Skip to main content

agent_client_protocol_schema/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! [![Agent Client Protocol](https://zed.dev/img/acp/banner-dark.webp)](https://agentclientprotocol.com/)
4//!
5//! # Agent Client Protocol Schema
6//!
7//! Strongly-typed Rust definitions of the Agent Client Protocol (ACP) wire
8//! format. ACP is a JSON-RPC based protocol that standardizes communication
9//! between code editors (IDEs, text-editors, etc.) and coding agents
10//! (programs that use generative AI to autonomously modify code).
11//!
12//! This crate is **only** the schema: the request, response, and
13//! notification types, plus serde plumbing and JSON Schema generation. For
14//! the runtime pieces (transport, connection setup, the `Agent` / `Client`
15//! traits, etc.) use the higher-level [`agent-client-protocol`] crate, which
16//! builds on top of these types.
17//!
18//! [`agent-client-protocol`]: https://crates.io/crates/agent-client-protocol
19//!
20//! ## What's in this crate
21//!
22//! - Wire-format types for every ACP method: request, response, and
23//!   notification structs grouped by which side handles them.
24//! - JSON-RPC envelope and routing types: [`JsonRpcMessage`],
25//!   [`rpc::JsonRpcBatch`], [`Request`], [`Response`], [`Notification`],
26//!   [`RequestId`], [`Error`].
27//! - Aggregated routing enums: [`AgentRequest`], [`AgentResponse`],
28//!   [`AgentNotification`], and the matching client-side trio used by SDK
29//!   crates to dispatch incoming JSON-RPC messages.
30//! - The `generate` binary that emits the published `schema.json`,
31//!   `meta.json`, and the accompanying mdx documentation consumed by the
32//!   protocol website and registry.
33//!
34//! ## Versioning
35//!
36//! The default surface re-exports the v1 (current stable) protocol types
37//! directly at the crate root, so most consumers can write
38//! `agent_client_protocol_schema::SessionId` (and so on) without thinking
39//! about versions.
40//!
41//! For the complete protocol specification and documentation, visit
42//! <https://agentclientprotocol.com>.
43
44pub mod rpc;
45mod serde_util;
46mod v1;
47#[cfg(feature = "unstable_protocol_v2")]
48pub mod v2;
49mod version;
50
51pub use serde_util::*;
52pub use v1::*;
53pub use version::*;