Skip to main content

Crate cacp_proto

Crate cacp_proto 

Source
Expand description

ACP v1 wire types, method names, and the protocol error.

Data only — no runtime, no I/O. Depend on this alone if you just need to read or write ACP JSON.

Modules§

method
Every method name in ACP v1, in one place.

Structs§

AcceptNesNotification
AgentAuthCapabilities
AgentCapabilities
Annotations
Boxed wherever it is held: four fields almost nothing sets, which inline would widen every content block a turn streams.
AudioContent
AuthMethodAgent
The agent signs in on its own — an API key already in its environment, or an OAuth flow it opens a browser for.
AuthMethodId
Identifies an authentication method the agent offers.
AuthMethodTerminal
The client runs a terminal for the user to sign in interactively.
AuthenticateRequest
AuthenticateResponse
AvailableCommand
A slash command the agent offers for this session.
AvailableCommandInput
AvailableCommandsUpdate
BlobResourceContents
BooleanPropertySchema
CancelNotification
A notification, not a request: the agent still ends the turn by answering session/prompt with StopReason::Cancelled.
CancelRequestNotification
Cancels a single in-flight request, in either direction — unlike CancelNotification, which cancels a whole turn.
Capability
An empty object whose presence is itself the capability flag.
ClientAuthCapabilities
Which AuthMethod variants the agent may offer. A client that cannot run a terminal must not be handed AuthMethod::Terminal.
ClientCapabilities
ClientNesCapabilities
Which suggestion kinds the client can actually apply. An agent must not send a kind the client did not advertise.
ClientSessionCapabilities
CloseNesRequest
CloseNesResponse
CloseSessionRequest
CloseSessionResponse
CompleteElicitationNotification
Tells the client a URL-mode elicitation finished out of band.
ConfigOptionUpdate
ConnectMcpRequest
Open a connection to a server named in an McpServerAcp entry.
ConnectMcpResponse
ContentChunk
Cost
CreateElicitationRequest
CreateElicitationResponse
CreateTerminalRequest
CreateTerminalResponse
CurrentModeUpdate
DeleteSessionRequest
DeleteSessionResponse
DidChangeDocumentNotification
DidCloseDocumentNotification
DidFocusDocumentNotification
DidOpenDocumentNotification
DidSaveDocumentNotification
Diff
A proposed edit, rendered by the client as a diff.
DisableProviderRequest
DisableProviderResponse
DisconnectMcpRequest
DisconnectMcpResponse
ElicitationAcceptAction
ElicitationCapabilities
ElicitationFormCapabilities
ElicitationFormMode
ElicitationId
Identifies an in-flight elicitation.
ElicitationRequestScope
ElicitationSchema
The JSON-Schema subset a form elicitation may describe.
ElicitationSessionScope
ElicitationUrlCapabilities
ElicitationUrlMode
EmbeddedResource
EnumOption
EnvVariable
Error
A JSON-RPC error, as it appears on the wire.
FileSystemCapabilities
ForkSessionRequest
Branch a session: the fork starts with the original’s history and then diverges from it. The original is untouched.
ForkSessionResponse
Carries the new session’s id — the fork, not the original.
HttpHeader
ImageContent
Implementation
Name and version of the program on either end.
InitializeRequest
InitializeResponse
IntegerPropertySchema
KillTerminalRequest
KillTerminalResponse
ListProvidersRequest
ListProvidersResponse
ListSessionsRequest
ListSessionsResponse
LoadSessionRequest
LoadSessionResponse
LogoutRequest
LogoutResponse
McpCapabilities
McpConnectionId
Identifies one live MCP-over-ACP connection the client holds.
McpServerAcp
McpServerAcpId
Names an MCP server the agent reaches through the client.
McpServerHttp
McpServerSse
McpServerStdio
MessageId
Groups content chunks belonging to the same assistant message.
MessageMcpNotification
The same tunnel as MessageMcpRequest, for MCP messages that expect no reply.
MessageMcpRequest
One MCP call forwarded down the tunnel. Sent by whichever side has something to ask: the agent invoking a tool, or the client relaying what the MCP server sent back at it.
MessageMcpResponse
The MCP server’s reply, passed through untouched.
MultiSelectPropertySchema
NesCapabilities
What the agent wants: which document events to receive, and which kinds of context to be given with each request.
NesContextCapabilities
NesCountCapability
A context kind the agent wants, capped at however many entries it can use.
NesDiagnostic
NesDidChangeCapabilities
NesDocumentEventCapabilities
NesEditHistoryEntry
NesEditSuggestion
NesEventCapabilities
NesExcerpt
NesJumpSuggestion
Move the cursor somewhere else — the next edit belongs in another place, not in different text here.
NesOpenFile
NesRecentFile
NesRelatedSnippet
NesRenameSuggestion
NesRepository
NesSearchAndReplaceSuggestion
NesSuggestContext
Only the kinds the agent asked for in NesContextCapabilities.
NesSuggestionId
Identifies one suggestion within a next-edit response.
NesTextEdit
NesUserAction
NewSessionRequest
NewSessionResponse
NumberPropertySchema
OtherContentBlock
OtherElicitationAction
OtherElicitationMode
OtherNesSuggestion
OtherPlanUpdateContent
OtherPropertySchema
A property or item shape this revision doesn’t model, kept verbatim.
OtherSessionUpdate
OtherToolCallContent
PermissionOption
PermissionOptionId
Identifies one choice offered in a permission request.
Plan
Replaces the client’s view of the plan wholesale on every report.
PlanEntry
PlanFile
PlanId
Identifies one of the agent’s plans within a session.
PlanItems
PlanMarkdown
PlanRemoved
The agent dropped a plan it had reported with PlanUpdate.
PlanUpdate
Addresses one plan by id, so an agent can keep several alive at once — unlike Plan, which is the whole picture every time.
Position
Zero-based, with character counted in the negotiated PositionEncodingKind.
PromptCapabilities
PromptRequest
PromptResponse
ProtocolVersion
The protocol revision. This crate speaks ProtocolVersion::V1.
ProviderCurrentConfig
What the provider is pointed at right now.
ProviderId
Identifies an LLM provider the agent can be pointed at.
ProviderInfo
Range
ReadTextFileRequest
ReadTextFileResponse
RejectNesNotification
ReleaseTerminalRequest
ReleaseTerminalResponse
RequestPermissionRequest
RequestPermissionResponse
Wraps RequestPermissionOutcome because a JSON-RPC result must be an object.
ResourceLink
A pointer to a resource the agent may fetch, rather than its contents.
ResumeSessionRequest
ResumeSessionResponse
SessionCapabilities
SessionConfigBoolean
SessionConfigGroupId
Groups related config option values.
SessionConfigId
Identifies a per-session configuration option.
SessionConfigOption
SessionConfigOptionsCapabilities
SessionConfigSelect
SessionConfigSelectGroup
SessionConfigSelectOption
SessionConfigValueId
Identifies one selectable value of a config option.
SessionId
Identifies a conversation with an agent.
SessionInfo
SessionInfoUpdate
SessionMode
SessionModeId
Identifies one of the agent’s operating modes.
SessionModeState
SessionNotification
SetProviderRequest
SetProviderResponse
SetSessionConfigOptionRequest
SetSessionConfigOptionResponse
SetSessionModeRequest
SetSessionModeResponse
StartNesRequest
StartNesResponse
StringMultiSelectItems
StringPropertySchema
SuggestNesRequest
SuggestNesResponse
TerminalExitStatus
TerminalId
Identifies a terminal the client runs on the agent’s behalf.
TerminalOutputRequest
TerminalOutputResponse
TextContent
TextDocumentContentChangeEvent
A range of None means text replaces the whole document — that is the TextDocumentSyncKind::Full shape.
TextResourceContents
TitledMultiSelectItems
ToolCall
A tool invocation the agent is reporting to the client.
ToolCallId
Identifies one tool invocation within a session.
ToolCallLocation
A file the tool call touches, so the client can follow along.
ToolCallUpdate
A partial update to an in-flight tool call; absent fields are unchanged.
ToolCallUpdateFields
Usage
Tokens the whole turn cost. Distinct from UsageUpdate, which tracks the context window as the turn runs.
UsageUpdate
Context-window consumption for the session so far.
WaitForTerminalExitRequest
WaitForTerminalExitResponse
WorkspaceFolder
WriteTextFileRequest
WriteTextFileResponse

Enums§

AuthMethod
A way to sign in. Agent is the untagged fallback: methods that predate the type tag still arrive without one, and they mean “the agent handles this itself”.
ContentBlock
A single piece of content in a prompt or a message.
ElicitationAction
ElicitationContentValue
ElicitationMode
Other preserves a mode this revision doesn’t know, so it can be declined rather than failing to parse.
ElicitationPropertySchema
ElicitationSchemaType
ElicitationScope
What the elicitation belongs to: a session, or a single in-flight request.
EmbeddedResourceResource
Untagged: text resources carry text, blob resources carry blob.
LlmProtocol
The API dialect an endpoint speaks. Other is the untagged fallback, so a dialect added later deserializes as itself instead of failing.
MaybeUndefined
Distinguishes “field absent” from “field explicitly null”.
McpServer
Stdio is the untagged fallback: those entries predate the type tag and still arrive without one.
MultiSelectItems
NesDiagnosticSeverity
NesRejectReason
Ignored means the user simply kept typing; Replaced means a newer suggestion superseded this one.
NesSuggestion
What the agent thinks should happen next. The client applies at most one, then says which with AcceptNesNotification.
NesTriggerKind
Why the client is asking now.
PermissionOptionKind
PlanEntryPriority
PlanEntryStatus
PlanUpdateContent
How the plan is carried: as structured entries, as a file the client renders, or as markdown.
PositionEncodingKind
How the client counts columns in a Position.
RequestId
A JSON-RPC request id. Any shape is legal; peers echo back whatever they were sent. Null is the id of an error about a frame too malformed to have one.
RequestPermissionOutcome
Role
SessionConfigKind
SessionConfigOptionCategory
Other keeps a category added by a newer agent from failing the parse.
SessionConfigOptionValue
Untagged ValueId is the legacy shape: a bare value with no type.
SessionConfigSelectOptions
SessionUpdate
StopReason
Why the agent stopped working on a turn.
StringFormat
TextDocumentSyncKind
Whether DidChangeDocumentNotification carries the whole document or just the ranges that changed.
ToolCallContent
ToolCallStatus
ToolKind
What a tool does, so the client can pick an icon and a phrasing.

Constants§

AUTH_REQUIRED
The agent needs authenticate before it can serve this.
INTERNAL_ERROR
The handler failed.
INVALID_PARAMS
Params did not match the method’s schema.
INVALID_REQUEST
Not a valid request object.
METHOD_NOT_FOUND
The method is not implemented by this side.
PARSE_ERROR
Malformed JSON.
REQUEST_CANCELLED
The request was cancelled before it completed.
RESOURCE_NOT_FOUND
The requested resource does not exist.

Type Aliases§

Meta
Whatever either side wants to attach to a message, under _meta.
Result
Every fallible operation in this crate reports a wire-shaped error.