a2a_ao/lib.rs
1//! # a2a-ao
2//!
3//! Rust SDK for the Agent-to-Agent (A2A) protocol — the open standard for
4//! agent interoperability, governed by the Linux Foundation.
5//!
6//! A2A enables AI agents to discover each other, delegate tasks, and collaborate
7//! regardless of framework or platform.
8//!
9//! ## Architecture
10//!
11//! The A2A protocol has three layers:
12//!
13//! 1. **Canonical Data Model** — Protocol-agnostic type definitions (this crate's types)
14//! 2. **Abstract Operations** — Core operations like `SendMessage`, `GetTask`, etc.
15//! 3. **Protocol Bindings** — Wire-level: JSON-RPC 2.0, gRPC, HTTP+JSON
16//!
17//! ## Quick Start
18//!
19//! ```rust,no_run
20//! use a2a_ao::{A2AClient, AgentCard};
21//!
22//! #[tokio::main]
23//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
24//! // Discover a remote agent
25//! let card = AgentCard::discover("https://agent.example.com").await?;
26//! println!("Found: {}", card.name);
27//!
28//! // Create a client and send a message
29//! let client = A2AClient::new("https://agent.example.com");
30//! let response = client.send_message_text("Summarize Q4 report").await?;
31//! println!("Task state: {:?}", response.state);
32//! Ok(())
33//! }
34//! ```
35
36pub mod agent_card;
37pub mod artifact;
38pub mod client;
39pub mod error;
40pub mod message;
41pub mod notification;
42pub mod task;
43pub mod transport;
44
45// Re-export primary types
46pub use agent_card::{
47 AgentCapabilities, AgentCard, AgentProvider, AgentSkill, ContentType, SecurityScheme,
48};
49pub use artifact::Artifact;
50pub use client::{A2AClient, SendMessageRequest};
51pub use error::A2AError;
52pub use message::{DataPart, FilePart, Message, MessagePart, MessageRole};
53pub use notification::{PushNotificationConfig, PushNotificationEvent};
54pub use task::{Task, TaskEvent, TaskQueryParams, TaskState};
55pub use transport::jsonrpc::{JsonRpcError, JsonRpcRequest, JsonRpcResponse};
56pub use transport::sse::TaskEventStream;