adk_server/lib.rs
1//! # adk-server
2#![allow(clippy::result_large_err)]
3//!
4//! HTTP server and A2A v1.0.0 protocol for ADK agents.
5//!
6//! ## Overview
7//!
8//! This crate provides HTTP infrastructure:
9//!
10//! - [`create_app`] - Create REST API server
11//! - [`create_app_with_a2a`] - Add A2A protocol support
12//! - [`RemoteA2aAgent`] - Connect to remote A2A agents
13//! - [`ServerConfig`] - Server configuration
14//!
15//! ## What's New in 0.6.0
16//!
17//! ### A2A v1.0.0 Protocol Compliance
18//!
19//! The `a2a::v1` module (behind the `a2a-v1` feature flag) implements the full A2A Protocol
20//! v1.0.0 specification with all 11 JSON-RPC operations:
21//!
22//! - RFC 3339 timestamps on all task status changes
23//! - Agent capabilities declaration via `build_v1_agent_card()`
24//! - Message ID idempotency for `SendMessage`/`SendStreamingMessage`
25//! - Push notification authentication (Bearer + `a2a-notification-token`)
26//! - INPUT_REQUIRED multi-turn resume flow
27//! - Input validation (parts, IDs, metadata size)
28//! - `Content-Type: application/a2a+json` on JSON-RPC responses
29//! - Task object as first SSE streaming event
30//! - Context-scoped task lookup for multi-turn conversations
31//! - Version negotiation via `A2A-Version` header
32//!
33//! Wire types powered by [`a2a-protocol-types`](https://crates.io/crates/a2a-protocol-types).
34//!
35//! ### Breaking Changes
36//!
37//! - `build_v1_agent_card()` now requires an `AgentCapabilities` parameter
38//! - `TaskStore` trait gains `find_task_by_context()` method
39//! - `PushNotificationSender` trait methods gain `config` parameter
40//! - `message_stream()` and `tasks_subscribe()` return `StreamResponse` instead of `TaskStatusUpdateEvent`
41//!
42//! ## Quick Start
43//!
44//! ```rust,no_run
45//! use adk_server::{create_app, ServerConfig};
46//! use std::sync::Arc;
47//!
48//! // let config = ServerConfig { ... };
49//! // let app = create_app(config);
50//! // let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await?;
51//! // axum::serve(listener, app).await?;
52//! ```
53//!
54//! ## A2A Protocol
55//!
56//! Expose agents via Agent-to-Agent protocol:
57//!
58//! - `GET /.well-known/agent-card.json` - Agent card with capabilities
59//! - `POST /jsonrpc` - JSON-RPC endpoint (all 11 v1 operations)
60//! - REST routes for all operations
61
62pub mod a2a;
63pub mod auth_bridge;
64pub mod config;
65pub mod rest;
66pub mod ui_protocol;
67pub mod ui_types;
68pub mod web_ui;
69
70pub use a2a::{
71 A2aClient, Executor, ExecutorConfig, RemoteA2aAgent, RemoteA2aAgentBuilder, RemoteA2aConfig,
72 build_agent_card, build_agent_skills,
73};
74pub use auth_bridge::{RequestContext, RequestContextError, RequestContextExtractor};
75pub use config::{SecurityConfig, ServerConfig};
76pub use rest::{
77 A2aController, RuntimeController, SessionController, create_app, create_app_with_a2a,
78 shutdown_signal,
79};