Skip to main content

Module bridge

Module bridge 

Source
Expand description

Bridge adapters (SPEC.md roadmap item 3): map ACL semantics to the protocols agents already speak — A2A task lifecycle and MCP tools.

A2A v1.0: Task states SUBMITTED, WORKING, INPUT_REQUIRED, COMPLETED, CANCELED, FAILED, REJECTED (spec: a2a-protocol.org). MCP: JSON-RPC 2.0 methods tools/list and tools/call.

Enums§

A2aState
A2A TaskState (subset used by the bridge).

Functions§

a2a_state_to_acl
Map an A2A task-state JSON object back to the ACL performative it implies.
a2a_task_to_acl
§13bis: full A2A task JSON -> ACL Envelope (the inverse of acl_to_a2a_task). Rebuilds the performative from the task state and the body from artifacts/metadata. None when the state is unknown.
acl_result_to_mcp
An ACL inform/Result → MCP tools/call result.
acl_to_a2a_state
Map an ACL (performative, body) pair to the A2A task state it represents. None = performative has no A2A equivalent (e.g. propose/hello).
acl_to_a2a_task
A2A-shaped task object (JSON, mirroring the A2A v1.0 Task structure).
card_has_capability
capability name lookup on a card (used when routing tools/call)
card_to_mcp_tools
AgentCard capabilities → MCP tools/list result.
mcp_call_to_acl_body
MCP tools/call params → an ACL request body (name = capability name).
validate_arguments
§13bis: validate an MCP call’s arguments against the card’s declared input schema — JSON-schema-lite: required fields must be present with non-null values, and type is checked when declared.