Skip to main content

Crate leviath_agent_client

Crate leviath_agent_client 

Source
Expand description

§Leviath Agent Client Protocol

Wire types and Leviath mappings for the Agent Client Protocol - the JSON-RPC 2.0 protocol agent hosts (Zed, Gas City, …) use to drive a headless agent over stdio.

§Naming

The bare acronym “ACP” is deliberately never used unqualified anywhere in this workspace: it is claimed by two unrelated protocols. This crate implements the Agent Client Protocol (JSON-RPC over stdio, the one implemented here). The Agent Communication Protocol (a REST + SSE API from the BeeAI project, since folded into A2A) is a different thing entirely and is not implemented anywhere in this workspace.

§Scope

This crate is deliberately pure: wire types plus total functions over them. It has no transport, no I/O, no async runtime, and no knowledge of the Leviath daemon. The stdio server that drives it lives in leviath-cli (commands::agent_client).

Framing is newline-delimited JSON: exactly one compact JSON message per line. See protocol::MAX_FRAME_BYTES for the size ceiling this implies.

Re-exports§

pub use mapping::flatten_prompt;
pub use mapping::is_permission_request;
pub use mapping::parse_region_markers;
pub use mapping::permission_request;
pub use mapping::stop_reason_for;
pub use mapping::stop_reason_for_label;
pub use protocol::AgentCapabilities;
pub use protocol::AgentInfo;
pub use protocol::ContentBlock;
pub use protocol::EmbeddedResource;
pub use protocol::InitializeParams;
pub use protocol::InitializeResult;
pub use protocol::JsonRpcError;
pub use protocol::JsonRpcMessage;
pub use protocol::MAX_FRAME_BYTES;
pub use protocol::PROTOCOL_VERSION;
pub use protocol::PermissionOutcome;
pub use protocol::PromptCapabilities;
pub use protocol::RequestPermissionResult;
pub use protocol::SessionCancelParams;
pub use protocol::SessionNewParams;
pub use protocol::SessionNewResult;
pub use protocol::SessionPromptParams;
pub use protocol::SessionPromptResult;
pub use protocol::SessionUpdate;
pub use protocol::SessionUpdateParams;
pub use protocol::StopReason;
pub use protocol::error_codes;

Modules§

mapping
Pure translations between Leviath’s own types and the Agent Client Protocol.
protocol
Agent Client Protocol wire types.