Skip to main content

rullama_a2a/
lib.rs

1#![deny(missing_docs)]
2//! # rullama-a2a
3//!
4//! Agent-to-Agent (A2A) protocol implementation with JSON-RPC, REST, and gRPC bindings.
5//!
6//! ## Features
7//!
8//! - `client` — HTTP client for JSON-RPC and REST (reqwest)
9//! - `server` — HTTP server for JSON-RPC and REST (hyper)
10//! - `native` — Both client and server (default)
11//! - `grpc` — gRPC types (prost + tonic)
12//! - `grpc-client` — gRPC client transport
13//! - `grpc-server` — gRPC server service
14//! - `full` — Everything
15
16/// The A2A protocol version this crate targets (merged with ACP under AAIF, Dec 2025).
17pub const A2A_PROTOCOL_VERSION: &str = "0.3";
18
19// Core types (always available)
20/// Agent card and capability types.
21pub mod agent_card;
22/// Type conversions between serde and proto types.
23pub mod convert;
24/// Error types and JSON-RPC error codes.
25pub mod error;
26/// JSON-RPC 2.0 envelopes and method constants.
27pub mod jsonrpc;
28/// Typed request parameter structs.
29pub mod params;
30/// Generated proto types (gRPC feature).
31pub mod proto;
32/// Push notification configuration types.
33pub mod push_notification;
34/// Streaming event types.
35pub mod streaming;
36/// Task lifecycle types: Task, TaskStatus, TaskState.
37pub mod task;
38/// Core message types: Message, Part, Artifact, Role.
39pub mod types;
40
41// Client (feature-gated)
42/// A2A client with transport selection.
43#[cfg(feature = "client")]
44pub mod client;
45
46// Server (feature-gated)
47/// A2A server serving all protocol bindings.
48#[cfg(feature = "server")]
49pub mod server;
50
51// Re-exports for convenience
52pub use agent_card::{
53    AgentCapabilities, AgentCard, AgentCardSignature, AgentExtension, AgentInterface,
54    AgentProvider, AgentSkill, ApiKeySecurityScheme, AuthorizationCodeOAuthFlow,
55    ClientCredentialsOAuthFlow, DeviceCodeOAuthFlow, HttpAuthSecurityScheme, ImplicitOAuthFlow,
56    MutualTlsSecurityScheme, OAuth2SecurityScheme, OAuthFlows, OpenIdConnectSecurityScheme,
57    PasswordOAuthFlow, SecurityRequirement, SecurityScheme,
58};
59pub use error::A2aError;
60pub use jsonrpc::{JsonRpcRequest, JsonRpcResponse, RequestId};
61pub use params::*;
62pub use push_notification::{AuthenticationInfo, TaskPushNotificationConfig};
63pub use streaming::{
64    SendMessageResponse, StreamResponse, TaskArtifactUpdateEvent, TaskStatusUpdateEvent,
65};
66pub use task::{Task, TaskState, TaskStatus};
67pub use types::{Artifact, Message, Part, Role};
68
69#[cfg(feature = "client")]
70pub use client::{A2aClient, Transport};
71
72#[cfg(feature = "server")]
73pub use server::{A2aHandler, A2aServer};