Skip to content

feat(a2a): add experimental A2A v1 protocol adapter - #7

Merged
SergeevDmitry merged 10 commits into
masterfrom
feature/a2a-adapter
Aug 30, 2026
Merged

feat(a2a): add experimental A2A v1 protocol adapter#7
SergeevDmitry merged 10 commits into
masterfrom
feature/a2a-adapter

Conversation

@Revinand

Copy link
Copy Markdown
Member

Summary

Add an experimental, opt-in adapter for the A2A v1.0.0 protocol.

The adapter publishes Agent Commerce resources as A2A skills and maps JSON-RPC SendMessage requests onto the existing canonical execution pipeline, including free and x402-paid resource flows.

What changed

  • Add A2A protocol configuration:
    • disabled by default
    • default mount path: /a2a
    • resources can opt in with expose: [a2a]
  • Publish an A2A Agent Card at /.well-known/agent-card.json
    • derives skills from exposed canonical resources
    • identifies free and paid skills
    • advertises the JSON-RPC endpoint and supported protocol version
  • Implement A2A v1 JSON-RPC transport:
    • supports SendMessage
    • requires the A2A-Version: 1.0 header
    • validates the structured resource invocation envelope
    • maps malformed and unsupported requests to standard JSON-RPC errors
  • Map canonical execution outcomes to terminal A2A tasks:
    • successful delivery → TASK_STATE_COMPLETED
    • payment required or domain failure → TASK_STATE_FAILED
    • x402 proofs use the existing reserved _payment input field
  • Extend the gateway adapter model with adapter-owned discovery routes
  • Add mount-path conflict validation and preserve per-adapter startup/request isolation
  • Expose A2A capabilities, status, and unsupported operations through gateway discovery and agent-commerce doctor
  • Document configuration, invocation, payment, result mapping, and limitations
  • Add unit, gateway integration, and official SDK-driven conformance coverage for discovery, free resources, paid resources, errors, and protocol negotiation

Supported scope

This initial implementation supports:

  • A2A specification v1.0.0
  • protocol negotiation version 1.0
  • JSON-RPC binding
  • Agent Card discovery
  • synchronous SendMessage
  • terminal task results
  • free and x402-paid canonical resources

Streaming, persistent or resumable tasks, push notifications, multi-turn continuation, extended Agent Cards, A2A authentication schemes, REST, and gRPC bindings are intentionally not implemented.

Compatibility

A2A remains disabled unless explicitly enabled, so existing configurations continue to work unchanged. The official @a2a-js/sdk dependency is used only for conformance testing and is not required at runtime.

@Revinand
Revinand requested a review from SergeevDmitry August 30, 2026 16:20
@Revinand Revinand linked an issue Aug 30, 2026 that may be closed by this pull request
@SergeevDmitry SergeevDmitry self-assigned this Aug 30, 2026
@SergeevDmitry
SergeevDmitry merged commit 74a1b35 into master Aug 30, 2026
6 checks passed
@SergeevDmitry
SergeevDmitry deleted the feature/a2a-adapter branch August 30, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature/Roadmap] Implement A2A (Agent2Agent) protocol support

2 participants