Skip to main content

Module protocol

Module protocol 

Source
Expand description

ACP v1 protocol types — pure data re-exports from agent-client-protocol-schema.

This module is a thin re-export layer. All wire types come from the upstream agent-client-protocol-schema crate (fixed version). No runtime dependencies, no async, no I/O — just serde-backed structs and enums.

Covers the full ACP v1 spec: initialize, session lifecycle, prompt turns, tool calls, permissions, content blocks, capabilities, and protocol-level notifications.

See: https://agentclientprotocol.com/protocol/v1/

Structs§

AgentAuthCapabilities
Agent auth capabilities. Authentication-related capabilities supported by the agent.
AgentCapabilities
Capabilities declared by the agent. Capabilities supported by the agent.
AgentMethodNames
Agent method names. Names of all methods that agents handle.
Annotations
Annotations attached to content blocks. Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
AudioContent
Audio content. Audio provided to or from an LLM.
AuthMethodAgent
Agent-side auth method. Agent handles authentication itself.
AuthMethodId
An auth method ID. Typed identifier used for auth method values on the wire.
AuthenticateRequest
authenticate request from client to agent. Request parameters for the authenticate method.
AuthenticateResponse
authenticate response from agent to client. Response to the authenticate method.
AvailableCommand
Available command. Information about a command.
AvailableCommandsUpdate
An available commands update. Available commands are ready or have changed
BlobResourceContents
Binary resource contents. Binary resource contents.
BooleanConfigOptionCapabilities
Boolean config option capabilities. Capabilities for boolean session configuration options.
CancelNotification
notifications/cancel notification. Notification to cancel ongoing operations for a session.
CancelRequestNotification
notifications/cancelled protocol-level notification. Notification to cancel an ongoing request.
ClientCapabilities
Capabilities declared by the client. Capabilities supported by the client.
ClientMethodNames
Client method names. Names of all methods that clients handle.
ClientSessionCapabilities
Client-specific session capabilities. Session-related capabilities supported by the client.
CloseSessionRequest
session/close request from client to agent. Request parameters for closing an active session.
CloseSessionResponse
session/close response from agent to client. Response from closing a session.
ConfigOptionUpdate
A config option update. Session configuration options have been updated.
ContentChunk
A chunk of streamed content. A streamed item of content
Cost
Cost information for a turn. Cost information for a session.
CurrentModeUpdate
A current mode update. The current mode of the session has changed
DeleteSessionRequest
session/delete request from client to agent. Request parameters for deleting an existing session from session/list.
DeleteSessionResponse
session/delete response from agent to client. Response from deleting a session.
Diff
A diff representing file modifications. A diff representing file modifications.
EmbeddedResource
An embedded resource with full content. The contents of a resource, embedded into a prompt or tool call result.
EnvVariable
An environment variable definition. An environment variable to set when launching an MCP server.
Error
An ACP protocol error. JSON-RPC error object.
ExtNotification
Extension notification. Allows the Agent to send an arbitrary notification that is not part of the ACP spec. Extension notifications provide a way to send one-way messages for custom functionality while maintaining protocol compatibility.
ExtRequest
Extension request. Allows for sending an arbitrary request that is not part of the ACP spec. Extension methods provide a way to add custom functionality while maintaining protocol compatibility.
ExtResponse
Extension response. Allows for sending an arbitrary response to an ExtRequest that is not part of the ACP spec. Extension methods provide a way to add custom functionality while maintaining protocol compatibility.
FileSystemCapabilities
File-system capabilities. File system capabilities that a client may support.
GeneralMethodNames
General method names. Names of all methods that agents handle.
HttpHeader
An HTTP header definition. An HTTP header to set when making requests to the MCP server.
ImageContent
Base64-encoded image content. An image provided to or from an LLM.
Implementation
Information about an implementation (name, version). Metadata about the implementation of the client or agent. Describes the name and version of an ACP implementation, with an optional title for UI representation.
InitializeRequest
initialize request from client to agent. Request parameters for the initialize method.
InitializeResponse
initialize response from agent to client. Response to the initialize method.
ListSessionsRequest
session/list request from client to agent. Request parameters for listing existing sessions.
ListSessionsResponse
session/list response from agent to client. Response from listing sessions.
LoadSessionRequest
session/load request from client to agent. Request parameters for loading an existing session.
LoadSessionResponse
session/load response from agent to client. Response from loading an existing session.
LogoutCapabilities
Logout capabilities. Logout capabilities supported by the agent.
LogoutRequest
logout request from client to agent. Request parameters for the logout method.
LogoutResponse
logout response from agent to client. Response to the logout method.
McpCapabilities
MCP-related capabilities. MCP capabilities supported by the agent
McpServerHttp
HTTP-based MCP server config. HTTP transport configuration for MCP.
McpServerSse
SSE-based MCP server config. SSE transport configuration for MCP.
McpServerStdio
Stdio-based MCP server config. Stdio transport configuration for MCP.
MessageId
A message identifier. Unique identifier for a message within a session.
NewSessionRequest
session/new request from client to agent. Request parameters for creating a new session.
NewSessionResponse
session/new response from agent to client. Response from creating a new session.
PermissionOption
A permission option presented to the user. An option presented to the user when requesting permission.
PermissionOptionId
A permission option ID. Unique identifier for a permission option.
Plan
A plan for execution. An execution plan for accomplishing complex tasks.
PlanEntry
An entry in a plan. A single entry in the execution plan.
PromptCapabilities
Prompt-related capabilities. Prompt capabilities supported by the agent in session/prompt requests.
PromptRequest
session/prompt request from client to agent. Request parameters for sending a user prompt to the agent.
PromptResponse
session/prompt response from agent to client. Response from processing a user prompt.
ProtocolVersion
Protocol version identifier (v0, v1, v2). Protocol version identifier.
RequestPermissionRequest
A permission request to the client. Request for user permission to execute a tool call.
RequestPermissionResponse
The client’s response to a permission request. Response to a permission request.
ResourceLink
A link to an external resource. A resource that the server is capable of reading, included in a prompt or tool call result.
ResumeSessionRequest
session/resume request from client to agent. Request parameters for resuming an existing session.
ResumeSessionResponse
session/resume response from agent to client. Response from resuming an existing session.
SelectedPermissionOutcome
The outcome selected by the user. The user selected one of the provided options.
SessionAdditionalDirectoriesCapabilities
Session additional directories capabilities. Capabilities for additional session directories support.
SessionCapabilities
Capabilities for a specific session. Session capabilities supported by the agent.
SessionCloseCapabilities
Session close capabilities. Capabilities for the session/close method.
SessionConfigBoolean
A boolean config option. A boolean on/off toggle session configuration option payload.
SessionConfigGroupId
A config group ID. Unique identifier for a session configuration option value group.
SessionConfigId
A config ID. Unique identifier for a session configuration option.
SessionConfigOption
A config option for a session. A session configuration option selector and its current state.
SessionConfigOptionsCapabilities
Session config options capabilities. Session configuration option capabilities supported by the client.
SessionConfigSelect
A select config option. A single-value selector (dropdown) session configuration option payload.
SessionConfigSelectGroup
A select config group. A group of possible values for a session configuration option.
SessionConfigSelectOption
A select config option item. A possible value for a session configuration option.
SessionConfigValueId
A config value ID. Unique identifier for a session configuration option value.
SessionDeleteCapabilities
Session delete capabilities. Capabilities for the session/delete method.
SessionId
A session identifier. A unique identifier for a conversation session between a client and agent.
SessionInfo
Information about a session. Information about a session returned by session/list
SessionInfoUpdate
A session info update. Update to session metadata. All fields are optional to support partial updates.
SessionListCapabilities
Session list capabilities. Capabilities for the session/list method.
SessionMode
A session mode. A mode the agent can operate in.
SessionModeId
A session mode identifier. Unique identifier for a Session Mode.
SessionModeState
Current mode state. The set of modes and the one currently active.
SessionNotification
Session-scoped notification from agent to client. Notification containing a session update from the agent.
SessionResumeCapabilities
Session resume capabilities. Capabilities for the session/resume method.
SetSessionConfigOptionRequest
session/setConfigOption request from client to agent. Request parameters for setting a session configuration option.
SetSessionConfigOptionResponse
session/setConfigOption response from agent to client. Response to session/set_config_option method.
SetSessionModeRequest
session/setMode request from client to agent. Request parameters for setting a session mode.
SetSessionModeResponse
session/setMode response from agent to client. Response to session/set_mode method.
TerminalExitStatus
Terminal exit status. Exit status of a terminal command.
TerminalId
A terminal identifier. Typed identifier used for terminal values on the wire.
TextContent
Plain text content. Text provided to or from an LLM.
TextResourceContents
Text resource contents. Text-based resource contents.
ToolCall
A tool call the agent is requested to make. Represents a tool call that the language model has requested.
ToolCallId
Unique identifier for a tool call within a session. Unique identifier for a tool call within a session.
ToolCallLocation
A file location accessed or modified by a tool. A file location being accessed or modified by a tool.
ToolCallUpdate
An update to an existing tool call (status, content, etc.). An update to an existing tool call.
ToolCallUpdateFields
Fields that can be updated in a tool call update. Optional fields that can be updated in a tool call.
UnstructuredCommandInput
Unstructured command input. All text that was typed after the command name is provided as input.
UsageUpdate
A usage update during a session. Context window and cost update for a session.

Enums§

AgentNotification
Notification sent by the agent. All possible notifications that an agent can send to a client.
AgentRequest
All requests an agent can receive. All possible requests that an agent can send to a client.
AgentResponse
All responses an agent can send. All possible responses that an agent can send to a client.
AuthMethod
An authentication method. Describes an available authentication method.
AvailableCommandInput
Input type for an available command. The input specification for a command.
ClientNotification
Notification sent by the client. All possible notifications that a client can send to an agent.
ClientRequest
All requests a client can receive. All possible requests that a client can send to an agent.
ClientResponse
All responses a client can send. All possible responses that a client can send to an agent.
ContentBlock
A block of content (text, image, audio, resource). Content blocks represent displayable information in the Agent Client Protocol.
EmbeddedResourceResource
Embedded resource variants. Resource content that can be embedded in a message.
ErrorCode
ACP error codes. Predefined error codes for common JSON-RPC and ACP-specific errors.
McpServer
An MCP server configuration. Configuration for connecting to an MCP (Model Context Protocol) server.
PermissionOptionKind
The kind of permission option. The type of permission option being presented to the user.
PlanEntryPriority
The priority of a plan entry. Priority levels for plan entries.
PlanEntryStatus
The status of a plan entry. Status of a plan entry in the execution flow.
ProtocolLevelNotification
Protocol-level notification enum (cancel, etc.). General protocol-level notifications that all sides are expected to implement.
RequestPermissionOutcome
The outcome the client selected for a permission request. The outcome of a permission request.
Role
The role of a message (user / agent). The sender or recipient of messages and data in a conversation.
SessionConfigKind
A config option kind. Type-specific session configuration option payload.
SessionConfigOptionCategory
Config option category. Semantic category for a session configuration option.
SessionConfigOptionValue
A config option value. The value to set for a session configuration option.
SessionConfigSelectOptions
Select options grouping. Possible values for a session configuration option.
SessionUpdate
Types of updates that can be sent during session processing. Different types of updates that can be sent during session processing.
StopReason
Reason the agent stopped a turn. Reasons why an agent stops processing a prompt turn.
ToolCallContent
Content produced by a tool call (content block / diff / terminal). Content produced by a tool call.
ToolCallStatus
Execution status of a tool call. Execution status of a tool call.

Type Aliases§

Meta
Arbitrary metadata (opaque JSON object). Value attached to a given ACP type on the _meta field.
Response
A JSON-RPC response envelope. JSON-RPC response envelope using this protocol version’s error type.