a2a_protocol_sdk/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Tom F.
3
4//! A2A protocol v1.0 — umbrella SDK crate.
5//!
6//! Re-exports all three constituent crates so users who want everything can
7//! depend on `a2a-sdk` alone.
8//!
9//! # Quick start
10//!
11//! Use the [`prelude`] module to pull in the most common types:
12//!
13//! ```rust
14//! use a2a_protocol_sdk::prelude::*;
15//! ```
16//!
17//! # Module overview
18//!
19//! | Module | Source crate | Contents |
20//! |---|---|---|
21//! | [`types`] | `a2a-types` | All A2A wire types |
22//! | [`client`] | `a2a-client` | HTTP client |
23//! | [`server`] | `a2a-server` | Server framework |
24//! | [`prelude`] | — | Convenience re-exports for common usage |
25
26#![deny(missing_docs)]
27#![deny(unsafe_op_in_unsafe_fn)]
28#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
29#![allow(clippy::module_name_repetitions)]
30
31/// All A2A protocol wire types.
32pub mod types {
33 #[allow(unused_imports)]
34 pub use a2a_protocol_types::*;
35}
36
37/// HTTP client for sending A2A requests.
38pub mod client {
39 #[allow(unused_imports)]
40 pub use a2a_protocol_client::*;
41}
42
43/// Server framework for implementing A2A agents.
44pub mod server {
45 #[allow(unused_imports)]
46 pub use a2a_protocol_server::*;
47}
48
49/// Convenience re-exports for common A2A usage patterns.
50///
51/// Import with `use a2a_protocol_sdk::prelude::*` to get the most frequently used
52/// types for building agents and clients:
53///
54/// - **Wire types**: `Task`, `TaskState`, `TaskStatus`, `Message`, `Part`,
55/// `MessageRole`, `Artifact`, `StreamResponse`, `AgentCard`, `AgentInterface`
56/// - **ID newtypes**: `TaskId`, `ContextId`, `MessageId`, `ArtifactId`
57/// - **Params**: `MessageSendParams`, `TaskQueryParams`, `ListTasksParams`
58/// - **Responses**: `SendMessageResponse`, `TaskListResponse`
59/// - **Client**: `A2aClient`, `ClientBuilder`, `EventStream`
60/// - **Server**: `AgentExecutor`, `RequestHandler`, `RequestHandlerBuilder`,
61/// `RequestContext`, `EventQueueWriter`, `JsonRpcDispatcher`, `RestDispatcher`
62/// - **Errors**: `A2aError`, `A2aResult`, `ClientError`, `ServerError`
63pub mod prelude {
64 // ── Wire types ───────────────────────────────────────────────────────
65 pub use a2a_protocol_types::{
66 AgentCapabilities, AgentCard, AgentInterface, AgentSkill, Artifact, ArtifactId, ContextId,
67 Message, MessageId, MessageRole, MessageSendParams, Part, SendMessageResponse,
68 StreamResponse, Task, TaskArtifactUpdateEvent, TaskId, TaskListResponse, TaskQueryParams,
69 TaskState, TaskStatus, TaskStatusUpdateEvent,
70 };
71
72 // ── Errors ───────────────────────────────────────────────────────────
73 pub use a2a_protocol_types::{A2aError, A2aResult};
74
75 // ── Client ───────────────────────────────────────────────────────────
76 pub use a2a_protocol_client::{
77 A2aClient, ClientBuilder, ClientError, ClientResult, EventStream,
78 };
79
80 // ── Server ───────────────────────────────────────────────────────────
81 pub use a2a_protocol_server::{
82 AgentExecutor, EventQueueWriter, JsonRpcDispatcher, RequestContext, RequestHandler,
83 RequestHandlerBuilder, RestDispatcher, ServerError, ServerResult,
84 };
85}