1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Agent2Agent (A2A) protocol client support.
//!
//! [A2A v1.0](https://a2a-protocol.org/v1.0.0/specification) is how one agent
//! hands work to another whose insides it cannot see: the remote agent
//! publishes an Agent Card describing itself, and accepts messages that start
//! or continue *tasks* — server-owned units of work with a lifecycle that ends
//! in a terminal state, or pauses when the agent needs input. It is the
//! neighbour of MCP rather than an overlap: MCP is an agent calling tools, A2A
//! is an agent calling another agent.
//!
//! This module is the client half, behind the default-off `a2a` feature:
//!
//! - [`A2aClient`](crate::a2a::A2aClient) fetches and validates an agent's card and speaks the
//! JSON-RPC binding — `SendMessage`, `GetTask`, `CancelTask` — over HTTP.
//! - [`A2aAgentTool`](crate::a2a::A2aAgentTool) bridges one connected agent into the tool roster as
//! `a2a__{agent}`, submitting a message and polling the task it starts until
//! it settles or the call's wait bound passes.
//!
//! # Scope
//!
//! One binding and one version: JSON-RPC at protocol 1.0, the only interface
//! [`A2aClient::connect`](crate::a2a::A2aClient::connect) will select from a card. Every request carries
//! `A2A-Version: 1.0`. The streaming methods, push notifications, the extended
//! card, and the REST and gRPC bindings are not implemented.
//!
//! # Architecture
//!
//! These links use absolute paths because the module's documentation is merged
//! with the outer comment on its `pub mod` declaration, which resolves relative
//! links against the crate root rather than this module.
//!
//! - [`config`](crate::a2a::config) — [`A2aAgentConfig`](crate::a2a::A2aAgentConfig), how its URL names
//! the card, and the limits a host tunes
//! - [`client`](crate::a2a::client) — the JSON-RPC client for one agent
//! - [`error`](crate::a2a::error) — [`A2aError`](crate::a2a::A2aError) and the A2A JSON-RPC codes
//! - [`tool`](crate::a2a::tool) — [`A2aAgentTool`](crate::a2a::A2aAgentTool), the call contract and
//! what a reply looks like to the model
//! - [`name`](crate::a2a::name) — the `a2a__{agent}` tool name and the rule
//! an agent's name must pass
//! - [`types`](crate::a2a::types) — the A2A wire types, re-exported from the
//! official `a2a-lf` crate so a caller needs no direct dependency on it
pub
/// The A2A v1.0 wire types: the official `a2a-lf` crate, re-exported.
///
/// [`A2aClient`] takes and returns these directly, so a caller building a
/// [`Message`](types::Message) or reading a [`Task`](types::Task) uses the
/// same version of them that this crate was built against.
pub use a2a_lf as types;
pub use ;
pub use ;
pub use ;
pub use ;
pub use A2aAgentTool;