Skip to main content

Crate a2a_protocol_server

Crate a2a_protocol_server 

Source
Expand description

A2A protocol v1.0 — server framework.

Provides RequestHandler and AgentExecutor for implementing A2A agents over HTTP/1.1 and HTTP/2 using hyper 1.x.

§Quick start

  1. Implement AgentExecutor with your agent logic.
  2. Build a RequestHandler via RequestHandlerBuilder.
  3. Wire JsonRpcDispatcher or RestDispatcher into your hyper server.

§Module overview

§Transport limitations

The A2A specification lists gRPC as an optional transport binding. This implementation currently supports HTTP + SSE only; gRPC transport is not yet implemented.

§Rate limiting

This library does not perform request rate limiting. Deployments that require rate limiting should handle it in a reverse proxy (e.g. nginx, Envoy) or a middleware layer in front of the A2A handler.

Re-exports§

pub use agent_card::AgentCardProducer;
pub use agent_card::DynamicAgentCardHandler;
pub use agent_card::StaticAgentCardHandler;
pub use agent_card::CORS_ALLOW_ALL;
pub use builder::RequestHandlerBuilder;
pub use call_context::CallContext;
pub use dispatch::CorsConfig;
pub use dispatch::JsonRpcDispatcher;
pub use dispatch::RestDispatcher;
pub use error::ServerError;
pub use error::ServerResult;
pub use executor::AgentExecutor;
pub use handler::RequestHandler;
pub use handler::SendMessageResult;
pub use interceptor::ServerInterceptor;
pub use interceptor::ServerInterceptorChain;
pub use push::HttpPushSender;
pub use push::InMemoryPushConfigStore;
pub use push::PushConfigStore;
pub use push::PushSender;
pub use request_context::RequestContext;
pub use store::InMemoryTaskStore;
pub use store::TaskStore;
pub use store::TaskStoreConfig;
pub use streaming::EventQueueManager;
pub use streaming::EventQueueReader;
pub use streaming::EventQueueWriter;
pub use streaming::InMemoryQueueReader;
pub use streaming::InMemoryQueueWriter;

Modules§

agent_card
Agent card HTTP handlers (static, dynamic, and caching utilities).
builder
Builder for RequestHandler.
call_context
Call context for server-side interceptors.
dispatch
HTTP dispatch layer — JSON-RPC and REST routing.
error
Server-specific error types.
executor
Agent executor trait.
handler
Core request handler — protocol logic layer.
interceptor
Server-side interceptor chain.
metrics
Metrics hooks for observing handler activity.
push
Push notification configuration storage and delivery.
request_context
Request context passed to the AgentExecutor.
store
Task storage backend.
streaming
Streaming infrastructure for SSE responses and event queues.