Expand description
Agent Client Protocol wire types.
JSON-RPC 2.0 messages, newline-delimited, one compact message per line. Field names are camelCase and discriminator values are snake_case, per the spec.
Every type a client sends us is permissive on deserialize - unknown fields are
ignored and every optional field carries #[serde(default)] - because real
hosts differ in how much of the spec they populate. Gas City, for instance,
sends initialize with only protocolVersion and clientInfo and no
clientCapabilities at all.
Modules§
- error_
codes - Standard JSON-RPC 2.0 error codes.
Structs§
- Agent
Capabilities - Agent-side capabilities advertised at
initialize. - Agent
Info - An agent’s identity.
- Client
Capabilities - Client-side capabilities advertised at
initialize. - Content
Block - One block of prompt or message content.
- Embedded
Resource - A resource inlined into a prompt (the
embeddedContextcapability). - Initialize
Params - Params of the
initializerequest. - Initialize
Result - Result of the
initializerequest. - Json
RpcError - A JSON-RPC 2.0 error object.
- Json
RpcMessage - A JSON-RPC 2.0 message: request, response, or notification depending on which fields are set.
- Permission
Option - One choice offered in a permission request.
- Prompt
Capabilities - Prompt content kinds an agent accepts.
- Request
Permission Params - Params of an outbound
session/request_permissionrequest. - Request
Permission Result - Result of a
session/request_permissionrequest. - Session
Cancel Params - Params of the
session/cancelnotification. - Session
NewParams - Params of the
session/newrequest. - Session
NewResult - Result of the
session/newrequest. - Session
Prompt Params - Params of the
session/promptrequest. - Session
Prompt Result - Result of the
session/promptrequest. - Session
Update Params - Params of an outbound
session/updatenotification. - Tool
Call Ref - The tool call a permission request refers to.
Enums§
- Permission
Option Kind - What selecting a permission option means.
- Permission
Outcome - The user’s decision on a permission request.
- Session
Update - One
session/updatepayload, discriminated bysessionUpdate. - Stop
Reason - Why a prompt turn ended.
- Tool
Call Status - A tool call’s lifecycle status.
- Tool
Kind - The category of operation a tool performs.
Constants§
- MAX_
FRAME_ BYTES - The largest single JSON frame (one line) we will ever write.
- PROTOCOL_
VERSION - The protocol MAJOR version this crate speaks.