Skip to content

feat(a2a): baqueano-a2a client with A2A v1.0 and v0.3 negotiation - #36

Merged
pingedbrain merged 1 commit into
mainfrom
feat/a2a-client
Nov 29, 2026
Merged

pingedbrain merged 1 commit into
mainfrom
feat/a2a-client

Conversation

@pingedbrain

Copy link
Copy Markdown
Owner

Second v0.2 deliverable: the A2A client that module scripts call, as fixed by the module contract.

baqueano-a2a send --agent URL --input FILE --output FILE [--timeout SECS=60]

  • New crate crates/baqueano-a2a (lib + bin), hand-written serde types over the workspace reqwest; no A2A SDK, no new workspace dependencies.
  • Polls /.well-known/agent-card.json until HTTP 200, then negotiates: a v1.0 JSON-RPC interface first, then a v0.3 one (in supportedInterfaces or the v0.3 top-level url/additionalInterfaces). Relative interface URLs resolve against the agent base.
  • v1.0: SendMessage/GetTask, A2A-Version: 1.0, ROLE_USER, {data, mediaType} parts, TASK_STATE_*. v0.3: message/send (blocking: true)/tasks/get, kind discriminators, kebab-case states. Shapes checked against the v1.0 proto, the v0.3 JSON schema and the official Rust SDK.
  • Writes the first JSON-object data part of the artifacts (or of a direct Message reply) atomically, mode 0644; nothing is written on failure.
  • One deadline for card polling, send and task polling (--timeout 1..=86400); bodies capped at 8 MiB, --input capped at 8 MiB; no URLs with credentials or raw bodies in errors. Exit 0 ok, 1 runtime failure, 2 usage.
  • Tests: unit tests, plus in-process axum v1.0 and v0.3 servers on 127.0.0.1 for library and binary round trips and failure cases (timeouts, JSON-RPC errors on non-2xx, failed/canceled/rejected/input-required tasks, no JSON artifact).
  • Publishable at the workspace version; release spec now covers every publishable crate. ROADMAP item checked.

Note for the next release: crates.io Trusted Publishing cannot create a new crate, so the first baqueano-a2a publish needs a one-time bootstrap token, then a trusted publisher.

AI use: implemented with an AI coding assistant under maintainer direction; reviewed (spec verify plus an independent bug review) before merge.

New crate with a library and the baqueano-a2a binary. It polls the agent
card, negotiates A2A v1.0 (JSON-RPC, preferred) or v0.3, sends one JSON
data part, waits for a terminal task state and writes the first
JSON-object data part atomically to --output. One overall deadline,
bounded reads, no credentials in errors. Round trips are tested against
in-process v1.0 and v0.3 servers.
@pingedbrain
pingedbrain merged commit 0528d04 into main Nov 29, 2026
7 checks passed
@pingedbrain
pingedbrain deleted the feat/a2a-client branch November 29, 2026 04:13
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.

1 participant