Skip to content

v2

Class info

Re-exported classes

Class Module Description
AcceptElicitationResponse aclientp.schema.v2.elicitation The user accepted and provided content.
AddDiffChange aclientp.schema.v2.tool_calls A file was added.
AgentAuthCapabilities aclientp.schema.v2.capabilities Authentication-related extension capabilities supported by the agent.
AgentCapabilities aclientp.schema.v2.capabilities Capabilities supported by the agent.
AgentMessage aclientp.schema.v2.messages An agent message upsert, in addition to or instead of streamed chunks.
AgentMessageChunk aclientp.schema.v2.messages A chunk of the agent's response being streamed.
AgentMessageCursorAnchor aclientp.schema.v2.cursors UNSTABLE: The cursor is next to an agent message.
AgentNotification aclientp.schema.v2.protocol A notification the agent sends to the client.
AgentRequest aclientp.schema.v2.protocol A request the agent sends to the client (a :data:ClientMethod).
AgentThought aclientp.schema.v2.messages An agent thought (reasoning) message upsert.
AgentThoughtChunk aclientp.schema.v2.messages A chunk of the agent's internal reasoning being streamed.
AgentThoughtCursorAnchor aclientp.schema.v2.cursors UNSTABLE: The cursor is next to an agent thought.
AnnotatedObject aclientp.schema.v2.base A v2 object with the _meta extension point.
Annotations aclientp.schema.v2.common Hints for the client on how an object is used or displayed.
ArchiveSessionRequest aclientp.schema.v2.sessions UNSTABLE: Request parameters for archiving a session.
ArchiveSessionResponse aclientp.schema.v2.sessions UNSTABLE: Response from archiving a session.
AudioContent aclientp.schema.v2.content Audio provided to or from an LLM. Requires the audio prompt capability.
AuthAccount aclientp.schema.v2.auth UNSTABLE: An account or credential the agent has configured.
AuthMethodAgent aclientp.schema.v2.auth Agent handles authentication itself through auth/login.
AuthMethodTerminal aclientp.schema.v2.auth Terminal-based authentication method.
AuthStatusCapabilities aclientp.schema.v2.capabilities UNSTABLE: Auth status capabilities supported by the agent.
AuthStatusRequest aclientp.schema.v2.auth UNSTABLE: Request parameters for the auth/status method.
AuthStatusResponse aclientp.schema.v2.auth UNSTABLE: Response to the auth/status method.
AuthStatusUpdateNotification aclientp.schema.v2.auth UNSTABLE: Notification sent by the agent when its authentication status changes.
AvailableCommandsUpdate aclientp.schema.v2.session_updates The available commands are ready or have changed.
BackgroundSubagent aclientp.schema.v2.prompt A detached subagent session that has anything running.
BackgroundTerminal aclientp.schema.v2.prompt A process that keeps running after its tool call returned control to the model.
BackgroundToolCall aclientp.schema.v2.prompt Work of a tool call that continues without a process of its own, e.g. a watcher.
BlobResourceContents aclientp.schema.v2.content Binary contents of a resource.
BooleanPropertySchema aclientp.schema.v2.elicitation Schema for boolean properties in an elicitation form.
BooleanSessionConfigOption aclientp.schema.v2.config_options An on/off toggle.
CancelElicitationResponse aclientp.schema.v2.elicitation The elicitation was cancelled.
CancelRequestNotification aclientp.schema.v2.protocol Parameters of $/cancel_request: cancel an ongoing request.
CancelSessionNotification aclientp.schema.v2.sessions Notification to cancel a session's foreground work and its prompts not yet inserted.
CancelTerminalRequest aclientp.schema.v2.terminals Parameters of terminal/cancel: cancel one terminal.
CancelTerminalResponse aclientp.schema.v2.terminals Response from cancelling a terminal.
CancelToolCallRequest aclientp.schema.v2.tool_calls Parameters of tool_call/cancel: cancel one tool call.
CancelToolCallResponse aclientp.schema.v2.tool_calls Response to tool_call/cancel.
CancelledPermissionOutcome aclientp.schema.v2.permissions No option was selected, e.g. because the session's work was cancelled.
ClientAuthCapabilities aclientp.schema.v2.capabilities Authentication capabilities supported by the client.
ClientCapabilities aclientp.schema.v2.capabilities Capabilities supported by the client.
ClientNotification aclientp.schema.v2.protocol A notification the client sends to the agent.
ClientRequest aclientp.schema.v2.protocol A request the client sends to the agent (an :data:AgentMethod).
ClientSessionCapabilities aclientp.schema.v2.capabilities UNSTABLE: Session-related capabilities supported by the client.
CloseSessionRequest aclientp.schema.v2.sessions Request parameters for closing an active session.
CloseSessionResponse aclientp.schema.v2.sessions Response from closing a session.
Command aclientp.schema.v2.commands A slash command the user invokes by including /name in a prompt.
CommandPermissionSubject aclientp.schema.v2.permissions Permission is requested before running a command.
CommandsCapabilities aclientp.schema.v2.capabilities UNSTABLE: Command types the client understands in addition to command.
CommandsSkillCapabilities aclientp.schema.v2.capabilities UNSTABLE: Client support for skill command entries.
CompactionSummaryChunk aclientp.schema.v2.session_updates A content block appended to a compaction's summary.
CompactionUpdate aclientp.schema.v2.session_updates A context compaction upsert, keyed by compaction_id.
CompleteElicitationNotification aclientp.schema.v2.elicitation Notification sent by the agent when a URL-based elicitation is complete.
ConfigOptionUpdate aclientp.schema.v2.session_updates The session's config options have changed.
Content aclientp.schema.v2.tool_calls A standard content block (text, image, resource) produced by a tool call.
CopyDiffChange aclientp.schema.v2.tool_calls A file was copied.
Cost aclientp.schema.v2.common Cumulative cost of a session.
CursorCapabilities aclientp.schema.v2.cursors UNSTABLE: The methods that currently accept a cursor.
CursorCompactionAnchor aclientp.schema.v2.cursors UNSTABLE: The cursor is next to a context compaction.
CursorForkCapabilities aclientp.schema.v2.cursors UNSTABLE: The cursor can be passed to session/fork as cursorId.
CursorMessageAnchor aclientp.schema.v2.cursors UNSTABLE: A cursor anchored to a message; type names the kind of message.
CursorToolCallAnchor aclientp.schema.v2.cursors UNSTABLE: The cursor is next to a tool call.
CursorUpdate aclientp.schema.v2.cursors UNSTABLE: A session cursor upsert, keyed by cursor_id.
DeclineElicitationResponse aclientp.schema.v2.elicitation The user declined.
DeleteDiffChange aclientp.schema.v2.tool_calls A file was deleted.
DeleteSessionRequest aclientp.schema.v2.sessions Request parameters for deleting an existing session from session/list.
DeleteSessionResponse aclientp.schema.v2.sessions Response from deleting a session.
Diff aclientp.schema.v2.tool_calls File changes produced by a tool call.
DiffPatch aclientp.schema.v2.tool_calls Renderable patch text and its format.
DisableProviderRequest aclientp.schema.v2.providers UNSTABLE: Request parameters for providers/disable.
DisableProviderResponse aclientp.schema.v2.providers UNSTABLE: Response to providers/disable.
ElicitationCapabilities aclientp.schema.v2.capabilities Elicitation capabilities supported by the client.
ElicitationFormCapabilities aclientp.schema.v2.capabilities Form-based elicitation capabilities.
ElicitationSchema aclientp.schema.v2.elicitation Type-safe elicitation schema for requesting structured user input.
ElicitationUrlCapabilities aclientp.schema.v2.capabilities URL-based elicitation capabilities.
EmbeddedResource aclientp.schema.v2.content Resource contents embedded in a prompt or tool call result.
EnumOption aclientp.schema.v2.elicitation A titled enum option with a const value, human-readable title, and optional description.
EnvVariable aclientp.schema.v2.common An environment variable to set when launching a process.
Error aclientp.schema.v2.common A JSON-RPC error object.
ErrorResponse aclientp.schema.v2.protocol A failed JSON-RPC response.
ForkSessionRequest aclientp.schema.v2.sessions UNSTABLE: Request parameters for forking an existing session.
ForkSessionResponse aclientp.schema.v2.sessions UNSTABLE: Response from forking an existing session.
FormElicitationRequest aclientp.schema.v2.elicitation The client renders a form from requested_schema.
HttpHeader aclientp.schema.v2.common An HTTP header to send with requests.
Icon aclientp.schema.v2.common An optionally sized icon a user interface can display.
IdleStateSessionUpdate aclientp.schema.v2.session_updates state_update: no foreground work is active.
IdleStateUpdate aclientp.schema.v2.prompt No foreground work is active; background work may continue.
ImageContent aclientp.schema.v2.content An image provided to or from an LLM. Requires the image prompt capability.
Implementation aclientp.schema.v2.common Name and version of a client or agent implementation.
InitialConfigOptionBoolean aclientp.schema.v2.config_options UNSTABLE: Initial value of a boolean config option.
InitialConfigOptionId aclientp.schema.v2.config_options UNSTABLE: Initial value of a select config option.
InitialConfigOptionUnknown aclientp.schema.v2.config_options UNSTABLE: Initial value of a custom or future kind of config option.
InitializeProxyRequest aclientp.schema.v2.protocol UNSTABLE: Parameters of proxy/initialize, sent instead of initialize.
InitializeProxyResponse aclientp.schema.v2.protocol UNSTABLE: Response to proxy/initialize; the same as an initialize response.
InitializeRequest aclientp.schema.v2.initialize Request parameters for the initialize method.
InitializeResponse aclientp.schema.v2.initialize Response to the initialize method.
IntegerPropertySchema aclientp.schema.v2.elicitation Schema for integer properties in an elicitation form.
ListProvidersRequest aclientp.schema.v2.providers UNSTABLE: Request parameters for providers/list.
ListProvidersResponse aclientp.schema.v2.providers UNSTABLE: Response to providers/list.
ListSessionsRequest aclientp.schema.v2.sessions Request parameters for listing existing sessions.
ListSessionsResponse aclientp.schema.v2.sessions Response from listing sessions.
LoginAuthRequest aclientp.schema.v2.auth Request parameters for the auth/login method.
LoginAuthResponse aclientp.schema.v2.auth Response to the auth/login method.
LogoutAuthRequest aclientp.schema.v2.auth Request parameters for the auth/logout method.
LogoutAuthResponse aclientp.schema.v2.auth Response to the auth/logout method.
McpAcpCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for ACP MCP server transports.
McpCapabilities aclientp.schema.v2.capabilities MCP capabilities supported by the agent for session lifecycle requests.
McpError aclientp.schema.v2.mcp UNSTABLE: An inner MCP error, distinct from an outer ACP error.
McpHttpCapabilities aclientp.schema.v2.capabilities Capabilities for HTTP MCP server transports.
McpServerAcp aclientp.schema.v2.mcp UNSTABLE: ACP transport configuration for MCP.
McpServerHttp aclientp.schema.v2.mcp HTTP transport configuration for MCP.
McpServerStdio aclientp.schema.v2.mcp Stdio transport configuration for MCP.
McpStdioCapabilities aclientp.schema.v2.capabilities Capabilities for stdio MCP server transports.
MessageMcpError aclientp.schema.v2.mcp UNSTABLE: Successful mcp/message call whose inner MCP request failed.
MessageMcpNotification aclientp.schema.v2.mcp UNSTABLE: Notification for an active inner MCP request, from provider to consumer.
MessageMcpRequest aclientp.schema.v2.mcp UNSTABLE: Parameters of mcp/message: an inner MCP request to the provider.
MessageMcpResult aclientp.schema.v2.mcp UNSTABLE: Successful mcp/message outcome: an opaque inner MCP result.
ModifyDiffChange aclientp.schema.v2.tool_calls A file was modified in place.
MoveDiffChange aclientp.schema.v2.tool_calls A file was moved or renamed.
MultiSelectPropertySchema aclientp.schema.v2.elicitation Schema for multi-select (array) properties in an elicitation form.
NewSessionRequest aclientp.schema.v2.sessions Request parameters for creating a new session.
NewSessionResponse aclientp.schema.v2.sessions Response from creating a new session.
Notice aclientp.schema.v2.session_updates Fire-and-forget information for the user, not part of session history.
NumberPropertySchema aclientp.schema.v2.elicitation Schema for number (floating-point) properties in an elicitation form.
OtherStateSessionUpdate aclientp.schema.v2.session_updates state_update with a custom or future state.
OtherStateUpdate aclientp.schema.v2.prompt A custom or future state; state values starting with _ are extensions.
PermissionOption aclientp.schema.v2.permissions An option offered to the user.
PlanEntry aclientp.schema.v2.plans A task or goal the agent intends to accomplish.
PlanItems aclientp.schema.v2.plans A plan as structured entries.
PlanMarkdown aclientp.schema.v2.plans UNSTABLE: A plan as raw markdown content.
PlanRemoved aclientp.schema.v2.plans UNSTABLE: The plan with this ID was removed.
PlanUpdate aclientp.schema.v2.plans New content of the plan identified by its plan_id.
PromptAudioCapabilities aclientp.schema.v2.capabilities Capabilities for audio content in prompt requests.
PromptCapabilities aclientp.schema.v2.capabilities Prompt capabilities supported by the agent in session/prompt requests.
PromptEmbeddedContextCapabilities aclientp.schema.v2.capabilities Capabilities for embedded context in prompt requests.
PromptImageCapabilities aclientp.schema.v2.capabilities Capabilities for image content in prompt requests.
PromptRequest aclientp.schema.v2.prompt Parameters of session/prompt: a user message for the session.
PromptResponse aclientp.schema.v2.prompt Acknowledges that the user message was inserted into the conversation.
PromptSkillCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for skill content blocks in prompt requests.
PromptSkillInlineCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for skill content blocks at any position in a prompt.
PromptSuggestion aclientp.schema.v2.session_updates UNSTABLE: A prompt the agent predicts the user will send next.
PromptSuggestionsAudioCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for audio content in prompt suggestions.
PromptSuggestionsCapabilities aclientp.schema.v2.capabilities UNSTABLE: Client support for prompt_suggestions_update session updates.
PromptSuggestionsEmbeddedContextCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for embedded resources in prompt suggestions.
PromptSuggestionsImageCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for image content in prompt suggestions.
PromptSuggestionsUpdate aclientp.schema.v2.session_updates UNSTABLE: Replaces the session's prompt suggestions.
ProviderCurrentConfig aclientp.schema.v2.providers UNSTABLE: Current effective non-secret routing configuration for a provider.
ProviderInfo aclientp.schema.v2.providers UNSTABLE: Information about a configurable LLM provider.
ProvidersCapabilities aclientp.schema.v2.capabilities UNSTABLE: Provider configuration capabilities supported by the agent.
ProxyNotification aclientp.schema.v2.protocol UNSTABLE: A notification to a proxy in a proxy chain.
ProxyRequest aclientp.schema.v2.protocol UNSTABLE: A request to a proxy in a proxy chain (a :data:ProxyMethod).
ProxySuccessorNotification aclientp.schema.v2.protocol UNSTABLE: Parameters of a proxy/successor notification: a wrapped notification.
ProxySuccessorRequest aclientp.schema.v2.protocol UNSTABLE: Parameters of a proxy/successor request: a wrapped request.
ReplayComplete aclientp.schema.v2.session_updates The history replay requested by session/resume is complete.
ReplayFromStart aclientp.schema.v2.sessions Replay all retained conversation history from its first replayable entry.
RequestPermissionRequest aclientp.schema.v2.permissions Parameters of session/request_permission.
RequestPermissionResponse aclientp.schema.v2.permissions Response to session/request_permission.
RequestTypes aclientp.schema.v2.protocol Validators of a request method's parameters and result.
RequiresActionStateSessionUpdate aclientp.schema.v2.session_updates state_update: foreground work is blocked on user action.
RequiresActionStateUpdate aclientp.schema.v2.prompt The foreground workflow as a whole is blocked on user action.
ResourceLink aclientp.schema.v2.content A link to a resource the receiver may be able to read. All agents MUST support it.
ResultResponse aclientp.schema.v2.protocol A successful JSON-RPC response.
ResumeSessionRequest aclientp.schema.v2.sessions Request parameters for resuming an existing session.
ResumeSessionResponse aclientp.schema.v2.sessions Response from resuming an existing session.
RunningStateSessionUpdate aclientp.schema.v2.session_updates state_update: foreground work is in progress.
RunningStateUpdate aclientp.schema.v2.prompt Foreground work is in progress.
Schema aclientp.schema.v2.base Base class of all v2 models.
SelectSessionConfigOption aclientp.schema.v2.config_options A single-value selector (dropdown).
SelectedPermissionOutcome aclientp.schema.v2.permissions The user selected one of the offered options.
SessionAdditionalDirectoriesCapabilities aclientp.schema.v2.capabilities Capabilities for additional session directories support.
SessionArchiveCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for session/archive and session/unarchive.
SessionCancelCapabilities aclientp.schema.v2.subagents A subagent session's work can be cancelled (session/cancel) without ending it.
SessionCapabilities aclientp.schema.v2.capabilities Session capabilities supported by the agent.
SessionConfigSelectGroup aclientp.schema.v2.config_options A group of possible values of a select config option.
SessionConfigSelectOption aclientp.schema.v2.config_options A possible value of a select config option.
SessionDeleteCapabilities aclientp.schema.v2.capabilities Capabilities for the session/delete method.
SessionForkCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for the session/fork method.
SessionInfo aclientp.schema.v2.sessions Information about a session returned by session/list.
SessionInfoUpdate aclientp.schema.v2.session_updates Partial update of session metadata; None clears a field.
SessionMessage aclientp.schema.v2.messages An upsert of a message sent to or received from another session.
SessionMessageChunk aclientp.schema.v2.messages A content block appended to a session message.
SessionMessageCursorAnchor aclientp.schema.v2.cursors UNSTABLE: The cursor is next to a session-directed message.
SessionNotFoundErrorData aclientp.schema.v2.common Data of the -32002 (Resource not found) error for an unknown or inactive session.
SessionOptionsCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for the session/options method.
SessionOptionsRequest aclientp.schema.v2.sessions UNSTABLE: Parameters of session/options.
SessionOptionsResponse aclientp.schema.v2.sessions UNSTABLE: Response from session/options.
SessionReference aclientp.schema.v2.tool_calls A display-only reference to another session the tool call operates on, e.g. a subagent.
SessionStatusCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for the session/status method.
SessionStatusRequest aclientp.schema.v2.sessions UNSTABLE: Request parameters for checking the status of a session.
SessionStatusResponse aclientp.schema.v2.sessions UNSTABLE: Response from checking the status of a session.
SessionSystemPromptCapabilities aclientp.schema.v2.capabilities Capabilities for client-provided system prompts.
SessionSystemPromptModeCapabilities aclientp.schema.v2.capabilities System prompt delivery modes the agent supports in addition to append.
SessionSystemPromptOverrideCapabilities aclientp.schema.v2.capabilities Capabilities for the override system prompt mode.
SessionTitleCapabilities aclientp.schema.v2.capabilities UNSTABLE: Capabilities for Client-set session titles.
SetConfigOptionBooleanRequest aclientp.schema.v2.config_options Set a boolean config option.
SetConfigOptionIdRequest aclientp.schema.v2.config_options Select a value of a select config option.
SetConfigOptionUnknownRequest aclientp.schema.v2.config_options Set a custom or future kind of config option.
SetProviderRequest aclientp.schema.v2.providers UNSTABLE: Request parameters for providers/set.
SetProviderResponse aclientp.schema.v2.providers UNSTABLE: Response to providers/set.
SetSessionConfigOptionResponse aclientp.schema.v2.config_options Response to session/set_config_option.
SetSessionTitleRequest aclientp.schema.v2.sessions UNSTABLE: Request parameters for setting the title of a session.
SetSessionTitleResponse aclientp.schema.v2.sessions UNSTABLE: Response from setting the title of a session.
Skill aclientp.schema.v2.commands UNSTABLE: An Agent Skill the user invokes with a skill content block.
SkillReference aclientp.schema.v2.content UNSTABLE: A skill the user invokes with a prompt.
StringMultiSelectItems aclientp.schema.v2.elicitation String item schema for multi-select enum properties.
StringPropertySchema aclientp.schema.v2.elicitation Schema for string properties in an elicitation form.
SubagentSessionCapabilities aclientp.schema.v2.subagents Client-initiated mutations permitted for a specific subagent session.
SubagentUpdate aclientp.schema.v2.subagents The parent session created and owns a child session, or the association changed.
SystemPrompt aclientp.schema.v2.sessions Client-provided system-level instructions for a session.
Terminal aclientp.schema.v2.tool_calls A display-only reference to an agent-owned terminal.
TerminalAuthCapabilities aclientp.schema.v2.capabilities Capabilities for terminal authentication methods.
TerminalCancelCapabilities aclientp.schema.v2.terminals Capability to cancel a terminal with terminal/cancel.
TerminalCapabilities aclientp.schema.v2.terminals Client-initiated controls a terminal currently supports.
TerminalExitStatus aclientp.schema.v2.terminals Exit information for an agent-owned terminal.
TerminalOutput aclientp.schema.v2.terminals An authoritative replacement snapshot of terminal output bytes.
TerminalOutputChunk aclientp.schema.v2.terminals A chunk of bytes appended to an agent-owned terminal's output.
TerminalSize aclientp.schema.v2.terminals The size of an agent-owned terminal in character cells.
TerminalUpdate aclientp.schema.v2.terminals An upsert of an agent-owned terminal's state, keyed by terminal_id.
TextCommandInput aclientp.schema.v2.commands All text typed after the command name (and the following whitespace) is the input.
TextContent aclientp.schema.v2.content Text provided to or from an LLM. All agents MUST support it in prompts.
TextResourceContents aclientp.schema.v2.content Text contents of a resource.
TitledMultiSelectItems aclientp.schema.v2.elicitation Items definition for titled multi-select enum properties.
ToolCallCancelCapabilities aclientp.schema.v2.tool_calls The tool call can be cancelled with tool_call/cancel.
ToolCallCapabilities aclientp.schema.v2.tool_calls Client-initiated controls a tool call currently supports.
ToolCallContentChunk aclientp.schema.v2.tool_calls A content item appended to a tool call's content.
ToolCallLocation aclientp.schema.v2.tool_calls A file location a tool reads or modifies, for "follow-along" features.
ToolCallPermissionSubject aclientp.schema.v2.permissions Permission is requested before executing a tool call.
ToolCallSessionUpdate aclientp.schema.v2.session_updates tool_call_update: a tool call was created or updated.
ToolCallUpdate aclientp.schema.v2.tool_calls A tool call upsert, keyed by tool_call_id.
UnarchiveSessionRequest aclientp.schema.v2.sessions UNSTABLE: Request parameters for unarchiving a session.
UnarchiveSessionResponse aclientp.schema.v2.sessions UNSTABLE: Response from unarchiving a session.
Unknown aclientp.schema.v2.base Base of fallback variants of open unions: a custom or future variant.
UnknownAuthMethod aclientp.schema.v2.auth A custom or future auth method; type values starting with _ are extensions.
UnknownBackgroundWork aclientp.schema.v2.prompt Custom or future background work; type values starting with _ are extensions.
UnknownCommand aclientp.schema.v2.commands A custom or future command kind; type values starting with _ are extensions.
UnknownCommandInput aclientp.schema.v2.commands A custom or future input kind; type values starting with _ are extensions.
UnknownContent aclientp.schema.v2.content A custom or future content block; type values starting with _ are extensions.
UnknownCursorAnchor aclientp.schema.v2.cursors UNSTABLE: A custom or future anchor kind; the client cannot place such a cursor.
UnknownDiffChange aclientp.schema.v2.tool_calls A custom or future file operation; values starting with _ are extensions.
UnknownElicitationRequest aclientp.schema.v2.elicitation A custom or future mode; values starting with _ are extensions.
UnknownElicitationResponse aclientp.schema.v2.elicitation A custom or future action; values starting with _ are extensions.
UnknownMcpServer aclientp.schema.v2.mcp A custom or future MCP transport; type values starting with _ are extensions.
UnknownMultiSelectItems aclientp.schema.v2.elicitation Custom or future typed multi-select items.
UnknownPermissionOutcome aclientp.schema.v2.permissions A custom or future outcome; values starting with _ are extensions.
UnknownPermissionSubject aclientp.schema.v2.permissions A custom or future subject; type values starting with _ are extensions.
UnknownPlanContent aclientp.schema.v2.plans Custom or future plan content; type values starting with _ are extensions.
UnknownPropertySchema aclientp.schema.v2.elicitation A custom or future property type; values starting with _ are extensions.
UnknownReplayFrom aclientp.schema.v2.sessions A custom or future replay cursor; type values starting with _ are extensions.
UnknownSessionConfigOption aclientp.schema.v2.config_options A custom or future option kind; type values starting with _ are extensions.
UnknownSessionUpdate aclientp.schema.v2.session_updates A custom or future session update; values starting with _ are extensions.
UnknownStateSessionUpdate aclientp.schema.v2.session_updates state_update: the agent cannot currently determine foreground activity.
UnknownStateUpdate aclientp.schema.v2.prompt The agent cannot currently determine foreground activity.
UnknownToolCallContent aclientp.schema.v2.tool_calls Custom or future tool call content; type values starting with _ are extensions.
UnsupportedProtocolVersionErrorData aclientp.schema.v2.common Data of the -32022 (Unsupported protocol version) error.
UpdateSessionNotification aclientp.schema.v2.session_updates Parameters of session/update: one update of a session.
UrlElicitationRequest aclientp.schema.v2.elicitation The client directs the user to url.
Usage aclientp.schema.v2.common UNSTABLE: Token usage of the foreground work that just completed (not cumulative).
UsageUpdate aclientp.schema.v2.session_updates Context window and cost of the session.
UserMessage aclientp.schema.v2.messages A user message upsert, e.g. when the agent accepts or replaces a prompt.
UserMessageChunk aclientp.schema.v2.messages A chunk of the user's message being streamed.
UserMessageCursorAnchor aclientp.schema.v2.cursors UNSTABLE: The cursor is next to a user message.

🛈 DocStrings

UNSTABLE: Models of the draft ACP v2 protocol.

Written against the pinned upstream schema in schema/v2/ and checked by python -m aclientp.schema_reference --protocol 2 check. See :mod:aclientp.schema.v2.base for the wire rules: optional fields default to MISSING and are left out, None is sent as null; serialize with :func:to_wire and test fields with :func:is_set.

AGENT_NOTIFICATIONS module-attribute

AGENT_NOTIFICATIONS: dict[str, TypeAdapter[Any]] = {
    "session/cancel": TypeAdapter(CancelSessionNotification),
    "mcp/message": TypeAdapter(MessageMcpNotification),
}

Notifications the agent handles.

AGENT_REQUESTS module-attribute

AGENT_REQUESTS: dict[str, RequestTypes] = {
    "initialize": RequestTypes.of(InitializeRequest, InitializeResponse),
    "auth/login": RequestTypes.of(LoginAuthRequest, LoginAuthResponse),
    "auth/logout": RequestTypes.of(LogoutAuthRequest, LogoutAuthResponse),
    "auth/status": RequestTypes.of(AuthStatusRequest, AuthStatusResponse),
    "providers/list": RequestTypes.of(ListProvidersRequest, ListProvidersResponse),
    "providers/set": RequestTypes.of(SetProviderRequest, SetProviderResponse),
    "providers/disable": RequestTypes.of(DisableProviderRequest, DisableProviderResponse),
    "session/new": RequestTypes.of(NewSessionRequest, NewSessionResponse),
    "session/resume": RequestTypes.of(ResumeSessionRequest, ResumeSessionResponse),
    "session/fork": RequestTypes.of(ForkSessionRequest, ForkSessionResponse),
    "session/close": RequestTypes.of(CloseSessionRequest, CloseSessionResponse),
    "session/list": RequestTypes.of(ListSessionsRequest, ListSessionsResponse),
    "session/delete": RequestTypes.of(DeleteSessionRequest, DeleteSessionResponse),
    "session/archive": RequestTypes.of(ArchiveSessionRequest, ArchiveSessionResponse),
    "session/unarchive": RequestTypes.of(UnarchiveSessionRequest, UnarchiveSessionResponse),
    "session/status": RequestTypes.of(SessionStatusRequest, SessionStatusResponse),
    "session/options": RequestTypes.of(SessionOptionsRequest, SessionOptionsResponse),
    "session/set_title": RequestTypes.of(SetSessionTitleRequest, SetSessionTitleResponse),
    "session/set_config_option": RequestTypes.of(
        SetSessionConfigOptionRequest, SetSessionConfigOptionResponse
    ),
    "session/prompt": RequestTypes.of(PromptRequest, PromptResponse),
    "tool_call/cancel": RequestTypes.of(CancelToolCallRequest, CancelToolCallResponse),
    "terminal/cancel": RequestTypes.of(CancelTerminalRequest, CancelTerminalResponse),
    "mcp/message": RequestTypes.of(MessageMcpRequest, MessageMcpResponse),
}

Requests the agent handles.

AbsolutePath module-attribute

AbsolutePath = str

An absolute filesystem path.

AgentMethod module-attribute

AgentMethod = Literal[
    "auth/login",
    "auth/logout",
    "auth/status",
    "initialize",
    "mcp/message",
    "providers/disable",
    "providers/list",
    "providers/set",
    "session/archive",
    "session/cancel",
    "session/close",
    "session/delete",
    "session/fork",
    "session/list",
    "session/new",
    "session/options",
    "session/prompt",
    "session/resume",
    "session/set_config_option",
    "session/set_title",
    "session/status",
    "session/unarchive",
    "terminal/cancel",
    "tool_call/cancel",
]

Methods handled by the agent (session/cancel is a notification).

AgentResponse module-attribute

AgentResponse = ResultResponse | ErrorResponse

A response the agent sends to a client request.

AuthMethod module-attribute

AuthMethod = Annotated[
    Annotated[AuthMethodTerminal, Tag("terminal")]
    | Annotated[AuthMethodAgent, Tag("agent")]
    | Annotated[UnknownAuthMethod, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"terminal", "agent"}))),
]

An authentication method the agent offers, discriminated by type.

AuthMethodId module-attribute

AuthMethodId = str

Unique identifier of an authentication method.

AuthState module-attribute

AuthState = Literal['authenticated', 'unauthenticated', 'not_required', 'unknown'] | str

UNSTABLE: The agent's overall authentication state.

authenticated does not guarantee valid credentials. Values starting with _ are extensions.

AvailableCommand module-attribute

AvailableCommand = Annotated[
    Annotated[Command, Tag("command")]
    | Annotated[Skill, Tag("skill")]
    | Annotated[UnknownCommand, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"command", "skill"}))),
]

A command the agent advertises to the client.

AvailableCommandInput module-attribute

AvailableCommandInput = Annotated[
    Annotated[TextCommandInput, Tag("text")] | Annotated[UnknownCommandInput, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"text"}))),
]

How a command takes input.

BackgroundWork module-attribute

BackgroundWork = Annotated[
    Annotated[BackgroundTerminal, Tag("terminal")]
    | Annotated[BackgroundToolCall, Tag("tool_call")]
    | Annotated[BackgroundSubagent, Tag("subagent")]
    | Annotated[UnknownBackgroundWork, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"terminal", "tool_call", "subagent"}))),
]

One piece of work running independently of the foreground work.

Items reference entities the client already tracks; the agent announces each item before listing it.

CLIENT_NOTIFICATIONS module-attribute

CLIENT_NOTIFICATIONS: dict[str, TypeAdapter[Any]] = {
    "session/update": TypeAdapter(UpdateSessionNotification),
    "elicitation/complete": TypeAdapter(CompleteElicitationNotification),
    "auth/status_update": TypeAdapter(AuthStatusUpdateNotification),
    "mcp/message": TypeAdapter(MessageMcpNotification),
}

Notifications the client handles.

CLIENT_REQUESTS module-attribute

CLIENT_REQUESTS: dict[str, RequestTypes] = {
    "session/request_permission": RequestTypes.of(
        RequestPermissionRequest, RequestPermissionResponse
    ),
    "elicitation/create": RequestTypes.of(CreateElicitationRequest, CreateElicitationResponse),
    "mcp/message": RequestTypes.of(MessageMcpRequest, MessageMcpResponse),
}

Requests the client handles.

ClientMethod module-attribute

ClientMethod = Literal[
    "auth/status_update",
    "elicitation/complete",
    "elicitation/create",
    "mcp/message",
    "session/request_permission",
    "session/update",
]

Methods handled by the client.

ClientResponse module-attribute

ClientResponse = ResultResponse | ErrorResponse

A response the client sends to an agent request.

CompactionId module-attribute

CompactionId = str

Unique identifier of a context compaction within a session.

CompactionStatus module-attribute

CompactionStatus = Literal['in_progress', 'completed', 'failed', 'cancelled'] | str

Lifecycle state of a context compaction. Values starting with _ are extensions.

ContentBlock module-attribute

ContentBlock = Annotated[
    Annotated[TextContent, Tag("text")]
    | Annotated[ImageContent, Tag("image")]
    | Annotated[AudioContent, Tag("audio")]
    | Annotated[ResourceLink, Tag("resource_link")]
    | Annotated[EmbeddedResource, Tag("resource")]
    | Annotated[SkillReference, Tag("skill")]
    | Annotated[UnknownContent, Tag(OTHER_TAG)],
    Discriminator(
        open_discriminator(
            "type", frozenset({"text", "image", "audio", "resource_link", "resource", "skill"})
        )
    ),
]

Displayable content: in prompts, model output, tool call results and more.

CreateElicitationRequest module-attribute

CreateElicitationRequest = Annotated[
    Annotated[FormElicitationRequest, Tag("form")]
    | Annotated[UrlElicitationRequest, Tag("url")]
    | Annotated[UnknownElicitationRequest, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("mode", frozenset({"form", "url"}))),
]

Parameters of elicitation/create: structured user input the agent asks for.

CreateElicitationResponse module-attribute

CreateElicitationResponse = Annotated[
    Annotated[AcceptElicitationResponse, Tag("accept")]
    | Annotated[DeclineElicitationResponse, Tag("decline")]
    | Annotated[CancelElicitationResponse, Tag("cancel")]
    | Annotated[UnknownElicitationResponse, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("action", frozenset({"accept", "decline", "cancel"}))),
]

Response to elicitation/create.

CursorAnchor module-attribute

CursorAnchor = Annotated[
    Annotated[UserMessageCursorAnchor, Tag("user_message")]
    | Annotated[AgentMessageCursorAnchor, Tag("agent_message")]
    | Annotated[AgentThoughtCursorAnchor, Tag("agent_thought")]
    | Annotated[SessionMessageCursorAnchor, Tag("session_message")]
    | Annotated[CursorToolCallAnchor, Tag("tool_call")]
    | Annotated[CursorCompactionAnchor, Tag("compaction")]
    | Annotated[UnknownCursorAnchor, Tag(OTHER_TAG)],
    Discriminator(
        open_discriminator(
            "type",
            frozenset({
                "user_message",
                "agent_message",
                "agent_thought",
                "session_message",
                "tool_call",
                "compaction",
            }),
        )
    ),
]

UNSTABLE: Where a cursor is, relative to an entity the client holds.

CursorAnchorPosition module-attribute

CursorAnchorPosition = Literal['before', 'after'] | str

UNSTABLE: On which side of the anchored entity the cursor is.

before: the history before the cursor excludes the entity; after: it includes it and nothing that follows. A client that does not know the value cannot place the cursor.

CursorId module-attribute

CursorId = str

UNSTABLE: Agent-owned identifier of a session cursor, unique within its session.

DiffChange module-attribute

DiffChange = Annotated[
    Annotated[AddDiffChange, Tag("add")]
    | Annotated[DeleteDiffChange, Tag("delete")]
    | Annotated[ModifyDiffChange, Tag("modify")]
    | Annotated[MoveDiffChange, Tag("move")]
    | Annotated[CopyDiffChange, Tag("copy")]
    | Annotated[UnknownDiffChange, Tag(OTHER_TAG)],
    Discriminator(
        open_discriminator("operation", frozenset({"add", "delete", "modify", "move", "copy"}))
    ),
]

One file-level change of a :class:Diff.

DiffFileType module-attribute

DiffFileType = Literal['text', 'binary', 'directory', 'symlink'] | str

Kind of file content of a diff change. Values starting with _ are extensions.

DiffPatchFormat module-attribute

DiffPatchFormat = Literal['git_patch'] | str

Format of a diff patch; git_patch is diff --git sections in Git's --patch format.

ERROR_CODES module-attribute

ERROR_CODES: dict[int, str] = {
    PARSE_ERROR: "Parse error",
    INVALID_REQUEST: "Invalid request",
    METHOD_NOT_FOUND: "Method not found",
    INVALID_PARAMS: "Invalid params",
    INTERNAL_ERROR: "Internal error",
    REQUEST_CANCELLED: "Request cancelled",
    AUTH_REQUIRED: "Authentication required",
    RESOURCE_NOT_FOUND: "Resource not found",
    UNSUPPORTED_PROTOCOL_VERSION: "Unsupported protocol version",
}

Error codes the protocol defines, with their standard messages.

ElicitationContentValue module-attribute

ElicitationContentValue = str | int | float | bool | Sequence[str] | Any

A value in an accepted elicitation's content; other JSON values are kept.

ElicitationId module-attribute

ElicitationId = str

Unique identifier of an elicitation.

ElicitationPropertySchema module-attribute

ElicitationPropertySchema = Annotated[
    Annotated[StringPropertySchema, Tag("string")]
    | Annotated[NumberPropertySchema, Tag("number")]
    | Annotated[IntegerPropertySchema, Tag("integer")]
    | Annotated[BooleanPropertySchema, Tag("boolean")]
    | Annotated[MultiSelectPropertySchema, Tag("array")]
    | Annotated[UnknownPropertySchema, Tag(OTHER_TAG)],
    Discriminator(
        open_discriminator("type", frozenset({"string", "number", "integer", "boolean", "array"}))
    ),
]

A form field: string (or single-select enum), number, integer, boolean or multi-select.

ElicitationSchemaType module-attribute

ElicitationSchemaType = Literal['object']

Type of an elicitation schema: always object.

EmbeddedResourceResource module-attribute

EmbeddedResourceResource = TextResourceContents | BlobResourceContents

Contents of an embedded resource: text or binary.

ErrorCode module-attribute

ErrorCode = int

A JSON-RPC error code: one of :data:ERROR_CODES or another integer.

ErrorData module-attribute

Data of an :class:Error: a shape ACP defines, or any other value.

IconTheme module-attribute

IconTheme = Literal['light', 'dark'] | str

Theme an icon is designed for. Values starting with _ are extensions.

IdempotencyKey module-attribute

IdempotencyKey = str

Client-chosen key that makes a session/prompt retry insert at most one message.

InitialSessionConfigOption module-attribute

InitialSessionConfigOption = Annotated[
    Annotated[InitialConfigOptionId, Tag("id")]
    | Annotated[InitialConfigOptionBoolean, Tag("boolean")]
    | Annotated[InitialConfigOptionUnknown, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", _VALUE_TYPES)),
]

UNSTABLE: An initial config option value, sent on session setup requests.

Unlike session/set_config_option, an unknown option or value does not fail the request: the agent ignores it, and the response's configOptions show the result.

LlmProtocol module-attribute

LlmProtocol = Literal['anthropic', 'openai', 'azure', 'vertex', 'bedrock'] | str

UNSTABLE: API protocol of an LLM provider; unknown values MUST be handled gracefully.

McpRequestId module-attribute

McpRequestId = str

UNSTABLE: Identifier of an MCP request carried over ACP.

McpServer module-attribute

McpServer = Annotated[
    Annotated[McpServerHttp, Tag("http")]
    | Annotated[McpServerAcp, Tag("acp")]
    | Annotated[McpServerStdio, Tag("stdio")]
    | Annotated[UnknownMcpServer, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"http", "acp", "stdio"}))),
]

An MCP server the agent should connect to.

Each transport requires the matching session.mcp agent capability.

McpServerAcpId module-attribute

McpServerAcpId = str

UNSTABLE: Identifier of an MCP server provided over ACP.

MediaType module-attribute

MediaType = str

A MIME type, e.g. image/png.

MessageId module-attribute

MessageId = str

Unique identifier of a message within a session.

MessageMcpResponse module-attribute

MessageMcpResponse = MessageMcpResult | MessageMcpError

UNSTABLE: Response of mcp/message: exactly one inner MCP outcome.

MultiSelectItems module-attribute

MultiSelectItems = Annotated[
    Annotated[StringMultiSelectItems, Tag("string")]
    | Annotated[TitledMultiSelectItems, Tag("titled")]
    | Annotated[UnknownMultiSelectItems, Tag(OTHER_TAG)],
    Discriminator(_multi_select_items_tag),
]

Allowed values of a multi-select property: plain strings, or titled options (no type).

NoticeSeverity module-attribute

NoticeSeverity = Literal['info', 'warning', 'error'] | str

Severity hint of a notice. Values starting with _ are extensions.

OTHER_TAG module-attribute

OTHER_TAG = '__other__'

Tag of the fallback variant of an open union.

Not a possible protocol value, so it cannot clash with real tags such as the unknown session state.

PROTOCOL_NOTIFICATIONS module-attribute

PROTOCOL_NOTIFICATIONS: dict[str, TypeAdapter[Any]] = {
    "$/cancel_request": TypeAdapter(CancelRequestNotification)
}

Notifications either side handles.

PROXY_NOTIFICATIONS module-attribute

PROXY_NOTIFICATIONS: dict[str, TypeAdapter[Any]] = {
    "proxy/successor": TypeAdapter(ProxySuccessorNotification)
}

UNSTABLE: Notifications a proxy handles.

PROXY_REQUESTS module-attribute

PROXY_REQUESTS: dict[str, RequestTypes] = {
    "proxy/initialize": RequestTypes.of(InitializeProxyRequest, InitializeProxyResponse),
    "proxy/successor": RequestTypes.of(ProxySuccessorRequest, ProxySuccessorResponse),
}

UNSTABLE: Requests a proxy handles.

PermissionOptionId module-attribute

PermissionOptionId = str

Unique identifier of a permission option.

PermissionOptionKind module-attribute

PermissionOptionKind = Literal['allow_once', 'allow_always', 'reject_once', 'reject_always'] | str

Nature of a permission option, for icons and UI. Values starting with _ are extensions.

PlanEntryPriority module-attribute

PlanEntryPriority = Literal['high', 'medium', 'low'] | str

Relative importance of a plan entry. Values starting with _ are extensions.

PlanEntryStatus module-attribute

PlanEntryStatus = Literal['pending', 'in_progress', 'completed', 'cancelled'] | str

Status of a plan entry. Values starting with _ are extensions.

PlanId module-attribute

PlanId = str

Unique identifier of a plan within a session.

PlanUpdateContent module-attribute

PlanUpdateContent = Annotated[
    Annotated[PlanItems, Tag("items")]
    | Annotated[PlanMarkdown, Tag("markdown")]
    | Annotated[UnknownPlanContent, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"items", "markdown"}))),
]

Updated content of a plan.

ProtocolMethod module-attribute

ProtocolMethod = Literal['$/cancel_request']

Methods either side may send.

ProtocolVersion module-attribute

ProtocolVersion = int

An ACP protocol version number.

ProviderId module-attribute

ProviderId = str

UNSTABLE: Unique identifier of an LLM provider.

ProxyMethod module-attribute

ProxyMethod = Literal['proxy/initialize', 'proxy/successor']

UNSTABLE: Methods handled by proxies in a proxy chain.

ProxyResponse module-attribute

ProxyResponse = ResultResponse | ErrorResponse

UNSTABLE: A response of a proxy.

ProxySuccessorResponse module-attribute

ProxySuccessorResponse = Any

UNSTABLE: Result of proxy/successor: the wrapped request's result, unchanged.

ReplayFrom module-attribute

ReplayFrom = Annotated[
    Annotated[ReplayFromStart, Tag("start")] | Annotated[UnknownReplayFrom, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"start"}))),
]

Inclusive cursor of where replayed history begins on session/resume.

RequestId module-attribute

RequestId = int | str

A JSON-RPC request ID. Unlike base JSON-RPC, it MUST NOT be null.

RequestPermissionOutcome module-attribute

RequestPermissionOutcome = Annotated[
    Annotated[CancelledPermissionOutcome, Tag("cancelled")]
    | Annotated[SelectedPermissionOutcome, Tag("selected")]
    | Annotated[UnknownPermissionOutcome, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("outcome", frozenset({"cancelled", "selected"}))),
]

The user's decision on a permission request.

RequestPermissionSubject module-attribute

RequestPermissionSubject = Annotated[
    Annotated[ToolCallPermissionSubject, Tag("tool_call")]
    | Annotated[CommandPermissionSubject, Tag("command")]
    | Annotated[UnknownPermissionSubject, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"tool_call", "command"}))),
]

The operation that requires permission.

Role module-attribute

Role = Literal['assistant', 'user'] | str

Sender or recipient in a conversation. Values starting with _ are extensions.

SessionArchiveFilter module-attribute

SessionArchiveFilter = Literal['exclude', 'include', 'only'] | str

UNSTABLE: Which sessions session/list returns by archive state (default exclude).

SessionConfigGroupId module-attribute

SessionConfigGroupId = str

Unique identifier of a group of select config option values.

SessionConfigId module-attribute

SessionConfigId = str

Unique identifier of a session config option.

SessionConfigOption module-attribute

SessionConfigOption = Annotated[
    Annotated[SelectSessionConfigOption, Tag("select")]
    | Annotated[BooleanSessionConfigOption, Tag("boolean")]
    | Annotated[UnknownSessionConfigOption, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", frozenset({"select", "boolean"}))),
]

A session config option and its current state.

SessionConfigOptionCategory module-attribute

SessionConfigOptionCategory = (
    Literal["mode", "model", "model_config", "speed", "thought_level"] | str
)

Semantic category of a config option, for UX only.

Clients MUST handle unknown categories gracefully; values starting with _ are extensions.

SessionConfigSelectOptions module-attribute

SessionConfigSelectOptions = (
    Sequence[SessionConfigSelectOption] | Sequence[SessionConfigSelectGroup]
)

Values of a select config option: a flat list, or groups under headers.

SessionConfigValueId module-attribute

SessionConfigValueId = str

Unique identifier of a value of a select config option.

SessionId module-attribute

SessionId = str

Unique identifier of a session.

SessionListCursor module-attribute

SessionListCursor = str

Opaque pagination cursor of session/list.

SessionStatus module-attribute

SessionStatus = Literal['open', 'saved'] | str

UNSTABLE: Whether the agent has a session in memory (open) or can resume it (saved).

Clients MUST treat unknown values as saved.

SessionUpdate module-attribute

SessionUpdate = Annotated[
    Annotated[UserMessageChunk, Tag("user_message_chunk")]
    | Annotated[UserMessage, Tag("user_message")]
    | Annotated[AgentMessageChunk, Tag("agent_message_chunk")]
    | Annotated[AgentMessage, Tag("agent_message")]
    | Annotated[AgentThoughtChunk, Tag("agent_thought_chunk")]
    | Annotated[AgentThought, Tag("agent_thought")]
    | Annotated[StateSessionUpdate, Tag("state_update")]
    | Annotated[ToolCallContentChunk, Tag("tool_call_content_chunk")]
    | Annotated[ToolCallSessionUpdate, Tag("tool_call_update")]
    | Annotated[TerminalUpdate, Tag("terminal_update")]
    | Annotated[TerminalOutputChunk, Tag("terminal_output_chunk")]
    | Annotated[PlanUpdate, Tag("plan_update")]
    | Annotated[PlanRemoved, Tag("plan_removed")]
    | Annotated[AvailableCommandsUpdate, Tag("available_commands_update")]
    | Annotated[ConfigOptionUpdate, Tag("config_option_update")]
    | Annotated[SessionInfoUpdate, Tag("session_info_update")]
    | Annotated[UsageUpdate, Tag("usage_update")]
    | Annotated[Notice, Tag("notice")]
    | Annotated[CompactionUpdate, Tag("compaction_update")]
    | Annotated[CompactionSummaryChunk, Tag("compaction_summary_chunk")]
    | Annotated[ReplayComplete, Tag("replay_complete")]
    | Annotated[PromptSuggestionsUpdate, Tag("prompt_suggestions_update")]
    | Annotated[CursorUpdate, Tag("cursor_update")]
    | Annotated[SubagentUpdate, Tag("subagent_update")]
    | Annotated[SessionMessage, Tag("session_message")]
    | Annotated[SessionMessageChunk, Tag("session_message_chunk")]
    | Annotated[UnknownSessionUpdate, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("sessionUpdate", _SESSION_UPDATES)),
]

An update sent while a session exists: messages, progress and other activity.

SetSessionConfigOptionRequest module-attribute

SetSessionConfigOptionRequest = Annotated[
    Annotated[SetConfigOptionIdRequest, Tag("id")]
    | Annotated[SetConfigOptionBooleanRequest, Tag("boolean")]
    | Annotated[SetConfigOptionUnknownRequest, Tag(OTHER_TAG)],
    Discriminator(open_discriminator("type", _VALUE_TYPES)),
]

Parameters of session/set_config_option.

Agents MUST support it for any session where they advertise config options, and reject unknown options or values with -32602.

StateSessionUpdate module-attribute

StateSessionUpdate = Annotated[
    Annotated[RunningStateSessionUpdate, Tag("running")]
    | Annotated[IdleStateSessionUpdate, Tag("idle")]
    | Annotated[RequiresActionStateSessionUpdate, Tag("requires_action")]
    | Annotated[UnknownStateSessionUpdate, Tag("unknown")]
    | Annotated[OtherStateSessionUpdate, Tag(OTHER_TAG)],
    Discriminator(
        open_discriminator("state", frozenset({"running", "idle", "requires_action", "unknown"}))
    ),
]

A state_update session update: a snapshot of the session's foreground activity.

StateUpdate module-attribute

StateUpdate = Annotated[
    Annotated[RunningStateUpdate, Tag("running")]
    | Annotated[IdleStateUpdate, Tag("idle")]
    | Annotated[RequiresActionStateUpdate, Tag("requires_action")]
    | Annotated[UnknownStateUpdate, Tag("unknown")]
    | Annotated[OtherStateUpdate, Tag(OTHER_TAG)],
    Discriminator(
        open_discriminator("state", frozenset({"running", "idle", "requires_action", "unknown"}))
    ),
]

A snapshot of the session's aggregate foreground activity.

StopReason module-attribute

StopReason = (
    Literal["end_turn", "max_tokens", "max_turn_requests", "refusal", "cancelled", "error"] | str
)

Why foreground work stopped. Values starting with _ are extensions.

StringFormat module-attribute

StringFormat = Literal['email', 'uri', 'date', 'date-time'] | str

Format of a string property; unknown formats are kept.

SystemPromptMode module-attribute

SystemPromptMode = Literal['append', 'override'] | str

How the agent combines a client-provided system prompt with its own instructions.

Every agent with the systemPrompt capability supports append; override needs session.systemPrompt.mode.override. Values starting with _ are extensions.

TerminalId module-attribute

TerminalId = str

Unique identifier of a display terminal within a session.

ToolCallContent module-attribute

ToolCallContent = Annotated[
    Annotated[Content, Tag("content")]
    | Annotated[Diff, Tag("diff")]
    | Annotated[Terminal, Tag("terminal")]
    | Annotated[SessionReference, Tag("session")]
    | Annotated[UnknownToolCallContent, Tag(OTHER_TAG)],
    Discriminator(
        open_discriminator("type", frozenset({"content", "diff", "terminal", "session"}))
    ),
]

Content produced by a tool call.

ToolCallId module-attribute

ToolCallId = str

Unique identifier of a tool call within a session.

ToolCallStatus module-attribute

ToolCallStatus = (
    Literal["pending", "in_progress", "paused", "completed", "failed", "cancelled"] | str
)

Execution status of a tool call. Values starting with _ are extensions.

ToolKind module-attribute

ToolKind = (
    Literal[
        "read",
        "edit",
        "delete",
        "move",
        "search",
        "execute",
        "think",
        "fetch",
        "switch_mode",
        "other",
    ]
    | str
)

Category of a tool, for icons and display. Values starting with _ are extensions.

JsonValue

JsonValue = dict[str, JsonValue] | list[JsonValue] | str | int | float | bool | None

A JSON value: the params and results of custom (_-prefixed) methods.

AcceptElicitationResponse

Bases: AnnotatedObject

The user accepted and provided content.

Source code in src/aclientp/schema/v2/elicitation.py
class AcceptElicitationResponse(AnnotatedObject):
    """The user accepted and provided content."""

    action: Literal["accept"] = Field(default="accept", init=False)

    content: dict[str, ElicitationContentValue] | MISSING | None = MISSING
    """The content, matching the requested schema."""

content class-attribute instance-attribute

content: dict[str, ElicitationContentValue] | MISSING | None = MISSING

The content, matching the requested schema.

AddDiffChange

Bases: _PathChange

A file was added.

Source code in src/aclientp/schema/v2/tool_calls.py
class AddDiffChange(_PathChange):
    """A file was added."""

    operation: Literal["add"] = Field(default="add", init=False)

AgentAuthCapabilities

Bases: AnnotatedObject

Authentication-related extension capabilities supported by the agent.

Source code in src/aclientp/schema/v2/capabilities.py
class AgentAuthCapabilities(AnnotatedObject):
    """Authentication-related extension capabilities supported by the agent."""

    status: AuthStatusCapabilities | MISSING | None = MISSING
    """Whether the agent supports the ``auth/status`` method."""

status class-attribute instance-attribute

status: AuthStatusCapabilities | MISSING | None = MISSING

Whether the agent supports the auth/status method.

AgentCapabilities

Bases: AnnotatedObject

Capabilities supported by the agent.

Source code in src/aclientp/schema/v2/capabilities.py
class AgentCapabilities(AnnotatedObject):
    """Capabilities supported by the agent."""

    session: SessionCapabilities | MISSING | None = MISSING
    """Session capabilities supported by the agent."""

    auth: AgentAuthCapabilities | MISSING | None = MISSING
    """Authentication-related extension capabilities supported by the agent."""

    providers: ProvidersCapabilities | MISSING | None = MISSING
    """Provider configuration capabilities supported by the agent."""

auth class-attribute instance-attribute

auth: AgentAuthCapabilities | MISSING | None = MISSING

Authentication-related extension capabilities supported by the agent.

providers class-attribute instance-attribute

providers: ProvidersCapabilities | MISSING | None = MISSING

Provider configuration capabilities supported by the agent.

session class-attribute instance-attribute

session: SessionCapabilities | MISSING | None = MISSING

Session capabilities supported by the agent.

AgentMessage

Bases: _MessageUpsert

An agent message upsert, in addition to or instead of streamed chunks.

Source code in src/aclientp/schema/v2/messages.py
class AgentMessage(_MessageUpsert):
    """An agent message upsert, in addition to or instead of streamed chunks."""

    session_update: Literal["agent_message"] = Field(default="agent_message", init=False)

AgentMessageChunk

Bases: _Chunk

A chunk of the agent's response being streamed.

Source code in src/aclientp/schema/v2/messages.py
class AgentMessageChunk(_Chunk):
    """A chunk of the agent's response being streamed."""

    session_update: Literal["agent_message_chunk"] = Field(
        default="agent_message_chunk", init=False
    )

AgentMessageCursorAnchor

Bases: CursorMessageAnchor

UNSTABLE: The cursor is next to an agent message.

Source code in src/aclientp/schema/v2/cursors.py
class AgentMessageCursorAnchor(CursorMessageAnchor):
    """**UNSTABLE**: The cursor is next to an agent message."""

    type: Literal["agent_message"] = Field(default="agent_message", init=False)

AgentNotification

Bases: _Notification

A notification the agent sends to the client.

Source code in src/aclientp/schema/v2/protocol.py
class AgentNotification(_Notification):
    """A notification the agent sends to the client."""

AgentRequest

Bases: _Request

A request the agent sends to the client (a :data:ClientMethod).

Source code in src/aclientp/schema/v2/protocol.py
class AgentRequest(_Request):
    """A request the agent sends to the client (a :data:`ClientMethod`)."""

AgentThought

Bases: _MessageUpsert

An agent thought (reasoning) message upsert.

Source code in src/aclientp/schema/v2/messages.py
class AgentThought(_MessageUpsert):
    """An agent thought (reasoning) message upsert."""

    session_update: Literal["agent_thought"] = Field(default="agent_thought", init=False)

AgentThoughtChunk

Bases: _Chunk

A chunk of the agent's internal reasoning being streamed.

Source code in src/aclientp/schema/v2/messages.py
class AgentThoughtChunk(_Chunk):
    """A chunk of the agent's internal reasoning being streamed."""

    session_update: Literal["agent_thought_chunk"] = Field(
        default="agent_thought_chunk", init=False
    )

AgentThoughtCursorAnchor

Bases: CursorMessageAnchor

UNSTABLE: The cursor is next to an agent thought.

Source code in src/aclientp/schema/v2/cursors.py
class AgentThoughtCursorAnchor(CursorMessageAnchor):
    """**UNSTABLE**: The cursor is next to an agent thought."""

    type: Literal["agent_thought"] = Field(default="agent_thought", init=False)

AnnotatedObject

Bases: Schema

A v2 object with the _meta extension point.

Source code in src/aclientp/schema/v2/base.py
class AnnotatedObject(Schema):
    """A v2 object with the ``_meta`` extension point."""

    field_meta: dict[str, Any] | MISSING | None = MISSING
    """Extension point for implementations. Omitted and ``null`` mean no metadata.

    On upserts, ``_meta`` is a patch: omitted leaves it unchanged, ``null`` clears it,
    and an object patches the stored metadata by top-level key (a key set to ``null``
    is removed, any other value replaces that key).
    """

field_meta class-attribute instance-attribute

field_meta: dict[str, Any] | MISSING | None = MISSING

Extension point for implementations. Omitted and null mean no metadata.

On upserts, _meta is a patch: omitted leaves it unchanged, null clears it, and an object patches the stored metadata by top-level key (a key set to null is removed, any other value replaces that key).

Annotations

Bases: AnnotatedObject

Hints for the client on how an object is used or displayed.

Source code in src/aclientp/schema/v2/common.py
class Annotations(AnnotatedObject):
    """Hints for the client on how an object is used or displayed."""

    audience: Sequence[Role] | MISSING | None = MISSING
    """Intended recipients, such as the user or the assistant."""

    last_modified: str | MISSING | None = MISSING
    """When the underlying resource was last modified (ISO 8601)."""

    priority: float | MISSING | None = Field(default=MISSING, ge=0, le=1)
    """Importance from 0 (least) to 1 (most important)."""

audience class-attribute instance-attribute

audience: Sequence[Role] | MISSING | None = MISSING

Intended recipients, such as the user or the assistant.

last_modified class-attribute instance-attribute

last_modified: str | MISSING | None = MISSING

When the underlying resource was last modified (ISO 8601).

priority class-attribute instance-attribute

priority: float | MISSING | None = Field(default=MISSING, ge=0, le=1)

Importance from 0 (least) to 1 (most important).

ArchiveSessionRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for archiving a session.

Source code in src/aclientp/schema/v2/sessions.py
class ArchiveSessionRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for archiving a session."""

    session_id: SessionId
    """The ID of the session to archive."""

session_id instance-attribute

session_id: SessionId

The ID of the session to archive.

ArchiveSessionResponse

Bases: AnnotatedObject

UNSTABLE: Response from archiving a session.

Source code in src/aclientp/schema/v2/sessions.py
class ArchiveSessionResponse(AnnotatedObject):
    """**UNSTABLE**: Response from archiving a session."""

AudioContent

Bases: AnnotatedObject

Audio provided to or from an LLM. Requires the audio prompt capability.

Source code in src/aclientp/schema/v2/content.py
class AudioContent(AnnotatedObject):
    """Audio provided to or from an LLM. Requires the ``audio`` prompt capability."""

    type: Literal["audio"] = Field(default="audio", init=False)

    data: str
    """Base64-encoded audio data."""

    mime_type: MediaType
    """MIME type of the audio."""

    annotations: Annotations | MISSING | None = MISSING
    """Display and routing hints."""

annotations class-attribute instance-attribute

annotations: Annotations | MISSING | None = MISSING

Display and routing hints.

data instance-attribute

data: str

Base64-encoded audio data.

mime_type instance-attribute

mime_type: MediaType

MIME type of the audio.

AuthAccount

Bases: AnnotatedObject

UNSTABLE: An account or credential the agent has configured.

For example a signed-in user account or an API key. All fields are display information only.

Source code in src/aclientp/schema/v2/auth.py
class AuthAccount(AnnotatedObject):
    """**UNSTABLE**: An account or credential the agent has configured.

    For example a signed-in user account or an API key. All fields are display
    information only.
    """

    label: str
    """Human-readable name for the account, suitable for display on its own, for example
    ``Claude Max``, ``OpenAI API key``, or ``Vertex AI``."""

    description: str | MISSING | None = MISSING
    """Short text shown with the label, such as the credential source, for example ``API key
    helper``. MUST NOT contain credentials."""

    active: bool | MISSING | None = MISSING
    """Whether the agent currently uses this account by default."""

    name: str | MISSING | None = MISSING
    """Display name of the user, such as a username or full name."""

    email: str | MISSING | None = MISSING
    """Email address of the user."""

    organization: str | MISSING | None = MISSING
    """Display name of the organization, team, or workspace the account is using."""

active class-attribute instance-attribute

active: bool | MISSING | None = MISSING

Whether the agent currently uses this account by default.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Short text shown with the label, such as the credential source, for example API key helper. MUST NOT contain credentials.

email class-attribute instance-attribute

email: str | MISSING | None = MISSING

Email address of the user.

label instance-attribute

label: str

Human-readable name for the account, suitable for display on its own, for example Claude Max, OpenAI API key, or Vertex AI.

name class-attribute instance-attribute

name: str | MISSING | None = MISSING

Display name of the user, such as a username or full name.

organization class-attribute instance-attribute

organization: str | MISSING | None = MISSING

Display name of the organization, team, or workspace the account is using.

AuthMethodAgent

Bases: AnnotatedObject

Agent handles authentication itself through auth/login.

Source code in src/aclientp/schema/v2/auth.py
class AuthMethodAgent(AnnotatedObject):
    """Agent handles authentication itself through ``auth/login``."""

    type: Literal["agent"] = Field(default="agent", init=False)

    method_id: AuthMethodId
    """Unique identifier for this authentication method."""

    name: str
    """Human-readable name of the authentication method."""

    description: str | MISSING | None = MISSING
    """Optional human-readable description of this authentication method."""

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Optional human-readable description of this authentication method.

method_id instance-attribute

method_id: AuthMethodId

Unique identifier for this authentication method.

name instance-attribute

name: str

Human-readable name of the authentication method.

AuthMethodTerminal

Bases: AnnotatedObject

Terminal-based authentication method.

The client runs the configured agent program as a separate interactive process, with args appended and env set, for the user to authenticate in a TUI. Requires the client's auth.terminal capability.

Source code in src/aclientp/schema/v2/auth.py
class AuthMethodTerminal(AnnotatedObject):
    """Terminal-based authentication method.

    The client runs the configured agent program as a separate interactive process, with
    ``args`` appended and ``env`` set, for the user to authenticate in a TUI. Requires the
    client's ``auth.terminal`` capability.
    """

    type: Literal["terminal"] = Field(default="terminal", init=False)

    method_id: AuthMethodId
    """Unique identifier for this authentication method."""

    name: str
    """Human-readable name of the authentication method."""

    description: str | MISSING | None = MISSING
    """Optional human-readable description of this authentication method."""

    args: Sequence[str] | MISSING = MISSING
    """Additional arguments to append to the configured agent invocation for terminal auth."""

    env: Sequence[EnvVariable] | MISSING = MISSING
    """Additional environment variables to set on the configured agent invocation for terminal
    auth. Names MUST be unique. These values override same-named variables in the base launch
    configuration."""

args class-attribute instance-attribute

args: Sequence[str] | MISSING = MISSING

Additional arguments to append to the configured agent invocation for terminal auth.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Optional human-readable description of this authentication method.

env class-attribute instance-attribute

env: Sequence[EnvVariable] | MISSING = MISSING

Additional environment variables to set on the configured agent invocation for terminal auth. Names MUST be unique. These values override same-named variables in the base launch configuration.

method_id instance-attribute

method_id: AuthMethodId

Unique identifier for this authentication method.

name instance-attribute

name: str

Human-readable name of the authentication method.

AuthStatusCapabilities

Bases: AnnotatedObject

UNSTABLE: Auth status capabilities supported by the agent.

Source code in src/aclientp/schema/v2/capabilities.py
class AuthStatusCapabilities(AnnotatedObject):
    """**UNSTABLE**: Auth status capabilities supported by the agent."""

AuthStatusRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for the auth/status method.

Source code in src/aclientp/schema/v2/auth.py
class AuthStatusRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for the ``auth/status`` method."""

AuthStatusResponse

Bases: AnnotatedObject

UNSTABLE: Response to the auth/status method.

Source code in src/aclientp/schema/v2/auth.py
class AuthStatusResponse(AnnotatedObject):
    """**UNSTABLE**: Response to the ``auth/status`` method."""

    state: AuthState
    """Whether the agent can start sessions without the user signing in first."""

    accounts: Sequence[AuthAccount] | MISSING = MISSING
    """The accounts the agent has configured, for display."""

accounts class-attribute instance-attribute

accounts: Sequence[AuthAccount] | MISSING = MISSING

The accounts the agent has configured, for display.

state instance-attribute

state: AuthState

Whether the agent can start sessions without the user signing in first.

AuthStatusUpdateNotification

Bases: AnnotatedObject

UNSTABLE: Notification sent by the agent when its authentication status changes.

Source code in src/aclientp/schema/v2/auth.py
class AuthStatusUpdateNotification(AnnotatedObject):
    """**UNSTABLE**: Notification sent by the agent when its authentication status changes."""

    state: AuthState
    """Whether the agent can start sessions without the user signing in first."""

    accounts: Sequence[AuthAccount] | MISSING = MISSING
    """The accounts the agent has configured, for display."""

accounts class-attribute instance-attribute

accounts: Sequence[AuthAccount] | MISSING = MISSING

The accounts the agent has configured, for display.

state instance-attribute

state: AuthState

Whether the agent can start sessions without the user signing in first.

AvailableCommandsUpdate

Bases: AnnotatedObject

The available commands are ready or have changed.

Source code in src/aclientp/schema/v2/session_updates.py
class AvailableCommandsUpdate(AnnotatedObject):
    """The available commands are ready or have changed."""

    session_update: Literal["available_commands_update"] = Field(
        default="available_commands_update", init=False
    )

    available_commands: Sequence[AvailableCommand]
    """All commands the agent can execute."""

available_commands instance-attribute

available_commands: Sequence[AvailableCommand]

All commands the agent can execute.

BackgroundSubagent

Bases: AnnotatedObject

A detached subagent session that has anything running.

Source code in src/aclientp/schema/v2/prompt.py
class BackgroundSubagent(AnnotatedObject):
    """A detached subagent session that has anything running."""

    type: Literal["subagent"] = Field(default="subagent", init=False)

    session_id: SessionId
    """The listed session."""

session_id instance-attribute

session_id: SessionId

The listed session.

BackgroundTerminal

Bases: AnnotatedObject

A process that keeps running after its tool call returned control to the model.

Source code in src/aclientp/schema/v2/prompt.py
class BackgroundTerminal(AnnotatedObject):
    """A process that keeps running after its tool call returned control to the model."""

    type: Literal["terminal"] = Field(default="terminal", init=False)

    terminal_id: TerminalId
    """The listed terminal."""

terminal_id instance-attribute

terminal_id: TerminalId

The listed terminal.

BackgroundToolCall

Bases: AnnotatedObject

Work of a tool call that continues without a process of its own, e.g. a watcher.

Source code in src/aclientp/schema/v2/prompt.py
class BackgroundToolCall(AnnotatedObject):
    """Work of a tool call that continues without a process of its own, e.g. a watcher."""

    type: Literal["tool_call"] = Field(default="tool_call", init=False)

    tool_call_id: ToolCallId
    """The listed tool call."""

tool_call_id instance-attribute

tool_call_id: ToolCallId

The listed tool call.

BlobResourceContents

Bases: AnnotatedObject

Binary contents of a resource.

Source code in src/aclientp/schema/v2/content.py
class BlobResourceContents(AnnotatedObject):
    """Binary contents of a resource."""

    blob: str
    """Base64-encoded bytes."""

    uri: str
    """URI of the resource."""

    mime_type: MediaType | MISSING | None = MISSING
    """MIME type of the resource."""

blob instance-attribute

blob: str

Base64-encoded bytes.

mime_type class-attribute instance-attribute

mime_type: MediaType | MISSING | None = MISSING

MIME type of the resource.

uri instance-attribute

uri: str

URI of the resource.

BooleanPropertySchema

Bases: AnnotatedObject

Schema for boolean properties in an elicitation form.

Source code in src/aclientp/schema/v2/elicitation.py
class BooleanPropertySchema(AnnotatedObject):
    """Schema for boolean properties in an elicitation form."""

    type: Literal["boolean"] = Field(default="boolean", init=False)

    title: str | MISSING | None = MISSING
    """Optional title for the property."""

    description: str | MISSING | None = MISSING
    """Human-readable description."""

    default: bool | MISSING | None = MISSING
    """Default value."""

default class-attribute instance-attribute

default: bool | MISSING | None = MISSING

Default value.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Human-readable description.

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Optional title for the property.

BooleanSessionConfigOption

Bases: _ConfigOptionBase

An on/off toggle.

Source code in src/aclientp/schema/v2/config_options.py
class BooleanSessionConfigOption(_ConfigOptionBase):
    """An on/off toggle."""

    type: Literal["boolean"] = Field(default="boolean", init=False)

    current_value: bool
    """The current value."""

current_value instance-attribute

current_value: bool

The current value.

CancelElicitationResponse

Bases: AnnotatedObject

The elicitation was cancelled.

Source code in src/aclientp/schema/v2/elicitation.py
class CancelElicitationResponse(AnnotatedObject):
    """The elicitation was cancelled."""

    action: Literal["cancel"] = Field(default="cancel", init=False)

CancelRequestNotification

Bases: AnnotatedObject

Parameters of $/cancel_request: cancel an ongoing request.

The request must be one the sender of the notification issued.

Source code in src/aclientp/schema/v2/protocol.py
class CancelRequestNotification(AnnotatedObject):
    """Parameters of ``$/cancel_request``: cancel an ongoing request.

    The request must be one the sender of the notification issued.
    """

    request_id: RequestId
    """The request to cancel."""

request_id instance-attribute

request_id: RequestId

The request to cancel.

CancelSessionNotification

Bases: AnnotatedObject

Notification to cancel a session's foreground work and its prompts not yet inserted.

Source code in src/aclientp/schema/v2/sessions.py
class CancelSessionNotification(AnnotatedObject):
    """Notification to cancel a session's foreground work and its prompts not yet inserted."""

    session_id: SessionId
    """The ID of the session whose foreground work to cancel."""

session_id instance-attribute

session_id: SessionId

The ID of the session whose foreground work to cancel.

CancelTerminalRequest

Bases: AnnotatedObject

Parameters of terminal/cancel: cancel one terminal.

Only for terminals that currently advertise capabilities.cancel.

Source code in src/aclientp/schema/v2/terminals.py
class CancelTerminalRequest(AnnotatedObject):
    """Parameters of ``terminal/cancel``: cancel one terminal.

    Only for terminals that currently advertise ``capabilities.cancel``.
    """

    session_id: SessionId
    """The ID of the session that owns the terminal."""

    terminal_id: TerminalId
    """The ID of the terminal to cancel."""

session_id instance-attribute

session_id: SessionId

The ID of the session that owns the terminal.

terminal_id instance-attribute

terminal_id: TerminalId

The ID of the terminal to cancel.

CancelTerminalResponse

Bases: AnnotatedObject

Response from cancelling a terminal.

Source code in src/aclientp/schema/v2/terminals.py
class CancelTerminalResponse(AnnotatedObject):
    """Response from cancelling a terminal."""

CancelToolCallRequest

Bases: AnnotatedObject

Parameters of tool_call/cancel: cancel one tool call.

Only for tool calls that currently advertise capabilities.cancel.

Source code in src/aclientp/schema/v2/tool_calls.py
class CancelToolCallRequest(AnnotatedObject):
    """Parameters of ``tool_call/cancel``: cancel one tool call.

    Only for tool calls that currently advertise ``capabilities.cancel``.
    """

    session_id: SessionId
    """The session that owns the tool call."""

    tool_call_id: ToolCallId
    """The tool call to cancel."""

session_id instance-attribute

session_id: SessionId

The session that owns the tool call.

tool_call_id instance-attribute

tool_call_id: ToolCallId

The tool call to cancel.

CancelToolCallResponse

Bases: AnnotatedObject

Response to tool_call/cancel.

Source code in src/aclientp/schema/v2/tool_calls.py
class CancelToolCallResponse(AnnotatedObject):
    """Response to ``tool_call/cancel``."""

CancelledPermissionOutcome

Bases: AnnotatedObject

No option was selected, e.g. because the session's work was cancelled.

Source code in src/aclientp/schema/v2/permissions.py
class CancelledPermissionOutcome(AnnotatedObject):
    """No option was selected, e.g. because the session's work was cancelled."""

    outcome: Literal["cancelled"] = Field(default="cancelled", init=False)

ClientAuthCapabilities

Bases: AnnotatedObject

Authentication capabilities supported by the client.

Source code in src/aclientp/schema/v2/capabilities.py
class ClientAuthCapabilities(AnnotatedObject):
    """Authentication capabilities supported by the client."""

    terminal: TerminalAuthCapabilities | MISSING | None = MISSING
    """Whether the client supports ``terminal`` authentication methods."""

terminal class-attribute instance-attribute

terminal: TerminalAuthCapabilities | MISSING | None = MISSING

Whether the client supports terminal authentication methods.

ClientCapabilities

Bases: AnnotatedObject

Capabilities supported by the client.

Source code in src/aclientp/schema/v2/capabilities.py
class ClientCapabilities(AnnotatedObject):
    """Capabilities supported by the client."""

    auth: ClientAuthCapabilities | MISSING | None = MISSING
    """Authentication capabilities supported by the client. Determines which authentication
    method types the agent may include in its ``InitializeResponse``."""

    elicitation: ElicitationCapabilities | MISSING | None = MISSING
    """Elicitation capabilities supported by the client. Determines which elicitation modes the
    agent may use."""

    session: ClientSessionCapabilities | MISSING | None = MISSING
    """Session-related capabilities supported by the client."""

auth class-attribute instance-attribute

auth: ClientAuthCapabilities | MISSING | None = MISSING

Authentication capabilities supported by the client. Determines which authentication method types the agent may include in its InitializeResponse.

elicitation class-attribute instance-attribute

elicitation: ElicitationCapabilities | MISSING | None = MISSING

Elicitation capabilities supported by the client. Determines which elicitation modes the agent may use.

session class-attribute instance-attribute

session: ClientSessionCapabilities | MISSING | None = MISSING

Session-related capabilities supported by the client.

ClientNotification

Bases: _Notification

A notification the client sends to the agent.

Source code in src/aclientp/schema/v2/protocol.py
class ClientNotification(_Notification):
    """A notification the client sends to the agent."""

ClientRequest

Bases: _Request

A request the client sends to the agent (an :data:AgentMethod).

Source code in src/aclientp/schema/v2/protocol.py
class ClientRequest(_Request):
    """A request the client sends to the agent (an :data:`AgentMethod`)."""

ClientSessionCapabilities

Bases: AnnotatedObject

UNSTABLE: Session-related capabilities supported by the client.

Source code in src/aclientp/schema/v2/capabilities.py
class ClientSessionCapabilities(AnnotatedObject):
    """**UNSTABLE**: Session-related capabilities supported by the client."""

    prompt_suggestions: PromptSuggestionsCapabilities | MISSING | None = MISSING
    """Support for ``prompt_suggestions_update`` session updates."""

    commands: CommandsCapabilities | MISSING | None = MISSING
    """Command types the client understands in addition to ``command``."""

commands class-attribute instance-attribute

commands: CommandsCapabilities | MISSING | None = MISSING

Command types the client understands in addition to command.

prompt_suggestions class-attribute instance-attribute

prompt_suggestions: PromptSuggestionsCapabilities | MISSING | None = MISSING

Support for prompt_suggestions_update session updates.

CloseSessionRequest

Bases: AnnotatedObject

Request parameters for closing an active session.

Source code in src/aclientp/schema/v2/sessions.py
class CloseSessionRequest(AnnotatedObject):
    """Request parameters for closing an active session."""

    session_id: SessionId
    """The ID of the session to close."""

session_id instance-attribute

session_id: SessionId

The ID of the session to close.

CloseSessionResponse

Bases: AnnotatedObject

Response from closing a session.

Source code in src/aclientp/schema/v2/sessions.py
class CloseSessionResponse(AnnotatedObject):
    """Response from closing a session."""

Command

Bases: AnnotatedObject

A slash command the user invokes by including /name in a prompt.

Source code in src/aclientp/schema/v2/commands.py
class Command(AnnotatedObject):
    """A slash command the user invokes by including ``/name`` in a prompt."""

    type: Literal["command"] = Field(default="command", init=False)

    name: str
    """Command name without the leading ``/``, e.g. ``create_plan``; no whitespace."""

    description: str
    """What the command does."""

    input: AvailableCommandInput | MISSING | None = MISSING
    """The command's input; omitted means it takes none."""

description instance-attribute

description: str

What the command does.

input class-attribute instance-attribute

input: AvailableCommandInput | MISSING | None = MISSING

The command's input; omitted means it takes none.

name instance-attribute

name: str

Command name without the leading /, e.g. create_plan; no whitespace.

CommandPermissionSubject

Bases: AnnotatedObject

Permission is requested before running a command.

Source code in src/aclientp/schema/v2/permissions.py
class CommandPermissionSubject(AnnotatedObject):
    """Permission is requested before running a command."""

    type: Literal["command"] = Field(default="command", init=False)

    command: str
    """The command that runs if permission is granted."""

    cwd: AbsolutePath
    """Absolute working directory of the command."""

    tool_call_id: ToolCallId | MISSING | None = MISSING
    """The associated tool call, when known."""

    terminal_id: TerminalId | MISSING | None = MISSING
    """The associated terminal, when already known."""

command instance-attribute

command: str

The command that runs if permission is granted.

cwd instance-attribute

Absolute working directory of the command.

terminal_id class-attribute instance-attribute

terminal_id: TerminalId | MISSING | None = MISSING

The associated terminal, when already known.

tool_call_id class-attribute instance-attribute

tool_call_id: ToolCallId | MISSING | None = MISSING

The associated tool call, when known.

CommandsCapabilities

Bases: AnnotatedObject

UNSTABLE: Command types the client understands in addition to command.

Source code in src/aclientp/schema/v2/capabilities.py
class CommandsCapabilities(AnnotatedObject):
    """**UNSTABLE**: Command types the client understands in addition to ``command``."""

    skill: CommandsSkillCapabilities | MISSING | None = MISSING
    """Support for ``skill`` command entries."""

skill class-attribute instance-attribute

skill: CommandsSkillCapabilities | MISSING | None = MISSING

Support for skill command entries.

CommandsSkillCapabilities

Bases: AnnotatedObject

UNSTABLE: Client support for skill command entries.

Source code in src/aclientp/schema/v2/capabilities.py
class CommandsSkillCapabilities(AnnotatedObject):
    """**UNSTABLE**: Client support for ``skill`` command entries."""

CompactionSummaryChunk

Bases: AnnotatedObject

A content block appended to a compaction's summary.

A first-seen ID creates an in-progress compaction; chunks append in receive order.

Source code in src/aclientp/schema/v2/session_updates.py
class CompactionSummaryChunk(AnnotatedObject):
    """A content block appended to a compaction's summary.

    A first-seen ID creates an in-progress compaction; chunks append in receive order.
    """

    session_update: Literal["compaction_summary_chunk"] = Field(
        default="compaction_summary_chunk", init=False
    )

    compaction_id: CompactionId
    """The compaction whose summary receives the content."""

    content: ContentBlock
    """The appended content block."""

compaction_id instance-attribute

compaction_id: CompactionId

The compaction whose summary receives the content.

content instance-attribute

content: ContentBlock

The appended content block.

CompactionUpdate

Bases: AnnotatedObject

A context compaction upsert, keyed by compaction_id.

The first update fixes the compaction's position in the timeline; summary and error are patches.

Source code in src/aclientp/schema/v2/session_updates.py
class CompactionUpdate(AnnotatedObject):
    """A context compaction upsert, keyed by ``compaction_id``.

    The first update fixes the compaction's position in the timeline; ``summary`` and
    ``error`` are patches.
    """

    session_update: Literal["compaction_update"] = Field(default="compaction_update", init=False)

    compaction_id: CompactionId
    """The agent-owned ID of the compaction, unique within the session."""

    status: CompactionStatus | MISSING | None = MISSING
    """Current lifecycle status; omitted leaves it unchanged, ``None`` resets it to
    ``in_progress``. A new compaction starts as ``in_progress``."""

    summary: Sequence[ContentBlock] | MISSING | None = MISSING
    """Complete replacement summary content to show the user."""

    error: str | MISSING | None = MISSING
    """Human-readable error details."""

compaction_id instance-attribute

compaction_id: CompactionId

The agent-owned ID of the compaction, unique within the session.

error class-attribute instance-attribute

error: str | MISSING | None = MISSING

Human-readable error details.

status class-attribute instance-attribute

status: CompactionStatus | MISSING | None = MISSING

Current lifecycle status; omitted leaves it unchanged, None resets it to in_progress. A new compaction starts as in_progress.

summary class-attribute instance-attribute

summary: Sequence[ContentBlock] | MISSING | None = MISSING

Complete replacement summary content to show the user.

CompleteElicitationNotification

Bases: AnnotatedObject

Notification sent by the agent when a URL-based elicitation is complete.

Source code in src/aclientp/schema/v2/elicitation.py
class CompleteElicitationNotification(AnnotatedObject):
    """Notification sent by the agent when a URL-based elicitation is complete."""

    elicitation_id: ElicitationId
    """The ID of the elicitation that completed."""

elicitation_id instance-attribute

elicitation_id: ElicitationId

The ID of the elicitation that completed.

ConfigOptionUpdate

Bases: AnnotatedObject

The session's config options have changed.

Source code in src/aclientp/schema/v2/session_updates.py
class ConfigOptionUpdate(AnnotatedObject):
    """The session's config options have changed."""

    session_update: Literal["config_option_update"] = Field(
        default="config_option_update", init=False
    )

    config_options: Sequence[SessionConfigOption]
    """All config options and their current values."""

config_options instance-attribute

config_options: Sequence[SessionConfigOption]

All config options and their current values.

Content

Bases: AnnotatedObject

A standard content block (text, image, resource) produced by a tool call.

Source code in src/aclientp/schema/v2/tool_calls.py
class Content(AnnotatedObject):
    """A standard content block (text, image, resource) produced by a tool call."""

    type: Literal["content"] = Field(default="content", init=False)

    content: ContentBlock
    """The content block."""

content instance-attribute

content: ContentBlock

The content block.

CopyDiffChange

Bases: _PathPairChange

A file was copied.

Source code in src/aclientp/schema/v2/tool_calls.py
class CopyDiffChange(_PathPairChange):
    """A file was copied."""

    operation: Literal["copy"] = Field(default="copy", init=False)

Cost

Bases: AnnotatedObject

Cumulative cost of a session.

Source code in src/aclientp/schema/v2/common.py
class Cost(AnnotatedObject):
    """Cumulative cost of a session."""

    amount: float
    """Total cumulative cost."""

    currency: str
    """Unit of ``amount``: an ISO 4217 code such as ``USD``, or another unit such as ``credits``."""

amount instance-attribute

amount: float

Total cumulative cost.

currency instance-attribute

currency: str

Unit of amount: an ISO 4217 code such as USD, or another unit such as credits.

CursorCapabilities

Bases: AnnotatedObject

UNSTABLE: The methods that currently accept a cursor.

A malformed value counts as no capabilities.

Source code in src/aclientp/schema/v2/cursors.py
class CursorCapabilities(AnnotatedObject):
    """**UNSTABLE**: The methods that currently accept a cursor.

    A malformed value counts as no capabilities.
    """

    fork: CursorForkCapabilities | MISSING | None = MISSING
    """``session/fork`` accepts this cursor."""

fork class-attribute instance-attribute

fork: CursorForkCapabilities | MISSING | None = MISSING

session/fork accepts this cursor.

CursorCompactionAnchor

Bases: AnnotatedObject

UNSTABLE: The cursor is next to a context compaction.

Source code in src/aclientp/schema/v2/cursors.py
class CursorCompactionAnchor(AnnotatedObject):
    """**UNSTABLE**: The cursor is next to a context compaction."""

    type: Literal["compaction"] = Field(default="compaction", init=False)

    compaction_id: CompactionId
    """The anchored compaction."""

    position: CursorAnchorPosition
    """On which side of the compaction the cursor is."""

compaction_id instance-attribute

compaction_id: CompactionId

The anchored compaction.

position instance-attribute

On which side of the compaction the cursor is.

CursorForkCapabilities

Bases: AnnotatedObject

UNSTABLE: The cursor can be passed to session/fork as cursorId.

Source code in src/aclientp/schema/v2/cursors.py
class CursorForkCapabilities(AnnotatedObject):
    """**UNSTABLE**: The cursor can be passed to ``session/fork`` as ``cursorId``."""

CursorMessageAnchor

Bases: AnnotatedObject

UNSTABLE: A cursor anchored to a message; type names the kind of message.

Source code in src/aclientp/schema/v2/cursors.py
class CursorMessageAnchor(AnnotatedObject):
    """**UNSTABLE**: A cursor anchored to a message; ``type`` names the kind of message."""

    message_id: MessageId
    """The anchored message."""

    position: CursorAnchorPosition
    """On which side of the message the cursor is."""

message_id instance-attribute

message_id: MessageId

The anchored message.

position instance-attribute

On which side of the message the cursor is.

CursorToolCallAnchor

Bases: AnnotatedObject

UNSTABLE: The cursor is next to a tool call.

Source code in src/aclientp/schema/v2/cursors.py
class CursorToolCallAnchor(AnnotatedObject):
    """**UNSTABLE**: The cursor is next to a tool call."""

    type: Literal["tool_call"] = Field(default="tool_call", init=False)

    tool_call_id: ToolCallId
    """The anchored tool call."""

    position: CursorAnchorPosition
    """On which side of the tool call the cursor is."""

position instance-attribute

On which side of the tool call the cursor is.

tool_call_id instance-attribute

tool_call_id: ToolCallId

The anchored tool call.

CursorUpdate

Bases: AnnotatedObject

UNSTABLE: A session cursor upsert, keyed by cursor_id.

The first update for a cursor MUST include anchor, which is fixed afterwards. capabilities and _meta are patches: omitted leaves them unchanged, None clears them.

Source code in src/aclientp/schema/v2/cursors.py
class CursorUpdate(AnnotatedObject):
    """**UNSTABLE**: A session cursor upsert, keyed by ``cursor_id``.

    The first update for a cursor MUST include ``anchor``, which is fixed afterwards.
    ``capabilities`` and ``_meta`` are patches: omitted leaves them unchanged, ``None``
    clears them.
    """

    session_update: Literal["cursor_update"] = Field(default="cursor_update", init=False)

    cursor_id: CursorId
    """The agent-owned ID of the cursor, unique within the session."""

    capabilities: CursorCapabilities | MISSING | None = MISSING
    """The methods that currently accept the cursor; a new cursor starts with none."""

    anchor: CursorAnchor | MISSING | None = MISSING
    """Where the cursor is; required on the first update for a cursor."""

anchor class-attribute instance-attribute

anchor: CursorAnchor | MISSING | None = MISSING

Where the cursor is; required on the first update for a cursor.

capabilities class-attribute instance-attribute

capabilities: CursorCapabilities | MISSING | None = MISSING

The methods that currently accept the cursor; a new cursor starts with none.

cursor_id instance-attribute

cursor_id: CursorId

The agent-owned ID of the cursor, unique within the session.

DeclineElicitationResponse

Bases: AnnotatedObject

The user declined.

Source code in src/aclientp/schema/v2/elicitation.py
class DeclineElicitationResponse(AnnotatedObject):
    """The user declined."""

    action: Literal["decline"] = Field(default="decline", init=False)

DeleteDiffChange

Bases: _PathChange

A file was deleted.

Source code in src/aclientp/schema/v2/tool_calls.py
class DeleteDiffChange(_PathChange):
    """A file was deleted."""

    operation: Literal["delete"] = Field(default="delete", init=False)

DeleteSessionRequest

Bases: AnnotatedObject

Request parameters for deleting an existing session from session/list.

Source code in src/aclientp/schema/v2/sessions.py
class DeleteSessionRequest(AnnotatedObject):
    """Request parameters for deleting an existing session from ``session/list``."""

    session_id: SessionId
    """The ID of the session to delete."""

session_id instance-attribute

session_id: SessionId

The ID of the session to delete.

DeleteSessionResponse

Bases: AnnotatedObject

Response from deleting a session.

Source code in src/aclientp/schema/v2/sessions.py
class DeleteSessionResponse(AnnotatedObject):
    """Response from deleting a session."""

Diff

Bases: AnnotatedObject

File changes produced by a tool call.

changes is authoritative for affected paths and operations; patch optionally carries renderable text for some or all of them.

Source code in src/aclientp/schema/v2/tool_calls.py
class Diff(AnnotatedObject):
    """File changes produced by a tool call.

    ``changes`` is authoritative for affected paths and operations; ``patch`` optionally
    carries renderable text for some or all of them.
    """

    type: Literal["diff"] = Field(default="diff", init=False)

    changes: Sequence[DiffChange] = Field(min_length=1)
    """The structured file changes; at least one."""

    patch: DiffPatch | MISSING | None = MISSING
    """Renderable patch text; agents SHOULD provide it whenever feasible."""

changes class-attribute instance-attribute

changes: Sequence[DiffChange] = Field(min_length=1)

The structured file changes; at least one.

patch class-attribute instance-attribute

patch: DiffPatch | MISSING | None = MISSING

Renderable patch text; agents SHOULD provide it whenever feasible.

DiffPatch

Bases: AnnotatedObject

Renderable patch text and its format.

Source code in src/aclientp/schema/v2/tool_calls.py
class DiffPatch(AnnotatedObject):
    """Renderable patch text and its format."""

    format: DiffPatchFormat
    """The patch format; ACP defines only ``git_patch``."""

    text: str
    """The patch text."""

format instance-attribute

The patch format; ACP defines only git_patch.

text instance-attribute

text: str

The patch text.

DisableProviderRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for providers/disable.

Source code in src/aclientp/schema/v2/providers.py
class DisableProviderRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for ``providers/disable``."""

    provider_id: ProviderId
    """Provider ID to disable."""

provider_id instance-attribute

provider_id: ProviderId

Provider ID to disable.

DisableProviderResponse

Bases: AnnotatedObject

UNSTABLE: Response to providers/disable.

Source code in src/aclientp/schema/v2/providers.py
class DisableProviderResponse(AnnotatedObject):
    """**UNSTABLE**: Response to ``providers/disable``."""

ElicitationCapabilities

Bases: AnnotatedObject

Elicitation capabilities supported by the client.

Source code in src/aclientp/schema/v2/capabilities.py
class ElicitationCapabilities(AnnotatedObject):
    """Elicitation capabilities supported by the client."""

    form: ElicitationFormCapabilities | MISSING | None = MISSING
    """Whether the client supports form-based elicitation."""

    url: ElicitationUrlCapabilities | MISSING | None = MISSING
    """Whether the client supports URL-based elicitation."""

form class-attribute instance-attribute

form: ElicitationFormCapabilities | MISSING | None = MISSING

Whether the client supports form-based elicitation.

url class-attribute instance-attribute

url: ElicitationUrlCapabilities | MISSING | None = MISSING

Whether the client supports URL-based elicitation.

ElicitationFormCapabilities

Bases: AnnotatedObject

Form-based elicitation capabilities.

Source code in src/aclientp/schema/v2/capabilities.py
class ElicitationFormCapabilities(AnnotatedObject):
    """Form-based elicitation capabilities."""

ElicitationSchema

Bases: AnnotatedObject

Type-safe elicitation schema for requesting structured user input.

Source code in src/aclientp/schema/v2/elicitation.py
class ElicitationSchema(AnnotatedObject):
    """Type-safe elicitation schema for requesting structured user input."""

    type: ElicitationSchemaType = Field(default="object", init=False)
    """Type discriminator. Always ``"object"``. Any other value is rejected."""

    title: str | MISSING | None = MISSING
    """Optional title for the schema."""

    properties: dict[str, ElicitationPropertySchema]
    """Property definitions (must be primitive types)."""

    required: Sequence[str] | MISSING | None = MISSING
    """List of required property names."""

    description: str | MISSING | None = MISSING
    """Optional description of what this schema represents."""

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Optional description of what this schema represents.

properties instance-attribute

properties: dict[str, ElicitationPropertySchema]

Property definitions (must be primitive types).

required class-attribute instance-attribute

required: Sequence[str] | MISSING | None = MISSING

List of required property names.

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Optional title for the schema.

type class-attribute instance-attribute

type: ElicitationSchemaType = Field(default='object', init=False)

Type discriminator. Always "object". Any other value is rejected.

ElicitationUrlCapabilities

Bases: AnnotatedObject

URL-based elicitation capabilities.

Source code in src/aclientp/schema/v2/capabilities.py
class ElicitationUrlCapabilities(AnnotatedObject):
    """URL-based elicitation capabilities."""

EmbeddedResource

Bases: AnnotatedObject

Resource contents embedded in a prompt or tool call result.

Requires the embeddedContext prompt capability in prompts.

Source code in src/aclientp/schema/v2/content.py
class EmbeddedResource(AnnotatedObject):
    """Resource contents embedded in a prompt or tool call result.

    Requires the ``embeddedContext`` prompt capability in prompts.
    """

    type: Literal["resource"] = Field(default="resource", init=False)

    resource: EmbeddedResourceResource
    """The embedded contents."""

    annotations: Annotations | MISSING | None = MISSING
    """Display and routing hints."""

annotations class-attribute instance-attribute

annotations: Annotations | MISSING | None = MISSING

Display and routing hints.

resource instance-attribute

The embedded contents.

EnumOption

Bases: AnnotatedObject

A titled enum option with a const value, human-readable title, and optional description.

Source code in src/aclientp/schema/v2/elicitation.py
class EnumOption(AnnotatedObject):
    """A titled enum option with a const value, human-readable title, and optional description."""

    const: str
    """The constant value for this option."""

    title: str
    """Human-readable title for this option."""

    description: str | MISSING | None = MISSING
    """Human-readable description."""

const instance-attribute

const: str

The constant value for this option.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Human-readable description.

title instance-attribute

title: str

Human-readable title for this option.

EnvVariable

Bases: AnnotatedObject

An environment variable to set when launching a process.

Source code in src/aclientp/schema/v2/common.py
class EnvVariable(AnnotatedObject):
    """An environment variable to set when launching a process."""

    name: str
    """Name of the variable."""

    value: str
    """Value of the variable."""

name instance-attribute

name: str

Name of the variable.

value instance-attribute

value: str

Value of the variable.

Error

Bases: Schema

A JSON-RPC error object.

Source code in src/aclientp/schema/v2/common.py
class Error(Schema):
    """A JSON-RPC error object."""

    code: ErrorCode
    """The error type, e.g. :data:`INVALID_PARAMS`."""

    message: str
    """A short, single-sentence description of the error."""

    data: ErrorData | MISSING | None = MISSING
    """Additional information about the error."""

code instance-attribute

code: ErrorCode

The error type, e.g. :data:INVALID_PARAMS.

data class-attribute instance-attribute

data: ErrorData | MISSING | None = MISSING

Additional information about the error.

message instance-attribute

message: str

A short, single-sentence description of the error.

ErrorResponse

Bases: _Message

A failed JSON-RPC response.

Source code in src/aclientp/schema/v2/protocol.py
class ErrorResponse(_Message):
    """A failed JSON-RPC response."""

    id: RequestId | None
    """The ID of the request answered; ``None`` if it could not be determined."""

    error: Error
    """The error."""

error instance-attribute

error: Error

The error.

id instance-attribute

id: RequestId | None

The ID of the request answered; None if it could not be determined.

ForkSessionRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for forking an existing session.

Source code in src/aclientp/schema/v2/sessions.py
class ForkSessionRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for forking an existing session."""

    session_id: SessionId
    """The ID of the session to fork."""

    cursor_id: CursorId | MISSING | None = MISSING
    """The session cursor to fork at. The new session's history is the source session's history
    before the cursor."""

    cwd: AbsolutePath
    """The working directory for this session. Must be an absolute path."""

    additional_directories: Sequence[AbsolutePath] | MISSING = MISSING
    """Additional workspace roots to activate for this session. Each path must be absolute."""

    mcp_servers: Sequence[McpServer] | MISSING = MISSING
    """List of MCP servers to connect to for this session."""

    system_prompt: SystemPrompt | MISSING | None = MISSING
    """System-level instructions for the forked session."""

    config_options: Sequence[InitialSessionConfigOption] | MISSING = MISSING
    """Initial values for the forked session's config options."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[AbsolutePath] | MISSING = MISSING

Additional workspace roots to activate for this session. Each path must be absolute.

config_options class-attribute instance-attribute

config_options: Sequence[InitialSessionConfigOption] | MISSING = MISSING

Initial values for the forked session's config options.

cursor_id class-attribute instance-attribute

cursor_id: CursorId | MISSING | None = MISSING

The session cursor to fork at. The new session's history is the source session's history before the cursor.

cwd instance-attribute

The working directory for this session. Must be an absolute path.

mcp_servers class-attribute instance-attribute

mcp_servers: Sequence[McpServer] | MISSING = MISSING

List of MCP servers to connect to for this session.

session_id instance-attribute

session_id: SessionId

The ID of the session to fork.

system_prompt class-attribute instance-attribute

system_prompt: SystemPrompt | MISSING | None = MISSING

System-level instructions for the forked session.

ForkSessionResponse

Bases: AnnotatedObject

UNSTABLE: Response from forking an existing session.

Source code in src/aclientp/schema/v2/sessions.py
class ForkSessionResponse(AnnotatedObject):
    """**UNSTABLE**: Response from forking an existing session."""

    session_id: SessionId
    """Unique identifier for the newly created forked session."""

    config_options: Sequence[SessionConfigOption] | MISSING = MISSING
    """Initial session configuration options."""

    available_commands: Sequence[AvailableCommand] | MISSING = MISSING
    """Initial commands the agent can execute in this session."""

available_commands class-attribute instance-attribute

available_commands: Sequence[AvailableCommand] | MISSING = MISSING

Initial commands the agent can execute in this session.

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | MISSING = MISSING

Initial session configuration options.

session_id instance-attribute

session_id: SessionId

Unique identifier for the newly created forked session.

FormElicitationRequest

Bases: _ScopedRequest

The client renders a form from requested_schema.

Source code in src/aclientp/schema/v2/elicitation.py
class FormElicitationRequest(_ScopedRequest):
    """The client renders a form from ``requested_schema``."""

    mode: Literal["form"] = Field(default="form", init=False)

    requested_schema: ElicitationSchema
    """The form fields."""

requested_schema instance-attribute

requested_schema: ElicitationSchema

The form fields.

HttpHeader

Bases: AnnotatedObject

An HTTP header to send with requests.

Source code in src/aclientp/schema/v2/common.py
class HttpHeader(AnnotatedObject):
    """An HTTP header to send with requests."""

    name: str
    """Name of the header."""

    value: str
    """Value of the header."""

name instance-attribute

name: str

Name of the header.

value instance-attribute

value: str

Value of the header.

Icon

Bases: AnnotatedObject

An optionally sized icon a user interface can display.

Source code in src/aclientp/schema/v2/common.py
class Icon(AnnotatedObject):
    """An optionally sized icon a user interface can display."""

    src: str
    """URI of the icon. MUST be an ``https:`` or ``data:`` URI."""

    mime_type: MediaType | MISSING | None = MISSING
    """MIME type override, if the source's type is missing or generic."""

    sizes: Sequence[str] | MISSING | None = MISSING
    """Sizes the icon can be used at, each ``WxH`` (e.g. ``48x48``) or ``any``."""

    theme: IconTheme | MISSING | None = MISSING
    """Theme the icon is designed for; omitted means not theme-specific."""

mime_type class-attribute instance-attribute

mime_type: MediaType | MISSING | None = MISSING

MIME type override, if the source's type is missing or generic.

sizes class-attribute instance-attribute

sizes: Sequence[str] | MISSING | None = MISSING

Sizes the icon can be used at, each WxH (e.g. 48x48) or any.

src instance-attribute

src: str

URI of the icon. MUST be an https: or data: URI.

theme class-attribute instance-attribute

theme: IconTheme | MISSING | None = MISSING

Theme the icon is designed for; omitted means not theme-specific.

IdleStateSessionUpdate

Bases: IdleStateUpdate

state_update: no foreground work is active.

Source code in src/aclientp/schema/v2/session_updates.py
class IdleStateSessionUpdate(IdleStateUpdate):
    """``state_update``: no foreground work is active."""

    session_update: Literal["state_update"] = Field(default="state_update", init=False)

IdleStateUpdate

Bases: _StateBase

No foreground work is active; background work may continue.

Agents SHOULD include stop_reason when the transition ends foreground work.

Source code in src/aclientp/schema/v2/prompt.py
class IdleStateUpdate(_StateBase):
    """No foreground work is active; background work may continue.

    Agents SHOULD include ``stop_reason`` when the transition ends foreground work.
    """

    state: Literal["idle"] = Field(default="idle", init=False)

    stop_reason: StopReason | MISSING | None = MISSING
    """Why foreground work stopped; omitted or ``None`` when there is no stop reason."""

    error: Error | MISSING | None = MISSING
    """For ``stop_reason == "error"``: the failure, as a JSON-RPC error object."""

    usage: Usage | MISSING | None = MISSING
    """**UNSTABLE**: Token usage of the completed foreground work."""

error class-attribute instance-attribute

error: Error | MISSING | None = MISSING

For stop_reason == "error": the failure, as a JSON-RPC error object.

stop_reason class-attribute instance-attribute

stop_reason: StopReason | MISSING | None = MISSING

Why foreground work stopped; omitted or None when there is no stop reason.

usage class-attribute instance-attribute

usage: Usage | MISSING | None = MISSING

UNSTABLE: Token usage of the completed foreground work.

ImageContent

Bases: AnnotatedObject

An image provided to or from an LLM. Requires the image prompt capability.

Source code in src/aclientp/schema/v2/content.py
class ImageContent(AnnotatedObject):
    """An image provided to or from an LLM. Requires the ``image`` prompt capability."""

    type: Literal["image"] = Field(default="image", init=False)

    data: str
    """Base64-encoded image data."""

    mime_type: MediaType
    """MIME type of the image."""

    uri: str | MISSING | None = MISSING
    """URI associated with the image."""

    annotations: Annotations | MISSING | None = MISSING
    """Display and routing hints."""

annotations class-attribute instance-attribute

annotations: Annotations | MISSING | None = MISSING

Display and routing hints.

data instance-attribute

data: str

Base64-encoded image data.

mime_type instance-attribute

mime_type: MediaType

MIME type of the image.

uri class-attribute instance-attribute

uri: str | MISSING | None = MISSING

URI associated with the image.

Implementation

Bases: AnnotatedObject

Name and version of a client or agent implementation.

Source code in src/aclientp/schema/v2/common.py
class Implementation(AnnotatedObject):
    """Name and version of a client or agent implementation."""

    name: str
    """Programmatic name; also the display name if ``title`` is not set."""

    title: str | MISSING | None = MISSING
    """Human-readable name for user interfaces."""

    version: str
    """Version of the implementation, e.g. ``1.0.0``."""

name instance-attribute

name: str

Programmatic name; also the display name if title is not set.

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Human-readable name for user interfaces.

version instance-attribute

version: str

Version of the implementation, e.g. 1.0.0.

InitialConfigOptionBoolean

Bases: _InitialConfigOptionBase

UNSTABLE: Initial value of a boolean config option.

Source code in src/aclientp/schema/v2/config_options.py
class InitialConfigOptionBoolean(_InitialConfigOptionBase):
    """**UNSTABLE**: Initial value of a boolean config option."""

    type: Literal["boolean"] = Field(default="boolean", init=False)

    value: bool
    """The value to set."""

value instance-attribute

value: bool

The value to set.

InitialConfigOptionId

Bases: _InitialConfigOptionBase

UNSTABLE: Initial value of a select config option.

Source code in src/aclientp/schema/v2/config_options.py
class InitialConfigOptionId(_InitialConfigOptionBase):
    """**UNSTABLE**: Initial value of a select config option."""

    type: Literal["id"] = Field(default="id", init=False)

    value: SessionConfigValueId
    """The value to select."""

value instance-attribute

The value to select.

InitialConfigOptionUnknown

Bases: Unknown, _InitialConfigOptionBase

UNSTABLE: Initial value of a custom or future kind of config option.

Source code in src/aclientp/schema/v2/config_options.py
class InitialConfigOptionUnknown(Unknown, _InitialConfigOptionBase):
    """**UNSTABLE**: Initial value of a custom or future kind of config option."""

    type: str
    """The value kind."""

    value: Any
    """The value to set."""

type instance-attribute

type: str

The value kind.

value instance-attribute

value: Any

The value to set.

InitializeProxyRequest

Bases: InitializeRequest

UNSTABLE: Parameters of proxy/initialize, sent instead of initialize.

A conductor sends it to every component that has a successor.

Source code in src/aclientp/schema/v2/protocol.py
class InitializeProxyRequest(InitializeRequest):
    """**UNSTABLE**: Parameters of ``proxy/initialize``, sent instead of ``initialize``.

    A conductor sends it to every component that has a successor.
    """

InitializeProxyResponse

Bases: InitializeResponse

UNSTABLE: Response to proxy/initialize; the same as an initialize response.

Source code in src/aclientp/schema/v2/protocol.py
class InitializeProxyResponse(InitializeResponse):
    """**UNSTABLE**: Response to ``proxy/initialize``; the same as an ``initialize`` response."""

InitializeRequest

Bases: AnnotatedObject

Request parameters for the initialize method.

Source code in src/aclientp/schema/v2/initialize.py
class InitializeRequest(AnnotatedObject):
    """Request parameters for the initialize method."""

    protocol_version: ProtocolVersion
    """The latest protocol version supported by the client."""

    info: Implementation
    """Information about the implementation sending this initialize request."""

    capabilities: ClientCapabilities | MISSING = MISSING
    """Capabilities supported by the client."""

capabilities class-attribute instance-attribute

capabilities: ClientCapabilities | MISSING = MISSING

Capabilities supported by the client.

info instance-attribute

Information about the implementation sending this initialize request.

protocol_version instance-attribute

protocol_version: ProtocolVersion

The latest protocol version supported by the client.

InitializeResponse

Bases: AnnotatedObject

Response to the initialize method.

Source code in src/aclientp/schema/v2/initialize.py
class InitializeResponse(AnnotatedObject):
    """Response to the ``initialize`` method."""

    protocol_version: ProtocolVersion
    """The highest protocol version supported by the agent that is at or below the version
    requested by the client. If no such version exists, initialization fails with error code
    -32022."""

    info: Implementation
    """Information about the implementation sending this initialize response."""

    capabilities: AgentCapabilities | MISSING = MISSING
    """Capabilities supported by the agent."""

    auth_methods: Sequence[AuthMethod] | MISSING = MISSING
    """Authentication methods supported by the agent."""

auth_methods class-attribute instance-attribute

auth_methods: Sequence[AuthMethod] | MISSING = MISSING

Authentication methods supported by the agent.

capabilities class-attribute instance-attribute

capabilities: AgentCapabilities | MISSING = MISSING

Capabilities supported by the agent.

info instance-attribute

Information about the implementation sending this initialize response.

protocol_version instance-attribute

protocol_version: ProtocolVersion

The highest protocol version supported by the agent that is at or below the version requested by the client. If no such version exists, initialization fails with error code -32022.

IntegerPropertySchema

Bases: AnnotatedObject

Schema for integer properties in an elicitation form.

Source code in src/aclientp/schema/v2/elicitation.py
class IntegerPropertySchema(AnnotatedObject):
    """Schema for integer properties in an elicitation form."""

    type: Literal["integer"] = Field(default="integer", init=False)

    title: str | MISSING | None = MISSING
    """Optional title for the property."""

    description: str | MISSING | None = MISSING
    """Human-readable description."""

    minimum: int | MISSING | None = MISSING
    """Minimum value (inclusive)."""

    maximum: int | MISSING | None = MISSING
    """Maximum value (inclusive)."""

    default: int | MISSING | None = MISSING
    """Default value."""

default class-attribute instance-attribute

default: int | MISSING | None = MISSING

Default value.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Human-readable description.

maximum class-attribute instance-attribute

maximum: int | MISSING | None = MISSING

Maximum value (inclusive).

minimum class-attribute instance-attribute

minimum: int | MISSING | None = MISSING

Minimum value (inclusive).

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Optional title for the property.

ListProvidersRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for providers/list.

Source code in src/aclientp/schema/v2/providers.py
class ListProvidersRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for ``providers/list``."""

ListProvidersResponse

Bases: AnnotatedObject

UNSTABLE: Response to providers/list.

Source code in src/aclientp/schema/v2/providers.py
class ListProvidersResponse(AnnotatedObject):
    """**UNSTABLE**: Response to ``providers/list``."""

    providers: Sequence[ProviderInfo]
    """Configurable providers with current routing info suitable for UI display."""

providers instance-attribute

providers: Sequence[ProviderInfo]

Configurable providers with current routing info suitable for UI display.

ListSessionsRequest

Bases: AnnotatedObject

Request parameters for listing existing sessions.

Source code in src/aclientp/schema/v2/sessions.py
class ListSessionsRequest(AnnotatedObject):
    """Request parameters for listing existing sessions."""

    cwd: AbsolutePath | MISSING | None = MISSING
    """Filter sessions by working directory. Must be an absolute path."""

    cursor: SessionListCursor | MISSING | None = MISSING
    """Opaque cursor token from a previous response's nextCursor field for cursor-based
    pagination"""

    archived: SessionArchiveFilter | MISSING | None = MISSING
    """Filter sessions by archive state."""

archived class-attribute instance-attribute

archived: SessionArchiveFilter | MISSING | None = MISSING

Filter sessions by archive state.

cursor class-attribute instance-attribute

cursor: SessionListCursor | MISSING | None = MISSING

Opaque cursor token from a previous response's nextCursor field for cursor-based pagination

cwd class-attribute instance-attribute

cwd: AbsolutePath | MISSING | None = MISSING

Filter sessions by working directory. Must be an absolute path.

ListSessionsResponse

Bases: AnnotatedObject

Response from listing sessions.

Source code in src/aclientp/schema/v2/sessions.py
class ListSessionsResponse(AnnotatedObject):
    """Response from listing sessions."""

    sessions: Sequence[SessionInfo]
    """Array of session information objects."""

    next_cursor: SessionListCursor | MISSING | None = MISSING
    """Opaque cursor token. If present, pass this in the next request's cursor parameter to
    fetch the next page. An empty string is a valid cursor, not the end of results."""

next_cursor class-attribute instance-attribute

next_cursor: SessionListCursor | MISSING | None = MISSING

Opaque cursor token. If present, pass this in the next request's cursor parameter to fetch the next page. An empty string is a valid cursor, not the end of results.

sessions instance-attribute

sessions: Sequence[SessionInfo]

Array of session information objects.

LoginAuthRequest

Bases: AnnotatedObject

Request parameters for the auth/login method.

Source code in src/aclientp/schema/v2/auth.py
class LoginAuthRequest(AnnotatedObject):
    """Request parameters for the ``auth/login`` method."""

    method_id: AuthMethodId
    """The ID of the authentication method to use. Must be one of the methods advertised in the
    initialize response."""

method_id instance-attribute

method_id: AuthMethodId

The ID of the authentication method to use. Must be one of the methods advertised in the initialize response.

LoginAuthResponse

Bases: AnnotatedObject

Response to the auth/login method.

Source code in src/aclientp/schema/v2/auth.py
class LoginAuthResponse(AnnotatedObject):
    """Response to the ``auth/login`` method."""

LogoutAuthRequest

Bases: AnnotatedObject

Request parameters for the auth/logout method.

Source code in src/aclientp/schema/v2/auth.py
class LogoutAuthRequest(AnnotatedObject):
    """Request parameters for the ``auth/logout`` method."""

LogoutAuthResponse

Bases: AnnotatedObject

Response to the auth/logout method.

Source code in src/aclientp/schema/v2/auth.py
class LogoutAuthResponse(AnnotatedObject):
    """Response to the ``auth/logout`` method."""

McpAcpCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for ACP MCP server transports.

Source code in src/aclientp/schema/v2/capabilities.py
class McpAcpCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for ACP MCP server transports."""

McpCapabilities

Bases: AnnotatedObject

MCP capabilities supported by the agent for session lifecycle requests.

Source code in src/aclientp/schema/v2/capabilities.py
class McpCapabilities(AnnotatedObject):
    """MCP capabilities supported by the agent for session lifecycle requests."""

    stdio: McpStdioCapabilities | MISSING | None = MISSING
    """Agent supports ``stdio`` MCP servers."""

    http: McpHttpCapabilities | MISSING | None = MISSING
    """Agent supports ``http`` MCP servers."""

    acp: McpAcpCapabilities | MISSING | None = MISSING
    """Agent supports ``acp`` MCP servers."""

acp class-attribute instance-attribute

acp: McpAcpCapabilities | MISSING | None = MISSING

Agent supports acp MCP servers.

http class-attribute instance-attribute

http: McpHttpCapabilities | MISSING | None = MISSING

Agent supports http MCP servers.

stdio class-attribute instance-attribute

stdio: McpStdioCapabilities | MISSING | None = MISSING

Agent supports stdio MCP servers.

McpError

Bases: Schema

UNSTABLE: An inner MCP error, distinct from an outer ACP error.

Source code in src/aclientp/schema/v2/mcp.py
class McpError(Schema):
    """**UNSTABLE**: An inner MCP error, distinct from an outer ACP error."""

    code: int
    """Inner MCP error code. Never an ACP error code."""

    message: str
    """Inner MCP error message."""

    data: Any | MISSING = MISSING
    """Error data; an explicit ``None`` (``null``) is kept."""

code instance-attribute

code: int

Inner MCP error code. Never an ACP error code.

data class-attribute instance-attribute

data: Any | MISSING = MISSING

Error data; an explicit None (null) is kept.

message instance-attribute

message: str

Inner MCP error message.

McpHttpCapabilities

Bases: AnnotatedObject

Capabilities for HTTP MCP server transports.

Source code in src/aclientp/schema/v2/capabilities.py
class McpHttpCapabilities(AnnotatedObject):
    """Capabilities for HTTP MCP server transports."""

McpServerAcp

Bases: AnnotatedObject

UNSTABLE: ACP transport configuration for MCP.

The server is provided by an ACP component and talks over the ACP channel using mcp/message.

Source code in src/aclientp/schema/v2/mcp.py
class McpServerAcp(AnnotatedObject):
    """**UNSTABLE**: ACP transport configuration for MCP.

    The server is provided by an ACP component and talks over the ACP channel using
    ``mcp/message``.
    """

    type: Literal["acp"] = Field(default="acp", init=False)

    name: str
    """Human-readable name identifying this MCP server."""

    server_id: McpServerAcpId
    """Identifier generated by the component providing the server; never reused."""

name instance-attribute

name: str

Human-readable name identifying this MCP server.

server_id instance-attribute

server_id: McpServerAcpId

Identifier generated by the component providing the server; never reused.

McpServerHttp

Bases: AnnotatedObject

HTTP transport configuration for MCP.

Source code in src/aclientp/schema/v2/mcp.py
class McpServerHttp(AnnotatedObject):
    """HTTP transport configuration for MCP."""

    type: Literal["http"] = Field(default="http", init=False)

    name: str
    """Human-readable name identifying this MCP server."""

    url: str
    """URL to the MCP server."""

    headers: Sequence[HttpHeader] | MISSING = MISSING
    """HTTP headers to set when making requests to the MCP server. Headers the MCP transport
    defines are owned by the transport, and Agents use the transport's values for them."""

headers class-attribute instance-attribute

headers: Sequence[HttpHeader] | MISSING = MISSING

HTTP headers to set when making requests to the MCP server. Headers the MCP transport defines are owned by the transport, and Agents use the transport's values for them.

name instance-attribute

name: str

Human-readable name identifying this MCP server.

url instance-attribute

url: str

URL to the MCP server.

McpServerStdio

Bases: AnnotatedObject

Stdio transport configuration for MCP.

Source code in src/aclientp/schema/v2/mcp.py
class McpServerStdio(AnnotatedObject):
    """Stdio transport configuration for MCP."""

    type: Literal["stdio"] = Field(default="stdio", init=False)

    name: str
    """Human-readable name identifying this MCP server."""

    command: AbsolutePath
    """Absolute path to the MCP server executable."""

    args: Sequence[str] | MISSING = MISSING
    """Command-line arguments to pass to the MCP server."""

    env: Sequence[EnvVariable] | MISSING = MISSING
    """Environment variables to set when launching the MCP server. Names SHOULD be unique.
    Agents MAY reject duplicates with ``-32602``, and otherwise the last entry wins."""

args class-attribute instance-attribute

args: Sequence[str] | MISSING = MISSING

Command-line arguments to pass to the MCP server.

command instance-attribute

command: AbsolutePath

Absolute path to the MCP server executable.

env class-attribute instance-attribute

env: Sequence[EnvVariable] | MISSING = MISSING

Environment variables to set when launching the MCP server. Names SHOULD be unique. Agents MAY reject duplicates with -32602, and otherwise the last entry wins.

name instance-attribute

name: str

Human-readable name identifying this MCP server.

McpStdioCapabilities

Bases: AnnotatedObject

Capabilities for stdio MCP server transports.

Source code in src/aclientp/schema/v2/capabilities.py
class McpStdioCapabilities(AnnotatedObject):
    """Capabilities for stdio MCP server transports."""

MessageMcpError

Bases: AnnotatedObject

UNSTABLE: Successful mcp/message call whose inner MCP request failed.

Source code in src/aclientp/schema/v2/mcp.py
class MessageMcpError(AnnotatedObject):
    """**UNSTABLE**: Successful ``mcp/message`` call whose inner MCP request failed."""

    error: McpError
    """The inner MCP error."""

error instance-attribute

error: McpError

The inner MCP error.

MessageMcpNotification

Bases: AnnotatedObject

UNSTABLE: Notification for an active inner MCP request, from provider to consumer.

Source code in src/aclientp/schema/v2/mcp.py
class MessageMcpNotification(AnnotatedObject):
    """**UNSTABLE**: Notification for an active inner MCP request, from provider to consumer."""

    server_id: McpServerAcpId
    """The declared ACP MCP server handling the associated request."""

    request_id: McpRequestId
    """The identifier of the active inner MCP request."""

    method: str
    """The inner MCP method name."""

    params: dict[str, Any] | MISSING | None = MISSING
    """The inner MCP params; ``None`` is the same as omitted."""

method instance-attribute

method: str

The inner MCP method name.

params class-attribute instance-attribute

params: dict[str, Any] | MISSING | None = MISSING

The inner MCP params; None is the same as omitted.

request_id instance-attribute

request_id: McpRequestId

The identifier of the active inner MCP request.

server_id instance-attribute

server_id: McpServerAcpId

The declared ACP MCP server handling the associated request.

MessageMcpRequest

Bases: AnnotatedObject

UNSTABLE: Parameters of mcp/message: an inner MCP request to the provider.

Source code in src/aclientp/schema/v2/mcp.py
class MessageMcpRequest(AnnotatedObject):
    """**UNSTABLE**: Parameters of ``mcp/message``: an inner MCP request to the provider."""

    server_id: McpServerAcpId
    """The declared ACP MCP server receiving this request."""

    request_id: McpRequestId
    """The caller-generated identifier for the inner MCP request."""

    method: str
    """The inner MCP method name."""

    params: dict[str, Any] | MISSING | None = MISSING
    """The inner MCP params; ``None`` is the same as omitted."""

method instance-attribute

method: str

The inner MCP method name.

params class-attribute instance-attribute

params: dict[str, Any] | MISSING | None = MISSING

The inner MCP params; None is the same as omitted.

request_id instance-attribute

request_id: McpRequestId

The caller-generated identifier for the inner MCP request.

server_id instance-attribute

server_id: McpServerAcpId

The declared ACP MCP server receiving this request.

MessageMcpResult

Bases: AnnotatedObject

UNSTABLE: Successful mcp/message outcome: an opaque inner MCP result.

Source code in src/aclientp/schema/v2/mcp.py
class MessageMcpResult(AnnotatedObject):
    """**UNSTABLE**: Successful ``mcp/message`` outcome: an opaque inner MCP result."""

    result: Any
    """The inner MCP result; may be ``None`` (JSON ``null``)."""

result instance-attribute

result: Any

The inner MCP result; may be None (JSON null).

ModifyDiffChange

Bases: _PathChange

A file was modified in place.

Source code in src/aclientp/schema/v2/tool_calls.py
class ModifyDiffChange(_PathChange):
    """A file was modified in place."""

    operation: Literal["modify"] = Field(default="modify", init=False)

MoveDiffChange

Bases: _PathPairChange

A file was moved or renamed.

Source code in src/aclientp/schema/v2/tool_calls.py
class MoveDiffChange(_PathPairChange):
    """A file was moved or renamed."""

    operation: Literal["move"] = Field(default="move", init=False)

MultiSelectPropertySchema

Bases: AnnotatedObject

Schema for multi-select (array) properties in an elicitation form.

Source code in src/aclientp/schema/v2/elicitation.py
class MultiSelectPropertySchema(AnnotatedObject):
    """Schema for multi-select (array) properties in an elicitation form."""

    type: Literal["array"] = Field(default="array", init=False)

    title: str | MISSING | None = MISSING
    """Optional title for the property."""

    description: str | MISSING | None = MISSING
    """Human-readable description."""

    min_items: int | MISSING | None = Field(default=MISSING, ge=0)
    """Minimum number of items to select."""

    max_items: int | MISSING | None = Field(default=MISSING, ge=0)
    """Maximum number of items to select."""

    items: MultiSelectItems
    """The items definition describing allowed values."""

    default: Sequence[str] | MISSING | None = MISSING
    """Default selected values."""

default class-attribute instance-attribute

default: Sequence[str] | MISSING | None = MISSING

Default selected values.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Human-readable description.

items instance-attribute

The items definition describing allowed values.

max_items class-attribute instance-attribute

max_items: int | MISSING | None = Field(default=MISSING, ge=0)

Maximum number of items to select.

min_items class-attribute instance-attribute

min_items: int | MISSING | None = Field(default=MISSING, ge=0)

Minimum number of items to select.

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Optional title for the property.

NewSessionRequest

Bases: AnnotatedObject

Request parameters for creating a new session.

Source code in src/aclientp/schema/v2/sessions.py
class NewSessionRequest(AnnotatedObject):
    """Request parameters for creating a new session."""

    cwd: AbsolutePath
    """The working directory for this session. Must be an absolute path."""

    additional_directories: Sequence[AbsolutePath] | MISSING = MISSING
    """Additional workspace roots for this session. Each path must be absolute."""

    mcp_servers: Sequence[McpServer] | MISSING = MISSING
    """List of MCP (Model Context Protocol) servers the agent should connect to."""

    system_prompt: SystemPrompt | MISSING | None = MISSING
    """System-level instructions for the new session."""

    config_options: Sequence[InitialSessionConfigOption] | MISSING = MISSING
    """Initial values for the session's config options."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[AbsolutePath] | MISSING = MISSING

Additional workspace roots for this session. Each path must be absolute.

config_options class-attribute instance-attribute

config_options: Sequence[InitialSessionConfigOption] | MISSING = MISSING

Initial values for the session's config options.

cwd instance-attribute

The working directory for this session. Must be an absolute path.

mcp_servers class-attribute instance-attribute

mcp_servers: Sequence[McpServer] | MISSING = MISSING

List of MCP (Model Context Protocol) servers the agent should connect to.

system_prompt class-attribute instance-attribute

system_prompt: SystemPrompt | MISSING | None = MISSING

System-level instructions for the new session.

NewSessionResponse

Bases: AnnotatedObject

Response from creating a new session.

New sessions are idle until a state_update says otherwise.

Source code in src/aclientp/schema/v2/sessions.py
class NewSessionResponse(AnnotatedObject):
    """Response from creating a new session.

    New sessions are ``idle`` until a ``state_update`` says otherwise.
    """

    session_id: SessionId
    """Unique identifier for the created session."""

    config_options: Sequence[SessionConfigOption] | MISSING = MISSING
    """Initial session configuration options."""

    available_commands: Sequence[AvailableCommand] | MISSING = MISSING
    """Initial commands the agent can execute in this session."""

available_commands class-attribute instance-attribute

available_commands: Sequence[AvailableCommand] | MISSING = MISSING

Initial commands the agent can execute in this session.

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | MISSING = MISSING

Initial session configuration options.

session_id instance-attribute

session_id: SessionId

Unique identifier for the created session.

Notice

Bases: AnnotatedObject

Fire-and-forget information for the user, not part of session history.

Agents must not rely on a notice being received or shown.

Source code in src/aclientp/schema/v2/session_updates.py
class Notice(AnnotatedObject):
    """Fire-and-forget information for the user, not part of session history.

    Agents must not rely on a notice being received or shown.
    """

    session_update: Literal["notice"] = Field(default="notice", init=False)

    severity: NoticeSeverity
    """Presentation severity hint."""

    title: str = Field(min_length=1)
    """Plain-text title that can stand alone."""

    description: str | MISSING | None = MISSING
    """Plain-text detail or guidance."""

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Plain-text detail or guidance.

severity instance-attribute

severity: NoticeSeverity

Presentation severity hint.

title class-attribute instance-attribute

title: str = Field(min_length=1)

Plain-text title that can stand alone.

NumberPropertySchema

Bases: AnnotatedObject

Schema for number (floating-point) properties in an elicitation form.

Source code in src/aclientp/schema/v2/elicitation.py
class NumberPropertySchema(AnnotatedObject):
    """Schema for number (floating-point) properties in an elicitation form."""

    type: Literal["number"] = Field(default="number", init=False)

    title: str | MISSING | None = MISSING
    """Optional title for the property."""

    description: str | MISSING | None = MISSING
    """Human-readable description."""

    minimum: float | MISSING | None = MISSING
    """Minimum value (inclusive)."""

    maximum: float | MISSING | None = MISSING
    """Maximum value (inclusive)."""

    default: float | MISSING | None = MISSING
    """Default value."""

default class-attribute instance-attribute

default: float | MISSING | None = MISSING

Default value.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Human-readable description.

maximum class-attribute instance-attribute

maximum: float | MISSING | None = MISSING

Maximum value (inclusive).

minimum class-attribute instance-attribute

minimum: float | MISSING | None = MISSING

Minimum value (inclusive).

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Optional title for the property.

OtherStateSessionUpdate

Bases: OtherStateUpdate

state_update with a custom or future state.

Source code in src/aclientp/schema/v2/session_updates.py
class OtherStateSessionUpdate(OtherStateUpdate):
    """``state_update`` with a custom or future state."""

    session_update: Literal["state_update"] = Field(default="state_update", init=False)

OtherStateUpdate

Bases: Unknown, _StateBase

A custom or future state; state values starting with _ are extensions.

Source code in src/aclientp/schema/v2/prompt.py
class OtherStateUpdate(Unknown, _StateBase):
    """A custom or future state; ``state`` values starting with ``_`` are extensions."""

    state: str
    """The state."""

state instance-attribute

state: str

The state.

PermissionOption

Bases: AnnotatedObject

An option offered to the user.

Source code in src/aclientp/schema/v2/permissions.py
class PermissionOption(AnnotatedObject):
    """An option offered to the user."""

    option_id: PermissionOptionId
    """Identifier of the option; unique within the request."""

    name: str
    """Label shown to the user."""

    kind: PermissionOptionKind
    """Hint about the nature of the option."""

kind instance-attribute

Hint about the nature of the option.

name instance-attribute

name: str

Label shown to the user.

option_id instance-attribute

option_id: PermissionOptionId

Identifier of the option; unique within the request.

PlanEntry

Bases: AnnotatedObject

A task or goal the agent intends to accomplish.

Source code in src/aclientp/schema/v2/plans.py
class PlanEntry(AnnotatedObject):
    """A task or goal the agent intends to accomplish."""

    content: str
    """What the task aims to accomplish."""

    priority: PlanEntryPriority
    """Relative importance of the task."""

    status: PlanEntryStatus
    """Current status of the task."""

content instance-attribute

content: str

What the task aims to accomplish.

priority instance-attribute

Relative importance of the task.

status instance-attribute

Current status of the task.

PlanItems

Bases: AnnotatedObject

A plan as structured entries.

Source code in src/aclientp/schema/v2/plans.py
class PlanItems(AnnotatedObject):
    """A plan as structured entries."""

    type: Literal["items"] = Field(default="items", init=False)

    plan_id: PlanId
    """The plan to update."""

    entries: Sequence[PlanEntry]
    """All tasks of the plan; updates send the complete list, which replaces the old one."""

entries instance-attribute

entries: Sequence[PlanEntry]

All tasks of the plan; updates send the complete list, which replaces the old one.

plan_id instance-attribute

plan_id: PlanId

The plan to update.

PlanMarkdown

Bases: AnnotatedObject

UNSTABLE: A plan as raw markdown content.

Source code in src/aclientp/schema/v2/plans.py
class PlanMarkdown(AnnotatedObject):
    """**UNSTABLE**: A plan as raw markdown content."""

    type: Literal["markdown"] = Field(default="markdown", init=False)

    plan_id: PlanId
    """The plan to update."""

    content: str
    """Markdown content of the plan."""

    path: AbsolutePath | MISSING | None = MISSING
    """Absolute path of the file holding the plan."""

content instance-attribute

content: str

Markdown content of the plan.

path class-attribute instance-attribute

path: AbsolutePath | MISSING | None = MISSING

Absolute path of the file holding the plan.

plan_id instance-attribute

plan_id: PlanId

The plan to update.

PlanRemoved

Bases: AnnotatedObject

UNSTABLE: The plan with this ID was removed.

Source code in src/aclientp/schema/v2/plans.py
class PlanRemoved(AnnotatedObject):
    """**UNSTABLE**: The plan with this ID was removed."""

    session_update: Literal["plan_removed"] = Field(default="plan_removed", init=False)

    plan_id: PlanId
    """The removed plan."""

plan_id instance-attribute

plan_id: PlanId

The removed plan.

PlanUpdate

Bases: AnnotatedObject

New content of the plan identified by its plan_id.

Source code in src/aclientp/schema/v2/plans.py
class PlanUpdate(AnnotatedObject):
    """New content of the plan identified by its ``plan_id``."""

    session_update: Literal["plan_update"] = Field(default="plan_update", init=False)

    plan: PlanUpdateContent
    """The updated plan content."""

plan instance-attribute

The updated plan content.

PromptAudioCapabilities

Bases: AnnotatedObject

Capabilities for audio content in prompt requests.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptAudioCapabilities(AnnotatedObject):
    """Capabilities for audio content in prompt requests."""

PromptCapabilities

Bases: AnnotatedObject

Prompt capabilities supported by the agent in session/prompt requests.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptCapabilities(AnnotatedObject):
    """Prompt capabilities supported by the agent in ``session/prompt`` requests."""

    image: PromptImageCapabilities | MISSING | None = MISSING
    """Agent supports ``image`` content blocks."""

    audio: PromptAudioCapabilities | MISSING | None = MISSING
    """Agent supports ``audio`` content blocks."""

    embedded_context: PromptEmbeddedContextCapabilities | MISSING | None = MISSING
    """Agent supports embedded context in ``session/prompt`` requests."""

    skill: PromptSkillCapabilities | MISSING | None = MISSING
    """Agent supports ``skill`` content blocks."""

audio class-attribute instance-attribute

audio: PromptAudioCapabilities | MISSING | None = MISSING

Agent supports audio content blocks.

embedded_context class-attribute instance-attribute

embedded_context: PromptEmbeddedContextCapabilities | MISSING | None = MISSING

Agent supports embedded context in session/prompt requests.

image class-attribute instance-attribute

image: PromptImageCapabilities | MISSING | None = MISSING

Agent supports image content blocks.

skill class-attribute instance-attribute

skill: PromptSkillCapabilities | MISSING | None = MISSING

Agent supports skill content blocks.

PromptEmbeddedContextCapabilities

Bases: AnnotatedObject

Capabilities for embedded context in prompt requests.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptEmbeddedContextCapabilities(AnnotatedObject):
    """Capabilities for embedded context in prompt requests."""

PromptImageCapabilities

Bases: AnnotatedObject

Capabilities for image content in prompt requests.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptImageCapabilities(AnnotatedObject):
    """Capabilities for image content in prompt requests."""

PromptRequest

Bases: AnnotatedObject

Parameters of session/prompt: a user message for the session.

Agents MUST support text and resource_link content; other block types need the matching prompt capability.

Source code in src/aclientp/schema/v2/prompt.py
class PromptRequest(AnnotatedObject):
    """Parameters of ``session/prompt``: a user message for the session.

    Agents MUST support ``text`` and ``resource_link`` content; other block types
    need the matching prompt capability.
    """

    session_id: SessionId
    """The session to send the message to."""

    prompt: Sequence[ContentBlock] = Field(min_length=1)
    """The content of the user message; at least one block."""

    idempotency_key: IdempotencyKey | MISSING | None = MISSING
    """Identifies this submission, so a retry does not insert the message twice."""

idempotency_key class-attribute instance-attribute

idempotency_key: IdempotencyKey | MISSING | None = MISSING

Identifies this submission, so a retry does not insert the message twice.

prompt class-attribute instance-attribute

prompt: Sequence[ContentBlock] = Field(min_length=1)

The content of the user message; at least one block.

session_id instance-attribute

session_id: SessionId

The session to send the message to.

PromptResponse

Bases: AnnotatedObject

Acknowledges that the user message was inserted into the conversation.

It does not mean the turn has finished; that is reported with state_update.

Source code in src/aclientp/schema/v2/prompt.py
class PromptResponse(AnnotatedObject):
    """Acknowledges that the user message was inserted into the conversation.

    It does not mean the turn has finished; that is reported with ``state_update``.
    """

    message_id: MessageId
    """ID of the inserted user message; live user message updates use the same ID."""

message_id instance-attribute

message_id: MessageId

ID of the inserted user message; live user message updates use the same ID.

PromptSkillCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for skill content blocks in prompt requests.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptSkillCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for ``skill`` content blocks in prompt requests."""

    inline: PromptSkillInlineCapabilities | MISSING | None = MISSING
    """Agent supports ``skill`` content blocks at any position in a prompt."""

inline class-attribute instance-attribute

inline: PromptSkillInlineCapabilities | MISSING | None = MISSING

Agent supports skill content blocks at any position in a prompt.

PromptSkillInlineCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for skill content blocks at any position in a prompt.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptSkillInlineCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for ``skill`` content blocks at any position in a prompt."""

PromptSuggestion

Bases: AnnotatedObject

UNSTABLE: A prompt the agent predicts the user will send next.

Source code in src/aclientp/schema/v2/session_updates.py
class PromptSuggestion(AnnotatedObject):
    """**UNSTABLE**: A prompt the agent predicts the user will send next."""

    prompt: Sequence[ContentBlock] = Field(min_length=1)
    """The content of the suggested prompt."""

prompt class-attribute instance-attribute

prompt: Sequence[ContentBlock] = Field(min_length=1)

The content of the suggested prompt.

PromptSuggestionsAudioCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for audio content in prompt suggestions.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptSuggestionsAudioCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for audio content in prompt suggestions."""

PromptSuggestionsCapabilities

Bases: AnnotatedObject

UNSTABLE: Client support for prompt_suggestions_update session updates.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptSuggestionsCapabilities(AnnotatedObject):
    """**UNSTABLE**: Client support for ``prompt_suggestions_update`` session updates."""

    image: PromptSuggestionsImageCapabilities | MISSING | None = MISSING
    """Whether prompt suggestions may include ``image`` content blocks."""

    audio: PromptSuggestionsAudioCapabilities | MISSING | None = MISSING
    """Whether prompt suggestions may include ``audio`` content blocks."""

    embedded_context: PromptSuggestionsEmbeddedContextCapabilities | MISSING | None = MISSING
    """Whether prompt suggestions may include ``resource`` content blocks."""

audio class-attribute instance-attribute

audio: PromptSuggestionsAudioCapabilities | MISSING | None = MISSING

Whether prompt suggestions may include audio content blocks.

embedded_context class-attribute instance-attribute

embedded_context: PromptSuggestionsEmbeddedContextCapabilities | MISSING | None = MISSING

Whether prompt suggestions may include resource content blocks.

image class-attribute instance-attribute

image: PromptSuggestionsImageCapabilities | MISSING | None = MISSING

Whether prompt suggestions may include image content blocks.

PromptSuggestionsEmbeddedContextCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for embedded resources in prompt suggestions.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptSuggestionsEmbeddedContextCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for embedded resources in prompt suggestions."""

PromptSuggestionsImageCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for image content in prompt suggestions.

Source code in src/aclientp/schema/v2/capabilities.py
class PromptSuggestionsImageCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for image content in prompt suggestions."""

PromptSuggestionsUpdate

Bases: AnnotatedObject

UNSTABLE: Replaces the session's prompt suggestions.

Source code in src/aclientp/schema/v2/session_updates.py
class PromptSuggestionsUpdate(AnnotatedObject):
    """**UNSTABLE**: Replaces the session's prompt suggestions."""

    session_update: Literal["prompt_suggestions_update"] = Field(
        default="prompt_suggestions_update", init=False
    )

    suggestions: Sequence[PromptSuggestion]
    """Suggestions, most likely first; an empty list withdraws all."""

suggestions instance-attribute

suggestions: Sequence[PromptSuggestion]

Suggestions, most likely first; an empty list withdraws all.

ProviderCurrentConfig

Bases: AnnotatedObject

UNSTABLE: Current effective non-secret routing configuration for a provider.

Source code in src/aclientp/schema/v2/providers.py
class ProviderCurrentConfig(AnnotatedObject):
    """**UNSTABLE**: Current effective non-secret routing configuration for a provider."""

    api_type: LlmProtocol
    """Protocol currently used by this provider."""

    base_url: str
    """Base URL currently used by this provider."""

api_type instance-attribute

api_type: LlmProtocol

Protocol currently used by this provider.

base_url instance-attribute

base_url: str

Base URL currently used by this provider.

ProviderInfo

Bases: AnnotatedObject

UNSTABLE: Information about a configurable LLM provider.

Source code in src/aclientp/schema/v2/providers.py
class ProviderInfo(AnnotatedObject):
    """**UNSTABLE**: Information about a configurable LLM provider."""

    provider_id: ProviderId
    """Provider identifier, for example "main" or "openai"."""

    supported: Sequence[LlmProtocol]
    """Supported protocol types for this provider."""

    required: bool
    """Whether this provider is mandatory and cannot be disabled via ``providers/disable``. If
    true, clients must not call ``providers/disable`` for this provider ID."""

    current: ProviderCurrentConfig | MISSING | None = MISSING
    """Current effective non-secret routing config. Null or omitted means provider is
    disabled."""

current class-attribute instance-attribute

current: ProviderCurrentConfig | MISSING | None = MISSING

Current effective non-secret routing config. Null or omitted means provider is disabled.

provider_id instance-attribute

provider_id: ProviderId

Provider identifier, for example "main" or "openai".

required instance-attribute

required: bool

Whether this provider is mandatory and cannot be disabled via providers/disable. If true, clients must not call providers/disable for this provider ID.

supported instance-attribute

supported: Sequence[LlmProtocol]

Supported protocol types for this provider.

ProvidersCapabilities

Bases: AnnotatedObject

UNSTABLE: Provider configuration capabilities supported by the agent.

Source code in src/aclientp/schema/v2/capabilities.py
class ProvidersCapabilities(AnnotatedObject):
    """**UNSTABLE**: Provider configuration capabilities supported by the agent."""

ProxyNotification

Bases: _Notification

UNSTABLE: A notification to a proxy in a proxy chain.

Source code in src/aclientp/schema/v2/protocol.py
class ProxyNotification(_Notification):
    """**UNSTABLE**: A notification to a proxy in a proxy chain."""

ProxyRequest

Bases: _Request

UNSTABLE: A request to a proxy in a proxy chain (a :data:ProxyMethod).

Source code in src/aclientp/schema/v2/protocol.py
class ProxyRequest(_Request):
    """**UNSTABLE**: A request to a proxy in a proxy chain (a :data:`ProxyMethod`)."""

ProxySuccessorNotification

Bases: AnnotatedObject

UNSTABLE: Parameters of a proxy/successor notification: a wrapped notification.

Source code in src/aclientp/schema/v2/protocol.py
class ProxySuccessorNotification(AnnotatedObject):
    """**UNSTABLE**: Parameters of a ``proxy/successor`` notification: a wrapped notification."""

    method: str
    """Method of the wrapped notification."""

    params: Any | MISSING = MISSING
    """Params of the wrapped notification, forwarded unchanged."""

method instance-attribute

method: str

Method of the wrapped notification.

params class-attribute instance-attribute

params: Any | MISSING = MISSING

Params of the wrapped notification, forwarded unchanged.

ProxySuccessorRequest

Bases: AnnotatedObject

UNSTABLE: Parameters of a proxy/successor request: a wrapped request.

Source code in src/aclientp/schema/v2/protocol.py
class ProxySuccessorRequest(AnnotatedObject):
    """**UNSTABLE**: Parameters of a ``proxy/successor`` request: a wrapped request."""

    method: str
    """Method of the wrapped request."""

    params: Any | MISSING = MISSING
    """Params of the wrapped request, forwarded unchanged."""

method instance-attribute

method: str

Method of the wrapped request.

params class-attribute instance-attribute

params: Any | MISSING = MISSING

Params of the wrapped request, forwarded unchanged.

ReplayComplete

Bases: AnnotatedObject

The history replay requested by session/resume is complete.

Sent once per session/resume with replayFrom; a resume that ends without it delivered a truncated replay.

Source code in src/aclientp/schema/v2/session_updates.py
class ReplayComplete(AnnotatedObject):
    """The history replay requested by ``session/resume`` is complete.

    Sent once per ``session/resume`` with ``replayFrom``; a resume that ends without it
    delivered a truncated replay.
    """

    session_update: Literal["replay_complete"] = Field(default="replay_complete", init=False)

ReplayFromStart

Bases: AnnotatedObject

Replay all retained conversation history from its first replayable entry.

Source code in src/aclientp/schema/v2/sessions.py
class ReplayFromStart(AnnotatedObject):
    """Replay all retained conversation history from its first replayable entry."""

    type: Literal["start"] = Field(default="start", init=False)

RequestPermissionRequest

Bases: AnnotatedObject

Parameters of session/request_permission.

Source code in src/aclientp/schema/v2/permissions.py
class RequestPermissionRequest(AnnotatedObject):
    """Parameters of ``session/request_permission``."""

    session_id: SessionId
    """The session asking."""

    title: str
    """Title of the permission prompt (not the title of a tool call)."""

    description: str | MISSING | None = MISSING
    """Why permission is needed."""

    subject: RequestPermissionSubject | MISSING | None = MISSING
    """Structured context about the operation."""

    options: Sequence[PermissionOption] = Field(min_length=1)
    """The options the user can choose from; at least one."""

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Why permission is needed.

options class-attribute instance-attribute

options: Sequence[PermissionOption] = Field(min_length=1)

The options the user can choose from; at least one.

session_id instance-attribute

session_id: SessionId

The session asking.

subject class-attribute instance-attribute

subject: RequestPermissionSubject | MISSING | None = MISSING

Structured context about the operation.

title instance-attribute

title: str

Title of the permission prompt (not the title of a tool call).

RequestPermissionResponse

Bases: AnnotatedObject

Response to session/request_permission.

Source code in src/aclientp/schema/v2/permissions.py
class RequestPermissionResponse(AnnotatedObject):
    """Response to ``session/request_permission``."""

    outcome: RequestPermissionOutcome
    """The user's decision."""

outcome instance-attribute

The user's decision.

RequestTypes dataclass

Validators of a request method's parameters and result.

Source code in src/aclientp/schema/v2/protocol.py
@dataclass(frozen=True)
class RequestTypes:
    """Validators of a request method's parameters and result."""

    params: TypeAdapter[Any]
    """Parses and validates the ``params`` of the request."""

    result: TypeAdapter[Any]
    """Parses and validates the ``result`` of the response."""

    @classmethod
    def of(cls, params: Any, result: Any) -> RequestTypes:
        """Build the validators from parameter and result types."""
        return cls(TypeAdapter(params), TypeAdapter(result))

params instance-attribute

params: TypeAdapter[Any]

Parses and validates the params of the request.

result instance-attribute

result: TypeAdapter[Any]

Parses and validates the result of the response.

of classmethod

of(params: Any, result: Any) -> RequestTypes

Build the validators from parameter and result types.

Source code in src/aclientp/schema/v2/protocol.py
@classmethod
def of(cls, params: Any, result: Any) -> RequestTypes:
    """Build the validators from parameter and result types."""
    return cls(TypeAdapter(params), TypeAdapter(result))

RequiresActionStateSessionUpdate

Bases: RequiresActionStateUpdate

state_update: foreground work is blocked on user action.

Source code in src/aclientp/schema/v2/session_updates.py
class RequiresActionStateSessionUpdate(RequiresActionStateUpdate):
    """``state_update``: foreground work is blocked on user action."""

    session_update: Literal["state_update"] = Field(default="state_update", init=False)

RequiresActionStateUpdate

Bases: _StateBase

The foreground workflow as a whole is blocked on user action.

Source code in src/aclientp/schema/v2/prompt.py
class RequiresActionStateUpdate(_StateBase):
    """The foreground workflow as a whole is blocked on user action."""

    state: Literal["requires_action"] = Field(default="requires_action", init=False)

Bases: AnnotatedObject

A link to a resource the receiver may be able to read. All agents MUST support it.

Source code in src/aclientp/schema/v2/content.py
class ResourceLink(AnnotatedObject):
    """A link to a resource the receiver may be able to read. All agents MUST support it."""

    type: Literal["resource_link"] = Field(default="resource_link", init=False)

    name: str
    """Human-readable name."""

    uri: str
    """URI of the resource."""

    title: str | MISSING | None = MISSING
    """Display title."""

    description: str | MISSING | None = MISSING
    """Human-readable details."""

    icons: Sequence[Icon] | MISSING | None = MISSING
    """Icons a user interface can show."""

    mime_type: MediaType | MISSING | None = MISSING
    """MIME type of the resource."""

    size: int | MISSING | None = Field(default=MISSING, ge=0)
    """Size of the resource in bytes."""

    annotations: Annotations | MISSING | None = MISSING
    """Display and routing hints."""

annotations class-attribute instance-attribute

annotations: Annotations | MISSING | None = MISSING

Display and routing hints.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Human-readable details.

icons class-attribute instance-attribute

icons: Sequence[Icon] | MISSING | None = MISSING

Icons a user interface can show.

mime_type class-attribute instance-attribute

mime_type: MediaType | MISSING | None = MISSING

MIME type of the resource.

name instance-attribute

name: str

Human-readable name.

size class-attribute instance-attribute

size: int | MISSING | None = Field(default=MISSING, ge=0)

Size of the resource in bytes.

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Display title.

uri instance-attribute

uri: str

URI of the resource.

ResultResponse

Bases: _Message

A successful JSON-RPC response.

Source code in src/aclientp/schema/v2/protocol.py
class ResultResponse(_Message):
    """A successful JSON-RPC response."""

    id: RequestId
    """The ID of the request answered."""

    result: Any
    """The method-specific result; parse it with the method tables."""

id instance-attribute

The ID of the request answered.

result instance-attribute

result: Any

The method-specific result; parse it with the method tables.

ResumeSessionRequest

Bases: AnnotatedObject

Request parameters for resuming an existing session.

Source code in src/aclientp/schema/v2/sessions.py
class ResumeSessionRequest(AnnotatedObject):
    """Request parameters for resuming an existing session."""

    session_id: SessionId
    """The ID of the session to resume."""

    cwd: AbsolutePath
    """The working directory for this session. Must be an absolute path."""

    additional_directories: Sequence[AbsolutePath] | MISSING = MISSING
    """Additional workspace roots to activate for this session. Each path must be absolute."""

    mcp_servers: Sequence[McpServer] | MISSING = MISSING
    """List of MCP servers to connect to for this session."""

    replay_from: ReplayFrom | MISSING | None = MISSING
    """Inclusive cursor describing where conversation replay should begin."""

    system_prompt: SystemPrompt | MISSING | None = MISSING
    """System-level instructions for the resumed session."""

    config_options: Sequence[InitialSessionConfigOption] | MISSING = MISSING
    """Initial values for the session's config options."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[AbsolutePath] | MISSING = MISSING

Additional workspace roots to activate for this session. Each path must be absolute.

config_options class-attribute instance-attribute

config_options: Sequence[InitialSessionConfigOption] | MISSING = MISSING

Initial values for the session's config options.

cwd instance-attribute

The working directory for this session. Must be an absolute path.

mcp_servers class-attribute instance-attribute

mcp_servers: Sequence[McpServer] | MISSING = MISSING

List of MCP servers to connect to for this session.

replay_from class-attribute instance-attribute

replay_from: ReplayFrom | MISSING | None = MISSING

Inclusive cursor describing where conversation replay should begin.

session_id instance-attribute

session_id: SessionId

The ID of the session to resume.

system_prompt class-attribute instance-attribute

system_prompt: SystemPrompt | MISSING | None = MISSING

System-level instructions for the resumed session.

ResumeSessionResponse

Bases: AnnotatedObject

Response from resuming an existing session.

The agent sends a current state_update after any requested replay (ended by replay_complete) and before this response.

Source code in src/aclientp/schema/v2/sessions.py
class ResumeSessionResponse(AnnotatedObject):
    """Response from resuming an existing session.

    The agent sends a current ``state_update`` after any requested replay (ended by
    ``replay_complete``) and before this response.
    """

    config_options: Sequence[SessionConfigOption] | MISSING = MISSING
    """Initial session configuration options."""

    available_commands: Sequence[AvailableCommand] | MISSING = MISSING
    """Initial commands the agent can execute in this session."""

available_commands class-attribute instance-attribute

available_commands: Sequence[AvailableCommand] | MISSING = MISSING

Initial commands the agent can execute in this session.

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | MISSING = MISSING

Initial session configuration options.

RunningStateSessionUpdate

Bases: RunningStateUpdate

state_update: foreground work is in progress.

Source code in src/aclientp/schema/v2/session_updates.py
class RunningStateSessionUpdate(RunningStateUpdate):
    """``state_update``: foreground work is in progress."""

    session_update: Literal["state_update"] = Field(default="state_update", init=False)

RunningStateUpdate

Bases: _StateBase

Foreground work is in progress.

Source code in src/aclientp/schema/v2/prompt.py
class RunningStateUpdate(_StateBase):
    """Foreground work is in progress."""

    state: Literal["running"] = Field(default="running", init=False)

Schema

Bases: BaseModel

Base class of all v2 models.

Source code in src/aclientp/schema/v2/base.py
class Schema(BaseModel):
    """Base class of all v2 models."""

    model_config = ConfigDict(
        populate_by_name=True,
        alias_generator=_alias,
        use_attribute_docstrings=True,
    )

SelectSessionConfigOption

Bases: _ConfigOptionBase

A single-value selector (dropdown).

Source code in src/aclientp/schema/v2/config_options.py
class SelectSessionConfigOption(_ConfigOptionBase):
    """A single-value selector (dropdown)."""

    type: Literal["select"] = Field(default="select", init=False)

    current_value: SessionConfigValueId
    """The selected value; one of the ``value``s in ``options``."""

    options: SessionConfigSelectOptions
    """The selectable values; at least one, each ``value`` unique."""

current_value instance-attribute

current_value: SessionConfigValueId

The selected value; one of the values in options.

options instance-attribute

The selectable values; at least one, each value unique.

SelectedPermissionOutcome

Bases: AnnotatedObject

The user selected one of the offered options.

An option_id that matches no offered option counts as rejection.

Source code in src/aclientp/schema/v2/permissions.py
class SelectedPermissionOutcome(AnnotatedObject):
    """The user selected one of the offered options.

    An ``option_id`` that matches no offered option counts as rejection.
    """

    outcome: Literal["selected"] = Field(default="selected", init=False)

    option_id: PermissionOptionId
    """The selected option."""

option_id instance-attribute

option_id: PermissionOptionId

The selected option.

SessionAdditionalDirectoriesCapabilities

Bases: AnnotatedObject

Capabilities for additional session directories support.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionAdditionalDirectoriesCapabilities(AnnotatedObject):
    """Capabilities for additional session directories support."""

SessionArchiveCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for session/archive and session/unarchive.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionArchiveCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for ``session/archive`` and ``session/unarchive``."""

SessionCancelCapabilities

Bases: AnnotatedObject

A subagent session's work can be cancelled (session/cancel) without ending it.

Source code in src/aclientp/schema/v2/subagents.py
class SessionCancelCapabilities(AnnotatedObject):
    """A subagent session's work can be cancelled (``session/cancel``) without ending it."""

SessionCapabilities

Bases: AnnotatedObject

Session capabilities supported by the agent.

{} means the agent supports the baseline session methods: session/new, session/list, session/resume, session/close, session/prompt, session/cancel and session/update.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionCapabilities(AnnotatedObject):
    """Session capabilities supported by the agent.

    ``{}`` means the agent supports the baseline session methods: ``session/new``,
    ``session/list``, ``session/resume``, ``session/close``, ``session/prompt``,
    ``session/cancel`` and ``session/update``.
    """

    prompt: PromptCapabilities | MISSING | None = MISSING
    """Prompt capabilities supported by the agent in ``session/prompt`` requests."""

    mcp: McpCapabilities | MISSING | None = MISSING
    """MCP capabilities supported by the agent for session lifecycle requests."""

    delete: SessionDeleteCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``session/delete``."""

    additional_directories: SessionAdditionalDirectoriesCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``additionalDirectories`` on supported session lifecycle
    requests."""

    system_prompt: SessionSystemPromptCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``systemPrompt`` on session lifecycle requests."""

    fork: SessionForkCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``session/fork``."""

    archive: SessionArchiveCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``session/archive`` and ``session/unarchive``."""

    status: SessionStatusCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``session/status``."""

    options: SessionOptionsCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``session/options``."""

    title: SessionTitleCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``session/set_title``."""

additional_directories class-attribute instance-attribute

additional_directories: SessionAdditionalDirectoriesCapabilities | MISSING | None = MISSING

Whether the agent supports additionalDirectories on supported session lifecycle requests.

archive class-attribute instance-attribute

archive: SessionArchiveCapabilities | MISSING | None = MISSING

Whether the agent supports session/archive and session/unarchive.

delete class-attribute instance-attribute

delete: SessionDeleteCapabilities | MISSING | None = MISSING

Whether the agent supports session/delete.

fork class-attribute instance-attribute

fork: SessionForkCapabilities | MISSING | None = MISSING

Whether the agent supports session/fork.

mcp class-attribute instance-attribute

mcp: McpCapabilities | MISSING | None = MISSING

MCP capabilities supported by the agent for session lifecycle requests.

options class-attribute instance-attribute

options: SessionOptionsCapabilities | MISSING | None = MISSING

Whether the agent supports session/options.

prompt class-attribute instance-attribute

prompt: PromptCapabilities | MISSING | None = MISSING

Prompt capabilities supported by the agent in session/prompt requests.

status class-attribute instance-attribute

status: SessionStatusCapabilities | MISSING | None = MISSING

Whether the agent supports session/status.

system_prompt class-attribute instance-attribute

system_prompt: SessionSystemPromptCapabilities | MISSING | None = MISSING

Whether the agent supports systemPrompt on session lifecycle requests.

title class-attribute instance-attribute

title: SessionTitleCapabilities | MISSING | None = MISSING

Whether the agent supports session/set_title.

SessionConfigSelectGroup

Bases: AnnotatedObject

A group of possible values of a select config option.

Source code in src/aclientp/schema/v2/config_options.py
class SessionConfigSelectGroup(AnnotatedObject):
    """A group of possible values of a select config option."""

    group_id: SessionConfigGroupId
    """Unique identifier of this group."""

    name: str
    """Human-readable label."""

    options: Sequence[SessionConfigSelectOption] = Field(min_length=1)
    """The values in this group."""

group_id instance-attribute

Unique identifier of this group.

name instance-attribute

name: str

Human-readable label.

options class-attribute instance-attribute

options: Sequence[SessionConfigSelectOption] = Field(min_length=1)

The values in this group.

SessionConfigSelectOption

Bases: AnnotatedObject

A possible value of a select config option.

Source code in src/aclientp/schema/v2/config_options.py
class SessionConfigSelectOption(AnnotatedObject):
    """A possible value of a select config option."""

    value: SessionConfigValueId
    """Unique identifier of this value."""

    name: str
    """Human-readable label."""

    description: str | MISSING | None = MISSING
    """Description of this value."""

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Description of this value.

name instance-attribute

name: str

Human-readable label.

value instance-attribute

Unique identifier of this value.

SessionDeleteCapabilities

Bases: AnnotatedObject

Capabilities for the session/delete method.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionDeleteCapabilities(AnnotatedObject):
    """Capabilities for the ``session/delete`` method."""

SessionForkCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for the session/fork method.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionForkCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for the ``session/fork`` method."""

SessionInfo

Bases: AnnotatedObject

Information about a session returned by session/list.

Source code in src/aclientp/schema/v2/sessions.py
class SessionInfo(AnnotatedObject):
    """Information about a session returned by ``session/list``."""

    session_id: SessionId
    """Unique identifier for the session"""

    cwd: AbsolutePath
    """The working directory for this session. Must be an absolute path."""

    additional_directories: Sequence[AbsolutePath] | MISSING = MISSING
    """Additional workspace roots reported for this session. Each path must be absolute."""

    title: str | MISSING | None = MISSING
    """Human-readable title for the session"""

    updated_at: str | MISSING | None = MISSING
    """RFC 3339 timestamp of last activity."""

    archived: bool | MISSING | None = MISSING
    """Whether the session is archived."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[AbsolutePath] | MISSING = MISSING

Additional workspace roots reported for this session. Each path must be absolute.

archived class-attribute instance-attribute

archived: bool | MISSING | None = MISSING

Whether the session is archived.

cwd instance-attribute

The working directory for this session. Must be an absolute path.

session_id instance-attribute

session_id: SessionId

Unique identifier for the session

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Human-readable title for the session

updated_at class-attribute instance-attribute

updated_at: str | MISSING | None = MISSING

RFC 3339 timestamp of last activity.

SessionInfoUpdate

Bases: AnnotatedObject

Partial update of session metadata; None clears a field.

Source code in src/aclientp/schema/v2/session_updates.py
class SessionInfoUpdate(AnnotatedObject):
    """Partial update of session metadata; ``None`` clears a field."""

    session_update: Literal["session_info_update"] = Field(
        default="session_info_update", init=False
    )

    title: str | MISSING | None = MISSING
    """Human-readable title of the session."""

    updated_at: str | MISSING | None = MISSING
    """RFC 3339 timestamp of the last activity."""

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Human-readable title of the session.

updated_at class-attribute instance-attribute

updated_at: str | MISSING | None = MISSING

RFC 3339 timestamp of the last activity.

SessionMessage

Bases: AnnotatedObject

An upsert of a message sent to or received from another session.

Every field but message_id is a patch: omitted leaves it unchanged, None clears it, a value replaces it.

Source code in src/aclientp/schema/v2/messages.py
class SessionMessage(AnnotatedObject):
    """An upsert of a message sent to or received from another session.

    Every field but ``message_id`` is a patch: omitted leaves it unchanged, ``None``
    clears it, a value replaces it.
    """

    session_update: Literal["session_message"] = Field(default="session_message", init=False)

    message_id: MessageId
    """Identifier of the message in this session's transcript."""

    sender_session_id: SessionId | MISSING | None = MISSING
    """The sending session."""

    recipient_session_id: SessionId | MISSING | None = MISSING
    """The receiving session."""

    sender_message_id: MessageId | MISSING | None = MISSING
    """On an incoming view: the ``messageId`` of the outgoing view in the sender's transcript."""

    recipient_message_id: MessageId | MISSING | None = MISSING
    """On an outgoing view: the ``messageId`` of the incoming view in the recipient's
    transcript."""

    content: Sequence[ContentBlock] | MISSING | None = MISSING
    """Complete replacement content."""

content class-attribute instance-attribute

content: Sequence[ContentBlock] | MISSING | None = MISSING

Complete replacement content.

message_id instance-attribute

message_id: MessageId

Identifier of the message in this session's transcript.

recipient_message_id class-attribute instance-attribute

recipient_message_id: MessageId | MISSING | None = MISSING

On an outgoing view: the messageId of the incoming view in the recipient's transcript.

recipient_session_id class-attribute instance-attribute

recipient_session_id: SessionId | MISSING | None = MISSING

The receiving session.

sender_message_id class-attribute instance-attribute

sender_message_id: MessageId | MISSING | None = MISSING

On an incoming view: the messageId of the outgoing view in the sender's transcript.

sender_session_id class-attribute instance-attribute

sender_session_id: SessionId | MISSING | None = MISSING

The sending session.

SessionMessageChunk

Bases: AnnotatedObject

A content block appended to a session message.

Participants and references come from session_message upserts.

Source code in src/aclientp/schema/v2/messages.py
class SessionMessageChunk(AnnotatedObject):
    """A content block appended to a session message.

    Participants and references come from ``session_message`` upserts.
    """

    session_update: Literal["session_message_chunk"] = Field(
        default="session_message_chunk", init=False
    )

    message_id: MessageId
    """Identifier of the message in this session's transcript."""

    content: ContentBlock
    """The appended content block."""

content instance-attribute

content: ContentBlock

The appended content block.

message_id instance-attribute

message_id: MessageId

Identifier of the message in this session's transcript.

SessionMessageCursorAnchor

Bases: CursorMessageAnchor

UNSTABLE: The cursor is next to a session-directed message.

Source code in src/aclientp/schema/v2/cursors.py
class SessionMessageCursorAnchor(CursorMessageAnchor):
    """**UNSTABLE**: The cursor is next to a session-directed message."""

    type: Literal["session_message"] = Field(default="session_message", init=False)

SessionNotFoundErrorData

Bases: AnnotatedObject

Data of the -32002 (Resource not found) error for an unknown or inactive session.

Source code in src/aclientp/schema/v2/common.py
class SessionNotFoundErrorData(AnnotatedObject):
    """Data of the ``-32002`` (Resource not found) error for an unknown or inactive session."""

    session_id: SessionId
    """The session ID from the request."""

session_id instance-attribute

session_id: SessionId

The session ID from the request.

SessionOptionsCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for the session/options method.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionOptionsCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for the ``session/options`` method."""

SessionOptionsRequest

Bases: AnnotatedObject

UNSTABLE: Parameters of session/options.

Returns the config options a session would start with, without creating or resuming one.

Source code in src/aclientp/schema/v2/sessions.py
class SessionOptionsRequest(AnnotatedObject):
    """**UNSTABLE**: Parameters of ``session/options``.

    Returns the config options a session would start with, without creating or resuming
    one.
    """

    cwd: AbsolutePath
    """The working directory to resolve options for. Must be an absolute path."""

    additional_directories: Sequence[AbsolutePath] | MISSING = MISSING
    """Additional workspace roots to resolve options for. Each path must be absolute."""

    session_id: SessionId | MISSING | None = MISSING
    """The session to resolve options for."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[AbsolutePath] | MISSING = MISSING

Additional workspace roots to resolve options for. Each path must be absolute.

cwd instance-attribute

The working directory to resolve options for. Must be an absolute path.

session_id class-attribute instance-attribute

session_id: SessionId | MISSING | None = MISSING

The session to resolve options for.

SessionOptionsResponse

Bases: AnnotatedObject

UNSTABLE: Response from session/options.

Source code in src/aclientp/schema/v2/sessions.py
class SessionOptionsResponse(AnnotatedObject):
    """**UNSTABLE**: Response from ``session/options``."""

    config_options: Sequence[SessionConfigOption] | MISSING = MISSING
    """The config options the session would start with, with the same rules as on
    ``NewSessionResponse``."""

    available_commands: Sequence[AvailableCommand] | MISSING = MISSING
    """Commands the Agent knows the session would have."""

available_commands class-attribute instance-attribute

available_commands: Sequence[AvailableCommand] | MISSING = MISSING

Commands the Agent knows the session would have.

config_options class-attribute instance-attribute

config_options: Sequence[SessionConfigOption] | MISSING = MISSING

The config options the session would start with, with the same rules as on NewSessionResponse.

SessionReference

Bases: AnnotatedObject

A display-only reference to another session the tool call operates on, e.g. a subagent.

Source code in src/aclientp/schema/v2/tool_calls.py
class SessionReference(AnnotatedObject):
    """A display-only reference to another session the tool call operates on, e.g. a subagent."""

    type: Literal["session"] = Field(default="session", init=False)

    session_id: SessionId
    """The referenced session."""

session_id instance-attribute

session_id: SessionId

The referenced session.

SessionStatusCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for the session/status method.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionStatusCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for the ``session/status`` method."""

SessionStatusRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for checking the status of a session.

Source code in src/aclientp/schema/v2/sessions.py
class SessionStatusRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for checking the status of a session."""

    session_id: SessionId
    """The ID of the session to check."""

session_id instance-attribute

session_id: SessionId

The ID of the session to check.

SessionStatusResponse

Bases: AnnotatedObject

UNSTABLE: Response from checking the status of a session.

Source code in src/aclientp/schema/v2/sessions.py
class SessionStatusResponse(AnnotatedObject):
    """**UNSTABLE**: Response from checking the status of a session."""

    status: SessionStatus
    """Whether the Agent has the session in memory."""

    state: StateUpdate | MISSING | None = MISSING
    """The session's current foreground state, as the same snapshot the Agent sends in
    ``state_update`` notifications."""

state class-attribute instance-attribute

state: StateUpdate | MISSING | None = MISSING

The session's current foreground state, as the same snapshot the Agent sends in state_update notifications.

status instance-attribute

status: SessionStatus

Whether the Agent has the session in memory.

SessionSystemPromptCapabilities

Bases: AnnotatedObject

Capabilities for client-provided system prompts.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionSystemPromptCapabilities(AnnotatedObject):
    """Capabilities for client-provided system prompts."""

    mode: SessionSystemPromptModeCapabilities | MISSING | None = MISSING
    """Delivery modes the agent supports in addition to ``append``."""

mode class-attribute instance-attribute

mode: SessionSystemPromptModeCapabilities | MISSING | None = MISSING

Delivery modes the agent supports in addition to append.

SessionSystemPromptModeCapabilities

Bases: AnnotatedObject

System prompt delivery modes the agent supports in addition to append.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionSystemPromptModeCapabilities(AnnotatedObject):
    """System prompt delivery modes the agent supports in addition to ``append``."""

    override: SessionSystemPromptOverrideCapabilities | MISSING | None = MISSING
    """Whether the agent supports ``override`` mode."""

override class-attribute instance-attribute

override: SessionSystemPromptOverrideCapabilities | MISSING | None = MISSING

Whether the agent supports override mode.

SessionSystemPromptOverrideCapabilities

Bases: AnnotatedObject

Capabilities for the override system prompt mode.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionSystemPromptOverrideCapabilities(AnnotatedObject):
    """Capabilities for the ``override`` system prompt mode."""

SessionTitleCapabilities

Bases: AnnotatedObject

UNSTABLE: Capabilities for Client-set session titles.

Source code in src/aclientp/schema/v2/capabilities.py
class SessionTitleCapabilities(AnnotatedObject):
    """**UNSTABLE**: Capabilities for Client-set session titles."""

SetConfigOptionBooleanRequest

Bases: _SetConfigOptionBase

Set a boolean config option.

Source code in src/aclientp/schema/v2/config_options.py
class SetConfigOptionBooleanRequest(_SetConfigOptionBase):
    """Set a boolean config option."""

    type: Literal["boolean"] = Field(default="boolean", init=False)

    value: bool
    """The value to set."""

value instance-attribute

value: bool

The value to set.

SetConfigOptionIdRequest

Bases: _SetConfigOptionBase

Select a value of a select config option.

Source code in src/aclientp/schema/v2/config_options.py
class SetConfigOptionIdRequest(_SetConfigOptionBase):
    """Select a value of a select config option."""

    type: Literal["id"] = Field(default="id", init=False)

    value: SessionConfigValueId
    """The value to select."""

value instance-attribute

The value to select.

SetConfigOptionUnknownRequest

Bases: Unknown, _SetConfigOptionBase

Set a custom or future kind of config option.

Source code in src/aclientp/schema/v2/config_options.py
class SetConfigOptionUnknownRequest(Unknown, _SetConfigOptionBase):
    """Set a custom or future kind of config option."""

    type: str
    """The value kind."""

    value: Any
    """The value to set."""

type instance-attribute

type: str

The value kind.

value instance-attribute

value: Any

The value to set.

SetProviderRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for providers/set.

Source code in src/aclientp/schema/v2/providers.py
class SetProviderRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for ``providers/set``."""

    provider_id: ProviderId
    """Provider ID to configure."""

    api_type: LlmProtocol
    """Protocol type for this provider."""

    base_url: str
    """Base URL for requests sent through this provider."""

    headers: dict[str, str] | MISSING = MISSING
    """Full headers map for this provider. May include authorization, routing, or other
    integration-specific headers."""

api_type instance-attribute

api_type: LlmProtocol

Protocol type for this provider.

base_url instance-attribute

base_url: str

Base URL for requests sent through this provider.

headers class-attribute instance-attribute

headers: dict[str, str] | MISSING = MISSING

Full headers map for this provider. May include authorization, routing, or other integration-specific headers.

provider_id instance-attribute

provider_id: ProviderId

Provider ID to configure.

SetProviderResponse

Bases: AnnotatedObject

UNSTABLE: Response to providers/set.

Source code in src/aclientp/schema/v2/providers.py
class SetProviderResponse(AnnotatedObject):
    """**UNSTABLE**: Response to ``providers/set``."""

SetSessionConfigOptionResponse

Bases: AnnotatedObject

Response to session/set_config_option.

Source code in src/aclientp/schema/v2/config_options.py
class SetSessionConfigOptionResponse(AnnotatedObject):
    """Response to ``session/set_config_option``."""

    config_options: Sequence[SessionConfigOption]
    """All config options and their current values."""

config_options instance-attribute

config_options: Sequence[SessionConfigOption]

All config options and their current values.

SetSessionTitleRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for setting the title of a session.

Source code in src/aclientp/schema/v2/sessions.py
class SetSessionTitleRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for setting the title of a session."""

    session_id: SessionId
    """The ID of the session to retitle."""

    title: str
    """The new title for the session."""

session_id instance-attribute

session_id: SessionId

The ID of the session to retitle.

title instance-attribute

title: str

The new title for the session.

SetSessionTitleResponse

Bases: AnnotatedObject

UNSTABLE: Response from setting the title of a session.

Source code in src/aclientp/schema/v2/sessions.py
class SetSessionTitleResponse(AnnotatedObject):
    """**UNSTABLE**: Response from setting the title of a session."""

    title: str
    """The title the Agent stored."""

title instance-attribute

title: str

The title the Agent stored.

Skill

Bases: AnnotatedObject

UNSTABLE: An Agent Skill the user invokes with a skill content block.

Agents MUST only send skills to clients that advertise session.commands.skill.

Source code in src/aclientp/schema/v2/commands.py
class Skill(AnnotatedObject):
    """**UNSTABLE**: An Agent Skill the user invokes with a ``skill`` content block.

    Agents MUST only send skills to clients that advertise ``session.commands.skill``.
    """

    type: Literal["skill"] = Field(default="skill", init=False)

    name: str
    """Skill name, used in ``skill`` content blocks; no whitespace."""

    description: str
    """What the skill does, shown to users."""

    path: AbsolutePath | MISSING | None = MISSING
    """Absolute path of the file defining the skill (normally its ``SKILL.md``) on the
    agent's machine."""

description instance-attribute

description: str

What the skill does, shown to users.

name instance-attribute

name: str

Skill name, used in skill content blocks; no whitespace.

path class-attribute instance-attribute

path: AbsolutePath | MISSING | None = MISSING

Absolute path of the file defining the skill (normally its SKILL.md) on the agent's machine.

SkillReference

Bases: AnnotatedObject

UNSTABLE: A skill the user invokes with a prompt.

Names a skill entry of the session's command list. Requires the skill prompt capability.

Source code in src/aclientp/schema/v2/content.py
class SkillReference(AnnotatedObject):
    """**UNSTABLE**: A skill the user invokes with a prompt.

    Names a ``skill`` entry of the session's command list. Requires the ``skill``
    prompt capability.
    """

    type: Literal["skill"] = Field(default="skill", init=False)

    name: str
    """The ``name`` of a ``skill`` entry in the session's current command list."""

name instance-attribute

name: str

The name of a skill entry in the session's current command list.

StringMultiSelectItems

Bases: AnnotatedObject

String item schema for multi-select enum properties.

Source code in src/aclientp/schema/v2/elicitation.py
class StringMultiSelectItems(AnnotatedObject):
    """String item schema for multi-select enum properties."""

    type: Literal["string"] = Field(default="string", init=False)

    enum: Sequence[str] = Field(min_length=1)
    """Allowed enum values. Must contain at least one value."""

enum class-attribute instance-attribute

enum: Sequence[str] = Field(min_length=1)

Allowed enum values. Must contain at least one value.

StringPropertySchema

Bases: AnnotatedObject

Schema for string properties in an elicitation form.

Source code in src/aclientp/schema/v2/elicitation.py
class StringPropertySchema(AnnotatedObject):
    """Schema for string properties in an elicitation form."""

    type: Literal["string"] = Field(default="string", init=False)

    title: str | MISSING | None = MISSING
    """Optional title for the property."""

    description: str | MISSING | None = MISSING
    """Human-readable description."""

    min_length: int | MISSING | None = Field(default=MISSING, ge=0)
    """Minimum string length."""

    max_length: int | MISSING | None = Field(default=MISSING, ge=0)
    """Maximum string length."""

    format: StringFormat | MISSING | None = MISSING
    """String format."""

    default: str | MISSING | None = MISSING
    """Default value."""

    enum: Sequence[str] | MISSING | None = Field(default=MISSING, min_length=1)
    """Enum values for untitled single-select enums. Must contain at least one value when
    present."""

    one_of: Sequence[EnumOption] | MISSING | None = Field(default=MISSING, min_length=1)
    """Titled enum options for titled single-select enums. Must contain at least one option when
    present."""

default class-attribute instance-attribute

default: str | MISSING | None = MISSING

Default value.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

Human-readable description.

enum class-attribute instance-attribute

enum: Sequence[str] | MISSING | None = Field(default=MISSING, min_length=1)

Enum values for untitled single-select enums. Must contain at least one value when present.

format class-attribute instance-attribute

format: StringFormat | MISSING | None = MISSING

String format.

max_length class-attribute instance-attribute

max_length: int | MISSING | None = Field(default=MISSING, ge=0)

Maximum string length.

min_length class-attribute instance-attribute

min_length: int | MISSING | None = Field(default=MISSING, ge=0)

Minimum string length.

one_of class-attribute instance-attribute

one_of: Sequence[EnumOption] | MISSING | None = Field(default=MISSING, min_length=1)

Titled enum options for titled single-select enums. Must contain at least one option when present.

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Optional title for the property.

SubagentSessionCapabilities

Bases: AnnotatedObject

Client-initiated mutations permitted for a specific subagent session.

Each mutation needs an explicit per-child capability.

Source code in src/aclientp/schema/v2/subagents.py
class SubagentSessionCapabilities(AnnotatedObject):
    """Client-initiated mutations permitted for a specific subagent session.

    Each mutation needs an explicit per-child capability.
    """

    cancel: SessionCancelCapabilities | MISSING | None = MISSING
    """Permits cancelling the child's current work."""

cancel class-attribute instance-attribute

cancel: SessionCancelCapabilities | MISSING | None = MISSING

Permits cancelling the child's current work.

SubagentUpdate

Bases: AnnotatedObject

The parent session created and owns a child session, or the association changed.

Fields other than session_id are patches: omitted leaves them unchanged, None clears them.

Source code in src/aclientp/schema/v2/subagents.py
class SubagentUpdate(AnnotatedObject):
    """The parent session created and owns a child session, or the association changed.

    Fields other than ``session_id`` are patches: omitted leaves them unchanged,
    ``None`` clears them.
    """

    session_update: Literal["subagent_update"] = Field(default="subagent_update", init=False)

    session_id: SessionId
    """The opaque ID of the child session in all ACP messages."""

    title: str | MISSING | None = MISSING
    """The parent's display title for the child; need not be unique."""

    description: str | MISSING | None = MISSING
    """The parent's description of the child's role or purpose."""

    capabilities: SubagentSessionCapabilities | MISSING | None = MISSING
    """Client-initiated mutations permitted for the child."""

    state: StateUpdate | MISSING | None = MISSING
    """The child's current foreground state, mirrored onto the association."""

    cwd: AbsolutePath | MISSING | None = MISSING
    """The child's working directory."""

    additional_directories: Sequence[AbsolutePath] | MISSING | None = MISSING
    """Additional workspace roots of the child."""

additional_directories class-attribute instance-attribute

additional_directories: Sequence[AbsolutePath] | MISSING | None = MISSING

Additional workspace roots of the child.

capabilities class-attribute instance-attribute

capabilities: SubagentSessionCapabilities | MISSING | None = MISSING

Client-initiated mutations permitted for the child.

cwd class-attribute instance-attribute

cwd: AbsolutePath | MISSING | None = MISSING

The child's working directory.

description class-attribute instance-attribute

description: str | MISSING | None = MISSING

The parent's description of the child's role or purpose.

session_id instance-attribute

session_id: SessionId

The opaque ID of the child session in all ACP messages.

state class-attribute instance-attribute

state: StateUpdate | MISSING | None = MISSING

The child's current foreground state, mirrored onto the association.

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

The parent's display title for the child; need not be unique.

SystemPrompt

Bases: AnnotatedObject

Client-provided system-level instructions for a session.

Only sent when the agent advertises session.systemPrompt; agents that cannot apply it return an error instead of creating the session.

Source code in src/aclientp/schema/v2/sessions.py
class SystemPrompt(AnnotatedObject):
    """Client-provided system-level instructions for a session.

    Only sent when the agent advertises ``session.systemPrompt``; agents that cannot apply
    it return an error instead of creating the session.
    """

    mode: SystemPromptMode
    """How the Agent combines ``content`` with its own instructions."""

    content: Sequence[ContentBlock] = Field(min_length=1)
    """The system prompt content; at least one block."""

content class-attribute instance-attribute

content: Sequence[ContentBlock] = Field(min_length=1)

The system prompt content; at least one block.

mode instance-attribute

How the Agent combines content with its own instructions.

Terminal

Bases: AnnotatedObject

A display-only reference to an agent-owned terminal.

State and output arrive separately as terminal_update and terminal_output_chunk.

Source code in src/aclientp/schema/v2/tool_calls.py
class Terminal(AnnotatedObject):
    """A display-only reference to an agent-owned terminal.

    State and output arrive separately as ``terminal_update`` and
    ``terminal_output_chunk``.
    """

    type: Literal["terminal"] = Field(default="terminal", init=False)

    terminal_id: TerminalId
    """The terminal to display."""

terminal_id instance-attribute

terminal_id: TerminalId

The terminal to display.

TerminalAuthCapabilities

Bases: AnnotatedObject

Capabilities for terminal authentication methods.

Source code in src/aclientp/schema/v2/capabilities.py
class TerminalAuthCapabilities(AnnotatedObject):
    """Capabilities for terminal authentication methods."""

TerminalCancelCapabilities

Bases: AnnotatedObject

Capability to cancel a terminal with terminal/cancel.

Source code in src/aclientp/schema/v2/terminals.py
class TerminalCancelCapabilities(AnnotatedObject):
    """Capability to cancel a terminal with ``terminal/cancel``."""

TerminalCapabilities

Bases: AnnotatedObject

Client-initiated controls a terminal currently supports.

Source code in src/aclientp/schema/v2/terminals.py
class TerminalCapabilities(AnnotatedObject):
    """Client-initiated controls a terminal currently supports."""

    cancel: TerminalCancelCapabilities | MISSING | None = MISSING
    """Permits the Client to cancel this terminal with ``terminal/cancel``."""

cancel class-attribute instance-attribute

cancel: TerminalCancelCapabilities | MISSING | None = MISSING

Permits the Client to cancel this terminal with terminal/cancel.

TerminalExitStatus

Bases: AnnotatedObject

Exit information for an agent-owned terminal.

Its presence marks the terminal as exited, even when neither code nor signal is known.

Source code in src/aclientp/schema/v2/terminals.py
class TerminalExitStatus(AnnotatedObject):
    """Exit information for an agent-owned terminal.

    Its presence marks the terminal as exited, even when neither code nor signal is known.
    """

    exit_code: int | MISSING | None = MISSING
    """Process exit code as the platform reports it; negative values are allowed."""

    signal: str | MISSING | None = MISSING
    """Signal that terminated the process, when known."""

exit_code class-attribute instance-attribute

exit_code: int | MISSING | None = MISSING

Process exit code as the platform reports it; negative values are allowed.

signal class-attribute instance-attribute

signal: str | MISSING | None = MISSING

Signal that terminated the process, when known.

TerminalOutput

Bases: AnnotatedObject

An authoritative replacement snapshot of terminal output bytes.

Source code in src/aclientp/schema/v2/terminals.py
class TerminalOutput(AnnotatedObject):
    """An authoritative replacement snapshot of terminal output bytes."""

    data: str
    """Base64-encoded replacement terminal output bytes."""

    @classmethod
    def from_bytes(cls, data: bytes) -> Self:
        """Create a snapshot from raw output bytes."""
        return cls(data=base64.b64encode(data).decode("ascii"))

    def decode(self) -> bytes:
        """The raw output bytes."""
        return base64.b64decode(self.data)

data instance-attribute

data: str

Base64-encoded replacement terminal output bytes.

decode

decode() -> bytes

The raw output bytes.

Source code in src/aclientp/schema/v2/terminals.py
def decode(self) -> bytes:
    """The raw output bytes."""
    return base64.b64decode(self.data)

from_bytes classmethod

from_bytes(data: bytes) -> Self

Create a snapshot from raw output bytes.

Source code in src/aclientp/schema/v2/terminals.py
@classmethod
def from_bytes(cls, data: bytes) -> Self:
    """Create a snapshot from raw output bytes."""
    return cls(data=base64.b64encode(data).decode("ascii"))

TerminalOutputChunk

Bases: AnnotatedObject

A chunk of bytes appended to an agent-owned terminal's output.

Source code in src/aclientp/schema/v2/terminals.py
class TerminalOutputChunk(AnnotatedObject):
    """A chunk of bytes appended to an agent-owned terminal's output."""

    session_update: Literal["terminal_output_chunk"] = Field(
        default="terminal_output_chunk", init=False
    )

    terminal_id: TerminalId
    """The terminal receiving these bytes."""

    data: str
    """Independently base64-encoded terminal output bytes."""

    @classmethod
    def from_bytes(cls, terminal_id: TerminalId, data: bytes) -> Self:
        """Create a chunk from raw output bytes."""
        return cls(terminal_id=terminal_id, data=base64.b64encode(data).decode("ascii"))

    def decode(self) -> bytes:
        """The raw output bytes."""
        return base64.b64decode(self.data)

data instance-attribute

data: str

Independently base64-encoded terminal output bytes.

terminal_id instance-attribute

terminal_id: TerminalId

The terminal receiving these bytes.

decode

decode() -> bytes

The raw output bytes.

Source code in src/aclientp/schema/v2/terminals.py
def decode(self) -> bytes:
    """The raw output bytes."""
    return base64.b64decode(self.data)

from_bytes classmethod

from_bytes(terminal_id: TerminalId, data: bytes) -> Self

Create a chunk from raw output bytes.

Source code in src/aclientp/schema/v2/terminals.py
@classmethod
def from_bytes(cls, terminal_id: TerminalId, data: bytes) -> Self:
    """Create a chunk from raw output bytes."""
    return cls(terminal_id=terminal_id, data=base64.b64encode(data).decode("ascii"))

TerminalSize

Bases: AnnotatedObject

The size of an agent-owned terminal in character cells.

Source code in src/aclientp/schema/v2/terminals.py
class TerminalSize(AnnotatedObject):
    """The size of an agent-owned terminal in character cells."""

    cols: int = Field(ge=1, le=65535)
    """Number of columns."""

    rows: int = Field(ge=1, le=65535)
    """Number of rows."""

cols class-attribute instance-attribute

cols: int = Field(ge=1, le=65535)

Number of columns.

rows class-attribute instance-attribute

rows: int = Field(ge=1, le=65535)

Number of rows.

TerminalUpdate

Bases: AnnotatedObject

An upsert of an agent-owned terminal's state, keyed by terminal_id.

Other fields are patches: omitted leaves the stored value unchanged, None clears it.

Source code in src/aclientp/schema/v2/terminals.py
class TerminalUpdate(AnnotatedObject):
    """An upsert of an agent-owned terminal's state, keyed by ``terminal_id``.

    Other fields are patches: omitted leaves the stored value unchanged, ``None``
    clears it.
    """

    session_update: Literal["terminal_update"] = Field(default="terminal_update", init=False)

    terminal_id: TerminalId
    """Unique identifier for this terminal within the session."""

    command: str | MISSING | None = MISSING
    """The command being run."""

    cwd: AbsolutePath | MISSING | None = MISSING
    """The absolute working directory of the command."""

    output: TerminalOutput | MISSING | None = MISSING
    """An authoritative replacement snapshot of terminal output bytes."""

    exit_status: TerminalExitStatus | MISSING | None = MISSING
    """Exit information. A concrete object marks the terminal as exited."""

    size: TerminalSize | MISSING | None = MISSING
    """The terminal size the command runs with, when known."""

    capabilities: TerminalCapabilities | MISSING | None = MISSING
    """Client-initiated controls this terminal currently supports, such as cancellation."""

capabilities class-attribute instance-attribute

capabilities: TerminalCapabilities | MISSING | None = MISSING

Client-initiated controls this terminal currently supports, such as cancellation.

command class-attribute instance-attribute

command: str | MISSING | None = MISSING

The command being run.

cwd class-attribute instance-attribute

cwd: AbsolutePath | MISSING | None = MISSING

The absolute working directory of the command.

exit_status class-attribute instance-attribute

exit_status: TerminalExitStatus | MISSING | None = MISSING

Exit information. A concrete object marks the terminal as exited.

output class-attribute instance-attribute

output: TerminalOutput | MISSING | None = MISSING

An authoritative replacement snapshot of terminal output bytes.

size class-attribute instance-attribute

size: TerminalSize | MISSING | None = MISSING

The terminal size the command runs with, when known.

terminal_id instance-attribute

terminal_id: TerminalId

Unique identifier for this terminal within the session.

TextCommandInput

Bases: AnnotatedObject

All text typed after the command name (and the following whitespace) is the input.

Source code in src/aclientp/schema/v2/commands.py
class TextCommandInput(AnnotatedObject):
    """All text typed after the command name (and the following whitespace) is the input."""

    type: Literal["text"] = Field(default="text", init=False)

    hint: str
    """Hint to show while no input has been given."""

hint instance-attribute

hint: str

Hint to show while no input has been given.

TextContent

Bases: AnnotatedObject

Text provided to or from an LLM. All agents MUST support it in prompts.

Source code in src/aclientp/schema/v2/content.py
class TextContent(AnnotatedObject):
    """Text provided to or from an LLM. All agents MUST support it in prompts."""

    type: Literal["text"] = Field(default="text", init=False)

    text: str
    """The text; clients SHOULD render it as Markdown."""

    annotations: Annotations | MISSING | None = MISSING
    """Display and routing hints."""

annotations class-attribute instance-attribute

annotations: Annotations | MISSING | None = MISSING

Display and routing hints.

text instance-attribute

text: str

The text; clients SHOULD render it as Markdown.

TextResourceContents

Bases: AnnotatedObject

Text contents of a resource.

Source code in src/aclientp/schema/v2/content.py
class TextResourceContents(AnnotatedObject):
    """Text contents of a resource."""

    text: str
    """The text."""

    uri: str
    """URI of the resource."""

    mime_type: MediaType | MISSING | None = MISSING
    """MIME type of the resource."""

mime_type class-attribute instance-attribute

mime_type: MediaType | MISSING | None = MISSING

MIME type of the resource.

text instance-attribute

text: str

The text.

uri instance-attribute

uri: str

URI of the resource.

TitledMultiSelectItems

Bases: AnnotatedObject

Items definition for titled multi-select enum properties.

Source code in src/aclientp/schema/v2/elicitation.py
class TitledMultiSelectItems(AnnotatedObject):
    """Items definition for titled multi-select enum properties."""

    any_of: Sequence[EnumOption] = Field(min_length=1)
    """Titled enum options. Must contain at least one option."""

any_of class-attribute instance-attribute

any_of: Sequence[EnumOption] = Field(min_length=1)

Titled enum options. Must contain at least one option.

ToolCallCancelCapabilities

Bases: AnnotatedObject

The tool call can be cancelled with tool_call/cancel.

Source code in src/aclientp/schema/v2/tool_calls.py
class ToolCallCancelCapabilities(AnnotatedObject):
    """The tool call can be cancelled with ``tool_call/cancel``."""

ToolCallCapabilities

Bases: AnnotatedObject

Client-initiated controls a tool call currently supports.

A malformed value counts as no controls.

Source code in src/aclientp/schema/v2/tool_calls.py
class ToolCallCapabilities(AnnotatedObject):
    """Client-initiated controls a tool call currently supports.

    A malformed value counts as no controls.
    """

    cancel: ToolCallCancelCapabilities | MISSING | None = MISSING
    """Permits ``tool_call/cancel`` for this tool call."""

cancel class-attribute instance-attribute

cancel: ToolCallCancelCapabilities | MISSING | None = MISSING

Permits tool_call/cancel for this tool call.

ToolCallContentChunk

Bases: AnnotatedObject

A content item appended to a tool call's content.

Source code in src/aclientp/schema/v2/tool_calls.py
class ToolCallContentChunk(AnnotatedObject):
    """A content item appended to a tool call's content."""

    session_update: Literal["tool_call_content_chunk"] = Field(
        default="tool_call_content_chunk", init=False
    )

    tool_call_id: ToolCallId
    """The tool call the content belongs to."""

    content: ToolCallContent
    """The appended content item."""

content instance-attribute

content: ToolCallContent

The appended content item.

tool_call_id instance-attribute

tool_call_id: ToolCallId

The tool call the content belongs to.

ToolCallLocation

Bases: AnnotatedObject

A file location a tool reads or modifies, for "follow-along" features.

Source code in src/aclientp/schema/v2/tool_calls.py
class ToolCallLocation(AnnotatedObject):
    """A file location a tool reads or modifies, for "follow-along" features."""

    path: AbsolutePath
    """The absolute file path."""

    line: int | MISSING | None = Field(default=MISSING, ge=1)
    """1-based line number in the file; ``0`` is invalid."""

line class-attribute instance-attribute

line: int | MISSING | None = Field(default=MISSING, ge=1)

1-based line number in the file; 0 is invalid.

path instance-attribute

The absolute file path.

ToolCallPermissionSubject

Bases: AnnotatedObject

Permission is requested before executing a tool call.

Source code in src/aclientp/schema/v2/permissions.py
class ToolCallPermissionSubject(AnnotatedObject):
    """Permission is requested before executing a tool call."""

    type: Literal["tool_call"] = Field(default="tool_call", init=False)

    tool_call: ToolCallUpdate
    """The tool call; clients apply it to their stored tool call like a ``tool_call_update``."""

tool_call instance-attribute

tool_call: ToolCallUpdate

The tool call; clients apply it to their stored tool call like a tool_call_update.

ToolCallSessionUpdate

Bases: ToolCallUpdate

tool_call_update: a tool call was created or updated.

Source code in src/aclientp/schema/v2/session_updates.py
class ToolCallSessionUpdate(ToolCallUpdate):
    """``tool_call_update``: a tool call was created or updated."""

    session_update: Literal["tool_call_update"] = Field(default="tool_call_update", init=False)

ToolCallUpdate

Bases: AnnotatedObject

A tool call upsert, keyed by tool_call_id.

Sent as the tool_call_update session update (:class:ToolCallSessionUpdate in :mod:aclientp.schema.v2.session_updates), and embedded in tool call permission requests.

Source code in src/aclientp/schema/v2/tool_calls.py
class ToolCallUpdate(AnnotatedObject):
    """A tool call upsert, keyed by ``tool_call_id``.

    Sent as the ``tool_call_update`` session update (:class:`ToolCallSessionUpdate` in
    :mod:`aclientp.schema.v2.session_updates`), and embedded in tool call permission requests.
    """

    tool_call_id: ToolCallId
    """Unique identifier of the tool call in the session."""

    name: str | MISSING | None = MISSING
    """Programmatic name of the tool."""

    title: str | MISSING | None = MISSING
    """Human-readable title of what the tool is doing."""

    kind: ToolKind | MISSING | None = MISSING
    """Category of the tool."""

    status: ToolCallStatus | MISSING | None = MISSING
    """Execution status; ``None`` resets it to ``pending``."""

    content: Sequence[ToolCallContent] | MISSING | None = MISSING
    """Content produced by the tool call; replaces earlier content."""

    locations: Sequence[ToolCallLocation] | MISSING | None = MISSING
    """File locations affected by the tool call."""

    raw_input: Any | MISSING = MISSING
    """Raw input parameters of the tool."""

    raw_output: Any | MISSING = MISSING
    """Raw output of the tool."""

    capabilities: ToolCallCapabilities | MISSING | None = MISSING
    """Controls the tool call currently supports, such as cancellation."""

capabilities class-attribute instance-attribute

capabilities: ToolCallCapabilities | MISSING | None = MISSING

Controls the tool call currently supports, such as cancellation.

content class-attribute instance-attribute

content: Sequence[ToolCallContent] | MISSING | None = MISSING

Content produced by the tool call; replaces earlier content.

kind class-attribute instance-attribute

kind: ToolKind | MISSING | None = MISSING

Category of the tool.

locations class-attribute instance-attribute

locations: Sequence[ToolCallLocation] | MISSING | None = MISSING

File locations affected by the tool call.

name class-attribute instance-attribute

name: str | MISSING | None = MISSING

Programmatic name of the tool.

raw_input class-attribute instance-attribute

raw_input: Any | MISSING = MISSING

Raw input parameters of the tool.

raw_output class-attribute instance-attribute

raw_output: Any | MISSING = MISSING

Raw output of the tool.

status class-attribute instance-attribute

status: ToolCallStatus | MISSING | None = MISSING

Execution status; None resets it to pending.

title class-attribute instance-attribute

title: str | MISSING | None = MISSING

Human-readable title of what the tool is doing.

tool_call_id instance-attribute

tool_call_id: ToolCallId

Unique identifier of the tool call in the session.

UnarchiveSessionRequest

Bases: AnnotatedObject

UNSTABLE: Request parameters for unarchiving a session.

Source code in src/aclientp/schema/v2/sessions.py
class UnarchiveSessionRequest(AnnotatedObject):
    """**UNSTABLE**: Request parameters for unarchiving a session."""

    session_id: SessionId
    """The ID of the session to unarchive."""

session_id instance-attribute

session_id: SessionId

The ID of the session to unarchive.

UnarchiveSessionResponse

Bases: AnnotatedObject

UNSTABLE: Response from unarchiving a session.

Source code in src/aclientp/schema/v2/sessions.py
class UnarchiveSessionResponse(AnnotatedObject):
    """**UNSTABLE**: Response from unarchiving a session."""

Unknown

Bases: AnnotatedObject

Base of fallback variants of open unions: a custom or future variant.

Keeps all fields of the payload, so messages can be passed on unchanged.

Source code in src/aclientp/schema/v2/base.py
class Unknown(AnnotatedObject):
    """Base of fallback variants of open unions: a custom or future variant.

    Keeps all fields of the payload, so messages can be passed on unchanged.
    """

    model_config = ConfigDict(extra="allow")

UnknownAuthMethod

Bases: Unknown

A custom or future auth method; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/auth.py
class UnknownAuthMethod(Unknown):
    """A custom or future auth method; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The method type."""

    method_id: AuthMethodId
    """Unique identifier for this authentication method."""

    name: str
    """Human-readable name of the authentication method."""

method_id instance-attribute

method_id: AuthMethodId

Unique identifier for this authentication method.

name instance-attribute

name: str

Human-readable name of the authentication method.

type instance-attribute

type: str

The method type.

UnknownBackgroundWork

Bases: Unknown

Custom or future background work; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/prompt.py
class UnknownBackgroundWork(Unknown):
    """Custom or future background work; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The kind of work."""

type instance-attribute

type: str

The kind of work.

UnknownCommand

Bases: Unknown

A custom or future command kind; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/commands.py
class UnknownCommand(Unknown):
    """A custom or future command kind; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The command kind."""

    name: str
    """Command name."""

    description: str
    """What the command does."""

description instance-attribute

description: str

What the command does.

name instance-attribute

name: str

Command name.

type instance-attribute

type: str

The command kind.

UnknownCommandInput

Bases: Unknown

A custom or future input kind; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/commands.py
class UnknownCommandInput(Unknown):
    """A custom or future input kind; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The input kind."""

type instance-attribute

type: str

The input kind.

UnknownContent

Bases: Unknown

A custom or future content block; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/content.py
class UnknownContent(Unknown):
    """A custom or future content block; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The content block type."""

type instance-attribute

type: str

The content block type.

UnknownCursorAnchor

Bases: Unknown

UNSTABLE: A custom or future anchor kind; the client cannot place such a cursor.

Source code in src/aclientp/schema/v2/cursors.py
class UnknownCursorAnchor(Unknown):
    """**UNSTABLE**: A custom or future anchor kind; the client cannot place such a cursor."""

    type: str
    """The anchor kind."""

type instance-attribute

type: str

The anchor kind.

UnknownDiffChange

Bases: Unknown, _DiffChangeBase

A custom or future file operation; values starting with _ are extensions.

Source code in src/aclientp/schema/v2/tool_calls.py
class UnknownDiffChange(Unknown, _DiffChangeBase):
    """A custom or future file operation; values starting with ``_`` are extensions."""

    operation: str
    """The operation."""

operation instance-attribute

operation: str

The operation.

UnknownElicitationRequest

Bases: Unknown

A custom or future mode; values starting with _ are extensions.

Source code in src/aclientp/schema/v2/elicitation.py
class UnknownElicitationRequest(Unknown):
    """A custom or future mode; values starting with ``_`` are extensions."""

    mode: str
    """The mode."""

    message: str
    """What input is needed."""

message instance-attribute

message: str

What input is needed.

mode instance-attribute

mode: str

The mode.

UnknownElicitationResponse

Bases: Unknown

A custom or future action; values starting with _ are extensions.

Source code in src/aclientp/schema/v2/elicitation.py
class UnknownElicitationResponse(Unknown):
    """A custom or future action; values starting with ``_`` are extensions."""

    action: str
    """The action."""

action instance-attribute

action: str

The action.

UnknownMcpServer

Bases: Unknown

A custom or future MCP transport; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/mcp.py
class UnknownMcpServer(Unknown):
    """A custom or future MCP transport; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The transport."""

type instance-attribute

type: str

The transport.

UnknownMultiSelectItems

Bases: Unknown

Custom or future typed multi-select items.

Source code in src/aclientp/schema/v2/elicitation.py
class UnknownMultiSelectItems(Unknown):
    """Custom or future typed multi-select items."""

    type: str
    """The item type."""

type instance-attribute

type: str

The item type.

UnknownPermissionOutcome

Bases: Unknown

A custom or future outcome; values starting with _ are extensions.

Source code in src/aclientp/schema/v2/permissions.py
class UnknownPermissionOutcome(Unknown):
    """A custom or future outcome; values starting with ``_`` are extensions."""

    outcome: str
    """The outcome kind."""

outcome instance-attribute

outcome: str

The outcome kind.

UnknownPermissionSubject

Bases: Unknown

A custom or future subject; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/permissions.py
class UnknownPermissionSubject(Unknown):
    """A custom or future subject; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The subject kind."""

type instance-attribute

type: str

The subject kind.

UnknownPlanContent

Bases: Unknown

Custom or future plan content; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/plans.py
class UnknownPlanContent(Unknown):
    """Custom or future plan content; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The content kind."""

    plan_id: PlanId
    """The plan to update."""

plan_id instance-attribute

plan_id: PlanId

The plan to update.

type instance-attribute

type: str

The content kind.

UnknownPropertySchema

Bases: Unknown

A custom or future property type; values starting with _ are extensions.

Source code in src/aclientp/schema/v2/elicitation.py
class UnknownPropertySchema(Unknown):
    """A custom or future property type; values starting with ``_`` are extensions."""

    type: str
    """The property type."""

type instance-attribute

type: str

The property type.

UnknownReplayFrom

Bases: Unknown

A custom or future replay cursor; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/sessions.py
class UnknownReplayFrom(Unknown):
    """A custom or future replay cursor; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The cursor kind."""

type instance-attribute

type: str

The cursor kind.

UnknownSessionConfigOption

Bases: Unknown, _ConfigOptionBase

A custom or future option kind; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/config_options.py
class UnknownSessionConfigOption(Unknown, _ConfigOptionBase):
    """A custom or future option kind; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The option kind."""

type instance-attribute

type: str

The option kind.

UnknownSessionUpdate

Bases: Unknown

A custom or future session update; values starting with _ are extensions.

Source code in src/aclientp/schema/v2/session_updates.py
class UnknownSessionUpdate(Unknown):
    """A custom or future session update; values starting with ``_`` are extensions."""

    session_update: str
    """The update kind."""

session_update instance-attribute

session_update: str

The update kind.

UnknownStateSessionUpdate

Bases: UnknownStateUpdate

state_update: the agent cannot currently determine foreground activity.

Source code in src/aclientp/schema/v2/session_updates.py
class UnknownStateSessionUpdate(UnknownStateUpdate):
    """``state_update``: the agent cannot currently determine foreground activity."""

    session_update: Literal["state_update"] = Field(default="state_update", init=False)

UnknownStateUpdate

Bases: _StateBase

The agent cannot currently determine foreground activity.

Replaces previously confirmed states; not to be sent merely because the session has been quiet.

Source code in src/aclientp/schema/v2/prompt.py
class UnknownStateUpdate(_StateBase):
    """The agent cannot currently determine foreground activity.

    Replaces previously confirmed states; not to be sent merely because the session
    has been quiet.
    """

    state: Literal["unknown"] = Field(default="unknown", init=False)

UnknownToolCallContent

Bases: Unknown

Custom or future tool call content; type values starting with _ are extensions.

Source code in src/aclientp/schema/v2/tool_calls.py
class UnknownToolCallContent(Unknown):
    """Custom or future tool call content; ``type`` values starting with ``_`` are extensions."""

    type: str
    """The content kind."""

type instance-attribute

type: str

The content kind.

UnsupportedProtocolVersionErrorData

Bases: AnnotatedObject

Data of the -32022 (Unsupported protocol version) error.

Source code in src/aclientp/schema/v2/common.py
class UnsupportedProtocolVersionErrorData(AnnotatedObject):
    """Data of the ``-32022`` (Unsupported protocol version) error."""

    requested: ProtocolVersion
    """The protocol version the Client requested."""

    supported: Sequence[ProtocolVersion]
    """The protocol versions the Agent supports."""

requested instance-attribute

requested: ProtocolVersion

The protocol version the Client requested.

supported instance-attribute

supported: Sequence[ProtocolVersion]

The protocol versions the Agent supports.

UpdateSessionNotification

Bases: AnnotatedObject

Parameters of session/update: one update of a session.

Source code in src/aclientp/schema/v2/session_updates.py
class UpdateSessionNotification(AnnotatedObject):
    """Parameters of ``session/update``: one update of a session."""

    session_id: SessionId
    """The session the update belongs to."""

    update: SessionUpdate
    """The update."""

session_id instance-attribute

session_id: SessionId

The session the update belongs to.

update instance-attribute

update: SessionUpdate

The update.

UrlElicitationRequest

Bases: _ScopedRequest

The client directs the user to url.

Source code in src/aclientp/schema/v2/elicitation.py
class UrlElicitationRequest(_ScopedRequest):
    """The client directs the user to ``url``."""

    mode: Literal["url"] = Field(default="url", init=False)

    elicitation_id: ElicitationId
    """Unique identifier of the elicitation; completed with ``elicitation/complete``."""

    url: str
    """The URL to direct the user to."""

elicitation_id instance-attribute

elicitation_id: ElicitationId

Unique identifier of the elicitation; completed with elicitation/complete.

url instance-attribute

url: str

The URL to direct the user to.

Usage

Bases: AnnotatedObject

UNSTABLE: Token usage of the foreground work that just completed (not cumulative).

Source code in src/aclientp/schema/v2/common.py
class Usage(AnnotatedObject):
    """**UNSTABLE**: Token usage of the foreground work that just completed (not cumulative)."""

    total_tokens: int = Field(ge=0)
    """Sum of all token types."""

    input_tokens: int = Field(ge=0)
    """Input tokens."""

    output_tokens: int = Field(ge=0)
    """Output tokens."""

    thought_tokens: int | MISSING | None = Field(default=MISSING, ge=0)
    """Thought/reasoning tokens, if reported."""

    cached_read_tokens: int | MISSING | None = Field(default=MISSING, ge=0)
    """Cache read tokens, if reported."""

    cached_write_tokens: int | MISSING | None = Field(default=MISSING, ge=0)
    """Cache write tokens, if reported."""

cached_read_tokens class-attribute instance-attribute

cached_read_tokens: int | MISSING | None = Field(default=MISSING, ge=0)

Cache read tokens, if reported.

cached_write_tokens class-attribute instance-attribute

cached_write_tokens: int | MISSING | None = Field(default=MISSING, ge=0)

Cache write tokens, if reported.

input_tokens class-attribute instance-attribute

input_tokens: int = Field(ge=0)

Input tokens.

output_tokens class-attribute instance-attribute

output_tokens: int = Field(ge=0)

Output tokens.

thought_tokens class-attribute instance-attribute

thought_tokens: int | MISSING | None = Field(default=MISSING, ge=0)

Thought/reasoning tokens, if reported.

total_tokens class-attribute instance-attribute

total_tokens: int = Field(ge=0)

Sum of all token types.

UsageUpdate

Bases: AnnotatedObject

Context window and cost of the session.

Source code in src/aclientp/schema/v2/session_updates.py
class UsageUpdate(AnnotatedObject):
    """Context window and cost of the session."""

    session_update: Literal["usage_update"] = Field(default="usage_update", init=False)

    used: int = Field(ge=0)
    """Tokens currently in the context."""

    size: int = Field(ge=0)
    """Total context window size in tokens."""

    cost: Cost | MISSING | None = MISSING
    """Cumulative session cost; omitted leaves the last cost unchanged, ``None`` clears it."""

cost class-attribute instance-attribute

cost: Cost | MISSING | None = MISSING

Cumulative session cost; omitted leaves the last cost unchanged, None clears it.

size class-attribute instance-attribute

size: int = Field(ge=0)

Total context window size in tokens.

used class-attribute instance-attribute

used: int = Field(ge=0)

Tokens currently in the context.

UserMessage

Bases: _MessageUpsert

A user message upsert, e.g. when the agent accepts or replaces a prompt.

Source code in src/aclientp/schema/v2/messages.py
class UserMessage(_MessageUpsert):
    """A user message upsert, e.g. when the agent accepts or replaces a prompt."""

    session_update: Literal["user_message"] = Field(default="user_message", init=False)

UserMessageChunk

Bases: _Chunk

A chunk of the user's message being streamed.

Source code in src/aclientp/schema/v2/messages.py
class UserMessageChunk(_Chunk):
    """A chunk of the user's message being streamed."""

    session_update: Literal["user_message_chunk"] = Field(default="user_message_chunk", init=False)

UserMessageCursorAnchor

Bases: CursorMessageAnchor

UNSTABLE: The cursor is next to a user message.

Source code in src/aclientp/schema/v2/cursors.py
class UserMessageCursorAnchor(CursorMessageAnchor):
    """**UNSTABLE**: The cursor is next to a user message."""

    type: Literal["user_message"] = Field(default="user_message", init=False)

is_set

is_set(value: T | MISSING) -> TypeIs[T]

Whether a field was given (None counts as given): narrows T | MISSING to T.

MISSING is truthy, so if field: does not work for this.

Source code in src/aclientp/schema/v2/base.py
def is_set[T](value: T | MISSING) -> TypeIs[T]:
    """Whether a field was given (``None`` counts as given): narrows ``T | MISSING`` to ``T``.

    ``MISSING`` is truthy, so ``if field:`` does not work for this.
    """
    return value is not MISSING

supports

supports(capabilities: AnnotatedObject | MISSING | None, path: str) -> bool

Whether a capability marker is present, by its dotted wire path.

path uses the spec's camelCase names, e.g. supports(init.capabilities, "session.systemPrompt.mode.override"). Every object on the way must be present: omitted (MISSING) or null at any level means not supported. Unknown names mean not supported.

Source code in src/aclientp/schema/v2/capabilities.py
def supports(capabilities: AnnotatedObject | MISSING | None, path: str) -> bool:
    """Whether a capability marker is present, by its dotted wire path.

    ``path`` uses the spec's camelCase names, e.g.
    ``supports(init.capabilities, "session.systemPrompt.mode.override")``. Every
    object on the way must be present: omitted (``MISSING``) or ``null`` at any
    level means not supported. Unknown names mean not supported.
    """
    node: object = capabilities
    for name in path.split("."):
        if node is MISSING or node is None or not isinstance(node, AnnotatedObject):
            return False
        attr = to_snake(name)
        if attr not in type(node).model_fields:
            return False
        node = getattr(node, attr)
    return node is not MISSING and node is not None

to_wire

to_wire(model: BaseModel) -> dict[str, Any]

Serialize a v2 model: wire names, MISSING left out, None sent as null.

Source code in src/aclientp/schema/v2/base.py
def to_wire(model: BaseModel) -> dict[str, Any]:
    """Serialize a v2 model: wire names, ``MISSING`` left out, ``None`` sent as ``null``."""
    return model.model_dump(mode="json", by_alias=True)