Add JSON-RPC 2.0 endpoint at POST /a2a with three methods: - message.send: validates target agent, creates tracked task, delivers DM - tasks.get: returns task state, auto-completes when target agent replies - tasks.cancel: transitions non-terminal tasks to CANCELED Includes SQLite migration (010_a2a_tasks), task store, gateway with interface-based dependencies, and 9 tests covering happy paths and error cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
15 lines
599 B
SQL
15 lines
599 B
SQL
-- A2A inbound gateway: task tracking for external A2A agents sending tasks to SynapBus agents.
|
|
CREATE TABLE IF NOT EXISTS a2a_tasks (
|
|
id TEXT PRIMARY KEY,
|
|
context_id TEXT NOT NULL,
|
|
target_agent TEXT NOT NULL,
|
|
source_agent TEXT DEFAULT '',
|
|
conversation_id INTEGER,
|
|
state TEXT NOT NULL DEFAULT 'SUBMITTED',
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_a2a_tasks_target ON a2a_tasks(target_agent);
|
|
CREATE INDEX IF NOT EXISTS idx_a2a_tasks_state ON a2a_tasks(state);
|