From 9f97beaae3a45c62661a6f974eccc70bfbba6906 Mon Sep 17 00:00:00 2001 From: Chojan Shang Date: Thu, 26 Nov 2026 16:36:07 +0800 Subject: [PATCH] feat(v2)!: bump ACP schema to 2.0.0-beta.4 BREAKING CHANGE: Update the experimental v2 bindings and runtime to the beta.4 schema, which removes NES and document notifications and requires a non-null request ID for request-scoped elicitation. --- docs/experimental-v2.md | 12 +- schema/v2/VERSION | 2 +- schema/v2/meta.json | 25 +- schema/v2/schema.json | 10253 +++++++++++++--------- scripts/_schema_semantics.py | 6 +- scripts/gen_meta.py | 13 + scripts/gen_schema.py | 23 +- scripts/gen_schema_v2.py | 164 +- scripts/gen_signature.py | 14 +- src/acp/_deserialize.py | 5 + src/acp/_schema_base.py | 2 +- src/acp/experimental/v2/_params.py | 2 +- src/acp/experimental/v2/_schema_base.py | 147 +- src/acp/experimental/v2/agent.py | 39 +- src/acp/experimental/v2/client.py | 221 +- src/acp/experimental/v2/interfaces.py | 158 +- src/acp/experimental/v2/meta.py | 70 +- src/acp/experimental/v2/schema.py | 5548 +++++++----- tests/test_protocol_negotiation.py | 1 + tests/test_stateless_mcp.py | 7 +- tests/test_v2_routing.py | 23 +- tests/test_v2_runtime.py | 132 +- tests/test_v2_schema.py | 209 +- 23 files changed, 10273 insertions(+), 6803 deletions(-) diff --git a/docs/experimental-v2.md b/docs/experimental-v2.md index 087dbe17..26a93d45 100644 --- a/docs/experimental-v2.md +++ b/docs/experimental-v2.md @@ -3,7 +3,9 @@ > **Experimental.** Protocol v2 is a draft. Import it from `acp.experimental` and > expect its API and generated models to change with the upstream schema. -The bindings use `schema-v2.0.0-alpha.7`. +The bindings use [`schema-v2.0.0-beta.4`](https://github.com/agentclientprotocol/agent-client-protocol/releases/tag/schema-v2.0.0-beta.4). +The upstream schema removes Next Edit Suggestions (`nes/*`) and the associated +document notifications from v2. The v2 runtime is separate from the stable v1 API. Like v1, connection methods and agent/client handlers accept expanded, snake-case parameters. Responses and @@ -91,8 +93,8 @@ await agent_connection.create_elicitation( ) ``` -For elicitation, `session_id` selects session scope; otherwise `request_id` -selects request scope (including `None`). Pass `requested_schema` for form mode, +For elicitation, pass either `session_id` for session scope or a string or integer +`request_id` for request scope. Pass `requested_schema` for form mode, or `elicitation_id` and `url` for URL mode. Handlers receive the validated branch's fields, including `type` for config options and `mode` for elicitation. @@ -118,8 +120,8 @@ terminal updates and patch metadata. When applying received patches, use Setting `replay_from=v2.schema.ReplayFromStartVariant()` on `connection.resume_session(...)` requests all retained conversation history; agents need not retain every message. -Accepted elicitation content validates scalar values and string lists; nested -objects are not valid form values. +Accepted elicitation content preserves scalar values, string lists, and any +custom or extension JSON values. Agents that serve both versions use `AgentProtocolRouter`: diff --git a/schema/v2/VERSION b/schema/v2/VERSION index c7bdc61f..4e0d2af8 100644 --- a/schema/v2/VERSION +++ b/schema/v2/VERSION @@ -1 +1 @@ -refs/tags/schema-v2.0.0-alpha.7 +refs/tags/schema-v2.0.0-beta.4 diff --git a/schema/v2/meta.json b/schema/v2/meta.json index 1912c791..88544256 100644 --- a/schema/v2/meta.json +++ b/schema/v2/meta.json @@ -14,28 +14,31 @@ "session_list": "session/list", "session_delete": "session/delete", "session_fork": "session/fork", + "session_archive": "session/archive", + "session_unarchive": "session/unarchive", + "session_status": "session/status", + "session_options": "session/options", + "session_set_title": "session/set_title", "session_resume": "session/resume", "session_close": "session/close", + "tool_call_cancel": "tool_call/cancel", + "terminal_cancel": "terminal/cancel", "auth_logout": "auth/logout", - "nes_start": "nes/start", - "nes_suggest": "nes/suggest", - "nes_accept": "nes/accept", - "nes_reject": "nes/reject", - "nes_close": "nes/close", - "document_did_open": "document/didOpen", - "document_did_change": "document/didChange", - "document_did_close": "document/didClose", - "document_did_save": "document/didSave", - "document_did_focus": "document/didFocus" + "auth_status": "auth/status" }, "clientMethods": { "session_request_permission": "session/request_permission", "session_update": "session/update", "mcp_message": "mcp/message", "elicitation_create": "elicitation/create", - "elicitation_complete": "elicitation/complete" + "elicitation_complete": "elicitation/complete", + "auth_status_update": "auth/status_update" }, "protocolMethods": { "cancel_request": "$/cancel_request" + }, + "proxyMethods": { + "proxy_initialize": "proxy/initialize", + "proxy_successor": "proxy/successor" } } diff --git a/schema/v2/schema.json b/schema/v2/schema.json index 0c867dc5..e20fbf56 100644 --- a/schema/v2/schema.json +++ b/schema/v2/schema.json @@ -86,448 +86,6 @@ } ] }, - { - "title": "AgentBatchCall", - "description": "A non-empty JSON-RPC 2.0 batch message.", - "type": "array", - "items": { - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "type": "object", - "properties": { - "jsonrpc": { - "type": "string", - "enum": [ - "2.0" - ] - } - }, - "required": [ - "jsonrpc" - ], - "anyOf": [ - { - "title": "Request", - "allOf": [ - { - "$ref": "#/$defs/AgentRequest" - } - ] - }, - { - "title": "Notification", - "allOf": [ - { - "$ref": "#/$defs/AgentNotification" - } - ] - }, - { - "title": "ProtocolLevelNotification", - "allOf": [ - { - "$ref": "#/$defs/ProtocolLevelNotification" - } - ] - } - ] - }, - "minItems": 1 - }, - { - "title": "AgentBatchResponse", - "description": "A non-empty JSON-RPC 2.0 batch message.", - "type": "array", - "items": { - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "type": "object", - "properties": { - "jsonrpc": { - "type": "string", - "enum": [ - "2.0" - ] - } - }, - "required": [ - "jsonrpc" - ], - "anyOf": [ - { - "title": "Result", - "description": "A successful JSON-RPC response.", - "type": "object", - "properties": { - "id": { - "description": "The id of the request this response answers.", - "allOf": [ - { - "$ref": "#/$defs/RequestId" - } - ] - }, - "result": { - "description": "Method-specific response data.", - "anyOf": [ - { - "title": "InitializeResponse", - "description": "Successful result returned for a `initialize` request.", - "allOf": [ - { - "$ref": "#/$defs/InitializeResponse" - } - ] - }, - { - "title": "LoginAuthResponse", - "description": "Successful result returned for an `auth/login` request.", - "allOf": [ - { - "$ref": "#/$defs/LoginAuthResponse" - } - ] - }, - { - "title": "ListProvidersResponse", - "description": "Successful result returned for a `providers/list` request.", - "allOf": [ - { - "$ref": "#/$defs/ListProvidersResponse" - } - ] - }, - { - "title": "SetProviderResponse", - "description": "Successful result returned for a `providers/set` request.", - "allOf": [ - { - "$ref": "#/$defs/SetProviderResponse" - } - ] - }, - { - "title": "DisableProviderResponse", - "description": "Successful result returned for a `providers/disable` request.", - "allOf": [ - { - "$ref": "#/$defs/DisableProviderResponse" - } - ] - }, - { - "title": "LogoutAuthResponse", - "description": "Successful result returned for an `auth/logout` request.", - "allOf": [ - { - "$ref": "#/$defs/LogoutAuthResponse" - } - ] - }, - { - "title": "NewSessionResponse", - "description": "Successful result returned for a `session/new` request.", - "allOf": [ - { - "$ref": "#/$defs/NewSessionResponse" - } - ] - }, - { - "title": "ListSessionsResponse", - "description": "Successful result returned for a `session/list` request.", - "allOf": [ - { - "$ref": "#/$defs/ListSessionsResponse" - } - ] - }, - { - "title": "DeleteSessionResponse", - "description": "Successful result returned for a `session/delete` request.", - "allOf": [ - { - "$ref": "#/$defs/DeleteSessionResponse" - } - ] - }, - { - "title": "ForkSessionResponse", - "description": "Successful result returned for a `session/fork` request.", - "allOf": [ - { - "$ref": "#/$defs/ForkSessionResponse" - } - ] - }, - { - "title": "ResumeSessionResponse", - "description": "Successful result returned for a `session/resume` request.", - "allOf": [ - { - "$ref": "#/$defs/ResumeSessionResponse" - } - ] - }, - { - "title": "CloseSessionResponse", - "description": "Successful result returned for a `session/close` request.", - "allOf": [ - { - "$ref": "#/$defs/CloseSessionResponse" - } - ] - }, - { - "title": "SetSessionConfigOptionResponse", - "description": "Successful result returned for a `session/set_config_option` request.", - "allOf": [ - { - "$ref": "#/$defs/SetSessionConfigOptionResponse" - } - ] - }, - { - "title": "PromptResponse", - "description": "Successful result returned for a `session/prompt` request.", - "allOf": [ - { - "$ref": "#/$defs/PromptResponse" - } - ] - }, - { - "title": "StartNesResponse", - "description": "Successful result returned for a `nes/start` request.", - "allOf": [ - { - "$ref": "#/$defs/StartNesResponse" - } - ] - }, - { - "title": "SuggestNesResponse", - "description": "Successful result returned for a `nes/suggest` request.", - "allOf": [ - { - "$ref": "#/$defs/SuggestNesResponse" - } - ] - }, - { - "title": "CloseNesResponse", - "description": "Successful result returned for a `nes/close` request.", - "allOf": [ - { - "$ref": "#/$defs/CloseNesResponse" - } - ] - }, - { - "title": "ExtMethodResponse", - "description": "Successful result returned by an extension method outside the core ACP method set.", - "allOf": [ - { - "$ref": "#/$defs/ExtResponse" - } - ] - } - ] - } - }, - "required": [ - "id", - "result" - ] - }, - { - "title": "Error", - "description": "A failed JSON-RPC response.", - "type": "object", - "properties": { - "id": { - "description": "The id of the request this response answers.", - "allOf": [ - { - "$ref": "#/$defs/RequestId" - } - ] - }, - "error": { - "description": "Method-specific error data.", - "allOf": [ - { - "$ref": "#/$defs/Error" - } - ] - } - }, - "required": [ - "id", - "error" - ] - } - ], - "x-docs-ignore": true - }, - "minItems": 1 - }, - { - "title": "ClientBatchCall", - "description": "A non-empty JSON-RPC 2.0 batch message.", - "type": "array", - "items": { - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "type": "object", - "properties": { - "jsonrpc": { - "type": "string", - "enum": [ - "2.0" - ] - } - }, - "required": [ - "jsonrpc" - ], - "anyOf": [ - { - "title": "Request", - "allOf": [ - { - "$ref": "#/$defs/ClientRequest" - } - ] - }, - { - "title": "Notification", - "allOf": [ - { - "$ref": "#/$defs/ClientNotification" - } - ] - }, - { - "title": "ProtocolLevelNotification", - "allOf": [ - { - "$ref": "#/$defs/ProtocolLevelNotification" - } - ] - } - ] - }, - "minItems": 1 - }, - { - "title": "ClientBatchResponse", - "description": "A non-empty JSON-RPC 2.0 batch message.", - "type": "array", - "items": { - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "type": "object", - "properties": { - "jsonrpc": { - "type": "string", - "enum": [ - "2.0" - ] - } - }, - "required": [ - "jsonrpc" - ], - "anyOf": [ - { - "title": "Result", - "description": "A successful JSON-RPC response.", - "type": "object", - "properties": { - "id": { - "description": "The id of the request this response answers.", - "allOf": [ - { - "$ref": "#/$defs/RequestId" - } - ] - }, - "result": { - "description": "Method-specific response data.", - "anyOf": [ - { - "title": "RequestPermissionResponse", - "description": "Successful result returned for a `session/request_permission` request.", - "allOf": [ - { - "$ref": "#/$defs/RequestPermissionResponse" - } - ] - }, - { - "title": "CreateElicitationResponse", - "description": "Successful result returned for a `elicitation/create` request.", - "allOf": [ - { - "$ref": "#/$defs/CreateElicitationResponse" - } - ] - }, - { - "title": "MessageMcpResponse", - "description": "Successful result returned by an MCP-over-ACP `mcp/message` request.", - "allOf": [ - { - "$ref": "#/$defs/MessageMcpResponse" - } - ] - }, - { - "title": "ExtMethodResponse", - "description": "Successful result returned by an extension method outside the core ACP method set.", - "allOf": [ - { - "$ref": "#/$defs/ExtResponse" - } - ] - } - ] - } - }, - "required": [ - "id", - "result" - ] - }, - { - "title": "Error", - "description": "A failed JSON-RPC response.", - "type": "object", - "properties": { - "id": { - "description": "The id of the request this response answers.", - "allOf": [ - { - "$ref": "#/$defs/RequestId" - } - ] - }, - "error": { - "description": "Method-specific error data.", - "allOf": [ - { - "$ref": "#/$defs/Error" - } - ] - } - }, - "required": [ - "id", - "error" - ] - } - ], - "x-docs-ignore": true - }, - "minItems": 1 - }, { "title": "ProtocolLevel", "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", @@ -547,11 +105,11 @@ "description": "Method-specific notification parameters.", "anyOf": [ { - "description": "General protocol-level notifications that all sides are expected to\nimplement.\n\nNotifications whose methods start with '$/' are messages which\nare protocol implementation dependent and might not be implementable in all\nclients or agents. For example if the implementation uses a single threaded\nsynchronous programming language then there is little it can do to react to\na `$/cancel_request` notification. If an agent or client receives\nnotifications starting with '$/' it is free to ignore the notification.\n\nNotifications do not expect a response.", + "description": "Protocol-level notifications, which either side can send.\n\nTheir methods start with `$/`. Acting on one is optional, because it might not\nbe implementable in every Client or Agent. For example, a single-threaded\nsynchronous implementation can do little to react to a `$/cancel_request`\nnotification. An Agent or Client MAY ignore a `$/` notification it cannot act on.\n\nNotifications do not expect a response.", "anyOf": [ { "title": "CancelRequestNotification", - "description": "Cancels an ongoing request.\n\nThis is a notification sent by the side that sent a request to cancel that request.\n\nUpon receiving this notification, the receiver:\n\n1. MAY cancel the corresponding request activity and all nested activities\n2. MAY send any pending notifications.\n3. MUST send one of these responses for the original request:\n - Valid response with appropriate data (partial results or cancellation marker)\n - Error response with code `-32800` (Cancelled)\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/cancellation)", + "description": "Cancels an ongoing request.\n\nThis is a notification sent by the side that sent a request to cancel that request.\n\nUpon receiving this notification, the receiver:\n\n1. MAY cancel the corresponding request activity and all nested activities\n2. MAY send any pending notifications.\n3. MUST still send a response for the original request. If the request already finished\n or is not cancelled, that is its normal response. If it is cancelled, it is either the\n method's defined cancellation result (for example an inserted `session/prompt`, or a\n `cancelled` permission outcome) or an error with code `-32800` (Request cancelled).\n\nReceivers MUST ignore this notification for an unknown or already-answered request ID,\nand MUST NOT send a second response for it.\n\nSee protocol docs: [Request Cancellation](https://agentclientprotocol.com/protocol/v2/draft/cancellation)", "allOf": [ { "$ref": "#/$defs/CancelRequestNotification" @@ -571,6 +129,48 @@ "method" ], "x-docs-ignore": true + }, + { + "title": "Proxy", + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "type": "object", + "properties": { + "jsonrpc": { + "type": "string", + "enum": [ + "2.0" + ] + } + }, + "required": [ + "jsonrpc" + ], + "anyOf": [ + { + "title": "Request", + "allOf": [ + { + "$ref": "#/$defs/ProxyRequest" + } + ] + }, + { + "title": "Response", + "allOf": [ + { + "$ref": "#/$defs/ProxyResponse" + } + ] + }, + { + "title": "Notification", + "allOf": [ + { + "$ref": "#/$defs/ProxyNotification" + } + ] + } + ] } ], "$defs": { @@ -594,11 +194,11 @@ "description": "Method-specific request parameters.", "anyOf": [ { - "description": "All possible requests that an agent can send to a client.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly.\n\nThis enum encompasses all method calls from agent to client.", + "description": "All possible requests that an Agent can send to a Client.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly.\n\nThis enum encompasses all method calls from Agent to Client.", "anyOf": [ { "title": "RequestPermissionRequest", - "description": "Requests permission from the user for an operation.\n\nCalled by the agent when it needs user authorization before executing\na potentially sensitive operation. The client should present the options\nto the user and return their decision.\n\nIf the client cancels active session work via `session/cancel`, it MUST\nrespond to this request with `RequestPermissionOutcome::Cancelled`.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#requesting-permission)", + "description": "Requests permission from the user for an operation.\n\nCalled by the Agent when it needs user authorization before executing\na potentially sensitive operation. The Client presents the options\nto the user and returns their decision.\n\nAfter `session/cancel`, the Agent stops waiting for requests of the cancelled\nforeground work and MUST cancel them with `$/cancel_request`. The Client\nanswers a cancelled request with the `cancelled` outcome.\n\nIf the selected option has kind `reject_once` or `reject_always`, the Agent MUST NOT\nperform the requested operation.\n\nAn error response is not approval, and neither is a connection that ends\nbefore the Client answers. The Agent MUST NOT treat either as approval.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#requesting-permission)", "allOf": [ { "$ref": "#/$defs/RequestPermissionRequest" @@ -625,7 +225,7 @@ }, { "title": "ExtMethodRequest", - "description": "Handles extension method requests from the agent.\n\nAllows the Agent to send an arbitrary request that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "Handles extension method requests from the Agent.\n\nAllows the Agent to send an arbitrary request that is not part of the ACP spec.\nExtension methods are custom methods that are not part of the ACP spec.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "allOf": [ { "$ref": "#/$defs/ExtRequest" @@ -647,28 +247,23 @@ "x-docs-ignore": true }, "RequestId": { - "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null \\[1\\] and Numbers SHOULD NOT contain fractional parts \\[2\\]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n\\[1\\] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n\\[2\\] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.", + "description": "A JSON-RPC request ID: a string or an integer. Unlike base JSON-RPC, it MUST NOT be `null`.\n\nThe receiver MUST reply with the same value in the response. Each side chooses IDs for its own\nrequests, so the same ID can be in use in both directions. A sender MUST NOT reuse an ID while\na request with it is still awaiting a response.", "anyOf": [ - { - "title": "Null", - "description": "The JSON-RPC `null` request id.", - "type": "null" - }, { "title": "Number", - "description": "A numeric JSON-RPC request id.", + "description": "A numeric request ID.", "type": "integer", "format": "int64" }, { "title": "Str", - "description": "A string JSON-RPC request id.", + "description": "A string request ID.", "type": "string" } ] }, "RequestPermissionRequest": { - "description": "Request for user permission to proceed with an operation.\n\nSent when the agent needs authorization before performing a sensitive operation.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#requesting-permission)", + "description": "Request for user permission to proceed with an operation.\n\nSent when the Agent needs authorization before performing a sensitive operation.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#requesting-permission)", "type": "object", "properties": { "sessionId": { @@ -680,11 +275,11 @@ ] }, "title": { - "description": "Human-readable title for the permission prompt.\n\nThis title is specific to the permission prompt and does not update any\nsubject's displayed title.", + "description": "Human-readable title shown with the permission prompt, in plain text.\n\nThis title is specific to the permission prompt and does not update any\nsubject's displayed title.", "type": "string" }, "description": { - "description": "Optional human-readable explanation of why permission is needed.\n\nThis text is specific to the permission prompt and does not update any\nsubject's displayed content. Omitted or `null` both mean no separate\npermission description was provided.", + "description": "Optional human-readable explanation of why permission is needed.\nMay contain Markdown.\n\nThis text is specific to the permission prompt and does not update any\nsubject's displayed content. Omitted and `null` are equivalent and mean no separate\npermission description was provided.", "type": [ "string", "null" @@ -692,7 +287,7 @@ "x-deserialize-default-on-error": true }, "subject": { - "description": "Optional structured context about the operation requiring permission.\n\nOmitted or `null` both mean no structured subject was provided.", + "description": "Optional structured context about the operation requiring permission.\n\nOmitted and `null` are equivalent and mean no structured subject was provided.", "anyOf": [ { "$ref": "#/$defs/RequestPermissionSubject" @@ -711,7 +306,7 @@ "minItems": 1 }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -726,10 +321,29 @@ "options" ], "x-side": "client", - "x-method": "session/request_permission" + "x-method": "session/request_permission", + "x-scope": { + "session": [ + "sessionId" + ], + "toolCall": [ + "subject.toolCall.toolCallId", + "subject.toolCallId" + ] + }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "toolCall", + "id": "subject.toolCall.toolCallId", + "value": "subject.toolCall" + } + ] + } }, "SessionId": { - "description": "A unique identifier for a conversation session between a client and agent.\n\nSessions maintain their own context, conversation history, and state,\nallowing multiple independent interactions with the same agent.\n\nSee protocol docs: [Session ID](https://agentclientprotocol.com/protocol/v2/draft/session-setup#session-id)", + "description": "A unique identifier for a conversation session between a Client and Agent.\n\nEach session has its own context, conversation history, and state, so one\nAgent can run several independent sessions.\n\nSee protocol docs: [Session ID](https://agentclientprotocol.com/protocol/v2/draft/session-setup#session-id)", "type": "string" }, "RequestPermissionSubject": { @@ -773,7 +387,7 @@ }, { "title": "other", - "description": "Custom or future permission subject.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this subject type should preserve the raw\npayload when storing, replaying, proxying, or forwarding permission\nrequests, and otherwise display a generic permission prompt or decline it\naccording to policy.", + "description": "Custom or future permission subject.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this subject type SHOULD preserve the raw\npayload when storing, replaying, proxying, or forwarding permission\nrequests, and otherwise display a generic permission prompt or decline it\naccording to policy.", "type": "object", "properties": { "type": { @@ -817,7 +431,7 @@ ] }, "ToolCallUpdate": { - "description": "Represents an upsert for a tool call that the language model has requested.\n\nTool calls are actions that the agent executes on behalf of the language model,\nsuch as reading files, executing code, or fetching data from external sources.\n\nOnly [`ToolCallUpdate::tool_call_id`] is required. Other fields have patch semantics:\nomitted fields leave the existing tool call value unchanged, `null` clears or\nunsets the value, and concrete values replace the previous value. For\ncollection fields, concrete arrays replace the previous collection, and both\n`null` and `[]` clear the collection. When a client receives a tool call ID it\nhas not seen before, omitted fields use client defaults.\n\nSee protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/v2/draft/tool-calls)", + "description": "Represents an upsert for a tool call that the language model has requested.\n\nTool calls are actions that the Agent executes on behalf of the language model,\nsuch as reading files, executing code, or fetching data from external sources.\n\nOnly `toolCallId` is required. Other fields have patch semantics:\nomitted fields leave the existing tool call value unchanged, `null` clears or\nunsets the value, and concrete values replace the previous value. For\ncollection fields, concrete arrays replace the previous collection, and both\n`null` and `[]` clear the collection. A concrete `_meta` object instead\npatches the stored metadata by top-level key. When a Client receives a tool\ncall ID it has not seen before, omitted fields start at their protocol defaults.\n\nSee protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/v2/draft/tool-calls)", "type": "object", "properties": { "toolCallId": { @@ -829,7 +443,7 @@ ] }, "name": { - "description": "Programmatic name of the tool being invoked.\n\nThis field is optional and has patch semantics. Omission means no\nchange, `null` clears the name, and a string replaces it. For a tool\ncall ID the client has not seen before, omission or `null` means that no\ntool name is available.", + "description": "Programmatic name of the tool being invoked.\n\nThis field is optional and has patch semantics. Omission means no\nchange, `null` clears the name, and a string replaces it. For a tool\ncall ID the Client has not seen before, omission or `null` means that no\ntool name is available.", "type": [ "string", "null" @@ -837,7 +451,7 @@ "x-deserialize-default-on-error": true }, "title": { - "description": "Human-readable title describing what the tool is doing.", + "description": "Human-readable plain-text title describing what the tool is doing.\n\nOmission leaves the title unchanged, `null` unsets it, and a string replaces it.\nA new tool call starts without a title.", "type": [ "string", "null" @@ -845,7 +459,7 @@ "x-deserialize-default-on-error": true }, "kind": { - "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment.", + "description": "The category of tool being invoked.\nHelps Clients choose appropriate icons and UI treatment.\n\nOmission leaves the kind unchanged, `null` resets it to `other`, and a value replaces it.\nA new tool call starts as `other`.", "anyOf": [ { "$ref": "#/$defs/ToolKind" @@ -857,7 +471,7 @@ "x-deserialize-default-on-error": true }, "status": { - "description": "Current execution status of the tool call.", + "description": "Current execution status of the tool call.\n\nOmission leaves the status unchanged, `null` resets it to `pending`, and a value\nreplaces it. A new tool call starts as `pending`. Agents do not move a tool call\nback to `pending` once it has another status.", "anyOf": [ { "$ref": "#/$defs/ToolCallStatus" @@ -881,7 +495,7 @@ "x-deserialize-skip-invalid-items": true }, "locations": { - "description": "File locations affected by this tool call.\nEnables \"follow-along\" features in clients.", + "description": "File locations affected by this tool call.\nEnables \"follow-along\" features in Clients.", "type": [ "array", "null" @@ -900,8 +514,20 @@ "description": "Raw output returned by the tool.", "x-deserialize-default-on-error": true }, + "capabilities": { + "description": "Client-initiated controls this tool call currently supports, such as cancellation.\n\nOmission leaves the capabilities unchanged, `null` clears them, and an object replaces\nthe whole previous value. A new tool call starts with none.", + "anyOf": [ + { + "$ref": "#/$defs/ToolCallCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Omitted means no metadata update; `null` is an\nexplicit clear signal. Implementations MUST NOT make assumptions about values at these keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", "type": [ "object", "null" @@ -919,7 +545,7 @@ "type": "string" }, "ToolKind": { - "description": "Categories of tools that can be invoked.\n\nTool kinds help clients choose appropriate icons and optimize how they\ndisplay tool execution progress.\n\nSee protocol docs: [Creating](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#creating)", + "description": "Categories of tools that can be invoked.\n\nTool kinds help Clients choose appropriate icons and optimize how they\ndisplay tool execution progress.\n\nSee protocol docs: [Reporting](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#reporting)", "anyOf": [ { "description": "Reading files or data.", @@ -962,7 +588,7 @@ "const": "fetch" }, { - "description": "Switching the current session mode.", + "description": "Changing the session's mode, a [config option](https://agentclientprotocol.com/protocol/v2/draft/session-config-options) with the `mode` category.", "type": "string", "const": "switch_mode" }, @@ -973,7 +599,7 @@ }, { "title": "unknown", - "description": "Custom or future tool kind.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "description": "Custom or future tool kind.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants. Clients display an unrecognized kind as `other`.", "type": "string" } ] @@ -982,7 +608,7 @@ "description": "Execution status of a tool call.\n\nTool calls progress through different statuses during their lifecycle.\n\nSee protocol docs: [Status](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#status)", "anyOf": [ { - "description": "The tool call hasn't started running yet because the input is either\nstreaming or we're awaiting approval.", + "description": "The tool call hasn't started running yet, for example because its input is\nstreaming, it is awaiting approval, or it is scheduled to run later.", "type": "string", "const": "pending" }, @@ -991,6 +617,11 @@ "type": "string", "const": "in_progress" }, + { + "description": "The tool call has started, is not running now, and will not continue until\nsomething resumes it. It may return to `in_progress` any number of times.", + "type": "string", + "const": "paused" + }, { "description": "The tool call completed successfully.", "type": "string", @@ -1008,7 +639,7 @@ }, { "title": "other", - "description": "Custom or future tool call status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "description": "Custom or future tool call status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients treat a tool call with an unrecognized status as still in progress.", "type": "string" } ] @@ -1053,7 +684,7 @@ ] }, { - "description": "A display-only reference to an agent-owned terminal.", + "description": "A display-only reference to an Agent-owned terminal.", "type": "object", "properties": { "type": { @@ -1070,9 +701,27 @@ } ] }, + { + "description": "A display-only reference to another session, such as a subagent.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "session" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/SessionReference" + } + ] + }, { "title": "other", - "description": "Custom or future tool call content.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this content type should preserve the\nraw payload when storing, replaying, proxying, or forwarding tool call\noutput, and otherwise ignore it or display it generically.", + "description": "Custom or future tool call content.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this content type SHOULD preserve the\nraw payload when storing, replaying, proxying, or forwarding tool call\noutput, and otherwise ignore it or display it generically.", "type": "object", "properties": { "type": { @@ -1120,6 +769,18 @@ "required": [ "type" ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "session" + } + }, + "required": [ + "type" + ] } ] }, @@ -1128,10 +789,10 @@ ] }, "ContentBlock": { - "description": "Content blocks represent displayable information in the Agent Client Protocol.\n\nThey provide a structured way to handle various types of user-facing content\u2014whether\nit's text from language models, images for analysis, or embedded resources for context.\n\nContent blocks appear in:\n- User prompts sent via `session/prompt`\n- Language model output reported through `session/update` notifications as\n message updates or streamed chunks\n- Progress updates and results from tool calls\n\nThis structure is compatible with the Model Context Protocol (MCP), enabling\nagents to seamlessly forward content from MCP tool outputs without transformation.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/v2/draft/content)", + "description": "Content blocks represent displayable information in the Agent Client Protocol.\n\nContent blocks appear in:\n- User prompts sent via `session/prompt`\n- Language model output reported through `session/update` notifications as\n message updates or streamed chunks\n- Progress updates and results from tool calls\n\nThis structure is compatible with the Model Context Protocol (MCP), so Agents can\nforward content from MCP tool outputs without transformation.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/v2/draft/content)", "anyOf": [ { - "description": "Text content. May be plain text or formatted with Markdown.\n\nAll agents MUST support text content blocks in prompts.\nClients SHOULD render this text as Markdown.", + "description": "Text content. May be plain text or formatted with Markdown.\n\nAll Agents MUST support text content blocks in prompts.\nClients SHOULD join adjacent text blocks without a separator before rendering.\nClients SHOULD render this text as CommonMark and MAY support GitHub Flavored Markdown\nextensions.", "type": "object", "properties": { "type": { @@ -1185,7 +846,7 @@ ] }, { - "description": "References to resources that the agent can access.\n\nAll agents MUST support resource links in prompts.", + "description": "References to resources that the receiver may be able to read.\n\nAll Agents MUST support resource links in prompts.", "type": "object", "properties": { "type": { @@ -1220,9 +881,27 @@ } ] }, + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA reference to a skill that the user invokes with this prompt.\n\nRequires the `skill` prompt capability when included in prompts. A skill\nreference has no meaning outside a user message.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "skill" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/SkillReference" + } + ] + }, { "title": "other", - "description": "Custom or future content block.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this content block type should preserve\nthe raw payload when storing, replaying, proxying, or forwarding content,\nand otherwise ignore it or display it generically.", + "description": "Custom or future content block.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this content block type SHOULD preserve\nthe raw payload when storing, replaying, proxying, or forwarding content,\nand otherwise ignore it or display it generically. Agents MUST reject a\n`session/prompt` request with a content block type they do not support\nwith `-32602`.", "type": "object", "properties": { "type": { @@ -1294,6 +973,18 @@ "required": [ "type" ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "skill" + } + }, + "required": [ + "type" + ] } ] }, @@ -1302,11 +993,11 @@ ] }, "Annotations": { - "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed", + "description": "Optional annotations for the Client. The Client can use annotations to inform how objects are used or displayed", "type": "object", "properties": { "audience": { - "description": "Intended recipients for this content, such as the user or assistant.", + "description": "Intended recipients for this content, such as the user or assistant.\n\nOmitted and `null` are equivalent and mean no audience is specified.", "type": [ "array", "null" @@ -1318,16 +1009,15 @@ "x-deserialize-skip-invalid-items": true }, "lastModified": { - "description": "Timestamp indicating when the underlying resource was last modified.\n\nMust be an RFC 3339 formatted string (e.g., \"2025-01-12T15:00:58Z\").", + "description": "Timestamp indicating when the underlying resource was last modified.\n\nShould be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\"), as in MCP.\n\nOmitted and `null` are equivalent and mean the modification time is not reported.", "type": [ "string", "null" ], - "format": "date-time", "x-deserialize-default-on-error": true }, "priority": { - "description": "Relative importance of this content when clients choose what to surface.", + "description": "Relative importance of this content when Clients choose what to surface, from 0 (least\nimportant) to 1 (most important).\n\nOmitted and `null` are equivalent and mean no priority is specified.", "type": [ "number", "null" @@ -1338,7 +1028,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1373,11 +1063,11 @@ "type": "object", "properties": { "text": { - "description": "Text payload carried by this content block.", + "description": "Text payload carried by this content block. It may be plain text or Markdown.", "type": "string" }, "annotations": { - "description": "Optional annotations that help clients decide how to display or route this content.", + "description": "Optional annotations that help Clients decide how to display or route this content.\n\nOmitted and `null` are equivalent and mean no annotations are provided.", "anyOf": [ { "$ref": "#/$defs/Annotations" @@ -1389,7 +1079,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1424,7 +1114,7 @@ ] }, "uri": { - "description": "URI associated with this resource or media payload.", + "description": "URI associated with this resource or media payload.\n\nOmitted and `null` are equivalent and mean no URI is associated with the image.", "type": [ "string", "null" @@ -1433,7 +1123,7 @@ "x-deserialize-default-on-error": true }, "annotations": { - "description": "Optional annotations that help clients decide how to display or route this content.", + "description": "Optional annotations that help Clients decide how to display or route this content.\n\nOmitted and `null` are equivalent and mean no annotations are provided.", "anyOf": [ { "$ref": "#/$defs/Annotations" @@ -1445,7 +1135,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1477,7 +1167,7 @@ ] }, "annotations": { - "description": "Optional annotations that help clients decide how to display or route this content.", + "description": "Optional annotations that help Clients decide how to display or route this content.\n\nOmitted and `null` are equivalent and mean no annotations are provided.", "anyOf": [ { "$ref": "#/$defs/Annotations" @@ -1489,7 +1179,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1508,12 +1198,12 @@ "type": "object", "properties": { "src": { - "description": "A standard URI pointing to an icon resource.", + "description": "A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a\n`data:` URI with Base64-encoded image data.\n\nClients MUST accept only `https:` and `data:` URIs, MUST fetch without\ncredentials, and MUST NOT follow redirects that change the scheme or origin.", "type": "string", "format": "uri" }, "mimeType": { - "description": "Optional MIME type override if the source MIME type is missing or generic.", + "description": "Optional MIME type override if the source MIME type is missing or generic.\n\nOmitted and `null` are equivalent and mean the source MIME type is used.", "anyOf": [ { "$ref": "#/$defs/MediaType" @@ -1525,7 +1215,7 @@ "x-deserialize-default-on-error": true }, "sizes": { - "description": "Optional array of strings that specify sizes at which the icon can be used.\nEach string should be in `WxH` format (e.g., `\"48x48\"`, `\"96x96\"`) or\n`\"any\"` for scalable formats like SVG.\n\nIf not provided, the client should assume that the icon can be used at any size.", + "description": "Optional array of strings that specify sizes at which the icon can be used.\nEach string SHOULD be in `WxH` format (e.g., `\"48x48\"`, `\"96x96\"`) or\n`\"any\"` for scalable formats like SVG.\n\nIf not provided, the Client SHOULD assume that the icon can be used at any size.\n\nOmitted and `null` are equivalent and mean no sizes are specified.", "type": [ "array", "null" @@ -1537,7 +1227,7 @@ "x-deserialize-skip-invalid-items": true }, "theme": { - "description": "Optional theme this icon is designed for.", + "description": "Optional theme this icon is designed for.\n\nOmitted and `null` are equivalent and mean the icon is not theme-specific.", "anyOf": [ { "$ref": "#/$defs/IconTheme" @@ -1547,9 +1237,18 @@ } ], "x-deserialize-default-on-error": true - } - }, - "required": [ + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ "src" ] }, @@ -1574,11 +1273,11 @@ ] }, "ResourceLink": { - "description": "A resource that the server is capable of reading, included in a prompt or tool call result.", + "description": "A link to a resource that the receiver may be able to read, included in a prompt or tool call result.", "type": "object", "properties": { "name": { - "description": "Human-readable name shown for this protocol object.", + "description": "Human-readable name shown for the linked resource, in plain text.", "type": "string" }, "uri": { @@ -1587,7 +1286,7 @@ "format": "uri" }, "title": { - "description": "Optional display title for end-user UI.", + "description": "Optional plain-text display title for the resource, intended for end users.\n\nOmitted and `null` are equivalent and mean no title is provided.", "type": [ "string", "null" @@ -1595,7 +1294,7 @@ "x-deserialize-default-on-error": true }, "description": { - "description": "Optional human-readable details shown with this protocol object.", + "description": "Optional human-readable description shown with the link. It describes the resource\ncontents in plain text.\n\nOmitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -1603,7 +1302,7 @@ "x-deserialize-default-on-error": true }, "icons": { - "description": "Optional set of sized icons that the client can display in a user interface.", + "description": "Optional set of sized icons that the Client can display in a user interface.\n\nOmitted and `null` are equivalent and mean no icons are provided.", "type": [ "array", "null" @@ -1615,7 +1314,7 @@ "x-deserialize-skip-invalid-items": true }, "mimeType": { - "description": "MIME type describing the encoded media payload.", + "description": "MIME type describing the encoded media payload.\n\nOmitted and `null` are equivalent and mean the MIME type is not specified.", "anyOf": [ { "$ref": "#/$defs/MediaType" @@ -1627,16 +1326,17 @@ "x-deserialize-default-on-error": true }, "size": { - "description": "Optional size of the linked resource in bytes, if known.", + "description": "Optional size of the linked resource in bytes, if known.\n\nOmitted and `null` are equivalent and mean the size is not known.", "type": [ "integer", "null" ], - "format": "int64", + "format": "uint64", + "minimum": 0, "x-deserialize-default-on-error": true }, "annotations": { - "description": "Optional annotations that help clients decide how to display or route this content.", + "description": "Optional annotations that help Clients decide how to display or route this content.\n\nOmitted and `null` are equivalent and mean no annotations are provided.", "anyOf": [ { "$ref": "#/$defs/Annotations" @@ -1648,7 +1348,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1690,7 +1390,7 @@ "type": "object", "properties": { "text": { - "description": "Text payload carried by this content block.", + "description": "The contents of the resource. Its `mimeType`, when provided, describes the format.", "type": "string" }, "uri": { @@ -1699,7 +1399,7 @@ "format": "uri" }, "mimeType": { - "description": "MIME type describing the encoded media payload.", + "description": "MIME type describing the encoded media payload.\n\nOmitted and `null` are equivalent and mean the MIME type is not specified.", "anyOf": [ { "$ref": "#/$defs/MediaType" @@ -1711,7 +1411,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1740,7 +1440,7 @@ "format": "uri" }, "mimeType": { - "description": "MIME type describing the encoded media payload.", + "description": "MIME type describing the encoded media payload.\n\nOmitted and `null` are equivalent and mean the MIME type is not specified.", "anyOf": [ { "$ref": "#/$defs/MediaType" @@ -1752,7 +1452,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1779,7 +1479,7 @@ ] }, "annotations": { - "description": "Optional annotations that help clients decide how to display or route this content.", + "description": "Optional annotations that help Clients decide how to display or route this content.\n\nOmitted and `null` are equivalent and mean no annotations are provided.", "anyOf": [ { "$ref": "#/$defs/Annotations" @@ -1791,7 +1491,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1804,6 +1504,28 @@ "resource" ] }, + "SkillReference": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA reference to a skill that the user invokes with a prompt.\n\nThe Client sends it in `session/prompt` to invoke a `skill` entry from the\nsession's command list. The Agent MUST treat each reference as the user\nexplicitly invoking that skill for this prompt, and applies the skill to\nthe prompt as a whole. The reference carries no input.\n\nAn Agent that advertises the `session.prompt.skill` capability accepts one\nskill reference per prompt, as the first content block. An Agent that also\nadvertises `session.prompt.skill.inline` accepts any number of them, at any\nposition. Clients MUST NOT send a skill reference that the Agent's\ncapability does not allow.\n\nThe `type` discriminator value is `skill`.", + "type": "object", + "properties": { + "name": { + "description": "The `name` of a `skill` entry in the session's current command list.\n\nRequired and non-null. The Agent MUST reject the prompt with `-32602`\nwhen it cannot resolve the name to a skill the user can invoke.", + "type": "string" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "name" + ] + }, "Content": { "description": "Standard content block (text, images, resources).", "type": "object", @@ -1817,7 +1539,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -1831,11 +1553,11 @@ ] }, "DiffChange": { - "description": "One file-level change described by a [`Diff`].\n\nStructured change metadata lets clients identify affected files and\noperations without parsing the text patch.", + "description": "One file-level change described by a `Diff`.\n\nStructured change metadata lets Clients identify affected files and\noperations without parsing the text patch.", "type": "object", "properties": { "fileType": { - "description": "File content kind.\n\nOmitted or `null` means the content kind is unknown.", + "description": "File content kind after the operation (for `delete`, of the deleted file).\n\nOmitted and `null` are equivalent and mean the content kind is unknown.", "anyOf": [ { "$ref": "#/$defs/DiffFileType" @@ -1847,7 +1569,7 @@ "x-deserialize-default-on-error": true }, "mimeType": { - "description": "MIME type of the file contents.\n\nOmitted or `null` means the MIME type is unknown.", + "description": "MIME type of the file contents after the operation (for `delete`, of the deleted file).\n\nOmitted and `null` are equivalent and mean the MIME type is unknown.", "anyOf": [ { "$ref": "#/$defs/MediaType" @@ -1859,7 +1581,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2071,7 +1793,7 @@ ] }, "AbsolutePath": { - "description": "An absolute filesystem path used by the protocol.", + "description": "An absolute filesystem path used by the protocol.\n\nUses the native syntax of the machine the Agent runs on, such as `/home/user/project`,\n`C:\\Users\\user\\project`, or `\\\\server\\share\\project`. It is not a URI.", "type": "string" }, "DiffPathChange": { @@ -2132,6 +1854,15 @@ "text": { "description": "Patch text in the format named by `format`.", "type": "string" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true } }, "required": [ @@ -2140,10 +1871,10 @@ ] }, "DiffPatchFormat": { - "description": "Text patch format used by [`DiffPatch`].", + "description": "Text patch format used by `DiffPatch`.", "anyOf": [ { - "description": "One or more `diff --git` sections in Git's `--patch` (`-p`) text format.\n\nPaths MUST be absolute. Surrounding commit metadata and email envelopes\nMUST NOT be included.", + "description": "One or more `diff --git` sections in Git's `--patch` (`-p`) text format.\n\nUnlike Git, which writes paths relative to the repository root, every\npath MUST be absolute, including in `rename from`, `rename to`,\n`copy from`, and `copy to` lines, and MUST NOT have a prefix such as\nGit's default `a/` and `b/`. Otherwise paths follow Git: `/dev/null`\nnames the missing side of an added or deleted file in the `---` and\n`+++` lines, and paths with unusual characters are quoted as Git quotes\nthem. Each path, once unquoted, is the same native absolute path string as\nthe matching `changes` entry. Surrounding commit metadata and email envelopes MUST NOT be\nincluded.", "type": "string", "const": "git_patch" }, @@ -2159,15 +1890,16 @@ "type": "object", "properties": { "changes": { - "description": "Structured file changes described by this diff.\n\nClients can use this field without parsing patch text to determine affected paths.", + "description": "Structured file changes described by this diff. Agents MUST include at least one entry.\n\nClients can use this field without parsing patch text to determine affected paths.", "type": "array", "items": { "$ref": "#/$defs/DiffChange" }, + "minItems": 1, "x-deserialize-skip-invalid-items": true }, "patch": { - "description": "Renderable patch text for some or all of the structured changes.\n\nAgents SHOULD provide patch text whenever feasible. Omitted or `null`\nmeans no renderable patch text was provided.", + "description": "Renderable patch text for some or all of the structured changes.\n\nAgents SHOULD provide patch text whenever feasible. Omitted and `null` are\nequivalent and mean no renderable patch text was provided.", "anyOf": [ { "$ref": "#/$defs/DiffPatch" @@ -2179,7 +1911,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2193,11 +1925,11 @@ ] }, "TerminalId": { - "description": "Unique identifier for an agent-owned terminal within a session.", + "description": "Unique identifier for an Agent-owned terminal within a session.", "type": "string" }, "Terminal": { - "description": "A display-only reference to an agent-owned terminal.\n\nTerminal state and output are delivered separately through\n[`TerminalUpdate`] and [`TerminalOutputChunk`].", + "description": "A display-only reference to an Agent-owned terminal.\n\nTerminal state and output are delivered separately through\n`terminal_update` and `terminal_output_chunk` session updates.", "type": "object", "properties": { "terminalId": { @@ -2209,7 +1941,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. This metadata is scoped to the content reference. Omitted\nand `null` are equivalent and mean no item metadata was provided.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2222,8 +1954,34 @@ "terminalId" ] }, + "SessionReference": { + "description": "A display-only reference to another session that this tool call operates on,\nsuch as a subagent it created, delegated to, or is waiting on.\n\nThe referenced session MUST already be known to the Client through ordinary\nsession setup or a `subagent_update` announcement. The reference does not\nestablish ownership, grant any Client-initiated controls, or report that the\nreferenced session received or finished any work.", + "type": "object", + "properties": { + "sessionId": { + "description": "The referenced session.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "sessionId" + ] + }, "ToolCallLocation": { - "description": "A file location being accessed or modified by a tool.\n\nEnables clients to implement \"follow-along\" features that track\nwhich files the agent is working with in real-time.\n\nSee protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#following-the-agent)", + "description": "A file location being accessed or modified by a tool.\n\nEnables Clients to implement \"follow-along\" features that track\nwhich files the Agent is working with in real-time.\n\nSee protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#following-the-agent)", "type": "object", "properties": { "path": { @@ -2235,17 +1993,17 @@ ] }, "line": { - "description": "Optional line number within the file.", + "description": "Optional 1-based line number within the file. Omitted and `null` are equivalent and\nmean no specific line. `0` is invalid.", "type": [ "integer", "null" ], "format": "uint32", - "minimum": 0, + "minimum": 1, "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2258,17 +2016,68 @@ "path" ] }, + "ToolCallCapabilities": { + "description": "Client-initiated controls a tool call currently supports.\n\nSee protocol docs: [Cancelling Tool Calls](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#cancelling-tool-calls)", + "type": "object", + "properties": { + "cancel": { + "description": "Permits the Client to cancel this tool call with `tool_call/cancel`.\n\nOmitted and `null` are equivalent and mean unsupported. An object (including `{}`)\nmeans supported. Agents SHOULD stop advertising it once the tool call reaches a final status.", + "anyOf": [ + { + "$ref": "#/$defs/ToolCallCancelCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "ToolCallCancelCapabilities": { + "description": "Capability to cancel a tool call with `tool_call/cancel`.\n\nSupplying `{}` advertises support. An omitted or `null` `cancel` does not.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, "ToolCallPermissionSubject": { "description": "Permission request details for a tool call.", "type": "object", "properties": { "toolCall": { - "description": "Details about the tool call requiring permission.", + "description": "Details about the tool call requiring permission.\n\nClients apply this to their stored tool call exactly like a `tool_call_update`\nnotification, in the order it was received, before showing the prompt. A first-seen\n`toolCallId` creates the tool call.", "allOf": [ { "$ref": "#/$defs/ToolCallUpdate" } ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true } }, "required": [ @@ -2316,7 +2125,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. Omitted and `null` are equivalent and mean no subject metadata was provided.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2335,7 +2144,7 @@ "type": "object", "properties": { "optionId": { - "description": "Unique identifier for this permission option.", + "description": "Identifier for this permission option. MUST be unique within the request.", "allOf": [ { "$ref": "#/$defs/PermissionOptionId" @@ -2343,11 +2152,11 @@ ] }, "name": { - "description": "Human-readable label to display to the user.", + "description": "Human-readable label for this choice, shown to the user as plain text.", "type": "string" }, "kind": { - "description": "Hint about the nature of this permission option.", + "description": "What selecting this option means. Clients can also use it to choose how to display the option.", "allOf": [ { "$ref": "#/$defs/PermissionOptionKind" @@ -2355,7 +2164,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2375,7 +2184,7 @@ "type": "string" }, "PermissionOptionKind": { - "description": "The type of permission option being presented to the user.\n\nHelps clients choose appropriate icons and UI treatment.", + "description": "The type of permission option being presented to the user.\n\nIf the user selects a `reject_once` or `reject_always` option, the Agent MUST NOT\nperform the requested operation. For `reject_always`, the Agent also remembers\nthe rejection for later operations within its scope.", "anyOf": [ { "description": "Allow this operation only this time.", @@ -2405,15 +2214,15 @@ ] }, "CreateElicitationRequest": { - "description": "Request from the agent to elicit structured user input.\n\nThe agent sends this to the client to request information from the user,\neither via a form or by directing them to a URL.\nElicitations are tied to a session (optionally a tool call) or a request.", + "description": "Request from the Agent to elicit structured user input.\n\nThe Agent sends this to the Client to request information from the user,\neither via a form or by directing them to a URL.\nElicitations are tied to a session (optionally a tool call) or a request.\n\nA session-scoped request follows the aggregate foreground-state contract:\nAgents SHOULD report `requires_action` when the whole foreground workflow is\nblocked on user action. Once reported, they MUST report `running` when progress\nresumes, or `idle` if work ends without resuming. Independent background requests\nand request-scoped elicitations do not themselves change session state.\nAccepting a URL does not mean the external interaction completed.\n\nWhen an Agent stops waiting for an elicitation because its work was cancelled,\nit MUST cancel the request with `$/cancel_request`.\nThe request's scope alone does not establish that dependency.\n\nSee protocol docs: [Elicitation](https://agentclientprotocol.com/protocol/v2/draft/elicitation)", "type": "object", "properties": { "message": { - "description": "A human-readable message describing what input is needed.", + "description": "A plain-text message explaining to the user what the Agent needs and why.", "type": "string" }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2424,7 +2233,7 @@ }, "anyOf": [ { - "description": "Form-based elicitation where the client renders a form from the provided schema.", + "description": "Form-based elicitation where the Client renders a form from the provided schema.", "type": "object", "properties": { "mode": { @@ -2442,7 +2251,7 @@ ] }, { - "description": "URL-based elicitation where the client directs the user to a URL.", + "description": "URL-based elicitation where the Client directs the user to a URL.", "type": "object", "properties": { "mode": { @@ -2461,7 +2270,7 @@ }, { "title": "other", - "description": "Custom or future elicitation mode.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this mode should preserve the raw payload\nwhen storing, replaying, proxying, or forwarding elicitation requests.\nThey MUST NOT render it as a known elicitation mode.", + "description": "Custom or future elicitation mode.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this mode SHOULD preserve the raw payload\nwhen storing, replaying, proxying, or forwarding elicitation requests.\nThey MUST NOT render it as a known elicitation mode.", "type": "object", "properties": { "mode": { @@ -2472,7 +2281,7 @@ "required": [ "mode" ], - "anyOf": [ + "oneOf": [ { "title": "Session", "description": "Tied to a session, optionally to a specific tool call within that session.", @@ -2527,10 +2336,21 @@ "message" ], "x-side": "client", - "x-method": "elicitation/create" + "x-method": "elicitation/create", + "x-scope": { + "request": [ + "requestId" + ], + "session": [ + "sessionId" + ], + "toolCall": [ + "toolCallId" + ] + } }, "ElicitationSessionScope": { - "description": "Session-scoped elicitation, optionally tied to a specific tool call.\n\nWhen `tool_call_id` is set, the elicitation is tied to a specific tool call.\nThis is useful when an agent receives an elicitation from an MCP server\nduring a tool call and needs to redirect it to the user.", + "description": "Session-scoped elicitation, optionally tied to a specific tool call.\n\nWhen `toolCallId` is set, the elicitation is tied to a specific tool call.\nThis is useful when an Agent receives an elicitation from an MCP server\nduring a tool call and needs to redirect it to the user.", "type": "object", "properties": { "sessionId": { @@ -2556,14 +2376,19 @@ }, "required": [ "sessionId" - ] + ], + "propertyNames": { + "not": { + "const": "requestId" + } + } }, "ElicitationRequestScope": { "description": "Request-scoped elicitation, tied to a specific JSON-RPC request outside of a session\n(e.g., during auth/configuration phases before any session is started).", "type": "object", "properties": { "requestId": { - "description": "The request this elicitation is tied to.", + "description": "The pending Client-to-Agent request this elicitation is tied to.", "allOf": [ { "$ref": "#/$defs/RequestId" @@ -2573,16 +2398,22 @@ }, "required": [ "requestId" - ] + ], + "propertyNames": { + "not": { + "enum": [ + "sessionId", + "toolCallId" + ] + } + } }, "ElicitationSchema": { "description": "Type-safe elicitation schema for requesting structured user input.\n\nThis represents a JSON Schema object with primitive-typed properties,\nas required by the elicitation specification.", "type": "object", "properties": { "type": { - "description": "Type discriminator. Always `\"object\"`.", - "x-deserialize-default-on-error": true, - "default": "object", + "description": "Type discriminator. Always `\"object\"`. Any other value is rejected.", "allOf": [ { "$ref": "#/$defs/ElicitationSchemaType" @@ -2590,7 +2421,7 @@ ] }, "title": { - "description": "Optional title for the schema.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", + "description": "Optional plain-text title for the form as a whole.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", "type": [ "string", "null" @@ -2598,9 +2429,8 @@ "x-deserialize-default-on-error": true }, "properties": { - "description": "Property definitions (must be primitive types).", + "description": "Property definitions (MUST be primitive types).", "type": "object", - "default": {}, "additionalProperties": { "$ref": "#/$defs/ElicitationPropertySchema" } @@ -2616,7 +2446,7 @@ } }, "description": { - "description": "Optional description of what this schema represents.\n\nOptional. Omitted and `null` are equivalent and mean no schema description is provided.", + "description": "Optional plain-text description of what the form asks the user to provide.\n\nOptional. Omitted and `null` are equivalent and mean no schema description is provided.", "type": [ "string", "null" @@ -2624,7 +2454,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2632,7 +2462,11 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - } + }, + "required": [ + "type", + "properties" + ] }, "ElicitationSchemaType": { "description": "Type discriminator for elicitation schemas.", @@ -2645,7 +2479,7 @@ ] }, "ElicitationPropertySchema": { - "description": "Property schema for elicitation form fields.\n\nEach variant corresponds to a JSON Schema `\"type\"` value.\nSingle-select enums use the `String` variant with `enum` or `oneOf` set.\nMulti-select enums use the `Array` variant.", + "description": "Property schema for elicitation form fields.\n\nEach variant corresponds to a JSON Schema `\"type\"` value.\nSingle-select enums use `type: \"string\"` with `enum` or `oneOf` set.\nMulti-select enums use `type: \"array\"`.", "anyOf": [ { "description": "String property (or single-select enum when `enum`/`oneOf` is set).", @@ -2739,7 +2573,7 @@ }, { "title": "other", - "description": "Custom or future elicitation property schema.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this property schema type should preserve\nthe raw schema when storing, replaying, proxying, or forwarding\nelicitation requests. They MUST NOT render it as a known input control.", + "description": "Custom or future elicitation property schema.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this property schema type SHOULD preserve\nthe raw schema when storing, replaying, proxying, or forwarding\nelicitation requests. They MUST NOT render it as a known input control.", "type": "object", "properties": { "type": { @@ -2843,7 +2677,7 @@ }, { "title": "other", - "description": "Custom or future string format.\n\nUnknown formats are preserved. Implementations that do not understand a\nformat should treat it as an annotation rather than rejecting the schema.", + "description": "Custom or future string format.\n\nUnknown formats are preserved. Implementations that do not understand a\nformat SHOULD treat it as an annotation rather than rejecting the schema.", "type": "string" } ] @@ -2857,11 +2691,11 @@ "type": "string" }, "title": { - "description": "Human-readable title for this option.", + "description": "Human-readable title for this choice, in plain text. `const` holds the corresponding value.", "type": "string" }, "description": { - "description": "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", + "description": "Plain-text description to help the user choose between options.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -2869,7 +2703,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2888,7 +2722,7 @@ "type": "object", "properties": { "title": { - "description": "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", + "description": "Optional plain-text label for this field in the form.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", "type": [ "string", "null" @@ -2896,7 +2730,7 @@ "x-deserialize-default-on-error": true }, "description": { - "description": "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", + "description": "Plain-text help for the user filling out this field.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -2921,14 +2755,6 @@ "format": "uint32", "minimum": 0 }, - "pattern": { - "description": "Pattern the string must match.\n\nOptional. Omitted and `null` are equivalent and mean there is no pattern constraint.", - "type": [ - "string", - "null" - ], - "format": "regex" - }, "format": { "description": "String format.\n\nOptional. Omitted and `null` are equivalent and mean there is no format constraint.", "anyOf": [ @@ -2971,7 +2797,7 @@ "minItems": 1 }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -2986,7 +2812,7 @@ "type": "object", "properties": { "title": { - "description": "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", + "description": "Optional plain-text label for this field in the form.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", "type": [ "string", "null" @@ -2994,7 +2820,7 @@ "x-deserialize-default-on-error": true }, "description": { - "description": "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", + "description": "Plain-text help for the user filling out this field.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -3027,7 +2853,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3042,7 +2868,7 @@ "type": "object", "properties": { "title": { - "description": "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", + "description": "Optional plain-text label for this field in the form.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", "type": [ "string", "null" @@ -3050,7 +2876,7 @@ "x-deserialize-default-on-error": true }, "description": { - "description": "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", + "description": "Plain-text help for the user filling out this field.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -3083,7 +2909,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3098,7 +2924,7 @@ "type": "object", "properties": { "title": { - "description": "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", + "description": "Optional plain-text label for this field in the form.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", "type": [ "string", "null" @@ -3106,7 +2932,7 @@ "x-deserialize-default-on-error": true }, "description": { - "description": "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", + "description": "Plain-text help for the user filling out this field.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -3122,7 +2948,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3186,7 +3012,7 @@ }, { "title": "titled", - "description": "Titled multi-select items with human-readable labels.", + "description": "Titled multi-select items with human-readable labels.\n\nAs in MCP, titled items omit `type` and are identified by `anyOf`.", "allOf": [ { "$ref": "#/$defs/TitledMultiSelectItems" @@ -3208,7 +3034,7 @@ "minItems": 1 }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3222,7 +3048,7 @@ ] }, "TitledMultiSelectItems": { - "description": "Items definition for titled multi-select enum properties.", + "description": "Titled multi-select items use `anyOf` and omit `type`.", "type": "object", "properties": { "anyOf": { @@ -3234,7 +3060,7 @@ "minItems": 1 }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3245,14 +3071,19 @@ }, "required": [ "anyOf" - ] + ], + "propertyNames": { + "not": { + "const": "type" + } + } }, "MultiSelectPropertySchema": { "description": "Schema for multi-select (array) properties in an elicitation form.", "type": "object", "properties": { "title": { - "description": "Optional title for the property.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", + "description": "Optional plain-text label for this field in the form.\n\nOptional. Omitted and `null` are equivalent and mean no title is provided.", "type": [ "string", "null" @@ -3260,7 +3091,7 @@ "x-deserialize-default-on-error": true }, "description": { - "description": "Human-readable description.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", + "description": "Plain-text help for the user filling out this field.\n\nOptional. Omitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -3306,7 +3137,7 @@ "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3320,7 +3151,7 @@ ] }, "ElicitationFormMode": { - "description": "Form-based elicitation mode where the client renders a form from the provided schema.", + "description": "Form-based elicitation mode where the Client renders a form from the provided schema.", "type": "object", "properties": { "requestedSchema": { @@ -3332,7 +3163,7 @@ ] } }, - "anyOf": [ + "oneOf": [ { "title": "Session", "description": "Tied to a session, optionally to a specific tool call within that session.", @@ -3361,7 +3192,7 @@ "type": "string" }, "ElicitationUrlMode": { - "description": "URL-based elicitation mode where the client directs the user to a URL.", + "description": "URL-based elicitation mode where the Client directs the user to a URL.", "type": "object", "properties": { "elicitationId": { @@ -3378,7 +3209,7 @@ "format": "uri" } }, - "anyOf": [ + "oneOf": [ { "title": "Session", "description": "Tied to a session, optionally to a specific tool call within that session.", @@ -3404,7 +3235,7 @@ ] }, "MessageMcpRequest": { - "description": "**UNSTABLE**\n\nRequest parameters for `mcp/message`, sent from consumer to provider.", + "description": "**UNSTABLE**\n\nRequest parameters for `mcp/message`, sent from consumer to provider.\n\n`sessionId` and `toolCallId` name the session and tool call the request was\nsent for. Both are optional. The provider can use `sessionId` to choose\nwhich session the request runs for, and `toolCallId` to show the request\nwith the tool call that the Agent reports. Neither field grants\npermission to run the request.\n\nSee RFD: [MCP-over-ACP](https://agentclientprotocol.com/rfds/mcp-over-acp#session-and-tool-call-attribution)", "type": "object", "properties": { "serverId": { @@ -3428,15 +3259,38 @@ "type": "string" }, "params": { - "description": "Optional inner MCP params; null is equivalent to omission.", + "description": "Optional inner MCP params. Null is equivalent to omission.", "type": [ "object", "null" ], "additionalProperties": true }, + "sessionId": { + "description": "The session whose work caused this request. It is the `sessionId` the\nAgent uses on `session/update` for that work. For a child session's work,\nthat is the child's ID.\n\nOptional. Omitted and `null` are equivalent and mean the Agent supplied\nno session. The Agent SHOULD include it when it knows the session, and\nMUST NOT send another session's ID when it does not. A provider that\nneeds the session to run the request MAY reject a request without it.", + "anyOf": [ + { + "$ref": "#/$defs/SessionId" + }, + { + "type": "null" + } + ] + }, + "toolCallId": { + "description": "The tool call in that session that this request is part of. It is the\n`toolCallId` the Agent uses to report the call in `session/update`. The\nAgent SHOULD report the tool call before it sends the request.\n\nOptional. Omitted and `null` are equivalent and mean the Agent supplied\nno tool call. The Agent MUST NOT send it without `sessionId`. More than\none request can name the same tool call.", + "anyOf": [ + { + "$ref": "#/$defs/ToolCallId" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "ACP extension metadata (not inner MCP params._meta); null is equivalent to omission.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis is ACP metadata, not the inner MCP message's `_meta`.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3451,7 +3305,38 @@ "method" ], "x-side": "client", - "x-method": "mcp/message" + "x-method": "mcp/message", + "x-scope": { + "mcpServer": [ + "serverId" + ], + "session": [ + "sessionId" + ], + "toolCall": [ + "toolCallId" + ] + }, + "if": { + "properties": { + "toolCallId": { + "type": "string" + } + }, + "required": [ + "toolCallId" + ] + }, + "then": { + "properties": { + "sessionId": { + "type": "string" + } + }, + "required": [ + "sessionId" + ] + } }, "McpServerAcpId": { "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for an MCP server using the ACP transport.\n\nThe value is opaque and generated by the ACP component providing the MCP server. It is\nused by `mcp/message` to route requests to the component that declared the server.", @@ -3462,7 +3347,7 @@ "type": "string" }, "ExtRequest": { - "description": "Allows for sending an arbitrary request that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)" + "description": "Allows for sending an arbitrary request that is not part of the ACP spec.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)" }, "AgentResponse": { "description": "A JSON-RPC response object.", @@ -3537,6 +3422,15 @@ } ] }, + { + "title": "AuthStatusResponse", + "description": "Successful result returned for an `auth/status` request.", + "allOf": [ + { + "$ref": "#/$defs/AuthStatusResponse" + } + ] + }, { "title": "NewSessionResponse", "description": "Successful result returned for a `session/new` request.", @@ -3574,65 +3468,101 @@ ] }, { - "title": "ResumeSessionResponse", - "description": "Successful result returned for a `session/resume` request.", + "title": "ArchiveSessionResponse", + "description": "Successful result returned for a `session/archive` request.", "allOf": [ { - "$ref": "#/$defs/ResumeSessionResponse" + "$ref": "#/$defs/ArchiveSessionResponse" } ] }, { - "title": "CloseSessionResponse", - "description": "Successful result returned for a `session/close` request.", + "title": "UnarchiveSessionResponse", + "description": "Successful result returned for a `session/unarchive` request.", "allOf": [ { - "$ref": "#/$defs/CloseSessionResponse" + "$ref": "#/$defs/UnarchiveSessionResponse" } ] }, { - "title": "SetSessionConfigOptionResponse", - "description": "Successful result returned for a `session/set_config_option` request.", + "title": "SessionStatusResponse", + "description": "Successful result returned for a `session/status` request.", "allOf": [ { - "$ref": "#/$defs/SetSessionConfigOptionResponse" + "$ref": "#/$defs/SessionStatusResponse" } ] }, { - "title": "PromptResponse", - "description": "Successful result returned for a `session/prompt` request.", + "title": "SessionOptionsResponse", + "description": "Successful result returned for a `session/options` request.", "allOf": [ { - "$ref": "#/$defs/PromptResponse" + "$ref": "#/$defs/SessionOptionsResponse" + } + ] + }, + { + "title": "SetSessionTitleResponse", + "description": "Successful result returned for a `session/set_title` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, + { + "title": "ResumeSessionResponse", + "description": "Successful result returned for a `session/resume` request.", + "allOf": [ + { + "$ref": "#/$defs/ResumeSessionResponse" + } + ] + }, + { + "title": "CloseSessionResponse", + "description": "Successful result returned for a `session/close` request.", + "allOf": [ + { + "$ref": "#/$defs/CloseSessionResponse" + } + ] + }, + { + "title": "CancelToolCallResponse", + "description": "Successful result returned for a `tool_call/cancel` request.", + "allOf": [ + { + "$ref": "#/$defs/CancelToolCallResponse" } ] }, { - "title": "StartNesResponse", - "description": "Successful result returned for a `nes/start` request.", + "title": "CancelTerminalResponse", + "description": "Successful result returned for a `terminal/cancel` request.", "allOf": [ { - "$ref": "#/$defs/StartNesResponse" + "$ref": "#/$defs/CancelTerminalResponse" } ] }, { - "title": "SuggestNesResponse", - "description": "Successful result returned for a `nes/suggest` request.", + "title": "SetSessionConfigOptionResponse", + "description": "Successful result returned for a `session/set_config_option` request.", "allOf": [ { - "$ref": "#/$defs/SuggestNesResponse" + "$ref": "#/$defs/SetSessionConfigOptionResponse" } ] }, { - "title": "CloseNesResponse", - "description": "Successful result returned for a `nes/close` request.", + "title": "PromptResponse", + "description": "Successful result returned for a `session/prompt` request.", "allOf": [ { - "$ref": "#/$defs/CloseNesResponse" + "$ref": "#/$defs/PromptResponse" } ] }, @@ -3659,10 +3589,21 @@ "type": "object", "properties": { "id": { - "description": "The id of the request this response answers.", - "allOf": [ + "description": "The id of the request this response answers.\n\nRequired. `null` only when the request's id could not be determined, such as\nfor a parse error or an invalid request.", + "anyOf": [ { - "$ref": "#/$defs/RequestId" + "title": "Number", + "description": "A numeric request ID.", + "type": "integer", + "format": "int64" + }, + { + "title": "Str", + "description": "A string request ID.", + "type": "string" + }, + { + "type": "null" } ] }, @@ -3684,11 +3625,11 @@ "x-docs-ignore": true }, "InitializeResponse": { - "description": "Response to the `initialize` method.\n\nContains the negotiated protocol version and agent capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)", + "description": "Response to the `initialize` method.\n\nContains the negotiated protocol version and Agent capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)", "type": "object", "properties": { "protocolVersion": { - "description": "The protocol version the client specified if supported by the agent,\nor the latest protocol version supported by the agent.\n\nThe client should disconnect, if it doesn't support this version.", + "description": "The highest protocol version supported by the Agent that is at or below\nthe version requested by the Client. If no such version exists,\ninitialization fails with error code -32022.\n\nThe Client MUST check that it supports this version and SHOULD disconnect\nif it does not.", "allOf": [ { "$ref": "#/$defs/ProtocolVersion" @@ -3704,7 +3645,7 @@ ] }, "capabilities": { - "description": "Capabilities supported by the agent.", + "description": "Capabilities supported by the Agent.", "x-deserialize-default-on-error": true, "default": {}, "allOf": [ @@ -3714,7 +3655,7 @@ ] }, "authMethods": { - "description": "Authentication methods supported by the agent.\n\nOptional. Omitted or empty means the agent does not advertise the\nauthentication method surface. Supplying one or more valid methods means\nthe agent MUST support both `auth/login` and `auth/logout`.", + "description": "Authentication methods supported by the Agent.\n\nOptional. Omitted or empty means the Agent does not advertise the\n`auth/login` and `auth/logout` methods. Supplying one or more methods means\nthe Agent MUST support both `auth/login` and `auth/logout`.", "type": "array", "items": { "$ref": "#/$defs/AuthMethod" @@ -3723,7 +3664,7 @@ "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3747,15 +3688,15 @@ "maximum": 65535 }, "Implementation": { - "description": "Metadata about the implementation of the client or agent.\nDescribes the name and version of an ACP implementation, with an optional\ntitle for UI representation.", + "description": "Metadata about the implementation of the Client or Agent.\nDescribes the name and version of an ACP implementation, with an optional\ntitle for UI representation.", "type": "object", "properties": { "name": { - "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn\u2019t present.", + "description": "Name intended for programmatic or logical use. It can also serve as the\nplain-text display name when `title` is absent.", "type": "string" }, "title": { - "description": "Intended for UI and end-user contexts \u2014 optimized to be human-readable\nand easily understood.\n\nIf not provided, the name should be used for display.", + "description": "Optional human-readable title chosen to make the implementation easy to\nrecognize in the user interface. The title is plain text.\n\nOmission and `null` are equivalent. When displaying an implementation without a title,\nthe receiver SHOULD use `name`.", "type": [ "string", "null" @@ -3767,7 +3708,7 @@ "type": "string" }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3782,11 +3723,11 @@ ] }, "AgentCapabilities": { - "description": "Capabilities supported by the agent.\n\nAdvertised during initialization to inform the client about\navailable features and content types.\n\nSee protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#agent-capabilities)", + "description": "Capabilities supported by the Agent.\n\nAdvertised during initialization to inform the Client about\navailable features and content types.\n\nSee protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#agent-capabilities)", "type": "object", "properties": { "session": { - "description": "Session capabilities supported by the agent.\n\nOptional. Omitted or `null` both mean the agent does not support the\n`session/*` method surface. Supplying `{}` means the agent supports the\nbaseline session methods: `session/new`, `session/prompt`,\n`session/cancel`, and `session/update`.", + "description": "Session capabilities supported by the Agent.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not support the\n`session/*` methods. Supplying `{}` means the Agent supports the\nbaseline session methods: `session/new`, `session/list`,\n`session/resume`, `session/close`, `session/prompt`, `session/cancel`,\nand `session/update`.", "anyOf": [ { "$ref": "#/$defs/SessionCapabilities" @@ -3798,7 +3739,7 @@ "x-deserialize-default-on-error": true }, "auth": { - "description": "Authentication-related extension capabilities supported by the agent.\n\nOptional. Omitted or `null` both mean the agent does not advertise any\nauthentication-related extensions. This field does not advertise support\nfor `auth/login` or `auth/logout`; those methods are advertised by a\nnon-empty `authMethods` list in the `initialize` response.", + "description": "Authentication-related extension capabilities supported by the Agent.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise any\nauthentication-related extensions. This field does not advertise support\nfor `auth/login` or `auth/logout`. Those methods are advertised by a\nnon-empty `authMethods` list in the `initialize` response.", "anyOf": [ { "$ref": "#/$defs/AgentAuthCapabilities" @@ -3810,7 +3751,7 @@ "x-deserialize-default-on-error": true }, "providers": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProvider configuration capabilities supported by the agent.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports provider configuration methods.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProvider configuration capabilities supported by the Agent.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports provider configuration methods.", "anyOf": [ { "$ref": "#/$defs/ProvidersCapabilities" @@ -3821,35 +3762,11 @@ ], "x-deserialize-default-on-error": true }, - "nes": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNES (Next Edit Suggestions) capabilities supported by the agent.\n\nOptional. Omitted or `null` both mean the agent does not advertise support\nfor NES methods.", - "anyOf": [ - { - "$ref": "#/$defs/NesCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "positionEncoding": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe position encoding selected by the agent from the client's supported encodings.", - "anyOf": [ - { - "$ref": "#/$defs/PositionEncodingKind" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" ], "x-deserialize-default-on-error": true, "additionalProperties": true @@ -3857,11 +3774,11 @@ } }, "SessionCapabilities": { - "description": "Session capabilities supported by the agent.\n\nSupplying `{}` means the agent supports the baseline session methods:\n`session/new`, `session/list`, `session/resume`, `session/close`,\n`session/prompt`, `session/cancel`, and `session/update`.\n\nAgents that support sessions **MAY** support additional session methods,\nprompt content types, and MCP transports by specifying additional\ncapabilities.\n\nSee protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#session-capabilities)", + "description": "Session capabilities supported by the Agent.\n\nSupplying `{}` means the Agent supports the baseline session methods:\n`session/new`, `session/list`, `session/resume`, `session/close`,\n`session/prompt`, `session/cancel`, and `session/update`.\n\nAgents that support sessions MAY support additional session methods,\nprompt content types, and MCP transports by specifying additional\ncapabilities.\n\nSee protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#session-capabilities)", "type": "object", "properties": { "prompt": { - "description": "Prompt capabilities supported by the agent in `session/prompt` requests.\n\nOptional. Omitted or `null` both mean the agent does not advertise any\nprompt extensions beyond the baseline text and resource-link content\nrequired by `session/prompt`.", + "description": "Prompt capabilities supported by the Agent in `session/prompt` requests.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise any\nprompt extensions beyond the baseline text and resource-link content\nrequired by `session/prompt`.", "anyOf": [ { "$ref": "#/$defs/PromptCapabilities" @@ -3873,7 +3790,7 @@ "x-deserialize-default-on-error": true }, "mcp": { - "description": "MCP capabilities supported by the agent for session lifecycle requests.\n\nOptional. Omitted or `null` both mean the agent does not advertise MCP\nserver transport support for sessions.", + "description": "MCP capabilities supported by the Agent for session lifecycle requests.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise MCP\nserver transport support for sessions.", "anyOf": [ { "$ref": "#/$defs/McpCapabilities" @@ -3885,7 +3802,7 @@ "x-deserialize-default-on-error": true }, "delete": { - "description": "Whether the agent supports `session/delete`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports deleting sessions from `session/list`.", + "description": "Whether the Agent supports `session/delete`.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports deleting sessions from `session/list`.", "anyOf": [ { "$ref": "#/$defs/SessionDeleteCapabilities" @@ -3897,7 +3814,7 @@ "x-deserialize-default-on-error": true }, "additionalDirectories": { - "description": "Whether the agent supports `additionalDirectories` on supported session lifecycle requests.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports `additionalDirectories` on\nsupported session lifecycle requests.\n\nAgents may return `SessionInfo.additionalDirectories` to report the\ncomplete ordered additional-root list associated with a listed session.", + "description": "Whether the Agent supports `additionalDirectories` on supported session lifecycle requests.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports `additionalDirectories` on\nsupported session lifecycle requests.\n\nAgents MAY return `SessionInfo.additionalDirectories` to report the\ncomplete ordered additional-root list associated with a listed session.", "anyOf": [ { "$ref": "#/$defs/SessionAdditionalDirectoriesCapabilities" @@ -3908,8 +3825,20 @@ ], "x-deserialize-default-on-error": true }, + "systemPrompt": { + "description": "Whether the Agent supports `systemPrompt` on session lifecycle requests.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports `systemPrompt` in `append` mode.", + "anyOf": [ + { + "$ref": "#/$defs/SessionSystemPromptCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "fork": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the agent supports `session/fork`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports forking sessions.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the Agent supports `session/fork`.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports forking sessions.", "anyOf": [ { "$ref": "#/$defs/SessionForkCapabilities" @@ -3920,8 +3849,56 @@ ], "x-deserialize-default-on-error": true }, + "archive": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the Agent supports `session/archive` and `session/unarchive`.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports both methods, the `archived` filter on\n`session/list`, and `SessionInfo.archived`.", + "anyOf": [ + { + "$ref": "#/$defs/SessionArchiveCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "status": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the Agent supports `session/status`.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports checking session status.", + "anyOf": [ + { + "$ref": "#/$defs/SessionStatusCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "options": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the Agent supports `session/options`.\n\nOptional. Omitted or `null` both mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports `session/options` and accepts initial\nconfig option values on session setup requests.", + "anyOf": [ + { + "$ref": "#/$defs/SessionOptionsCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "title": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the Agent supports `session/set_title`.\n\nAgents report titles through `session/list` and `session_info_update` without this\ncapability. It only advertises that Clients can set titles.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports setting session titles.", + "anyOf": [ + { + "$ref": "#/$defs/SessionTitleCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3932,11 +3909,11 @@ } }, "PromptCapabilities": { - "description": "Prompt capabilities supported by the agent in `session/prompt` requests.\n\nBaseline agent functionality requires support for [`ContentBlock::Text`]\nand [`ContentBlock::ResourceLink`] in prompt requests.\n\nOther variants must be explicitly opted in to.\nCapabilities for different types of content in prompt requests.\n\nIndicates which content types beyond the baseline (text and resource links)\nthe agent can process.\n\nSee protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#prompt-capabilities)", + "description": "Prompt capabilities supported by the Agent in `session/prompt` requests.\n\nBaseline Agent functionality requires support for `text`\nand `resource_link` content blocks in prompt requests.\n\nOther content types need one of these capabilities.\nCapabilities for different types of content in prompt requests.\n\nIndicates which content types beyond the baseline (text and resource links)\nthe Agent can process.\n\nSee protocol docs: [Session Prompt Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#session-prompt-capabilities)", "type": "object", "properties": { "image": { - "description": "Agent supports [`ContentBlock::Image`].\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports image content in prompts.", + "description": "Agent supports `image` content blocks.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports image content in prompts.", "anyOf": [ { "$ref": "#/$defs/PromptImageCapabilities" @@ -3948,7 +3925,7 @@ "x-deserialize-default-on-error": true }, "audio": { - "description": "Agent supports [`ContentBlock::Audio`].\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports audio content in prompts.", + "description": "Agent supports `audio` content blocks.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports audio content in prompts.", "anyOf": [ { "$ref": "#/$defs/PromptAudioCapabilities" @@ -3960,7 +3937,7 @@ "x-deserialize-default-on-error": true }, "embeddedContext": { - "description": "Agent supports embedded context in `session/prompt` requests.\n\nWhen enabled, the Client is allowed to include [`ContentBlock::Resource`]\nin prompt requests for pieces of context that are referenced in the message.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports embedded context in prompts.", + "description": "Agent supports embedded context in `session/prompt` requests.\n\nWhen enabled, the Client is allowed to include `resource` content blocks\nin prompt requests for pieces of context that are referenced in the message.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports embedded context in prompts.", "anyOf": [ { "$ref": "#/$defs/PromptEmbeddedContextCapabilities" @@ -3971,8 +3948,20 @@ ], "x-deserialize-default-on-error": true }, + "skill": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAgent supports `skill` content blocks.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means a prompt may contain one `skill` content block, as its first block.\nAn Agent that sends `skill` entries in `availableCommands` MUST advertise this capability.", + "anyOf": [ + { + "$ref": "#/$defs/PromptSkillCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3983,11 +3972,11 @@ } }, "PromptImageCapabilities": { - "description": "Capabilities for image content in prompt requests.\n\nSupplying `{}` means the agent supports image content in prompts.", + "description": "Capabilities for image content in prompt requests.\n\nSupplying `{}` means the Agent supports image content in prompts.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -3998,11 +3987,11 @@ } }, "PromptAudioCapabilities": { - "description": "Capabilities for audio content in prompt requests.\n\nSupplying `{}` means the agent supports audio content in prompts.", + "description": "Capabilities for audio content in prompt requests.\n\nSupplying `{}` means the Agent supports audio content in prompts.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4013,11 +4002,53 @@ } }, "PromptEmbeddedContextCapabilities": { - "description": "Capabilities for embedded context in prompt requests.\n\nSupplying `{}` means the agent supports embedded context in prompts.", + "description": "Capabilities for embedded context in prompt requests.\n\nSupplying `{}` means the Agent supports embedded context in prompts.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "PromptSkillCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for `skill` content blocks in prompt requests.\n\nSupplying `{}` means a prompt may contain one `skill` content block, as\nits first block. The Agent opts in to more with the `inline` field.", + "type": "object", + "properties": { + "inline": { + "description": "Agent supports `skill` content blocks at any position in a prompt.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means a prompt may contain any number of `skill` content blocks, at any\nposition.", + "anyOf": [ + { + "$ref": "#/$defs/PromptSkillInlineCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "PromptSkillInlineCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for `skill` content blocks at any position in a prompt.\n\nSupplying `{}` means a prompt may contain any number of `skill` content\nblocks, at any position.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4028,11 +4059,11 @@ } }, "McpCapabilities": { - "description": "MCP capabilities supported by the agent for session lifecycle requests.", + "description": "MCP capabilities supported by the Agent for session lifecycle requests.", "type": "object", "properties": { "stdio": { - "description": "Agent supports [`McpServer::Stdio`].\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports stdio MCP server transports.", + "description": "Agent supports `stdio` MCP servers.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports stdio MCP server transports.", "anyOf": [ { "$ref": "#/$defs/McpStdioCapabilities" @@ -4044,7 +4075,7 @@ "x-deserialize-default-on-error": true }, "http": { - "description": "Agent supports [`McpServer::Http`].\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports HTTP MCP server transports.", + "description": "Agent supports `http` MCP servers.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports HTTP MCP server transports.", "anyOf": [ { "$ref": "#/$defs/McpHttpCapabilities" @@ -4056,7 +4087,7 @@ "x-deserialize-default-on-error": true }, "acp": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAgent supports [`McpServer::Acp`].\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports ACP MCP server transports.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAgent supports `acp` MCP servers.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports ACP MCP server transports.", "anyOf": [ { "$ref": "#/$defs/McpAcpCapabilities" @@ -4068,7 +4099,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4079,11 +4110,11 @@ } }, "McpStdioCapabilities": { - "description": "Capabilities for stdio MCP server transports.\n\nSupplying `{}` means the agent supports stdio MCP server transports.", + "description": "Capabilities for stdio MCP server transports.\n\nSupplying `{}` means the Agent supports stdio MCP server transports.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4094,11 +4125,11 @@ } }, "McpHttpCapabilities": { - "description": "Capabilities for HTTP MCP server transports.\n\nSupplying `{}` means the agent supports HTTP MCP server transports.", + "description": "Capabilities for HTTP MCP server transports.\n\nSupplying `{}` means the Agent supports HTTP MCP server transports.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4109,11 +4140,11 @@ } }, "McpAcpCapabilities": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for ACP MCP server transports.\n\nSupplying `{}` means the agent supports ACP MCP server transports.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for ACP MCP server transports.\n\nSupplying `{}` means the Agent supports ACP MCP server transports.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4124,11 +4155,11 @@ } }, "SessionDeleteCapabilities": { - "description": "Capabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.", + "description": "Capabilities for the `session/delete` method.\n\nSupplying `{}` means the Agent supports deleting sessions from `session/list`.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4139,11 +4170,11 @@ } }, "SessionAdditionalDirectoriesCapabilities": { - "description": "Capabilities for additional session directories support.\n\nSupplying `{}` means the agent supports the `additionalDirectories` field on\nsupported session lifecycle requests. Agents that also support\n`session/list` may return `SessionInfo.additionalDirectories` to report the\ncomplete ordered additional-root list associated with a listed session.", + "description": "Capabilities for additional session directories support.\n\nSupplying `{}` means the Agent supports the `additionalDirectories` field on\nsupported session lifecycle requests. Agents MAY return\n`SessionInfo.additionalDirectories` in `session/list` to report the\ncomplete ordered additional-root list associated with a listed session.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4153,12 +4184,24 @@ } } }, - "SessionForkCapabilities": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for the `session/fork` method.\n\nSupplying `{}` means the agent supports forking sessions.", + "SessionSystemPromptCapabilities": { + "description": "Capabilities for Client-provided system prompts.\n\nSupplying `{}` means the Agent supports `systemPrompt` on session lifecycle\nrequests in `append` mode.", "type": "object", "properties": { + "mode": { + "description": "Delivery modes the Agent supports in addition to `append`.\n\nOptional. Omitted and `null` are equivalent and mean the Agent supports only `append`.", + "anyOf": [ + { + "$ref": "#/$defs/SessionSystemPromptModeCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4168,12 +4211,24 @@ } } }, - "AgentAuthCapabilities": { - "description": "Authentication-related extension capabilities supported by the agent.\n\nThis object does not advertise support for `auth/login` or `auth/logout`.\nThose methods are advertised by a non-empty `authMethods` list in the\n`initialize` response.", + "SessionSystemPromptModeCapabilities": { + "description": "System prompt delivery modes the Agent supports in addition to `append`.\n\n`append` has no entry because every Agent advertising `session.systemPrompt`\nsupports it.", "type": "object", "properties": { + "override": { + "description": "Whether the Agent supports `override` mode.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports replacing its built-in default\ninstructions with the Client-provided system prompt.", + "anyOf": [ + { + "$ref": "#/$defs/SessionSystemPromptOverrideCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4183,12 +4238,12 @@ } } }, - "ProvidersCapabilities": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProvider configuration capabilities supported by the agent.\n\nSupplying `{}` means the agent supports provider configuration methods.", + "SessionSystemPromptOverrideCapabilities": { + "description": "Capabilities for the `override` system prompt mode.\n\nSupplying `{}` means the Agent supports replacing its built-in default\ninstructions with the Client-provided system prompt.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4198,36 +4253,12 @@ } } }, - "NesCapabilities": { - "description": "NES capabilities advertised by the agent during initialization.\n\nSupplying `{}` means the agent supports the NES method surface. Omitted or\n`null` both mean the agent does not advertise support for `nes/*` methods.", + "SessionForkCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for the `session/fork` method.\n\nSupplying `{}` means the Agent supports forking sessions.", "type": "object", "properties": { - "events": { - "description": "Events the agent wants to receive.", - "anyOf": [ - { - "$ref": "#/$defs/NesEventCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "context": { - "description": "Context the agent wants attached to each suggestion request.", - "anyOf": [ - { - "$ref": "#/$defs/NesContextCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4237,24 +4268,12 @@ } } }, - "NesEventCapabilities": { - "description": "Event capabilities the agent can consume.", + "SessionArchiveCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for `session/archive` and `session/unarchive`.\n\nSupplying `{}` means the Agent supports both methods, the `archived` filter on\n`session/list`, and `SessionInfo.archived`.", "type": "object", "properties": { - "document": { - "description": "Document event capabilities.", - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentEventCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4264,72 +4283,12 @@ } } }, - "NesDocumentEventCapabilities": { - "description": "Document event capabilities the agent wants to receive.", + "SessionStatusCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for the `session/status` method.\n\nSupplying `{}` means the Agent supports checking session status.", "type": "object", "properties": { - "didOpen": { - "description": "Whether the agent wants `document/didOpen` events.", - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidOpenCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "didChange": { - "description": "Whether the agent wants `document/didChange` events, and the sync kind.", - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidChangeCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "didClose": { - "description": "Whether the agent wants `document/didClose` events.", - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidCloseCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "didSave": { - "description": "Whether the agent wants `document/didSave` events.", - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidSaveCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "didFocus": { - "description": "Whether the agent wants `document/didFocus` events.", - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidFocusCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4339,12 +4298,12 @@ } } }, - "NesDocumentDidOpenCapabilities": { - "description": "Marker for `document/didOpen` capability support.", + "SessionOptionsCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for the `session/options` method.\n\nSupplying `{}` means the Agent supports `session/options` and accepts initial config\noption values on session setup requests.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4354,20 +4313,12 @@ } } }, - "NesDocumentDidChangeCapabilities": { - "description": "Capabilities for `document/didChange` events.", + "SessionTitleCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for Client-set session titles.\n\nSupplying `{}` means the Agent supports `session/set_title`. Agents report titles\nthrough `session/list` and `session_info_update` without this capability.", "type": "object", "properties": { - "syncKind": { - "description": "The sync kind the agent wants: `\"full\"` or `\"incremental\"`.", - "allOf": [ - { - "$ref": "#/$defs/TextDocumentSyncKind" - } - ] - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4375,32 +4326,26 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "syncKind" - ] - }, - "TextDocumentSyncKind": { - "description": "How the agent wants document changes delivered.", - "oneOf": [ - { - "description": "Client sends the entire file content on each change.", - "type": "string", - "const": "full" - }, - { - "description": "Client sends only the changed ranges.", - "type": "string", - "const": "incremental" - } - ] + } }, - "NesDocumentDidCloseCapabilities": { - "description": "Marker for `document/didClose` capability support.", + "AgentAuthCapabilities": { + "description": "Authentication-related extension capabilities supported by the Agent.\n\nThis object does not advertise support for `auth/login` or `auth/logout`.\nThose methods are advertised by a non-empty `authMethods` list in the\n`initialize` response.", "type": "object", "properties": { + "status": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the Agent supports the `auth/status` method.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not advertise support.\nSupplying `{}` means the Agent supports the `auth/status` method.", + "anyOf": [ + { + "$ref": "#/$defs/AuthStatusCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4410,12 +4355,12 @@ } } }, - "NesDocumentDidSaveCapabilities": { - "description": "Marker for `document/didSave` capability support.", + "AuthStatusCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuth status capabilities supported by the Agent.\n\nSupplying `{}` means the Agent supports the `auth/status` method.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4425,12 +4370,12 @@ } } }, - "NesDocumentDidFocusCapabilities": { - "description": "Marker for `document/didFocus` capability support.", + "ProvidersCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProvider configuration capabilities supported by the Agent.\n\nSupplying `{}` means the Agent supports provider configuration methods.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4440,251 +4385,24 @@ } } }, - "NesContextCapabilities": { - "description": "Context capabilities the agent wants attached to each suggestion request.", - "type": "object", - "properties": { - "recentFiles": { - "description": "Whether the agent wants recent files context.", - "anyOf": [ - { - "$ref": "#/$defs/NesRecentFilesCapabilities" - }, - { - "type": "null" + "AuthMethod": { + "description": "Describes an available authentication method.\n\nThe `type` field acts as the discriminator in the serialized JSON form.", + "anyOf": [ + { + "description": "Client runs the configured Agent program as a separate interactive\nprocess, without passing this method to `auth/login`.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "terminal" } + }, + "required": [ + "type" ], - "x-deserialize-default-on-error": true - }, - "relatedSnippets": { - "description": "Whether the agent wants related snippets context.", - "anyOf": [ - { - "$ref": "#/$defs/NesRelatedSnippetsCapabilities" - }, + "allOf": [ { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "editHistory": { - "description": "Whether the agent wants edit history context.", - "anyOf": [ - { - "$ref": "#/$defs/NesEditHistoryCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "userActions": { - "description": "Whether the agent wants user actions context.", - "anyOf": [ - { - "$ref": "#/$defs/NesUserActionsCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "openFiles": { - "description": "Whether the agent wants open files context.", - "anyOf": [ - { - "$ref": "#/$defs/NesOpenFilesCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "diagnostics": { - "description": "Whether the agent wants diagnostics context.", - "anyOf": [ - { - "$ref": "#/$defs/NesDiagnosticsCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesRecentFilesCapabilities": { - "description": "Capabilities for recent files context.", - "type": "object", - "properties": { - "maxCount": { - "description": "Maximum number of recent files the agent can use.", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0, - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesRelatedSnippetsCapabilities": { - "description": "Capabilities for related snippets context.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesEditHistoryCapabilities": { - "description": "Capabilities for edit history context.", - "type": "object", - "properties": { - "maxCount": { - "description": "Maximum number of edit history entries the agent can use.", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0, - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesUserActionsCapabilities": { - "description": "Capabilities for user actions context.", - "type": "object", - "properties": { - "maxCount": { - "description": "Maximum number of user actions the agent can use.", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0, - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesOpenFilesCapabilities": { - "description": "Capabilities for open files context.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesDiagnosticsCapabilities": { - "description": "Capabilities for diagnostics context.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "PositionEncodingKind": { - "description": "The encoding used for character offsets in positions.\n\nFollows the same conventions as LSP 3.17. The default is UTF-16.", - "oneOf": [ - { - "description": "Character offsets count UTF-16 code units. This is the default.", - "type": "string", - "const": "utf-16" - }, - { - "description": "Character offsets count Unicode code points.", - "type": "string", - "const": "utf-32" - }, - { - "description": "Character offsets count UTF-8 code units (bytes).", - "type": "string", - "const": "utf-8" - } - ] - }, - "AuthMethod": { - "description": "Describes an available authentication method.\n\nThe `type` field acts as the discriminator in the serialized JSON form.", - "anyOf": [ - { - "description": "Client runs the configured agent program as a separate interactive\nprocess, without passing this method to `auth/login`.", - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "terminal" - } - }, - "required": [ - "type" - ], - "allOf": [ - { - "$ref": "#/$defs/AuthMethodTerminal" + "$ref": "#/$defs/AuthMethodTerminal" } ] }, @@ -4708,7 +4426,7 @@ }, { "title": "other", - "description": "Custom or future authentication method.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this method type should preserve the raw\npayload when storing, replaying, proxying, or forwarding initialization\ndata, and otherwise ignore the method or display it generically.", + "description": "Custom or future authentication method.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this method type SHOULD preserve the raw\npayload when storing, replaying, proxying, or forwarding initialization\ndata, and otherwise ignore the method or display it generically.", "type": "object", "properties": { "type": { @@ -4724,25 +4442,8 @@ ] }, "name": { - "description": "Human-readable name of the authentication method.", + "description": "Human-readable name of the authentication method, shown to users as plain text.", "type": "string" - }, - "description": { - "description": "Optional description providing more details about this authentication method.", - "type": [ - "string", - "null" - ], - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true } }, "required": [ @@ -4799,7 +4500,7 @@ "type": "string" }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4814,7 +4515,7 @@ ] }, "AuthMethodTerminal": { - "description": "Terminal-based authentication method.\n\nThe client runs the configured agent program as a separate interactive\nprocess for the user to authenticate via a TUI. Agents MUST advertise this\nmethod only when the client enabled its terminal authentication capability.\nA zero exit status signals success; any other termination signals failure.\nThe client MUST NOT pass this method to `auth/login`.", + "description": "Terminal-based authentication method.\n\nThe Client runs the configured Agent program as a separate interactive\nprocess for the user to authenticate via a TUI. Agents MUST advertise this\nmethod only when the Client enabled its terminal authentication capability.\nA zero exit status signals success. Any other termination signals failure.\nThe Client MUST NOT pass this method to `auth/login`.", "type": "object", "properties": { "methodId": { @@ -4826,11 +4527,11 @@ ] }, "name": { - "description": "Human-readable name of the authentication method.", + "description": "Human-readable name of the authentication method, shown to users as plain text.", "type": "string" }, "description": { - "description": "Optional description providing more details about this authentication method.", + "description": "Optional human-readable description of this authentication method.\nMay contain Markdown.\n\nOmitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -4838,25 +4539,23 @@ "x-deserialize-default-on-error": true }, "args": { - "description": "Additional arguments to append to the configured agent invocation for terminal auth.", + "description": "Additional arguments to append to the configured Agent invocation for terminal auth.", "type": "array", "items": { "type": "string" }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "x-deserialize-default-on-null": true }, "env": { - "description": "Additional environment variables to set on the configured agent invocation for terminal auth.\nNames MUST be unique. These values override same-named variables in the\nbase launch configuration.", + "description": "Additional environment variables to set on the configured Agent invocation for terminal auth.\nNames SHOULD be unique, and otherwise the last entry wins. These values override\nsame-named variables in the base launch configuration.", "type": "array", "items": { "$ref": "#/$defs/EnvVariable" }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "x-deserialize-default-on-null": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4883,11 +4582,11 @@ ] }, "name": { - "description": "Human-readable name of the authentication method.", + "description": "Human-readable name of the authentication method, shown to users as plain text.", "type": "string" }, "description": { - "description": "Optional description providing more details about this authentication method.", + "description": "Optional human-readable description of this authentication method.\nMay contain Markdown.\n\nOmitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -4895,7 +4594,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4914,7 +4613,7 @@ "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4938,7 +4637,7 @@ } }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -4975,7 +4674,7 @@ "x-deserialize-skip-invalid-items": true }, "required": { - "description": "Whether this provider is mandatory and cannot be disabled via `providers/disable`.\nIf true, clients must not call `providers/disable` for this provider ID.", + "description": "Whether this provider is mandatory and cannot be disabled via `providers/disable`.\nIf true, Clients MUST NOT call `providers/disable` for this provider ID.", "type": "boolean" }, "current": { @@ -4990,7 +4689,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5010,7 +4709,7 @@ "type": "string" }, "LlmProtocol": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWell-known API protocol identifiers for LLM providers.\n\nAgents and clients MUST handle unknown protocol identifiers gracefully.\n\nProtocol names beginning with `_` are free for custom use, like other ACP extension methods.\nProtocol names that do not begin with `_` are reserved for the ACP spec.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWell-known API protocol identifiers for LLM providers.\n\nAgents and Clients MUST handle unknown protocol identifiers gracefully.\n\nProtocol names beginning with `_` are free for custom use, like other ACP extension methods.\nProtocol names that do not begin with `_` are reserved for the ACP spec.", "anyOf": [ { "description": "Anthropic API protocol.", @@ -5062,7 +4761,7 @@ "format": "uri" }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5081,7 +4780,7 @@ "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5098,7 +4797,7 @@ "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5115,7 +4814,7 @@ "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5127,38 +4826,29 @@ "x-side": "agent", "x-method": "auth/logout" }, - "NewSessionResponse": { - "description": "Response from creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)", + "AuthStatusResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to the `auth/status` method.", "type": "object", "properties": { - "sessionId": { - "description": "Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation.", + "state": { + "description": "Whether the Agent can start sessions without the user signing in first.\n\nClients use this field to decide whether sign-in is needed. Clients MUST treat\nvalues they do not recognize as `unknown`.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/AuthState" } ] }, - "configOptions": { - "description": "Initial session configuration options.", - "type": "array", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, - "availableCommands": { - "description": "Initial commands the agent can execute in this session.\n\nOptional. Omitted or empty means no initial commands are advertised.\nSenders MUST use an array, not `null`; receivers treat `null` like omission.\nLater `available_commands_update` notifications replace this list.", + "accounts": { + "description": "The accounts the Agent has configured, for display.\n\nOptional. Omitted and empty are equivalent and mean no accounts are reported.\nAgents that hold credentials for several providers or accounts SHOULD list each\nof them and mark the ones in effect with `active`.", "type": "array", "items": { - "$ref": "#/$defs/AvailableCommand" + "$ref": "#/$defs/AuthAccount" }, "x-deserialize-default-on-error": true, "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5168,51 +4858,211 @@ } }, "required": [ - "sessionId" + "state" ], "x-side": "agent", - "x-method": "session/new" + "x-method": "auth/status", + "x-state": { + "agent": [ + { + "action": "replace", + "target": "authStatus" + } + ] + } }, - "SessionConfigOption": { - "description": "A session configuration option selector and its current state.", + "AuthState": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe Agent's overall authentication state.", + "anyOf": [ + { + "description": "Credentials are configured. This does not guarantee that they are valid.", + "type": "string", + "const": "authenticated" + }, + { + "description": "The user needs to sign in. This includes credentials that are missing,\nexpired, or known to be invalid.", + "type": "string", + "const": "unauthenticated" + }, + { + "description": "No authentication is needed, for example because the Agent uses a local model.", + "type": "string", + "const": "not_required" + }, + { + "description": "The Agent cannot currently determine the state.", + "type": "string", + "const": "unknown" + }, + { + "title": "other", + "description": "Custom or future authentication state.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" + } + ] + }, + "AuthAccount": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAn account or credential the Agent has configured, such as a signed-in user\naccount or an API key.\n\nAll fields are display information only. Clients MUST NOT use them as stable\naccount identifiers, and SHOULD NOT log them or send them elsewhere, such as to\ntelemetry.", "type": "object", "properties": { - "configId": { - "description": "Unique identifier for the configuration option.", - "allOf": [ - { - "$ref": "#/$defs/SessionConfigId" - } - ] - }, - "name": { - "description": "Human-readable label for the option.", + "label": { + "description": "Human-readable name for the account, suitable for display on its own as plain text,\nfor example `Claude Max`, `OpenAI API key`, or `Vertex AI`.", "type": "string" }, "description": { - "description": "Optional description for the Client to display to the user.", + "description": "Short plain-text description shown with the label, such as the credential source\n`API key helper`. Agents MUST NOT put credentials in this field.\n\nOptional. Omitted and `null` are equivalent and mean no description is reported.", "type": [ "string", "null" ], "x-deserialize-default-on-error": true }, - "category": { - "description": "Optional semantic category for this option (UX only).", - "anyOf": [ - { - "$ref": "#/$defs/SessionConfigOptionCategory" - }, - { - "type": "null" - } + "active": { + "description": "Whether the Agent currently uses this account by default.\n\nSeveral accounts MAY be active, for example one per provider.\n\nOptional. Omitted and `null` are equivalent and mean the Agent does not indicate whether this account is in effect.", + "type": [ + "boolean", + "null" ], "x-deserialize-default-on-error": true }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "name": { + "description": "Display name of the user, such as a username or full name.\n\nOptional. Omitted and `null` are equivalent and mean no name is reported.", "type": [ - "object", + "string", + "null" + ], + "x-deserialize-default-on-error": true + }, + "email": { + "description": "Email address of the user.\n\nOptional. Omitted and `null` are equivalent and mean no email is reported.", + "type": [ + "string", + "null" + ], + "x-deserialize-default-on-error": true + }, + "organization": { + "description": "Display name of the organization, team, or workspace the account is using.\n\nOptional. Omitted and `null` are equivalent and mean no organization is reported.", + "type": [ + "string", + "null" + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "label" + ] + }, + "NewSessionResponse": { + "description": "Response from creating a new session.\n\nNew sessions default to `idle` until a state update reports otherwise.\nUpdates may arrive before or after this response. Clients MUST NOT overwrite\nan already-reported state when the response arrives.\n\nAn Agent whose new session is not `idle` MUST send the session's\n`state_update` after this response.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)", + "type": "object", + "properties": { + "sessionId": { + "description": "Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "configOptions": { + "description": "Initial session configuration options.\n\nOptional. Omitted or empty means no config options are advertised.\nSenders MUST use an array, not `null`.\nLater `config_option_update` notifications replace this list.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "availableCommands": { + "description": "Initial commands the Agent can execute in this session.\n\nOptional. Omitted or empty means no initial commands are advertised.\nSenders MUST use an array, not `null`.\nLater `available_commands_update` notifications replace this list.", + "type": "array", + "items": { + "$ref": "#/$defs/AvailableCommand" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "sessionId" + ], + "x-side": "agent", + "x-method": "session/new", + "x-state": { + "session": [ + { + "action": "replace", + "target": "configOptions", + "value": "configOptions" + }, + { + "action": "replace", + "target": "availableCommands", + "value": "availableCommands" + } + ] + } + }, + "SessionConfigOption": { + "description": "A session configuration option selector and its current state.", + "type": "object", + "properties": { + "configId": { + "description": "Identifier for the configuration option. MUST be unique within `configOptions`.", + "allOf": [ + { + "$ref": "#/$defs/SessionConfigId" + } + ] + }, + "name": { + "description": "Human-readable label the Client can display for the option, in plain text.", + "type": "string" + }, + "description": { + "description": "Optional description for the Client to display to the user.\nMay contain Markdown.\n\nOmitted and `null` are equivalent and mean no description is provided.", + "type": [ + "string", + "null" + ], + "x-deserialize-default-on-error": true + }, + "category": { + "description": "Optional semantic category for this option (UX only).\n\nOmitted and `null` are equivalent and mean no category is provided.", + "anyOf": [ + { + "$ref": "#/$defs/SessionConfigOptionCategory" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", "null" ], "x-deserialize-default-on-error": true, @@ -5262,7 +5112,7 @@ }, { "title": "other", - "description": "Custom or future session configuration option payload.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this option type should preserve the raw\npayload when storing, replaying, proxying, or forwarding configuration\ndata, and otherwise ignore the option or display it generically.", + "description": "Custom or future session configuration option payload.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this option type SHOULD preserve the raw\npayload when storing, replaying, proxying, or forwarding configuration\ndata, and otherwise ignore the option. The Agent keeps using its `currentValue`.", "type": "object", "properties": { "type": { @@ -5327,6 +5177,11 @@ "type": "string", "const": "model_config" }, + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse speed selector, such as a fast mode toggle.", + "type": "string", + "const": "speed" + }, { "description": "Thought/reasoning level selector.", "type": "string", @@ -5352,7 +5207,8 @@ "type": "array", "items": { "$ref": "#/$defs/SessionConfigSelectOption" - } + }, + "minItems": 1 }, { "title": "Grouped", @@ -5360,7 +5216,8 @@ "type": "array", "items": { "$ref": "#/$defs/SessionConfigSelectGroup" - } + }, + "minItems": 1 } ] }, @@ -5377,11 +5234,11 @@ ] }, "name": { - "description": "Human-readable label for this option value.", + "description": "Human-readable label the Client can display for this option value, in plain text.", "type": "string" }, "description": { - "description": "Optional description for this option value.", + "description": "Optional description for this option value.\nMay contain Markdown.\n\nOmitted and `null` are equivalent and mean no description is provided.", "type": [ "string", "null" @@ -5389,7 +5246,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5408,7 +5265,7 @@ "type": "object", "properties": { "groupId": { - "description": "Unique identifier for this group.", + "description": "Identifier for this group. MUST be unique within the option.", "allOf": [ { "$ref": "#/$defs/SessionConfigGroupId" @@ -5416,20 +5273,21 @@ ] }, "name": { - "description": "Human-readable label for this group.", + "description": "Human-readable label the Client can display as a plain-text group header.", "type": "string" }, "options": { - "description": "The set of option values in this group.", + "description": "The set of option values in this group. MUST contain at least one value.", "type": "array", "items": { "$ref": "#/$defs/SessionConfigSelectOption" }, + "minItems": 1, "x-deserialize-default-on-error": true, "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5453,7 +5311,7 @@ "type": "object", "properties": { "currentValue": { - "description": "The currently selected value.", + "description": "The currently selected value. MUST be one of the `value`s in `options`.", "allOf": [ { "$ref": "#/$defs/SessionConfigValueId" @@ -5461,7 +5319,7 @@ ] }, "options": { - "description": "The set of selectable options.", + "description": "The set of selectable options. MUST contain at least one value, and each `value` MUST be\nunique within the option, including across groups.", "allOf": [ { "$ref": "#/$defs/SessionConfigSelectOptions" @@ -5488,49 +5346,104 @@ ] }, "AvailableCommand": { - "description": "Information about a command.", - "type": "object", - "properties": { - "name": { - "description": "Command name (e.g., `create_plan`, `research_codebase`).", - "type": "string" - }, - "description": { - "description": "Human-readable description of what the command does.", - "type": "string" - }, - "input": { - "description": "Input for the command if required", - "anyOf": [ - { - "$ref": "#/$defs/AvailableCommandInput" - }, + "description": "A command the Agent advertises to the Client.\n\nThe `type` field acts as the discriminator in the serialized JSON form.", + "anyOf": [ + { + "description": "A slash command the user can invoke by including it in a prompt.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "command" + } + }, + "required": [ + "type" + ], + "allOf": [ { - "type": "null" + "$ref": "#/$defs/Command" + } + ] + }, + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAn Agent Skill the user can invoke with a `skill` content block.\n\nAgents MUST only send this entry when the Client advertised\nthe `session.commands.skill` Client capability.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "skill" } + }, + "required": [ + "type" ], - "x-deserialize-default-on-error": true + "allOf": [ + { + "$ref": "#/$defs/Skill" + } + ] }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" + { + "title": "other", + "description": "Custom or future command kind.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this command type SHOULD preserve the raw\npayload when storing, replaying, proxying, or forwarding command\nmetadata, and otherwise ignore the command. They MUST NOT display it as a\nslash command.", + "type": "object", + "properties": { + "type": { + "description": "Custom or future command type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" + }, + "name": { + "description": "Plain-text command name. MUST NOT contain whitespace and MUST be unique within the command list.", + "type": "string" + }, + "description": { + "description": "Human-readable description of what the command does.\nMay contain Markdown.", + "type": "string" + } + }, + "required": [ + "type", + "name", + "description" ], - "x-deserialize-default-on-error": true, + "not": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "command" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "skill" + } + }, + "required": [ + "type" + ] + } + ] + }, "additionalProperties": true } - }, - "required": [ - "name", - "description" ] }, "AvailableCommandInput": { "description": "The input specification for a command.", "anyOf": [ { - "description": "All text that was typed after the command name is provided as input.", + "description": "All text after the command name and the whitespace following it is provided as input.", "type": "object", "properties": { "type": { @@ -5549,7 +5462,7 @@ }, { "title": "other", - "description": "Custom or future command input specification.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this input type should preserve the raw\npayload when storing, replaying, proxying, or forwarding command\nmetadata, and otherwise ignore the input specification or display the\ncommand without structured input.", + "description": "Custom or future command input specification.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nClients that do not understand this input type SHOULD preserve the raw\npayload when storing, replaying, proxying, or forwarding command\nmetadata, and otherwise ignore the input specification or display the\ncommand without structured input.", "type": "object", "properties": { "type": { @@ -5585,11 +5498,11 @@ "type": "object", "properties": { "hint": { - "description": "A hint to display when the input hasn't been provided yet", + "description": "Plain-text hint about the input the command expects. The Client can display it\nwhen the user hasn't provided input yet.", "type": "string" }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5602,24 +5515,23 @@ "hint" ] }, - "ListSessionsResponse": { - "description": "Response from listing sessions.", + "Command": { + "description": "A slash command the user can invoke by including it in a prompt.\n\nThe `type` discriminator value is `command`.", "type": "object", "properties": { - "sessions": { - "description": "Array of session information objects.", - "type": "array", - "items": { - "$ref": "#/$defs/SessionInfo" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "name": { + "description": "Plain-text command name without the leading `/`, such as `create_plan` or `research_codebase`.\n\nMUST NOT contain whitespace and MUST be unique within the command list.", + "type": "string" }, - "nextCursor": { - "description": "Opaque cursor token. If present, pass this in the next request's cursor parameter\nto fetch the next page. If absent, there are no more results.", + "description": { + "description": "Human-readable description of what the command does.\nMay contain Markdown.", + "type": "string" + }, + "input": { + "description": "Input for the command if required\n\nOmitted and `null` are equivalent and mean the command takes no input.", "anyOf": [ { - "$ref": "#/$defs/SessionListCursor" + "$ref": "#/$defs/AvailableCommandInput" }, { "type": "null" @@ -5628,7 +5540,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5638,42 +5550,119 @@ } }, "required": [ - "sessions" - ], - "x-side": "agent", - "x-method": "session/list" + "name", + "description" + ] }, - "SessionInfo": { - "description": "Information about a session returned by session/list", + "Skill": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAn Agent Skill the user can invoke.\n\nThe `type` discriminator value is `skill`.\n\nThe Client invokes a skill with a `skill` content block that names it. The\n`/name` syntax applies only to `command` entries. An Agent that sends\n`skill` entries MUST advertise the `session.prompt.skill` capability.\n\nAgents MUST only send `skill` entries when the Client advertised the\n`session.commands.skill` Client capability. Agents SHOULD advertise only\nskills the user can invoke.", "type": "object", "properties": { - "sessionId": { - "description": "Unique identifier for the session", - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ] + "name": { + "description": "Plain-text skill name. The Client uses it to refer to the skill in a `skill` content block.\n\nMUST NOT contain whitespace and MUST be unique within the command list,\nacross commands and skills. It need not match the `name` in the skill's\nfrontmatter.", + "type": "string" }, - "cwd": { - "description": "The working directory for this session. Must be an absolute path.", - "allOf": [ - { - "$ref": "#/$defs/AbsolutePath" + "description": { + "description": "Human-readable description of what the skill does, shown to users.\nMay contain Markdown.", + "type": "string" + }, + "path": { + "description": "The absolute path of the file that defines the skill, normally its\n`SKILL.md`, on the machine the Agent runs on.\n\nOmitted and `null` are equivalent and mean the skill has no such file,\nas with a skill that is built into the Agent or served by an MCP server.", + "anyOf": [ + { + "$ref": "#/$defs/AbsolutePath" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "name", + "description" + ] + }, + "ListSessionsResponse": { + "description": "Response from listing sessions.", + "type": "object", + "properties": { + "sessions": { + "description": "Array of session information objects.\n\nAgents SHOULD return the sessions with the most recent activity first.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionInfo" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "nextCursor": { + "description": "Opaque cursor token. If present, pass this in the next request's cursor parameter\nto fetch the next page. Omitted and `null` are equivalent and mean there are no more\nresults. An empty string is a valid cursor, not the end of results.", + "anyOf": [ + { + "$ref": "#/$defs/SessionListCursor" + }, + { + "type": "null" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "sessions" + ], + "x-side": "agent", + "x-method": "session/list" + }, + "SessionInfo": { + "description": "Information about a session returned by session/list", + "type": "object", + "properties": { + "sessionId": { + "description": "Unique identifier for the session", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "cwd": { + "description": "The working directory for this session. Must be an absolute path.", + "allOf": [ + { + "$ref": "#/$defs/AbsolutePath" } ] }, "additionalDirectories": { - "description": "Additional workspace roots reported for this session. Each path must be absolute.\n\nWhen present, this is the complete ordered additional-root list reported\nby the Agent. Omitted and empty values are equivalent: the response\nreports no additional roots.", + "description": "Additional workspace roots reported for this session. Each path MUST be absolute.\n\nWhen present, this is the complete ordered additional-root list reported\nby the Agent. Omitted and empty values are equivalent: the response\nreports no additional roots.", "type": "array", "items": { "$ref": "#/$defs/AbsolutePath" }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "x-deserialize-default-on-null": true }, "title": { - "description": "Human-readable title for the session", + "description": "Human-readable title for the session, in plain text.\n\nOmitted and `null` are equivalent and mean no title is provided.", "type": [ "string", "null" @@ -5681,7 +5670,7 @@ "x-deserialize-default-on-error": true }, "updatedAt": { - "description": "RFC 3339 timestamp of last activity.", + "description": "RFC 3339 timestamp of last activity.\n\nOmitted and `null` are equivalent and mean the last activity time is not reported.", "type": [ "string", "null" @@ -5689,8 +5678,16 @@ "format": "date-time", "x-deserialize-default-on-error": true }, + "archived": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the session is archived.\n\nOptional. Omitted and `null` are equivalent and mean the archive state is not reported.\nAgents that advertise the `session.archive` capability MUST include it on every listed session.", + "type": [ + "boolean", + "null" + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5713,7 +5710,7 @@ "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5738,7 +5735,7 @@ ] }, "configOptions": { - "description": "Initial session configuration options.", + "description": "Initial session configuration options.\n\nOptional. Omitted or empty means no config options are advertised.\nSenders MUST use an array, not `null`.\nLater `config_option_update` notifications replace this list.", "type": "array", "items": { "$ref": "#/$defs/SessionConfigOption" @@ -5747,7 +5744,7 @@ "x-deserialize-skip-invalid-items": true }, "availableCommands": { - "description": "Initial commands the agent can execute in this session.\n\nOptional. Omitted or empty means no initial commands are advertised.\nSenders MUST use an array, not `null`; receivers treat `null` like omission.\nLater `available_commands_update` notifications replace this list.", + "description": "Initial commands the Agent can execute in this session.\n\nOptional. Omitted or empty means no initial commands are advertised.\nSenders MUST use an array, not `null`.\nLater `available_commands_update` notifications replace this list.", "type": "array", "items": { "$ref": "#/$defs/AvailableCommand" @@ -5756,7 +5753,7 @@ "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5769,49 +5766,28 @@ "sessionId" ], "x-side": "agent", - "x-method": "session/fork" - }, - "ResumeSessionResponse": { - "description": "Response from resuming an existing session.", - "type": "object", - "properties": { - "configOptions": { - "description": "Initial session configuration options.", - "type": "array", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, - "availableCommands": { - "description": "Initial commands the agent can execute in this session.\n\nOptional. Omitted or empty means no initial commands are advertised.\nSenders MUST use an array, not `null`; receivers treat `null` like omission.\nLater `available_commands_update` notifications replace this list.", - "type": "array", - "items": { - "$ref": "#/$defs/AvailableCommand" + "x-method": "session/fork", + "x-state": { + "session": [ + { + "action": "replace", + "target": "configOptions", + "value": "configOptions" }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "x-side": "agent", - "x-method": "session/resume" + { + "action": "replace", + "target": "availableCommands", + "value": "availableCommands" + } + ] + } }, - "CloseSessionResponse": { - "description": "Response from closing a session.", + "ArchiveSessionResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from archiving a session.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5821,23 +5797,14 @@ } }, "x-side": "agent", - "x-method": "session/close" + "x-method": "session/archive" }, - "SetSessionConfigOptionResponse": { - "description": "Response to `session/set_config_option` method.", + "UnarchiveSessionResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from unarchiving a session.", "type": "object", "properties": { - "configOptions": { - "description": "The full set of configuration options and their current values.", - "type": "array", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5846,58 +5813,35 @@ "additionalProperties": true } }, - "required": [ - "configOptions" - ], "x-side": "agent", - "x-method": "session/set_config_option" + "x-method": "session/unarchive" }, - "PromptResponse": { - "description": "Response acknowledging that a user prompt was inserted into the ACP conversation.\n\nThis response does not indicate that the prompt was merely received or queued, nor that the\nagent has finished processing it.\nProcessing and completion are reported through `state_update` session updates.\n\nSee protocol docs: [Prompt Accepted](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#2-prompt-accepted)", + "SessionStatusResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from checking the status of a session.\n\nThe result is a snapshot. A session reported `open` may be closed or evicted before\nthe Client's next request.", "type": "object", "properties": { - "messageId": { - "description": "Identifies the user message inserted into the ACP conversation.\n\nRequired and non-null. Omission and explicit `null` are both invalid.\n\nThe corresponding user-message session update carries this same identifier and may arrive\nbefore or after this response. Agents must echo the message during the live session, but are\nnot required to retain it. If retained and replayed, the message keeps this identifier.", + "status": { + "description": "Whether the Agent has the session in memory.\n\nRequired. Clients MUST treat a value they do not recognize as `saved`.", "allOf": [ { - "$ref": "#/$defs/MessageId" + "$ref": "#/$defs/SessionStatus" } ] }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "messageId" - ], - "x-side": "agent", - "x-method": "session/prompt" - }, - "MessageId": { - "description": "Unique identifier for a message within a session.", - "type": "string" - }, - "StartNesResponse": { - "description": "Response to `nes/start`.", - "type": "object", - "properties": { - "sessionId": { - "description": "The session ID for the newly started NES session.", - "allOf": [ + "state": { + "description": "The session's current foreground state, as the same snapshot the Agent sends in\n`state_update` notifications.\n\nOptional. Agents SHOULD include it when `status` is `open`. Omitted and `null`\nmean the Agent is not reporting foreground state, and Clients\nMUST NOT read that as `idle`. This is a snapshot, not a new transition. Clients\nMUST NOT count an `idle` snapshot as a new completion.", + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/StateUpdate" + }, + { + "type": "null" } - ] + ], + "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -5907,183 +5851,167 @@ } }, "required": [ - "sessionId" + "status" ], "x-side": "agent", - "x-method": "nes/start" + "x-method": "session/status" }, - "SuggestNesResponse": { - "description": "Response to `nes/suggest`.", - "type": "object", - "properties": { - "suggestions": { - "description": "The list of suggestions.", - "type": "array", - "items": { - "$ref": "#/$defs/NesSuggestion" - } + "SessionStatus": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the Agent has a session in memory, as reported by `session/status`.", + "anyOf": [ + { + "description": "The Agent has the session in memory, for any connection.\n\nThis does not mean the requesting connection is attached to it. A Client that did\nnot create or resume the session on its own connection MUST still call\n`session/resume` before sending `session/prompt` or expecting\n`session/update` notifications.", + "type": "string", + "const": "open" }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true + { + "description": "The Agent knows the session and can resume it, but does not have it in memory.\n\nThe Client can call `session/resume` to start it.", + "type": "string", + "const": "saved" + }, + { + "title": "other", + "description": "Custom or future session status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants. Clients MUST treat a value they do not recognize as\n`saved`.", + "type": "string" } - }, - "required": [ - "suggestions" - ], - "x-side": "agent", - "x-method": "nes/suggest" + ] }, - "NesSuggestion": { - "description": "A suggestion returned by the agent.", + "StateUpdate": { + "description": "A snapshot of the session's aggregate foreground activity.\n\nForeground work is the Agent's active response or workflow in the session,\nincluding model processing, tool execution, and waiting for user action needed\nto continue that work. It can start with a prompt or be Agent-initiated, for\nexample to pursue an ongoing goal or follow up on a completed background task.\nEither way, the Agent MUST report `running` when foreground work starts,\nor `requires_action` if it starts blocked on user action, and `idle` when it\nends. The Agent SHOULD include a stop reason on that idle update.\nAgent-initiated work does not require a prompt request or a synthetic user\nmessage.\n\n`running` may precede user-message insertion, for example during a foreground\nhook. It is not acknowledgment of insertion, and rejecting a prompt does not\nitself end foreground work.\n\nBackground activity can continue and emit other `session/update` notifications\nwhile `idle`. Those notifications, including a detached task's progress or\ncompletion, do not by themselves change this state. A permission request only\nwarrants `requires_action` when foreground work is blocked on user action.\n\nThe Agent SHOULD report `requires_action` when the foreground workflow as a\nwhole cannot progress without user action, including permissions or elicitations.\nOnce reported, it MUST report `running` when progress resumes, or `idle` when\nwork ends without resuming.\nIf other foreground work can progress, the state remains `running`. Resolving\none of several requests does not itself change the state. Agents SHOULD ignore\nresponses for work that has already ended rather than use them to resume it.\n\nA new session defaults to idle until a state update reports otherwise.\nResume MUST send a current-state snapshot after any replay and before its\nresponse. The snapshot reports foreground state after resuming.\nThe response alone does not imply idle.\nRepeated snapshots are idempotent, not additional work or completions.\nA repeated state may carry updated information without another state transition.\nThe Agent MUST report `idle` when no foreground activity remains. Completing\nan individual activity while other foreground work continues does not require\nan idle boundary. Local commands use the same lifecycle even without model work.\n\nSee protocol docs: [Session States](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#session-states)", "anyOf": [ { - "description": "A text edit suggestion.", + "description": "Foreground work is in progress.", "type": "object", "properties": { - "kind": { + "state": { "type": "string", - "const": "edit" + "const": "running" } }, "required": [ - "kind" + "state" ], "allOf": [ { - "$ref": "#/$defs/NesEditSuggestion" + "$ref": "#/$defs/RunningStateUpdate" } ] }, { - "description": "A jump-to-location suggestion.", + "description": "No foreground work is active. Background activity may continue.", "type": "object", "properties": { - "kind": { + "state": { "type": "string", - "const": "jump" + "const": "idle" } }, "required": [ - "kind" + "state" ], "allOf": [ { - "$ref": "#/$defs/NesJumpSuggestion" + "$ref": "#/$defs/IdleStateUpdate" } ] }, { - "description": "A rename symbol suggestion.", + "description": "Foreground work is blocked on user action.", "type": "object", "properties": { - "kind": { + "state": { "type": "string", - "const": "rename" + "const": "requires_action" } }, "required": [ - "kind" + "state" ], "allOf": [ { - "$ref": "#/$defs/NesRenameSuggestion" + "$ref": "#/$defs/RequiresActionStateUpdate" } ] }, { - "description": "A search-and-replace suggestion.", + "description": "The Agent cannot currently determine foreground activity.\nThis replaces previously confirmed activity without ending the work or session.", "type": "object", "properties": { - "kind": { + "state": { "type": "string", - "const": "searchAndReplace" + "const": "unknown" } }, "required": [ - "kind" + "state" ], "allOf": [ { - "$ref": "#/$defs/NesSearchAndReplaceSuggestion" + "$ref": "#/$defs/UnknownStateUpdate" } ] }, { "title": "other", - "description": "Custom or future NES suggestion.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this suggestion kind should preserve\nthe raw payload when storing, replaying, proxying, or forwarding\nsuggestions, and otherwise ignore it or display it generically.", + "description": "Custom or future session state.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nUnless the Client advertised support for this state, Agents MUST still\nreport the standard states.\nClients MUST NOT treat an unrecognized state as `idle` or present the\nprevious state as confirmed, and show a generic busy state until a known\nstate arrives.", "type": "object", "properties": { - "kind": { - "description": "Custom or future NES suggestion kind.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "state": { + "description": "Custom or future session state.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", "type": "string" - }, - "suggestionId": { - "description": "Unique identifier for accept/reject tracking.", - "allOf": [ - { - "$ref": "#/$defs/NesSuggestionId" - } - ] } }, "required": [ - "kind", - "suggestionId" + "state" ], "not": { "anyOf": [ { "type": "object", "properties": { - "kind": { + "state": { "type": "string", - "const": "edit" + "const": "running" } }, "required": [ - "kind" + "state" ] }, { "type": "object", "properties": { - "kind": { + "state": { "type": "string", - "const": "jump" + "const": "idle" } }, "required": [ - "kind" + "state" ] }, { "type": "object", "properties": { - "kind": { + "state": { "type": "string", - "const": "rename" + "const": "requires_action" } }, "required": [ - "kind" + "state" ] }, { "type": "object", "properties": { - "kind": { + "state": { "type": "string", - "const": "searchAndReplace" + "const": "unknown" } }, "required": [ - "kind" + "state" ] } ] @@ -6092,187 +6020,134 @@ } ] }, - "NesSuggestionId": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for an NES suggestion.", - "type": "string" - }, - "NesTextEdit": { - "description": "A text edit within a suggestion.", - "type": "object", - "properties": { - "range": { - "description": "The range to replace.", - "allOf": [ - { - "$ref": "#/$defs/Range" - } - ] - }, - "newText": { - "description": "The replacement text.", - "type": "string" - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" + "BackgroundWork": { + "description": "One piece of work running independently of the session's foreground work.\n\nItems reference entities the Client already tracks. The Agent MUST announce each item\nbefore the first snapshot that lists it, and MUST report a terminal's `exitStatus` or a\ntool call's final status before the snapshot that removes it. Each piece of work is\nlisted once: process-backed work is listed as its terminal, and the Agent MUST NOT\nalso list a tool call whose only live work is a listed terminal.\n\nSee protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work)", + "anyOf": [ + { + "description": "A process that keeps running after its tool call returned control to the model.\nLive until its `terminal_update` reports `exitStatus`.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "terminal" + } + }, + "required": [ + "type" ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "range", - "newText" - ] - }, - "Range": { - "description": "A range in a text document, expressed as start and end positions.", - "type": "object", - "properties": { - "start": { - "description": "The start position (inclusive).", "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/BackgroundTerminal" } ] }, - "end": { - "description": "The end position (exclusive).", + { + "description": "Work started by a tool call that continues without a process of its own, such as\na watcher, a workflow, or a scheduled wakeup. `pending` and `paused` tool calls\nstay listed.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "tool_call" + } + }, + "required": [ + "type" + ], "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/BackgroundToolCall" } ] }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "start", - "end" - ] - }, - "Position": { - "description": "A zero-based position in a text document.\n\nThe meaning of `character` depends on the negotiated position encoding.", - "type": "object", - "properties": { - "line": { - "description": "Zero-based line number.", - "type": "integer", - "format": "uint32", - "minimum": 0 - }, - "character": { - "description": "Zero-based character offset (encoding-dependent).", - "type": "integer", - "format": "uint32", - "minimum": 0 - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" + { + "description": "A detached subagent session that has anything running: its state is not `idle`, or\nits own `background` list is non-empty or not reported.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "subagent" + } + }, + "required": [ + "type" ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "line", - "character" - ] - }, - "NesEditSuggestion": { - "description": "A text edit suggestion.", - "type": "object", - "properties": { - "suggestionId": { - "description": "Unique identifier for accept/reject tracking.", "allOf": [ { - "$ref": "#/$defs/NesSuggestionId" + "$ref": "#/$defs/BackgroundSubagent" } ] }, - "uri": { - "description": "The URI of the file to edit.", - "type": "string", - "format": "uri" - }, - "edits": { - "description": "The text edits to apply. Must contain at least one edit.", - "type": "array", - "items": { - "$ref": "#/$defs/NesTextEdit" - }, - "minItems": 1 - }, - "cursorPosition": { - "description": "Optional suggested cursor position after applying edits.", - "anyOf": [ - { - "$ref": "#/$defs/Position" - }, - { - "type": "null" + { + "title": "other", + "description": "Custom or future background work.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nAn unknown item still means background work is running, even when the Client\ncannot show what it is.", + "type": "object", + "properties": { + "type": { + "description": "Custom or future background work type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" } + }, + "required": [ + "type" ], - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, + "not": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "terminal" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "tool_call" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "subagent" + } + }, + "required": [ + "type" + ] + } + ] + }, "additionalProperties": true } - }, - "required": [ - "suggestionId", - "uri", - "edits" ] }, - "NesJumpSuggestion": { - "description": "A jump-to-location suggestion.", + "BackgroundTerminal": { + "description": "A listed terminal running in the background.", "type": "object", "properties": { - "suggestionId": { - "description": "Unique identifier for accept/reject tracking.", - "allOf": [ - { - "$ref": "#/$defs/NesSuggestionId" - } - ] - }, - "uri": { - "description": "The file to navigate to.", - "type": "string", - "format": "uri" - }, - "position": { - "description": "The target position within the file.", + "terminalId": { + "description": "The ID of the listed terminal.", "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/TerminalId" } ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -6282,42 +6157,23 @@ } }, "required": [ - "suggestionId", - "uri", - "position" + "terminalId" ] }, - "NesRenameSuggestion": { - "description": "A rename symbol suggestion.", + "BackgroundToolCall": { + "description": "A listed tool call whose work continues in the background.", "type": "object", "properties": { - "suggestionId": { - "description": "Unique identifier for accept/reject tracking.", - "allOf": [ - { - "$ref": "#/$defs/NesSuggestionId" - } - ] - }, - "uri": { - "description": "The file URI containing the symbol.", - "type": "string", - "format": "uri" - }, - "position": { - "description": "The position of the symbol to rename.", + "toolCallId": { + "description": "The ID of the listed tool call.", "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/ToolCallId" } ] }, - "newName": { - "description": "The new name for the symbol.", - "type": "string" - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -6327,46 +6183,23 @@ } }, "required": [ - "suggestionId", - "uri", - "position", - "newName" + "toolCallId" ] }, - "NesSearchAndReplaceSuggestion": { - "description": "A search-and-replace suggestion.", + "BackgroundSubagent": { + "description": "A listed subagent session associated with this session through `subagent_update`.", "type": "object", "properties": { - "suggestionId": { - "description": "Unique identifier for accept/reject tracking.", + "sessionId": { + "description": "The ID of the listed session.", "allOf": [ { - "$ref": "#/$defs/NesSuggestionId" + "$ref": "#/$defs/SessionId" } ] }, - "uri": { - "description": "The file URI to search within.", - "type": "string", - "format": "uri" - }, - "search": { - "description": "The text or pattern to find.", - "type": "string" - }, - "replace": { - "description": "The replacement text.", - "type": "string" - }, - "isRegex": { - "description": "Whether `search` is a regular expression. Defaults to `false`.", - "type": [ - "boolean", - "null" - ] - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -6376,18 +6209,26 @@ } }, "required": [ - "suggestionId", - "uri", - "search", - "replace" + "sessionId" ] }, - "CloseNesResponse": { - "description": "Response from closing an NES session.", + "RunningStateUpdate": { + "description": "Foreground work is in progress.", "type": "object", "properties": { + "background": { + "description": "Work running independently of foreground work, as a complete snapshot.\n\nOptional. Omitted and `null` are equivalent and mean the Agent is not reporting\nbackground work, not that nothing is running. `[]` means no background work is\nrunning. An Agent that reports background work MUST include it on every state\nupdate for the session.\n\nSee protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work)", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/BackgroundWork" + }, + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -6395,19 +6236,14 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "x-side": "agent", - "x-method": "nes/close" - }, - "ExtResponse": { - "description": "Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)" + } }, "Error": { "description": "JSON-RPC error object.\n\nRepresents an error that occurred during method execution, following the\nJSON-RPC 2.0 error object specification with optional additional data.\n\nSee protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)", "type": "object", "properties": { "code": { - "description": "A number indicating the error type that occurred.\nThis must be an integer as defined in the JSON-RPC specification.", + "description": "A number indicating the error type that occurred.\nThis MUST be an integer as defined in the JSON-RPC specification.", "allOf": [ { "$ref": "#/$defs/ErrorCode" @@ -6415,21 +6251,46 @@ ] }, "message": { - "description": "A string providing a short description of the error.\nThe message should be limited to a concise single sentence.", + "description": "A short, human-readable description of the error, in plain text.\nThe sender SHOULD limit the message to a single concise sentence.", "type": "string" }, "data": { - "description": "Optional primitive or structured value that contains additional information about the error.\nThis may include debugging information or context-specific details.", + "description": "Optional primitive or structured value that contains additional information about the error.\nThis may include debugging information or context-specific details.\n\nOmitted and `null` are equivalent and mean no additional data is provided. Some codes\ndefine a shape: [`UnsupportedProtocolVersionErrorData`] for `-32022`, and\n[`SessionNotFoundErrorData`] for `-32002` when a session is not found.", + "anyOf": [ + { + "$ref": "#/$defs/ErrorData" + }, + { + "type": "null" + } + ], "x-deserialize-default-on-error": true } }, "required": [ "code", "message" - ] + ], + "if": { + "properties": { + "code": { + "const": -32022 + } + } + }, + "then": { + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/$defs/UnsupportedProtocolVersionErrorData" + } + } + } }, "ErrorCode": { - "description": "Predefined error codes for common JSON-RPC and ACP-specific errors.\n\nThese codes follow the JSON-RPC 2.0 specification for standard errors\nand use the reserved range (-32000 to -32099) for protocol-specific errors.", + "description": "Predefined error codes for common JSON-RPC and ACP-specific errors.\n\nStandard errors use the JSON-RPC 2.0 codes. ACP-specific errors use the JSON-RPC\nserver-error range (-32000 to -32099), and request cancellation uses -32800 from the\nrange LSP reserves (-32899 to -32800).", "anyOf": [ { "title": "Parse error", @@ -6461,7 +6322,7 @@ }, { "title": "Internal error", - "description": "**Internal error**: Internal JSON-RPC error.\nReserved for implementation-defined server errors.", + "description": "**Internal error**: Internal JSON-RPC error.", "type": "integer", "format": "int32", "const": -32603 @@ -6482,11 +6343,18 @@ }, { "title": "Resource not found", - "description": "**Resource not found**: A given resource, such as a file, was not found.", + "description": "**Resource not found**: A given resource, such as a session, was not found.", "type": "integer", "format": "int32", "const": -32002 }, + { + "title": "Unsupported protocol version", + "description": "**Unsupported protocol version**: No protocol version supported by the Agent is at or below the requested version.\nThe error data is an [`UnsupportedProtocolVersionErrorData`].", + "type": "integer", + "format": "int32", + "const": -32022 + }, { "title": "Other", "description": "Other undefined error code.", @@ -6495,82 +6363,162 @@ } ] }, - "AgentNotification": { - "description": "A JSON-RPC notification object.", - "type": "object", - "properties": { - "method": { - "description": "The notification method name.", - "type": "string" - }, - "params": { - "description": "Method-specific notification parameters.", - "anyOf": [ + "ErrorData": { + "description": "Schema for the `data` field of an error: the shapes ACP defines, or any other value.", + "anyOf": [ + { + "title": "UnsupportedProtocolVersion", + "allOf": [ { - "description": "All possible notifications that an agent can send to a client.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly.\n\nNotifications do not expect a response.", - "anyOf": [ - { - "title": "UpdateSessionNotification", - "description": "Handles session update notifications from the agent.\n\nThis is a notification endpoint (no response expected) that receives\nupdates about session activity, including message updates, message chunks,\ntool calls, and execution plans.\n\nNote: Clients SHOULD continue accepting tool call updates even after\nsending a `session/cancel` notification, as the agent may send final\nupdates before reporting an idle `state_update` with the cancelled\nstop reason.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#3-agent-reports-output)", - "allOf": [ - { - "$ref": "#/$defs/UpdateSessionNotification" - } - ] - }, - { - "title": "CompleteElicitationNotification", - "description": "Notification that a URL-based elicitation has completed.\n\nSee protocol docs: [Elicitation](https://agentclientprotocol.com/protocol/v2/draft/elicitation#url-completion)", - "allOf": [ - { - "$ref": "#/$defs/CompleteElicitationNotification" - } - ] - }, - { - "title": "ExtNotification", - "description": "Handles extension notifications from the agent.\n\nAllows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "allOf": [ - { - "$ref": "#/$defs/ExtNotification" - } - ] - } - ] - }, + "$ref": "#/$defs/UnsupportedProtocolVersionErrorData" + } + ] + }, + { + "title": "SessionNotFound", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/SessionNotFoundErrorData" + } + ] + }, + { + "title": "Other" + } + ] + }, + "UnsupportedProtocolVersionErrorData": { + "description": "Data for the `-32022` (Unsupported protocol version) error.\n\nSee protocol docs: [Version Negotiation](https://agentclientprotocol.com/protocol/v2/draft/initialization#version-negotiation)", + "type": "object", + "properties": { + "requested": { + "description": "The protocol version the Client requested.", + "allOf": [ + { + "$ref": "#/$defs/ProtocolVersion" } ] + }, + "supported": { + "description": "The protocol versions the Agent supports.", + "type": "array", + "items": { + "$ref": "#/$defs/ProtocolVersion" + } + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true } }, "required": [ - "method" - ], - "x-docs-ignore": true + "requested", + "supported" + ] }, - "UpdateSessionNotification": { - "description": "Notification containing a session update from the agent.\n\nAgents can send session updates at any point while the session exists.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#3-agent-reports-output)", + "SessionNotFoundErrorData": { + "description": "Data for the `-32002` (Resource not found) error when a session-scoped request names a\nsession that does not exist or is not active.\n\nSee protocol docs: [Unknown Sessions](https://agentclientprotocol.com/protocol/v2/draft/error#unknown-sessions)", "type": "object", "properties": { "sessionId": { - "description": "The ID of the session this update pertains to.", + "description": "The session ID from the request.", "allOf": [ { "$ref": "#/$defs/SessionId" } ] }, - "update": { - "description": "The actual update content.", - "allOf": [ + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "sessionId" + ] + }, + "ErrorStopReason": { + "description": "Details of a failure that ended active work.", + "type": "object", + "properties": { + "error": { + "description": "The failure, as a JSON-RPC error object.\n\nOptional. Omitted and `null` are equivalent and mean the Agent is not reporting failure details.\nAgents SHOULD include it.", + "anyOf": [ { - "$ref": "#/$defs/SessionUpdate" + "$ref": "#/$defs/Error" + }, + { + "type": "null" } - ] + ], + "x-deserialize-default-on-error": true + } + } + }, + "Usage": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nToken usage for the foreground work that just completed, not cumulative for the session.", + "type": "object", + "properties": { + "totalTokens": { + "description": "Sum of all token types for the completed work.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "inputTokens": { + "description": "Input tokens for the completed work.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "outputTokens": { + "description": "Output tokens for the completed work.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "thoughtTokens": { + "description": "Thought/reasoning tokens for the completed work.\n\nOmitted and `null` are equivalent and mean the count is not reported.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0, + "x-deserialize-default-on-error": true + }, + "cachedReadTokens": { + "description": "Cache read tokens for the completed work.\n\nOmitted and `null` are equivalent and mean the count is not reported.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0, + "x-deserialize-default-on-error": true + }, + "cachedWriteTokens": { + "description": "Cache write tokens for the completed work.\n\nOmitted and `null` are equivalent and mean the count is not reported.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0, + "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -6580,160 +6528,868 @@ } }, "required": [ - "sessionId", - "update" - ], - "x-side": "client", - "x-method": "session/update" + "totalTokens", + "inputTokens", + "outputTokens" + ] }, - "SessionUpdate": { - "description": "Different types of updates that can be sent while a session exists.\n\nThese updates report messages, progress, and other session activity.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#3-agent-reports-output)", - "anyOf": [ - { - "description": "A chunk of the user's message being streamed.", - "type": "object", - "properties": { - "sessionUpdate": { - "type": "string", - "const": "user_message_chunk" + "IdleStateUpdate": { + "description": "No foreground work is active. Background activity may continue.\n\nAgents SHOULD include a `stopReason` when the idle transition ends foreground\nwork. An idle update that does not end foreground work need not include one.\nReceivers treat an omitted or `null` `stopReason` as the Agent not reporting one.\nRepeated or resume snapshots may carry the last stop reason for context.\nThey MUST NOT be counted as new completions or cancellations.", + "type": "object", + "properties": { + "usage": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nToken usage for completed foreground work.\n\nOptional. Omitted and `null` are equivalent and mean the Agent is not reporting token\nusage for this state update. A repeated or resume snapshot that carries it MUST NOT\nbe counted as additional usage.", + "anyOf": [ + { + "$ref": "#/$defs/Usage" + }, + { + "type": "null" } + ], + "x-deserialize-default-on-error": true + }, + "background": { + "description": "Work running independently of foreground work, as a complete snapshot.\n\nOptional. Omitted and `null` are equivalent and mean the Agent is not reporting\nbackground work, not that nothing is running. `[]` means no background work is\nrunning. An Agent that reports background work MUST include it on every state\nupdate for the session.\n\nSee protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work)", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/BackgroundWork" }, - "required": [ - "sessionUpdate" + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" ], - "allOf": [ - { - "$ref": "#/$defs/ContentChunk" - } - ] + "x-deserialize-default-on-error": true, + "additionalProperties": true }, + "stopReason": { + "description": "Why foreground work stopped. The value selects one of this type's variants, which may add fields of their own.\n\nOptional. Omitted and `null` are equivalent and mean the Agent is not reporting a stop reason.\n\nSee protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#stop-reasons)", + "type": [ + "string", + "null" + ], + "x-deserialize-default-on-error": true + } + }, + "anyOf": [ { - "description": "A user message has been created or updated.\n\nAgents can send this when they accept or replay a user message. When a\nclient receives another `user_message` update with the same `messageId`,\nfields in the new update patch the previous fields for that message.", + "description": "The active work ended successfully.\nIncludes locally handled commands that required no model call.", "type": "object", "properties": { - "sessionUpdate": { + "stopReason": { "type": "string", - "const": "user_message" + "const": "end_turn" } }, "required": [ - "sessionUpdate" - ], - "allOf": [ - { - "$ref": "#/$defs/UserMessage" - } + "stopReason" ] }, { - "description": "A chunk of the agent's response being streamed.", + "description": "The active work ended because the Agent reached the maximum number of tokens.", "type": "object", "properties": { - "sessionUpdate": { + "stopReason": { "type": "string", - "const": "agent_message_chunk" + "const": "max_tokens" } }, "required": [ - "sessionUpdate" - ], - "allOf": [ - { - "$ref": "#/$defs/ContentChunk" - } + "stopReason" ] }, { - "description": "An agent message has been created or updated.\n\nAgents can send this in addition to streamed chunks. When a client\nreceives another `agent_message` update with the same `messageId`,\nfields in the new update patch the previous fields for that message.", + "description": "The active work ended because the Agent reached the maximum number of\nmodel requests for the foreground work.", "type": "object", "properties": { - "sessionUpdate": { + "stopReason": { "type": "string", - "const": "agent_message" + "const": "max_turn_requests" } }, "required": [ - "sessionUpdate" - ], - "allOf": [ - { - "$ref": "#/$defs/AgentMessage" - } + "stopReason" ] }, { - "description": "A chunk of the agent's internal reasoning being streamed.", + "description": "The active work ended because the Agent refused to continue.", "type": "object", "properties": { - "sessionUpdate": { + "stopReason": { "type": "string", - "const": "agent_thought_chunk" + "const": "refusal" } }, "required": [ - "sessionUpdate" - ], - "allOf": [ - { - "$ref": "#/$defs/ContentChunk" - } + "stopReason" ] }, { - "description": "An agent thought or reasoning message has been created or updated.\n\nAgents can send this in addition to streamed chunks. When a client\nreceives another `agent_thought` update with the same `messageId`,\nfields in the new update patch the previous fields for that message.", + "description": "The user or Client chose to stop the work: via `session/cancel`, by\nclosing the session, or through an interaction the Agent offers, such\nas a permission option that tells the Agent to stop. A child session\nalso reports this reason when its parent cancels its work. Other work\nthe Agent stops for its own reasons uses another reason, such as\n`error` for an internal timeout.\n\nAgents MUST report this stop reason on an idle `state_update` when\ncancellation ends active foreground work, even if aborting causes\nexceptions. Agents MUST catch these errors and report `cancelled`, not\n`error`.", "type": "object", "properties": { - "sessionUpdate": { + "stopReason": { "type": "string", - "const": "agent_thought" + "const": "cancelled" } }, "required": [ - "sessionUpdate" - ], - "allOf": [ - { - "$ref": "#/$defs/AgentThought" - } + "stopReason" ] }, { - "description": "The state of the agent's foreground work has changed.", + "description": "The active work ended because something failed.\n\nThis includes pre-insertion foreground work. A prompt failure before\ninsertion also requires an error response to `session/prompt`. After\ninsertion, the prompt's response remains successful.", "type": "object", "properties": { - "sessionUpdate": { + "stopReason": { "type": "string", - "const": "state_update" + "const": "error" } }, "required": [ - "sessionUpdate" + "stopReason" ], "allOf": [ { - "$ref": "#/$defs/StateUpdate" + "$ref": "#/$defs/ErrorStopReason" } ] }, { - "description": "A chunk of tool-call content being streamed.", + "title": "other", + "description": "Custom or future stop reason.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", "type": "object", "properties": { - "sessionUpdate": { - "type": "string", - "const": "tool_call_content_chunk" + "stopReason": { + "description": "Custom or future stop reason.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" } }, "required": [ - "sessionUpdate" + "stopReason" ], - "allOf": [ - { - "$ref": "#/$defs/ToolCallContentChunk" - } - ] - }, - { + "not": { + "anyOf": [ + { + "type": "object", + "properties": { + "stopReason": { + "type": "string", + "const": "end_turn" + } + }, + "required": [ + "stopReason" + ] + }, + { + "type": "object", + "properties": { + "stopReason": { + "type": "string", + "const": "max_tokens" + } + }, + "required": [ + "stopReason" + ] + }, + { + "type": "object", + "properties": { + "stopReason": { + "type": "string", + "const": "max_turn_requests" + } + }, + "required": [ + "stopReason" + ] + }, + { + "type": "object", + "properties": { + "stopReason": { + "type": "string", + "const": "refusal" + } + }, + "required": [ + "stopReason" + ] + }, + { + "type": "object", + "properties": { + "stopReason": { + "type": "string", + "const": "cancelled" + } + }, + "required": [ + "stopReason" + ] + }, + { + "type": "object", + "properties": { + "stopReason": { + "type": "string", + "const": "error" + } + }, + "required": [ + "stopReason" + ] + } + ] + }, + "additionalProperties": true + }, + { + "title": "none", + "description": "No stop reason: `stopReason` is omitted or `null`.", + "type": "object", + "properties": { + "stopReason": { + "type": "null" + } + } + } + ] + }, + "RequiresActionStateUpdate": { + "description": "The foreground workflow as a whole is blocked on user action.\n\nAgents SHOULD report this state when foreground work cannot progress without\nuser action. Pending permissions or elicitations alone do not imply this\nstate if other foreground work can progress, or if the requests belong only\nto independent background activity. Once reported, Agents MUST report\n`running` when progress resumes, or `idle` if the work ends without resuming.\nResponding to one request does not itself imply `running`.", + "type": "object", + "properties": { + "background": { + "description": "Work running independently of foreground work, as a complete snapshot.\n\nOptional. Omitted and `null` are equivalent and mean the Agent is not reporting\nbackground work, not that nothing is running. `[]` means no background work is\nrunning. An Agent that reports background work MUST include it on every state\nupdate for the session.\n\nSee protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work)", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/BackgroundWork" + }, + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "UnknownStateUpdate": { + "description": "The Agent cannot currently determine foreground activity.\n\nThe Agent MUST report this when it can no longer observe the session's\nforeground work. Silence alone is not lost observability. The Client MUST\nstop presenting the previous state as confirmed current activity, but MAY\nretain it as last known. A later state replaces this snapshot normally.\n\nThis is not a task outcome or session closure. It does not cancel work, resolve\npending requests, or revoke capabilities. If a control is no longer available,\nthe Agent updates the capabilities explicitly. Unfinished tool calls and\nterminals stay as last reported. The Agent MUST NOT invent a final status\nfor them, and Clients MUST NOT present them as confirmed live activity.", + "type": "object", + "properties": { + "background": { + "description": "Work running independently of foreground work, as a complete snapshot.\n\nOptional. Omitted and `null` are equivalent and mean the Agent is not reporting\nbackground work, not that nothing is running. `[]` means no background work is\nrunning. An Agent that reports background work MUST include it on every state\nupdate for the session.\n\nSee protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work)", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/BackgroundWork" + }, + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "SessionOptionsResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from `session/options`.\n\nThe result is a snapshot. The options a session actually starts with are the ones in\nthe session setup response.", + "type": "object", + "properties": { + "configOptions": { + "description": "The config options the session would start with, with the same rules as on\n`NewSessionResponse`.\n\nOptional. Omitted or empty means no config options are advertised.\nSenders MUST use an array, not `null`.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "availableCommands": { + "description": "Commands the Agent knows the session would have.\n\nOptional. Omitted or empty means no commands are advertised.\nSenders MUST use an array, not `null`.\n\nAdvisory. Agents MAY return a partial list. Clients MUST use the commands from the\n`session/new` or `session/resume` response and later `available_commands_update`\nnotifications for the session itself.", + "type": "array", + "items": { + "$ref": "#/$defs/AvailableCommand" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/options" + }, + "SetSessionTitleResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from setting the title of a session.", + "type": "object", + "properties": { + "title": { + "description": "The plain-text title the Agent stored.\n\nThis differs from the requested title if the Agent normalized it. Clients SHOULD\ndisplay this value rather than the one they sent.", + "type": "string" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "title" + ], + "x-side": "agent", + "x-method": "session/set_title", + "x-state": { + "session": [ + { + "action": "replace", + "target": "sessionInfo", + "field": "title", + "value": "title" + } + ] + } + }, + "ResumeSessionResponse": { + "description": "Response from resuming an existing session.\n\nThe Agent MUST send a current `state_update` after any requested history\nreplay and before this response, even without replay. The update reports\nforeground state after resuming. The response alone does not imply `idle`.\n\nSee protocol docs: [Current-State Synchronization](https://agentclientprotocol.com/protocol/v2/draft/session-setup#current-state-synchronization)", + "type": "object", + "properties": { + "configOptions": { + "description": "Current session configuration options.\n\nOptional. Omitted or empty means no config options are advertised.\nSenders MUST use an array, not `null`.\nLater `config_option_update` notifications replace this list.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "availableCommands": { + "description": "Current commands the Agent can execute in this session.\n\nOptional. Omitted or empty means no initial commands are advertised.\nSenders MUST use an array, not `null`.\nLater `available_commands_update` notifications replace this list.", + "type": "array", + "items": { + "$ref": "#/$defs/AvailableCommand" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/resume", + "x-state": { + "session": [ + { + "action": "replace", + "target": "configOptions", + "value": "configOptions" + }, + { + "action": "replace", + "target": "availableCommands", + "value": "availableCommands" + } + ] + } + }, + "CloseSessionResponse": { + "description": "Response from closing a session.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/close" + }, + "CancelToolCallResponse": { + "description": "Response from cancelling a tool call.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "tool_call/cancel" + }, + "CancelTerminalResponse": { + "description": "Response from cancelling a terminal.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "terminal/cancel" + }, + "SetSessionConfigOptionResponse": { + "description": "Response to `session/set_config_option` method.", + "type": "object", + "properties": { + "configOptions": { + "description": "The full set of configuration options and their current values.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-skip-invalid-items": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "configOptions" + ], + "x-side": "agent", + "x-method": "session/set_config_option", + "x-state": { + "session": [ + { + "action": "replace", + "target": "configOptions", + "value": "configOptions" + } + ] + } + }, + "PromptResponse": { + "description": "Response acknowledging that a user prompt was inserted into the ACP conversation.\n\nThis response does not indicate that the prompt was merely received or held, nor that the\nAgent has finished processing it.\nProcessing and completion are reported through `state_update` session updates.\n\nInsertion is the logical addition of a user message with a message ID and a position\nrelative to other messages in the ACP conversation.\n\nSee protocol docs: [Prompt Accepted](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#2-prompt-accepted)", + "type": "object", + "properties": { + "messageId": { + "description": "Identifies the user message inserted into the ACP conversation.\n\nRequired and non-null. Omission and explicit `null` are both invalid.\n\nThe corresponding user-message session update carries this same identifier and may arrive\nbefore or after this response. Agents MUST echo the message during the live session, but are\nnot required to retain it. If retained and replayed, the message keeps this identifier.", + "allOf": [ + { + "$ref": "#/$defs/MessageId" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "messageId" + ], + "x-side": "agent", + "x-method": "session/prompt" + }, + "MessageId": { + "description": "Identifier for a message, unique among messages of the same type within a session.\n\nEach message type, such as user messages, Agent messages, and Agent thoughts,\nhas its own ID space: messages of different types may share an ID and remain\ndistinct messages.", + "type": "string" + }, + "ExtResponse": { + "description": "Allows for sending an arbitrary response to an extension request that is not part of the ACP spec.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)" + }, + "AgentNotification": { + "description": "A JSON-RPC notification object.", + "type": "object", + "properties": { + "method": { + "description": "The notification method name.", + "type": "string" + }, + "params": { + "description": "Method-specific notification parameters.", + "anyOf": [ + { + "description": "All possible notifications that an Agent can send to a Client.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly.\n\nNotifications do not expect a response.", + "anyOf": [ + { + "title": "UpdateSessionNotification", + "description": "Handles session update notifications from the Agent.\n\nThis is a notification endpoint (no response expected) that receives\nupdates about session activity, including message updates, message chunks,\ntool calls, and execution plans.\n\nClients SHOULD continue accepting tool call updates after `session/cancel`.\nFinal updates for the cancelled foreground work precede the idle `state_update`\nwith `stopReason: \"cancelled\"`. Updates for surviving background work can follow it.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#3-agent-reports-output)", + "allOf": [ + { + "$ref": "#/$defs/UpdateSessionNotification" + } + ] + }, + { + "title": "CompleteElicitationNotification", + "description": "Notification that a URL-based elicitation has completed.\n\nSee protocol docs: [Elicitation](https://agentclientprotocol.com/protocol/v2/draft/elicitation#url-completion)", + "allOf": [ + { + "$ref": "#/$defs/CompleteElicitationNotification" + } + ] + }, + { + "title": "AuthStatusUpdateNotification", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification that the Agent's authentication state changed.\n\nOnly sent by Agents that advertise the `auth.status` capability.", + "allOf": [ + { + "$ref": "#/$defs/AuthStatusUpdateNotification" + } + ] + }, + { + "title": "ExtNotification", + "description": "Handles extension notifications from the Agent.\n\nAllows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications are custom one-way messages that are not part of the ACP spec.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "allOf": [ + { + "$ref": "#/$defs/ExtNotification" + } + ] + } + ] + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "method" + ], + "x-docs-ignore": true + }, + "UpdateSessionNotification": { + "description": "Notification containing a session update from the Agent.\n\nAgents can send session updates at any point while the session exists.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#3-agent-reports-output)", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session this update pertains to.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "update": { + "description": "The actual update content.", + "allOf": [ + { + "$ref": "#/$defs/SessionUpdate" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "sessionId", + "update" + ], + "x-side": "client", + "x-method": "session/update", + "x-scope": { + "session": [ + "sessionId" + ] + } + }, + "SessionUpdate": { + "description": "Different types of updates that can be sent while a session exists.\n\nThese updates report messages, progress, and other session activity.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#3-agent-reports-output)", + "anyOf": [ + { + "description": "A chunk of the user's message being streamed.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "user_message_chunk" + } + }, + "x-state": { + "session": [ + { + "action": "append", + "target": "userMessage", + "id": "messageId", + "field": "content", + "value": "content" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ] + }, + { + "description": "A user message has been created or updated.\n\nAgents can send this when they accept or replay a user message. When a\nClient receives another `user_message` update with the same `messageId`,\nfields in the new update patch the previous fields for that message.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "user_message" + } + }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "userMessage", + "id": "messageId" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/UserMessage" + } + ] + }, + { + "description": "A chunk of the Agent's response being streamed.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_message_chunk" + } + }, + "x-state": { + "session": [ + { + "action": "append", + "target": "agentMessage", + "id": "messageId", + "field": "content", + "value": "content" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ] + }, + { + "description": "An Agent message has been created or updated.\n\nAgents can send this in addition to streamed chunks. When a Client\nreceives another `agent_message` update with the same `messageId`,\nfields in the new update patch the previous fields for that message.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_message" + } + }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "agentMessage", + "id": "messageId" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/AgentMessage" + } + ] + }, + { + "description": "A chunk of the Agent's internal reasoning being streamed.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_thought_chunk" + } + }, + "x-state": { + "session": [ + { + "action": "append", + "target": "agentThought", + "id": "messageId", + "field": "content", + "value": "content" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ] + }, + { + "description": "An Agent thought or reasoning message has been created or updated.\n\nAgents can send this in addition to streamed chunks. When a Client\nreceives another `agent_thought` update with the same `messageId`,\nfields in the new update patch the previous fields for that message.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_thought" + } + }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "agentThought", + "id": "messageId" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/AgentThought" + } + ] + }, + { + "description": "A snapshot of the session's aggregate foreground activity.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "state_update" + } + }, + "x-state": { + "session": [ + { + "action": "replace", + "target": "state" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/StateUpdate" + } + ] + }, + { + "description": "A chunk of tool-call content being streamed.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "tool_call_content_chunk" + } + }, + "x-state": { + "session": [ + { + "action": "append", + "target": "toolCall", + "id": "toolCallId", + "field": "content", + "value": "content" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ToolCallContentChunk" + } + ] + }, + { "description": "A tool call has been created or updated.", "type": "object", "properties": { @@ -6742,6 +7398,15 @@ "const": "tool_call_update" } }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "toolCall", + "id": "toolCallId" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6752,7 +7417,7 @@ ] }, { - "description": "An agent-owned terminal has been created or updated.", + "description": "An Agent-owned terminal has been created or updated.", "type": "object", "properties": { "sessionUpdate": { @@ -6760,6 +7425,15 @@ "const": "terminal_update" } }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "terminal", + "id": "terminalId" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6770,7 +7444,7 @@ ] }, { - "description": "A chunk of bytes appended to an agent-owned terminal's output.", + "description": "A chunk of bytes appended to an Agent-owned terminal's output.", "type": "object", "properties": { "sessionUpdate": { @@ -6778,6 +7452,17 @@ "const": "terminal_output_chunk" } }, + "x-state": { + "session": [ + { + "action": "append", + "target": "terminal", + "id": "terminalId", + "field": "output.data", + "value": "data" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6796,6 +7481,16 @@ "const": "plan_update" } }, + "x-state": { + "session": [ + { + "action": "replace", + "target": "plan", + "id": "plan.planId", + "value": "plan" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6806,7 +7501,7 @@ ] }, { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRemoval notice for a plan identified by ID.", + "description": "Removal notice for a plan identified by ID.", "type": "object", "properties": { "sessionUpdate": { @@ -6814,6 +7509,15 @@ "const": "plan_removed" } }, + "x-state": { + "session": [ + { + "action": "remove", + "target": "plan", + "id": "planId" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6832,6 +7536,15 @@ "const": "available_commands_update" } }, + "x-state": { + "session": [ + { + "action": "replace", + "target": "availableCommands", + "value": "availableCommands" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6850,6 +7563,15 @@ "const": "config_option_update" } }, + "x-state": { + "session": [ + { + "action": "replace", + "target": "configOptions", + "value": "configOptions" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6868,6 +7590,14 @@ "const": "session_info_update" } }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "sessionInfo" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6886,6 +7616,14 @@ "const": "usage_update" } }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "usage" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6896,7 +7634,7 @@ ] }, { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdvisory information for the user that is not part of session history.\n\nNo Client capability is required. Clients that do not understand or\npresent notices may ignore them.", + "description": "Information for the user that is not part of session history.\n\nNo Client capability is required. Clients that do not understand or\npresent notices MAY ignore them.", "type": "object", "properties": { "sessionUpdate": { @@ -6904,6 +7642,7 @@ "const": "notice" } }, + "x-state": {}, "required": [ "sessionUpdate" ], @@ -6914,7 +7653,7 @@ ] }, { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA context compaction has been created or updated.", + "description": "A context compaction has been created or updated.", "type": "object", "properties": { "sessionUpdate": { @@ -6922,6 +7661,15 @@ "const": "compaction_update" } }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "compaction", + "id": "compactionId" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6932,7 +7680,7 @@ ] }, { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA content block appended to a context compaction's retained summary.", + "description": "A content block appended to a context compaction's retained summary.", "type": "object", "properties": { "sessionUpdate": { @@ -6940,6 +7688,17 @@ "const": "compaction_summary_chunk" } }, + "x-state": { + "session": [ + { + "action": "append", + "target": "compaction", + "id": "compactionId", + "field": "summary", + "value": "content" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6950,7 +7709,80 @@ ] }, { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAnnounces a child session created and owned by this session, or updates\nthat ownership association's metadata.", + "description": "The history replay requested by `session/resume` is complete for this session.\n\nEvery update for the session between the `session/resume` request and\nthis update is replayed history. Every update after it is not.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "replay_complete" + } + }, + "x-state": {}, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ReplayComplete" + } + ] + }, + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nReplaces the session's current list of prompt suggestions.\n\nAgents MUST only send this update when the Client advertised\nthe `session.promptSuggestions` Client capability.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "prompt_suggestions_update" + } + }, + "x-state": { + "session": [ + { + "action": "replace", + "target": "promptSuggestions", + "value": "suggestions" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/PromptSuggestionsUpdate" + } + ] + }, + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA session cursor has been announced or its capabilities have changed.\n\nNo Client capability is required. Clients that do not understand\ncursors may ignore this update.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "cursor_update" + } + }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "cursor", + "id": "cursorId" + } + ] + }, + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/CursorUpdate" + } + ] + }, + { + "description": "Announces a child session created and owned by this session, or updates\nthat ownership association's metadata.", "type": "object", "properties": { "sessionUpdate": { @@ -6958,6 +7790,15 @@ "const": "subagent_update" } }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "subagent", + "id": "sessionId" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6968,7 +7809,7 @@ ] }, { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA message upsert observed in this session's transcript, sent to or\nreceived from another session.", + "description": "A message upsert observed in this session's transcript, sent to or\nreceived from another session.", "type": "object", "properties": { "sessionUpdate": { @@ -6976,6 +7817,15 @@ "const": "session_message" } }, + "x-state": { + "session": [ + { + "action": "upsert", + "target": "sessionMessage", + "id": "messageId" + } + ] + }, "required": [ "sessionUpdate" ], @@ -6986,7 +7836,7 @@ ] }, { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nOne content block appended to a sent or received session message.", + "description": "One content block appended to a sent or received session message.", "type": "object", "properties": { "sessionUpdate": { @@ -6994,6 +7844,17 @@ "const": "session_message_chunk" } }, + "x-state": { + "session": [ + { + "action": "append", + "target": "sessionMessage", + "id": "messageId", + "field": "content", + "value": "content" + } + ] + }, "required": [ "sessionUpdate" ], @@ -7005,7 +7866,7 @@ }, { "title": "other", - "description": "Custom or future session update.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this update type should preserve the\nraw payload when storing, replaying, proxying, or forwarding session\nhistory, and otherwise ignore it or display it generically.", + "description": "Custom or future session update.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this update type SHOULD preserve the\nraw payload when storing, replaying, proxying, or forwarding session\nhistory, and otherwise ignore it or display it generically.", "type": "object", "properties": { "sessionUpdate": { @@ -7035,7 +7896,43 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "user_message" + "const": "user_message" + } + }, + "required": [ + "sessionUpdate" + ] + }, + { + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_message_chunk" + } + }, + "required": [ + "sessionUpdate" + ] + }, + { + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_message" + } + }, + "required": [ + "sessionUpdate" + ] + }, + { + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_thought_chunk" } }, "required": [ @@ -7047,7 +7944,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "agent_message_chunk" + "const": "agent_thought" } }, "required": [ @@ -7059,7 +7956,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "agent_message" + "const": "state_update" } }, "required": [ @@ -7071,7 +7968,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "agent_thought_chunk" + "const": "tool_call_content_chunk" } }, "required": [ @@ -7083,7 +7980,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "agent_thought" + "const": "tool_call_update" } }, "required": [ @@ -7095,7 +7992,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "state_update" + "const": "terminal_update" } }, "required": [ @@ -7107,7 +8004,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "tool_call_content_chunk" + "const": "terminal_output_chunk" } }, "required": [ @@ -7119,7 +8016,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "tool_call_update" + "const": "plan_update" } }, "required": [ @@ -7131,7 +8028,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "terminal_update" + "const": "plan_removed" } }, "required": [ @@ -7143,7 +8040,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "terminal_output_chunk" + "const": "available_commands_update" } }, "required": [ @@ -7155,7 +8052,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "plan_update" + "const": "config_option_update" } }, "required": [ @@ -7167,7 +8064,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "available_commands_update" + "const": "session_info_update" } }, "required": [ @@ -7179,7 +8076,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "config_option_update" + "const": "usage_update" } }, "required": [ @@ -7191,7 +8088,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "session_info_update" + "const": "notice" } }, "required": [ @@ -7203,7 +8100,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "plan_removed" + "const": "compaction_update" } }, "required": [ @@ -7215,7 +8112,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "usage_update" + "const": "compaction_summary_chunk" } }, "required": [ @@ -7227,7 +8124,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "notice" + "const": "replay_complete" } }, "required": [ @@ -7239,7 +8136,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "compaction_update" + "const": "prompt_suggestions_update" } }, "required": [ @@ -7251,7 +8148,7 @@ "properties": { "sessionUpdate": { "type": "string", - "const": "compaction_summary_chunk" + "const": "cursor_update" } }, "required": [ @@ -7305,7 +8202,7 @@ "type": "object", "properties": { "messageId": { - "description": "A unique identifier for the message this chunk belongs to.\n\nAll chunks belonging to the same message share the same `messageId`.\nA change in `messageId` indicates a new message has started.", + "description": "A unique identifier for the message this chunk belongs to.\n\nAll chunks belonging to the same message share the same `messageId`.\nChunks for different messages can interleave.", "allOf": [ { "$ref": "#/$defs/MessageId" @@ -7321,7 +8218,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. This field is chunk-scoped.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis metadata is scoped to the chunk and does not patch stored metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7336,7 +8233,7 @@ ] }, "UserMessage": { - "description": "A user message upsert.\n\nOnly [`UserMessage::message_id`] is required. `content` has patch semantics:\nan omitted field leaves existing message content unchanged, `null` clears the\nvalue, and a concrete array replaces the previous value. For a new\n`messageId`, omitted fields use client defaults. `content` is replaced as a\nwhole array; send `[]` or `null` to clear it.\n\nMessage updates and chunks are applied in the order they are received. When\na `user_message` update includes `content`, that array replaces any content\npreviously accumulated for the message, including content from earlier\nchunks. Later chunks with the same `messageId` append to the current\ncontent.", + "description": "A user message upsert.\n\nOnly `messageId` is required. `content` has patch semantics:\nan omitted field leaves existing message content unchanged, `null` clears the\nvalue, and a concrete array replaces the previous value. For a new\n`messageId`, omitted `content` starts empty. `content` is replaced as a\nwhole array. Send `[]` or `null` to clear it.\n\nMessage updates and chunks are applied in the order they are received. When\na `user_message` update includes `content`, that array replaces any content\npreviously accumulated for the message, including content from earlier\nchunks. Later chunks with the same `messageId` append to the current\ncontent.", "type": "object", "properties": { "messageId": { @@ -7360,7 +8257,7 @@ "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. Omitted means no metadata update; `null` is an explicit clear signal.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", "type": [ "object", "null" @@ -7374,7 +8271,7 @@ ] }, "AgentMessage": { - "description": "An agent message upsert.\n\nOnly [`AgentMessage::message_id`] is required. `content` has patch semantics:\nan omitted field leaves existing message content unchanged, `null` clears the\nvalue, and a concrete array replaces the previous value. For a new\n`messageId`, omitted fields use client defaults. `content` is replaced as a\nwhole array; send `[]` or `null` to clear it.\n\nMessage updates and chunks are applied in the order they are received. When\nan `agent_message` update includes `content`, that array replaces any\ncontent previously accumulated for the message, including content from\nearlier chunks. Later chunks with the same `messageId` append to the current\ncontent.", + "description": "An Agent message upsert.\n\nOnly `messageId` is required. `content` has patch semantics:\nan omitted field leaves existing message content unchanged, `null` clears the\nvalue, and a concrete array replaces the previous value. For a new\n`messageId`, omitted `content` starts empty. `content` is replaced as a\nwhole array. Send `[]` or `null` to clear it.\n\nMessage updates and chunks are applied in the order they are received. When\nan `agent_message` update includes `content`, that array replaces any\ncontent previously accumulated for the message, including content from\nearlier chunks. Later chunks with the same `messageId` append to the current\ncontent.", "type": "object", "properties": { "messageId": { @@ -7398,7 +8295,7 @@ "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. Omitted means no metadata update; `null` is an explicit clear signal.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", "type": [ "object", "null" @@ -7412,7 +8309,7 @@ ] }, "AgentThought": { - "description": "An agent thought or reasoning message upsert.\n\nOnly [`AgentThought::message_id`] is required. `content` has patch semantics:\nan omitted field leaves existing thought content unchanged, `null` clears the\nvalue, and a concrete array replaces the previous value. For a new\n`messageId`, omitted fields use client defaults. `content` is replaced as a\nwhole array; send `[]` or `null` to clear it.\n\nMessage updates and chunks are applied in the order they are received. When\nan `agent_thought` update includes `content`, that array replaces any\ncontent previously accumulated for the thought, including content from\nearlier chunks. Later chunks with the same `messageId` append to the current\ncontent.", + "description": "An Agent thought or reasoning message upsert.\n\nOnly `messageId` is required. `content` has patch semantics:\nan omitted field leaves existing thought content unchanged, `null` clears the\nvalue, and a concrete array replaces the previous value. For a new\n`messageId`, omitted `content` starts empty. `content` is replaced as a\nwhole array. Send `[]` or `null` to clear it.\n\nMessage updates and chunks are applied in the order they are received. When\nan `agent_thought` update includes `content`, that array replaces any\ncontent previously accumulated for the thought, including content from\nearlier chunks. Later chunks with the same `messageId` append to the current\ncontent.", "type": "object", "properties": { "messageId": { @@ -7436,7 +8333,7 @@ "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. Omitted means no metadata update; `null` is an explicit clear signal.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", "type": [ "object", "null" @@ -7449,12 +8346,28 @@ "messageId" ] }, - "RunningStateUpdate": { - "description": "Foreground work is in progress.", + "ToolCallContentChunk": { + "description": "A streamed item of tool-call content.\n\nTool-call content chunks append one `ToolCallContent` item to the current\ncontent for the matching `toolCallId`. Agents can send a `tool_call_update`\nwith `content` when they need to replace the whole content collection\ninstead.", "type": "object", "properties": { + "toolCallId": { + "description": "The ID of the tool call this content belongs to.", + "allOf": [ + { + "$ref": "#/$defs/ToolCallId" + } + ] + }, + "content": { + "description": "A single item of content produced by the tool call.", + "allOf": [ + { + "$ref": "#/$defs/ToolCallContent" + } + ] + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis metadata is scoped to the chunk and does not patch stored metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7462,97 +8375,87 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - } + }, + "required": [ + "toolCallId", + "content" + ] }, - "StopReason": { - "description": "Reasons why an agent stops active session work.\n\nSee protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#stop-reasons)", - "anyOf": [ - { - "description": "The active work ended successfully.", - "type": "string", - "const": "end_turn" - }, - { - "description": "The active work ended because the agent reached the maximum number of tokens.", - "type": "string", - "const": "max_tokens" - }, - { - "description": "The active work ended because the agent reached the maximum number of\nallowed agent requests before returning idle.", - "type": "string", - "const": "max_turn_requests" - }, - { - "description": "The active work ended because the agent refused to continue. The user\nprompt and everything that comes after it won't be included in the next\nprompt, so this should be reflected in the UI.", - "type": "string", - "const": "refusal" - }, - { - "description": "Active session work was cancelled by the client via `session/cancel`.\n\nAgents should report this stop reason on an idle `state_update` session update\nwhen cancellation succeeds, even if cancellation causes exceptions in\nunderlying operations.", + "TerminalOutput": { + "description": "An authoritative replacement snapshot of terminal output bytes.", + "type": "object", + "properties": { + "data": { + "description": "Base64-encoded replacement terminal output bytes.", "type": "string", - "const": "cancelled" + "contentEncoding": "base64" }, - { - "title": "other", - "description": "Custom or future stop reason.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true } + }, + "required": [ + "data" ] }, - "Usage": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nToken usage information for completed session work.", + "TerminalExitStatus": { + "description": "Exit information for an Agent-owned terminal.\n\nThe presence of this object marks the terminal as exited, even when neither\nan exit code nor a signal is known.", "type": "object", "properties": { - "totalTokens": { - "description": "Sum of all token types across session.", - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "inputTokens": { - "description": "Total input tokens.", - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "outputTokens": { - "description": "Total output tokens.", - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "thoughtTokens": { - "description": "Total thought/reasoning tokens", + "exitCode": { + "description": "Process exit code as the platform reports it, when known. Negative values are\nallowed, for example signed Windows exit codes. Omitted and `null` are equivalent.", "type": [ "integer", "null" ], - "format": "uint64", - "minimum": 0, + "format": "int64", "x-deserialize-default-on-error": true }, - "cachedReadTokens": { - "description": "Total cache read tokens.", + "signal": { + "description": "Signal that terminated the process, when known.\n\nAgents SHOULD use the conventional platform signal name. POSIX examples\ninclude `SIGTERM`, `SIGKILL`, and `SIGINT`. Other platforms may use a\nplatform-specific name. Omitted and `null` are equivalent.", "type": [ - "integer", + "string", "null" ], - "format": "uint64", - "minimum": 0, "x-deserialize-default-on-error": true }, - "cachedWriteTokens": { - "description": "Total cache write tokens.", + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ - "integer", + "object", "null" ], - "format": "uint64", - "minimum": 0, - "x-deserialize-default-on-error": true + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "TerminalSize": { + "description": "The size of an Agent-owned terminal in character cells.", + "type": "object", + "properties": { + "cols": { + "description": "Number of columns. At least 1.", + "type": "integer", + "format": "uint16", + "minimum": 1, + "maximum": 65535 + }, + "rows": { + "description": "Number of rows. At least 1.", + "type": "integer", + "format": "uint16", + "minimum": 1, + "maximum": 65535 }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7562,32 +8465,19 @@ } }, "required": [ - "totalTokens", - "inputTokens", - "outputTokens" + "cols", + "rows" ] }, - "IdleStateUpdate": { - "description": "The agent is ready to process a new prompt.", + "TerminalCapabilities": { + "description": "Client-initiated controls a terminal currently supports.\n\nSee protocol docs: [Cancelling Terminals](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#cancelling-terminals)", "type": "object", "properties": { - "stopReason": { - "description": "Indicates why foreground work stopped.\n\nOptional. Omitted or `null` both mean the agent is not reporting a stop reason.\nAgents SHOULD include this when the idle transition ends foreground work.", - "anyOf": [ - { - "$ref": "#/$defs/StopReason" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "usage": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nToken usage for completed foreground work.\n\nOptional. Omitted or `null` both mean the agent is not reporting token\nusage for this state update.", + "cancel": { + "description": "Permits the Client to cancel this terminal with `terminal/cancel`.\n\nOmitted and `null` are equivalent and mean unsupported. An object (including `{}`)\nmeans supported. Agents SHOULD stop advertising it once the terminal reports `exitStatus`.", "anyOf": [ { - "$ref": "#/$defs/Usage" + "$ref": "#/$defs/TerminalCancelCapabilities" }, { "type": "null" @@ -7596,7 +8486,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7606,12 +8496,12 @@ } } }, - "RequiresActionStateUpdate": { - "description": "Foreground work is blocked on user action.", + "TerminalCancelCapabilities": { + "description": "Capability to cancel a terminal with `terminal/cancel`.\n\nSupplying `{}` advertises support. An omitted or `null` `cancel` does not.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7621,157 +8511,217 @@ } } }, - "UnknownStateUpdate": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe Agent cannot currently determine foreground activity.\n\nReport this when activity becomes unobservable, not merely because the session\nhas been quiet. The Client MUST stop presenting the previous state as confirmed\ncurrent activity, but may retain it as last known. A later state replaces this\nsnapshot normally.\n\nThis is not a task outcome or session closure. It does not cancel work, resolve\npending requests, or revoke capabilities; capabilities are updated separately.", + "TerminalUpdate": { + "description": "An upsert for the stored state of an Agent-owned terminal.\n\nOnly `terminalId` is required. Other fields have patch\nsemantics: omitted fields leave the stored value unchanged, `null` clears\nit, and concrete values replace it. A concrete `_meta` object instead\npatches the stored metadata by top-level key. When the terminal ID is new,\nomitted fields start unknown.", "type": "object", "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP for additional metadata.\nImplementations MUST NOT make assumptions about values at these keys.\nOptional; omitted and `null` mean no metadata for this state snapshot.", + "terminalId": { + "description": "Unique identifier for this terminal within the session.", + "allOf": [ + { + "$ref": "#/$defs/TerminalId" + } + ] + }, + "command": { + "description": "The command being run.", "type": [ - "object", + "string", "null" ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "StateUpdate": { - "description": "The state of the agent's foreground work has changed.\n\nBackground activity can continue and emit other `session/update` notifications\nwhile `idle`. Those notifications do not change this state.", - "anyOf": [ - { - "description": "Foreground work is in progress.", - "type": "object", - "properties": { - "state": { - "type": "string", - "const": "running" + "x-deserialize-default-on-error": true + }, + "cwd": { + "description": "The absolute working directory of the command.", + "anyOf": [ + { + "$ref": "#/$defs/AbsolutePath" + }, + { + "type": "null" } - }, - "required": [ - "state" ], - "allOf": [ + "x-deserialize-default-on-error": true + }, + "output": { + "description": "An authoritative replacement snapshot of terminal output bytes.", + "anyOf": [ { - "$ref": "#/$defs/RunningStateUpdate" + "$ref": "#/$defs/TerminalOutput" + }, + { + "type": "null" } - ] + ], + "x-deserialize-default-on-error": true }, - { - "description": "The agent is ready to process a new prompt.", - "type": "object", - "properties": { - "state": { - "type": "string", - "const": "idle" + "exitStatus": { + "description": "Exit information. A concrete object marks the terminal as exited.", + "anyOf": [ + { + "$ref": "#/$defs/TerminalExitStatus" + }, + { + "type": "null" } - }, - "required": [ - "state" ], + "x-deserialize-default-on-error": true + }, + "size": { + "description": "The terminal size the command runs with, when known.\n\nClients can render output at this size so that column layouts, progress bars,\nand cursor-positioned output display as the program wrote them.", + "anyOf": [ + { + "$ref": "#/$defs/TerminalSize" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "capabilities": { + "description": "Client-initiated controls this terminal currently supports, such as cancellation.\n\nOmission leaves the capabilities unchanged, `null` clears them, and an object replaces\nthe whole previous value. A new terminal starts with none.", + "anyOf": [ + { + "$ref": "#/$defs/TerminalCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "terminalId" + ] + }, + "TerminalOutputChunk": { + "description": "A chunk of bytes appended to an Agent-owned terminal's output.", + "type": "object", + "properties": { + "terminalId": { + "description": "The terminal receiving these bytes.", "allOf": [ { - "$ref": "#/$defs/IdleStateUpdate" + "$ref": "#/$defs/TerminalId" } ] }, + "data": { + "description": "Independently base64-encoded terminal output bytes.", + "type": "string", + "contentEncoding": "base64" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis metadata is scoped to the chunk and does not patch stored metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "terminalId", + "data" + ] + }, + "PlanUpdateContent": { + "description": "Updated content for a plan.", + "anyOf": [ { - "description": "Foreground work is blocked on user action.", + "description": "Structured plan entries.", "type": "object", "properties": { - "state": { + "type": { "type": "string", - "const": "requires_action" + "const": "items" } }, "required": [ - "state" + "type" ], "allOf": [ { - "$ref": "#/$defs/RequiresActionStateUpdate" + "$ref": "#/$defs/PlanItems" } ] }, { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe Agent cannot currently determine foreground activity.\nThis replaces previously confirmed activity without ending the work or session.", + "description": "The complete plan as Markdown.", "type": "object", "properties": { - "state": { + "type": { "type": "string", - "const": "unknown" + "const": "markdown" } }, "required": [ - "state" + "type" ], "allOf": [ { - "$ref": "#/$defs/UnknownStateUpdate" + "$ref": "#/$defs/PlanMarkdown" } ] }, { "title": "other", - "description": "Custom or future session state.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "description": "Custom or future plan update content.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this content type SHOULD preserve the\nraw payload when storing, replaying, proxying, or forwarding plans, and\notherwise ignore it or display it generically. It still replaces any earlier\ncontent for the same `planId`.", "type": "object", "properties": { - "state": { - "description": "Custom or future session state.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": { + "description": "Custom or future plan update content type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", "type": "string" + }, + "planId": { + "description": "The plan ID to update.", + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ] } }, "required": [ - "state" + "type", + "planId" ], "not": { "anyOf": [ { "type": "object", "properties": { - "state": { - "type": "string", - "const": "running" - } - }, - "required": [ - "state" - ] - }, - { - "type": "object", - "properties": { - "state": { - "type": "string", - "const": "idle" - } - }, - "required": [ - "state" - ] - }, - { - "type": "object", - "properties": { - "state": { + "type": { "type": "string", - "const": "requires_action" + "const": "items" } }, "required": [ - "state" + "type" ] }, { "type": "object", "properties": { - "state": { + "type": { "type": "string", - "const": "unknown" + "const": "markdown" } }, "required": [ - "state" + "type" ] } ] @@ -7780,28 +8730,170 @@ } ] }, - "ToolCallContentChunk": { - "description": "A streamed item of tool-call content.\n\nTool-call content chunks append one [`ToolCallContent`] item to the current\ncontent for the matching [`ToolCallId`]. Agents can use\n[`ToolCallUpdate::content`] when they need to replace the whole content\ncollection instead.", + "PlanId": { + "description": "Unique identifier for a plan within a session.", + "type": "string" + }, + "PlanEntry": { + "description": "A single entry in the execution plan.\n\nRepresents a task or goal that the assistant intends to accomplish\nas part of fulfilling the user's request.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)", "type": "object", "properties": { - "toolCallId": { - "description": "The ID of the tool call this content belongs to.", + "content": { + "description": "Human-readable description of what this task aims to accomplish.\nMay contain Markdown.", + "type": "string" + }, + "priority": { + "description": "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal.", "allOf": [ { - "$ref": "#/$defs/ToolCallId" + "$ref": "#/$defs/PlanEntryPriority" } ] }, - "content": { - "description": "A single item of content produced by the tool call.", + "status": { + "description": "Current execution status of this task.", "allOf": [ { - "$ref": "#/$defs/ToolCallContent" + "$ref": "#/$defs/PlanEntryStatus" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "content", + "priority", + "status" + ] + }, + "PlanEntryPriority": { + "description": "Priority levels for plan entries.\n\nUsed to indicate the relative importance or urgency of different\ntasks in the execution plan.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)", + "anyOf": [ + { + "description": "High priority task. Critical to the overall goal.", + "type": "string", + "const": "high" + }, + { + "description": "Medium priority task. Important but not critical.", + "type": "string", + "const": "medium" + }, + { + "description": "Low priority task. Nice to have but not essential.", + "type": "string", + "const": "low" + }, + { + "title": "other", + "description": "Custom or future plan entry priority.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" + } + ] + }, + "PlanEntryStatus": { + "description": "Status of a plan entry in the execution flow.\n\nTracks the lifecycle of each task from planning through completion.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)", + "anyOf": [ + { + "description": "The task has not started yet.", + "type": "string", + "const": "pending" + }, + { + "description": "The task is currently being worked on.", + "type": "string", + "const": "in_progress" + }, + { + "description": "The task has been successfully completed.", + "type": "string", + "const": "completed" + }, + { + "description": "The task was cancelled before it completed.", + "type": "string", + "const": "cancelled" + }, + { + "title": "other", + "description": "Custom or future plan entry status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" + } + ] + }, + "PlanItems": { + "description": "A plan represented as structured entries.", + "type": "object", + "properties": { + "planId": { + "description": "The plan ID to update.", + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ] + }, + "entries": { + "description": "The list of tasks to be accomplished.\n\nThe Agent MUST send all entries with their current status.\nThe Client MUST replace the checklist with this `planId` on each update.", + "type": "array", + "items": { + "$ref": "#/$defs/PlanEntry" + }, + "x-deserialize-skip-invalid-items": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "planId", + "entries" + ] + }, + "PlanMarkdown": { + "description": "A plan represented as Markdown.", + "type": "object", + "properties": { + "planId": { + "description": "The plan ID to update.", + "allOf": [ + { + "$ref": "#/$defs/PlanId" } ] }, + "content": { + "description": "The complete plan as Markdown, not just the text that changed.", + "type": "string" + }, + "path": { + "description": "The absolute path of the file that holds this plan.\n\nOmitted and `null` both mean the plan has no file. A supplied path MUST\nbe absolute. `content` is the plan to display whether or not `path` is set.\nClients can use `path` to open the file.", + "anyOf": [ + { + "$ref": "#/$defs/AbsolutePath" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. This field is chunk-scoped.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7811,21 +8903,24 @@ } }, "required": [ - "toolCallId", + "planId", "content" ] }, - "TerminalOutput": { - "description": "An authoritative replacement snapshot of terminal output bytes.", + "PlanUpdate": { + "description": "A content update for a plan identified by ID.", "type": "object", "properties": { - "data": { - "description": "Base64-encoded replacement terminal output bytes.", - "type": "string", - "contentEncoding": "base64" + "plan": { + "description": "Replaces the whole plan with this `planId`, even if its `type` changes.", + "allOf": [ + { + "$ref": "#/$defs/PlanUpdateContent" + } + ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. This metadata is scoped to the replacement snapshot. Omitted\nand `null` are equivalent and mean no snapshot metadata was provided.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7835,33 +8930,23 @@ } }, "required": [ - "data" + "plan" ] }, - "TerminalExitStatus": { - "description": "Exit information for an agent-owned terminal.\n\nThe presence of this object marks the terminal as exited, even when neither\nan exit code nor a signal is known.", + "PlanRemoved": { + "description": "Removal notice for a plan identified by ID.", "type": "object", "properties": { - "exitCode": { - "description": "Process exit code, when known. Omitted and `null` are equivalent.", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0, - "x-deserialize-default-on-error": true - }, - "signal": { - "description": "Signal that terminated the process, when known.\n\nAgents should use the conventional platform signal name. POSIX examples\ninclude `SIGTERM`, `SIGKILL`, and `SIGINT`. Other platforms may use a\nplatform-specific name. Omitted and `null` are equivalent.", - "type": [ - "string", - "null" - ], - "x-deserialize-default-on-error": true + "planId": { + "description": "The plan ID to remove. Clients MUST ignore a removal for an unknown ID.", + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. This metadata is scoped to the exit information. Omitted\nand `null` are equivalent and mean no exit metadata was provided.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7869,66 +8954,25 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - } + }, + "required": [ + "planId" + ] }, - "TerminalUpdate": { - "description": "An upsert for the stored state of an agent-owned terminal.\n\nOnly [`TerminalUpdate::terminal_id`] is required. Other fields have patch\nsemantics: omitted fields leave the stored value unchanged, `null` clears\nit, and concrete values replace it. When the terminal ID is new, omitted\nfields start unknown.", + "AvailableCommandsUpdate": { + "description": "Available commands are ready or have changed", "type": "object", "properties": { - "terminalId": { - "description": "Unique identifier for this terminal within the session.", - "allOf": [ - { - "$ref": "#/$defs/TerminalId" - } - ] - }, - "command": { - "description": "The command being run.", - "type": [ - "string", - "null" - ], - "x-deserialize-default-on-error": true - }, - "cwd": { - "description": "The absolute working directory of the command.", - "anyOf": [ - { - "$ref": "#/$defs/AbsolutePath" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "output": { - "description": "An authoritative replacement snapshot of terminal output bytes.", - "anyOf": [ - { - "$ref": "#/$defs/TerminalOutput" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "exitStatus": { - "description": "Exit information. A concrete object marks the terminal as exited.", - "anyOf": [ - { - "$ref": "#/$defs/TerminalExitStatus" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true + "availableCommands": { + "description": "Commands the Agent can execute.", + "type": "array", + "items": { + "$ref": "#/$defs/AvailableCommand" + }, + "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Omitted means no metadata update; `null` is an\nexplicit clear signal. Implementations MUST NOT make assumptions about values at these keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7938,28 +8982,23 @@ } }, "required": [ - "terminalId" + "availableCommands" ] }, - "TerminalOutputChunk": { - "description": "A chunk of bytes appended to an agent-owned terminal's output.", + "ConfigOptionUpdate": { + "description": "Session configuration options have been updated.", "type": "object", "properties": { - "terminalId": { - "description": "The terminal receiving these bytes.", - "allOf": [ - { - "$ref": "#/$defs/TerminalId" - } - ] - }, - "data": { - "description": "Independently base64-encoded terminal output bytes.", - "type": "string", - "contentEncoding": "base64" + "configOptions": { + "description": "The full set of configuration options and their current values.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys. This field is chunk-scoped. Omitted and `null` are\nequivalent and mean no chunk metadata was provided.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -7969,163 +9008,56 @@ } }, "required": [ - "terminalId", - "data" + "configOptions" ] }, - "PlanUpdateContent": { - "description": "Updated content for a plan.", - "anyOf": [ - { - "description": "Structured plan entries.", - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "items" - } - }, - "required": [ - "type" - ], - "allOf": [ - { - "$ref": "#/$defs/PlanItems" - } - ] - }, - { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA URI pointing to a file containing the plan.", - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "file" - } - }, - "required": [ - "type" - ], - "allOf": [ - { - "$ref": "#/$defs/PlanFile" - } - ] - }, - { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRaw markdown content for the plan.", - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "markdown" - } - }, - "required": [ - "type" + "SessionInfoUpdate": { + "description": "Update to session metadata. All fields are optional to support partial updates.\n\nAgents send this notification to update session information like title or custom metadata.\nClients can use it to keep session titles and state current.\n\nOmitted fields leave the existing session info unchanged. `null` clears the\ncorresponding value. A concrete `_meta` object patches the stored metadata by\ntop-level key.", + "type": "object", + "properties": { + "title": { + "description": "Human-readable title for the session, in plain text. Set to `null` to clear.", + "type": [ + "string", + "null" ], - "allOf": [ - { - "$ref": "#/$defs/PlanMarkdown" - } - ] + "x-deserialize-default-on-error": true }, - { - "title": "other", - "description": "Custom or future plan update content.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this content type should preserve the\nraw payload when storing, replaying, proxying, or forwarding plans, and\notherwise ignore it or display it generically.", - "type": "object", - "properties": { - "type": { - "description": "Custom or future plan update content type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", - "type": "string" - }, - "planId": { - "description": "The plan ID to update.", - "allOf": [ - { - "$ref": "#/$defs/PlanId" - } - ] - } - }, - "required": [ - "type", - "planId" - ], - "not": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "items" - } - }, - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "file" - } - }, - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "markdown" - } - }, - "required": [ - "type" - ] - } - ] - }, + "updatedAt": { + "description": "RFC 3339 timestamp of last activity. Set to null to clear.", + "type": [ + "string", + "null" + ], + "format": "date-time", + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, "additionalProperties": true } - ] - }, - "PlanId": { - "description": "Unique identifier for a plan within a session.", - "type": "string" + } }, - "PlanEntry": { - "description": "A single entry in the execution plan.\n\nRepresents a task or goal that the assistant intends to accomplish\nas part of fulfilling the user's request.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)", + "Cost": { + "description": "Cost information for a session.", "type": "object", "properties": { - "content": { - "description": "Human-readable description of what this task aims to accomplish.", - "type": "string" - }, - "priority": { - "description": "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal.", - "allOf": [ - { - "$ref": "#/$defs/PlanEntryPriority" - } - ] + "amount": { + "description": "Total cumulative cost for session.", + "type": "number", + "format": "double" }, - "status": { - "description": "Current execution status of this task.", - "allOf": [ - { - "$ref": "#/$defs/PlanEntryStatus" - } - ] + "currency": { + "description": "Unit of `amount`: an ISO 4217 currency code (e.g., \"USD\", \"EUR\") for money, or another\nunit such as \"credits\".", + "type": "string" }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8135,89 +9067,105 @@ } }, "required": [ - "content", - "priority", - "status" + "amount", + "currency" ] }, - "PlanEntryPriority": { - "description": "Priority levels for plan entries.\n\nUsed to indicate the relative importance or urgency of different\ntasks in the execution plan.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)", - "anyOf": [ - { - "description": "High priority task - critical to the overall goal.", - "type": "string", - "const": "high" + "UsageUpdate": { + "description": "Context window and cost update for a session.", + "type": "object", + "properties": { + "used": { + "description": "Tokens currently in context.", + "type": "integer", + "format": "uint64", + "minimum": 0 }, - { - "description": "Medium priority task - important but not critical.", - "type": "string", - "const": "medium" + "size": { + "description": "Total context window size in tokens.", + "type": "integer", + "format": "uint64", + "minimum": 0 }, - { - "description": "Low priority task - nice to have but not essential.", - "type": "string", - "const": "low" + "cost": { + "description": "Cumulative session cost.\n\nOmitted leaves the last reported cost unchanged. `null` clears it. A value replaces it.", + "anyOf": [ + { + "$ref": "#/$defs/Cost" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - { - "title": "other", - "description": "Custom or future plan entry priority.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true } + }, + "required": [ + "used", + "size" ] }, - "PlanEntryStatus": { - "description": "Status of a plan entry in the execution flow.\n\nTracks the lifecycle of each task from planning through completion.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)", + "NoticeSeverity": { + "description": "Severity hint for a session notice.", "anyOf": [ { - "description": "The task has not started yet.", - "type": "string", - "const": "pending" - }, - { - "description": "The task is currently being worked on.", + "description": "Informational notice.", "type": "string", - "const": "in_progress" + "const": "info" }, { - "description": "The task has been successfully completed.", + "description": "Warning notice.", "type": "string", - "const": "completed" + "const": "warning" }, { - "description": "The task was cancelled before it completed.", + "description": "Error notice.", "type": "string", - "const": "cancelled" + "const": "error" }, { "title": "other", - "description": "Custom or future plan entry status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "description": "Custom or future notice severity.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Other unknown values are reserved for future ACP severities.", "type": "string" } ] }, - "PlanItems": { - "description": "A plan represented as structured entries.", + "Notice": { + "description": "Fire-and-forget information for the user.\n\nNotices are live events rather than session history. Agents MUST NOT rely on\na notice being received, displayed, or seen by the user.\nNo Client capability is required, and Clients MAY ignore notices.\n\nSee protocol docs: [Session Notices](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#session-notices)", "type": "object", "properties": { - "planId": { - "description": "The plan ID to update.", + "severity": { + "description": "Presentation severity hint.", "allOf": [ { - "$ref": "#/$defs/PlanId" + "$ref": "#/$defs/NoticeSeverity" } ] }, - "entries": { - "description": "The list of tasks to be accomplished.\n\nWhen updating an item-based plan, the agent must send a complete list of all entries\nwith their current status. The client replaces that plan with each update.", - "type": "array", - "items": { - "$ref": "#/$defs/PlanEntry" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "title": { + "description": "Required non-empty plain-text title that can stand alone.", + "type": "string", + "minLength": 1 + }, + "description": { + "description": "Optional plain-text detail or guidance.\n\nOmitted and `null` are equivalent and mean no description was supplied.", + "type": [ + "string", + "null" + ], + "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8227,87 +9175,90 @@ } }, "required": [ - "planId", - "entries" + "severity", + "title" ] }, - "PlanFile": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented by a file URI.", - "type": "object", - "properties": { - "planId": { - "description": "The plan ID to update.", - "allOf": [ - { - "$ref": "#/$defs/PlanId" - } - ] + "CompactionId": { + "description": "Unique identifier for a context compaction within a session.", + "type": "string" + }, + "CompactionStatus": { + "description": "Lifecycle state of a context compaction.", + "anyOf": [ + { + "description": "Compaction has started and has not finished.", + "type": "string", + "const": "in_progress" }, - "uri": { - "description": "The URI of the file containing the plan.", + { + "description": "Compaction finished successfully.", "type": "string", - "format": "uri" + "const": "completed" }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true + { + "description": "Compaction finished unsuccessfully.", + "type": "string", + "const": "failed" + }, + { + "description": "Compaction was cancelled before it finished.", + "type": "string", + "const": "cancelled" + }, + { + "title": "other", + "description": "Custom or future compaction status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Other unknown values are reserved for future ACP statuses.", + "type": "string" } - }, - "required": [ - "planId", - "uri" ] }, - "PlanMarkdown": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented as raw markdown content.", + "CompactionUpdate": { + "description": "A context compaction upsert. The first notification fixes the compaction's\ntimeline position. Later updates with the same ID patch that entity in place.\n\nOnly `compactionId` is required. `status`, `summary`, `error`, and `_meta` have\npatch semantics: omission leaves the stored value unchanged, `null` clears it\nor resets it to its default, and a concrete value replaces it.\n`summary: []` also clears the summary. A concrete `_meta` object patches the\nstored metadata by top-level key instead of replacing it.", "type": "object", "properties": { - "planId": { - "description": "The plan ID to update.", + "compactionId": { + "description": "The Agent-owned ID of this compaction, unique within the session.", "allOf": [ { - "$ref": "#/$defs/PlanId" + "$ref": "#/$defs/CompactionId" } ] }, - "content": { - "description": "Markdown content for the plan.", - "type": "string" + "status": { + "description": "Current lifecycle status.\n\nOmission leaves the status unchanged, `null` resets it to `in_progress`, and a value\nreplaces it. A new compaction starts as `in_progress`.", + "anyOf": [ + { + "$ref": "#/$defs/CompactionStatus" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "summary": { + "description": "Complete replacement user-displayable summary content for the compaction.", "type": [ - "object", + "array", "null" ], + "items": { + "$ref": "#/$defs/ContentBlock" + }, "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "planId", - "content" - ] - }, - "PlanUpdate": { - "description": "A content update for a plan identified by ID.", - "type": "object", - "properties": { - "plan": { - "description": "The updated plan content.", - "allOf": [ - { - "$ref": "#/$defs/PlanUpdateContent" - } - ] + "x-deserialize-skip-invalid-items": true + }, + "error": { + "description": "Human-readable details of a compaction error, in plain text.", + "type": [ + "string", + "null" + ], + "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", "type": [ "object", "null" @@ -8317,23 +9268,31 @@ } }, "required": [ - "plan" + "compactionId" ] }, - "PlanRemoved": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRemoval notice for a plan identified by ID.", + "CompactionSummaryChunk": { + "description": "A content block appended to a compaction's summary. A first-seen ID creates\nan in-progress compaction. Chunks append in receive order.", "type": "object", "properties": { - "planId": { - "description": "The plan ID to remove.", + "compactionId": { + "description": "ID of the compaction whose summary receives this content.", "allOf": [ { - "$ref": "#/$defs/PlanId" + "$ref": "#/$defs/CompactionId" + } + ] + }, + "content": { + "description": "One content block to append.", + "allOf": [ + { + "$ref": "#/$defs/ContentBlock" } ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis metadata is scoped to the chunk and does not patch stored metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8343,24 +9302,39 @@ } }, "required": [ - "planId" + "compactionId", + "content" ] }, - "AvailableCommandsUpdate": { - "description": "Available commands are ready or have changed", + "ReplayComplete": { + "description": "Marks the end of the history replay requested by `session/resume`.\n\nThe Agent MUST send this exactly once on a session for each `session/resume` request\nwith a `replayFrom` cursor, after the last replayed update for that session\nand before the response, even for an empty replay. After receiving the\nrequest, the Agent MUST hold live updates for the session during replay.\nIf the session is already active on the connection, a live update the Agent\nsent earlier can still arrive after the Client sends the request. The marker\nsignals the end of the requested replay, not its start. A full replay covers\nall the history the Agent retained for that session.\n\nThe Agent MUST NOT send it when `replayFrom` is omitted or `null`, or when\nit cannot finish the replay. A replay that ends without it and without a\nsuccessful response is truncated.\n\nSee protocol docs: [Replay Complete](https://agentclientprotocol.com/protocol/v2/draft/session-setup#replay-complete)", "type": "object", "properties": { - "availableCommands": { - "description": "Commands the agent can execute.", + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "PromptSuggestion": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA prompt the Agent predicts the user will send next.", + "type": "object", + "properties": { + "prompt": { + "description": "The content of the suggested prompt.\n\nRequired and non-null. Must contain at least one content block. This is\nthe same type as the `prompt` field of `session/prompt`, and the Client\ncan send it in that field unchanged.\n\nAgents MUST only use `text` and `resource_link` content blocks, and\nother content block types that both the Agent's `session.prompt`\ncapability and the Client's `session.promptSuggestions` capability\nadvertise. Agents MUST NOT send a prompt whose only content is empty\nor whitespace-only text.", "type": "array", "items": { - "$ref": "#/$defs/AvailableCommand" + "$ref": "#/$defs/ContentBlock" }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "minItems": 1 }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8370,24 +9344,23 @@ } }, "required": [ - "availableCommands" + "prompt" ] }, - "ConfigOptionUpdate": { - "description": "Session configuration options have been updated.", + "PromptSuggestionsUpdate": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nReplaces the session's current list of prompt suggestions.\n\nA prompt suggestion is a prompt the Agent predicts the user will send next.\nThe Client offers suggestions where the user writes the next prompt. The\nlist in the most recent update is the current list until the Agent sends\nanother update. A session starts with an empty list.\n\nSuggestions are not part of session history. Agents SHOULD NOT include\nthis update when they replay a session.\n\nAgents MUST only send this update when the Client advertised\nthe `session.promptSuggestions` Client capability.", "type": "object", "properties": { - "configOptions": { - "description": "The full set of configuration options and their current values.", + "suggestions": { + "description": "The suggestions the Client can offer, ordered most likely first.\n\nRequired and non-null. An empty list withdraws the suggestions the\nClient is offering.", "type": "array", "items": { - "$ref": "#/$defs/SessionConfigOption" + "$ref": "#/$defs/PromptSuggestion" }, - "x-deserialize-default-on-error": true, "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8397,32 +9370,31 @@ } }, "required": [ - "configOptions" + "suggestions" ] }, - "SessionInfoUpdate": { - "description": "Update to session metadata. All fields are optional to support partial updates.\n\nAgents send this notification to update session information like title or custom metadata.\nThis allows clients to display dynamic session names and track session state changes.\n\nOmitted fields leave the existing session info unchanged. `null` clears the\ncorresponding value.", + "CursorId": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for a session cursor within a session.\n\nThe Agent generates it, and it is never reused for another position in the\nsession. Clients MUST NOT parse, change, or construct it.\n\nSee the [Session Cursors RFD](https://agentclientprotocol.com/rfds/session-cursors).", + "type": "string" + }, + "CursorCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe methods that currently accept a session cursor.\n\nSee the [Session Cursors RFD](https://agentclientprotocol.com/rfds/session-cursors).", "type": "object", "properties": { - "title": { - "description": "Human-readable title for the session. Set to null to clear.", - "type": [ - "string", - "null" - ], - "x-deserialize-default-on-error": true - }, - "updatedAt": { - "description": "RFC 3339 timestamp of last activity. Set to null to clear.", - "type": [ - "string", - "null" + "fork": { + "description": "Permits the Client to fork the session at this cursor with `session/fork`.\n\nOmitted and `null` are equivalent and mean unsupported. An object (including `{}`)\nmeans supported.", + "anyOf": [ + { + "$ref": "#/$defs/CursorForkCapabilities" + }, + { + "type": "null" + } ], - "format": "date-time", "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Omitted means no metadata update; `null` is an\nexplicit clear signal. Implementations MUST NOT make assumptions about values at these keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8432,22 +9404,12 @@ } } }, - "Cost": { - "description": "Cost information for a session.", + "CursorForkCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapability to fork the session at a cursor with `session/fork`.\n\nSupplying `{}` advertises support. An omitted or `null` `fork` does not.", "type": "object", "properties": { - "amount": { - "description": "Total cumulative cost for session.", - "type": "number", - "format": "double" - }, - "currency": { - "description": "ISO 4217 currency code (e.g., \"USD\", \"EUR\").", - "type": "string", - "pattern": "^[A-Z]{3}$" - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8455,107 +9417,254 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "amount", - "currency" - ] + } }, - "UsageUpdate": { - "description": "Context window and cost update for a session.", - "type": "object", - "properties": { - "used": { - "description": "Tokens currently in context.", - "type": "integer", - "format": "uint64", - "minimum": 0 + "CursorAnchor": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhere a session cursor is, relative to an entity the Client holds.\n\nThe anchor names the entity by its type and ID, and `position` says on which\nside of that entity the cursor is. A known `type` with a malformed payload is\nan error. It does not fall back to the unknown-type variant.\n\nSee the [Session Cursors RFD](https://agentclientprotocol.com/rfds/session-cursors).", + "anyOf": [ + { + "description": "The cursor is next to a user message.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "user_message" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/CursorMessageAnchor" + } + ] }, - "size": { - "description": "Total context window size in tokens.", - "type": "integer", - "format": "uint64", - "minimum": 0 + { + "description": "The cursor is next to an Agent message.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "agent_message" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/CursorMessageAnchor" + } + ] }, - "cost": { - "description": "Cumulative session cost (optional).", - "anyOf": [ + { + "description": "The cursor is next to an Agent thought.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "agent_thought" + } + }, + "required": [ + "type" + ], + "allOf": [ { - "$ref": "#/$defs/Cost" - }, + "$ref": "#/$defs/CursorMessageAnchor" + } + ] + }, + { + "description": "The cursor is next to a session-directed message.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "session_message" + } + }, + "required": [ + "type" + ], + "allOf": [ { - "type": "null" + "$ref": "#/$defs/CursorMessageAnchor" + } + ] + }, + { + "description": "The cursor is next to a tool call.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "tool_call" } + }, + "required": [ + "type" ], - "x-deserialize-default-on-error": true + "allOf": [ + { + "$ref": "#/$defs/CursorToolCallAnchor" + } + ] }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" + { + "description": "The cursor is next to a compaction.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "compaction" + } + }, + "required": [ + "type" ], - "x-deserialize-default-on-error": true, + "allOf": [ + { + "$ref": "#/$defs/CursorCompactionAnchor" + } + ] + }, + { + "title": "other", + "description": "Custom or future anchor type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nA Client that does not recognize the type cannot place the cursor and\nMUST NOT guess a place for it.", + "type": "object", + "properties": { + "type": { + "description": "Custom or future anchor type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" + } + }, + "required": [ + "type" + ], + "not": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "user_message" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "agent_message" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "agent_thought" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "session_message" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "tool_call" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "compaction" + } + }, + "required": [ + "type" + ] + } + ] + }, "additionalProperties": true } - }, - "required": [ - "used", - "size" ] }, - "NoticeSeverity": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSeverity hint for a session notice.", + "CursorAnchorPosition": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nOn which side of the anchored entity a session cursor is.", "anyOf": [ { - "description": "Informational notice.", - "type": "string", - "const": "info" - }, - { - "description": "Warning notice.", + "description": "The cursor is immediately before the entity. The history before the\ncursor does not include the entity.", "type": "string", - "const": "warning" + "const": "before" }, { - "description": "Error notice.", + "description": "The cursor is immediately after the entity. The history before the\ncursor includes the entity and nothing that follows it in the timeline.", "type": "string", - "const": "error" + "const": "after" }, { "title": "other", - "description": "Custom or future notice severity.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Other unknown values are reserved for future ACP severities.", + "description": "Custom or future position.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Other unknown values are reserved for future ACP positions.\nA Client that does not recognize the value cannot place the cursor.", "type": "string" } ] }, - "Notice": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nFire-and-forget advisory information for the user.\n\nNotices are live events rather than session history. Agents must not rely on\na notice being received, displayed, or seen by the user.\nNo Client capability is required, and unsupported Clients may ignore notices.\n\nSee RFD: [Session Notices](https://agentclientprotocol.com/rfds/session-notices)", + "CursorMessageAnchor": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA session cursor anchor to a message. The anchor's `type` names the kind of message.", "type": "object", "properties": { - "severity": { - "description": "Presentation severity hint.", + "messageId": { + "description": "The ID of the anchored message.", "allOf": [ { - "$ref": "#/$defs/NoticeSeverity" + "$ref": "#/$defs/MessageId" } ] }, - "title": { - "description": "Required non-empty plain-text title that can stand alone.", - "type": "string", - "minLength": 1 - }, - "description": { - "description": "Optional plain-text detail or guidance.\n\nOmitted and `null` are equivalent and mean no description was supplied.", - "type": [ - "string", - "null" - ], - "x-deserialize-default-on-error": true + "position": { + "description": "On which side of the message the cursor is.", + "allOf": [ + { + "$ref": "#/$defs/CursorAnchorPosition" + } + ] }, "_meta": { - "description": "Metadata scoped to this notice.\n\nOmitted and `null` are equivalent and mean no metadata was supplied.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8565,86 +9674,67 @@ } }, "required": [ - "severity", - "title" + "messageId", + "position" ] }, - "CompactionId": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for a context compaction within a session.", - "type": "string" - }, - "CompactionStatus": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLifecycle state of a context compaction.", - "anyOf": [ - { - "description": "Compaction has started and has not finished.", - "type": "string", - "const": "in_progress" - }, - { - "description": "Compaction finished successfully.", - "type": "string", - "const": "completed" - }, - { - "description": "Compaction finished unsuccessfully.", - "type": "string", - "const": "failed" + "CursorToolCallAnchor": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA session cursor anchor to a tool call.", + "type": "object", + "properties": { + "toolCallId": { + "description": "The ID of the anchored tool call.", + "allOf": [ + { + "$ref": "#/$defs/ToolCallId" + } + ] }, - { - "description": "Compaction was cancelled before it finished.", - "type": "string", - "const": "cancelled" + "position": { + "description": "On which side of the tool call the cursor is.", + "allOf": [ + { + "$ref": "#/$defs/CursorAnchorPosition" + } + ] }, - { - "title": "other", - "description": "Custom or future compaction status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Other unknown values are reserved for future ACP statuses.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true } + }, + "required": [ + "toolCallId", + "position" ] }, - "CompactionUpdate": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA context compaction upsert. The first update fixes the compaction's\ntimeline position. Later updates with the same ID patch that entity in place.\n\n`summary`, `error`, and `_meta` have patch semantics: omission leaves the\nstored value unchanged, `null` clears it, and a concrete value replaces it.\n`summary: []` also clears the retained summary. A non-empty summary is only\nvalid with `completed`; `error` is only valid with `failed`.", + "CursorCompactionAnchor": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA session cursor anchor to a compaction.", "type": "object", "properties": { "compactionId": { - "description": "The Agent-owned ID of this compaction, unique within the session.", + "description": "The ID of the anchored compaction.", "allOf": [ { "$ref": "#/$defs/CompactionId" } ] }, - "status": { - "description": "Current lifecycle status.", + "position": { + "description": "On which side of the compaction the cursor is.", "allOf": [ { - "$ref": "#/$defs/CompactionStatus" + "$ref": "#/$defs/CursorAnchorPosition" } ] }, - "summary": { - "description": "Complete replacement user-displayable summary retained by the compaction.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/$defs/ContentBlock" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, - "error": { - "description": "Human-readable description of why the compaction failed.", - "type": [ - "string", - "null" - ], - "x-deserialize-default-on-error": true - }, "_meta": { - "description": "Extensible metadata patch for this compaction.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8655,31 +9745,46 @@ }, "required": [ "compactionId", - "status" + "position" ] }, - "CompactionSummaryChunk": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA content block appended to the retained summary of an in-progress\ncompaction. Agents send chunks only after an `in_progress` update and before\nthe terminal update for the same ID.", + "CursorUpdate": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA session cursor upsert. A cursor names one position in the session's timeline.\n\nThe first update for a `cursorId` MUST include `anchor`. The anchor is fixed\nafter that, and later updates change only `capabilities`.\n\n`capabilities` and `_meta` have patch semantics: omission leaves the stored\nvalue unchanged, `null` clears it, and an object replaces `capabilities` as a\nwhole. A concrete `_meta` object patches the stored metadata by top-level key\ninstead of replacing it.\n\nSee the [Session Cursors RFD](https://agentclientprotocol.com/rfds/session-cursors).", "type": "object", "properties": { - "compactionId": { - "description": "ID of the compaction whose summary receives this content.", + "cursorId": { + "description": "The Agent-owned ID of this cursor, unique within the session.", "allOf": [ { - "$ref": "#/$defs/CompactionId" + "$ref": "#/$defs/CursorId" } ] }, - "content": { - "description": "One content block to append.", - "allOf": [ + "capabilities": { + "description": "The methods that currently accept this cursor.\n\nOmission leaves the capabilities unchanged, `null` clears them, and an object replaces\nthe whole previous value. A new cursor starts with none.", + "anyOf": [ { - "$ref": "#/$defs/ContentBlock" + "$ref": "#/$defs/CursorCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "anchor": { + "description": "Where the cursor is, relative to an entity the Client holds.\n\nRequired on the first update for a cursor. The Agent MUST NOT change it afterwards.\nA later update can omit it or repeat the same anchor. Omitted and `null` are\nequivalent and leave the stored anchor unchanged.", + "anyOf": [ + { + "$ref": "#/$defs/CursorAnchor" + }, + { + "type": "null" } ] }, "_meta": { - "description": "Metadata scoped to this chunk. Omission and `null` both mean absent.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", "type": [ "object", "null" @@ -8689,16 +9794,15 @@ } }, "required": [ - "compactionId", - "content" + "cursorId" ] }, "SubagentSessionCapabilities": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nClient-initiated session mutations permitted for a specific subagent session.\n\nA mutation requires an explicit per-child capability; support for the method\non ordinary sessions does not grant support on a child.", + "description": "Client-initiated session mutations permitted for a specific subagent session.\n\nA mutation requires an explicit per-child capability. Support for the method\non ordinary sessions does not grant support on a child.\n\nSee protocol docs: [Restricted methods](https://agentclientprotocol.com/protocol/v2/draft/subagents#restricted-methods)", "type": "object", "properties": { "cancel": { - "description": "Permits the client to cancel this child's current work without ending\nthe session. Omitted or `null` means unsupported; an object (including\n`{}`) means supported.", + "description": "Permits the Client to cancel this child's current work without ending\nthe session. Omitted and `null` are equivalent and mean unsupported. An object (including\n`{}`) means supported.", "anyOf": [ { "$ref": "#/$defs/SessionCancelCapabilities" @@ -8710,7 +9814,7 @@ "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8721,11 +9825,11 @@ } }, "SessionCancelCapabilities": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapability to cancel work in a subagent session without ending that session.\n\nSupplying `{}` advertises support; an omitted or `null` `cancel` does not.", + "description": "Capability to cancel work in a subagent session without ending that session.\n\nSupplying `{}` advertises support. An omitted or `null` `cancel` does not.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8736,7 +9840,7 @@ } }, "SubagentUpdate": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification that the enclosing parent session created and owns a child session.\n\nLater updates modify the existing association's metadata, not its ownership.\n\nSent on the immediate parent session. The first update for an unknown\n[`SubagentUpdate::session_id`] announces the child and MUST be sent\nbefore any live request or notification bearing the child's session ID,\nincluding messages naming it as sender or recipient. Child events are\ndelivered automatically; no separate child load, resume, or subscription is needed.\nUnderstanding this update, registering child sessions, and applying their\noperation restrictions are baseline v2 requirements; no Client capability\nis required.\n\nOnly [`SubagentUpdate::session_id`] is required. Other fields have\npatch semantics: omitted fields leave the stored value unchanged, `null`\nclears or unsets the value, and concrete values replace it. For `state`,\n`null` removes the current state report and leaves activity unconfirmed;\nit does not report idle or cancellation. A child whose capabilities are\nunset permits no Client-initiated session mutations.\n\nThe title and description provide the parent's display metadata for the\nchild. Agents SHOULD mirror known child state changes in the parent's\n[`SubagentUpdate::state`] using the same [`StateUpdate`] snapshot as the\nordinary `state_update` notification on the child session. This reports\nchild state, not a separate parent-owned lifecycle. Consumers should\ntreat duplicate reports idempotently.\nCompleting or cancelling work does not end the association: the parent may\nmessage the same child again. Individual messages and their outcomes do not\nchange this association.", + "description": "Notification that the enclosing parent session created and owns a child session.\n\nLater updates modify the existing association's metadata, not its ownership.\n\nSent on the immediate parent session. The first update for an unknown\n`sessionId` announces the child and MUST be sent\nbefore any live request or notification bearing the child's session ID,\nincluding messages naming it as sender or recipient. Child events are\ndelivered automatically. No separate child resume or subscription is needed.\nUnderstanding this update, registering child sessions, and applying their\noperation restrictions are baseline requirements. No Client capability\nis required.\n\nOnly `sessionId` is required. Other fields have\npatch semantics: omitted fields leave the stored value unchanged, `null`\nclears or unsets the value, and concrete values replace it. A concrete\n`_meta` object instead patches the stored metadata by top-level key. For\n`state`, `null` removes the current state report and leaves activity\nunconfirmed. It does not report idle or cancellation. A child whose capabilities are\nunset permits no Client-initiated session mutations.\n\n`cwd` and `additionalDirectories` report where the Agent placed the child.\nWhile unset, each inherits the immediate parent's effective value.\nThe title and description provide the parent's display metadata for the\nchild. Agents SHOULD mirror known child state changes in the parent's\n`state` using the same `StateUpdate` snapshot as the\nordinary `state_update` notification on the child session. This reports\nchild state, not a separate parent-owned lifecycle. Clients MUST\napply duplicate reports idempotently.\nCompleting or cancelling work does not end the association: the parent may\nmessage the same child again. Individual messages and their outcomes do not\nchange this association.\n\nSee protocol docs: [Subagents](https://agentclientprotocol.com/protocol/v2/draft/subagents)", "type": "object", "properties": { "sessionId": { @@ -8748,7 +9852,7 @@ ] }, "title": { - "description": "The parent's human-readable display title for this child. It need not be unique.\n\nOptional and nullable. Omitted means unchanged; `null` clears it. If no\ntitle is set, the Client chooses a fallback presentation.", + "description": "The parent's human-readable display title for this child, in plain text. It need not be unique.\n\nOptional and nullable. Omitted means unchanged. `null` clears it. If no\ntitle is set, the Client chooses a fallback presentation.", "type": [ "string", "null" @@ -8756,7 +9860,7 @@ "x-deserialize-default-on-error": true }, "description": { - "description": "The parent's human-readable description of the child's role or purpose.\n\nOptional and nullable. Omitted means unchanged; `null` clears it. This is\ncurrent display metadata, not the history of instructions sent to the child.", + "description": "The parent's human-readable description of the child's role or purpose.\nMay contain Markdown.\n\nOptional and nullable. Omitted means unchanged. `null` clears it. This is\ncurrent display metadata, not the history of instructions sent to the child.", "type": [ "string", "null" @@ -8776,7 +9880,7 @@ "x-deserialize-default-on-error": true }, "state": { - "description": "The child's current foreground state, mirrored onto its parent association.\n\nOptional and nullable. Omitted means unchanged; `null` removes the\ncurrent report and leaves activity unconfirmed (not idle or cancelled).\nA concrete [`StateUpdate`] replaces the entire previous snapshot.", + "description": "The child's current foreground state, mirrored onto its parent association.\n\nOptional and nullable. Omitted means unchanged. `null` removes the\ncurrent report and leaves activity unconfirmed (not idle or cancelled).\nA concrete `StateUpdate` replaces the entire previous snapshot.", "anyOf": [ { "$ref": "#/$defs/StateUpdate" @@ -8787,8 +9891,29 @@ ], "x-deserialize-default-on-error": true }, + "cwd": { + "description": "The child's working directory. Must be an absolute path.\n\nOptional and nullable. Omitted means unchanged. `null` clears the\nreported value. While unset, the child inherits its immediate parent's\neffective working directory.", + "anyOf": [ + { + "$ref": "#/$defs/AbsolutePath" + }, + { + "type": "null" + } + ] + }, + "additionalDirectories": { + "description": "Additional workspace roots for the child. Each path MUST be absolute.\n\nOptional and nullable. Omitted means unchanged. `null` clears the\nreported value. While unset, the child inherits its immediate parent's\neffective additional directories, independently of `cwd`. A concrete\narray replaces the whole list. `[]` reports no additional directories.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/AbsolutePath" + } + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Omitted means no metadata update; `null` is an\nexplicit clear signal. Implementations MUST NOT make assumptions about values at these keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", "type": [ "object", "null" @@ -8802,7 +9927,7 @@ ] }, "SessionMessage": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAn upsert for an inter-session message.", + "description": "An upsert for an inter-session message.", "type": "object", "properties": { "messageId": { @@ -8814,7 +9939,7 @@ ] }, "senderSessionId": { - "description": "Optional sending session identity; omission or `null` retains a known value.", + "description": "The sending session.\n\nOmitted leaves the stored value unchanged. `null` clears it. A value replaces it.", "anyOf": [ { "$ref": "#/$defs/SessionId" @@ -8826,7 +9951,7 @@ "x-deserialize-default-on-error": true }, "recipientSessionId": { - "description": "Optional receiving session identity; omission or `null` retains a known value.", + "description": "The receiving session.\n\nOmitted leaves the stored value unchanged. `null` clears it. A value replaces it.", "anyOf": [ { "$ref": "#/$defs/SessionId" @@ -8837,8 +9962,32 @@ ], "x-deserialize-default-on-error": true }, + "senderMessageId": { + "description": "On an incoming view, the `messageId` of the same message's outgoing view in the\nsender's transcript.\n\nOmitted leaves the stored value unchanged. `null` clears it. A value replaces it. It can arrive\nafter the message starts streaming.", + "anyOf": [ + { + "$ref": "#/$defs/MessageId" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "recipientMessageId": { + "description": "On an outgoing view, the `messageId` of the same message's incoming view in the\nrecipient's transcript.\n\nOmitted leaves the stored value unchanged. `null` clears it. A value replaces it. It can arrive\nafter the message starts streaming.", + "anyOf": [ + { + "$ref": "#/$defs/MessageId" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "content": { - "description": "Omitted leaves content unchanged; `null` clears it; a concrete array\nreplaces the whole content collection.", + "description": "Omitted leaves content unchanged. `null` clears it. A concrete array\nreplaces the whole content collection.", "type": [ "array", "null" @@ -8850,7 +9999,7 @@ "x-deserialize-skip-invalid-items": true }, "_meta": { - "description": "Omitted leaves metadata unchanged; `null` clears it.\n\nImplementations MUST NOT make assumptions about values in `_meta`.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted leaves the stored metadata unchanged. `null`\nclears it. An object patches the stored metadata by top-level key: keys it omits are\nunchanged, a key set to `null` is removed, and any other value replaces that key's\nstored value without merging nested objects. Beyond this patch rule, implementations\nMUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches)", "type": [ "object", "null" @@ -8864,7 +10013,7 @@ ] }, "SessionMessageChunk": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA streamed content block of an inter-session message.", + "description": "A streamed content block of an inter-session message.\n\nA chunk carries only content. The message's participants and references come from\n`session_message` upserts, which can arrive before, between, or after its chunks.", "type": "object", "properties": { "messageId": { @@ -8875,40 +10024,43 @@ } ] }, - "senderSessionId": { - "description": "Optional sending session identity; omission or `null` retains a known value.", - "anyOf": [ - { - "$ref": "#/$defs/SessionId" - }, + "content": { + "description": "A single content block appended to the message.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/ContentBlock" } - ], - "x-deserialize-default-on-error": true + ] }, - "recipientSessionId": { - "description": "Optional receiving session identity; omission or `null` retains a known value.", - "anyOf": [ - { - "$ref": "#/$defs/SessionId" - }, - { - "type": "null" - } + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis metadata is scoped to the chunk and does not patch stored metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" ], - "x-deserialize-default-on-error": true - }, - "content": { - "description": "A single content block appended to the message.", + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "messageId", + "content" + ] + }, + "CompleteElicitationNotification": { + "description": "Notification sent by the Agent when a URL-based elicitation is complete.\n\nThis notification is not a foreground state update.", + "type": "object", + "properties": { + "elicitationId": { + "description": "The ID of the elicitation that completed.", "allOf": [ { - "$ref": "#/$defs/ContentBlock" + "$ref": "#/$defs/ElicitationId" } ] }, "_meta": { - "description": "Optional and nullable chunk-scoped metadata; omitted or `null` means none.\n\nImplementations MUST NOT make assumptions about values in `_meta`.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8918,24 +10070,39 @@ } }, "required": [ - "messageId", - "content" - ] + "elicitationId" + ], + "x-side": "client", + "x-method": "elicitation/complete", + "x-scope": { + "elicitation": [ + "elicitationId" + ] + } }, - "CompleteElicitationNotification": { - "description": "Notification sent by the agent when a URL-based elicitation is complete.", + "AuthStatusUpdateNotification": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification sent by the Agent when its authentication status changes.\n\nCarries the same fields as the `auth/status` response. Agents that advertise the\n`auth.status` capability MAY send it at any time after `initialize`, and SHOULD only\nsend it when the reported status differs from the last one sent on the connection.", "type": "object", "properties": { - "elicitationId": { - "description": "The ID of the elicitation that completed.", + "state": { + "description": "Whether the Agent can start sessions without the user signing in first.\n\nClients use this field to decide whether sign-in is needed. Clients MUST treat\nvalues they do not recognize as `unknown`.", "allOf": [ { - "$ref": "#/$defs/ElicitationId" + "$ref": "#/$defs/AuthState" } ] }, + "accounts": { + "description": "The accounts the Agent has configured, for display.\n\nOptional. Omitted and empty are equivalent and mean no accounts are reported.\nAgents that hold credentials for several providers or accounts SHOULD list each\nof them and mark the ones in effect with `active`.", + "type": "array", + "items": { + "$ref": "#/$defs/AuthAccount" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -8945,13 +10112,22 @@ } }, "required": [ - "elicitationId" + "state" ], "x-side": "client", - "x-method": "elicitation/complete" + "x-method": "auth/status_update", + "x-scope": {}, + "x-state": { + "agent": [ + { + "action": "replace", + "target": "authStatus" + } + ] + } }, "ExtNotification": { - "description": "Allows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)" + "description": "Allows either side to send an arbitrary notification that is not part of the ACP spec.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)" }, "ClientRequest": { "description": "A JSON-RPC request object.", @@ -8973,11 +10149,11 @@ "description": "Method-specific request parameters.", "anyOf": [ { - "description": "All possible requests that a client can send to an agent.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly.\n\nThis enum encompasses all method calls from client to agent.", + "description": "All possible requests that a Client can send to an Agent.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly.\n\nThis enum encompasses all method calls from Client to Agent.", "anyOf": [ { "title": "InitializeRequest", - "description": "Establishes the connection with a client and negotiates protocol capabilities.\n\nThis method is called once at the beginning of the connection to:\n- Negotiate the protocol version to use\n- Exchange capability information between client and agent\n- Determine available authentication methods\n\nThe agent should respond with its supported protocol version and capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)", + "description": "Establishes the connection with a Client and negotiates protocol capabilities.\n\nThis method is called at the beginning of the connection, before any other request, to:\n- Negotiate the protocol version to use\n- Exchange capability information between Client and Agent\n- Determine available authentication methods\n\nThe Client MAY repeat it before its first other request. The latest successful\n`initialize` is authoritative.\n\nThe Agent responds with its supported protocol version and capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)", "allOf": [ { "$ref": "#/$defs/InitializeRequest" @@ -8986,7 +10162,7 @@ }, { "title": "LoginAuthRequest", - "description": "Authenticates the client using the specified authentication method.\n\nAgents MUST support this method when their `initialize` response advertised\nat least one valid authentication method. Clients MUST call this method only\nwith a method whose type defines a protocol-driven login flow, and MUST NOT\ncall it when `authMethods` was omitted or empty.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)", + "description": "Authenticates the Client using the specified authentication method.\n\nAgents MUST support this method when their `initialize` response included\na non-empty `authMethods` list. Clients MUST call this method only\nwith a method whose type defines a protocol-driven login flow, and MUST NOT\ncall it when `authMethods` was omitted or empty.\n\nCalled when the Agent requires authentication before allowing session creation.\nThe Client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the Client can proceed to create sessions with\n`session/new` without receiving a `-32000` (Authentication required) error.\n\nSee protocol docs: [Authentication](https://agentclientprotocol.com/protocol/v2/draft/authentication)", "allOf": [ { "$ref": "#/$defs/LoginAuthRequest" @@ -8995,7 +10171,7 @@ }, { "title": "ListProvidersRequest", - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLists providers that can be configured by the client.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLists providers that can be configured by the Client.", "allOf": [ { "$ref": "#/$defs/ListProvidersRequest" @@ -9022,16 +10198,25 @@ }, { "title": "LogoutAuthRequest", - "description": "Logs out of the current authenticated state.\n\nAgents MUST support this method when their `initialize` response advertised\nat least one valid authentication method. Clients MUST NOT call this method\nwhen `authMethods` was omitted or empty.\n\nAfter a successful logout, authentication-gated requests require the\nclient to complete an advertised authentication flow again. There is no\nguarantee about the behavior of already running sessions.", + "description": "Logs out of the current authenticated state.\n\nAgents MUST support this method when their `initialize` response included\na non-empty `authMethods` list. Clients MUST NOT call this method\nwhen `authMethods` was omitted or empty.\n\nAfter a successful logout, authentication-gated requests require the\nClient to complete an advertised authentication flow again. There is no\nguarantee about the behavior of already running sessions.", "allOf": [ { "$ref": "#/$defs/LogoutAuthRequest" } ] }, + { + "title": "AuthStatusRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nQueries the Agent's current authentication state.\n\nThis method is only available if the Agent advertises the `auth.status` capability.\nIt MUST NOT change any Agent state, and Agents MUST NOT reject it with `-32000` (Authentication required).", + "allOf": [ + { + "$ref": "#/$defs/AuthStatusRequest" + } + ] + }, { "title": "NewSessionRequest", - "description": "Creates a new conversation session with the agent.\n\nSessions represent independent conversation contexts with their own history and state.\n\nThe agent should:\n- Create a new session context\n- Connect to any specified MCP servers\n- Return a unique session ID for future requests\n\nMay return an `auth_required` error if the agent requires authentication.\n\nSee protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/v2/draft/session-setup)", + "description": "Creates a new conversation session with the Agent.\n\nSessions represent independent conversation contexts with their own history and state.\n\nThe Agent:\n- Creates a new session context\n- Connects to the specified MCP servers\n- Returns a unique session ID for future requests\n\nFails with `-32000` (Authentication required) if the Agent requires authentication.\n\nSee protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/v2/draft/session-setup)", "allOf": [ { "$ref": "#/$defs/NewSessionRequest" @@ -9040,7 +10225,7 @@ }, { "title": "ListSessionsRequest", - "description": "Lists existing sessions known to the agent.\n\nThe agent should return metadata about sessions with optional filtering and pagination support.", + "description": "Lists existing sessions known to the Agent.\n\nThe Agent returns metadata about sessions, with optional filtering and pagination.", "allOf": [ { "$ref": "#/$defs/ListSessionsRequest" @@ -9049,7 +10234,7 @@ }, { "title": "DeleteSessionRequest", - "description": "Deletes an existing session from `session/list`.\n\nThis method is only available if the agent advertises the `session.delete` capability.", + "description": "Deletes an existing session from `session/list`.\n\nThis method is only available if the Agent advertises the `session.delete` capability.", "allOf": [ { "$ref": "#/$defs/DeleteSessionRequest" @@ -9058,7 +10243,7 @@ }, { "title": "ForkSessionRequest", - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nForks an existing session to create a new independent session.\n\nThis method is only available if the agent advertises the `session.fork` capability.\n\nThe agent should create a new session with the same conversation context as the\noriginal, allowing operations like generating summaries without affecting the\noriginal session's history.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nForks an existing session to create a new independent session.\n\nThis method is only available if the Agent advertises the `session.fork` capability.\n\nThe Agent creates a new session with the same conversation context as the\noriginal. The fork can be used for operations like generating summaries without\naffecting the original session's history.\n\nAs with `session/new`, the forked session is active once the Agent responds,\nset up with the request's `cwd`, `additionalDirectories`, and `mcpServers`.\nThe Client can prompt it without calling `session/resume` first.", "allOf": [ { "$ref": "#/$defs/ForkSessionRequest" @@ -9066,71 +10251,107 @@ ] }, { - "title": "ResumeSessionRequest", - "description": "Resumes an existing session.\n\nThe agent should resume the session context, allowing the conversation\nto continue. If `replayFrom` is set, the agent should replay\nretained conversation history before responding.", + "title": "ArchiveSessionRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nArchives a session, hiding it from default `session/list` results.\n\nThis method is only available if the Agent advertises the `session.archive` capability.", "allOf": [ { - "$ref": "#/$defs/ResumeSessionRequest" + "$ref": "#/$defs/ArchiveSessionRequest" } ] }, { - "title": "CloseSessionRequest", - "description": "Closes an active session and frees up any resources associated with it.\n\nThe agent must cancel any ongoing work (as if `session/cancel` was called)\nand then free up any resources associated with the session.", + "title": "UnarchiveSessionRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnarchives a session, returning it to default `session/list` results.\n\nThis method is only available if the Agent advertises the `session.archive` capability.", "allOf": [ { - "$ref": "#/$defs/CloseSessionRequest" + "$ref": "#/$defs/UnarchiveSessionRequest" } ] }, { - "title": "SetSessionConfigOptionRequest", - "description": "Sets the current value for a session configuration option.", + "title": "SessionStatusRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nChecks whether the Agent has a session in memory, without changing it.\n\nThis method is only available if the Agent advertises the `session.status` capability.", "allOf": [ { - "$ref": "#/$defs/SetSessionConfigOptionRequest" + "$ref": "#/$defs/SessionStatusRequest" } ] }, { - "title": "PromptRequest", - "description": "Processes a user prompt within a session.\n\nAcceptance means insertion into the ACP conversation:\n- Receives user messages with optional context (files, images, etc.)\n- Returns the inserted user message's ID without waiting for processing to finish\n\nThe Agent reports the user message with the same ID through `session/update`;\nthis notification may arrive before or after the response. Processing state,\noutput, tool calls, and completion are also reported through session updates.\n\nSee protocol docs: [Prompt Lifecycle](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle)", + "title": "SessionOptionsRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nReturns the config options a session would start with, without creating or resuming a session.\n\nThis method is only available if the Agent advertises the `session.options` capability.", "allOf": [ { - "$ref": "#/$defs/PromptRequest" + "$ref": "#/$defs/SessionOptionsRequest" + } + ] + }, + { + "title": "SetSessionTitleRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSets the title of a session.\n\nThis method is only available if the Agent advertises the `session.title` capability.\n\nThe session does not need to be active on the connection. The Agent stores the\ntitle and returns the stored title, which may be normalized.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleRequest" + } + ] + }, + { + "title": "ResumeSessionRequest", + "description": "Resumes an existing session.\n\nThe Agent resumes the session context so that the conversation\ncan continue. If `replayFrom` is set, the Agent replays\nretained conversation history before responding.", + "allOf": [ + { + "$ref": "#/$defs/ResumeSessionRequest" + } + ] + }, + { + "title": "CloseSessionRequest", + "description": "Closes an active session and frees up any resources associated with it.\n\nThe Agent MUST cancel any ongoing work as if `session/cancel` was called, stop the\nsession's background work, and then free the resources associated with the session.", + "allOf": [ + { + "$ref": "#/$defs/CloseSessionRequest" } ] }, { - "title": "StartNesRequest", - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nStarts an NES session.", + "title": "CancelToolCallRequest", + "description": "Cancels one tool call without cancelling the rest of the session's work.\n\nThis method is only available while the tool call advertises `capabilities.cancel`.\nThe response means the Agent accepted the cancellation. A final `tool_call_update`\nconfirms it.", "allOf": [ { - "$ref": "#/$defs/StartNesRequest" + "$ref": "#/$defs/CancelToolCallRequest" } ] }, { - "title": "SuggestNesRequest", - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequests a code suggestion.", + "title": "CancelTerminalRequest", + "description": "Stops one terminal's process without cancelling the rest of the session's work.\n\nThis method is only available while the terminal advertises `capabilities.cancel`.\nThe response means the Agent accepted the cancellation. A `terminal_update` with\n`exitStatus` confirms it.", "allOf": [ { - "$ref": "#/$defs/SuggestNesRequest" + "$ref": "#/$defs/CancelTerminalRequest" } ] }, { - "title": "CloseNesRequest", - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCloses an active NES session and frees up any resources associated with it.\n\nThe agent must cancel any ongoing work and then free up any resources\nassociated with the NES session.", + "title": "SetSessionConfigOptionRequest", + "description": "Sets the current value for a session configuration option.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionConfigOptionRequest" + } + ] + }, + { + "title": "PromptRequest", + "description": "Processes a user prompt within a session.\n\nAcceptance means adding a logical user message with an ID and a position\nrelative to other messages in the ACP conversation, not receipt or queueing.\nThe Agent MUST return the inserted message's ID without waiting for\nprocessing to finish.\n\nThe Agent reports the user message with the same ID through `session/update`.\nThis notification can arrive before or after the response, and MUST NOT\nprecede insertion. Processing state, output, tool calls, and completion are\nalso reported through session updates.\n\nAn error response means the user message was not inserted. Once it is\ninserted, the Agent MUST NOT answer with an error, even if the work fails\nbefore the response is sent. It ends that work with the `error` stop reason.\n\nA rejected submission produces no user-message updates. Foreground state\nfollows its normal lifecycle independently of the request outcome:\n`running` may precede insertion, and rejection alone does not imply `idle`.\n\nSee protocol docs: [Prompt Lifecycle](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle)", "allOf": [ { - "$ref": "#/$defs/CloseNesRequest" + "$ref": "#/$defs/PromptRequest" } ] }, { "title": "ExtMethodRequest", - "description": "Handles extension method requests from the client.\n\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "Handles extension method requests from the Client.\n\nExtension methods are custom methods that are not part of the ACP spec.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "allOf": [ { "$ref": "#/$defs/ExtRequest" @@ -9152,11 +10373,11 @@ "x-docs-ignore": true }, "InitializeRequest": { - "description": "Request parameters for the initialize method.\n\nSent by the client to establish connection and negotiate capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)", + "description": "Request parameters for the initialize method.\n\nSent by the Client to establish connection and negotiate capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)", "type": "object", "properties": { "protocolVersion": { - "description": "The latest protocol version supported by the client.", + "description": "The latest protocol version supported by the Client.", "allOf": [ { "$ref": "#/$defs/ProtocolVersion" @@ -9172,7 +10393,7 @@ ] }, "capabilities": { - "description": "Capabilities supported by the client.", + "description": "Capabilities supported by the Client.", "x-deserialize-default-on-error": true, "default": {}, "allOf": [ @@ -9182,7 +10403,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9199,14 +10420,14 @@ "x-method": "initialize" }, "ClientCapabilities": { - "description": "Capabilities supported by the client.\n\nAdvertised during initialization to inform the agent about\navailable features and methods.\n\nSee protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#client-capabilities)", + "description": "Capabilities supported by the Client.\n\nAdvertised during initialization to inform the Agent about\navailable features and methods.\n\nSee protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#client-capabilities)", "type": "object", "properties": { "auth": { - "description": "Authentication capabilities supported by the client.\nDetermines which authentication method types the agent may include\nin its `InitializeResponse`.\n\nOptional. Omitted or `null` both mean the client does not advertise any\nauthentication-method extensions.", + "description": "Authentication capabilities supported by the Client.\nDetermines which authentication method types the Agent can include\nin its `InitializeResponse`.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise any\nauthentication-method extensions.", "anyOf": [ { - "$ref": "#/$defs/AuthCapabilities" + "$ref": "#/$defs/ClientAuthCapabilities" }, { "type": "null" @@ -9215,7 +10436,7 @@ "x-deserialize-default-on-error": true }, "elicitation": { - "description": "Elicitation capabilities supported by the client.\nDetermines which elicitation modes the agent may use.\n\nOptional. Omitted or `null` both mean the client does not advertise\nelicitation support.", + "description": "Elicitation capabilities supported by the Client.\nDetermines which elicitation modes the Agent can use.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise\nelicitation support.", "anyOf": [ { "$ref": "#/$defs/ElicitationCapabilities" @@ -9226,11 +10447,11 @@ ], "x-deserialize-default-on-error": true }, - "nes": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNES (Next Edit Suggestions) capabilities supported by the client.\n\nOptional. Omitted or `null` both mean the client does not advertise any\nNES suggestion-kind extensions.", + "session": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSession-related capabilities supported by the Client.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise any\nsession-related capabilities. This object only groups capabilities. Supplying `{}`\nadvertises nothing.", "anyOf": [ { - "$ref": "#/$defs/ClientNesCapabilities" + "$ref": "#/$defs/ClientSessionCapabilities" }, { "type": "null" @@ -9238,17 +10459,8 @@ ], "x-deserialize-default-on-error": true }, - "positionEncodings": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe position encodings supported by the client, in order of preference.", - "type": "array", - "items": { - "$ref": "#/$defs/PositionEncodingKind" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9258,227 +10470,24 @@ } } }, - "AuthCapabilities": { - "description": "Authentication capabilities supported by the client.\n\nAdvertised during initialization to inform the agent which authentication\nmethod types the client can handle. This governs opt-in types that require\nadditional client-side support.", + "ClientAuthCapabilities": { + "description": "Authentication capabilities supported by the Client.\n\nAdvertised during initialization to inform the Agent which authentication\nmethod types the Client can handle. This governs opt-in types that require\nadditional Client-side support.", "type": "object", "properties": { "terminal": { - "description": "Whether the client supports `terminal` authentication methods.\n\nOptional. Omitted or `null` both mean the client does not advertise support.\nThe client should supply `{}` only when it can reproduce the configured\nagent invocation in an interactive terminal. Supplying `{}` means the\nagent may include `terminal` entries in its authentication methods.", - "anyOf": [ - { - "$ref": "#/$defs/TerminalAuthCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "TerminalAuthCapabilities": { - "description": "Capabilities for terminal authentication methods.\n\nSupplying `{}` means the client can reproduce the configured agent\ninvocation in an interactive terminal and supports terminal authentication\nmethods.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "ElicitationCapabilities": { - "description": "Elicitation capabilities supported by the client.", - "type": "object", - "properties": { - "form": { - "description": "Whether the client supports form-based elicitation.\n\nOptional. Omitted and `null` are equivalent and mean form support is not advertised.\nSupplying `{}` explicitly advertises form support.", - "anyOf": [ - { - "$ref": "#/$defs/ElicitationFormCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "url": { - "description": "Whether the client supports URL-based elicitation.\n\nOptional. Omitted or `null` both mean the client does not advertise support.\nSupplying `{}` means the client supports URL-based elicitation.", - "anyOf": [ - { - "$ref": "#/$defs/ElicitationUrlCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "ElicitationFormCapabilities": { - "description": "Form-based elicitation capabilities.\n\nSupplying `{}` means the client supports form-based elicitation.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "ElicitationUrlCapabilities": { - "description": "URL-based elicitation capabilities.\n\nSupplying `{}` means the client supports URL-based elicitation.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "ClientNesCapabilities": { - "description": "NES capabilities advertised by the client during initialization.", - "type": "object", - "properties": { - "jump": { - "description": "Whether the client supports the `jump` suggestion kind.", - "anyOf": [ - { - "$ref": "#/$defs/NesJumpCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "rename": { - "description": "Whether the client supports the `rename` suggestion kind.", - "anyOf": [ - { - "$ref": "#/$defs/NesRenameCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "searchAndReplace": { - "description": "Whether the client supports the `searchAndReplace` suggestion kind.", + "description": "Whether the Client supports `terminal` authentication methods.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise support.\nSupplying `{}` means the Client can reproduce the configured Agent\ninvocation in an interactive terminal, and the Agent MAY include\n`terminal` entries in its authentication methods.", "anyOf": [ { - "$ref": "#/$defs/NesSearchAndReplaceCapabilities" - }, - { - "type": "null" - } - ], - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesJumpCapabilities": { - "description": "Marker for jump suggestion support.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesRenameCapabilities": { - "description": "Marker for rename suggestion support.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "NesSearchAndReplaceCapabilities": { - "description": "Marker for search and replace suggestion support.", - "type": "object", - "properties": { - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - } - }, - "LoginAuthRequest": { - "description": "Request parameters for the `auth/login` method.\n\nSpecifies which authentication method to use.\n\nAgents MUST support this method when their `initialize` response advertised\nat least one valid authentication method. Clients MUST NOT call this method\nwhen `authMethods` was omitted or empty.", - "type": "object", - "properties": { - "methodId": { - "description": "The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response.", - "allOf": [ - { - "$ref": "#/$defs/AuthMethodId" + "$ref": "#/$defs/TerminalAuthCapabilities" + }, + { + "type": "null" } - ] + ], + "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9486,19 +10495,14 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "methodId" - ], - "x-side": "agent", - "x-method": "auth/login" + } }, - "ListProvidersRequest": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/list`.", + "TerminalAuthCapabilities": { + "description": "Capabilities for terminal authentication methods.\n\nSupplying `{}` means the Client can reproduce the configured Agent\ninvocation in an interactive terminal and supports terminal authentication\nmethods.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9506,44 +10510,38 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "x-side": "agent", - "x-method": "providers/list" + } }, - "SetProviderRequest": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/set`.\n\nReplaces the full configuration for one provider ID.", + "ElicitationCapabilities": { + "description": "Elicitation capabilities supported by the Client.", "type": "object", "properties": { - "providerId": { - "description": "Provider ID to configure.", - "allOf": [ + "form": { + "description": "Whether the Client supports form-based elicitation.\n\nOptional. Omitted and `null` are equivalent and mean form support is not advertised.\nSupplying `{}` explicitly advertises form support.", + "anyOf": [ { - "$ref": "#/$defs/ProviderId" + "$ref": "#/$defs/ElicitationFormCapabilities" + }, + { + "type": "null" } - ] + ], + "x-deserialize-default-on-error": true }, - "apiType": { - "description": "Protocol type for this provider.", - "allOf": [ + "url": { + "description": "Whether the Client supports URL-based elicitation.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise support.\nSupplying `{}` means the Client supports URL-based elicitation.", + "anyOf": [ { - "$ref": "#/$defs/LlmProtocol" + "$ref": "#/$defs/ElicitationUrlCapabilities" + }, + { + "type": "null" } - ] - }, - "baseUrl": { - "description": "Base URL for requests sent through this provider.", - "type": "string", - "format": "uri" - }, - "headers": { - "description": "Full headers map for this provider.\nMay include authorization, routing, or other integration-specific headers.", - "type": "object", - "additionalProperties": { - "type": "string" - } + ], + "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9551,29 +10549,14 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "providerId", - "apiType", - "baseUrl" - ], - "x-side": "agent", - "x-method": "providers/set" + } }, - "DisableProviderRequest": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/disable`.", + "ElicitationFormCapabilities": { + "description": "Form-based elicitation capabilities.\n\nSupplying `{}` means the Client supports form-based elicitation.", "type": "object", "properties": { - "providerId": { - "description": "Provider ID to disable.", - "allOf": [ - { - "$ref": "#/$defs/ProviderId" - } - ] - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9581,19 +10564,14 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "providerId" - ], - "x-side": "agent", - "x-method": "providers/disable" + } }, - "LogoutAuthRequest": { - "description": "Request parameters for the `auth/logout` method.\n\nTerminates the current authenticated session.\n\nAgents MUST support this method when their `initialize` response advertised\nat least one valid authentication method. Clients MUST NOT call this method\nwhen `authMethods` was omitted or empty.", + "ElicitationUrlCapabilities": { + "description": "URL-based elicitation capabilities.\n\nSupplying `{}` means the Client supports URL-based elicitation.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9601,42 +10579,38 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "x-side": "agent", - "x-method": "auth/logout" + } }, - "NewSessionRequest": { - "description": "Request parameters for creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)", + "ClientSessionCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSession-related capabilities supported by the Client.\n\nThis object only groups capabilities. Unlike the Agent's `session`\ncapability, it is not a support marker, and supplying `{}` advertises\nnothing.", "type": "object", "properties": { - "cwd": { - "description": "The working directory for this session. Must be an absolute path.", - "allOf": [ + "promptSuggestions": { + "description": "Support for `prompt_suggestions_update` session updates.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise support.\nSupplying `{}` means the Client can offer prompt suggestions made of\n`text` and `resource_link` content blocks.", + "anyOf": [ { - "$ref": "#/$defs/AbsolutePath" + "$ref": "#/$defs/PromptSuggestionsCapabilities" + }, + { + "type": "null" } - ] - }, - "additionalDirectories": { - "description": "Additional workspace roots for this session. Each path must be absolute.\n\nThese expand the session's workspace scope without changing `cwd`, which\nremains the base for relative paths. When omitted or empty, no\nadditional roots are activated for the new session.", - "type": "array", - "items": { - "$ref": "#/$defs/AbsolutePath" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + ], + "x-deserialize-default-on-error": true }, - "mcpServers": { - "description": "List of MCP (Model Context Protocol) servers the agent should connect to.", - "type": "array", - "items": { - "$ref": "#/$defs/McpServer" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "commands": { + "description": "Command types the Client understands in addition to `command`.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise support\nfor any of them. This object only groups capabilities. Supplying `{}` advertises nothing.", + "anyOf": [ + { + "$ref": "#/$defs/CommandsCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9644,141 +10618,65 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "cwd" - ], - "x-side": "agent", - "x-method": "session/new" + } }, - "McpServer": { - "description": "Configuration for connecting to an MCP (Model Context Protocol) server.\n\nMCP servers provide tools and context that the agent can use when\nprocessing prompts.\n\nSee protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/v2/draft/session-setup#mcp-servers)", - "anyOf": [ - { - "description": "HTTP transport configuration\n\nOnly available when the Agent capabilities include `session.mcp.http`.", - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "http" - } - }, - "required": [ - "type" - ], - "allOf": [ + "PromptSuggestionsCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nClient support for `prompt_suggestions_update` session updates.\n\nSupplying `{}` means the Client can offer prompt suggestions made of `text`\nand `resource_link` content blocks. The Client opts in to other content\nblock types with the fields below. They have the same names as the Agent's\n`session.prompt` capability.", + "type": "object", + "properties": { + "image": { + "description": "Whether prompt suggestions may include `image` content blocks.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise support.\nSupplying `{}` means the Client can offer suggestions that include images.", + "anyOf": [ { - "$ref": "#/$defs/McpServerHttp" - } - ] - }, - { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nACP transport configuration\n\nOnly available when the Agent capabilities include `session.mcp.acp`.\nThe MCP server is provided by an ACP component and communicates over the ACP channel.", - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "acp" - } - }, - "required": [ - "type" - ], - "allOf": [ + "$ref": "#/$defs/PromptSuggestionsImageCapabilities" + }, { - "$ref": "#/$defs/McpServerAcp" - } - ] - }, - { - "description": "Stdio transport configuration\n\nOnly available when the Agent capabilities include `session.mcp.stdio`.", - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "stdio" + "type": "null" } - }, - "required": [ - "type" ], - "allOf": [ - { - "$ref": "#/$defs/McpServerStdio" - } - ] + "x-deserialize-default-on-error": true }, - { - "title": "other", - "description": "Custom or future MCP server transport configuration.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this transport should preserve the raw\npayload when storing, replaying, proxying, or forwarding session setup\ndata, and otherwise ignore it or reject the server configuration.", - "type": "object", - "properties": { - "type": { - "description": "Custom or future MCP server transport type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", - "type": "string" + "audio": { + "description": "Whether prompt suggestions may include `audio` content blocks.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise support.\nSupplying `{}` means the Client can offer suggestions that include audio.", + "anyOf": [ + { + "$ref": "#/$defs/PromptSuggestionsAudioCapabilities" + }, + { + "type": "null" } - }, - "required": [ - "type" ], - "not": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "http" - } - }, - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "stdio" - } - }, - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "acp" - } - }, - "required": [ - "type" - ] - } - ] - }, + "x-deserialize-default-on-error": true + }, + "embeddedContext": { + "description": "Whether prompt suggestions may include `resource` content blocks.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise support.\nSupplying `{}` means the Client can offer suggestions that include\nembedded resources.", + "anyOf": [ + { + "$ref": "#/$defs/PromptSuggestionsEmbeddedContextCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, "additionalProperties": true } - ] + } }, - "HttpHeader": { - "description": "An HTTP header to set when making requests to the MCP server.", + "PromptSuggestionsImageCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for image content in prompt suggestions.\n\nSupplying `{}` means the Client can offer suggestions that include images.", "type": "object", "properties": { - "name": { - "description": "The name of the HTTP header.", - "type": "string" - }, - "value": { - "description": "The value to set for the HTTP header.", - "type": "string" - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9786,34 +10684,14 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "name", - "value" - ] + } }, - "McpServerHttp": { - "description": "HTTP transport configuration for MCP.", + "PromptSuggestionsAudioCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for audio content in prompt suggestions.\n\nSupplying `{}` means the Client can offer suggestions that include audio.", "type": "object", "properties": { - "name": { - "description": "Human-readable name identifying this MCP server.", - "type": "string" - }, - "url": { - "description": "URL to the MCP server.", - "type": "string", - "format": "uri" - }, - "headers": { - "description": "HTTP headers to set when making requests to the MCP server.", - "type": "array", - "items": { - "$ref": "#/$defs/HttpHeader" - } - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9821,30 +10699,41 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "name", - "url" - ] + } }, - "McpServerAcp": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nACP transport configuration for MCP.\n\nThe MCP server is provided by an ACP component and communicates over the ACP channel\nusing `mcp/message`.", + "PromptSuggestionsEmbeddedContextCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for embedded resources in prompt suggestions.\n\nSupplying `{}` means the Client can offer suggestions that include\n`resource` content blocks.", "type": "object", "properties": { - "name": { - "description": "Human-readable name identifying this MCP server.", - "type": "string" - }, - "serverId": { - "description": "Unique identifier for this MCP server, generated by the component providing it.\n\nProviders MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible\non the same ACP connection.", - "allOf": [ + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "CommandsCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCommand types the Client understands in addition to `command`.\n\nAgents MUST NOT send a command type listed here unless the Client\nadvertised it. This object only groups capabilities. Supplying `{}`\nadvertises nothing.", + "type": "object", + "properties": { + "skill": { + "description": "Support for `skill` command entries.\n\nOptional. Omitted and `null` are equivalent and mean the Client does not advertise support.\nSupplying `{}` means the Agent MAY send `skill` entries in `availableCommands`. The\nClient invokes them with `skill` content blocks.", + "anyOf": [ { - "$ref": "#/$defs/McpServerAcpId" + "$ref": "#/$defs/CommandsSkillCapabilities" + }, + { + "type": "null" } - ] + ], + "x-deserialize-default-on-error": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9852,44 +10741,37 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - }, - "required": [ - "name", - "serverId" - ] + } }, - "McpServerStdio": { - "description": "Stdio transport configuration for MCP.", + "CommandsSkillCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nClient support for `skill` command entries.\n\nSupplying `{}` means the Agent MAY send `skill` entries in\n`availableCommands`. The Client invokes them with `skill` content blocks.", "type": "object", "properties": { - "name": { - "description": "Human-readable name identifying this MCP server.", - "type": "string" - }, - "command": { - "description": "Absolute path to the MCP server executable.", + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "LoginAuthRequest": { + "description": "Request parameters for the `auth/login` method.\n\nSpecifies which authentication method to use.\n\nAgents MUST support this method when their `initialize` response included\na non-empty `authMethods` list. Clients MUST NOT call this method\nwhen `authMethods` was omitted or empty.", + "type": "object", + "properties": { + "methodId": { + "description": "The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response.", "allOf": [ { - "$ref": "#/$defs/AbsolutePath" + "$ref": "#/$defs/AuthMethodId" } ] }, - "args": { - "description": "Command-line arguments to pass to the MCP server.", - "type": "array", - "items": { - "type": "string" - } - }, - "env": { - "description": "Environment variables to set when launching the MCP server.", - "type": "array", - "items": { - "$ref": "#/$defs/EnvVariable" - } - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9899,38 +10781,62 @@ } }, "required": [ - "name", - "command" - ] + "methodId" + ], + "x-side": "agent", + "x-method": "auth/login" }, - "ListSessionsRequest": { - "description": "Request parameters for listing existing sessions.", + "ListProvidersRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/list`.", "type": "object", "properties": { - "cwd": { - "description": "Filter sessions by working directory. Must be an absolute path.", - "anyOf": [ - { - "$ref": "#/$defs/AbsolutePath" - }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "providers/list" + }, + "SetProviderRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/set`.\n\nReplaces the full configuration for one provider ID.", + "type": "object", + "properties": { + "providerId": { + "description": "Provider ID to configure.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/ProviderId" } ] }, - "cursor": { - "description": "Opaque cursor token from a previous response's nextCursor field for cursor-based pagination", - "anyOf": [ - { - "$ref": "#/$defs/SessionListCursor" - }, + "apiType": { + "description": "Protocol type for this provider.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/LlmProtocol" } ] }, + "baseUrl": { + "description": "Base URL for requests sent through this provider.", + "type": "string", + "format": "uri" + }, + "headers": { + "description": "Full headers map for this provider.\nMay include authorization, routing, or other integration-specific headers.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9939,23 +10845,28 @@ "additionalProperties": true } }, + "required": [ + "providerId", + "apiType", + "baseUrl" + ], "x-side": "agent", - "x-method": "session/list" + "x-method": "providers/set" }, - "DeleteSessionRequest": { - "description": "Request parameters for deleting an existing session from `session/list`.\n\nOnly available if the Agent supports the `session.delete` capability.", + "DisableProviderRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/disable`.", "type": "object", "properties": { - "sessionId": { - "description": "The ID of the session to delete.", + "providerId": { + "description": "Provider ID to disable.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/ProviderId" } ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -9965,51 +10876,34 @@ } }, "required": [ - "sessionId" + "providerId" ], "x-side": "agent", - "x-method": "session/delete" + "x-method": "providers/disable" }, - "ForkSessionRequest": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for forking an existing session.\n\nCreates a new session based on the context of an existing one, allowing\noperations like generating summaries without affecting the original session's history.\n\nOnly available if the Agent supports the `session.fork` capability.", + "LogoutAuthRequest": { + "description": "Request parameters for the `auth/logout` method.\n\nTerminates the current authenticated session.\n\nAgents MUST support this method when their `initialize` response included\na non-empty `authMethods` list. Clients MUST NOT call this method\nwhen `authMethods` was omitted or empty.", "type": "object", "properties": { - "sessionId": { - "description": "The ID of the session to fork.", - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ] - }, - "cwd": { - "description": "The working directory for this session. Must be an absolute path.", - "allOf": [ - { - "$ref": "#/$defs/AbsolutePath" - } - ] - }, - "additionalDirectories": { - "description": "Additional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the forked\nsession.", - "type": "array", - "items": { - "$ref": "#/$defs/AbsolutePath" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, - "mcpServers": { - "description": "List of MCP servers to connect to for this session.", - "type": "array", - "items": { - "$ref": "#/$defs/McpServer" - }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "auth/logout" + }, + "AuthStatusRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for the `auth/status` method.\n\nQueries the Agent's current authentication state without changing it.\n\nAgents MUST NOT reject it with `-32000` (Authentication required), since Clients call it to learn\nwhether authentication is required.", + "type": "object", + "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10018,25 +10912,13 @@ "additionalProperties": true } }, - "required": [ - "sessionId", - "cwd" - ], "x-side": "agent", - "x-method": "session/fork" + "x-method": "auth/status" }, - "ResumeSessionRequest": { - "description": "Request parameters for resuming an existing session.\n\nResumes an existing session and optionally replays retained conversation\nhistory according to `replayFrom`.", + "NewSessionRequest": { + "description": "Request parameters for creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)", "type": "object", "properties": { - "sessionId": { - "description": "The ID of the session to resume.", - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ] - }, "cwd": { "description": "The working directory for this session. Must be an absolute path.", "allOf": [ @@ -10046,37 +10928,42 @@ ] }, "additionalDirectories": { - "description": "Additional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the resumed\nsession. It may differ from any previously used or reported list as long as\nthe request `cwd` matches the session's `cwd`.", + "description": "Additional workspace roots for this session. Each path MUST be absolute.\n\nThese expand the session's workspace scope without changing `cwd`, which\nremains the base for relative paths. When omitted or empty, no\nadditional roots are activated for the new session.", "type": "array", "items": { "$ref": "#/$defs/AbsolutePath" }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "x-deserialize-default-on-null": true }, "mcpServers": { - "description": "List of MCP servers to connect to for this session.", + "description": "List of MCP (Model Context Protocol) servers for the Agent to connect to.", "type": "array", "items": { "$ref": "#/$defs/McpServer" }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "x-deserialize-default-on-null": true }, - "replayFrom": { - "description": "Inclusive cursor describing where conversation replay should begin.\n\nOptional. Omitted or `null` both mean the Agent should resume without\nreplaying previous conversation history. Replay cursors are inclusive:\nreplay includes the position identified by the cursor. Supplying\n`{ \"type\": \"start\" }` means the Agent should replay all retained\nconversation history before responding.", + "systemPrompt": { + "description": "System-level instructions for the new session.\n\nOptional. Omitted and `null` are equivalent and mean the Agent uses its\nown default instructions. Clients MUST only send this when the Agent\nadvertises `session.systemPrompt`.", "anyOf": [ { - "$ref": "#/$defs/ReplayFrom" + "$ref": "#/$defs/SystemPrompt" }, { "type": "null" } - ], - "x-deserialize-default-on-error": true + ] + }, + "configOptions": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial values for the session's config options.\n\nOptional. Omitted and `null` are equivalent to an empty list. Clients MUST only send\nthis when the Agent advertises `session.options`.\n\nThe Agent applies the entries in list order, as if the Client had called\n`session/set_config_option` for each entry after the session was set up. Malformed\nentries and duplicate `configId` values fail the request with `-32602`. The Agent MUST\nignore an entry whose `configId` is unknown, whose `type` does not match the option,\nor whose value is not allowed when it is applied. The `configOptions` in the response contain the values the session actually\nhas. The Agent SHOULD NOT send `config_option_update` notifications for these entries,\nand SHOULD NOT send other `session/update` notifications caused by applying them\nbefore it responds.", + "type": "array", + "items": { + "$ref": "#/$defs/InitialSessionConfigOption" + }, + "x-deserialize-default-on-null": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10086,22 +10973,21 @@ } }, "required": [ - "sessionId", "cwd" ], "x-side": "agent", - "x-method": "session/resume" + "x-method": "session/new" }, - "ReplayFrom": { - "description": "Inclusive cursor describing where replayed session history should begin.\n\nReplay includes the position identified by the cursor.", + "McpServer": { + "description": "Configuration for connecting to an MCP (Model Context Protocol) server.\n\nMCP servers provide tools and context that the Agent can use when\nprocessing prompts.\n\nSee protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/v2/draft/session-setup#mcp-servers)", "anyOf": [ { - "description": "Replay all retained conversation history from its first replayable entry.", + "description": "HTTP transport configuration\n\nOnly available when the Agent capabilities include `session.mcp.http`.", "type": "object", "properties": { "type": { "type": "string", - "const": "start" + "const": "http" } }, "required": [ @@ -10109,27 +10995,54 @@ ], "allOf": [ { - "$ref": "#/$defs/ReplayFromStart" + "$ref": "#/$defs/McpServerHttp" + } + ] + }, + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nACP transport configuration\n\nOnly available when the Agent capabilities include `session.mcp.acp`.\nThe MCP server is provided by an ACP component and communicates over the ACP channel.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "acp" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/McpServerAcp" + } + ] + }, + { + "description": "Stdio transport configuration\n\nOnly available when the Agent capabilities include `session.mcp.stdio`.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "stdio" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/McpServerStdio" } ] }, { "title": "other", - "description": "Custom or future replay cursor.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this cursor should preserve the raw\npayload when storing, replaying, proxying, or forwarding requests, and\notherwise reject the request rather than guessing where to replay from.", + "description": "Custom or future MCP server transport configuration.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nReceivers that do not understand this transport SHOULD preserve the raw\npayload when storing, replaying, proxying, or forwarding session setup\ndata. Agents MUST reject a request with a transport they do not support\nwith `-32602`.", "type": "object", "properties": { "type": { - "description": "Custom or future replay cursor type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "description": "Custom or future MCP server transport type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", "type": "string" - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true } }, "required": [ @@ -10142,7 +11055,31 @@ "properties": { "type": { "type": "string", - "const": "start" + "const": "http" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "stdio" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "acp" } }, "required": [ @@ -10155,12 +11092,20 @@ } ] }, - "ReplayFromStart": { - "description": "Inclusive replay cursor requesting replay from the start of retained conversation history.", + "HttpHeader": { + "description": "An HTTP header to set when making requests to the MCP server.", "type": "object", "properties": { + "name": { + "description": "The name of the HTTP header.", + "type": "string" + }, + "value": { + "description": "The value to set for the HTTP header.", + "type": "string" + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10168,22 +11113,66 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - } + }, + "required": [ + "name", + "value" + ] }, - "CloseSessionRequest": { - "description": "Request parameters for closing an active session.\n\nThe agent **must** cancel any ongoing work related to the session (treat it\nas if `session/cancel` was called) and then free up any resources associated\nwith the session.", + "McpServerHttp": { + "description": "HTTP transport configuration for MCP.", "type": "object", "properties": { - "sessionId": { - "description": "The ID of the session to close.", + "name": { + "description": "Human-readable name identifying this MCP server. MUST be unique within `mcpServers`.\n\nAgents reject a request with a duplicate `name` with `-32602`.", + "type": "string" + }, + "url": { + "description": "URL to the MCP server.", + "type": "string", + "format": "uri" + }, + "headers": { + "description": "HTTP headers to set when making requests to the MCP server. Headers the MCP transport\ndefines are owned by the transport, and Agents use the transport's values for them.", + "type": "array", + "items": { + "$ref": "#/$defs/HttpHeader" + }, + "x-deserialize-default-on-null": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "name", + "url" + ] + }, + "McpServerAcp": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nACP transport configuration for MCP.\n\nThe MCP server is provided by an ACP component and communicates over the ACP channel\nusing `mcp/message`.", + "type": "object", + "properties": { + "name": { + "description": "Human-readable name identifying this MCP server. MUST be unique within `mcpServers`.\n\nAgents reject a request with a duplicate `name` with `-32602`.", + "type": "string" + }, + "serverId": { + "description": "Unique identifier for this MCP server, generated by the component providing it.\n\nProviders MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible\non the same ACP connection.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/McpServerAcpId" } ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10193,23 +11182,116 @@ } }, "required": [ - "sessionId" - ], - "x-side": "agent", - "x-method": "session/close" + "name", + "serverId" + ] + }, + "McpServerStdio": { + "description": "Stdio transport configuration for MCP.", + "type": "object", + "properties": { + "name": { + "description": "Human-readable name identifying this MCP server. MUST be unique within `mcpServers`.\n\nAgents reject a request with a duplicate `name` with `-32602`.", + "type": "string" + }, + "command": { + "description": "Path to the MCP server executable. Must be an absolute path.\n\nAgents reject a request with a relative `command` with `-32602`.", + "allOf": [ + { + "$ref": "#/$defs/AbsolutePath" + } + ] + }, + "args": { + "description": "Command-line arguments to pass to the MCP server.", + "type": "array", + "items": { + "type": "string" + }, + "x-deserialize-default-on-null": true + }, + "env": { + "description": "Environment variables to set when launching the MCP server. Names SHOULD be unique.\nAgents MAY reject duplicates with `-32602`, and otherwise the last entry wins.", + "type": "array", + "items": { + "$ref": "#/$defs/EnvVariable" + }, + "x-deserialize-default-on-null": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "name", + "command" + ] + }, + "SystemPrompt": { + "description": "Client-provided system-level instructions for a session.\n\nClients MUST only send this when the Agent advertises\n`session.systemPrompt`. Agents that cannot apply it, for example because of\nan unadvertised mode or an unsupported content block type, MUST return an\nerror instead of creating or resuming the session.", + "type": "object", + "properties": { + "mode": { + "description": "How the Agent combines `content` with its own instructions.\n\nRequired. Agents MUST return an error for a mode they do not support rather than\ntreating it as `append` or `override`.", + "allOf": [ + { + "$ref": "#/$defs/SystemPromptMode" + } + ] + }, + "content": { + "description": "The system prompt content.\n\nAgents advertising the capability MUST accept `text` content blocks.\nClients MUST NOT send other content block types until a future\ncapability allows them, and Agents MUST return an error for content\nblocks they do not support, including unknown types.\n\nClients MUST NOT send an empty array. Agents MAY reject one with\n`-32602` without creating or resuming the session.", + "type": "array", + "items": { + "$ref": "#/$defs/ContentBlock" + }, + "minItems": 1 + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "mode", + "content" + ] + }, + "SystemPromptMode": { + "description": "How the Agent combines a Client-provided system prompt with its own instructions.\n\nUnknown modes are preserved so they can be stored,\nproxied, or forwarded. An Agent MUST return an error for a mode it does not\nsupport rather than treating it as `append` or `override`.", + "anyOf": [ + { + "description": "Add the content to the Agent's own instructions rather than replacing them.\n\nEvery Agent that advertises `session.systemPrompt` supports this mode.\nAgents SHOULD give the content system-level precedence, for example in the\nmodel's system prompt or developer instructions rather than in user-turn\ncontent. Where it is placed and how it is formatted is implementation-defined.", + "type": "string", + "const": "append" + }, + { + "description": "Replace the Agent's built-in default instructions with the content.\n\nThis does not change tool availability, MCP servers, permissions, or session\nconfiguration. Context the Agent supplies from the workspace or environment\nMAY still be included. Clients that use this mode take responsibility for any\ntool guidance or safety instructions the Agent's default instructions\nprovided, and MUST only use it when the Agent advertises\n`session.systemPrompt.mode.override`.", + "type": "string", + "const": "override" + }, + { + "title": "other", + "description": "Custom or future system prompt mode.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" + } + ] }, - "SetSessionConfigOptionRequest": { - "description": "Request parameters for setting a session configuration option.", + "InitialSessionConfigOption": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAn initial value for a config option, sent on session setup requests.\n\nSame shape as `session/set_config_option` without `sessionId`. Unlike\n`session/set_config_option`, an unknown `configId`, a `type` that does not match the\noption, or a value that is not allowed is ignored instead of rejected.", "type": "object", "properties": { - "sessionId": { - "description": "The ID of the session to set the configuration option for.", - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ] - }, "configId": { "description": "The ID of the configuration option to set.", "allOf": [ @@ -10219,7 +11301,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10229,14 +11311,17 @@ } }, "required": [ - "sessionId", "configId" ], "anyOf": [ { - "description": "A [`SessionConfigValueId`] string value (`type: \"id\"`).", + "description": "A `SessionConfigValueId` string value (`type: \"id\"`).", "type": "object", "properties": { + "type": { + "type": "string", + "const": "id" + }, "value": { "description": "The value ID.", "allOf": [ @@ -10244,10 +11329,6 @@ "$ref": "#/$defs/SessionConfigValueId" } ] - }, - "type": { - "type": "string", - "const": "id" } }, "required": [ @@ -10259,13 +11340,13 @@ "description": "A boolean value (`type: \"boolean\"`).", "type": "object", "properties": { - "value": { - "description": "The boolean value.", - "type": "boolean" - }, "type": { "type": "string", "const": "boolean" + }, + "value": { + "description": "The boolean value.", + "type": "boolean" } }, "required": [ @@ -10275,7 +11356,7 @@ }, { "title": "other", - "description": "Custom or future session configuration option value payload.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "description": "Custom or future session configuration option value payload.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nAgents MUST reject a `session/set_config_option` request with a value type\nthey do not support with `-32602`.", "type": "object", "properties": { "type": { @@ -10320,83 +11401,47 @@ }, "additionalProperties": true } - ], - "x-side": "agent", - "x-method": "session/set_config_option" + ] }, - "PromptRequest": { - "description": "Request parameters for sending a user prompt to the agent.\n\nContains the user's message and any additional context.\n\nSee protocol docs: [User Message](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#1-user-message)", + "ListSessionsRequest": { + "description": "Request parameters for listing existing sessions.", "type": "object", "properties": { - "sessionId": { - "description": "The ID of the session to send this user message to", - "allOf": [ + "cwd": { + "description": "Filter sessions by working directory. Must be an absolute path.\n\nOnly sessions whose `cwd` is this same directory match. Subdirectories and\n`additionalDirectories` don't. Agents MAY normalize paths when comparing.\n\nOmitted and `null` are equivalent and mean sessions are not filtered by working directory.\nClients keep the same value when following `nextCursor`.", + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/AbsolutePath" + }, + { + "type": "null" } ] }, - "prompt": { - "description": "The blocks of content that compose the user's message.\n\nAs a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`],\nwhile other variants are optionally enabled via [`PromptCapabilities`].\n\nThe Client MUST adapt its interface according to [`PromptCapabilities`].\n\nThe client MAY include referenced pieces of context as either\n[`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`].\n\nWhen available, [`ContentBlock::Resource`] is preferred\nas it avoids extra round-trips and allows the message to include\npieces of context from sources the agent may not have access to.", - "type": "array", - "items": { - "$ref": "#/$defs/ContentBlock" - } - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "sessionId", - "prompt" - ], - "x-side": "agent", - "x-method": "session/prompt" - }, - "StartNesRequest": { - "description": "Request to start an NES session.", - "type": "object", - "properties": { - "workspaceUri": { - "description": "The root URI of the workspace.", - "type": [ - "string", - "null" - ], - "format": "uri", - "x-deserialize-default-on-error": true - }, - "workspaceFolders": { - "description": "The workspace folders.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/$defs/WorkspaceFolder" - } + "cursor": { + "description": "Opaque cursor token from a previous response's nextCursor field for cursor-based pagination\n\nOmitted and `null` are equivalent and mean the first page is requested.", + "anyOf": [ + { + "$ref": "#/$defs/SessionListCursor" + }, + { + "type": "null" + } + ] }, - "repository": { - "description": "Repository metadata, if the workspace is a git repository.", + "archived": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nFilter sessions by archive state.\n\nOptional. Omitted and `null` are equivalent and mean `exclude`. Only send this when\nthe Agent advertises the `session.archive` capability. The filter combines with `cwd` and\napplies before pagination. Clients keep the same value when following `nextCursor`.", "anyOf": [ { - "$ref": "#/$defs/NesRepository" + "$ref": "#/$defs/SessionArchiveFilter" }, { "type": "null" } - ], - "x-deserialize-default-on-error": true + ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10406,54 +11451,47 @@ } }, "x-side": "agent", - "x-method": "nes/start" + "x-method": "session/list" }, - "WorkspaceFolder": { - "description": "A workspace folder.", - "type": "object", - "properties": { - "uri": { - "description": "The URI of the folder.", + "SessionArchiveFilter": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhich sessions `session/list` returns based on their archive state.\n\nUnknown values are preserved so they can be stored, proxied, or forwarded. An Agent MUST\nreturn `-32602` for a value it does not support rather than treating it as `exclude`.", + "anyOf": [ + { + "description": "Only sessions that are not archived. This is the default.", "type": "string", - "format": "uri" + "const": "exclude" }, - "name": { - "description": "The display name of the folder.", - "type": "string" + { + "description": "Both archived sessions and sessions that are not archived.", + "type": "string", + "const": "include" }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true + { + "description": "Only archived sessions.", + "type": "string", + "const": "only" + }, + { + "title": "other", + "description": "Custom or future archive filter.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" } - }, - "required": [ - "uri", - "name" ] }, - "NesRepository": { - "description": "Repository metadata for an NES session.", + "DeleteSessionRequest": { + "description": "Request parameters for deleting an existing session from `session/list`.\n\nOnly available if the Agent supports the `session.delete` capability.", "type": "object", "properties": { - "name": { - "description": "The repository name.", - "type": "string" - }, - "owner": { - "description": "The repository owner.", - "type": "string" - }, - "remoteUrl": { - "description": "The remote URL of the repository.", - "type": "string" + "sessionId": { + "description": "The ID of the session to delete.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10463,73 +11501,79 @@ } }, "required": [ - "name", - "owner", - "remoteUrl" - ] + "sessionId" + ], + "x-side": "agent", + "x-method": "session/delete" }, - "SuggestNesRequest": { - "description": "Request for a code suggestion.", + "ForkSessionRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for forking an existing session.\n\nCreates a new session based on the context of an existing one. The fork can be used\nfor operations like generating summaries without affecting the original session's history.\n\nOnly available if the Agent supports the `session.fork` capability.", "type": "object", "properties": { "sessionId": { - "description": "The session ID for this request.", + "description": "The ID of the session to fork.", "allOf": [ { "$ref": "#/$defs/SessionId" } ] }, - "uri": { - "description": "The URI of the document to suggest for.", - "type": "string", - "format": "uri" - }, - "version": { - "description": "The version number of the document.", - "type": "integer", - "format": "int64" - }, - "position": { - "description": "The current cursor position.", - "allOf": [ - { - "$ref": "#/$defs/Position" - } - ] - }, - "selection": { - "description": "The current text selection range, if any.", + "cursorId": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe session cursor to fork at. The new session's history is the source\nsession's history before the cursor.\n\nOptional. Omitted and `null` are equivalent and fork the whole session.\nClients MUST only send the ID of a cursor that the Agent announced on the\nsource session and that currently advertises `capabilities.fork`. The Agent\nrejects any other ID with `-32602`. It does not fall back to forking the\nwhole session.", "anyOf": [ { - "$ref": "#/$defs/Range" + "$ref": "#/$defs/CursorId" }, { "type": "null" } ] }, - "triggerKind": { - "description": "What triggered this suggestion request.", + "cwd": { + "description": "The working directory for this session. Must be an absolute path.", "allOf": [ { - "$ref": "#/$defs/NesTriggerKind" + "$ref": "#/$defs/AbsolutePath" } ] }, - "context": { - "description": "Context for the suggestion, included based on agent capabilities.", + "additionalDirectories": { + "description": "Additional workspace roots to activate for this session. Each path MUST be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the forked\nsession.", + "type": "array", + "items": { + "$ref": "#/$defs/AbsolutePath" + }, + "x-deserialize-default-on-null": true + }, + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "type": "array", + "items": { + "$ref": "#/$defs/McpServer" + }, + "x-deserialize-default-on-null": true + }, + "systemPrompt": { + "description": "System-level instructions for the forked session.\n\nOptional. Omitted and `null` are equivalent. The Agent MAY then keep a\nsystem prompt it stored with the source session or use its default\ninstructions. Clients MUST only send this when the Agent advertises\n`session.systemPrompt`, and SHOULD send the same value they used for the\nsource session.", "anyOf": [ { - "$ref": "#/$defs/NesSuggestContext" + "$ref": "#/$defs/SystemPrompt" }, { "type": "null" } ] }, + "configOptions": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial values for the forked session's config options.\n\nOptional. Omitted and `null` are equivalent to an empty list. Clients MUST only send\nthis when the Agent advertises `session.options`.\n\nThe Agent applies the entries in list order on top of the configuration the fork\nstarts with, as if the Client had called `session/set_config_option` for each entry\nafter the session was set up. Malformed entries and duplicate `configId` values fail\nthe request with `-32602`. The Agent MUST ignore an entry whose `configId` is unknown,\nwhose `type` does not match the option, or whose value is not allowed when it is\napplied. The `configOptions` in the response contain the values the session actually\nhas. The Agent SHOULD NOT send `config_option_update` notifications for these entries,\nand SHOULD NOT send other `session/update` notifications caused by applying them\nbefore it responds.", + "type": "array", + "items": { + "$ref": "#/$defs/InitialSessionConfigOption" + }, + "x-deserialize-default-on-null": true + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10540,105 +11584,53 @@ }, "required": [ "sessionId", - "uri", - "version", - "position", - "triggerKind" + "cwd" ], "x-side": "agent", - "x-method": "nes/suggest" - }, - "NesTriggerKind": { - "description": "What triggered the suggestion request.", - "anyOf": [ - { - "description": "Triggered by user typing or cursor movement.", - "type": "string", - "const": "automatic" - }, - { - "description": "Triggered by a diagnostic appearing at or near the cursor.", - "type": "string", - "const": "diagnostic" - }, - { - "description": "Triggered by an explicit user action (keyboard shortcut).", - "type": "string", - "const": "manual" - }, - { - "title": "Other", - "description": "Custom or future suggestion trigger kind.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", - "type": "string" - } - ] + "x-method": "session/fork" }, - "NesSuggestContext": { - "description": "Context attached to a suggestion request.", + "ArchiveSessionRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for archiving a session.\n\nOnly available if the Agent supports the `session.archive` capability.\n\nArchiving hides the session from default `session/list` results. It keeps the session ID\nand saved history. If the session is active, the Agent MUST cancel any ongoing work and\nfree the session's resources as if `session/close` had been called, then archive it.\nArchiving an archived session succeeds. A session that does not exist gets `-32002`.", "type": "object", "properties": { - "recentFiles": { - "description": "Recently accessed files.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/$defs/NesRecentFile" - } - }, - "relatedSnippets": { - "description": "Related code snippets.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/$defs/NesRelatedSnippet" - } - }, - "editHistory": { - "description": "Recent edit history.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/$defs/NesEditHistoryEntry" - } - }, - "userActions": { - "description": "Recent user actions (typing, navigation, etc.).", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/$defs/NesUserAction" - } - }, - "openFiles": { - "description": "Currently open files in the editor.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/$defs/NesOpenFile" - } + "sessionId": { + "description": "The ID of the session to archive.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, - "diagnostics": { - "description": "Current diagnostics (errors, warnings).", + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ - "array", + "object", "null" ], - "items": { - "$ref": "#/$defs/NesDiagnostic" - } + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "sessionId" + ], + "x-side": "agent", + "x-method": "session/archive" + }, + "UnarchiveSessionRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for unarchiving a session.\n\nOnly available if the Agent supports the `session.archive` capability.\n\nUnarchiving returns the session to default `session/list` results with the same ID and\nsaved history. It never resumes the session. Clients that want to continue an\narchived session SHOULD unarchive it before calling `session/resume`.\nUnarchiving a session that is not archived succeeds. A session that does not exist\ngets `-32002`.", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session to unarchive.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10646,27 +11638,27 @@ "x-deserialize-default-on-error": true, "additionalProperties": true } - } + }, + "required": [ + "sessionId" + ], + "x-side": "agent", + "x-method": "session/unarchive" }, - "NesRecentFile": { - "description": "A recently accessed file.", + "SessionStatusRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for checking the status of a session.\n\nOnly available if the Agent supports the `session.status` capability.\n\n`session/status` MUST NOT have side effects. The Agent does not resume, create,\nclose, or change the session, and does not attach the requesting connection to it.\nA session the Agent does not know gets `-32002` with the requested `sessionId` in `data`.", "type": "object", "properties": { - "uri": { - "description": "The URI of the file.", - "type": "string", - "format": "uri" - }, - "languageId": { - "description": "The language identifier.", - "type": "string" - }, - "text": { - "description": "The full text content of the file.", - "type": "string" + "sessionId": { + "description": "The ID of the session to check.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10676,29 +11668,44 @@ } }, "required": [ - "uri", - "languageId", - "text" - ] + "sessionId" + ], + "x-side": "agent", + "x-method": "session/status" }, - "NesRelatedSnippet": { - "description": "A related code snippet from a file.", + "SessionOptionsRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `session/options`, which returns the config options a session\nwould start with, without creating or resuming a session.\n\nOnly available if the Agent supports the `session.options` capability.\n\n`session/options` MUST NOT create or resume a session, send `session/update`\nnotifications, add an entry to `session/list`, or change an existing session. Agents\nSHOULD NOT connect to MCP servers to answer it. Agents MAY start their runtime to resolve\nthe options. The rules above still hold for it.", "type": "object", "properties": { - "uri": { - "description": "The URI of the file containing the snippets.", - "type": "string", - "format": "uri" + "cwd": { + "description": "The working directory to resolve options for. Must be an absolute path.", + "allOf": [ + { + "$ref": "#/$defs/AbsolutePath" + } + ] }, - "excerpts": { - "description": "The code excerpts.", + "additionalDirectories": { + "description": "Additional workspace roots to resolve options for. Each path MUST be absolute.\n\nOptional. Omitted and `null` are equivalent to an empty list.", "type": "array", "items": { - "$ref": "#/$defs/NesExcerpt" - } + "$ref": "#/$defs/AbsolutePath" + }, + "x-deserialize-default-on-null": true + }, + "sessionId": { + "description": "The session to resolve options for.\n\nOptional. Omitted and `null` are equivalent and mean a new session. When present,\nthe Agent returns what `session/resume` with the same `cwd` and\n`additionalDirectories` would return, with the same `cwd` rules. A session the\nAgent does not know gets `-32002`.", + "anyOf": [ + { + "$ref": "#/$defs/SessionId" + }, + { + "type": "null" + } + ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10708,32 +11715,29 @@ } }, "required": [ - "uri", - "excerpts" - ] + "cwd" + ], + "x-side": "agent", + "x-method": "session/options" }, - "NesExcerpt": { - "description": "A code excerpt from a file.", + "SetSessionTitleRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for setting the title of a session.\n\nOnly available if the Agent supports the `session.title` capability.\n\nThe session does not need to be active on the connection. Any session the Agent would\nreturn from `session/list` can be retitled. A session that does not exist gets `-32002`.\n\nThe Agent responds only after it has stored the title. After a successful response, the\nAgent SHOULD NOT replace the title with one it generates automatically.", "type": "object", "properties": { - "startLine": { - "description": "The start line of the excerpt (zero-based).", - "type": "integer", - "format": "uint32", - "minimum": 0 - }, - "endLine": { - "description": "The end line of the excerpt (zero-based).", - "type": "integer", - "format": "uint32", - "minimum": 0 + "sessionId": { + "description": "The ID of the session to retitle.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, - "text": { - "description": "The text content of the excerpt.", + "title": { + "description": "The new plain-text title for the session.\n\nRequired and non-null. Omission and explicit `null` are both invalid. The Agent MAY\nnormalize the title before storing it, for example by trimming whitespace or\ntruncating it. The Agent rejects a title that fails its validation, including one\nthat is empty after normalization, with `-32602`.", "type": "string" }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10743,26 +11747,80 @@ } }, "required": [ - "startLine", - "endLine", - "text" - ] + "sessionId", + "title" + ], + "x-side": "agent", + "x-method": "session/set_title" }, - "NesEditHistoryEntry": { - "description": "An entry in the edit history.", + "ResumeSessionRequest": { + "description": "Request parameters for resuming an existing session.\n\nResumes an existing session and optionally replays retained conversation\nhistory according to `replayFrom`.", "type": "object", "properties": { - "uri": { - "description": "The URI of the edited file.", - "type": "string", - "format": "uri" + "sessionId": { + "description": "The ID of the session to resume.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, - "diff": { - "description": "A diff representing the edit.", - "type": "string" + "cwd": { + "description": "The working directory for this session. Must be an absolute path.\n\nClients MUST send the session's working directory. Agents MAY reject a different directory\nwith `-32602`, and MAY normalize paths when comparing.", + "allOf": [ + { + "$ref": "#/$defs/AbsolutePath" + } + ] + }, + "additionalDirectories": { + "description": "Additional workspace roots to activate for this session. Each path MUST be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the resumed\nsession. It MAY differ from any previously used or reported list as long as\nthe request `cwd` matches the session's `cwd`.", + "type": "array", + "items": { + "$ref": "#/$defs/AbsolutePath" + }, + "x-deserialize-default-on-null": true + }, + "mcpServers": { + "description": "List of MCP servers to connect to for this session.\n\nThe complete set of Client-provided servers. Omitted and `[]` mean none. Agents SHOULD\nNOT restore servers from earlier requests.", + "type": "array", + "items": { + "$ref": "#/$defs/McpServer" + }, + "x-deserialize-default-on-null": true + }, + "replayFrom": { + "description": "Inclusive cursor describing where conversation replay begins.\n\nOptional. Omitted and `null` are equivalent, and the Agent MUST NOT replay\nprevious conversation history. Replay cursors are inclusive:\nreplay includes the position identified by the cursor. Supplying\n`{ \"type\": \"start\" }` means the Agent MUST replay all retained\nconversation history before responding.\n\nAgents MUST reject unsupported cursor types or malformed cursor values\nwith `-32602` (Invalid params), rather than substituting another cursor\nor resuming without replay.", + "anyOf": [ + { + "$ref": "#/$defs/ReplayFrom" + }, + { + "type": "null" + } + ] + }, + "systemPrompt": { + "description": "System-level instructions for the resumed session.\n\nOptional. Omitted and `null` are equivalent. The Agent MAY then keep a\nsystem prompt it stored with the session or use its default instructions.\nClients MUST only send this when the Agent advertises\n`session.systemPrompt`, and SHOULD send the same value they used when the\nsession was created.", + "anyOf": [ + { + "$ref": "#/$defs/SystemPrompt" + }, + { + "type": "null" + } + ] + }, + "configOptions": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial values for the session's config options.\n\nOptional. Omitted and `null` are equivalent to an empty list. Clients MUST only send\nthis when the Agent advertises `session.options`.\n\nThe Agent applies the entries in list order, as if the Client had called\n`session/set_config_option` for each entry after the session was set up. Malformed\nentries and duplicate `configId` values fail the request with `-32602`. The Agent MUST\nignore an entry whose `configId` is unknown, whose `type` does not match the option,\nor whose value is not allowed when it is applied. The `configOptions` in the response contain the values the session actually\nhas. The Agent SHOULD NOT send `config_option_update` notifications for these entries\non the requesting connection. If the session is active on other connections, the\nAgent SHOULD send `config_option_update` on those connections.\n\nThe Agent applies the entries before it replays history for `replayFrom` and before\nit responds.", + "type": "array", + "items": { + "$ref": "#/$defs/InitialSessionConfigOption" + }, + "x-deserialize-default-on-null": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10772,39 +11830,95 @@ } }, "required": [ - "uri", - "diff" + "sessionId", + "cwd" + ], + "x-side": "agent", + "x-method": "session/resume" + }, + "ReplayFrom": { + "description": "Inclusive cursor describing where replayed session history begins.\n\nReplay includes the position identified by the cursor.", + "anyOf": [ + { + "description": "Replay all retained conversation history from its first replayable entry.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "start" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/ReplayFromStart" + } + ] + }, + { + "title": "other", + "description": "Custom or future replay cursor.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nIntermediaries SHOULD preserve the raw payload when storing, replaying,\nproxying, or forwarding requests. Agents that do not support this cursor\nMUST reject the request with `-32602` (Invalid params), rather than\nsubstituting another cursor or resuming without replay.", + "type": "object", + "properties": { + "type": { + "description": "Custom or future replay cursor type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" + } + }, + "required": [ + "type" + ], + "not": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "start" + } + }, + "required": [ + "type" + ] + } + ] + }, + "additionalProperties": true + } ] }, - "NesUserAction": { - "description": "A user action (typing, cursor movement, etc.).", + "ReplayFromStart": { + "description": "Inclusive replay cursor requesting replay from the start of retained conversation history.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, + "CloseSessionRequest": { + "description": "Request parameters for closing an active session.\n\nThe Agent MUST cancel any ongoing work related to the session as if `session/cancel`\nwas called, then free the resources associated with the session. Unlike `session/cancel`,\nclosing also stops the session's background work. After the close response, the Agent\nsends no notifications or requests for the session on that connection. It still\nanswers `session/prompt` requests that were pending.\n\nClosing a session that does not exist or is not active SHOULD succeed, and Clients SHOULD\ntreat a `-32002` response as a successful close.\n\nWhen closing cancels active foreground work, the Agent MUST send the final\nupdates for that work and the idle `state_update` with `stopReason: \"cancelled\"`\nbefore responding successfully to `session/close`. Closing an idle session\ndoes not itself require another idle update.\n\nClosing also cancels pending `session/prompt` requests whose messages have not\nbeen inserted, including held prompts. If closing prevents a prompt's user message from being inserted, the\nAgent MUST answer that request with `-32800` (Request cancelled). If the message\nhas already been inserted, the Agent MUST respond successfully with its\n`messageId`. Prompt responses need not precede the close response.", "type": "object", "properties": { - "action": { - "description": "The kind of action (e.g., \"insertChar\", \"cursorMovement\").", - "type": "string" - }, - "uri": { - "description": "The URI of the file where the action occurred.", - "type": "string", - "format": "uri" - }, - "position": { - "description": "The position where the action occurred.", + "sessionId": { + "description": "The ID of the session to close.", "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/SessionId" } ] }, - "timestampMs": { - "description": "Timestamp in milliseconds since epoch.", - "type": "integer", - "format": "uint64", - "minimum": 0 - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10814,49 +11928,70 @@ } }, "required": [ - "action", - "uri", - "position", - "timestampMs" - ] + "sessionId" + ], + "x-side": "agent", + "x-method": "session/close" }, - "NesOpenFile": { - "description": "An open file in the editor.", + "CancelToolCallRequest": { + "description": "Request parameters for cancelling one tool call.\n\nClients MUST NOT send it unless the tool call currently advertises `capabilities.cancel`.\n\nThe Agent responds once it has accepted the cancellation. The response does not mean\nthe work has stopped. The Agent confirms it with a `tool_call_update` to a final\nstatus: normally `cancelled`, or `completed` or `failed` if the work finished first.\n\nThe Agent responds with `-32602` if the tool call is unknown, already final, or not\ncancellable. Cancelling a tool call does not change the foreground state by itself.\n\nSee protocol docs: [Cancelling Tool Calls](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#cancelling-tool-calls)", "type": "object", "properties": { - "uri": { - "description": "The URI of the file.", - "type": "string", - "format": "uri" - }, - "languageId": { - "description": "The language identifier.", - "type": "string" + "sessionId": { + "description": "The ID of the session that owns the tool call.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, - "visibleRange": { - "description": "The visible range in the editor, if any.", - "anyOf": [ + "toolCallId": { + "description": "The ID of the tool call to cancel.", + "allOf": [ { - "$ref": "#/$defs/Range" - }, + "$ref": "#/$defs/ToolCallId" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": [ + "sessionId", + "toolCallId" + ], + "x-side": "agent", + "x-method": "tool_call/cancel" + }, + "CancelTerminalRequest": { + "description": "Request parameters for cancelling one terminal.\n\nClients MUST NOT send it unless the terminal currently advertises `capabilities.cancel`.\n\nThe Agent responds once it has accepted the cancellation. The response does not mean\nthe work has stopped. The Agent confirms it with a `terminal_update` that sets\n`exitStatus`. Cancelling stops the process but does not release the terminal, and does\nnot change the status of a tool call that references it.\n\nThe Agent responds with `-32602` if the terminal is unknown, has already exited, or is not\ncancellable. Cancelling a terminal does not change the foreground state by itself.\n\nSee protocol docs: [Cancelling Terminals](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#cancelling-terminals)", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session that owns the terminal.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/SessionId" } - ], - "x-deserialize-default-on-error": true + ] }, - "lastFocusedMs": { - "description": "Timestamp in milliseconds since epoch of when the file was last focused.", - "type": [ - "integer", - "null" - ], - "format": "uint64", - "minimum": 0, - "x-deserialize-default-on-error": true + "terminalId": { + "description": "The ID of the terminal to cancel.", + "allOf": [ + { + "$ref": "#/$defs/TerminalId" + } + ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10866,41 +12001,34 @@ } }, "required": [ - "uri", - "languageId" - ] + "sessionId", + "terminalId" + ], + "x-side": "agent", + "x-method": "terminal/cancel" }, - "NesDiagnostic": { - "description": "A diagnostic (error, warning, etc.).", + "SetSessionConfigOptionRequest": { + "description": "Request parameters for setting a session configuration option.\n\nAgents MUST support this method for any session the Client created or resumed\nwhere they advertise config options. For a child session, the child's\ncapabilities decide whether the Client can send it, and none defined today\npermits it.\nAgents MUST reject an unknown `configId` or invalid value with `-32602` and leave the\nconfiguration unchanged.\n\nSee protocol docs: [Session Config Options](https://agentclientprotocol.com/protocol/v2/draft/session-config-options#setting-a-config-option)", "type": "object", "properties": { - "uri": { - "description": "The URI of the file containing the diagnostic.", - "type": "string", - "format": "uri" - }, - "range": { - "description": "The range of the diagnostic.", + "sessionId": { + "description": "The ID of the session to set the configuration option for.", "allOf": [ { - "$ref": "#/$defs/Range" + "$ref": "#/$defs/SessionId" } ] }, - "severity": { - "description": "The severity of the diagnostic.", + "configId": { + "description": "The ID of the configuration option to set.", "allOf": [ { - "$ref": "#/$defs/NesDiagnosticSeverity" + "$ref": "#/$defs/SessionConfigId" } ] }, - "message": { - "description": "The diagnostic message.", - "type": "string" - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10910,56 +12038,134 @@ } }, "required": [ - "uri", - "range", - "severity", - "message" - ] - }, - "NesDiagnosticSeverity": { - "description": "Severity of a diagnostic.", + "sessionId", + "configId" + ], "anyOf": [ { - "description": "An error.", - "type": "string", - "const": "error" - }, - { - "description": "A warning.", - "type": "string", - "const": "warning" - }, - { - "description": "An informational message.", - "type": "string", - "const": "information" + "description": "A `SessionConfigValueId` string value (`type: \"id\"`).", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "id" + }, + "value": { + "description": "The value ID.", + "allOf": [ + { + "$ref": "#/$defs/SessionConfigValueId" + } + ] + } + }, + "required": [ + "type", + "value" + ] }, { - "description": "A hint.", - "type": "string", - "const": "hint" + "description": "A boolean value (`type: \"boolean\"`).", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "boolean" + }, + "value": { + "description": "The boolean value.", + "type": "boolean" + } + }, + "required": [ + "type", + "value" + ] }, { - "title": "Other", - "description": "Custom or future diagnostic severity.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", - "type": "string" + "title": "other", + "description": "Custom or future session configuration option value payload.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nAgents MUST reject a `session/set_config_option` request with a value type\nthey do not support with `-32602`.", + "type": "object", + "properties": { + "type": { + "description": "Custom or future session configuration option value type.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", + "type": "string" + }, + "value": { + "description": "Raw value payload for the custom or future value type." + } + }, + "required": [ + "type", + "value" + ], + "not": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "id" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "boolean" + } + }, + "required": [ + "type" + ] + } + ] + }, + "additionalProperties": true } - ] + ], + "x-side": "agent", + "x-method": "session/set_config_option" }, - "CloseNesRequest": { - "description": "Request to close an NES session.\n\nThe agent **must** cancel any ongoing work related to the NES session\nand then free up any resources associated with the session.", + "PromptRequest": { + "description": "Request parameters for sending a user prompt to the Agent.\n\nContains the user's message and any additional context.\n\nSee protocol docs: [User Message](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#1-user-message)", "type": "object", "properties": { "sessionId": { - "description": "The ID of the NES session to close.", + "description": "The ID of the session to send this user message to", "allOf": [ { "$ref": "#/$defs/SessionId" } ] }, + "prompt": { + "description": "The blocks of content that compose the user's message.\n\nAs a baseline, the Agent MUST support `text` and `resource_link` content blocks,\nwhile other variants are optionally enabled via `PromptCapabilities`.\n\nThe Client MUST adapt its interface according to `PromptCapabilities`.\n\nThe Client MAY include referenced pieces of context as either\n`resource` or `resource_link` content blocks.\n\nWhen available, `resource` is preferred\nas it avoids extra round-trips and allows the message to include\npieces of context from sources the Agent might not have access to.\n\nClients MUST NOT send an empty array. Agents MAY reject one with `-32602` without\ninserting it.", + "type": "array", + "items": { + "$ref": "#/$defs/ContentBlock" + }, + "minItems": 1 + }, + "idempotencyKey": { + "description": "Identifies one prompt submission within this session.\n\nOptional. Omitted and `null` are equivalent and mean no key. The Agent then handles\nthe prompt without duplicate detection.\n\nThe Client generates the key and sends the same key on every attempt for the same\nsubmission. Agents that advertise `capabilities.session` MUST support the key.\nA retry of a recorded insertion returns the original `messageId` without inserting\nanother message.\n\nThe Agent MUST recognize the key for as long as it retains the message, including\nacross connections and Agent restarts. For a live-only message, it MUST recognize\nthe key while the session stays active on a connection. A retry with a forgotten\nkey is a new submission, even immediately after reconnecting. If a duplicate\nwould matter and the Client cannot rule it out, it SHOULD NOT retry automatically.\n\nWhen present, the value is an opaque, case-sensitive string of 1 to 255 characters.\nAgents MUST reject any other value with `-32602` (Invalid params) and MUST NOT treat\nit as omitted.\n\nSee protocol docs: [Retrying a prompt](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#retrying-a-prompt)", + "anyOf": [ + { + "$ref": "#/$defs/IdempotencyKey" + }, + { + "type": "null" + } + ] + }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -10969,10 +12175,17 @@ } }, "required": [ - "sessionId" + "sessionId", + "prompt" ], "x-side": "agent", - "x-method": "nes/close" + "x-method": "session/prompt" + }, + "IdempotencyKey": { + "description": "A key the Client generates to identify one `session/prompt` submission across attempts.\n\nThe key is an opaque, case-sensitive string of 1 to 255 characters. It is scoped to the\nsession named by the request's `sessionId`.\n\nSee protocol docs: [Retrying a prompt](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#retrying-a-prompt)", + "type": "string", + "minLength": 1, + "maxLength": 255 }, "ClientResponse": { "description": "A JSON-RPC response object.", @@ -11043,10 +12256,21 @@ "type": "object", "properties": { "id": { - "description": "The id of the request this response answers.", - "allOf": [ + "description": "The id of the request this response answers.\n\nRequired. `null` only when the request's id could not be determined, such as\nfor a parse error or an invalid request.", + "anyOf": [ { - "$ref": "#/$defs/RequestId" + "title": "Number", + "description": "A numeric request ID.", + "type": "integer", + "format": "int64" + }, + { + "title": "Str", + "description": "A string request ID.", + "type": "string" + }, + { + "type": "null" } ] }, @@ -11080,7 +12304,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11099,7 +12323,7 @@ "description": "The outcome of a permission request.", "anyOf": [ { - "description": "Active session work was cancelled before the user responded.\n\nWhen a client sends a `session/cancel` notification to cancel active\nsession work, it MUST respond to all pending `session/request_permission`\nrequests with this `Cancelled` outcome.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)", + "description": "The request was not approved and no option was selected: the session's work was\ncancelled, the user dismissed the prompt, or the Client declined it by policy.\nAgents MUST NOT proceed with the operation.\n\nThe Client answers a request the Agent cancels with `$/cancel_request` with\nthis outcome. After sending `session/cancel`, the Client MAY also send it\nwithout waiting for `$/cancel_request`, for a request it knows belongs to the\ncancelled foreground work.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)", "type": "object", "properties": { "outcome": { @@ -11109,10 +12333,15 @@ }, "required": [ "outcome" + ], + "allOf": [ + { + "$ref": "#/$defs/CancelledPermissionOutcome" + } ] }, { - "description": "The user selected one of the provided options.", + "description": "The user selected an option. Selection is not approval by itself.\n\nThe Agent MUST match `optionId` against the options it offered in this request.\nFor `reject_once` or `reject_always`, the Agent MUST NOT perform the requested\noperation. If no option matches or the Agent does not understand its `kind`,\nthe Agent MUST NOT treat the response as approval.", "type": "object", "properties": { "outcome": { @@ -11131,7 +12360,7 @@ }, { "title": "other", - "description": "Custom or future permission outcome.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nAgents that do not understand this outcome MUST NOT treat it as approval.\nThey should preserve the raw payload when storing, replaying, proxying, or\nforwarding permission responses, and otherwise fail or decline the\npermission request according to policy.", + "description": "Custom or future permission outcome.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nAgents that do not understand this outcome MUST NOT treat it as approval.\nThey SHOULD preserve the raw payload when storing, replaying, proxying, or\nforwarding permission responses, and otherwise fail or decline the\npermission request according to policy.", "type": "object", "properties": { "outcome": { @@ -11174,12 +12403,27 @@ } ] }, + "CancelledPermissionOutcome": { + "description": "The request was not approved and no option was selected.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "type": [ + "object", + "null" + ], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, "SelectedPermissionOutcome": { - "description": "The user selected one of the provided options.", + "description": "Identifies the option the user chose, whether it allows or rejects the operation.", "type": "object", "properties": { "optionId": { - "description": "The ID of the option the user selected.", + "description": "The ID of the option the user selected from this request's `options`.", "allOf": [ { "$ref": "#/$defs/PermissionOptionId" @@ -11187,7 +12431,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11201,11 +12445,11 @@ ] }, "CreateElicitationResponse": { - "description": "Response from the client to an elicitation request.", + "description": "Response from the Client to an elicitation request.", "type": "object", "properties": { "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nOptional. Omitted and `null` are equivalent and mean no metadata.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11261,7 +12505,7 @@ }, { "title": "other", - "description": "Custom or future elicitation action.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nAgents that do not understand this action should preserve the raw\npayload when storing, replaying, proxying, or forwarding elicitation\nresponses. They MUST NOT treat it as a known elicitation action.", + "description": "Custom or future elicitation action.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.\n\nAgents that do not understand this action SHOULD preserve the raw\npayload when storing, replaying, proxying, or forwarding elicitation\nresponses, and otherwise MUST handle it as `cancel`.", "type": "object", "properties": { "action": { @@ -11319,7 +12563,7 @@ "x-method": "elicitation/create" }, "ElicitationContentValue": { - "description": "Allowed wire representations for [`ElicitationContentValue`].", + "description": "Allowed wire representations for `ElicitationContentValue`.", "anyOf": [ { "title": "String", @@ -11350,6 +12594,10 @@ "items": { "type": "string" } + }, + { + "title": "Other", + "description": "Any other JSON value, such as the value of a custom or future property type.\n\nPreserved as sent. Agents validate it against the requested schema like any\nother value." } ] }, @@ -11358,7 +12606,7 @@ "type": "object", "properties": { "content": { - "description": "The user-provided content, if any, as an object matching the requested schema.", + "description": "The user-provided content, if any, as an object matching the requested schema.\n\nOmitted and `null` are equivalent and mean no content is provided.", "type": [ "object", "null" @@ -11370,7 +12618,7 @@ } }, "MessageMcpResponse": { - "description": "**UNSTABLE**\n\nThe successful outer ACP `mcp/message` response carries exactly one\ninner MCP outcome: an opaque result (including JSON null), or an MCP error.\nOuter ACP errors are reserved for binding and runtime failures.\n\nBoth branches require their carrier key. An error must be a non-null object.\nUnknown outer fields are ignored; inner result and error fields are preserved.\nCarrier `_meta` is optional; null or invalid values are treated as absent.\nSenders must include exactly one outcome; receivers prefer `result` if both are present.", + "description": "**UNSTABLE**\n\nThe successful outer ACP `mcp/message` response carries exactly one\ninner MCP outcome: an opaque result (including JSON null), or an MCP error.\nOuter ACP errors are reserved for binding and runtime failures.\n\nBoth branches require their carrier key. An error MUST be a non-null object.\nUnknown outer fields are ignored. Inner result and error fields are preserved.\nCarrier `_meta` is optional. Omitted and `null` are equivalent.\nSenders MUST include exactly one outcome.", "anyOf": [ { "title": "Result", @@ -11381,7 +12629,7 @@ "description": "Required, even if JSON null." }, "_meta": { - "description": "Optional ACP carrier metadata.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis is ACP metadata, not the inner MCP message's `_meta`.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11408,7 +12656,7 @@ ] }, "_meta": { - "description": "Optional ACP carrier metadata.", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis is ACP metadata, not the inner MCP message's `_meta`.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11426,11 +12674,11 @@ "x-method": "mcp/message" }, "McpError": { - "description": "**UNSTABLE**\n\nAn inner MCP error, distinct from an outer ACP binding or runtime error.\n\n`code` and `message` are required and non-null. `data` is optional;\nexplicit `null` is preserved separately from an omitted key.", + "description": "**UNSTABLE**\n\nAn inner MCP error, distinct from an outer ACP binding or runtime error.\n\n`code` and `message` are required and non-null. `data` is optional.\nExplicit `null` is preserved separately from an omitted key.", "type": "object", "properties": { "code": { - "description": "Inner MCP error code; never an ACP error code.", + "description": "Inner MCP error code. Never an ACP error code.", "type": "integer", "format": "int32" }, @@ -11439,98 +12687,35 @@ "type": "string" }, "data": { - "description": "Optional error data; explicit null is retained." + "description": "Optional error data. Explicit null is retained." } }, "required": [ "code", - "message" - ], - "additionalProperties": true - }, - "ClientNotification": { - "description": "A JSON-RPC notification object.", - "type": "object", - "properties": { - "method": { - "description": "The notification method name.", - "type": "string" - }, - "params": { - "description": "Method-specific notification parameters.", - "anyOf": [ - { - "description": "All possible notifications that a client can send to an agent.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly.\n\nNotifications do not expect a response.", - "anyOf": [ - { - "title": "CancelSessionNotification", - "description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel active work in a\nsession.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Report an idle `state_update` with `StopReason::Cancelled` after\n cancellation succeeds\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)", - "allOf": [ - { - "$ref": "#/$defs/CancelSessionNotification" - } - ] - }, - { - "title": "DidOpenDocumentNotification", - "description": "**UNSTABLE**\n\nNotification sent when a file is opened in the editor.", - "allOf": [ - { - "$ref": "#/$defs/DidOpenDocumentNotification" - } - ] - }, - { - "title": "DidChangeDocumentNotification", - "description": "**UNSTABLE**\n\nNotification sent when a file is edited.", - "allOf": [ - { - "$ref": "#/$defs/DidChangeDocumentNotification" - } - ] - }, - { - "title": "DidCloseDocumentNotification", - "description": "**UNSTABLE**\n\nNotification sent when a file is closed.", - "allOf": [ - { - "$ref": "#/$defs/DidCloseDocumentNotification" - } - ] - }, - { - "title": "DidSaveDocumentNotification", - "description": "**UNSTABLE**\n\nNotification sent when a file is saved.", - "allOf": [ - { - "$ref": "#/$defs/DidSaveDocumentNotification" - } - ] - }, - { - "title": "DidFocusDocumentNotification", - "description": "**UNSTABLE**\n\nNotification sent when a file becomes the active editor tab.", - "allOf": [ - { - "$ref": "#/$defs/DidFocusDocumentNotification" - } - ] - }, - { - "title": "AcceptNesNotification", - "description": "**UNSTABLE**\n\nNotification sent when a suggestion is accepted.", - "allOf": [ - { - "$ref": "#/$defs/AcceptNesNotification" - } - ] - }, + "message" + ], + "additionalProperties": true + }, + "ClientNotification": { + "description": "A JSON-RPC notification object.", + "type": "object", + "properties": { + "method": { + "description": "The notification method name.", + "type": "string" + }, + "params": { + "description": "Method-specific notification parameters.", + "anyOf": [ + { + "description": "All possible notifications that a Client can send to an Agent.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly.\n\nNotifications do not expect a response.", + "anyOf": [ { - "title": "RejectNesNotification", - "description": "**UNSTABLE**\n\nNotification sent when a suggestion is rejected.", + "title": "CancelSessionNotification", + "description": "Cancels the named session's active foreground work and earlier prompts not yet inserted.\nThe Agent MUST answer those uninserted prompts with `-32800`. Inserted prompts still\nsucceed with their `messageId`. This cancellation does not cover later submissions.\n\nWork in the latest `background` list is not covered and keeps running. The\nAgent MAY stop background activity it does not list.\n\nUpon receiving this notification, the Agent SHOULD stop all language model\nrequests and all tool call invocations of the cancelled foreground work as soon\nas possible.\n\nThe Agent MUST stop waiting for pending `session/request_permission` requests of\nthe cancelled work and treat them as not approved. It MUST cancel each of them\nwith `$/cancel_request`.\n\nWhen cancellation stops active foreground work, the Agent MUST send that work's\npending updates, then an idle `state_update` with `stopReason: \"cancelled\"`,\nbefore starting new foreground work in the same session. A later prompt can be\ninserted and acknowledged before that idle update, or held with its response\npending. Listed background work can report updates before or after it.\nNo additional idle update is required if no foreground work was active.\n\nAfter cancellation completes, the Agent SHOULD ignore late answers rather\nthan use them to resume the cancelled work.\n\nAgents MUST catch errors caused by aborting cancelled work and report the\n`cancelled` stop reason, not `error`.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)", "allOf": [ { - "$ref": "#/$defs/RejectNesNotification" + "$ref": "#/$defs/CancelSessionNotification" } ] }, @@ -11545,7 +12730,7 @@ }, { "title": "ExtNotification", - "description": "Handles extension notifications from the client.\n\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "Handles extension notifications from the Client.\n\nExtension notifications are custom one-way messages that are not part of the ACP spec.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "allOf": [ { "$ref": "#/$defs/ExtNotification" @@ -11566,11 +12751,11 @@ "x-docs-ignore": true }, "CancelSessionNotification": { - "description": "Notification to cancel ongoing operations for a session.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)", + "description": "Cancels the named session's active foreground work and earlier prompts not yet inserted.\nIt does not cancel later submissions or work in the session's latest `background` list.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)", "type": "object", "properties": { "sessionId": { - "description": "The ID of the session to cancel operations for.", + "description": "The ID of the session whose foreground work to cancel.", "allOf": [ { "$ref": "#/$defs/SessionId" @@ -11578,7 +12763,7 @@ ] }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11593,38 +12778,40 @@ "x-side": "agent", "x-method": "session/cancel" }, - "DidOpenDocumentNotification": { - "description": "Notification sent when a file is opened in the editor.", + "MessageMcpNotification": { + "description": "**UNSTABLE**\n\nNotification for an active request, sent from provider to consumer.\nIncludes subscription acknowledgements and updates.", "type": "object", "properties": { - "sessionId": { - "description": "The session ID for this notification.", + "serverId": { + "description": "The declared ACP MCP server handling the associated request.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/McpServerAcpId" } ] }, - "uri": { - "description": "The URI of the opened document.", - "type": "string", - "format": "uri" + "requestId": { + "description": "The identifier of the active inner MCP request.", + "allOf": [ + { + "$ref": "#/$defs/McpRequestId" + } + ] }, - "languageId": { - "description": "The language identifier of the document (e.g., \"rust\", \"python\").", + "method": { + "description": "The inner MCP method name.", "type": "string" }, - "version": { - "description": "The version number of the document.", - "type": "integer", - "format": "int64" - }, - "text": { - "description": "The full text content of the document.", - "type": "string" + "params": { + "description": "Optional inner MCP params. Null is equivalent to omission.", + "type": [ + "object", + "null" + ], + "additionalProperties": true }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\nThis is ACP metadata, not the inner MCP message's `_meta`.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11634,48 +12821,27 @@ } }, "required": [ - "sessionId", - "uri", - "languageId", - "version", - "text" + "serverId", + "requestId", + "method" ], "x-side": "agent", - "x-method": "document/didOpen" + "x-method": "mcp/message" }, - "DidChangeDocumentNotification": { - "description": "Notification sent when a file is edited.", + "CancelRequestNotification": { + "description": "Notification to cancel an ongoing request.\n\nSee protocol docs: [Request Cancellation](https://agentclientprotocol.com/protocol/v2/draft/cancellation)", "type": "object", "properties": { - "sessionId": { - "description": "The session ID for this notification.", + "requestId": { + "description": "The ID of the request to cancel: a request that the sender of this notification issued.\nReceivers match it only against requests they received from that sender.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/RequestId" } ] }, - "uri": { - "description": "The URI of the changed document.", - "type": "string", - "format": "uri" - }, - "version": { - "description": "The new version number of the document.", - "type": "integer", - "format": "int64" - }, - "contentChanges": { - "description": "The content changes.", - "type": "array", - "items": { - "$ref": "#/$defs/TextDocumentContentChangeEvent" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "The _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11685,66 +12851,88 @@ } }, "required": [ - "sessionId", - "uri", - "version", - "contentChanges" + "requestId" ], - "x-side": "agent", - "x-method": "document/didChange" + "x-side": "protocol", + "x-method": "$/cancel_request" }, - "TextDocumentContentChangeEvent": { - "description": "A content change event for a document.\n\nWhen `range` is `None`, `text` is the full content of the document.\nWhen `range` is `Some`, `text` replaces the given range.", + "ProxyRequest": { + "description": "A JSON-RPC request object.", "type": "object", "properties": { - "range": { - "description": "The range of the document that changed. If `None`, the entire content is replaced.", + "id": { + "description": "The request id used to correlate the matching response.", + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ] + }, + "method": { + "description": "The method name to invoke.", + "type": "string" + }, + "params": { + "description": "Method-specific request parameters.", "anyOf": [ { - "$ref": "#/$defs/Range" + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequests exchanged between a conductor and its proxies.\n\nA conductor sends `proxy/initialize` and `proxy/successor` to a proxy. A proxy sends\n`proxy/successor` to its conductor.", + "anyOf": [ + { + "title": "InitializeProxyRequest", + "description": "Initializes a component as a proxy.\n\nSent by a conductor to each component that has a successor, instead of `initialize`.\nThe params and response are the same as for `initialize`.", + "allOf": [ + { + "$ref": "#/$defs/InitializeProxyRequest" + } + ] + }, + { + "title": "ProxySuccessorRequest", + "description": "Forwards a request to or from a proxy's successor.\n\nA proxy sends it to its conductor to forward a request downstream. The conductor sends\nit to the proxy to deliver a request from the successor. The wrapped request's result\nor error is returned unchanged.", + "allOf": [ + { + "$ref": "#/$defs/ProxySuccessorRequest" + } + ] + } + ] }, { "type": "null" } ] - }, - "text": { - "description": "The new text for the range, or the full document content if `range` is `None`.", - "type": "string" - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true } }, "required": [ - "text" + "id", + "method" + ], + "x-docs-ignore": true + }, + "InitializeProxyRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `proxy/initialize`.\n\nA conductor sends `proxy/initialize` instead of `initialize` to every component that has a\nsuccessor, which tells the component to run as a proxy. The params and the response are\nthe same as for `initialize`. A conductor sends `initialize` to the final Agent.\n\nThe params carry the protocol version the conductor selected: the Client's requested\nversion, unless the conductor supports only a lower one. Before answering successfully,\nthe proxy MUST forward an `initialize` request to its successor through `proxy/successor`.\n\nSee the [Proxy Chains RFD](https://agentclientprotocol.com/rfds/proxy-chains).", + "x-method": "proxy/initialize", + "x-side": "proxy", + "allOf": [ + { + "$ref": "#/$defs/InitializeRequest" + } ] }, - "DidCloseDocumentNotification": { - "description": "Notification sent when a file is closed.", + "ProxySuccessorRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nParameters of a `proxy/successor` request.\n\nA proxy sends it to forward a message to its successor, and the conductor sends it to\ndeliver a message from the successor to the proxy. The envelope wraps one request: `method`\nand `params` are the wrapped request's method and params.\n\nThe result or error of the wrapped request is returned unchanged, as the same JSON value,\nas the result or error of the `proxy/successor` request. Errors the conductor returns\nitself, for example because the successor has exited, are not wrapped results.\n\nTo cancel it, the sender sends `$/cancel_request` with the ID of this `proxy/successor`\nrequest on the same connection. Cancellation is never forwarded to another hop.\n\nSee the [Proxy Chains RFD](https://agentclientprotocol.com/rfds/proxy-chains).", "type": "object", "properties": { - "sessionId": { - "description": "The session ID for this notification.", - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ] + "method": { + "description": "Method name of the wrapped request.", + "type": "string" }, - "uri": { - "description": "The URI of the closed document.", - "type": "string", - "format": "uri" + "params": { + "description": "Params of the wrapped request, forwarded unchanged.\n\nOptional. Omitted and `null` are equivalent and mean the wrapped request has no params.\nWhen present, it MUST be a JSON object or array, as JSON-RPC requires.\nThe wrapped request's own `_meta` stays inside these params." }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "Metadata for the `proxy/successor` envelope itself, separate from the wrapped\nmessage's `_meta`. It is hop-local: the conductor does not copy it into the message\nit unwraps.\n\nThe _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11754,31 +12942,161 @@ } }, "required": [ - "sessionId", - "uri" + "method" ], - "x-side": "agent", - "x-method": "document/didClose" + "x-side": "proxy", + "x-method": "proxy/successor" + }, + "ProxyResponse": { + "description": "A JSON-RPC response object.", + "anyOf": [ + { + "title": "Result", + "description": "A successful JSON-RPC response.", + "type": "object", + "properties": { + "id": { + "description": "The id of the request this response answers.", + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ] + }, + "result": { + "description": "Method-specific response data.", + "anyOf": [ + { + "title": "InitializeProxyResponse", + "description": "Successful result returned for a `proxy/initialize` request.", + "allOf": [ + { + "$ref": "#/$defs/InitializeProxyResponse" + } + ] + }, + { + "title": "ProxySuccessorResponse", + "description": "Successful result returned for a `proxy/successor` request.", + "allOf": [ + { + "$ref": "#/$defs/ProxySuccessorResponse" + } + ] + } + ] + } + }, + "required": [ + "id", + "result" + ] + }, + { + "title": "Error", + "description": "A failed JSON-RPC response.", + "type": "object", + "properties": { + "id": { + "description": "The id of the request this response answers.\n\nRequired. `null` only when the request's id could not be determined, such as\nfor a parse error or an invalid request.", + "anyOf": [ + { + "title": "Number", + "description": "A numeric request ID.", + "type": "integer", + "format": "int64" + }, + { + "title": "Str", + "description": "A string request ID.", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "error": { + "description": "Method-specific error data.", + "allOf": [ + { + "$ref": "#/$defs/Error" + } + ] + } + }, + "required": [ + "id", + "error" + ] + } + ], + "x-docs-ignore": true + }, + "InitializeProxyResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `proxy/initialize`.\n\nThe same as the `initialize` response. The proxy builds it from its successor's\n`initialize` response and answers with the capabilities of the chain from itself onward.\nIt MUST NOT change `protocolVersion`.", + "x-method": "proxy/initialize", + "x-side": "proxy", + "allOf": [ + { + "$ref": "#/$defs/InitializeResponse" + } + ] }, - "DidSaveDocumentNotification": { - "description": "Notification sent when a file is saved.", + "ProxySuccessorResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResult of a `proxy/successor` request: the wrapped request's result, forwarded unchanged.", + "x-side": "proxy", + "x-method": "proxy/successor" + }, + "ProxyNotification": { + "description": "A JSON-RPC notification object.", "type": "object", "properties": { - "sessionId": { - "description": "The session ID for this notification.", - "allOf": [ + "method": { + "description": "The notification method name.", + "type": "string" + }, + "params": { + "description": "Method-specific notification parameters.", + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotifications exchanged between a conductor and its proxies.", + "anyOf": [ + { + "title": "ProxySuccessorNotification", + "description": "Forwards a notification to or from a proxy's successor.\n\nA proxy sends it to its conductor to forward a notification downstream. The conductor\nsends it to the proxy to deliver a notification from the successor.", + "allOf": [ + { + "$ref": "#/$defs/ProxySuccessorNotification" + } + ] + } + ] + }, + { + "type": "null" } ] + } + }, + "required": [ + "method" + ], + "x-docs-ignore": true + }, + "ProxySuccessorNotification": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nParameters of a `proxy/successor` notification.\n\nA proxy sends it to forward a message to its successor, and the conductor sends it to\ndeliver a message from the successor to the proxy. The envelope wraps one notification: `method`\nand `params` are the wrapped notification's method and params.\n\nSee the [Proxy Chains RFD](https://agentclientprotocol.com/rfds/proxy-chains).", + "type": "object", + "properties": { + "method": { + "description": "Method name of the wrapped notification.", + "type": "string" + }, + "params": { + "description": "Params of the wrapped notification, forwarded unchanged.\n\nOptional. Omitted and `null` are equivalent and mean the wrapped notification has no params.\nWhen present, it MUST be a JSON object or array, as JSON-RPC requires.\nThe wrapped notification's own `_meta` stays inside these params." }, - "uri": { - "description": "The URI of the saved document.", - "type": "string", - "format": "uri" - }, "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", + "description": "Metadata for the `proxy/successor` envelope itself, separate from the wrapped\nmessage's `_meta`. It is hop-local: the conductor does not copy it into the message\nit unwraps.\n\nThe _meta property is reserved by ACP to allow Clients and Agents to attach additional\nmetadata to their interactions. Omitted and `null` are equivalent and mean no metadata.\nImplementations MUST NOT assign meaning to keys they do not recognize.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", "type": [ "object", "null" @@ -11788,299 +13106,848 @@ } }, "required": [ - "sessionId", - "uri" + "method" ], - "x-side": "agent", - "x-method": "document/didSave" + "x-side": "proxy", + "x-method": "proxy/successor" + } + }, + "x-methods": { + "agent": { + "auth/login": { + "request": "#/$defs/LoginAuthRequest", + "result": "#/$defs/LoginAuthResponse" + }, + "auth/logout": { + "request": "#/$defs/LogoutAuthRequest", + "result": "#/$defs/LogoutAuthResponse" + }, + "auth/status": { + "request": "#/$defs/AuthStatusRequest", + "result": "#/$defs/AuthStatusResponse" + }, + "initialize": { + "request": "#/$defs/InitializeRequest", + "result": "#/$defs/InitializeResponse" + }, + "mcp/message": { + "notification": "#/$defs/MessageMcpNotification" + }, + "providers/disable": { + "request": "#/$defs/DisableProviderRequest", + "result": "#/$defs/DisableProviderResponse" + }, + "providers/list": { + "request": "#/$defs/ListProvidersRequest", + "result": "#/$defs/ListProvidersResponse" + }, + "providers/set": { + "request": "#/$defs/SetProviderRequest", + "result": "#/$defs/SetProviderResponse" + }, + "session/archive": { + "request": "#/$defs/ArchiveSessionRequest", + "result": "#/$defs/ArchiveSessionResponse" + }, + "session/cancel": { + "notification": "#/$defs/CancelSessionNotification" + }, + "session/close": { + "request": "#/$defs/CloseSessionRequest", + "result": "#/$defs/CloseSessionResponse" + }, + "session/delete": { + "request": "#/$defs/DeleteSessionRequest", + "result": "#/$defs/DeleteSessionResponse" + }, + "session/fork": { + "request": "#/$defs/ForkSessionRequest", + "result": "#/$defs/ForkSessionResponse" + }, + "session/list": { + "request": "#/$defs/ListSessionsRequest", + "result": "#/$defs/ListSessionsResponse" + }, + "session/new": { + "request": "#/$defs/NewSessionRequest", + "result": "#/$defs/NewSessionResponse" + }, + "session/options": { + "request": "#/$defs/SessionOptionsRequest", + "result": "#/$defs/SessionOptionsResponse" + }, + "session/prompt": { + "request": "#/$defs/PromptRequest", + "result": "#/$defs/PromptResponse" + }, + "session/resume": { + "request": "#/$defs/ResumeSessionRequest", + "result": "#/$defs/ResumeSessionResponse" + }, + "session/set_config_option": { + "request": "#/$defs/SetSessionConfigOptionRequest", + "result": "#/$defs/SetSessionConfigOptionResponse" + }, + "session/set_title": { + "request": "#/$defs/SetSessionTitleRequest", + "result": "#/$defs/SetSessionTitleResponse" + }, + "session/status": { + "request": "#/$defs/SessionStatusRequest", + "result": "#/$defs/SessionStatusResponse" + }, + "session/unarchive": { + "request": "#/$defs/UnarchiveSessionRequest", + "result": "#/$defs/UnarchiveSessionResponse" + }, + "terminal/cancel": { + "request": "#/$defs/CancelTerminalRequest", + "result": "#/$defs/CancelTerminalResponse" + }, + "tool_call/cancel": { + "request": "#/$defs/CancelToolCallRequest", + "result": "#/$defs/CancelToolCallResponse" + } }, - "DidFocusDocumentNotification": { - "description": "Notification sent when a file becomes the active editor tab.", - "type": "object", - "properties": { - "sessionId": { - "description": "The session ID for this notification.", - "allOf": [ - { - "$ref": "#/$defs/SessionId" + "client": { + "auth/status_update": { + "notification": "#/$defs/AuthStatusUpdateNotification" + }, + "elicitation/complete": { + "notification": "#/$defs/CompleteElicitationNotification" + }, + "elicitation/create": { + "request": "#/$defs/CreateElicitationRequest", + "result": "#/$defs/CreateElicitationResponse" + }, + "mcp/message": { + "request": "#/$defs/MessageMcpRequest", + "result": "#/$defs/MessageMcpResponse" + }, + "session/request_permission": { + "request": "#/$defs/RequestPermissionRequest", + "result": "#/$defs/RequestPermissionResponse" + }, + "session/update": { + "notification": "#/$defs/UpdateSessionNotification" + } + }, + "protocol": { + "$/cancel_request": { + "notification": "#/$defs/CancelRequestNotification" + } + }, + "proxy": { + "proxy/initialize": { + "request": "#/$defs/InitializeProxyRequest", + "result": "#/$defs/InitializeProxyResponse" + }, + "proxy/successor": { + "notification": "#/$defs/ProxySuccessorNotification", + "request": "#/$defs/ProxySuccessorRequest", + "result": "#/$defs/ProxySuccessorResponse" + } + } + }, + "allOf": [ + { + "$defs": { + "Envelope": { + "$anchor": "rpcEnvelope", + "type": "object", + "required": [ + "jsonrpc" + ], + "properties": { + "jsonrpc": { + "const": "2.0" } - ] - }, - "uri": { - "description": "The URI of the focused document.", - "type": "string", - "format": "uri" - }, - "version": { - "description": "The version number of the document.", - "type": "integer", - "format": "int64" - }, - "position": { - "description": "The current cursor position.", - "allOf": [ + }, + "oneOf": [ { - "$ref": "#/$defs/Position" - } - ] - }, - "visibleRange": { - "description": "The portion of the file currently visible in the editor viewport.", - "allOf": [ + "required": [ + "method", + "id" + ], + "properties": { + "method": { + "type": "string" + }, + "id": { + "$ref": "#/$defs/RequestId" + }, + "params": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "array" + } + ] + }, + "result": false, + "error": false + } + }, + { + "required": [ + "method" + ], + "properties": { + "method": { + "type": "string" + }, + "id": false, + "params": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "array" + } + ] + }, + "result": false, + "error": false + } + }, + { + "required": [ + "id", + "result" + ], + "properties": { + "id": { + "$ref": "#/$defs/RequestId" + }, + "result": true, + "method": false, + "error": false + } + }, { - "$ref": "#/$defs/Range" + "required": [ + "id", + "error" + ], + "properties": { + "id": { + "anyOf": [ + { + "$ref": "#/$defs/RequestId" + }, + { + "type": "null" + } + ] + }, + "error": { + "$ref": "#/$defs/Error" + }, + "method": false, + "result": false + } } ] - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true } }, - "required": [ - "sessionId", - "uri", - "version", - "position", - "visibleRange" - ], - "x-side": "agent", - "x-method": "document/didFocus" - }, - "AcceptNesNotification": { - "description": "Notification sent when a suggestion is accepted.", - "type": "object", - "properties": { - "sessionId": { - "description": "The session ID for this notification.", + "anyOf": [ + { + "$anchor": "clientToAgent", + "type": "object", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#rpcEnvelope" + } + ], + "if": { + "required": [ + "method" + ], + "properties": { + "method": true + } + }, + "then": { + "if": { + "required": [ + "id" + ], + "properties": { + "id": true + } + }, + "then": { + "oneOf": [ + { + "properties": { + "method": { + "const": "auth/login" + }, + "params": { + "$ref": "#/$defs/LoginAuthRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "auth/logout" + }, + "params": { + "$ref": "#/$defs/LogoutAuthRequest" + } + } + }, + { + "properties": { + "method": { + "const": "auth/status" + }, + "params": { + "$ref": "#/$defs/AuthStatusRequest" + } + } + }, + { + "properties": { + "method": { + "const": "initialize" + }, + "params": { + "$ref": "#/$defs/InitializeRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "providers/disable" + }, + "params": { + "$ref": "#/$defs/DisableProviderRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "providers/list" + }, + "params": { + "$ref": "#/$defs/ListProvidersRequest" + } + } + }, + { + "properties": { + "method": { + "const": "providers/set" + }, + "params": { + "$ref": "#/$defs/SetProviderRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/archive" + }, + "params": { + "$ref": "#/$defs/ArchiveSessionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/close" + }, + "params": { + "$ref": "#/$defs/CloseSessionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/delete" + }, + "params": { + "$ref": "#/$defs/DeleteSessionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/fork" + }, + "params": { + "$ref": "#/$defs/ForkSessionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/list" + }, + "params": { + "$ref": "#/$defs/ListSessionsRequest" + } + } + }, + { + "properties": { + "method": { + "const": "session/new" + }, + "params": { + "$ref": "#/$defs/NewSessionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/options" + }, + "params": { + "$ref": "#/$defs/SessionOptionsRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/prompt" + }, + "params": { + "$ref": "#/$defs/PromptRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/resume" + }, + "params": { + "$ref": "#/$defs/ResumeSessionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/set_config_option" + }, + "params": { + "$ref": "#/$defs/SetSessionConfigOptionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/set_title" + }, + "params": { + "$ref": "#/$defs/SetSessionTitleRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/status" + }, + "params": { + "$ref": "#/$defs/SessionStatusRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/unarchive" + }, + "params": { + "$ref": "#/$defs/UnarchiveSessionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "terminal/cancel" + }, + "params": { + "$ref": "#/$defs/CancelTerminalRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "tool_call/cancel" + }, + "params": { + "$ref": "#/$defs/CancelToolCallRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "type": "string", + "pattern": "^_" + } + } + } + ] + }, + "else": { + "oneOf": [ + { + "properties": { + "method": { + "const": "mcp/message" + }, + "params": { + "$ref": "#/$defs/MessageMcpNotification" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/cancel" + }, + "params": { + "$ref": "#/$defs/CancelSessionNotification" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "$/cancel_request" + }, + "params": { + "$ref": "#/$defs/CancelRequestNotification" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "type": "string", + "pattern": "^_" + } + } + } + ] } - ] + } }, - "suggestionId": { - "description": "The ID of the accepted suggestion.", + { + "$anchor": "agentToClient", + "type": "object", "allOf": [ { - "$ref": "#/$defs/NesSuggestionId" + "$ref": "#rpcEnvelope" } - ] - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "sessionId", - "suggestionId" - ], - "x-side": "agent", - "x-method": "nes/accept" - }, - "RejectNesNotification": { - "description": "Notification sent when a suggestion is rejected.", - "type": "object", - "properties": { - "sessionId": { - "description": "The session ID for this notification.", - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ] - }, - "suggestionId": { - "description": "The ID of the rejected suggestion.", - "allOf": [ - { - "$ref": "#/$defs/NesSuggestionId" + "if": { + "required": [ + "method" + ], + "properties": { + "method": true } - ] - }, - "reason": { - "description": "The reason for rejection.", - "anyOf": [ - { - "$ref": "#/$defs/NesRejectReason" + }, + "then": { + "if": { + "required": [ + "id" + ], + "properties": { + "id": true + } }, - { - "type": "null" + "then": { + "oneOf": [ + { + "properties": { + "method": { + "const": "elicitation/create" + }, + "params": { + "$ref": "#/$defs/CreateElicitationRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "mcp/message" + }, + "params": { + "$ref": "#/$defs/MessageMcpRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/request_permission" + }, + "params": { + "$ref": "#/$defs/RequestPermissionRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "type": "string", + "pattern": "^_" + } + } + } + ] + }, + "else": { + "oneOf": [ + { + "properties": { + "method": { + "const": "auth/status_update" + }, + "params": { + "$ref": "#/$defs/AuthStatusUpdateNotification" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "elicitation/complete" + }, + "params": { + "$ref": "#/$defs/CompleteElicitationNotification" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "session/update" + }, + "params": { + "$ref": "#/$defs/UpdateSessionNotification" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "$/cancel_request" + }, + "params": { + "$ref": "#/$defs/CancelRequestNotification" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "type": "string", + "pattern": "^_" + } + } + } + ] } - ], - "x-deserialize-default-on-error": true - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "sessionId", - "suggestionId" - ], - "x-side": "agent", - "x-method": "nes/reject" - }, - "NesRejectReason": { - "description": "The reason a suggestion was rejected.", - "anyOf": [ - { - "description": "The user explicitly dismissed the suggestion.", - "type": "string", - "const": "rejected" - }, - { - "description": "The suggestion was shown but the user continued editing without interacting.", - "type": "string", - "const": "ignored" - }, - { - "description": "The suggestion was superseded by a newer suggestion.", - "type": "string", - "const": "replaced" - }, - { - "description": "The request was cancelled before the agent returned a response.", - "type": "string", - "const": "cancelled" + } }, { - "title": "Other", - "description": "Custom or future rejection reason.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", - "type": "string" - } - ] - }, - "MessageMcpNotification": { - "description": "**UNSTABLE**\n\nNotification for an active request, sent from provider to consumer.\nIncludes subscription acknowledgements and updates.", - "type": "object", - "properties": { - "serverId": { - "description": "The declared ACP MCP server handling the associated request.", - "allOf": [ - { - "$ref": "#/$defs/McpServerAcpId" - } - ] - }, - "requestId": { - "description": "The identifier of the active inner MCP request.", + "$anchor": "proxyExchange", + "type": "object", "allOf": [ { - "$ref": "#/$defs/McpRequestId" + "$ref": "#rpcEnvelope" } - ] - }, - "method": { - "description": "The inner MCP method name.", - "type": "string" - }, - "params": { - "description": "Optional inner MCP params; null is equivalent to omission.", - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "_meta": { - "description": "ACP extension metadata (not inner MCP params._meta); null is equivalent to omission.", - "type": [ - "object", - "null" ], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": [ - "serverId", - "requestId", - "method" - ], - "x-side": "agent", - "x-method": "mcp/message" - }, - "ProtocolLevelNotification": { - "description": "A JSON-RPC notification object.", - "type": "object", - "properties": { - "method": { - "description": "The notification method name.", - "type": "string" - }, - "params": { - "description": "Method-specific notification parameters.", - "anyOf": [ - { - "description": "General protocol-level notifications that all sides are expected to\nimplement.\n\nNotifications whose methods start with '$/' are messages which\nare protocol implementation dependent and might not be implementable in all\nclients or agents. For example if the implementation uses a single threaded\nsynchronous programming language then there is little it can do to react to\na `$/cancel_request` notification. If an agent or client receives\nnotifications starting with '$/' it is free to ignore the notification.\n\nNotifications do not expect a response.", - "anyOf": [ + "if": { + "required": [ + "method" + ], + "properties": { + "method": true + } + }, + "then": { + "if": { + "required": [ + "id" + ], + "properties": { + "id": true + } + }, + "then": { + "oneOf": [ { - "title": "CancelRequestNotification", - "description": "Cancels an ongoing request.\n\nThis is a notification sent by the side that sent a request to cancel that request.\n\nUpon receiving this notification, the receiver:\n\n1. MAY cancel the corresponding request activity and all nested activities\n2. MAY send any pending notifications.\n3. MUST send one of these responses for the original request:\n - Valid response with appropriate data (partial results or cancellation marker)\n - Error response with code `-32800` (Cancelled)\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/cancellation)", - "allOf": [ - { - "$ref": "#/$defs/CancelRequestNotification" + "properties": { + "method": { + "const": "proxy/initialize" + }, + "params": { + "$ref": "#/$defs/InitializeProxyRequest" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "proxy/successor" + }, + "params": { + "$ref": "#/$defs/ProxySuccessorRequest" } + }, + "required": [ + "params" ] } ] }, - { - "type": "null" - } - ] - } - }, - "required": [ - "method" - ], - "x-docs-ignore": true - }, - "CancelRequestNotification": { - "description": "Notification to cancel an ongoing request.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/cancellation)", - "type": "object", - "properties": { - "requestId": { - "description": "The ID of the request to cancel.", - "allOf": [ - { - "$ref": "#/$defs/RequestId" + "else": { + "oneOf": [ + { + "properties": { + "method": { + "const": "proxy/successor" + }, + "params": { + "$ref": "#/$defs/ProxySuccessorNotification" + } + }, + "required": [ + "params" + ] + }, + { + "properties": { + "method": { + "const": "$/cancel_request" + }, + "params": { + "$ref": "#/$defs/CancelRequestNotification" + } + }, + "required": [ + "params" + ] + } + ] } - ] - }, - "_meta": { - "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", - "type": [ - "object", - "null" - ], - "x-deserialize-default-on-error": true, - "additionalProperties": true + } } - }, - "required": [ - "requestId" - ], - "x-side": "protocol", - "x-method": "$/cancel_request" + ] } - } + ] } diff --git a/scripts/_schema_semantics.py b/scripts/_schema_semantics.py index e3189194..d9fb0766 100644 --- a/scripts/_schema_semantics.py +++ b/scripts/_schema_semantics.py @@ -1,9 +1,10 @@ from __future__ import annotations +from collections.abc import Callable from dataclasses import dataclass, field from importlib import import_module from pathlib import Path -from typing import Protocol, cast +from typing import Any, Protocol, cast ROOT = Path(__file__).resolve().parents[1] @@ -24,6 +25,9 @@ class SchemaSemantics: model_name_map: dict[str, str] compatibility_aliases: str = "" field_type_overrides: dict[str, str] = field(default_factory=dict) + base_class_map: dict[str, str] = field(default_factory=dict) + validate_renamed_models: bool = False + prepare_schema: Callable[[dict[str, Any]], None] | None = None class _SemanticsModule(Protocol): diff --git a/scripts/gen_meta.py b/scripts/gen_meta.py index b0e31cd3..d9edb0f4 100644 --- a/scripts/gen_meta.py +++ b/scripts/gen_meta.py @@ -55,6 +55,17 @@ def render_meta(*, protocol_version: int = 1) -> str: agent_methods = data.get("agentMethods", {}) client_methods = data.get("clientMethods", {}) protocol_methods = data.get("protocolMethods") + proxy_methods = data.get("proxyMethods") if protocol_version == 2 else None + method_schemas = None + if protocol_version == 2: + schema = json.loads((schema_dir / "schema.json").read_text("utf-8")) + method_schemas = { + side: { + method: {kind: ref.removeprefix("#/$defs/") for kind, ref in payloads.items()} + for method, payloads in methods.items() + } + for side, methods in schema["x-methods"].items() + } version = data.get("version", 1) header_lines = [f"# Generated from {meta_json.relative_to(ROOT).as_posix()}. Do not edit by hand."] if version_file.exists(): @@ -68,6 +79,8 @@ def render_meta(*, protocol_version: int = 1) -> str: + f"AGENT_METHODS = {json.dumps(agent_methods, indent=4)}\n" + f"CLIENT_METHODS = {json.dumps(client_methods, indent=4)}\n" + (f"PROTOCOL_METHODS = {json.dumps(protocol_methods, indent=4)}\n" if protocol_methods is not None else "") + + (f"PROXY_METHODS = {json.dumps(proxy_methods, indent=4)}\n" if proxy_methods is not None else "") + + (f"METHOD_SCHEMAS = {json.dumps(method_schemas, indent=4)}\n" if method_schemas is not None else "") + f"PROTOCOL_VERSION = {int(version)}\n" ) result = subprocess.run( # noqa: S603 diff --git a/scripts/gen_schema.py b/scripts/gen_schema.py index 6c9f0ab8..1b24415b 100644 --- a/scripts/gen_schema.py +++ b/scripts/gen_schema.py @@ -89,6 +89,8 @@ def render_schema(semantics: SchemaSemantics) -> str: raise FileNotFoundError(f"{schema_json.relative_to(ROOT)} is missing; fetch a pinned schema release first") schema = json.loads(schema_json.read_text(encoding="utf-8")) + if semantics.prepare_schema is not None: + semantics.prepare_schema(schema) generated = generate( schema, input_file_type=InputFileType.JsonSchema, @@ -98,13 +100,16 @@ def render_schema(semantics: SchemaSemantics) -> str: skip_root_model=True, output_model_type=DataModelType.PydanticV2BaseModel, base_class=semantics.base_class, + base_class_map=semantics.base_class_map, use_specialized_enum=False, use_standard_collections=False, use_union_operator=False, additional_imports=["enum.Enum"], enum_field_as_literal=LiteralType.All, use_one_literal_as_default=True, - validators=_build_validators_config(schema), + validators=_build_validators_config( + schema, semantics.model_name_map if semantics.validate_renamed_models else {} + ), formatters=[Formatter.BUILTIN], infer_union_variant_names=True, naming_strategy=NamingStrategy.PrimaryFirst, @@ -128,7 +133,7 @@ def render_schema(semantics: SchemaSemantics) -> str: return _format_python(f"{source}\n", semantics.schema_out) -def _build_validators_config(schema: dict[str, Any]) -> dict[str, ModelValidators]: +def _build_validators_config(schema: dict[str, Any], model_names: dict[str, str]) -> dict[str, ModelValidators]: validators: dict[str, list[ValidatorDefinition]] = { "InitializeRequest": [ ValidatorDefinition( @@ -142,7 +147,8 @@ def _build_validators_config(schema: dict[str, Any]) -> dict[str, ModelValidator if not isinstance(definition, dict): continue default_fields, skip_fields = _deserialize_field_specs(definition) - definitions = validators.setdefault(class_name, []) + generated_name = model_names.get(f"#/$defs/{class_name}", class_name) + definitions = validators.setdefault(generated_name, []) definitions.extend( ValidatorDefinition(fields=sorted(fields), function=function, mode=ValidatorMode.WRAP) for fields, function in ( @@ -151,6 +157,17 @@ def _build_validators_config(schema: dict[str, Any]) -> dict[str, ModelValidator ) if fields ) + null_fields = sorted( + to_snake(name) + for name, field in definition.get("properties", {}).items() + if field.get("x-deserialize-default-on-null") and field.get("default") == [] + ) + if null_fields: + definitions.append( + ValidatorDefinition( + fields=null_fields, function="acp._deserialize.empty_list_on_null", mode=ValidatorMode.BEFORE + ) + ) return { class_name: ModelValidators(validators=definitions) for class_name, definitions in validators.items() diff --git a/scripts/gen_schema_v2.py b/scripts/gen_schema_v2.py index 980072d8..bb2a5e1b 100644 --- a/scripts/gen_schema_v2.py +++ b/scripts/gen_schema_v2.py @@ -1,5 +1,7 @@ from __future__ import annotations +from typing import Any + from ._schema_semantics import ( ROOT, SchemaSemantics, @@ -9,6 +11,7 @@ MODEL_NAME_MAP = { "#/$defs/AvailableCommandsUpdate": "AvailableCommandsUpdateBase", + "#/$defs/CancelledPermissionOutcome": "CancelledPermissionOutcomeBase", "#/$defs/ConfigOptionUpdate": "ConfigOptionUpdateBase", "#/$defs/SessionInfoUpdate": "SessionInfoUpdateBase", "#/$defs/StringMultiSelectItems": "StringMultiSelectItemsBase", @@ -17,8 +20,22 @@ for variant_names in ( variant_model_map("AgentResponse", "anyOf", "object", ("AgentResponseMessage", "AgentErrorMessage")), variant_model_map("ClientResponse", "anyOf", "object", ("ClientResponseMessage", "ClientErrorMessage")), + variant_model_map("ProxyResponse", "anyOf", "object", ("ProxyResponseMessage", "ProxyErrorMessage")), variant_model_map("AuthMethod", "anyOf", "allOf", ("TerminalAuthMethod", "AgentAuthMethod")), + variant_model_map("AvailableCommand", "anyOf", "allOf", ("SlashCommand", "SkillCommand")), variant_model_map("AvailableCommandInput", "anyOf", "allOf", ("TextAvailableCommandInput",)), + variant_model_map( + "BackgroundWork", + "anyOf", + "allOf", + ("TerminalBackgroundWork", "ToolCallBackgroundWork", "SubagentBackgroundWork"), + ), + variant_model_map( + "InitialSessionConfigOption", + "anyOf", + "object", + ("InitialIdConfigOption", "InitialBooleanConfigOption", "OtherInitialConfigOption"), + ), variant_model_map( "ContentBlock", "anyOf", @@ -29,6 +46,7 @@ "AudioContentBlock", "ResourceContentBlock", "EmbeddedResourceContentBlock", + "SkillContentBlock", ), ), variant_model_map( @@ -38,6 +56,19 @@ ("AddDiffChange", "DeleteDiffChange", "ModifyDiffChange", "MoveDiffChange", "CopyDiffChange"), ), variant_model_map("McpServer", "anyOf", "allOf", ("HttpMcpServer", "AcpMcpServer", "StdioMcpServer")), + variant_model_map( + "CursorAnchor", + "anyOf", + "allOf", + ( + "UserMessageCursorAnchor", + "AgentMessageCursorAnchor", + "AgentThoughtCursorAnchor", + "SessionMessageCursorAnchor", + "ToolCallCursorAnchor", + "CompactionCursorAnchor", + ), + ), variant_model_map("ReplayFrom", "anyOf", "allOf", ("ReplayFromStartVariant",)), variant_model_map( "RequestPermissionSubject", @@ -61,36 +92,14 @@ "ToolCallContent", "anyOf", "allOf", - ("ContentToolCallContent", "DiffToolCallContent", "TerminalToolCallContent"), + ("ContentToolCallContent", "DiffToolCallContent", "TerminalToolCallContent", "SessionToolCallContent"), ), + variant_model_map("PlanUpdateContent", "anyOf", "allOf", ("PlanUpdateItems", "PlanUpdateMarkdown")), variant_model_map( - "PlanUpdateContent", - "anyOf", - "allOf", - ("PlanUpdateItems", "PlanUpdateFile", "PlanUpdateMarkdown"), + "ElicitationFormMode", "oneOf", "allOf", ("ElicitationFormSessionMode", "ElicitationFormRequestMode") ), variant_model_map( - "NesSuggestion", - "anyOf", - "allOf", - ( - "NesEditSuggestionVariant", - "NesJumpSuggestionVariant", - "NesRenameSuggestionVariant", - "NesSearchAndReplaceSuggestionVariant", - ), - ), - variant_model_map( - "ElicitationFormMode", - "anyOf", - "allOf", - ("ElicitationFormSessionMode", "ElicitationFormRequestMode"), - ), - variant_model_map( - "ElicitationUrlMode", - "anyOf", - "allOf", - ("ElicitationUrlSessionMode", "ElicitationUrlRequestMode"), + "ElicitationUrlMode", "oneOf", "allOf", ("ElicitationUrlSessionMode", "ElicitationUrlRequestMode") ), variant_model_map( "ElicitationPropertySchema", @@ -130,6 +139,9 @@ "SessionNotice", "SessionCompactionUpdate", "SessionCompactionSummaryChunk", + "SessionReplayComplete", + "SessionPromptSuggestionsUpdate", + "SessionCursorUpdate", "SessionSubagentUpdate", "SessionMessageUpdate", "SessionMessageChunkUpdate", @@ -139,15 +151,18 @@ MODEL_NAME_MAP.update(variant_names) MODEL_NAME_MAP.update({ + inline_model_ref("BackgroundWork", ("anyOf", 3), ("object", None)): "OtherBackgroundWork", inline_model_ref("MessageMcpResponse", ("anyOf", 0), ("object", None)): "McpResultResponse", inline_model_ref("MessageMcpResponse", ("anyOf", 1), ("object", None)): "McpErrorResponse", inline_model_ref("AuthMethod", ("anyOf", 2), ("object", None)): "OtherAuthMethod", + inline_model_ref("AvailableCommand", ("anyOf", 2), ("object", None)): "OtherAvailableCommand", inline_model_ref("AvailableCommandInput", ("anyOf", 1), ("object", None)): "OtherAvailableCommandInput", - inline_model_ref("ContentBlock", ("anyOf", 5), ("object", None)): "OtherContentBlock", + inline_model_ref("ContentBlock", ("anyOf", 6), ("object", None)): "OtherContentBlock", + inline_model_ref("CursorAnchor", ("anyOf", 6), ("object", None)): "OtherCursorAnchor", inline_model_ref("DiffChange", ("anyOf", 5), ("object", None)): "OtherDiffChange", inline_model_ref("McpServer", ("anyOf", 3), ("object", None)): "OtherMcpServer", inline_model_ref("ReplayFrom", ("anyOf", 1), ("object", None)): "OtherReplayFrom", - inline_model_ref("RequestPermissionOutcome", ("anyOf", 0), ("object", None)): ("CancelledPermissionOutcome"), + inline_model_ref("RequestPermissionOutcome", ("anyOf", 0), ("allOf", None)): "CancelledPermissionOutcome", inline_model_ref("RequestPermissionOutcome", ("anyOf", 1), ("allOf", None)): ("SelectedPermissionOutcomeVariant"), inline_model_ref("RequestPermissionOutcome", ("anyOf", 2), ("object", None)): "OtherPermissionOutcome", inline_model_ref("RequestPermissionSubject", ("anyOf", 2), ("object", None)): "OtherPermissionSubject", @@ -162,12 +177,11 @@ "SetSessionConfigOptionOtherRequest" ), inline_model_ref("StateUpdate", ("anyOf", 4), ("object", None)): "OtherState", - inline_model_ref("ToolCallContent", ("anyOf", 3), ("object", None)): "OtherToolCallContent", - inline_model_ref("PlanUpdateContent", ("anyOf", 3), ("object", None)): "OtherPlanUpdateContent", - inline_model_ref("NesSuggestion", ("anyOf", 4), ("object", None)): "OtherNesSuggestion", + inline_model_ref("ToolCallContent", ("anyOf", 4), ("object", None)): "OtherToolCallContent", + inline_model_ref("PlanUpdateContent", ("anyOf", 2), ("object", None)): "OtherPlanUpdateContent", inline_model_ref("ElicitationPropertySchema", ("anyOf", 5), ("object", None)): ("ElicitationOtherPropertySchema"), inline_model_ref("MultiSelectItems", ("anyOf", 1), ("object", None)): "OtherMultiSelectItems", - inline_model_ref("SessionUpdate", ("anyOf", 23), ("object", None)): "OtherSessionUpdate", + inline_model_ref("SessionUpdate", ("anyOf", 26), ("object", None)): "OtherSessionUpdate", inline_model_ref("SessionUpdate", ("anyOf", 6), ("allOf", 0), ("allOf", None)): ("RunningSessionStateUpdateBase"), inline_model_ref("SessionUpdate", ("anyOf", 6), ("allOf", 1), ("allOf", None)): ("IdleSessionStateUpdateBase"), inline_model_ref("SessionUpdate", ("anyOf", 6), ("allOf", 2), ("allOf", None)): ( @@ -223,24 +237,100 @@ inline_model_ref("CreateElicitationRequest", ("anyOf", 1), ("allOf", None), ("union_model-1", None)): ( "CreateUrlRequestElicitationRequest" ), - inline_model_ref("CreateElicitationRequest", ("anyOf", 2), ("anyOf", 0), ("allOf", None)): ( + inline_model_ref("CreateElicitationRequest", ("anyOf", 2), ("oneOf", 0), ("allOf", None)): ( "CreateOtherSessionElicitationRequest" ), - inline_model_ref("CreateElicitationRequest", ("anyOf", 2), ("anyOf", 1), ("allOf", None)): ( + inline_model_ref("CreateElicitationRequest", ("anyOf", 2), ("oneOf", 1), ("allOf", None)): ( "CreateOtherRequestElicitationRequest" ), }) + +def _prepare_schema(schema: dict[str, Any]) -> None: + definitions = schema["$defs"] + for definition in definitions.values(): + for field in definition.get("properties", {}).values(): + if field.get("x-deserialize-default-on-null"): + field["default"] = [] + # A nested stop-reason union loses its fields when datamodel-code-generator + # composes it into SessionUpdate. Use the common nullable string discriminator + # and the error variant's optional details on one model. + idle = definitions["IdleStateUpdate"] + idle.pop("anyOf") + idle["properties"]["error"] = definitions["ErrorStopReason"]["properties"]["error"] + + # Keep select options as a direct list union instead of numbered RootModel + # wrappers; SessionConfigSelectModel enforces minItems: 1 at runtime. + for branch in definitions["SessionConfigSelectOptions"]["anyOf"]: + branch.pop("minItems", None) + + # Inline IdempotencyKey bounds onto PromptRequest so callers pass plain str. + idempotency_key = definitions.pop("IdempotencyKey") + prompt_key = definitions["PromptRequest"]["properties"]["idempotencyKey"] + prompt_key.pop("anyOf", None) + prompt_key.update( + type=["string", "null"], + minLength=idempotency_key["minLength"], + maxLength=idempotency_key["maxLength"], + ) + + # Keep the SDK's existing positional fork arguments ahead of the new cursor. + fork_fields = definitions["ForkSessionRequest"]["properties"] + fork_fields["cursorId"] = fork_fields.pop("cursorId") + + SEMANTICS = SchemaSemantics( schema_json=ROOT / "schema" / "v2" / "schema.json", version_file=ROOT / "schema" / "v2" / "VERSION", schema_out=ROOT / "src" / "acp" / "experimental" / "v2" / "schema.py", base_class="acp.experimental.v2._schema_base.BaseModel", - compatibility_aliases='MessageMcpResponse = Annotated[Union[McpResultResponse, McpErrorResponse], Field(union_mode="left_to_right")]', + compatibility_aliases="""\ +MessageMcpResponse = Annotated[Union[McpResultResponse, McpErrorResponse], Field(union_mode="left_to_right")] +IdempotencyKey = Annotated[str, Field(min_length=1, max_length=255)] +SetSessionConfigOptionRequest = ( + SetSessionConfigOptionIdRequest | SetSessionConfigOptionBooleanRequest | SetSessionConfigOptionOtherRequest +) +CreateElicitationRequest = ( + CreateOtherSessionElicitationRequest | CreateOtherRequestElicitationRequest + | CreateFormSessionElicitationRequest | CreateFormRequestElicitationRequest + | CreateUrlSessionElicitationRequest | CreateUrlRequestElicitationRequest +) +CreateElicitationResponse = ( + AcceptElicitationResponse | DeclineElicitationResponse | CancelElicitationResponse | OtherElicitationResponse +) +ProxySuccessorResponse = Any +""", model_name_map=MODEL_NAME_MAP, - # Preserve nullable object value types and reject non-integer MCP error codes. + validate_renamed_models=True, + prepare_schema=_prepare_schema, + base_class_map={ + "Error": "acp.experimental.v2._schema_base.ErrorModel", + "IdleStateUpdate": "acp.experimental.v2._schema_base.IdleStateUpdateModel", + "SessionConfigSelect": "acp.experimental.v2._schema_base.SessionConfigSelectModel", + **dict.fromkeys( + ( + "AgentNotification", + "AgentRequest", + "ClientNotification", + "ClientRequest", + "ProxyNotification", + "ProxyRequest", + ), + "acp.experimental.v2._schema_base.MethodParamsModel", + ), + **dict.fromkeys( + ("ForkSessionRequest", "NewSessionRequest", "ResumeSessionRequest"), + "acp.experimental.v2._schema_base.InitialConfigRequestModel", + ), + }, field_type_overrides={ - "ElicitationAcceptAction.content": "acp._schema_base.ElicitationContent", + "ElicitationAcceptAction.content": "acp.experimental.v2._schema_base.ElicitationContent", + "Error.code": "pydantic.StrictInt", + "Error.data": "typing.Any", "McpError.code": "pydantic.StrictInt", + # A successor's result stays opaque until the originating method is known. + "ProxyResponseMessage.result": "typing.Any", + "InitialBooleanConfigOption.value": "pydantic.StrictBool", + "SetSessionConfigOptionBooleanRequest.value": "pydantic.StrictBool", }, ) diff --git a/scripts/gen_signature.py b/scripts/gen_signature.py index ef6c171f..5af696af 100644 --- a/scripts/gen_signature.py +++ b/scripts/gen_signature.py @@ -180,7 +180,9 @@ def _to_param_def(self, name: str, field: FieldInfo) -> tuple[ast.arg, ast.expr else: if field.default is PydanticUndefined: default = None - elif isinstance(field.default, dict | BaseModel): + elif isinstance(field.default, dict | list | BaseModel): + if ann is not None and not _allows_none(ann): + ann = ann | None default = ast.Constant(None) else: default = ast.Constant(value=field.default) @@ -252,6 +254,16 @@ def _format_literal(self, annotation: t.Any) -> ast.expr: ) +def _allows_none(annotation: t.Any) -> bool: + while t.get_origin(annotation) is t.Annotated: + annotation = t.get_args(annotation)[0] + if annotation is None or annotation is type(None): + return True + if t.get_origin(annotation) in (t.Union, types.UnionType): + return any(_allows_none(arg) for arg in t.get_args(annotation)) + return False + + def gen_signature(source_dir: Path, *, protocol_version: int = 1) -> None: global schema schema = _load_schema_module() diff --git a/src/acp/_deserialize.py b/src/acp/_deserialize.py index 46e60232..dc530dfa 100644 --- a/src/acp/_deserialize.py +++ b/src/acp/_deserialize.py @@ -33,6 +33,11 @@ def use_default_on_error(value: Any, handler: Callable[[Any], Any], _info: Any = raise PydanticUseDefault() from None +def empty_list_on_null(value: Any, _info: Any = None) -> Any: + """Treat explicit null as the empty list for annotated receiver fields.""" + return [] if value is None else value + + def salvage_on_error(value: Any, handler: Callable[[Any], Any], fallback: Callable[[], Any]) -> Any: """Return ``fallback()`` when ``value`` fails validation, otherwise the validated value. diff --git a/src/acp/_schema_base.py b/src/acp/_schema_base.py index c5a05fb9..2bcfe2a5 100644 --- a/src/acp/_schema_base.py +++ b/src/acp/_schema_base.py @@ -94,6 +94,6 @@ def _reject_malformed_known_variant(cls, value: Any) -> Any: return value wire_field, reserved = rule tag = value.get(wire_field, value.get(to_snake(wire_field))) - if tag in reserved: + if isinstance(tag, str) and tag in reserved: raise ValueError(f"{wire_field} value is reserved by a known variant") return value diff --git a/src/acp/experimental/v2/_params.py b/src/acp/experimental/v2/_params.py index 6b21a3b7..805e0375 100644 --- a/src/acp/experimental/v2/_params.py +++ b/src/acp/experimental/v2/_params.py @@ -46,7 +46,7 @@ def build_elicitation_request( url: str | AnyUrl | None, meta: dict[str, Any], ) -> CreateElicitationRequest: - if session_id is not None and request_id is not None: + if (session_id is None) == (request_id is None): raise ValueError("Specify either session_id or request_id") if session_id is None and tool_call_id is not None: raise ValueError("tool_call_id requires session_id") diff --git a/src/acp/experimental/v2/_schema_base.py b/src/acp/experimental/v2/_schema_base.py index b63d4b32..508e82db 100644 --- a/src/acp/experimental/v2/_schema_base.py +++ b/src/acp/experimental/v2/_schema_base.py @@ -1,7 +1,18 @@ -from typing import ClassVar +from __future__ import annotations + +from functools import cache +from typing import Any, ClassVar + +from pydantic import TypeAdapter, ValidationInfo, ValidatorFunctionWrapHandler, field_validator, model_validator +from pydantic.alias_generators import to_snake from acp._schema_base import BaseModel as _BaseModel +from .meta import METHOD_SCHEMAS + +ElicitationContent = dict[str, Any] +_NON_ERROR_STOP_REASONS = frozenset({None, "end_turn", "max_tokens", "max_turn_requests", "refusal", "cancelled"}) + class BaseModel(_BaseModel): """Runtime behavior shared by generated ACP v2 schema models.""" @@ -10,14 +21,20 @@ class BaseModel(_BaseModel): # open unions, so catch-all variants must reject tags owned by known variants. _reserved_tags: ClassVar[dict[str, tuple[str, frozenset[str]]]] = { "OtherAuthMethod": ("type", frozenset({"agent", "terminal"})), + "OtherAvailableCommand": ("type", frozenset({"command", "skill"})), "OtherAvailableCommandInput": ("type", frozenset({"text"})), - "OtherContentBlock": ("type", frozenset({"audio", "image", "resource", "resource_link", "text"})), + "OtherBackgroundWork": ("type", frozenset({"subagent", "terminal", "tool_call"})), + "OtherContentBlock": ("type", frozenset({"audio", "image", "resource", "resource_link", "skill", "text"})), + "OtherCursorAnchor": ( + "type", + frozenset({"user_message", "agent_message", "agent_thought", "session_message", "tool_call", "compaction"}), + ), "OtherDiffChange": ("operation", frozenset({"add", "copy", "delete", "modify", "move"})), + "OtherInitialConfigOption": ("type", frozenset({"boolean", "id"})), "OtherMcpServer": ("type", frozenset({"acp", "http", "stdio"})), - "OtherNesSuggestion": ("kind", frozenset({"edit", "jump", "rename", "searchAndReplace"})), "OtherPermissionOutcome": ("outcome", frozenset({"cancelled", "selected"})), "OtherPermissionSubject": ("type", frozenset({"command", "tool_call"})), - "OtherPlanUpdateContent": ("type", frozenset({"file", "items", "markdown"})), + "OtherPlanUpdateContent": ("type", frozenset({"items", "markdown"})), "OtherReplayFrom": ("type", frozenset({"start"})), "OtherSessionConfigOption": ("type", frozenset({"boolean", "select"})), "OtherSessionStateUpdate": ("state", frozenset({"idle", "requires_action", "running", "unknown"})), @@ -35,6 +52,9 @@ class BaseModel(_BaseModel): "notice", "plan_removed", "plan_update", + "cursor_update", + "prompt_suggestions_update", + "replay_complete", "session_info_update", "state_update", "terminal_output_chunk", @@ -50,7 +70,7 @@ class BaseModel(_BaseModel): }), ), "OtherState": ("state", frozenset({"idle", "requires_action", "running", "unknown"})), - "OtherToolCallContent": ("type", frozenset({"content", "diff", "terminal"})), + "OtherToolCallContent": ("type", frozenset({"content", "diff", "session", "terminal"})), "SetSessionConfigOptionOtherRequest": ("type", frozenset({"boolean", "id"})), "CreateOtherSessionElicitationRequest": ("mode", frozenset({"form", "url"})), "CreateOtherRequestElicitationRequest": ("mode", frozenset({"form", "url"})), @@ -61,3 +81,120 @@ class BaseModel(_BaseModel): ), "OtherMultiSelectItems": ("type", frozenset({"string"})), } + + @model_validator(mode="before") + @classmethod + def _validate_elicitation_fields(cls, value: Any) -> Any: + if not isinstance(value, dict): + return value + if cls.__name__ == "TitledMultiSelectItems" and "type" in value: + raise ValueError("Titled multi-select items must omit type") + scopes = {base.__name__ for base in cls.__mro__} + if "ElicitationRequestScope" in scopes: + forbidden = ("sessionId", "toolCallId") + elif "ElicitationSessionScope" in scopes: + forbidden = ("requestId",) + else: + return value + if any(key in value or to_snake(key) in value for key in forbidden): + raise ValueError("Elicitation must select one scope") + return value + + @model_validator(mode="after") + def _validate_mcp_attribution(self) -> BaseModel: + if ( + type(self).__name__ == "MessageMcpRequest" + and self.__dict__.get("tool_call_id") is not None + and self.__dict__.get("session_id") is None + ): + raise ValueError("tool_call_id requires session_id") + return self + + +class ErrorModel(BaseModel): + @model_validator(mode="after") + def _validate_version_error_data(self) -> ErrorModel: + if self.__dict__.get("code") == -32022: + from .schema import UnsupportedProtocolVersionErrorData + + self.__dict__["data"] = UnsupportedProtocolVersionErrorData.model_validate(self.__dict__.get("data")) + return self + + +class IdleStateUpdateModel(BaseModel): + @model_validator(mode="after") + def _validate_error_stop_reason(self) -> IdleStateUpdateModel: + if self.__dict__.get("error") is not None and self.__dict__.get("stop_reason") in _NON_ERROR_STOP_REASONS: + raise ValueError("error is only valid when stopReason is 'error'") + return self + + +class SessionConfigSelectModel(BaseModel): + @model_validator(mode="after") + def _validate_non_empty_options(self) -> SessionConfigSelectModel: + if not self.__dict__.get("options"): + raise ValueError("options must contain at least one item") + return self + + +@cache +def _payload_adapter(model_name: str) -> TypeAdapter[Any]: + from . import schema + + return TypeAdapter(getattr(schema, model_name)) + + +class MethodParamsModel(BaseModel): + # Envelope names identify the sender. The schema registry is keyed by receiver. + _payload_route: ClassVar[dict[str, tuple[str, str]]] = { + "AgentNotification": ("client", "notification"), + "AgentRequest": ("client", "request"), + "ClientNotification": ("agent", "notification"), + "ClientRequest": ("agent", "request"), + "ProxyNotification": ("proxy", "notification"), + "ProxyRequest": ("proxy", "request"), + } + + @classmethod + def _resolve_method_payload(cls, method: str, value: Any) -> Any: + side, kind = next( + cls._payload_route[base.__name__] for base in cls.__mro__ if base.__name__ in cls._payload_route + ) + method_spec = METHOD_SCHEMAS[side].get(method) + if method_spec is None and kind == "notification" and side != "proxy": + method_spec = METHOD_SCHEMAS.get("protocol", {}).get(method) + if method_spec is not None: + model_name = method_spec.get(kind) + if model_name is None: + raise ValueError(f"{method!r} is not a valid {side} {kind}") + adapter = _payload_adapter(model_name) + if value is None: + adapter.validate_python({}) + return None + return adapter.validate_python(value) + if side != "proxy" and method.startswith("_"): + return value + raise ValueError(f"Unknown {side} {kind} method: {method!r}") + + @field_validator("params", mode="wrap", check_fields=False) + @classmethod + def _validate_method_params(cls, value: Any, _handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + method = info.data.get("method") if info.data is not None else None + if not isinstance(method, str): + return value + return cls._resolve_method_payload(method, value) + + @model_validator(mode="after") + def _validate_omitted_params(self) -> MethodParamsModel: + if "params" not in self.model_fields_set: + self._resolve_method_payload(self.__dict__["method"], None) + return self + + +class InitialConfigRequestModel(BaseModel): + @model_validator(mode="after") + def _validate_config_ids(self) -> InitialConfigRequestModel: + options = self.__dict__.get("config_options", ()) + if len({option.config_id for option in options}) != len(options): + raise ValueError("configOptions contains duplicate configId values") + return self diff --git a/src/acp/experimental/v2/agent.py b/src/acp/experimental/v2/agent.py index ab829105..3b30b07a 100644 --- a/src/acp/experimental/v2/agent.py +++ b/src/acp/experimental/v2/agent.py @@ -2,7 +2,7 @@ import asyncio from collections.abc import Callable -from typing import Any +from typing import Any, Literal from pydantic import AnyUrl, BaseModel @@ -141,6 +141,9 @@ async def session_update( | schema.SessionNotice | schema.SessionCompactionUpdate | schema.SessionCompactionSummaryChunk + | schema.SessionReplayComplete + | schema.SessionPromptSuggestionsUpdate + | schema.SessionCursorUpdate | schema.SessionSubagentUpdate | schema.SessionMessageUpdate | schema.SessionMessageChunkUpdate @@ -159,13 +162,27 @@ async def session_update( @param_model(schema.MessageMcpRequest) async def mcp_message( - self, server_id: str, request_id: str, method: str, params: dict[str, Any] | None = None, **kwargs: Any + self, + server_id: str, + request_id: str, + method: str, + params: dict[str, Any] | None = None, + session_id: str | None = None, + tool_call_id: str | None = None, + **kwargs: Any, ) -> schema.MessageMcpResponse: return await self._request( CLIENT_METHODS["mcp_message"], build_request( schema.MessageMcpRequest, - {"server_id": server_id, "request_id": request_id, "method": method, "params": params}, + { + "server_id": server_id, + "request_id": request_id, + "method": method, + "params": params, + "session_id": session_id, + "tool_call_id": tool_call_id, + }, kwargs, ), ) @@ -204,6 +221,22 @@ async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None build_request(schema.CompleteElicitationNotification, {"elicitation_id": elicitation_id}, kwargs), ) + @param_model(schema.AuthStatusUpdateNotification) + async def auth_status_update( + self, + state: Literal["authenticated"] + | Literal["unauthenticated"] + | Literal["not_required"] + | Literal["unknown"] + | str, + accounts: list[schema.AuthAccount] | None = None, + **kwargs: Any, + ) -> None: + await self._notify( + CLIENT_METHODS["auth_status_update"], + build_request(schema.AuthStatusUpdateNotification, {"state": state, "accounts": accounts}, kwargs), + ) + async def send_extension_request(self, method: str, params: Any = None) -> Any: await self._state.require(method) return await self._conn.send_request(_extension_method(method), params) diff --git a/src/acp/experimental/v2/client.py b/src/acp/experimental/v2/client.py index 2db21aea..d1907e52 100644 --- a/src/acp/experimental/v2/client.py +++ b/src/acp/experimental/v2/client.py @@ -9,9 +9,7 @@ from . import schema from ._connection import open_connection from ._initialization import InitializationState -from ._methods import ( - AGENT_REQUESTS_BY_METHOD, -) +from ._methods import AGENT_REQUESTS_BY_METHOD from ._params import build_config_request, build_request from ._router import MethodRouter from .agent import _dump, _extension_method @@ -124,24 +122,39 @@ async def new_session( additional_directories: list[str] | None = None, mcp_servers: list[schema.HttpMcpServer | schema.AcpMcpServer | schema.StdioMcpServer | schema.OtherMcpServer] | None = None, + system_prompt: schema.SystemPrompt | None = None, + config_options: list[ + schema.InitialIdConfigOption | schema.InitialBooleanConfigOption | schema.OtherInitialConfigOption + ] + | None = None, **kwargs: Any, ) -> schema.NewSessionResponse: return await self._request( AGENT_METHODS["session_new"], build_request( schema.NewSessionRequest, - {"cwd": cwd, "additional_directories": additional_directories, "mcp_servers": mcp_servers}, + { + "cwd": cwd, + "additional_directories": additional_directories, + "mcp_servers": mcp_servers, + "system_prompt": system_prompt, + "config_options": config_options, + }, kwargs, ), ) @param_model(schema.ListSessionsRequest) async def list_sessions( - self, cwd: str | None = None, cursor: str | None = None, **kwargs: Any + self, + cwd: str | None = None, + cursor: str | None = None, + archived: Literal["exclude"] | Literal["include"] | Literal["only"] | str | None = None, + **kwargs: Any, ) -> schema.ListSessionsResponse: return await self._request( AGENT_METHODS["session_list"], - build_request(schema.ListSessionsRequest, {"cwd": cwd, "cursor": cursor}, kwargs), + build_request(schema.ListSessionsRequest, {"cwd": cwd, "cursor": cursor, "archived": archived}, kwargs), ) @param_model(schema.DeleteSessionRequest) @@ -159,6 +172,12 @@ async def fork_session( additional_directories: list[str] | None = None, mcp_servers: list[schema.HttpMcpServer | schema.AcpMcpServer | schema.StdioMcpServer | schema.OtherMcpServer] | None = None, + system_prompt: schema.SystemPrompt | None = None, + config_options: list[ + schema.InitialIdConfigOption | schema.InitialBooleanConfigOption | schema.OtherInitialConfigOption + ] + | None = None, + cursor_id: str | None = None, **kwargs: Any, ) -> schema.ForkSessionResponse: return await self._request( @@ -170,6 +189,9 @@ async def fork_session( "cwd": cwd, "additional_directories": additional_directories, "mcp_servers": mcp_servers, + "system_prompt": system_prompt, + "config_options": config_options, + "cursor_id": cursor_id, }, kwargs, ), @@ -184,6 +206,11 @@ async def resume_session( mcp_servers: list[schema.HttpMcpServer | schema.AcpMcpServer | schema.StdioMcpServer | schema.OtherMcpServer] | None = None, replay_from: schema.ReplayFromStartVariant | schema.OtherReplayFrom | None = None, + system_prompt: schema.SystemPrompt | None = None, + config_options: list[ + schema.InitialIdConfigOption | schema.InitialBooleanConfigOption | schema.OtherInitialConfigOption + ] + | None = None, **kwargs: Any, ) -> schema.ResumeSessionResponse: return await self._request( @@ -196,6 +223,8 @@ async def resume_session( "additional_directories": additional_directories, "mcp_servers": mcp_servers, "replay_from": replay_from, + "system_prompt": system_prompt, + "config_options": config_options, }, kwargs, ), @@ -231,13 +260,19 @@ async def prompt( | schema.AudioContentBlock | schema.ResourceContentBlock | schema.EmbeddedResourceContentBlock + | schema.SkillContentBlock | schema.OtherContentBlock ], + idempotency_key: str | None = None, **kwargs: Any, ) -> schema.PromptResponse: return await self._request( AGENT_METHODS["session_prompt"], - build_request(schema.PromptRequest, {"session_id": session_id, "prompt": prompt}, kwargs), + build_request( + schema.PromptRequest, + {"session_id": session_id, "prompt": prompt, "idempotency_key": idempotency_key}, + kwargs, + ), ) @param_model(schema.CancelSessionNotification) @@ -260,157 +295,67 @@ async def notify_mcp( ), ) - @param_model(schema.StartNesRequest) - async def start_nes( - self, - workspace_uri: str | AnyUrl | None = None, - workspace_folders: list[schema.WorkspaceFolder] | None = None, - repository: schema.NesRepository | None = None, - **kwargs: Any, - ) -> schema.StartNesResponse: + @param_model(schema.AuthStatusRequest) + async def auth_status(self, **kwargs: Any) -> schema.AuthStatusResponse: + return await self._request(AGENT_METHODS["auth_status"], build_request(schema.AuthStatusRequest, {}, kwargs)) + + @param_model(schema.ArchiveSessionRequest) + async def archive_session(self, session_id: str, **kwargs: Any) -> schema.ArchiveSessionResponse: return await self._request( - AGENT_METHODS["nes_start"], - build_request( - schema.StartNesRequest, - {"workspace_uri": workspace_uri, "workspace_folders": workspace_folders, "repository": repository}, - kwargs, - ), + AGENT_METHODS["session_archive"], + build_request(schema.ArchiveSessionRequest, {"session_id": session_id}, kwargs), ) - @param_model(schema.SuggestNesRequest) - async def suggest_nes( - self, - session_id: str, - uri: str | AnyUrl, - version: int, - position: schema.Position, - trigger_kind: Literal["automatic"] | Literal["diagnostic"] | Literal["manual"] | str, - selection: schema.Range | None = None, - context: schema.NesSuggestContext | None = None, - **kwargs: Any, - ) -> schema.SuggestNesResponse: + @param_model(schema.UnarchiveSessionRequest) + async def unarchive_session(self, session_id: str, **kwargs: Any) -> schema.UnarchiveSessionResponse: return await self._request( - AGENT_METHODS["nes_suggest"], - build_request( - schema.SuggestNesRequest, - { - "session_id": session_id, - "uri": uri, - "version": version, - "position": position, - "trigger_kind": trigger_kind, - "selection": selection, - "context": context, - }, - kwargs, - ), + AGENT_METHODS["session_unarchive"], + build_request(schema.UnarchiveSessionRequest, {"session_id": session_id}, kwargs), ) - @param_model(schema.AcceptNesNotification) - async def accept_nes(self, session_id: str, suggestion_id: str, **kwargs: Any) -> None: - await self._notify( - AGENT_METHODS["nes_accept"], - build_request( - schema.AcceptNesNotification, {"session_id": session_id, "suggestion_id": suggestion_id}, kwargs - ), + @param_model(schema.SessionStatusRequest) + async def session_status(self, session_id: str, **kwargs: Any) -> schema.SessionStatusResponse: + return await self._request( + AGENT_METHODS["session_status"], + build_request(schema.SessionStatusRequest, {"session_id": session_id}, kwargs), ) - @param_model(schema.RejectNesNotification) - async def reject_nes( - self, - session_id: str, - suggestion_id: str, - reason: Literal["rejected"] - | Literal["ignored"] - | Literal["replaced"] - | Literal["cancelled"] - | str - | None = None, - **kwargs: Any, - ) -> None: - await self._notify( - AGENT_METHODS["nes_reject"], + @param_model(schema.SessionOptionsRequest) + async def session_options( + self, cwd: str, additional_directories: list[str] | None = None, session_id: str | None = None, **kwargs: Any + ) -> schema.SessionOptionsResponse: + return await self._request( + AGENT_METHODS["session_options"], build_request( - schema.RejectNesNotification, - {"session_id": session_id, "suggestion_id": suggestion_id, "reason": reason}, + schema.SessionOptionsRequest, + {"cwd": cwd, "additional_directories": additional_directories, "session_id": session_id}, kwargs, ), ) - @param_model(schema.CloseNesRequest) - async def close_nes(self, session_id: str, **kwargs: Any) -> schema.CloseNesResponse: + @param_model(schema.SetSessionTitleRequest) + async def set_session_title(self, session_id: str, title: str, **kwargs: Any) -> schema.SetSessionTitleResponse: return await self._request( - AGENT_METHODS["nes_close"], build_request(schema.CloseNesRequest, {"session_id": session_id}, kwargs) - ) - - @param_model(schema.DidOpenDocumentNotification) - async def did_open( - self, session_id: str, uri: str | AnyUrl, language_id: str, version: int, text: str, **kwargs: Any - ) -> None: - await self._notify( - AGENT_METHODS["document_did_open"], - build_request( - schema.DidOpenDocumentNotification, - {"session_id": session_id, "uri": uri, "language_id": language_id, "version": version, "text": text}, - kwargs, - ), + AGENT_METHODS["session_set_title"], + build_request(schema.SetSessionTitleRequest, {"session_id": session_id, "title": title}, kwargs), ) - @param_model(schema.DidChangeDocumentNotification) - async def did_change( - self, - session_id: str, - uri: str | AnyUrl, - version: int, - content_changes: list[schema.TextDocumentContentChangeEvent], - **kwargs: Any, - ) -> None: - await self._notify( - AGENT_METHODS["document_did_change"], + @param_model(schema.CancelToolCallRequest) + async def cancel_tool_call( + self, session_id: str, tool_call_id: str, **kwargs: Any + ) -> schema.CancelToolCallResponse: + return await self._request( + AGENT_METHODS["tool_call_cancel"], build_request( - schema.DidChangeDocumentNotification, - {"session_id": session_id, "uri": uri, "version": version, "content_changes": content_changes}, - kwargs, + schema.CancelToolCallRequest, {"session_id": session_id, "tool_call_id": tool_call_id}, kwargs ), ) - @param_model(schema.DidCloseDocumentNotification) - async def did_close(self, session_id: str, uri: str | AnyUrl, **kwargs: Any) -> None: - await self._notify( - AGENT_METHODS["document_did_close"], - build_request(schema.DidCloseDocumentNotification, {"session_id": session_id, "uri": uri}, kwargs), - ) - - @param_model(schema.DidSaveDocumentNotification) - async def did_save(self, session_id: str, uri: str | AnyUrl, **kwargs: Any) -> None: - await self._notify( - AGENT_METHODS["document_did_save"], - build_request(schema.DidSaveDocumentNotification, {"session_id": session_id, "uri": uri}, kwargs), - ) - - @param_model(schema.DidFocusDocumentNotification) - async def did_focus( - self, - session_id: str, - uri: str | AnyUrl, - version: int, - position: schema.Position, - visible_range: schema.Range, - **kwargs: Any, - ) -> None: - await self._notify( - AGENT_METHODS["document_did_focus"], - build_request( - schema.DidFocusDocumentNotification, - { - "session_id": session_id, - "uri": uri, - "version": version, - "position": position, - "visible_range": visible_range, - }, - kwargs, - ), + @param_model(schema.CancelTerminalRequest) + async def cancel_terminal(self, session_id: str, terminal_id: str, **kwargs: Any) -> schema.CancelTerminalResponse: + return await self._request( + AGENT_METHODS["terminal_cancel"], + build_request(schema.CancelTerminalRequest, {"session_id": session_id, "terminal_id": terminal_id}, kwargs), ) async def send_extension_request(self, method: str, params: Any = None) -> Any: diff --git a/src/acp/experimental/v2/interfaces.py b/src/acp/experimental/v2/interfaces.py index f5b84955..3897fe4f 100644 --- a/src/acp/experimental/v2/interfaces.py +++ b/src/acp/experimental/v2/interfaces.py @@ -11,25 +11,9 @@ from . import schema from .meta import AGENT_METHODS, CLIENT_METHODS -SetConfigOptionRequest = ( - schema.SetSessionConfigOptionIdRequest - | schema.SetSessionConfigOptionBooleanRequest - | schema.SetSessionConfigOptionOtherRequest -) -CreateElicitationRequest = ( - schema.CreateOtherSessionElicitationRequest - | schema.CreateOtherRequestElicitationRequest - | schema.CreateFormSessionElicitationRequest - | schema.CreateFormRequestElicitationRequest - | schema.CreateUrlSessionElicitationRequest - | schema.CreateUrlRequestElicitationRequest -) -CreateElicitationResponse = ( - schema.AcceptElicitationResponse - | schema.DeclineElicitationResponse - | schema.CancelElicitationResponse - | schema.OtherElicitationResponse -) +SetConfigOptionRequest = schema.SetSessionConfigOptionRequest +CreateElicitationRequest = schema.CreateElicitationRequest +CreateElicitationResponse = schema.CreateElicitationResponse class Agent(Protocol): @@ -78,12 +62,21 @@ async def new_session( additional_directories: list[str] | None = None, mcp_servers: list[schema.HttpMcpServer | schema.AcpMcpServer | schema.StdioMcpServer | schema.OtherMcpServer] | None = None, + system_prompt: schema.SystemPrompt | None = None, + config_options: list[ + schema.InitialIdConfigOption | schema.InitialBooleanConfigOption | schema.OtherInitialConfigOption + ] + | None = None, **kwargs: Any, ) -> schema.NewSessionResponse: ... @param_model(schema.ListSessionsRequest, method=AGENT_METHODS["session_list"]) async def list_sessions( - self, cwd: str | None = None, cursor: str | None = None, **kwargs: Any + self, + cwd: str | None = None, + cursor: str | None = None, + archived: Literal["exclude"] | Literal["include"] | Literal["only"] | str | None = None, + **kwargs: Any, ) -> schema.ListSessionsResponse: ... @param_model(schema.DeleteSessionRequest, method=AGENT_METHODS["session_delete"], default_result={}) @@ -97,6 +90,12 @@ async def fork_session( additional_directories: list[str] | None = None, mcp_servers: list[schema.HttpMcpServer | schema.AcpMcpServer | schema.StdioMcpServer | schema.OtherMcpServer] | None = None, + system_prompt: schema.SystemPrompt | None = None, + config_options: list[ + schema.InitialIdConfigOption | schema.InitialBooleanConfigOption | schema.OtherInitialConfigOption + ] + | None = None, + cursor_id: str | None = None, **kwargs: Any, ) -> schema.ForkSessionResponse: ... @@ -109,6 +108,11 @@ async def resume_session( mcp_servers: list[schema.HttpMcpServer | schema.AcpMcpServer | schema.StdioMcpServer | schema.OtherMcpServer] | None = None, replay_from: schema.ReplayFromStartVariant | schema.OtherReplayFrom | None = None, + system_prompt: schema.SystemPrompt | None = None, + config_options: list[ + schema.InitialIdConfigOption | schema.InitialBooleanConfigOption | schema.OtherInitialConfigOption + ] + | None = None, **kwargs: Any, ) -> schema.ResumeSessionResponse: ... @@ -136,8 +140,10 @@ async def prompt( | schema.AudioContentBlock | schema.ResourceContentBlock | schema.EmbeddedResourceContentBlock + | schema.SkillContentBlock | schema.OtherContentBlock ], + idempotency_key: str | None = None, **kwargs: Any, ) -> schema.PromptResponse: ... @@ -149,79 +155,35 @@ async def notify_mcp( self, server_id: str, request_id: str, method: str, params: dict[str, Any] | None = None, **kwargs: Any ) -> None: ... - @param_model(schema.StartNesRequest, method=AGENT_METHODS["nes_start"]) - async def start_nes( - self, - workspace_uri: str | AnyUrl | None = None, - workspace_folders: list[schema.WorkspaceFolder] | None = None, - repository: schema.NesRepository | None = None, - **kwargs: Any, - ) -> schema.StartNesResponse: ... - - @param_model(schema.SuggestNesRequest, method=AGENT_METHODS["nes_suggest"]) - async def suggest_nes( - self, - session_id: str, - uri: str | AnyUrl, - version: int, - position: schema.Position, - trigger_kind: Literal["automatic"] | Literal["diagnostic"] | Literal["manual"] | str, - selection: schema.Range | None = None, - context: schema.NesSuggestContext | None = None, - **kwargs: Any, - ) -> schema.SuggestNesResponse: ... - - @param_model(schema.AcceptNesNotification, method=AGENT_METHODS["nes_accept"], kind="notification") - async def accept_nes(self, session_id: str, suggestion_id: str, **kwargs: Any) -> None: ... + @param_model(schema.AuthStatusRequest, method=AGENT_METHODS["auth_status"]) + async def auth_status(self, **kwargs: Any) -> schema.AuthStatusResponse: ... - @param_model(schema.RejectNesNotification, method=AGENT_METHODS["nes_reject"], kind="notification") - async def reject_nes( - self, - session_id: str, - suggestion_id: str, - reason: Literal["rejected"] - | Literal["ignored"] - | Literal["replaced"] - | Literal["cancelled"] - | str - | None = None, - **kwargs: Any, - ) -> None: ... + @param_model(schema.ArchiveSessionRequest, method=AGENT_METHODS["session_archive"], default_result={}) + async def archive_session(self, session_id: str, **kwargs: Any) -> schema.ArchiveSessionResponse: ... - @param_model(schema.CloseNesRequest, method=AGENT_METHODS["nes_close"], default_result={}) - async def close_nes(self, session_id: str, **kwargs: Any) -> schema.CloseNesResponse: ... + @param_model(schema.UnarchiveSessionRequest, method=AGENT_METHODS["session_unarchive"], default_result={}) + async def unarchive_session(self, session_id: str, **kwargs: Any) -> schema.UnarchiveSessionResponse: ... - @param_model(schema.DidOpenDocumentNotification, method=AGENT_METHODS["document_did_open"], kind="notification") - async def did_open( - self, session_id: str, uri: str | AnyUrl, language_id: str, version: int, text: str, **kwargs: Any - ) -> None: ... + @param_model(schema.SessionStatusRequest, method=AGENT_METHODS["session_status"]) + async def session_status(self, session_id: str, **kwargs: Any) -> schema.SessionStatusResponse: ... - @param_model(schema.DidChangeDocumentNotification, method=AGENT_METHODS["document_did_change"], kind="notification") - async def did_change( - self, - session_id: str, - uri: str | AnyUrl, - version: int, - content_changes: list[schema.TextDocumentContentChangeEvent], - **kwargs: Any, - ) -> None: ... + @param_model(schema.SessionOptionsRequest, method=AGENT_METHODS["session_options"]) + async def session_options( + self, cwd: str, additional_directories: list[str] | None = None, session_id: str | None = None, **kwargs: Any + ) -> schema.SessionOptionsResponse: ... - @param_model(schema.DidCloseDocumentNotification, method=AGENT_METHODS["document_did_close"], kind="notification") - async def did_close(self, session_id: str, uri: str | AnyUrl, **kwargs: Any) -> None: ... + @param_model(schema.SetSessionTitleRequest, method=AGENT_METHODS["session_set_title"]) + async def set_session_title(self, session_id: str, title: str, **kwargs: Any) -> schema.SetSessionTitleResponse: ... - @param_model(schema.DidSaveDocumentNotification, method=AGENT_METHODS["document_did_save"], kind="notification") - async def did_save(self, session_id: str, uri: str | AnyUrl, **kwargs: Any) -> None: ... + @param_model(schema.CancelToolCallRequest, method=AGENT_METHODS["tool_call_cancel"], default_result={}) + async def cancel_tool_call( + self, session_id: str, tool_call_id: str, **kwargs: Any + ) -> schema.CancelToolCallResponse: ... - @param_model(schema.DidFocusDocumentNotification, method=AGENT_METHODS["document_did_focus"], kind="notification") - async def did_focus( - self, - session_id: str, - uri: str | AnyUrl, - version: int, - position: schema.Position, - visible_range: schema.Range, - **kwargs: Any, - ) -> None: ... + @param_model(schema.CancelTerminalRequest, method=AGENT_METHODS["terminal_cancel"], default_result={}) + async def cancel_terminal( + self, session_id: str, terminal_id: str, **kwargs: Any + ) -> schema.CancelTerminalResponse: ... class Client(Protocol): @@ -264,6 +226,9 @@ async def session_update( | schema.SessionNotice | schema.SessionCompactionUpdate | schema.SessionCompactionSummaryChunk + | schema.SessionReplayComplete + | schema.SessionPromptSuggestionsUpdate + | schema.SessionCursorUpdate | schema.SessionSubagentUpdate | schema.SessionMessageUpdate | schema.SessionMessageChunkUpdate @@ -282,7 +247,14 @@ async def session_update( adapt_result=partial(validate_mcp_response, adapter=TypeAdapter(schema.MessageMcpResponse)), ) async def mcp_message( - self, server_id: str, request_id: str, method: str, params: dict[str, Any] | None = None, **kwargs: Any + self, + server_id: str, + request_id: str, + method: str, + params: dict[str, Any] | None = None, + session_id: str | None = None, + tool_call_id: str | None = None, + **kwargs: Any, ) -> schema.MessageMcpResponse: ... @param_model(CreateElicitationRequest, method=CLIENT_METHODS["elicitation_create"]) @@ -304,3 +276,15 @@ async def create_elicitation( schema.CompleteElicitationNotification, method=CLIENT_METHODS["elicitation_complete"], kind="notification" ) async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None: ... + + @param_model(schema.AuthStatusUpdateNotification, method=CLIENT_METHODS["auth_status_update"], kind="notification") + async def auth_status_update( + self, + state: Literal["authenticated"] + | Literal["unauthenticated"] + | Literal["not_required"] + | Literal["unknown"] + | str, + accounts: list[schema.AuthAccount] | None = None, + **kwargs: Any, + ) -> None: ... diff --git a/src/acp/experimental/v2/meta.py b/src/acp/experimental/v2/meta.py index 2f2ce75b..eead1852 100644 --- a/src/acp/experimental/v2/meta.py +++ b/src/acp/experimental/v2/meta.py @@ -1,5 +1,5 @@ # Generated from schema/v2/meta.json. Do not edit by hand. -# Schema ref: refs/tags/schema-v2.0.0-alpha.7 +# Schema ref: refs/tags/schema-v2.0.0-beta.4 AGENT_METHODS = { "initialize": "initialize", "auth_login": "auth/login", @@ -14,19 +14,17 @@ "session_list": "session/list", "session_delete": "session/delete", "session_fork": "session/fork", + "session_archive": "session/archive", + "session_unarchive": "session/unarchive", + "session_status": "session/status", + "session_options": "session/options", + "session_set_title": "session/set_title", "session_resume": "session/resume", "session_close": "session/close", + "tool_call_cancel": "tool_call/cancel", + "terminal_cancel": "terminal/cancel", "auth_logout": "auth/logout", - "nes_start": "nes/start", - "nes_suggest": "nes/suggest", - "nes_accept": "nes/accept", - "nes_reject": "nes/reject", - "nes_close": "nes/close", - "document_did_open": "document/didOpen", - "document_did_change": "document/didChange", - "document_did_close": "document/didClose", - "document_did_save": "document/didSave", - "document_did_focus": "document/didFocus", + "auth_status": "auth/status", } CLIENT_METHODS = { "session_request_permission": "session/request_permission", @@ -34,6 +32,56 @@ "mcp_message": "mcp/message", "elicitation_create": "elicitation/create", "elicitation_complete": "elicitation/complete", + "auth_status_update": "auth/status_update", } PROTOCOL_METHODS = {"cancel_request": "$/cancel_request"} +PROXY_METHODS = {"proxy_initialize": "proxy/initialize", "proxy_successor": "proxy/successor"} +METHOD_SCHEMAS = { + "agent": { + "auth/login": {"request": "LoginAuthRequest", "result": "LoginAuthResponse"}, + "auth/logout": {"request": "LogoutAuthRequest", "result": "LogoutAuthResponse"}, + "auth/status": {"request": "AuthStatusRequest", "result": "AuthStatusResponse"}, + "initialize": {"request": "InitializeRequest", "result": "InitializeResponse"}, + "mcp/message": {"notification": "MessageMcpNotification"}, + "providers/disable": {"request": "DisableProviderRequest", "result": "DisableProviderResponse"}, + "providers/list": {"request": "ListProvidersRequest", "result": "ListProvidersResponse"}, + "providers/set": {"request": "SetProviderRequest", "result": "SetProviderResponse"}, + "session/archive": {"request": "ArchiveSessionRequest", "result": "ArchiveSessionResponse"}, + "session/cancel": {"notification": "CancelSessionNotification"}, + "session/close": {"request": "CloseSessionRequest", "result": "CloseSessionResponse"}, + "session/delete": {"request": "DeleteSessionRequest", "result": "DeleteSessionResponse"}, + "session/fork": {"request": "ForkSessionRequest", "result": "ForkSessionResponse"}, + "session/list": {"request": "ListSessionsRequest", "result": "ListSessionsResponse"}, + "session/new": {"request": "NewSessionRequest", "result": "NewSessionResponse"}, + "session/options": {"request": "SessionOptionsRequest", "result": "SessionOptionsResponse"}, + "session/prompt": {"request": "PromptRequest", "result": "PromptResponse"}, + "session/resume": {"request": "ResumeSessionRequest", "result": "ResumeSessionResponse"}, + "session/set_config_option": { + "request": "SetSessionConfigOptionRequest", + "result": "SetSessionConfigOptionResponse", + }, + "session/set_title": {"request": "SetSessionTitleRequest", "result": "SetSessionTitleResponse"}, + "session/status": {"request": "SessionStatusRequest", "result": "SessionStatusResponse"}, + "session/unarchive": {"request": "UnarchiveSessionRequest", "result": "UnarchiveSessionResponse"}, + "terminal/cancel": {"request": "CancelTerminalRequest", "result": "CancelTerminalResponse"}, + "tool_call/cancel": {"request": "CancelToolCallRequest", "result": "CancelToolCallResponse"}, + }, + "client": { + "auth/status_update": {"notification": "AuthStatusUpdateNotification"}, + "elicitation/complete": {"notification": "CompleteElicitationNotification"}, + "elicitation/create": {"request": "CreateElicitationRequest", "result": "CreateElicitationResponse"}, + "mcp/message": {"request": "MessageMcpRequest", "result": "MessageMcpResponse"}, + "session/request_permission": {"request": "RequestPermissionRequest", "result": "RequestPermissionResponse"}, + "session/update": {"notification": "UpdateSessionNotification"}, + }, + "protocol": {"$/cancel_request": {"notification": "CancelRequestNotification"}}, + "proxy": { + "proxy/initialize": {"request": "InitializeProxyRequest", "result": "InitializeProxyResponse"}, + "proxy/successor": { + "notification": "ProxySuccessorNotification", + "request": "ProxySuccessorRequest", + "result": "ProxySuccessorResponse", + }, + }, +} PROTOCOL_VERSION = 2 diff --git a/src/acp/experimental/v2/schema.py b/src/acp/experimental/v2/schema.py index 5310eb49..46f32a84 100644 --- a/src/acp/experimental/v2/schema.py +++ b/src/acp/experimental/v2/schema.py @@ -1,20 +1,28 @@ # Generated from schema/v2/schema.json. Do not edit by hand. -# Schema ref: refs/tags/schema-v2.0.0-alpha.7 +# Schema ref: refs/tags/schema-v2.0.0-beta.4 from __future__ import annotations from enum import Enum from typing import Annotated, Any, Dict, List, Literal, Optional, Union -from acp._deserialize import coerce_protocol_version, skip_invalid_items, use_default_on_error -from acp._schema_base import ElicitationContent -from acp.experimental.v2._schema_base import BaseModel +from acp._deserialize import coerce_protocol_version, empty_list_on_null, skip_invalid_items, use_default_on_error +from acp.experimental.v2._schema_base import ( + BaseModel, + ElicitationContent, + ErrorModel, + IdleStateUpdateModel, + InitialConfigRequestModel, + MethodParamsModel, + SessionConfigSelectModel, +) from pydantic import ( AnyUrl, AwareDatetime, ConfigDict, Field, RootModel, + StrictBool, StrictInt, ValidationInfo, ValidatorFunctionWrapHandler, @@ -67,7 +75,7 @@ class OtherContentBlock(BaseModel): class TextResourceContents(BaseModel): text: str """ - Text payload carried by this content block. + The contents of the resource. Its `mimeType`, when provided, describes the format. """ uri: AnyUrl """ @@ -76,12 +84,14 @@ class TextResourceContents(BaseModel): mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ MIME type describing the encoded media payload. + + Omitted and `null` are equivalent and mean the MIME type is not specified. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -104,12 +114,14 @@ class BlobResourceContents(BaseModel): mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ MIME type describing the encoded media payload. + + Omitted and `null` are equivalent and mean the MIME type is not specified. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -120,6 +132,24 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa return use_default_on_error(v, handler, info) +class SkillReference(BaseModel): + name: str + """ + The `name` of a `skill` entry in the session's current command list. + + Required and non-null. The Agent MUST reject the prompt with `-32602` + when it cannot resolve the name to a skill the user can invoke. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + class DiffPathChange(BaseModel): path: str """ @@ -145,10 +175,24 @@ class Terminal(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. This metadata is scoped to the content reference. Omitted - and `null` are equivalent and mean no item metadata was provided. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + +class SessionReference(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] + """ + The referenced session. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -159,15 +203,16 @@ class ToolCallLocation(BaseModel): """ The absolute file path being accessed or modified. """ - line: Annotated[Optional[int], Field(ge=0)] = None + line: Annotated[Optional[int], Field(ge=1)] = None """ - Optional line number within the file. + Optional 1-based line number within the file. Omitted and `null` are equivalent and + mean no specific line. `0` is invalid. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -178,6 +223,17 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa return use_default_on_error(v, handler, info) +class ToolCallCancelCapabilities(BaseModel): + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + class CommandPermissionSubject(BaseModel): command: str """ @@ -197,9 +253,9 @@ class CommandPermissionSubject(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. Omitted and `null` are equivalent and mean no subject metadata was provided. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -213,15 +269,13 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class CreateFormElicitationRequestBase(BaseModel): message: str """ - A human-readable message describing what input is needed. + A plain-text message explaining to the user what the Agent needs and why. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -231,15 +285,13 @@ class CreateFormElicitationRequestBase(BaseModel): class CreateUrlElicitationRequestBase(BaseModel): message: str """ - A human-readable message describing what input is needed. + A plain-text message explaining to the user what the Agent needs and why. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -266,9 +318,9 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class ElicitationRequestScope(BaseModel): - request_id: Annotated[Optional[Union[int, str]], Field(alias="requestId")] + request_id: Annotated[Union[int, str], Field(alias="requestId")] """ - The request this elicitation is tied to. + The pending Client-to-Agent request this elicitation is tied to. """ @@ -293,21 +345,19 @@ class EnumOption(BaseModel): """ title: str """ - Human-readable title for this option. + Human-readable title for this choice, in plain text. `const` holds the corresponding value. """ description: Optional[str] = None """ - Human-readable description. + Plain-text description to help the user choose between options. Optional. Omitted and `null` are equivalent and mean no description is provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -321,13 +371,13 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class StringPropertySchema(BaseModel): title: Optional[str] = None """ - Optional title for the property. + Optional plain-text label for this field in the form. Optional. Omitted and `null` are equivalent and mean no title is provided. """ description: Optional[str] = None """ - Human-readable description. + Plain-text help for the user filling out this field. Optional. Omitted and `null` are equivalent and mean no description is provided. """ @@ -343,12 +393,6 @@ class StringPropertySchema(BaseModel): Optional. Omitted and `null` are equivalent and mean there is no maximum length constraint. """ - pattern: Optional[str] = None - """ - Pattern the string must match. - - Optional. Omitted and `null` are equivalent and mean there is no pattern constraint. - """ format: Optional[Union[Literal["email"], Literal["uri"], Literal["date"], Literal["date-time"], str]] = None """ String format. @@ -377,11 +421,9 @@ class StringPropertySchema(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -395,13 +437,13 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class NumberPropertySchema(BaseModel): title: Optional[str] = None """ - Optional title for the property. + Optional plain-text label for this field in the form. Optional. Omitted and `null` are equivalent and mean no title is provided. """ description: Optional[str] = None """ - Human-readable description. + Plain-text help for the user filling out this field. Optional. Omitted and `null` are equivalent and mean no description is provided. """ @@ -425,11 +467,9 @@ class NumberPropertySchema(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -443,13 +483,13 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class IntegerPropertySchema(BaseModel): title: Optional[str] = None """ - Optional title for the property. + Optional plain-text label for this field in the form. Optional. Omitted and `null` are equivalent and mean no title is provided. """ description: Optional[str] = None """ - Human-readable description. + Plain-text help for the user filling out this field. Optional. Omitted and `null` are equivalent and mean no description is provided. """ @@ -473,11 +513,9 @@ class IntegerPropertySchema(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -491,13 +529,13 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class BooleanPropertySchema(BaseModel): title: Optional[str] = None """ - Optional title for the property. + Optional plain-text label for this field in the form. Optional. Omitted and `null` are equivalent and mean no title is provided. """ description: Optional[str] = None """ - Human-readable description. + Plain-text help for the user filling out this field. Optional. Omitted and `null` are equivalent and mean no description is provided. """ @@ -509,11 +547,9 @@ class BooleanPropertySchema(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -545,11 +581,9 @@ class StringMultiSelectItemsBase(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -562,11 +596,9 @@ class TitledMultiSelectItems(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -597,22 +629,33 @@ class ElicitationUrlRequestMode(ElicitationRequestScope): class ElicitationUrlMode(RootModel[Union[ElicitationUrlSessionMode, ElicitationUrlRequestMode]]): root: Union[ElicitationUrlSessionMode, ElicitationUrlRequestMode] """ - URL-based elicitation mode where the client directs the user to a URL. + URL-based elicitation mode where the Client directs the user to a URL. + """ + + +class ProtocolVersion(RootModel[int]): + root: Annotated[int, Field(ge=0, le=65535)] + """ + Protocol version identifier. + + This version is only bumped for breaking changes. + Non-breaking changes should be introduced via capabilities. """ class Implementation(BaseModel): name: str """ - Intended for programmatic or logical use, but can be used as a display - name fallback if title isn’t present. + Name intended for programmatic or logical use. It can also serve as the + plain-text display name when `title` is absent. """ title: Optional[str] = None """ - Intended for UI and end-user contexts — optimized to be human-readable - and easily understood. + Optional human-readable title chosen to make the implementation easy to + recognize in the user interface. The title is plain text. - If not provided, the name should be used for display. + Omission and `null` are equivalent. When displaying an implementation without a title, + the receiver SHOULD use `name`. """ version: str """ @@ -621,9 +664,9 @@ class Implementation(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -637,9 +680,9 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class PromptImageCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -648,9 +691,9 @@ class PromptImageCapabilities(BaseModel): class PromptAudioCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -659,234 +702,163 @@ class PromptAudioCapabilities(BaseModel): class PromptEmbeddedContextCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) - """ - - -class McpStdioCapabilities(BaseModel): - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) - """ - - -class McpHttpCapabilities(BaseModel): - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class McpAcpCapabilities(BaseModel): - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) - """ - - -class SessionDeleteCapabilities(BaseModel): - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) - """ - - -class SessionAdditionalDirectoriesCapabilities(BaseModel): +class PromptSkillInlineCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class SessionForkCapabilities(BaseModel): +class McpStdioCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class AgentAuthCapabilities(BaseModel): +class McpHttpCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class ProvidersCapabilities(BaseModel): +class McpAcpCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesDocumentDidOpenCapabilities(BaseModel): +class SessionDeleteCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesDocumentDidCloseCapabilities(BaseModel): +class SessionAdditionalDirectoriesCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesDocumentDidSaveCapabilities(BaseModel): +class SessionSystemPromptOverrideCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesDocumentDidFocusCapabilities(BaseModel): +class SessionForkCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesRecentFilesCapabilities(BaseModel): - max_count: Annotated[Optional[int], Field(alias="maxCount", ge=0)] = None - """ - Maximum number of recent files the agent can use. - """ +class SessionArchiveCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("max_count", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - -class NesRelatedSnippetsCapabilities(BaseModel): +class SessionStatusCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesEditHistoryCapabilities(BaseModel): - max_count: Annotated[Optional[int], Field(alias="maxCount", ge=0)] = None - """ - Maximum number of edit history entries the agent can use. - """ +class SessionOptionsCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("max_count", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - -class NesUserActionsCapabilities(BaseModel): - max_count: Annotated[Optional[int], Field(alias="maxCount", ge=0)] = None - """ - Maximum number of user actions the agent can use. - """ +class SessionTitleCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("max_count", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - -class NesOpenFilesCapabilities(BaseModel): +class AuthStatusCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesDiagnosticsCapabilities(BaseModel): +class ProvidersCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -903,9 +875,9 @@ class EnvVariable(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -918,27 +890,30 @@ class AuthMethodTerminal(BaseModel): """ name: str """ - Human-readable name of the authentication method. + Human-readable name of the authentication method, shown to users as plain text. """ description: Optional[str] = None """ - Optional description providing more details about this authentication method. + Optional human-readable description of this authentication method. + May contain Markdown. + + Omitted and `null` are equivalent and mean no description is provided. """ - args: Optional[List[str]] = None + args: Optional[List[str]] = [] """ - Additional arguments to append to the configured agent invocation for terminal auth. + Additional arguments to append to the configured Agent invocation for terminal auth. """ - env: Optional[List[EnvVariable]] = None + env: Annotated[Optional[List[EnvVariable]], Field(validate_default=True)] = [] """ - 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. + Additional environment variables to set on the configured Agent invocation for terminal auth. + Names SHOULD be unique, and otherwise the last entry wins. These values override + same-named variables in the base launch configuration. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -948,10 +923,10 @@ class AuthMethodTerminal(BaseModel): def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) - @field_validator("args", "env", mode="wrap") + @field_validator("args", "env", mode="before") @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) + def empty_list_on_null_validator(cls, v: Any, info: ValidationInfo) -> Any: + return empty_list_on_null(v, info) class AuthMethodAgent(BaseModel): @@ -961,17 +936,20 @@ class AuthMethodAgent(BaseModel): """ name: str """ - Human-readable name of the authentication method. + Human-readable name of the authentication method, shown to users as plain text. """ description: Optional[str] = None """ - Optional description providing more details about this authentication method. + Optional human-readable description of this authentication method. + May contain Markdown. + + Omitted and `null` are equivalent and mean no description is provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -985,9 +963,9 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class LoginAuthResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -1007,9 +985,9 @@ class ProviderCurrentConfig(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -1018,9 +996,9 @@ class ProviderCurrentConfig(BaseModel): class SetProviderResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -1029,9 +1007,9 @@ class SetProviderResponse(BaseModel): class DisableProviderResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -1040,13 +1018,67 @@ class DisableProviderResponse(BaseModel): class LogoutAuthResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + +class AuthAccount(BaseModel): + label: str + """ + Human-readable name for the account, suitable for display on its own as plain text, + for example `Claude Max`, `OpenAI API key`, or `Vertex AI`. + """ + description: Optional[str] = None + """ + Short plain-text description shown with the label, such as the credential source + `API key helper`. Agents MUST NOT put credentials in this field. + + Optional. Omitted and `null` are equivalent and mean no description is reported. + """ + active: Optional[bool] = None + """ + Whether the Agent currently uses this account by default. + + Several accounts MAY be active, for example one per provider. + + Optional. Omitted and `null` are equivalent and mean the Agent does not indicate whether this account is in effect. + """ + name: Optional[str] = None + """ + Display name of the user, such as a username or full name. + + Optional. Omitted and `null` are equivalent and mean no name is reported. + """ + email: Optional[str] = None + """ + Email address of the user. + + Optional. Omitted and `null` are equivalent and mean no email is reported. + """ + organization: Optional[str] = None + """ + Display name of the organization, team, or workspace the account is using. + + Optional. Omitted and `null` are equivalent and mean no organization is reported. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("active", "description", "email", "name", "organization", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + class SessionConfigSelectOption(BaseModel): value: str @@ -1055,17 +1087,20 @@ class SessionConfigSelectOption(BaseModel): """ name: str """ - Human-readable label for this option value. + Human-readable label the Client can display for this option value, in plain text. """ description: Optional[str] = None """ Optional description for this option value. + May contain Markdown. + + Omitted and `null` are equivalent and mean no description is provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -1083,6 +1118,29 @@ class SessionConfigBoolean(BaseModel): """ +class OtherAvailableCommand(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + type: str + """ + Custom or future command type. + + Values beginning with `_` are reserved for implementation-specific + extensions. Unknown values that do not begin with `_` are reserved for + future ACP variants. + """ + name: str + """ + Plain-text command name. MUST NOT contain whitespace and MUST be unique within the command list. + """ + description: str + """ + Human-readable description of what the command does. + May contain Markdown. + """ + + class OtherAvailableCommandInput(BaseModel): model_config = ConfigDict( extra="allow", @@ -1100,17 +1158,55 @@ class OtherAvailableCommandInput(BaseModel): class TextCommandInput(BaseModel): hint: str """ - A hint to display when the input hasn't been provided yet + Plain-text hint about the input the command expects. The Client can display it + when the user hasn't provided input yet. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + +class Skill(BaseModel): + name: str + """ + Plain-text skill name. The Client uses it to refer to the skill in a `skill` content block. + + MUST NOT contain whitespace and MUST be unique within the command list, + across commands and skills. It need not match the `name` in the skill's + frontmatter. + """ + description: str + """ + Human-readable description of what the skill does, shown to users. + May contain Markdown. + """ + path: Optional[str] = None + """ + The absolute path of the file that defines the skill, normally its + `SKILL.md`, on the machine the Agent runs on. + + Omitted and `null` are equivalent and mean the skill has no such file, + as with a skill that is built into the Agent or served by an MCP server. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("path", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + class SessionInfo(BaseModel): session_id: Annotated[str, Field(alias="sessionId")] @@ -1121,9 +1217,9 @@ class SessionInfo(BaseModel): """ The working directory for this session. Must be an absolute path. """ - additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = None + additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = [] """ - Additional workspace roots reported for this session. Each path must be absolute. + Additional workspace roots reported for this session. Each path MUST be absolute. When present, this is the complete ordered additional-root list reported by the Agent. Omitted and empty values are equivalent: the response @@ -1131,356 +1227,313 @@ class SessionInfo(BaseModel): """ title: Optional[str] = None """ - Human-readable title for the session + Human-readable title for the session, in plain text. + + Omitted and `null` are equivalent and mean no title is provided. """ updated_at: Annotated[Optional[AwareDatetime], Field(alias="updatedAt")] = None """ RFC 3339 timestamp of last activity. + + Omitted and `null` are equivalent and mean the last activity time is not reported. + """ + archived: Optional[bool] = None + """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Whether the session is archived. + + Optional. Omitted and `null` are equivalent and mean the archive state is not reported. + Agents that advertise the `session.archive` capability MUST include it on every listed session. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("title", "updated_at", mode="wrap") + @field_validator("archived", "title", "updated_at", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) - @field_validator("additional_directories", mode="wrap") + @field_validator("additional_directories", mode="before") @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) + def empty_list_on_null_validator(cls, v: Any, info: ValidationInfo) -> Any: + return empty_list_on_null(v, info) class DeleteSessionResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class CloseSessionResponse(BaseModel): +class ArchiveSessionResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class StartNesResponse(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] - """ - The session ID for the newly started NES session. - """ +class UnarchiveSessionResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class Position(BaseModel): - line: Annotated[int, Field(ge=0)] +class OtherState(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + state: str + """ + Custom or future session state. + + Values beginning with `_` are reserved for implementation-specific + extensions. Unknown values that do not begin with `_` are reserved for + future ACP variants. + """ + + +class OtherBackgroundWork(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + type: str """ - Zero-based line number. + Custom or future background work type. + + Values beginning with `_` are reserved for implementation-specific + extensions. Unknown values that do not begin with `_` are reserved for + future ACP variants. """ - character: Annotated[int, Field(ge=0)] + + +class BackgroundTerminal(BaseModel): + terminal_id: Annotated[str, Field(alias="terminalId")] """ - Zero-based character offset (encoding-dependent). + The ID of the listed terminal. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesJumpSuggestion(BaseModel): - suggestion_id: Annotated[str, Field(alias="suggestionId")] +class BackgroundToolCall(BaseModel): + tool_call_id: Annotated[str, Field(alias="toolCallId")] """ - Unique identifier for accept/reject tracking. + The ID of the listed tool call. """ - uri: AnyUrl + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The file to navigate to. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - position: Position + + +class BackgroundSubagent(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - The target position within the file. + The ID of the listed session. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesRenameSuggestion(BaseModel): - suggestion_id: Annotated[str, Field(alias="suggestionId")] +class UnsupportedProtocolVersionErrorData(BaseModel): + requested: Annotated[int, Field(ge=0, le=65535)] """ - Unique identifier for accept/reject tracking. + The protocol version the Client requested. """ - uri: AnyUrl + supported: List[ProtocolVersion] """ - The file URI containing the symbol. + The protocol versions the Agent supports. """ - position: Position + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The position of the symbol to rename. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - new_name: Annotated[str, Field(alias="newName")] + + +class SessionNotFoundErrorData(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - The new name for the symbol. + The session ID from the request. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesSearchAndReplaceSuggestion(BaseModel): - suggestion_id: Annotated[str, Field(alias="suggestionId")] +class Usage(BaseModel): + total_tokens: Annotated[int, Field(alias="totalTokens", ge=0)] """ - Unique identifier for accept/reject tracking. + Sum of all token types for the completed work. """ - uri: AnyUrl + input_tokens: Annotated[int, Field(alias="inputTokens", ge=0)] """ - The file URI to search within. + Input tokens for the completed work. """ - search: str + output_tokens: Annotated[int, Field(alias="outputTokens", ge=0)] """ - The text or pattern to find. + Output tokens for the completed work. """ - replace: str + thought_tokens: Annotated[Optional[int], Field(alias="thoughtTokens", ge=0)] = None """ - The replacement text. + Thought/reasoning tokens for the completed work. + + Omitted and `null` are equivalent and mean the count is not reported. """ - is_regex: Annotated[Optional[bool], Field(alias="isRegex")] = None + cached_read_tokens: Annotated[Optional[int], Field(alias="cachedReadTokens", ge=0)] = None """ - Whether `search` is a regular expression. Defaults to `false`. + Cache read tokens for the completed work. + + Omitted and `null` are equivalent and mean the count is not reported. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + cached_write_tokens: Annotated[Optional[int], Field(alias="cachedWriteTokens", ge=0)] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + Cache write tokens for the completed work. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Omitted and `null` are equivalent and mean the count is not reported. """ - - -class CloseNesResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - -class OtherSessionStateUpdateBase(BaseModel): - model_config = ConfigDict( - extra="allow", - ) - state: str - """ - Custom or future session state. - - Values beginning with `_` are reserved for implementation-specific - extensions. Unknown values that do not begin with `_` are reserved for - future ACP variants. - """ - - -class SessionStateUpdateBase(BaseModel): - session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" - - -class OtherSessionStateUpdate(OtherSessionStateUpdateBase, SessionStateUpdateBase): - session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" + @field_validator("cached_read_tokens", "cached_write_tokens", "thought_tokens", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) -class OtherSessionUpdate(BaseModel): - model_config = ConfigDict( - extra="allow", - ) - session_update: Annotated[str, Field(alias="sessionUpdate")] +class SetSessionTitleResponse(BaseModel): + title: str """ - Custom or future session update type. + The plain-text title the Agent stored. - Values beginning with `_` are reserved for implementation-specific - extensions. Unknown values that do not begin with `_` are reserved for - future ACP variants. + This differs from the requested title if the Agent normalized it. Clients SHOULD + display this value rather than the one they sent. """ - - -class RunningStateUpdate(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class Usage(BaseModel): - total_tokens: Annotated[int, Field(alias="totalTokens", ge=0)] - """ - Sum of all token types across session. - """ - input_tokens: Annotated[int, Field(alias="inputTokens", ge=0)] - """ - Total input tokens. - """ - output_tokens: Annotated[int, Field(alias="outputTokens", ge=0)] - """ - Total output tokens. - """ - thought_tokens: Annotated[Optional[int], Field(alias="thoughtTokens", ge=0)] = None - """ - Total thought/reasoning tokens - """ - cached_read_tokens: Annotated[Optional[int], Field(alias="cachedReadTokens", ge=0)] = None - """ - Total cache read tokens. - """ - cached_write_tokens: Annotated[Optional[int], Field(alias="cachedWriteTokens", ge=0)] = None - """ - Total cache write tokens. - """ +class CloseSessionResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("cached_read_tokens", "cached_write_tokens", "thought_tokens", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - - -class IdleStateUpdate(BaseModel): - stop_reason: Annotated[ - Optional[ - Union[ - Literal["end_turn"], - Literal["max_tokens"], - Literal["max_turn_requests"], - Literal["refusal"], - Literal["cancelled"], - str, - ] - ], - Field(alias="stopReason"), - ] = None - """ - Indicates why foreground work stopped. - - Optional. Omitted or `null` both mean the agent is not reporting a stop reason. - Agents SHOULD include this when the idle transition ends foreground work. - """ - usage: Optional[Usage] = None - """ - **UNSTABLE** - - This capability is not part of the spec yet, and may be removed or changed at any point. - - Token usage for completed foreground work. - Optional. Omitted or `null` both mean the agent is not reporting token - usage for this state update. - """ +class CancelToolCallResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("stop_reason", "usage", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - -class RequiresActionStateUpdate(BaseModel): +class CancelTerminalResponse(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class UnknownStateUpdate(BaseModel): - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP for additional metadata. - Implementations MUST NOT make assumptions about values at these keys. - Optional; omitted and `null` mean no metadata for this state snapshot. +class OtherSessionStateUpdateBase(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + state: str """ + Custom or future session state. - -class RunningState(RunningStateUpdate): - state: Literal["running"] = "running" - - -class IdleState(IdleStateUpdate): - state: Literal["idle"] = "idle" + Values beginning with `_` are reserved for implementation-specific + extensions. Unknown values that do not begin with `_` are reserved for + future ACP variants. + """ -class RequiresActionState(RequiresActionStateUpdate): - state: Literal["requires_action"] = "requires_action" +class SessionStateUpdateBase(BaseModel): + session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" -class UnknownState(UnknownStateUpdate): - state: Literal["unknown"] = "unknown" +class OtherSessionStateUpdate(OtherSessionStateUpdateBase, SessionStateUpdateBase): + session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" -class OtherState(BaseModel): +class OtherSessionUpdate(BaseModel): model_config = ConfigDict( extra="allow", ) - state: str + session_update: Annotated[str, Field(alias="sessionUpdate")] """ - Custom or future session state. + Custom or future session update type. Values beginning with `_` are reserved for implementation-specific extensions. Unknown values that do not begin with `_` are reserved for @@ -1495,34 +1548,33 @@ class TerminalOutput(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. This metadata is scoped to the replacement snapshot. Omitted - and `null` are equivalent and mean no snapshot metadata was provided. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ class TerminalExitStatus(BaseModel): - exit_code: Annotated[Optional[int], Field(alias="exitCode", ge=0)] = None + exit_code: Annotated[Optional[int], Field(alias="exitCode")] = None """ - Process exit code, when known. Omitted and `null` are equivalent. + Process exit code as the platform reports it, when known. Negative values are + allowed, for example signed Windows exit codes. Omitted and `null` are equivalent. """ signal: Optional[str] = None """ Signal that terminated the process, when known. - Agents should use the conventional platform signal name. POSIX examples + Agents SHOULD use the conventional platform signal name. POSIX examples include `SIGTERM`, `SIGKILL`, and `SIGINT`. Other platforms may use a platform-specific name. Omitted and `null` are equivalent. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. This metadata is scoped to the exit information. Omitted - and `null` are equivalent and mean no exit metadata was provided. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -1533,41 +1585,35 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa return use_default_on_error(v, handler, info) -class TerminalUpdate(BaseModel): - terminal_id: Annotated[str, Field(alias="terminalId")] - """ - Unique identifier for this terminal within the session. - """ - command: Optional[str] = None - """ - The command being run. - """ - cwd: Optional[str] = None +class TerminalSize(BaseModel): + cols: Annotated[int, Field(ge=1, le=65535)] """ - The absolute working directory of the command. + Number of columns. At least 1. """ - output: Optional[TerminalOutput] = None + rows: Annotated[int, Field(ge=1, le=65535)] """ - An authoritative replacement snapshot of terminal output bytes. + Number of rows. At least 1. """ - exit_status: Annotated[Optional[TerminalExitStatus], Field(alias="exitStatus")] = None + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Exit information. A concrete object marks the terminal as exited. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + + +class TerminalCancelCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Omitted means no metadata update; `null` is an - explicit clear signal. Implementations MUST NOT make assumptions about values at these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("command", "cwd", "exit_status", "output", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - class TerminalOutputChunk(BaseModel): terminal_id: Annotated[str, Field(alias="terminalId")] @@ -1580,63 +1626,57 @@ class TerminalOutputChunk(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. This field is chunk-scoped. Omitted and `null` are - equivalent and mean no chunk metadata was provided. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This metadata is scoped to the chunk and does not patch stored metadata. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class PlanFile(BaseModel): +class PlanMarkdown(BaseModel): plan_id: Annotated[str, Field(alias="planId")] """ The plan ID to update. """ - uri: AnyUrl - """ - The URI of the file containing the plan. + content: str """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + The complete plan as Markdown, not just the text that changed. """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + path: Optional[str] = None """ + The absolute path of the file that holds this plan. - -class PlanMarkdown(BaseModel): - plan_id: Annotated[str, Field(alias="planId")] - """ - The plan ID to update. - """ - content: str - """ - Markdown content for the plan. + Omitted and `null` both mean the plan has no file. A supplied path MUST + be absolute. `content` is the plan to display whether or not `path` is set. + Clients can use `path` to open the file. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("path", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + class PlanRemoved(BaseModel): plan_id: Annotated[str, Field(alias="planId")] """ - The plan ID to remove. + The plan ID to remove. Clients MUST ignore a removal for an unknown ID. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -1645,7 +1685,7 @@ class PlanRemoved(BaseModel): class SessionInfoUpdateBase(BaseModel): title: Optional[str] = None """ - Human-readable title for the session. Set to null to clear. + Human-readable title for the session, in plain text. Set to `null` to clear. """ updated_at: Annotated[Optional[AwareDatetime], Field(alias="updatedAt")] = None """ @@ -1653,28 +1693,37 @@ class SessionInfoUpdateBase(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Omitted means no metadata update; `null` is an - explicit clear signal. Implementations MUST NOT make assumptions about values at these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ + @field_validator("title", "updated_at", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + class Cost(BaseModel): amount: float """ Total cumulative cost for session. """ - currency: Annotated[str, Field(pattern="^[A-Z]{3}$")] + currency: str """ - ISO 4217 currency code (e.g., "USD", "EUR"). + Unit of `amount`: an ISO 4217 currency code (e.g., "USD", "EUR") for money, or another + unit such as "credits". """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -1691,17 +1740,27 @@ class UsageUpdateBase(BaseModel): """ cost: Optional[Cost] = None """ - Cumulative session cost (optional). + Cumulative session cost. + + Omitted leaves the last reported cost unchanged. `null` clears it. A value replaces it. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ + @field_validator("cost", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + class Notice(BaseModel): severity: Union[Literal["info"], Literal["warning"], Literal["error"], str] @@ -1720,9 +1779,11 @@ class Notice(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Metadata scoped to this notice. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. - Omitted and `null` are equivalent and mean no metadata was supplied. + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @field_validator("description", mode="wrap") @@ -1731,440 +1792,506 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa return use_default_on_error(v, handler, info) -class SessionCancelCapabilities(BaseModel): +class ReplayComplete(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class CompleteElicitationNotification(BaseModel): - elicitation_id: Annotated[str, Field(alias="elicitationId")] - """ - The ID of the elicitation that completed. - """ +class CursorForkCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class TerminalAuthCapabilities(BaseModel): - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None +class OtherCursorAnchor(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + type: str """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + Custom or future anchor type. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Values beginning with `_` are reserved for implementation-specific + extensions. Unknown values that do not begin with `_` are reserved for + future ACP variants. """ -class ElicitationFormCapabilities(BaseModel): +class CursorMessageAnchor(BaseModel): + message_id: Annotated[str, Field(alias="messageId")] + """ + The ID of the anchored message. + """ + position: Union[Literal["before"], Literal["after"], str] + """ + On which side of the message the cursor is. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class ElicitationUrlCapabilities(BaseModel): +class CursorToolCallAnchor(BaseModel): + tool_call_id: Annotated[str, Field(alias="toolCallId")] + """ + The ID of the anchored tool call. + """ + position: Union[Literal["before"], Literal["after"], str] + """ + On which side of the tool call the cursor is. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesJumpCapabilities(BaseModel): +class CursorCompactionAnchor(BaseModel): + compaction_id: Annotated[str, Field(alias="compactionId")] + """ + The ID of the anchored compaction. + """ + position: Union[Literal["before"], Literal["after"], str] + """ + On which side of the compaction the cursor is. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesRenameCapabilities(BaseModel): +class SessionCancelCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesSearchAndReplaceCapabilities(BaseModel): +class CompleteElicitationNotification(BaseModel): + elicitation_id: Annotated[str, Field(alias="elicitationId")] + """ + The ID of the elicitation that completed. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class LoginAuthRequest(BaseModel): - method_id: Annotated[str, Field(alias="methodId")] +class AuthStatusUpdateNotification(BaseModel): + state: Union[Literal["authenticated"], Literal["unauthenticated"], Literal["not_required"], Literal["unknown"], str] """ - The ID of the authentication method to use. - Must be one of the methods advertised in the initialize response. + Whether the Agent can start sessions without the user signing in first. + + Clients use this field to decide whether sign-in is needed. Clients MUST treat + values they do not recognize as `unknown`. + """ + accounts: Optional[List[AuthAccount]] = None + """ + The accounts the Agent has configured, for display. + + Optional. Omitted and empty are equivalent and mean no accounts are reported. + Agents that hold credentials for several providers or accounts SHOULD list each + of them and mark the ones in effect with `active`. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("accounts", mode="wrap") + @classmethod + def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return skip_invalid_items(v, handler, info) + -class ListProvidersRequest(BaseModel): +class TerminalAuthCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class SetProviderRequest(BaseModel): - provider_id: Annotated[str, Field(alias="providerId")] - """ - Provider ID to configure. - """ - api_type: Annotated[ - Union[Literal["anthropic"], Literal["openai"], Literal["azure"], Literal["vertex"], Literal["bedrock"], str], - Field(alias="apiType"), - ] - """ - Protocol type for this provider. - """ - base_url: Annotated[AnyUrl, Field(alias="baseUrl")] - """ - Base URL for requests sent through this provider. - """ - headers: Optional[Dict[str, str]] = None - """ - Full headers map for this provider. - May include authorization, routing, or other integration-specific headers. - """ +class ElicitationFormCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class DisableProviderRequest(BaseModel): - provider_id: Annotated[str, Field(alias="providerId")] - """ - Provider ID to disable. - """ +class ElicitationUrlCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class LogoutAuthRequest(BaseModel): +class PromptSuggestionsImageCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class OtherMcpServer(BaseModel): - model_config = ConfigDict( - extra="allow", - ) - type: str +class PromptSuggestionsAudioCapabilities(BaseModel): + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Custom or future MCP server transport type. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. - Values beginning with `_` are reserved for implementation-specific - extensions. Unknown values that do not begin with `_` are reserved for - future ACP variants. + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class HttpHeader(BaseModel): - name: str - """ - The name of the HTTP header. - """ - value: str - """ - The value to set for the HTTP header. - """ +class PromptSuggestionsEmbeddedContextCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class McpServerHttp(BaseModel): - name: str - """ - Human-readable name identifying this MCP server. - """ - url: AnyUrl - """ - URL to the MCP server. - """ - headers: Optional[List[HttpHeader]] = None - """ - HTTP headers to set when making requests to the MCP server. - """ +class CommandsSkillCapabilities(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class McpServerAcp(BaseModel): - name: str +class LoginAuthRequest(BaseModel): + method_id: Annotated[str, Field(alias="methodId")] """ - Human-readable name identifying this MCP server. + The ID of the authentication method to use. + Must be one of the methods advertised in the initialize response. """ - server_id: Annotated[str, Field(alias="serverId")] + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Unique identifier for this MCP server, generated by the component providing it. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. - Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible - on the same ACP connection. + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + + +class ListProvidersRequest(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class McpServerStdio(BaseModel): - name: str +class SetProviderRequest(BaseModel): + provider_id: Annotated[str, Field(alias="providerId")] """ - Human-readable name identifying this MCP server. + Provider ID to configure. """ - command: str + api_type: Annotated[ + Union[Literal["anthropic"], Literal["openai"], Literal["azure"], Literal["vertex"], Literal["bedrock"], str], + Field(alias="apiType"), + ] """ - Absolute path to the MCP server executable. + Protocol type for this provider. """ - args: Optional[List[str]] = None + base_url: Annotated[AnyUrl, Field(alias="baseUrl")] """ - Command-line arguments to pass to the MCP server. + Base URL for requests sent through this provider. """ - env: Optional[List[EnvVariable]] = None + headers: Optional[Dict[str, str]] = None """ - Environment variables to set when launching the MCP server. + Full headers map for this provider. + May include authorization, routing, or other integration-specific headers. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class ListSessionsRequest(BaseModel): - cwd: Optional[str] = None - """ - Filter sessions by working directory. Must be an absolute path. - """ - cursor: Optional[str] = None +class DisableProviderRequest(BaseModel): + provider_id: Annotated[str, Field(alias="providerId")] """ - Opaque cursor token from a previous response's nextCursor field for cursor-based pagination + Provider ID to disable. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class DeleteSessionRequest(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] +class LogoutAuthRequest(BaseModel): + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The ID of the session to delete. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + + +class AuthStatusRequest(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class OtherReplayFrom(BaseModel): +class OtherMcpServer(BaseModel): model_config = ConfigDict( extra="allow", ) type: str """ - Custom or future replay cursor type. + Custom or future MCP server transport type. Values beginning with `_` are reserved for implementation-specific extensions. Unknown values that do not begin with `_` are reserved for future ACP variants. """ + + +class HttpHeader(BaseModel): + name: str + """ + The name of the HTTP header. + """ + value: str + """ + The value to set for the HTTP header. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class ReplayFromStart(BaseModel): +class McpServerHttp(BaseModel): + name: str + """ + Human-readable name identifying this MCP server. MUST be unique within `mcpServers`. + + Agents reject a request with a duplicate `name` with `-32602`. + """ + url: AnyUrl + """ + URL to the MCP server. + """ + headers: Annotated[Optional[List[HttpHeader]], Field(validate_default=True)] = [] + """ + 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. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("headers", mode="before") + @classmethod + def empty_list_on_null_validator(cls, v: Any, info: ValidationInfo) -> Any: + return empty_list_on_null(v, info) -class CloseSessionRequest(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] + +class McpServerAcp(BaseModel): + name: str """ - The ID of the session to close. + Human-readable name identifying this MCP server. MUST be unique within `mcpServers`. + + Agents reject a request with a duplicate `name` with `-32602`. + """ + server_id: Annotated[str, Field(alias="serverId")] + """ + Unique identifier for this MCP server, generated by the component providing it. + + Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible + on the same ACP connection. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class SetSessionConfigOptionIdRequest(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] +class McpServerStdio(BaseModel): + name: str """ - The ID of the session to set the configuration option for. + Human-readable name identifying this MCP server. MUST be unique within `mcpServers`. + + Agents reject a request with a duplicate `name` with `-32602`. + """ + command: str + """ + Path to the MCP server executable. Must be an absolute path. + + Agents reject a request with a relative `command` with `-32602`. + """ + args: Optional[List[str]] = [] + """ + Command-line arguments to pass to the MCP server. + """ + env: Annotated[Optional[List[EnvVariable]], Field(validate_default=True)] = [] + """ + 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. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + @field_validator("args", "env", mode="before") + @classmethod + def empty_list_on_null_validator(cls, v: Any, info: ValidationInfo) -> Any: + return empty_list_on_null(v, info) + + +class InitialIdConfigOption(BaseModel): config_id: Annotated[str, Field(alias="configId")] """ The ID of the configuration option to set. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + type: Literal["id"] = "id" value: str """ The value ID. """ - type: Literal["id"] = "id" -class SetSessionConfigOptionBooleanRequest(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] - """ - The ID of the session to set the configuration option for. - """ +class InitialBooleanConfigOption(BaseModel): config_id: Annotated[str, Field(alias="configId")] """ The ID of the configuration option to set. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - value: bool + type: Literal["boolean"] = "boolean" + value: StrictBool """ The boolean value. """ - type: Literal["boolean"] = "boolean" -class SetSessionConfigOptionOtherRequest(BaseModel): +class OtherInitialConfigOption(BaseModel): model_config = ConfigDict( extra="allow", ) - session_id: Annotated[str, Field(alias="sessionId")] - """ - The ID of the session to set the configuration option for. - """ config_id: Annotated[str, Field(alias="configId")] """ The ID of the configuration option to set. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2182,166 +2309,132 @@ class SetSessionConfigOptionOtherRequest(BaseModel): """ -class WorkspaceFolder(BaseModel): - uri: AnyUrl - """ - The URI of the folder. - """ - name: str +class DeleteSessionRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - The display name of the folder. + The ID of the session to delete. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesRepository(BaseModel): - name: str - """ - The repository name. - """ - owner: str - """ - The repository owner. - """ - remote_url: Annotated[str, Field(alias="remoteUrl")] +class ArchiveSessionRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - The remote URL of the repository. + The ID of the session to archive. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesRecentFile(BaseModel): - uri: AnyUrl - """ - The URI of the file. - """ - language_id: Annotated[str, Field(alias="languageId")] - """ - The language identifier. - """ - text: str +class UnarchiveSessionRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - The full text content of the file. + The ID of the session to unarchive. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesExcerpt(BaseModel): - start_line: Annotated[int, Field(alias="startLine", ge=0)] - """ - The start line of the excerpt (zero-based). - """ - end_line: Annotated[int, Field(alias="endLine", ge=0)] - """ - The end line of the excerpt (zero-based). - """ - text: str +class SessionStatusRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - The text content of the excerpt. + The ID of the session to check. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class NesEditHistoryEntry(BaseModel): - uri: AnyUrl - """ - The URI of the edited file. - """ - diff: str - """ - A diff representing the edit. +class SessionOptionsRequest(BaseModel): + cwd: str """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + The working directory to resolve options for. Must be an absolute path. """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = [] """ + Additional workspace roots to resolve options for. Each path MUST be absolute. - -class NesUserAction(BaseModel): - action: str - """ - The kind of action (e.g., "insertChar", "cursorMovement"). - """ - uri: AnyUrl + Optional. Omitted and `null` are equivalent to an empty list. """ - The URI of the file where the action occurred. + session_id: Annotated[Optional[str], Field(alias="sessionId")] = None """ - position: Position - """ - The position where the action occurred. - """ - timestamp_ms: Annotated[int, Field(alias="timestampMs", ge=0)] - """ - Timestamp in milliseconds since epoch. + The session to resolve options for. + + Optional. Omitted and `null` are equivalent and mean a new session. When present, + the Agent returns what `session/resume` with the same `cwd` and + `additionalDirectories` would return, with the same `cwd` rules. A session the + Agent does not know gets `-32002`. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("additional_directories", mode="before") + @classmethod + def empty_list_on_null_validator(cls, v: Any, info: ValidationInfo) -> Any: + return empty_list_on_null(v, info) + -class CloseNesRequest(BaseModel): +class SetSessionTitleRequest(BaseModel): session_id: Annotated[str, Field(alias="sessionId")] """ - The ID of the NES session to close. + The ID of the session to retitle. + """ + title: str + """ + The new plain-text title for the session. + + Required and non-null. Omission and explicit `null` are both invalid. The Agent MAY + normalize the title before storing it, for example by trimming whitespace or + truncating it. The Agent rejects a title that fails its validation, including one + that is empty after normalization, with `-32602`. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class CancelledPermissionOutcome(BaseModel): - outcome: Literal["cancelled"] = "cancelled" - - -class OtherPermissionOutcome(BaseModel): +class OtherReplayFrom(BaseModel): model_config = ConfigDict( extra="allow", ) - outcome: str + type: str """ - Custom or future permission outcome. + Custom or future replay cursor type. Values beginning with `_` are reserved for implementation-specific extensions. Unknown values that do not begin with `_` are reserved for @@ -2349,214 +2442,298 @@ class OtherPermissionOutcome(BaseModel): """ -class SelectedPermissionOutcome(BaseModel): - option_id: Annotated[str, Field(alias="optionId")] - """ - The ID of the option the user selected. - """ +class ReplayFromStart(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class DeclineElicitationResponse(BaseModel): +class CloseSessionRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] + """ + The ID of the session to close. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - action: Literal["decline"] = "decline" -class CancelElicitationResponse(BaseModel): +class CancelToolCallRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] + """ + The ID of the session that owns the tool call. + """ + tool_call_id: Annotated[str, Field(alias="toolCallId")] + """ + The ID of the tool call to cancel. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - action: Literal["cancel"] = "cancel" -class OtherElicitationResponse(BaseModel): - model_config = ConfigDict( - extra="allow", - ) +class CancelTerminalRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] + """ + The ID of the session that owns the terminal. + """ + terminal_id: Annotated[str, Field(alias="terminalId")] + """ + The ID of the terminal to cancel. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - action: str - """ - Custom or future elicitation action. - - Values beginning with `_` are reserved for implementation-specific - extensions. Unknown values that do not begin with `_` are reserved for - future ACP variants. - """ -class ElicitationContentValue(RootModel[Union[str, int, float, bool, List[str]]]): - root: Union[str, int, float, bool, List[str]] +class SetSessionConfigOptionIdRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - Allowed wire representations for [`ElicitationContentValue`]. + The ID of the session to set the configuration option for. """ + config_id: Annotated[str, Field(alias="configId")] + """ + The ID of the configuration option to set. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. - -class ElicitationAcceptAction(BaseModel): - content: Optional[ElicitationContent] = None + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - The user-provided content, if any, as an object matching the requested schema. + type: Literal["id"] = "id" + value: str + """ + The value ID. """ -class McpResultResponse(BaseModel): - result: Any +class SetSessionConfigOptionBooleanRequest(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - Required, even if JSON null. + The ID of the session to set the configuration option for. + """ + config_id: Annotated[str, Field(alias="configId")] + """ + The ID of the configuration option to set. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Optional ACP carrier metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + type: Literal["boolean"] = "boolean" + value: StrictBool + """ + The boolean value. """ -class McpError(BaseModel): +class SetSessionConfigOptionOtherRequest(BaseModel): model_config = ConfigDict( extra="allow", ) - code: StrictInt + session_id: Annotated[str, Field(alias="sessionId")] """ - Inner MCP error code; never an ACP error code. + The ID of the session to set the configuration option for. """ - message: str + config_id: Annotated[str, Field(alias="configId")] """ - Inner MCP error message. + The ID of the configuration option to set. """ - data: Optional[Any] = None + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + type: str + """ + Custom or future session configuration option value type. + + Values beginning with `_` are reserved for implementation-specific + extensions. Unknown values that do not begin with `_` are reserved for + future ACP variants. """ - Optional error data; explicit null is retained. + value: Any + """ + Raw value payload for the custom or future value type. """ -class CancelSessionNotification(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] +class OtherPermissionOutcome(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + outcome: str """ - The ID of the session to cancel operations for. + Custom or future permission outcome. + + Values beginning with `_` are reserved for implementation-specific + extensions. Unknown values that do not begin with `_` are reserved for + future ACP variants. """ + + +class CancelledPermissionOutcomeBase(BaseModel): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class DidOpenDocumentNotification(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] - """ - The session ID for this notification. - """ - uri: AnyUrl +class SelectedPermissionOutcome(BaseModel): + option_id: Annotated[str, Field(alias="optionId")] """ - The URI of the opened document. + The ID of the option the user selected from this request's `options`. """ - language_id: Annotated[str, Field(alias="languageId")] + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The language identifier of the document (e.g., "rust", "python"). + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - version: int + + +class DeclineElicitationResponse(BaseModel): + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The version number of the document. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - text: str + action: Literal["decline"] = "decline" + + +class CancelElicitationResponse(BaseModel): + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The full text content of the document. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + action: Literal["cancel"] = "cancel" + + +class OtherElicitationResponse(BaseModel): + model_config = ConfigDict( + extra="allow", + ) field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + action: str + """ + Custom or future elicitation action. + + Values beginning with `_` are reserved for implementation-specific + extensions. Unknown values that do not begin with `_` are reserved for + future ACP variants. + """ -class DidCloseDocumentNotification(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] +class ElicitationContentValue(RootModel[Union[str, int, float, bool, List[str], Any]]): + root: Union[str, int, float, bool, List[str], Any] """ - The session ID for this notification. + Allowed wire representations for `ElicitationContentValue`. """ - uri: AnyUrl + + +class ElicitationAcceptAction(BaseModel): + content: Optional[ElicitationContent] = None + """ + The user-provided content, if any, as an object matching the requested schema. + + Omitted and `null` are equivalent and mean no content is provided. """ - The URI of the closed document. + + +class McpResultResponse(BaseModel): + result: Any + """ + Required, even if JSON null. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This is ACP metadata, not the inner MCP message's `_meta`. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class DidSaveDocumentNotification(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] +class McpError(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + code: StrictInt """ - The session ID for this notification. + Inner MCP error code. Never an ACP error code. """ - uri: AnyUrl + message: str """ - The URI of the saved document. + Inner MCP error message. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + data: Optional[Any] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Optional error data. Explicit null is retained. """ -class AcceptNesNotification(BaseModel): +class CancelSessionNotification(BaseModel): session_id: Annotated[str, Field(alias="sessionId")] """ - The session ID for this notification. - """ - suggestion_id: Annotated[str, Field(alias="suggestionId")] - """ - The ID of the accepted suggestion. + The ID of the session whose foreground work to cancel. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2577,24 +2754,84 @@ class MessageMcpNotification(BaseModel): """ params: Optional[Dict[str, Any]] = None """ - Optional inner MCP params; null is equivalent to omission. + Optional inner MCP params. Null is equivalent to omission. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - ACP extension metadata (not inner MCP params._meta); null is equivalent to omission. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This is ACP metadata, not the inner MCP message's `_meta`. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ class CancelRequestNotification(BaseModel): - request_id: Annotated[Optional[Union[int, str]], Field(alias="requestId")] + request_id: Annotated[Union[int, str], Field(alias="requestId")] + """ + The ID of the request to cancel: a request that the sender of this notification issued. + Receivers match it only against requests they received from that sender. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + +class ProxySuccessorRequest(BaseModel): + method: str + """ + Method name of the wrapped request. + """ + params: Optional[Any] = None + """ + Params of the wrapped request, forwarded unchanged. + + Optional. Omitted and `null` are equivalent and mean the wrapped request has no params. + When present, it MUST be a JSON object or array, as JSON-RPC requires. + The wrapped request's own `_meta` stays inside these params. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + Metadata for the `proxy/successor` envelope itself, separate from the wrapped + message's `_meta`. It is hop-local: the conductor does not copy it into the message + it unwraps. + + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + +class ProxySuccessorNotification(BaseModel): + method: str """ - The ID of the request to cancel. + Method name of the wrapped notification. + """ + params: Optional[Any] = None + """ + Params of the wrapped notification, forwarded unchanged. + + Optional. Omitted and `null` are equivalent and mean the wrapped notification has no params. + When present, it MUST be a JSON object or array, as JSON-RPC requires. + The wrapped notification's own `_meta` stays inside these params. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + Metadata for the `proxy/successor` envelope itself, separate from the wrapped + message's `_meta`. It is hop-local: the conductor does not copy it into the message + it unwraps. + + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2608,26 +2845,41 @@ class TerminalToolCallContent(Terminal): type: Literal["terminal"] = "terminal" +class SessionToolCallContent(SessionReference): + type: Literal["session"] = "session" + + +class SkillContentBlock(SkillReference): + type: Literal["skill"] = "skill" + + class Annotations(BaseModel): audience: Optional[List[Union[Literal["assistant"], Literal["user"], str]]] = None """ Intended recipients for this content, such as the user or assistant. + + Omitted and `null` are equivalent and mean no audience is specified. """ - last_modified: Annotated[Optional[AwareDatetime], Field(alias="lastModified")] = None + last_modified: Annotated[Optional[str], Field(alias="lastModified")] = None """ Timestamp indicating when the underlying resource was last modified. - Must be an RFC 3339 formatted string (e.g., "2025-01-12T15:00:58Z"). + Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z"), as in MCP. + + Omitted and `null` are equivalent and mean the modification time is not reported. """ priority: Annotated[Optional[float], Field(ge=0.0, le=1.0)] = None """ - Relative importance of this content when clients choose what to surface. + Relative importance of this content when Clients choose what to surface, from 0 (least + important) to 1 (most important). + + Omitted and `null` are equivalent and mean no priority is specified. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2646,17 +2898,19 @@ def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHand class TextContent(BaseModel): text: str """ - Text payload carried by this content block. + Text payload carried by this content block. It may be plain text or Markdown. """ annotations: Optional[Annotations] = None """ - Optional annotations that help clients decide how to display or route this content. + Optional annotations that help Clients decide how to display or route this content. + + Omitted and `null` are equivalent and mean no annotations are provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2679,16 +2933,20 @@ class ImageContent(BaseModel): uri: Optional[AnyUrl] = None """ URI associated with this resource or media payload. + + Omitted and `null` are equivalent and mean no URI is associated with the image. """ annotations: Optional[Annotations] = None """ - Optional annotations that help clients decide how to display or route this content. + Optional annotations that help Clients decide how to display or route this content. + + Omitted and `null` are equivalent and mean no annotations are provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2710,13 +2968,15 @@ class AudioContent(BaseModel): """ annotations: Optional[Annotations] = None """ - Optional annotations that help clients decide how to display or route this content. + Optional annotations that help Clients decide how to display or route this content. + + Omitted and `null` are equivalent and mean no annotations are provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2730,23 +2990,41 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class Icon(BaseModel): src: AnyUrl """ - A standard URI pointing to an icon resource. + A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a + `data:` URI with Base64-encoded image data. + + Clients MUST accept only `https:` and `data:` URIs, MUST fetch without + credentials, and MUST NOT follow redirects that change the scheme or origin. """ mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ Optional MIME type override if the source MIME type is missing or generic. + + Omitted and `null` are equivalent and mean the source MIME type is used. """ sizes: Optional[List[str]] = None """ Optional array of strings that specify sizes at which the icon can be used. - Each string should be in `WxH` format (e.g., `"48x48"`, `"96x96"`) or + Each string SHOULD be in `WxH` format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG. - If not provided, the client should assume that the icon can be used at any size. + If not provided, the Client SHOULD assume that the icon can be used at any size. + + Omitted and `null` are equivalent and mean no sizes are specified. """ theme: Optional[Union[Literal["light"], Literal["dark"], str]] = None """ Optional theme this icon is designed for. + + Omitted and `null` are equivalent and mean the icon is not theme-specific. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @field_validator("mime_type", "theme", mode="wrap") @@ -2763,7 +3041,7 @@ def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHand class ResourceLink(BaseModel): name: str """ - Human-readable name shown for this protocol object. + Human-readable name shown for the linked resource, in plain text. """ uri: AnyUrl """ @@ -2771,33 +3049,46 @@ class ResourceLink(BaseModel): """ title: Optional[str] = None """ - Optional display title for end-user UI. + Optional plain-text display title for the resource, intended for end users. + + Omitted and `null` are equivalent and mean no title is provided. """ description: Optional[str] = None """ - Optional human-readable details shown with this protocol object. + Optional human-readable description shown with the link. It describes the resource + contents in plain text. + + Omitted and `null` are equivalent and mean no description is provided. """ icons: Optional[List[Icon]] = None """ - Optional set of sized icons that the client can display in a user interface. + Optional set of sized icons that the Client can display in a user interface. + + Omitted and `null` are equivalent and mean no icons are provided. """ mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ MIME type describing the encoded media payload. + + Omitted and `null` are equivalent and mean the MIME type is not specified. """ - size: Optional[int] = None + size: Annotated[Optional[int], Field(ge=0)] = None """ Optional size of the linked resource in bytes, if known. + + Omitted and `null` are equivalent and mean the size is not known. """ annotations: Optional[Annotations] = None """ - Optional annotations that help clients decide how to display or route this content. + Optional annotations that help Clients decide how to display or route this content. + + Omitted and `null` are equivalent and mean no annotations are provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2820,13 +3111,15 @@ class EmbeddedResource(BaseModel): """ annotations: Optional[Annotations] = None """ - Optional annotations that help clients decide how to display or route this content. + Optional annotations that help Clients decide how to display or route this content. + + Omitted and `null` are equivalent and mean no annotations are provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2843,21 +3136,21 @@ class AddDiffChange(DiffPathChange): Field(alias="fileType"), ] = None """ - File content kind. + File content kind after the operation (for `delete`, of the deleted file). - Omitted or `null` means the content kind is unknown. + Omitted and `null` are equivalent and mean the content kind is unknown. """ mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ - MIME type of the file contents. + MIME type of the file contents after the operation (for `delete`, of the deleted file). - Omitted or `null` means the MIME type is unknown. + Omitted and `null` are equivalent and mean the MIME type is unknown. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2870,21 +3163,21 @@ class DeleteDiffChange(DiffPathChange): Field(alias="fileType"), ] = None """ - File content kind. + File content kind after the operation (for `delete`, of the deleted file). - Omitted or `null` means the content kind is unknown. + Omitted and `null` are equivalent and mean the content kind is unknown. """ mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ - MIME type of the file contents. + MIME type of the file contents after the operation (for `delete`, of the deleted file). - Omitted or `null` means the MIME type is unknown. + Omitted and `null` are equivalent and mean the MIME type is unknown. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2897,21 +3190,21 @@ class ModifyDiffChange(DiffPathChange): Field(alias="fileType"), ] = None """ - File content kind. + File content kind after the operation (for `delete`, of the deleted file). - Omitted or `null` means the content kind is unknown. + Omitted and `null` are equivalent and mean the content kind is unknown. """ mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ - MIME type of the file contents. + MIME type of the file contents after the operation (for `delete`, of the deleted file). - Omitted or `null` means the MIME type is unknown. + Omitted and `null` are equivalent and mean the MIME type is unknown. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2924,21 +3217,21 @@ class MoveDiffChange(DiffPathPairChange): Field(alias="fileType"), ] = None """ - File content kind. + File content kind after the operation (for `delete`, of the deleted file). - Omitted or `null` means the content kind is unknown. + Omitted and `null` are equivalent and mean the content kind is unknown. """ mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ - MIME type of the file contents. + MIME type of the file contents after the operation (for `delete`, of the deleted file). - Omitted or `null` means the MIME type is unknown. + Omitted and `null` are equivalent and mean the MIME type is unknown. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2951,21 +3244,21 @@ class CopyDiffChange(DiffPathPairChange): Field(alias="fileType"), ] = None """ - File content kind. + File content kind after the operation (for `delete`, of the deleted file). - Omitted or `null` means the content kind is unknown. + Omitted and `null` are equivalent and mean the content kind is unknown. """ mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ - MIME type of the file contents. + MIME type of the file contents after the operation (for `delete`, of the deleted file). - Omitted or `null` means the MIME type is unknown. + Omitted and `null` are equivalent and mean the MIME type is unknown. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -2981,21 +3274,21 @@ class OtherDiffChange(BaseModel): Field(alias="fileType"), ] = None """ - File content kind. + File content kind after the operation (for `delete`, of the deleted file). - Omitted or `null` means the content kind is unknown. + Omitted and `null` are equivalent and mean the content kind is unknown. """ mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None """ - MIME type of the file contents. + MIME type of the file contents after the operation (for `delete`, of the deleted file). - Omitted or `null` means the MIME type is unknown. + Omitted and `null` are equivalent and mean the MIME type is unknown. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3018,14 +3311,23 @@ class DiffPatch(BaseModel): """ Patch text in the format named by `format`. """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ class Diff(BaseModel): - changes: List[ - Union[AddDiffChange, DeleteDiffChange, ModifyDiffChange, MoveDiffChange, CopyDiffChange, OtherDiffChange] + changes: Annotated[ + List[Union[AddDiffChange, DeleteDiffChange, ModifyDiffChange, MoveDiffChange, CopyDiffChange, OtherDiffChange]], + Field(min_length=1), ] """ - Structured file changes described by this diff. + Structured file changes described by this diff. Agents MUST include at least one entry. Clients can use this field without parsing patch text to determine affected paths. """ @@ -3033,14 +3335,14 @@ class Diff(BaseModel): """ Renderable patch text for some or all of the structured changes. - Agents SHOULD provide patch text whenever feasible. Omitted or `null` - means no renderable patch text was provided. + Agents SHOULD provide patch text whenever feasible. Omitted and `null` are + equivalent and mean no renderable patch text was provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3056,24 +3358,47 @@ def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHand return skip_invalid_items(v, handler, info) +class ToolCallCapabilities(BaseModel): + cancel: Optional[ToolCallCancelCapabilities] = None + """ + Permits the Client to cancel this tool call with `tool_call/cancel`. + + Omitted and `null` are equivalent and mean unsupported. An object (including `{}`) + means supported. Agents SHOULD stop advertising it once the tool call reaches a final status. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + @field_validator("cancel", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + + class PermissionOption(BaseModel): option_id: Annotated[str, Field(alias="optionId")] """ - Unique identifier for this permission option. + Identifier for this permission option. MUST be unique within the request. """ name: str """ - Human-readable label to display to the user. + Human-readable label for this choice, shown to the user as plain text. """ kind: Union[Literal["allow_once"], Literal["allow_always"], Literal["reject_once"], Literal["reject_always"], str] """ - Hint about the nature of this permission option. + What selecting this option means. Clients can also use it to choose how to display the option. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3104,15 +3429,13 @@ class CreateUrlRequestElicitationRequestBase(ElicitationRequestScope): class CreateUrlSessionElicitationRequest(CreateUrlSessionElicitationRequestBase, CreateUrlElicitationRequestBase): message: str """ - A human-readable message describing what input is needed. + A plain-text message explaining to the user what the Agent needs and why. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3122,15 +3445,13 @@ class CreateUrlSessionElicitationRequest(CreateUrlSessionElicitationRequestBase, class CreateUrlRequestElicitationRequest(CreateUrlRequestElicitationRequestBase, CreateUrlElicitationRequestBase): message: str """ - A human-readable message describing what input is needed. + A plain-text message explaining to the user what the Agent needs and why. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3143,15 +3464,13 @@ class CreateOtherSessionElicitationRequest(ElicitationSessionScope): ) message: str """ - A human-readable message describing what input is needed. + A plain-text message explaining to the user what the Agent needs and why. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3171,15 +3490,13 @@ class CreateOtherRequestElicitationRequest(ElicitationRequestScope): ) message: str """ - A human-readable message describing what input is needed. + A plain-text message explaining to the user what the Agent needs and why. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3216,13 +3533,13 @@ class StringMultiSelectItems(StringMultiSelectItemsBase): class MultiSelectPropertySchema(BaseModel): title: Optional[str] = None """ - Optional title for the property. + Optional plain-text label for this field in the form. Optional. Omitted and `null` are equivalent and mean no title is provided. """ description: Optional[str] = None """ - Human-readable description. + Plain-text help for the user filling out this field. Optional. Omitted and `null` are equivalent and mean no description is provided. """ @@ -3250,11 +3567,9 @@ class MultiSelectPropertySchema(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3285,49 +3600,64 @@ class MessageMcpRequest(BaseModel): """ params: Optional[Dict[str, Any]] = None """ - Optional inner MCP params; null is equivalent to omission. + Optional inner MCP params. Null is equivalent to omission. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - ACP extension metadata (not inner MCP params._meta); null is equivalent to omission. + session_id: Annotated[Optional[str], Field(alias="sessionId")] = None """ + The session whose work caused this request. It is the `sessionId` the + Agent uses on `session/update` for that work. For a child session's work, + that is the child's ID. - -class PromptCapabilities(BaseModel): - image: Optional[PromptImageCapabilities] = None + Optional. Omitted and `null` are equivalent and mean the Agent supplied + no session. The Agent SHOULD include it when it knows the session, and + MUST NOT send another session's ID when it does not. A provider that + needs the session to run the request MAY reject a request without it. + """ + tool_call_id: Annotated[Optional[str], Field(alias="toolCallId")] = None """ - Agent supports [`ContentBlock::Image`]. + The tool call in that session that this request is part of. It is the + `toolCallId` the Agent uses to report the call in `session/update`. The + Agent SHOULD report the tool call before it sends the request. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports image content in prompts. + Optional. Omitted and `null` are equivalent and mean the Agent supplied + no tool call. The Agent MUST NOT send it without `sessionId`. More than + one request can name the same tool call. """ - audio: Optional[PromptAudioCapabilities] = None + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Agent supports [`ContentBlock::Audio`]. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This is ACP metadata, not the inner MCP message's `_meta`. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports audio content in prompts. - """ - embedded_context: Annotated[Optional[PromptEmbeddedContextCapabilities], Field(alias="embeddedContext")] = None + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - Agent supports embedded context in `session/prompt` requests. - When enabled, the Client is allowed to include [`ContentBlock::Resource`] - in prompt requests for pieces of context that are referenced in the message. + @field_validator("tool_call_id", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + + +class PromptSkillCapabilities(BaseModel): + inline: Optional[PromptSkillInlineCapabilities] = None + """ + Agent supports `skill` content blocks at any position in a prompt. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports embedded context in prompts. + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means a prompt may contain any number of `skill` content blocks, at any + position. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("audio", "embedded_context", "image", mode="wrap") + @field_validator("inline", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -3336,17 +3666,17 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class McpCapabilities(BaseModel): stdio: Optional[McpStdioCapabilities] = None """ - Agent supports [`McpServer::Stdio`]. + Agent supports `stdio` MCP servers. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports stdio MCP server transports. + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports stdio MCP server transports. """ http: Optional[McpHttpCapabilities] = None """ - Agent supports [`McpServer::Http`]. + Agent supports `http` MCP servers. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports HTTP MCP server transports. + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports HTTP MCP server transports. """ acp: Optional[McpAcpCapabilities] = None """ @@ -3354,16 +3684,16 @@ class McpCapabilities(BaseModel): This capability is not part of the spec yet, and may be removed or changed at any point. - Agent supports [`McpServer::Acp`]. + Agent supports `acp` MCP servers. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports ACP MCP server transports. + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports ACP MCP server transports. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3374,58 +3704,52 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa return use_default_on_error(v, handler, info) -class NesDocumentDidChangeCapabilities(BaseModel): - sync_kind: Annotated[Literal["full", "incremental"], Field(alias="syncKind")] +class SessionSystemPromptModeCapabilities(BaseModel): + override: Optional[SessionSystemPromptOverrideCapabilities] = None """ - The sync kind the agent wants: `"full"` or `"incremental"`. + Whether the Agent supports `override` mode. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports replacing its built-in default + instructions with the Client-provided system prompt. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - -class NesContextCapabilities(BaseModel): - recent_files: Annotated[Optional[NesRecentFilesCapabilities], Field(alias="recentFiles")] = None - """ - Whether the agent wants recent files context. - """ - related_snippets: Annotated[Optional[NesRelatedSnippetsCapabilities], Field(alias="relatedSnippets")] = None - """ - Whether the agent wants related snippets context. - """ - edit_history: Annotated[Optional[NesEditHistoryCapabilities], Field(alias="editHistory")] = None - """ - Whether the agent wants edit history context. - """ - user_actions: Annotated[Optional[NesUserActionsCapabilities], Field(alias="userActions")] = None - """ - Whether the agent wants user actions context. - """ - open_files: Annotated[Optional[NesOpenFilesCapabilities], Field(alias="openFiles")] = None - """ - Whether the agent wants open files context. - """ - diagnostics: Optional[NesDiagnosticsCapabilities] = None + @field_validator("override", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + + +class AgentAuthCapabilities(BaseModel): + status: Optional[AuthStatusCapabilities] = None """ - Whether the agent wants diagnostics context. + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Whether the Agent supports the `auth/status` method. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports the `auth/status` method. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator( - "diagnostics", "edit_history", "open_files", "recent_files", "related_snippets", "user_actions", mode="wrap" - ) + @field_validator("status", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -3457,19 +3781,7 @@ class OtherAuthMethod(BaseModel): """ name: str """ - Human-readable name of the authentication method. - """ - description: Optional[str] = None - """ - Optional description providing more details about this authentication method. - """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Human-readable name of the authentication method, shown to users as plain text. """ @@ -3487,7 +3799,7 @@ class ProviderInfo(BaseModel): 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. + If true, Clients MUST NOT call `providers/disable` for this provider ID. """ current: Optional[ProviderCurrentConfig] = None """ @@ -3496,9 +3808,9 @@ class ProviderInfo(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3509,30 +3821,68 @@ def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHand return skip_invalid_items(v, handler, info) +class AuthStatusResponse(BaseModel): + state: Union[Literal["authenticated"], Literal["unauthenticated"], Literal["not_required"], Literal["unknown"], str] + """ + Whether the Agent can start sessions without the user signing in first. + + Clients use this field to decide whether sign-in is needed. Clients MUST treat + values they do not recognize as `unknown`. + """ + accounts: Optional[List[AuthAccount]] = None + """ + The accounts the Agent has configured, for display. + + Optional. Omitted and empty are equivalent and mean no accounts are reported. + Agents that hold credentials for several providers or accounts SHOULD list each + of them and mark the ones in effect with `active`. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + @field_validator("accounts", mode="wrap") + @classmethod + def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return skip_invalid_items(v, handler, info) + + class BooleanSessionConfigOption(SessionConfigBoolean): config_id: Annotated[str, Field(alias="configId")] """ - Unique identifier for the configuration option. + Identifier for the configuration option. MUST be unique within `configOptions`. """ name: str """ - Human-readable label for the option. + Human-readable label the Client can display for the option, in plain text. """ description: Optional[str] = None """ Optional description for the Client to display to the user. + May contain Markdown. + + Omitted and `null` are equivalent and mean no description is provided. """ category: Optional[ - Union[Literal["mode"], Literal["model"], Literal["model_config"], Literal["thought_level"], str] + Union[ + Literal["mode"], Literal["model"], Literal["model_config"], Literal["speed"], Literal["thought_level"], str + ] ] = None """ Optional semantic category for this option (UX only). + + Omitted and `null` are equivalent and mean no category is provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3545,27 +3895,34 @@ class OtherSessionConfigOption(BaseModel): ) config_id: Annotated[str, Field(alias="configId")] """ - Unique identifier for the configuration option. + Identifier for the configuration option. MUST be unique within `configOptions`. """ name: str """ - Human-readable label for the option. + Human-readable label the Client can display for the option, in plain text. """ description: Optional[str] = None """ Optional description for the Client to display to the user. + May contain Markdown. + + Omitted and `null` are equivalent and mean no description is provided. """ category: Optional[ - Union[Literal["mode"], Literal["model"], Literal["model_config"], Literal["thought_level"], str] + Union[ + Literal["mode"], Literal["model"], Literal["model_config"], Literal["speed"], Literal["thought_level"], str + ] ] = None """ Optional semantic category for this option (UX only). + + Omitted and `null` are equivalent and mean no category is provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3582,21 +3939,21 @@ class OtherSessionConfigOption(BaseModel): class SessionConfigSelectGroup(BaseModel): group_id: Annotated[str, Field(alias="groupId")] """ - Unique identifier for this group. + Identifier for this group. MUST be unique within the option. """ name: str """ - Human-readable label for this group. + Human-readable label the Client can display as a plain-text group header. """ - options: List[SessionConfigSelectOption] + options: Annotated[List[SessionConfigSelectOption], Field(min_length=1)] """ - The set of option values in this group. + The set of option values in this group. MUST contain at least one value. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3607,149 +3964,197 @@ def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHand return skip_invalid_items(v, handler, info) +class SkillCommand(Skill): + type: Literal["skill"] = "skill" + + class TextAvailableCommandInput(TextCommandInput): type: Literal["text"] = "text" -class ListSessionsResponse(BaseModel): - sessions: List[SessionInfo] +class Command(BaseModel): + name: str """ - Array of session information objects. + Plain-text command name without the leading `/`, such as `create_plan` or `research_codebase`. + + MUST NOT contain whitespace and MUST be unique within the command list. """ - next_cursor: Annotated[Optional[str], Field(alias="nextCursor")] = None + description: str """ - Opaque cursor token. If present, pass this in the next request's cursor parameter - to fetch the next page. If absent, there are no more results. + Human-readable description of what the command does. + May contain Markdown. + """ + input: Optional[Union[TextAvailableCommandInput, OtherAvailableCommandInput]] = None + """ + Input for the command if required + + Omitted and `null` are equivalent and mean the command takes no input. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("next_cursor", mode="wrap") + @field_validator("input", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) - @field_validator("sessions", mode="wrap") - @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) - -class PromptResponse(BaseModel): - message_id: Annotated[str, Field(alias="messageId")] +class ListSessionsResponse(BaseModel): + sessions: List[SessionInfo] """ - Identifies the user message inserted into the ACP conversation. - - Required and non-null. Omission and explicit `null` are both invalid. + Array of session information objects. - The corresponding user-message session update carries this same identifier and may arrive - before or after this response. Agents must echo the message during the live session, but are - not required to retain it. If retained and replayed, the message keeps this identifier. + Agents SHOULD return the sessions with the most recent activity first. + """ + next_cursor: Annotated[Optional[str], Field(alias="nextCursor")] = None + """ + Opaque cursor token. If present, pass this in the next request's cursor parameter + to fetch the next page. Omitted and `null` are equivalent and mean there are no more + results. An empty string is a valid cursor, not the end of results. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("sessions", mode="wrap") + @classmethod + def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return skip_invalid_items(v, handler, info) + -class NesJumpSuggestionVariant(NesJumpSuggestion): - kind: Literal["jump"] = "jump" +class TerminalBackgroundWork(BackgroundTerminal): + type: Literal["terminal"] = "terminal" -class NesRenameSuggestionVariant(NesRenameSuggestion): - kind: Literal["rename"] = "rename" +class ToolCallBackgroundWork(BackgroundToolCall): + type: Literal["tool_call"] = "tool_call" -class NesSearchAndReplaceSuggestionVariant(NesSearchAndReplaceSuggestion): - kind: Literal["searchAndReplace"] = "searchAndReplace" +class SubagentBackgroundWork(BackgroundSubagent): + type: Literal["subagent"] = "subagent" -class OtherNesSuggestion(BaseModel): - model_config = ConfigDict( - extra="allow", - ) - kind: str +class RunningStateUpdate(BaseModel): + background: Optional[ + List[Union[TerminalBackgroundWork, ToolCallBackgroundWork, SubagentBackgroundWork, OtherBackgroundWork]] + ] = None """ - Custom or future NES suggestion kind. + Work running independently of foreground work, as a complete snapshot. - Values beginning with `_` are reserved for implementation-specific - extensions. Unknown values that do not begin with `_` are reserved for - future ACP variants. + Optional. Omitted and `null` are equivalent and mean the Agent is not reporting + background work, not that nothing is running. `[]` means no background work is + running. An Agent that reports background work MUST include it on every state + update for the session. + + See protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work) """ - suggestion_id: Annotated[str, Field(alias="suggestionId")] + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Unique identifier for accept/reject tracking. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("background", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + -class Range(BaseModel): - start: Position - """ - The start position (inclusive). - """ - end: Position +class RequiresActionStateUpdate(BaseModel): + background: Optional[ + List[Union[TerminalBackgroundWork, ToolCallBackgroundWork, SubagentBackgroundWork, OtherBackgroundWork]] + ] = None """ - The end position (exclusive). + Work running independently of foreground work, as a complete snapshot. + + Optional. Omitted and `null` are equivalent and mean the Agent is not reporting + background work, not that nothing is running. `[]` means no background work is + running. An Agent that reports background work MUST include it on every state + update for the session. + + See protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work) """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("background", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) -class Error(BaseModel): - code: Union[ - Literal[-32700], - Literal[-32600], - Literal[-32601], - Literal[-32602], - Literal[-32603], - Literal[-32800], - Literal[-32000], - Literal[-32002], - int, - ] - """ - A number indicating the error type that occurred. - This must be an integer as defined in the JSON-RPC specification. - """ - message: str + +class UnknownStateUpdate(BaseModel): + background: Optional[ + List[Union[TerminalBackgroundWork, ToolCallBackgroundWork, SubagentBackgroundWork, OtherBackgroundWork]] + ] = None """ - A string providing a short description of the error. - The message should be limited to a concise single sentence. + Work running independently of foreground work, as a complete snapshot. + + Optional. Omitted and `null` are equivalent and mean the Agent is not reporting + background work, not that nothing is running. `[]` means no background work is + running. An Agent that reports background work MUST include it on every state + update for the session. + + See protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work) """ - data: Optional[Any] = None + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Optional primitive or structured value that contains additional information about the error. - This may include debugging information or context-specific details. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("data", mode="wrap") + @field_validator("background", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class RunningSessionStateUpdateBase(RunningStateUpdate): - state: Literal["running"] = "running" +class PromptResponse(BaseModel): + message_id: Annotated[str, Field(alias="messageId")] + """ + Identifies the user message inserted into the ACP conversation. + Required and non-null. Omission and explicit `null` are both invalid. -class IdleSessionStateUpdateBase(IdleStateUpdate): - state: Literal["idle"] = "idle" + The corresponding user-message session update carries this same identifier and may arrive + before or after this response. Agents MUST echo the message during the live session, but are + not required to retain it. If retained and replayed, the message keeps this identifier. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + +class RunningSessionStateUpdateBase(RunningStateUpdate): + state: Literal["running"] = "running" class RequiresActionSessionStateUpdateBase(RequiresActionStateUpdate): @@ -3764,10 +4169,6 @@ class RunningSessionStateUpdate(RunningSessionStateUpdateBase, SessionStateUpdat session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" -class IdleSessionStateUpdate(IdleSessionStateUpdateBase, SessionStateUpdateBase): - session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" - - class RequiresActionSessionStateUpdate(RequiresActionSessionStateUpdateBase, SessionStateUpdateBase): session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" @@ -3776,10 +4177,6 @@ class UnknownSessionStateUpdate(UnknownSessionStateUpdateBase, SessionStateUpdat session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" -class SessionTerminalUpdate(TerminalUpdate): - session_update: Annotated[Literal["terminal_update"], Field(alias="sessionUpdate")] = "terminal_update" - - class SessionTerminalOutputChunk(TerminalOutputChunk): session_update: Annotated[Literal["terminal_output_chunk"], Field(alias="sessionUpdate")] = "terminal_output_chunk" @@ -3791,27 +4188,93 @@ class SessionPlanRemovedUpdate(PlanRemoved): class SessionInfoUpdate(SessionInfoUpdateBase): session_update: Annotated[Literal["session_info_update"], Field(alias="sessionUpdate")] = "session_info_update" - @field_validator("title", "updated_at", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - class UsageUpdate(UsageUpdateBase): session_update: Annotated[Literal["usage_update"], Field(alias="sessionUpdate")] = "usage_update" - @field_validator("cost", mode="wrap") + +class SessionNotice(Notice): + session_update: Annotated[Literal["notice"], Field(alias="sessionUpdate")] = "notice" + + +class SessionReplayComplete(ReplayComplete): + session_update: Annotated[Literal["replay_complete"], Field(alias="sessionUpdate")] = "replay_complete" + + +class TerminalCapabilities(BaseModel): + cancel: Optional[TerminalCancelCapabilities] = None + """ + Permits the Client to cancel this terminal with `terminal/cancel`. + + Omitted and `null` are equivalent and mean unsupported. An object (including `{}`) + means supported. Agents SHOULD stop advertising it once the terminal reports `exitStatus`. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + @field_validator("cancel", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class SessionNotice(Notice): - session_update: Annotated[Literal["notice"], Field(alias="sessionUpdate")] = "notice" +class TerminalUpdate(BaseModel): + terminal_id: Annotated[str, Field(alias="terminalId")] + """ + Unique identifier for this terminal within the session. + """ + command: Optional[str] = None + """ + The command being run. + """ + cwd: Optional[str] = None + """ + The absolute working directory of the command. + """ + output: Optional[TerminalOutput] = None + """ + An authoritative replacement snapshot of terminal output bytes. + """ + exit_status: Annotated[Optional[TerminalExitStatus], Field(alias="exitStatus")] = None + """ + Exit information. A concrete object marks the terminal as exited. + """ + size: Optional[TerminalSize] = None + """ + The terminal size the command runs with, when known. + + Clients can render output at this size so that column layouts, progress bars, + and cursor-positioned output display as the program wrote them. + """ + capabilities: Optional[TerminalCapabilities] = None + """ + Client-initiated controls this terminal currently supports, such as cancellation. + + Omission leaves the capabilities unchanged, `null` clears them, and an object replaces + the whole previous value. A new terminal starts with none. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) + """ -class PlanUpdateFile(PlanFile): - type: Literal["file"] = "file" + @field_validator("capabilities", "command", "cwd", "exit_status", "output", "size", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) class PlanUpdateMarkdown(PlanMarkdown): @@ -3840,6 +4303,7 @@ class PlanEntry(BaseModel): content: str """ Human-readable description of what this task aims to accomplish. + May contain Markdown. """ priority: Union[Literal["high"], Literal["medium"], Literal["low"], str] """ @@ -3852,9 +4316,9 @@ class PlanEntry(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3869,14 +4333,14 @@ class PlanItems(BaseModel): """ The list of tasks to be accomplished. - When updating an item-based plan, the agent must send a complete list of all entries - with their current status. The client replaces that plan with each update. + The Agent MUST send all entries with their current status. + The Client MUST replace the checklist with this `planId` on each update. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3887,90 +4351,138 @@ def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHand return skip_invalid_items(v, handler, info) -class SubagentSessionCapabilities(BaseModel): - cancel: Optional[SessionCancelCapabilities] = None +class CursorCapabilities(BaseModel): + fork: Optional[CursorForkCapabilities] = None """ - Permits the client to cancel this child's current work without ending - the session. Omitted or `null` means unsupported; an object (including - `{}`) means supported. + Permits the Client to fork the session at this cursor with `session/fork`. + + Omitted and `null` are equivalent and mean unsupported. An object (including `{}`) + means supported. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("cancel", mode="wrap") + @field_validator("fork", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class SubagentUpdate(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] +class UserMessageCursorAnchor(CursorMessageAnchor): + type: Literal["user_message"] = "user_message" + + +class AgentMessageCursorAnchor(CursorMessageAnchor): + type: Literal["agent_message"] = "agent_message" + + +class AgentThoughtCursorAnchor(CursorMessageAnchor): + type: Literal["agent_thought"] = "agent_thought" + + +class SessionMessageCursorAnchor(CursorMessageAnchor): + type: Literal["session_message"] = "session_message" + + +class ToolCallCursorAnchor(CursorToolCallAnchor): + type: Literal["tool_call"] = "tool_call" + + +class CompactionCursorAnchor(CursorCompactionAnchor): + type: Literal["compaction"] = "compaction" + + +class CursorUpdate(BaseModel): + cursor_id: Annotated[str, Field(alias="cursorId")] """ - The opaque session ID identifying the child in all ACP messages. + The Agent-owned ID of this cursor, unique within the session. """ - title: Optional[str] = None + capabilities: Optional[CursorCapabilities] = None """ - The parent's human-readable display title for this child. It need not be unique. + The methods that currently accept this cursor. - Optional and nullable. Omitted means unchanged; `null` clears it. If no - title is set, the Client chooses a fallback presentation. - """ - description: Optional[str] = None + Omission leaves the capabilities unchanged, `null` clears them, and an object replaces + the whole previous value. A new cursor starts with none. """ - The parent's human-readable description of the child's role or purpose. + anchor: Optional[ + Union[ + UserMessageCursorAnchor, + AgentMessageCursorAnchor, + AgentThoughtCursorAnchor, + SessionMessageCursorAnchor, + ToolCallCursorAnchor, + CompactionCursorAnchor, + OtherCursorAnchor, + ] + ] = None + """ + Where the cursor is, relative to an entity the Client holds. - Optional and nullable. Omitted means unchanged; `null` clears it. This is - current display metadata, not the history of instructions sent to the child. + Required on the first update for a cursor. The Agent MUST NOT change it afterwards. + A later update can omit it or repeat the same anchor. Omitted and `null` are + equivalent and leave the stored anchor unchanged. """ - capabilities: Optional[SubagentSessionCapabilities] = None + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Client-initiated session mutations permitted for this subagent session. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. - Read-only operations retain their normal protocol semantics and - capability requirements. - """ - state: Optional[Union[RunningState, IdleState, RequiresActionState, UnknownState, OtherState]] = None + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ - The child's current foreground state, mirrored onto its parent association. - Optional and nullable. Omitted means unchanged; `null` removes the - current report and leaves activity unconfirmed (not idle or cancelled). - A concrete [`StateUpdate`] replaces the entire previous snapshot. + @field_validator("capabilities", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + + +class SubagentSessionCapabilities(BaseModel): + cancel: Optional[SessionCancelCapabilities] = None + """ + Permits the Client to cancel this child's current work without ending + the session. Omitted and `null` are equivalent and mean unsupported. An object (including + `{}`) means supported. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Omitted means no metadata update; `null` is an - explicit clear signal. Implementations MUST NOT make assumptions about values at these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("capabilities", "description", "state", "title", mode="wrap") + @field_validator("cancel", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class AuthCapabilities(BaseModel): +class ClientAuthCapabilities(BaseModel): terminal: Optional[TerminalAuthCapabilities] = None """ - Whether the client supports `terminal` authentication methods. + Whether the Client supports `terminal` authentication methods. - Optional. Omitted or `null` both mean the client does not advertise support. - The client should supply `{}` only when it can reproduce the configured - agent invocation in an interactive terminal. Supplying `{}` means the - agent may include `terminal` entries in its authentication methods. + Optional. Omitted and `null` are equivalent and mean the Client does not advertise support. + Supplying `{}` means the Client can reproduce the configured Agent + invocation in an interactive terminal, and the Agent MAY include + `terminal` entries in its authentication methods. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -3984,25 +4496,23 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class ElicitationCapabilities(BaseModel): form: Optional[ElicitationFormCapabilities] = None """ - Whether the client supports form-based elicitation. + Whether the Client supports form-based elicitation. Optional. Omitted and `null` are equivalent and mean form support is not advertised. Supplying `{}` explicitly advertises form support. """ url: Optional[ElicitationUrlCapabilities] = None """ - Whether the client supports URL-based elicitation. + Whether the Client supports URL-based elicitation. - Optional. Omitted or `null` both mean the client does not advertise support. - Supplying `{}` means the client supports URL-based elicitation. + Optional. Omitted and `null` are equivalent and mean the Client does not advertise support. + Supplying `{}` means the Client supports URL-based elicitation. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -4013,203 +4523,127 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa return use_default_on_error(v, handler, info) -class ClientNesCapabilities(BaseModel): - jump: Optional[NesJumpCapabilities] = None +class PromptSuggestionsCapabilities(BaseModel): + image: Optional[PromptSuggestionsImageCapabilities] = None """ - Whether the client supports the `jump` suggestion kind. + Whether prompt suggestions may include `image` content blocks. + + Optional. Omitted and `null` are equivalent and mean the Client does not advertise support. + Supplying `{}` means the Client can offer suggestions that include images. """ - rename: Optional[NesRenameCapabilities] = None + audio: Optional[PromptSuggestionsAudioCapabilities] = None """ - Whether the client supports the `rename` suggestion kind. + Whether prompt suggestions may include `audio` content blocks. + + Optional. Omitted and `null` are equivalent and mean the Client does not advertise support. + Supplying `{}` means the Client can offer suggestions that include audio. """ - search_and_replace: Annotated[Optional[NesSearchAndReplaceCapabilities], Field(alias="searchAndReplace")] = None + embedded_context: Annotated[ + Optional[PromptSuggestionsEmbeddedContextCapabilities], Field(alias="embeddedContext") + ] = None """ - Whether the client supports the `searchAndReplace` suggestion kind. + Whether prompt suggestions may include `resource` content blocks. + + Optional. Omitted and `null` are equivalent and mean the Client does not advertise support. + Supplying `{}` means the Client can offer suggestions that include + embedded resources. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("jump", "rename", "search_and_replace", mode="wrap") + @field_validator("audio", "embedded_context", "image", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class HttpMcpServer(McpServerHttp): - type: Literal["http"] = "http" - - -class AcpMcpServer(McpServerAcp): - type: Literal["acp"] = "acp" - - -class StdioMcpServer(McpServerStdio): - type: Literal["stdio"] = "stdio" - - -class ForkSessionRequest(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] - """ - The ID of the session to fork. - """ - cwd: str - """ - The working directory for this session. Must be an absolute path. - """ - additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = None +class CommandsCapabilities(BaseModel): + skill: Optional[CommandsSkillCapabilities] = None """ - Additional workspace roots to activate for this session. Each path must be absolute. + Support for `skill` command entries. - When omitted or empty, no additional roots are activated. When non-empty, - this is the complete resulting additional-root list for the forked - session. - """ - mcp_servers: Annotated[ - Optional[List[Union[HttpMcpServer, AcpMcpServer, StdioMcpServer, OtherMcpServer]]], Field(alias="mcpServers") - ] = None - """ - List of MCP servers to connect to for this session. + Optional. Omitted and `null` are equivalent and mean the Client does not advertise support. + Supplying `{}` means the Agent MAY send `skill` entries in `availableCommands`. The + Client invokes them with `skill` content blocks. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("additional_directories", "mcp_servers", mode="wrap") + @field_validator("skill", mode="wrap") @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) - + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) -class ReplayFromStartVariant(ReplayFromStart): - type: Literal["start"] = "start" +class HttpMcpServer(McpServerHttp): + type: Literal["http"] = "http" -class StartNesRequest(BaseModel): - workspace_uri: Annotated[Optional[AnyUrl], Field(alias="workspaceUri")] = None - """ - The root URI of the workspace. - """ - workspace_folders: Annotated[Optional[List[WorkspaceFolder]], Field(alias="workspaceFolders")] = None - """ - The workspace folders. - """ - repository: Optional[NesRepository] = None - """ - Repository metadata, if the workspace is a git repository. - """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) - """ +class AcpMcpServer(McpServerAcp): + type: Literal["acp"] = "acp" - @field_validator("repository", "workspace_uri", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) +class StdioMcpServer(McpServerStdio): + type: Literal["stdio"] = "stdio" -class NesRelatedSnippet(BaseModel): - uri: AnyUrl - """ - The URI of the file containing the snippets. - """ - excerpts: List[NesExcerpt] - """ - The code excerpts. - """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) +class ListSessionsRequest(BaseModel): + cwd: Optional[str] = None """ + Filter sessions by working directory. Must be an absolute path. + Only sessions whose `cwd` is this same directory match. Subdirectories and + `additionalDirectories` don't. Agents MAY normalize paths when comparing. -class NesOpenFile(BaseModel): - uri: AnyUrl - """ - The URI of the file. - """ - language_id: Annotated[str, Field(alias="languageId")] - """ - The language identifier. - """ - visible_range: Annotated[Optional[Range], Field(alias="visibleRange")] = None - """ - The visible range in the editor, if any. + Omitted and `null` are equivalent and mean sessions are not filtered by working directory. + Clients keep the same value when following `nextCursor`. """ - last_focused_ms: Annotated[Optional[int], Field(alias="lastFocusedMs", ge=0)] = None - """ - Timestamp in milliseconds since epoch of when the file was last focused. - """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + cursor: Optional[str] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + Opaque cursor token from a previous response's nextCursor field for cursor-based pagination - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Omitted and `null` are equivalent and mean the first page is requested. """ + archived: Optional[Union[Literal["exclude"], Literal["include"], Literal["only"], str]] = None + """ + **UNSTABLE** - @field_validator("last_focused_ms", "visible_range", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) + This capability is not part of the spec yet, and may be removed or changed at any point. + Filter sessions by archive state. -class NesDiagnostic(BaseModel): - uri: AnyUrl - """ - The URI of the file containing the diagnostic. - """ - range: Range - """ - The range of the diagnostic. - """ - severity: Union[Literal["error"], Literal["warning"], Literal["information"], Literal["hint"], str] - """ - The severity of the diagnostic. - """ - message: str - """ - The diagnostic message. + Optional. Omitted and `null` are equivalent and mean `exclude`. Only send this when + the Agent advertises the `session.archive` capability. The filter combines with `cwd` and + applies before pagination. Clients keep the same value when following `nextCursor`. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class ClientErrorMessage(BaseModel): - id: Optional[Union[int, str]] - """ - The id of the request this response answers. - """ - error: Error - """ - Method-specific error data. - """ +class ReplayFromStartVariant(ReplayFromStart): + type: Literal["start"] = "start" + + +class CancelledPermissionOutcome(CancelledPermissionOutcomeBase): + outcome: Literal["cancelled"] = "cancelled" class SelectedPermissionOutcomeVariant(SelectedPermissionOutcome): @@ -4219,11 +4653,9 @@ class SelectedPermissionOutcomeVariant(SelectedPermissionOutcome): class AcceptElicitationResponse(ElicitationAcceptAction): field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -4237,96 +4669,32 @@ class McpErrorResponse(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Optional ACP carrier metadata. - """ - - -class TextDocumentContentChangeEvent(BaseModel): - range: Optional[Range] = None - """ - The range of the document that changed. If `None`, the entire content is replaced. - """ - text: str - """ - The new text for the range, or the full document content if `range` is `None`. - """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) - """ - - -class DidFocusDocumentNotification(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] - """ - The session ID for this notification. - """ - uri: AnyUrl - """ - The URI of the focused document. - """ - version: int - """ - The version number of the document. - """ - position: Position - """ - The current cursor position. - """ - visible_range: Annotated[Range, Field(alias="visibleRange")] - """ - The portion of the file currently visible in the editor viewport. - """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This is ACP metadata, not the inner MCP message's `_meta`. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class RejectNesNotification(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] - """ - The session ID for this notification. - """ - suggestion_id: Annotated[str, Field(alias="suggestionId")] - """ - The ID of the rejected suggestion. - """ - reason: Optional[Union[Literal["rejected"], Literal["ignored"], Literal["replaced"], Literal["cancelled"], str]] = ( - None - ) +class ClientNotification(MethodParamsModel): + method: str """ - The reason for rejection. + The notification method name. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + params: Optional[Union[CancelSessionNotification, MessageMcpNotification, Any]] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Method-specific notification parameters. """ - @field_validator("reason", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - -class ProtocolLevelNotification(BaseModel): +class ProxyNotification(MethodParamsModel): method: str """ The notification method name. """ - params: Optional[CancelRequestNotification] = None + params: Optional[ProxySuccessorNotification] = None """ Method-specific notification parameters. """ @@ -4363,6 +4731,7 @@ class Content(BaseModel): AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] """ @@ -4370,9 +4739,9 @@ class Content(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -4382,110 +4751,75 @@ class ElicitationMultiSelectPropertySchema(MultiSelectPropertySchema): type: Literal["array"] = "array" -class AgentErrorMessage(BaseModel): - id: Optional[Union[int, str]] - """ - The id of the request this response answers. - """ - error: Error - """ - Method-specific error data. - """ - - -class SessionCapabilities(BaseModel): - prompt: Optional[PromptCapabilities] = None - """ - Prompt capabilities supported by the agent in `session/prompt` requests. - - Optional. Omitted or `null` both mean the agent does not advertise any - prompt extensions beyond the baseline text and resource-link content - required by `session/prompt`. - """ - mcp: Optional[McpCapabilities] = None +class PromptCapabilities(BaseModel): + image: Optional[PromptImageCapabilities] = None """ - MCP capabilities supported by the agent for session lifecycle requests. + Agent supports `image` content blocks. - Optional. Omitted or `null` both mean the agent does not advertise MCP - server transport support for sessions. + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports image content in prompts. """ - delete: Optional[SessionDeleteCapabilities] = None + audio: Optional[PromptAudioCapabilities] = None """ - Whether the agent supports `session/delete`. + Agent supports `audio` content blocks. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports deleting sessions from `session/list`. + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports audio content in prompts. """ - additional_directories: Annotated[ - Optional[SessionAdditionalDirectoriesCapabilities], Field(alias="additionalDirectories") - ] = None + embedded_context: Annotated[Optional[PromptEmbeddedContextCapabilities], Field(alias="embeddedContext")] = None """ - Whether the agent supports `additionalDirectories` on supported session lifecycle requests. + Agent supports embedded context in `session/prompt` requests. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports `additionalDirectories` on - supported session lifecycle requests. + When enabled, the Client is allowed to include `resource` content blocks + in prompt requests for pieces of context that are referenced in the message. - Agents may return `SessionInfo.additionalDirectories` to report the - complete ordered additional-root list associated with a listed session. + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports embedded context in prompts. """ - fork: Optional[SessionForkCapabilities] = None + skill: Optional[PromptSkillCapabilities] = None """ **UNSTABLE** This capability is not part of the spec yet, and may be removed or changed at any point. - Whether the agent supports `session/fork`. + Agent supports `skill` content blocks. - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports forking sessions. + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means a prompt may contain one `skill` content block, as its first block. + An Agent that sends `skill` entries in `availableCommands` MUST advertise this capability. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("additional_directories", "delete", "fork", "mcp", "prompt", mode="wrap") + @field_validator("audio", "embedded_context", "image", "skill", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class NesDocumentEventCapabilities(BaseModel): - did_open: Annotated[Optional[NesDocumentDidOpenCapabilities], Field(alias="didOpen")] = None - """ - Whether the agent wants `document/didOpen` events. - """ - did_change: Annotated[Optional[NesDocumentDidChangeCapabilities], Field(alias="didChange")] = None - """ - Whether the agent wants `document/didChange` events, and the sync kind. - """ - did_close: Annotated[Optional[NesDocumentDidCloseCapabilities], Field(alias="didClose")] = None - """ - Whether the agent wants `document/didClose` events. - """ - did_save: Annotated[Optional[NesDocumentDidSaveCapabilities], Field(alias="didSave")] = None +class SessionSystemPromptCapabilities(BaseModel): + mode: Optional[SessionSystemPromptModeCapabilities] = None """ - Whether the agent wants `document/didSave` events. - """ - did_focus: Annotated[Optional[NesDocumentDidFocusCapabilities], Field(alias="didFocus")] = None - """ - Whether the agent wants `document/didFocus` events. + Delivery modes the Agent supports in addition to `append`. + + Optional. Omitted and `null` are equivalent and mean the Agent supports only `append`. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("did_change", "did_close", "did_focus", "did_open", "did_save", mode="wrap") + @field_validator("mode", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -4498,106 +4832,154 @@ class ListProvidersResponse(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class SessionConfigSelect(BaseModel): +class SessionConfigSelect(SessionConfigSelectModel): current_value: Annotated[str, Field(alias="currentValue")] """ - The currently selected value. + The currently selected value. MUST be one of the `value`s in `options`. """ options: Union[List[SessionConfigSelectOption], List[SessionConfigSelectGroup]] """ - The set of selectable options. + The set of selectable options. MUST contain at least one value, and each `value` MUST be + unique within the option, including across groups. """ -class AvailableCommand(BaseModel): - name: str - """ - Command name (e.g., `create_plan`, `research_codebase`). - """ - description: str +class SlashCommand(Command): + type: Literal["command"] = "command" + + +class RunningState(RunningStateUpdate): + state: Literal["running"] = "running" + + +class RequiresActionState(RequiresActionStateUpdate): + state: Literal["requires_action"] = "requires_action" + + +class UnknownState(UnknownStateUpdate): + state: Literal["unknown"] = "unknown" + + +class Error(ErrorModel): + code: StrictInt """ - Human-readable description of what the command does. + A number indicating the error type that occurred. + This MUST be an integer as defined in the JSON-RPC specification. """ - input: Optional[Union[TextAvailableCommandInput, OtherAvailableCommandInput]] = None + message: str """ - Input for the command if required + A short, human-readable description of the error, in plain text. + The sender SHOULD limit the message to a single concise sentence. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + data: Any = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + Optional primitive or structured value that contains additional information about the error. + This may include debugging information or context-specific details. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Omitted and `null` are equivalent and mean no additional data is provided. Some codes + define a shape: [`UnsupportedProtocolVersionErrorData`] for `-32022`, and + [`SessionNotFoundErrorData`] for `-32002` when a session is not found. """ - @field_validator("input", mode="wrap") + @field_validator("data", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class NesTextEdit(BaseModel): - range: Range - """ - The range to replace. - """ - new_text: Annotated[str, Field(alias="newText")] +class ErrorStopReason(BaseModel): + error: Optional[Error] = None """ - The replacement text. - """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The failure, as a JSON-RPC error object. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Optional. Omitted and `null` are equivalent and mean the Agent is not reporting failure details. + Agents SHOULD include it. """ + @field_validator("error", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) -class NesEditSuggestion(BaseModel): - suggestion_id: Annotated[str, Field(alias="suggestionId")] + +class IdleStateUpdate(IdleStateUpdateModel): + usage: Optional[Usage] = None """ - Unique identifier for accept/reject tracking. + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Token usage for completed foreground work. + + Optional. Omitted and `null` are equivalent and mean the Agent is not reporting token + usage for this state update. A repeated or resume snapshot that carries it MUST NOT + be counted as additional usage. """ - uri: AnyUrl + background: Optional[ + List[Union[TerminalBackgroundWork, ToolCallBackgroundWork, SubagentBackgroundWork, OtherBackgroundWork]] + ] = None """ - The URI of the file to edit. + Work running independently of foreground work, as a complete snapshot. + + Optional. Omitted and `null` are equivalent and mean the Agent is not reporting + background work, not that nothing is running. `[]` means no background work is + running. An Agent that reports background work MUST include it on every state + update for the session. + + See protocol docs: [Background Work](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#background-work) """ - edits: Annotated[List[NesTextEdit], Field(min_length=1)] + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The text edits to apply. Must contain at least one edit. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - cursor_position: Annotated[Optional[Position], Field(alias="cursorPosition")] = None + stop_reason: Annotated[Optional[str], Field(alias="stopReason")] = None """ - Optional suggested cursor position after applying edits. + Why foreground work stopped. The value selects one of this type's variants, which may add fields of their own. + + Optional. Omitted and `null` are equivalent and mean the Agent is not reporting a stop reason. + + See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#stop-reasons) """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + error: Optional[Error] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The failure, as a JSON-RPC error object. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Optional. Omitted and `null` are equivalent and mean the Agent is not reporting failure details. + Agents SHOULD include it. """ - @field_validator("cursor_position", mode="wrap") + @field_validator("background", "error", "stop_reason", "usage", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class SessionSubagentUpdate(SubagentUpdate): - session_update: Annotated[Literal["subagent_update"], Field(alias="sessionUpdate")] = "subagent_update" +class IdleSessionStateUpdateBase(IdleStateUpdate): + state: Literal["idle"] = "idle" + + +class IdleSessionStateUpdate(IdleSessionStateUpdateBase, SessionStateUpdateBase): + session_update: Annotated[Literal["state_update"], Field(alias="sessionUpdate")] = "state_update" + + +class SessionTerminalUpdate(TerminalUpdate): + session_update: Annotated[Literal["terminal_update"], Field(alias="sessionUpdate")] = "terminal_update" + + +class SessionCursorUpdate(CursorUpdate): + session_update: Annotated[Literal["cursor_update"], Field(alias="sessionUpdate")] = "cursor_update" class ContentChunk(BaseModel): @@ -4606,7 +4988,7 @@ class ContentChunk(BaseModel): A unique identifier for the message this chunk belongs to. All chunks belonging to the same message share the same `messageId`. - A change in `messageId` indicates a new message has started. + Chunks for different messages can interleave. """ content: Union[ TextContentBlock, @@ -4614,6 +4996,7 @@ class ContentChunk(BaseModel): AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] """ @@ -4621,9 +5004,10 @@ class ContentChunk(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. This field is chunk-scoped. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This metadata is scoped to the chunk and does not patch stored metadata. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -4642,6 +5026,7 @@ class UserMessage(BaseModel): AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] ] @@ -4651,11 +5036,14 @@ class UserMessage(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. Omitted means no metadata update; `null` is an explicit clear signal. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ @field_validator("content", mode="wrap") @@ -4677,6 +5065,7 @@ class AgentMessage(BaseModel): AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] ] @@ -4686,11 +5075,14 @@ class AgentMessage(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. Omitted means no metadata update; `null` is an explicit clear signal. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ @field_validator("content", mode="wrap") @@ -4712,6 +5104,7 @@ class AgentThought(BaseModel): AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] ] @@ -4721,11 +5114,14 @@ class AgentThought(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. Omitted means no metadata update; `null` is an explicit clear signal. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ @field_validator("content", mode="wrap") @@ -4739,43 +5135,55 @@ class PlanUpdateItems(PlanItems): class PlanUpdate(BaseModel): - plan: Union[PlanUpdateItems, PlanUpdateFile, PlanUpdateMarkdown, OtherPlanUpdateContent] + plan: Union[PlanUpdateItems, PlanUpdateMarkdown, OtherPlanUpdateContent] """ - The updated plan content. + Replaces the whole plan with this `planId`, even if its `type` changes. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ class AvailableCommandsUpdateBase(BaseModel): - available_commands: Annotated[List[AvailableCommand], Field(alias="availableCommands")] + available_commands: Annotated[ + List[Union[SlashCommand, SkillCommand, OtherAvailableCommand]], Field(alias="availableCommands") + ] """ - Commands the agent can execute. + Commands the Agent can execute. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("available_commands", mode="wrap") + @classmethod + def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return skip_invalid_items(v, handler, info) + class CompactionUpdate(BaseModel): compaction_id: Annotated[str, Field(alias="compactionId")] """ The Agent-owned ID of this compaction, unique within the session. """ - status: Union[Literal["in_progress"], Literal["completed"], Literal["failed"], Literal["cancelled"], str] + status: Optional[ + Union[Literal["in_progress"], Literal["completed"], Literal["failed"], Literal["cancelled"], str] + ] = None """ Current lifecycle status. + + Omission leaves the status unchanged, `null` resets it to `in_progress`, and a value + replaces it. A new compaction starts as `in_progress`. """ summary: Optional[ List[ @@ -4785,23 +5193,31 @@ class CompactionUpdate(BaseModel): AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] ] ] = None """ - Complete replacement user-displayable summary retained by the compaction. + Complete replacement user-displayable summary content for the compaction. """ error: Optional[str] = None """ - Human-readable description of why the compaction failed. + Human-readable details of a compaction error, in plain text. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Extensible metadata patch for this compaction. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ - @field_validator("error", mode="wrap") + @field_validator("error", "status", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -4823,6 +5239,7 @@ class CompactionSummaryChunk(BaseModel): AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] """ @@ -4830,9 +5247,75 @@ class CompactionSummaryChunk(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Metadata scoped to this chunk. Omission and `null` both mean absent. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This metadata is scoped to the chunk and does not patch stored metadata. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + +class PromptSuggestion(BaseModel): + prompt: Annotated[ + List[ + Union[ + TextContentBlock, + ImageContentBlock, + AudioContentBlock, + ResourceContentBlock, + EmbeddedResourceContentBlock, + SkillContentBlock, + OtherContentBlock, + ] + ], + Field(min_length=1), + ] + """ + The content of the suggested prompt. + + Required and non-null. Must contain at least one content block. This is + the same type as the `prompt` field of `session/prompt`, and the Client + can send it in that field unchanged. + + Agents MUST only use `text` and `resource_link` content blocks, and + other content block types that both the Agent's `session.prompt` + capability and the Client's `session.promptSuggestions` capability + advertise. Agents MUST NOT send a prompt whose only content is empty + or whitespace-only text. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + +class PromptSuggestionsUpdate(BaseModel): + suggestions: List[PromptSuggestion] + """ + The suggestions the Client can offer, ordered most likely first. + + Required and non-null. An empty list withdraws the suggestions the + Client is offering. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("suggestions", mode="wrap") + @classmethod + def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return skip_invalid_items(v, handler, info) + class SessionMessage(BaseModel): message_id: Annotated[str, Field(alias="messageId")] @@ -4841,11 +5324,31 @@ class SessionMessage(BaseModel): """ sender_session_id: Annotated[Optional[str], Field(alias="senderSessionId")] = None """ - Optional sending session identity; omission or `null` retains a known value. + The sending session. + + Omitted leaves the stored value unchanged. `null` clears it. A value replaces it. """ recipient_session_id: Annotated[Optional[str], Field(alias="recipientSessionId")] = None """ - Optional receiving session identity; omission or `null` retains a known value. + The receiving session. + + Omitted leaves the stored value unchanged. `null` clears it. A value replaces it. + """ + sender_message_id: Annotated[Optional[str], Field(alias="senderMessageId")] = None + """ + On an incoming view, the `messageId` of the same message's outgoing view in the + sender's transcript. + + Omitted leaves the stored value unchanged. `null` clears it. A value replaces it. It can arrive + after the message starts streaming. + """ + recipient_message_id: Annotated[Optional[str], Field(alias="recipientMessageId")] = None + """ + On an outgoing view, the `messageId` of the same message's incoming view in the + recipient's transcript. + + Omitted leaves the stored value unchanged. `null` clears it. A value replaces it. It can arrive + after the message starts streaming. """ content: Optional[ List[ @@ -4855,22 +5358,30 @@ class SessionMessage(BaseModel): AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] ] ] = None """ - Omitted leaves content unchanged; `null` clears it; a concrete array + Omitted leaves content unchanged. `null` clears it. A concrete array replaces the whole content collection. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Omitted leaves metadata unchanged; `null` clears it. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. - Implementations MUST NOT make assumptions about values in `_meta`. + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ - @field_validator("recipient_session_id", "sender_session_id", mode="wrap") + @field_validator( + "recipient_message_id", "recipient_session_id", "sender_message_id", "sender_session_id", mode="wrap" + ) @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -4886,20 +5397,13 @@ class SessionMessageChunk(BaseModel): """ Identifier of this message within the enclosing session's transcript. """ - sender_session_id: Annotated[Optional[str], Field(alias="senderSessionId")] = None - """ - Optional sending session identity; omission or `null` retains a known value. - """ - recipient_session_id: Annotated[Optional[str], Field(alias="recipientSessionId")] = None - """ - Optional receiving session identity; omission or `null` retains a known value. - """ content: Union[ TextContentBlock, ImageContentBlock, AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock, + SkillContentBlock, OtherContentBlock, ] """ @@ -4907,111 +5411,178 @@ class SessionMessageChunk(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Optional and nullable chunk-scoped metadata; omitted or `null` means none. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This metadata is scoped to the chunk and does not patch stored metadata. - Implementations MUST NOT make assumptions about values in `_meta`. + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("recipient_session_id", "sender_session_id", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - -class ClientCapabilities(BaseModel): - auth: Optional[AuthCapabilities] = None +class ClientSessionCapabilities(BaseModel): + prompt_suggestions: Annotated[Optional[PromptSuggestionsCapabilities], Field(alias="promptSuggestions")] = None """ - Authentication capabilities supported by the client. - Determines which authentication method types the agent may include - in its `InitializeResponse`. + Support for `prompt_suggestions_update` session updates. - Optional. Omitted or `null` both mean the client does not advertise any - authentication-method extensions. + Optional. Omitted and `null` are equivalent and mean the Client does not advertise support. + Supplying `{}` means the Client can offer prompt suggestions made of + `text` and `resource_link` content blocks. """ - elicitation: Optional[ElicitationCapabilities] = None + commands: Optional[CommandsCapabilities] = None """ - Elicitation capabilities supported by the client. - Determines which elicitation modes the agent may use. + Command types the Client understands in addition to `command`. - Optional. Omitted or `null` both mean the client does not advertise - elicitation support. + Optional. Omitted and `null` are equivalent and mean the Client does not advertise support + for any of them. This object only groups capabilities. Supplying `{}` advertises nothing. """ - nes: Optional[ClientNesCapabilities] = None + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - **UNSTABLE** + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. - This capability is not part of the spec yet, and may be removed or changed at any point. + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + @field_validator("commands", "prompt_suggestions", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) - NES (Next Edit Suggestions) capabilities supported by the client. - Optional. Omitted or `null` both mean the client does not advertise any - NES suggestion-kind extensions. +class SystemPrompt(BaseModel): + mode: Union[Literal["append"], Literal["override"], str] """ - position_encodings: Annotated[ - Optional[List[Literal["utf-16", "utf-32", "utf-8"]]], Field(alias="positionEncodings") - ] = None + How the Agent combines `content` with its own instructions. + + Required. Agents MUST return an error for a mode they do not support rather than + treating it as `append` or `override`. """ - **UNSTABLE** + content: Annotated[ + List[ + Union[ + TextContentBlock, + ImageContentBlock, + AudioContentBlock, + ResourceContentBlock, + EmbeddedResourceContentBlock, + SkillContentBlock, + OtherContentBlock, + ] + ], + Field(min_length=1), + ] + """ + The system prompt content. - This capability is not part of the spec yet, and may be removed or changed at any point. + Agents advertising the capability MUST accept `text` content blocks. + Clients MUST NOT send other content block types until a future + capability allows them, and Agents MUST return an error for content + blocks they do not support, including unknown types. - The position encodings supported by the client, in order of preference. + Clients MUST NOT send an empty array. Agents MAY reject one with + `-32602` without creating or resuming the session. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("auth", "elicitation", "nes", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - - @field_validator("position_encodings", mode="wrap") - @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) - -class NewSessionRequest(BaseModel): +class ForkSessionRequest(InitialConfigRequestModel): + session_id: Annotated[str, Field(alias="sessionId")] + """ + The ID of the session to fork. + """ cwd: str """ The working directory for this session. Must be an absolute path. """ - additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = None + additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = [] """ - Additional workspace roots for this session. Each path must be absolute. + Additional workspace roots to activate for this session. Each path MUST be absolute. - These expand the session's workspace scope without changing `cwd`, which - remains the base for relative paths. When omitted or empty, no - additional roots are activated for the new session. + When omitted or empty, no additional roots are activated. When non-empty, + this is the complete resulting additional-root list for the forked + session. """ mcp_servers: Annotated[ - Optional[List[Union[HttpMcpServer, AcpMcpServer, StdioMcpServer, OtherMcpServer]]], Field(alias="mcpServers") - ] = None + Optional[List[Union[HttpMcpServer, AcpMcpServer, StdioMcpServer, OtherMcpServer]]], + Field(alias="mcpServers", validate_default=True), + ] = [] """ - List of MCP (Model Context Protocol) servers the agent should connect to. + List of MCP servers to connect to for this session. + """ + system_prompt: Annotated[Optional[SystemPrompt], Field(alias="systemPrompt")] = None + """ + System-level instructions for the forked session. + + Optional. Omitted and `null` are equivalent. The Agent MAY then keep a + system prompt it stored with the source session or use its default + instructions. Clients MUST only send this when the Agent advertises + `session.systemPrompt`, and SHOULD send the same value they used for the + source session. + """ + config_options: Annotated[ + Optional[List[Union[InitialIdConfigOption, InitialBooleanConfigOption, OtherInitialConfigOption]]], + Field(alias="configOptions", validate_default=True), + ] = [] + """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Initial values for the forked session's config options. + + Optional. Omitted and `null` are equivalent to an empty list. Clients MUST only send + this when the Agent advertises `session.options`. + + The Agent applies the entries in list order on top of the configuration the fork + starts with, as if the Client had called `session/set_config_option` for each entry + after the session was set up. Malformed entries and duplicate `configId` values fail + the request with `-32602`. The Agent MUST ignore an entry whose `configId` is unknown, + whose `type` does not match the option, or whose value is not allowed when it is + applied. The `configOptions` in the response contain the values the session actually + has. The Agent SHOULD NOT send `config_option_update` notifications for these entries, + and SHOULD NOT send other `session/update` notifications caused by applying them + before it responds. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + cursor_id: Annotated[Optional[str], Field(alias="cursorId")] = None + """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + The session cursor to fork at. The new session's history is the source + session's history before the cursor. + + Optional. Omitted and `null` are equivalent and fork the whole session. + Clients MUST only send the ID of a cursor that the Agent announced on the + source session and that currently advertises `capabilities.fork`. The Agent + rejects any other ID with `-32602`. It does not fall back to forking the + whole session. + """ - @field_validator("additional_directories", "mcp_servers", mode="wrap") + @field_validator("additional_directories", "config_options", "mcp_servers", mode="before") @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) + def empty_list_on_null_validator(cls, v: Any, info: ValidationInfo) -> Any: + return empty_list_on_null(v, info) -class ResumeSessionRequest(BaseModel): +class ResumeSessionRequest(InitialConfigRequestModel): session_id: Annotated[str, Field(alias="sessionId")] """ The ID of the session to resume. @@ -5019,50 +5590,92 @@ class ResumeSessionRequest(BaseModel): cwd: str """ The working directory for this session. Must be an absolute path. + + Clients MUST send the session's working directory. Agents MAY reject a different directory + with `-32602`, and MAY normalize paths when comparing. """ - additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = None + additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = [] """ - Additional workspace roots to activate for this session. Each path must be absolute. + Additional workspace roots to activate for this session. Each path MUST be absolute. When omitted or empty, no additional roots are activated. When non-empty, this is the complete resulting additional-root list for the resumed - session. It may differ from any previously used or reported list as long as + session. It MAY differ from any previously used or reported list as long as the request `cwd` matches the session's `cwd`. """ mcp_servers: Annotated[ - Optional[List[Union[HttpMcpServer, AcpMcpServer, StdioMcpServer, OtherMcpServer]]], Field(alias="mcpServers") - ] = None + Optional[List[Union[HttpMcpServer, AcpMcpServer, StdioMcpServer, OtherMcpServer]]], + Field(alias="mcpServers", validate_default=True), + ] = [] """ List of MCP servers to connect to for this session. + + The complete set of Client-provided servers. Omitted and `[]` mean none. Agents SHOULD + NOT restore servers from earlier requests. """ replay_from: Annotated[Optional[Union[ReplayFromStartVariant, OtherReplayFrom]], Field(alias="replayFrom")] = None """ - Inclusive cursor describing where conversation replay should begin. + Inclusive cursor describing where conversation replay begins. - Optional. Omitted or `null` both mean the Agent should resume without - replaying previous conversation history. Replay cursors are inclusive: + Optional. Omitted and `null` are equivalent, and the Agent MUST NOT replay + previous conversation history. Replay cursors are inclusive: replay includes the position identified by the cursor. Supplying - `{ "type": "start" }` means the Agent should replay all retained + `{ "type": "start" }` means the Agent MUST replay all retained conversation history before responding. + + Agents MUST reject unsupported cursor types or malformed cursor values + with `-32602` (Invalid params), rather than substituting another cursor + or resuming without replay. + """ + system_prompt: Annotated[Optional[SystemPrompt], Field(alias="systemPrompt")] = None + """ + System-level instructions for the resumed session. + + Optional. Omitted and `null` are equivalent. The Agent MAY then keep a + system prompt it stored with the session or use its default instructions. + Clients MUST only send this when the Agent advertises + `session.systemPrompt`, and SHOULD send the same value they used when the + session was created. + """ + config_options: Annotated[ + Optional[List[Union[InitialIdConfigOption, InitialBooleanConfigOption, OtherInitialConfigOption]]], + Field(alias="configOptions", validate_default=True), + ] = [] + """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Initial values for the session's config options. + + Optional. Omitted and `null` are equivalent to an empty list. Clients MUST only send + this when the Agent advertises `session.options`. + + The Agent applies the entries in list order, as if the Client had called + `session/set_config_option` for each entry after the session was set up. Malformed + entries and duplicate `configId` values fail the request with `-32602`. The Agent MUST + ignore an entry whose `configId` is unknown, whose `type` does not match the option, + or whose value is not allowed when it is applied. The `configOptions` in the response contain the values the session actually + has. The Agent SHOULD NOT send `config_option_update` notifications for these entries + on the requesting connection. If the session is active on other connections, the + Agent SHOULD send `config_option_update` on those connections. + + The Agent applies the entries before it replays history for `replayFrom` and before + it responds. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("replay_from", mode="wrap") + @field_validator("additional_directories", "config_options", "mcp_servers", mode="before") @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - - @field_validator("additional_directories", "mcp_servers", mode="wrap") - @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) + def empty_list_on_null_validator(cls, v: Any, info: ValidationInfo) -> Any: + return empty_list_on_null(v, info) class PromptRequest(BaseModel): @@ -5070,73 +5683,83 @@ class PromptRequest(BaseModel): """ The ID of the session to send this user message to """ - prompt: List[ - Union[ - TextContentBlock, - ImageContentBlock, - AudioContentBlock, - ResourceContentBlock, - EmbeddedResourceContentBlock, - OtherContentBlock, - ] + prompt: Annotated[ + List[ + Union[ + TextContentBlock, + ImageContentBlock, + AudioContentBlock, + ResourceContentBlock, + EmbeddedResourceContentBlock, + SkillContentBlock, + OtherContentBlock, + ] + ], + Field(min_length=1), ] """ The blocks of content that compose the user's message. - As a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`], - while other variants are optionally enabled via [`PromptCapabilities`]. + As a baseline, the Agent MUST support `text` and `resource_link` content blocks, + while other variants are optionally enabled via `PromptCapabilities`. - The Client MUST adapt its interface according to [`PromptCapabilities`]. + The Client MUST adapt its interface according to `PromptCapabilities`. - The client MAY include referenced pieces of context as either - [`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`]. + The Client MAY include referenced pieces of context as either + `resource` or `resource_link` content blocks. - When available, [`ContentBlock::Resource`] is preferred + When available, `resource` is preferred as it avoids extra round-trips and allows the message to include - pieces of context from sources the agent may not have access to. + pieces of context from sources the Agent might not have access to. + + Clients MUST NOT send an empty array. Agents MAY reject one with `-32602` without + inserting it. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + idempotency_key: Annotated[Optional[str], Field(alias="idempotencyKey", max_length=255, min_length=1)] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + Identifies one prompt submission within this session. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) - """ + Optional. Omitted and `null` are equivalent and mean no key. The Agent then handles + the prompt without duplicate detection. + The Client generates the key and sends the same key on every attempt for the same + submission. Agents that advertise `capabilities.session` MUST support the key. + A retry of a recorded insertion returns the original `messageId` without inserting + another message. -class NesSuggestContext(BaseModel): - recent_files: Annotated[Optional[List[NesRecentFile]], Field(alias="recentFiles")] = None - """ - Recently accessed files. - """ - related_snippets: Annotated[Optional[List[NesRelatedSnippet]], Field(alias="relatedSnippets")] = None - """ - Related code snippets. - """ - edit_history: Annotated[Optional[List[NesEditHistoryEntry]], Field(alias="editHistory")] = None - """ - Recent edit history. - """ - user_actions: Annotated[Optional[List[NesUserAction]], Field(alias="userActions")] = None - """ - Recent user actions (typing, navigation, etc.). + The Agent MUST recognize the key for as long as it retains the message, including + across connections and Agent restarts. For a live-only message, it MUST recognize + the key while the session stays active on a connection. A retry with a forgotten + key is a new submission, even immediately after reconnecting. If a duplicate + would matter and the Client cannot rule it out, it SHOULD NOT retry automatically. + + When present, the value is an opaque, case-sensitive string of 1 to 255 characters. + Agents MUST reject any other value with `-32602` (Invalid params) and MUST NOT treat + it as omitted. + + See protocol docs: [Retrying a prompt](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#retrying-a-prompt) """ - open_files: Annotated[Optional[List[NesOpenFile]], Field(alias="openFiles")] = None + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - Currently open files in the editor. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - diagnostics: Optional[List[NesDiagnostic]] = None + + +class ClientErrorMessage(BaseModel): + id: Optional[Union[int, str]] """ - Current diagnostics (errors, warnings). + The id of the request this response answers. + + Required. `null` only when the request's id could not be determined, such as + for a parse error or an invalid request. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + error: Error """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Method-specific error data. """ @@ -5147,79 +5770,56 @@ class RequestPermissionResponse(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ -class DidChangeDocumentNotification(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] - """ - The session ID for this notification. +class ProxyErrorMessage(BaseModel): + id: Optional[Union[int, str]] """ - uri: AnyUrl - """ - The URI of the changed document. - """ - version: int - """ - The new version number of the document. - """ - content_changes: Annotated[List[TextDocumentContentChangeEvent], Field(alias="contentChanges")] - """ - The content changes. + The id of the request this response answers. + + Required. `null` only when the request's id could not be determined, such as + for a parse error or an invalid request. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + error: Error """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Method-specific error data. """ - @field_validator("content_changes", mode="wrap") - @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) - class ContentToolCallContent(Content): type: Literal["content"] = "content" class ElicitationSchema(BaseModel): - type: Optional[Literal["object"]] = "object" + type: Literal["object"] = "object" """ - Type discriminator. Always `"object"`. + Type discriminator. Always `"object"`. Any other value is rejected. """ title: Optional[str] = None """ - Optional title for the schema. + Optional plain-text title for the form as a whole. Optional. Omitted and `null` are equivalent and mean no title is provided. """ - properties: Annotated[ - Optional[ - Dict[ - str, - Union[ - ElicitationStringPropertySchema, - ElicitationNumberPropertySchema, - ElicitationIntegerPropertySchema, - ElicitationBooleanPropertySchema, - ElicitationMultiSelectPropertySchema, - ElicitationOtherPropertySchema, - ], - ] + properties: Dict[ + str, + Union[ + ElicitationStringPropertySchema, + ElicitationNumberPropertySchema, + ElicitationIntegerPropertySchema, + ElicitationBooleanPropertySchema, + ElicitationMultiSelectPropertySchema, + ElicitationOtherPropertySchema, ], - Field(validate_default=True), - ] = {} + ] """ - Property definitions (must be primitive types). + Property definitions (MUST be primitive types). """ required: Optional[List[str]] = None """ @@ -5229,22 +5829,20 @@ class ElicitationSchema(BaseModel): """ description: Optional[str] = None """ - Optional description of what this schema represents. + Optional plain-text description of what the form asks the user to provide. Optional. Omitted and `null` are equivalent and mean no schema description is provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("description", "title", "type", mode="wrap") + @field_validator("description", "title", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -5267,25 +5865,149 @@ class ElicitationFormRequestMode(ElicitationRequestScope): class ElicitationFormMode(RootModel[Union[ElicitationFormSessionMode, ElicitationFormRequestMode]]): root: Union[ElicitationFormSessionMode, ElicitationFormRequestMode] """ - Form-based elicitation mode where the client renders a form from the provided schema. + Form-based elicitation mode where the Client renders a form from the provided schema. + """ + + +class AgentErrorMessage(BaseModel): + id: Optional[Union[int, str]] + """ + The id of the request this response answers. + + Required. `null` only when the request's id could not be determined, such as + for a parse error or an invalid request. + """ + error: Error + """ + Method-specific error data. + """ + + +class SessionCapabilities(BaseModel): + prompt: Optional[PromptCapabilities] = None + """ + Prompt capabilities supported by the Agent in `session/prompt` requests. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise any + prompt extensions beyond the baseline text and resource-link content + required by `session/prompt`. + """ + mcp: Optional[McpCapabilities] = None + """ + MCP capabilities supported by the Agent for session lifecycle requests. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise MCP + server transport support for sessions. + """ + delete: Optional[SessionDeleteCapabilities] = None + """ + Whether the Agent supports `session/delete`. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports deleting sessions from `session/list`. + """ + additional_directories: Annotated[ + Optional[SessionAdditionalDirectoriesCapabilities], Field(alias="additionalDirectories") + ] = None + """ + Whether the Agent supports `additionalDirectories` on supported session lifecycle requests. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports `additionalDirectories` on + supported session lifecycle requests. + + Agents MAY return `SessionInfo.additionalDirectories` to report the + complete ordered additional-root list associated with a listed session. + """ + system_prompt: Annotated[Optional[SessionSystemPromptCapabilities], Field(alias="systemPrompt")] = None + """ + Whether the Agent supports `systemPrompt` on session lifecycle requests. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports `systemPrompt` in `append` mode. + """ + fork: Optional[SessionForkCapabilities] = None + """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Whether the Agent supports `session/fork`. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports forking sessions. + """ + archive: Optional[SessionArchiveCapabilities] = None + """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Whether the Agent supports `session/archive` and `session/unarchive`. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports both methods, the `archived` filter on + `session/list`, and `SessionInfo.archived`. + """ + status: Optional[SessionStatusCapabilities] = None """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Whether the Agent supports `session/status`. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports checking session status. + """ + options: Optional[SessionOptionsCapabilities] = None + """ + **UNSTABLE** + This capability is not part of the spec yet, and may be removed or changed at any point. + + Whether the Agent supports `session/options`. -class NesEventCapabilities(BaseModel): - document: Optional[NesDocumentEventCapabilities] = None + Optional. Omitted or `null` both mean the Agent does not advertise support. + Supplying `{}` means the Agent supports `session/options` and accepts initial + config option values on session setup requests. """ - Document event capabilities. + title: Optional[SessionTitleCapabilities] = None + """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Whether the Agent supports `session/set_title`. + + Agents report titles through `session/list` and `session_info_update` without this + capability. It only advertises that Clients can set titles. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports setting session titles. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("document", mode="wrap") + @field_validator( + "additional_directories", + "archive", + "delete", + "fork", + "mcp", + "options", + "prompt", + "status", + "system_prompt", + "title", + mode="wrap", + ) @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -5294,27 +6016,34 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa class SelectSessionConfigOption(SessionConfigSelect): config_id: Annotated[str, Field(alias="configId")] """ - Unique identifier for the configuration option. + Identifier for the configuration option. MUST be unique within `configOptions`. """ name: str """ - Human-readable label for the option. + Human-readable label the Client can display for the option, in plain text. """ description: Optional[str] = None """ Optional description for the Client to display to the user. + May contain Markdown. + + Omitted and `null` are equivalent and mean no description is provided. """ category: Optional[ - Union[Literal["mode"], Literal["model"], Literal["model_config"], Literal["thought_level"], str] + Union[ + Literal["mode"], Literal["model"], Literal["model_config"], Literal["speed"], Literal["thought_level"], str + ] ] = None """ Optional semantic category for this option (UX only). + + Omitted and `null` are equivalent and mean no category is provided. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -5332,20 +6061,70 @@ class ForkSessionResponse(BaseModel): ] = None """ Initial session configuration options. + + Optional. Omitted or empty means no config options are advertised. + Senders MUST use an array, not `null`. + Later `config_option_update` notifications replace this list. """ - available_commands: Annotated[Optional[List[AvailableCommand]], Field(alias="availableCommands")] = None + available_commands: Annotated[ + Optional[List[Union[SlashCommand, SkillCommand, OtherAvailableCommand]]], Field(alias="availableCommands") + ] = None """ - Initial commands the agent can execute in this session. + Initial commands the Agent can execute in this session. Optional. Omitted or empty means no initial commands are advertised. - Senders MUST use an array, not `null`; receivers treat `null` like omission. + Senders MUST use an array, not `null`. Later `available_commands_update` notifications replace this list. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + """ + + @field_validator("available_commands", "config_options", mode="wrap") + @classmethod + def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return skip_invalid_items(v, handler, info) + + +class IdleState(IdleStateUpdate): + state: Literal["idle"] = "idle" + + +class SessionOptionsResponse(BaseModel): + config_options: Annotated[ + Optional[List[Union[SelectSessionConfigOption, BooleanSessionConfigOption, OtherSessionConfigOption]]], + Field(alias="configOptions"), + ] = None + """ + The config options the session would start with, with the same rules as on + `NewSessionResponse`. + + Optional. Omitted or empty means no config options are advertised. + Senders MUST use an array, not `null`. + """ + available_commands: Annotated[ + Optional[List[Union[SlashCommand, SkillCommand, OtherAvailableCommand]]], Field(alias="availableCommands") + ] = None + """ + Commands the Agent knows the session would have. + + Optional. Omitted or empty means no commands are advertised. + Senders MUST use an array, not `null`. + + Advisory. Agents MAY return a partial list. Clients MUST use the commands from the + `session/new` or `session/resume` response and later `available_commands_update` + notifications for the session itself. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -5362,21 +6141,27 @@ class ResumeSessionResponse(BaseModel): Field(alias="configOptions"), ] = None """ - Initial session configuration options. + Current session configuration options. + + Optional. Omitted or empty means no config options are advertised. + Senders MUST use an array, not `null`. + Later `config_option_update` notifications replace this list. """ - available_commands: Annotated[Optional[List[AvailableCommand]], Field(alias="availableCommands")] = None + available_commands: Annotated[ + Optional[List[Union[SlashCommand, SkillCommand, OtherAvailableCommand]]], Field(alias="availableCommands") + ] = None """ - Initial commands the agent can execute in this session. + Current commands the Agent can execute in this session. Optional. Omitted or empty means no initial commands are advertised. - Senders MUST use an array, not `null`; receivers treat `null` like omission. + Senders MUST use an array, not `null`. Later `available_commands_update` notifications replace this list. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -5397,9 +6182,9 @@ class SetSessionConfigOptionResponse(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -5410,10 +6195,6 @@ def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHand return skip_invalid_items(v, handler, info) -class NesEditSuggestionVariant(NesEditSuggestion): - kind: Literal["edit"] = "edit" - - class UserMessageChunk(ContentChunk): session_update: Annotated[Literal["user_message_chunk"], Field(alias="sessionUpdate")] = "user_message_chunk" @@ -5447,11 +6228,6 @@ class AvailableCommandsUpdate(AvailableCommandsUpdateBase): "available_commands_update" ) - @field_validator("available_commands", mode="wrap") - @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) - class SessionCompactionUpdate(CompactionUpdate): session_update: Annotated[Literal["compaction_update"], Field(alias="sessionUpdate")] = "compaction_update" @@ -5463,6 +6239,12 @@ class SessionCompactionSummaryChunk(CompactionSummaryChunk): ) +class SessionPromptSuggestionsUpdate(PromptSuggestionsUpdate): + session_update: Annotated[Literal["prompt_suggestions_update"], Field(alias="sessionUpdate")] = ( + "prompt_suggestions_update" + ) + + class SessionMessageUpdate(SessionMessage): session_update: Annotated[Literal["session_message"], Field(alias="sessionUpdate")] = "session_message" @@ -5476,15 +6258,22 @@ class ToolCallContentChunk(BaseModel): """ The ID of the tool call this content belongs to. """ - content: Union[ContentToolCallContent, DiffToolCallContent, TerminalToolCallContent, OtherToolCallContent] + content: Union[ + ContentToolCallContent, + DiffToolCallContent, + TerminalToolCallContent, + SessionToolCallContent, + OtherToolCallContent, + ] """ A single item of content produced by the tool call. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. This field is chunk-scoped. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + This metadata is scoped to the chunk and does not patch stored metadata. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -5500,90 +6289,202 @@ class ConfigOptionUpdateBase(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("config_options", mode="wrap") + @classmethod + def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return skip_invalid_items(v, handler, info) + -class InitializeRequest(BaseModel): - protocol_version: Annotated[int, Field(alias="protocolVersion", ge=0, le=65535)] +class SubagentUpdate(BaseModel): + session_id: Annotated[str, Field(alias="sessionId")] """ - The latest protocol version supported by the client. + The opaque session ID identifying the child in all ACP messages. """ - info: Implementation + title: Optional[str] = None """ - Information about the implementation sending this initialize request. + The parent's human-readable display title for this child, in plain text. It need not be unique. + + Optional and nullable. Omitted means unchanged. `null` clears it. If no + title is set, the Client chooses a fallback presentation. """ - capabilities: Annotated[Optional[ClientCapabilities], Field(validate_default=True)] = {} + description: Optional[str] = None """ - Capabilities supported by the client. + The parent's human-readable description of the child's role or purpose. + May contain Markdown. + + Optional and nullable. Omitted means unchanged. `null` clears it. This is + current display metadata, not the history of instructions sent to the child. """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + capabilities: Optional[SubagentSessionCapabilities] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + Client-initiated session mutations permitted for this subagent session. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + Read-only operations retain their normal protocol semantics and + capability requirements. + """ + state: Optional[Union[RunningState, IdleState, RequiresActionState, UnknownState, OtherState]] = None """ + The child's current foreground state, mirrored onto its parent association. - @field_validator("protocol_version", mode="before") - @classmethod - def coerce_protocol_version_validator(cls, v: Any, info: ValidationInfo) -> Any: - return coerce_protocol_version(v, info) + Optional and nullable. Omitted means unchanged. `null` removes the + current report and leaves activity unconfirmed (not idle or cancelled). + A concrete `StateUpdate` replaces the entire previous snapshot. + """ + cwd: Optional[str] = None + """ + The child's working directory. Must be an absolute path. - @field_validator("capabilities", mode="wrap") + Optional and nullable. Omitted means unchanged. `null` clears the + reported value. While unset, the child inherits its immediate parent's + effective working directory. + """ + additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = None + """ + Additional workspace roots for the child. Each path MUST be absolute. + + Optional and nullable. Omitted means unchanged. `null` clears the + reported value. While unset, the child inherits its immediate parent's + effective additional directories, independently of `cwd`. A concrete + array replaces the whole list. `[]` reports no additional directories. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) + """ + + @field_validator("capabilities", "description", "state", "title", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) -class SuggestNesRequest(BaseModel): - session_id: Annotated[str, Field(alias="sessionId")] +class ClientCapabilities(BaseModel): + auth: Optional[ClientAuthCapabilities] = None """ - The session ID for this request. + Authentication capabilities supported by the Client. + Determines which authentication method types the Agent can include + in its `InitializeResponse`. + + Optional. Omitted and `null` are equivalent and mean the Client does not advertise any + authentication-method extensions. """ - uri: AnyUrl + elicitation: Optional[ElicitationCapabilities] = None """ - The URI of the document to suggest for. + Elicitation capabilities supported by the Client. + Determines which elicitation modes the Agent can use. + + Optional. Omitted and `null` are equivalent and mean the Client does not advertise + elicitation support. """ - version: int + session: Optional[ClientSessionCapabilities] = None """ - The version number of the document. + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Session-related capabilities supported by the Client. + + Optional. Omitted and `null` are equivalent and mean the Client does not advertise any + session-related capabilities. This object only groups capabilities. Supplying `{}` + advertises nothing. """ - position: Position + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The current cursor position. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - selection: Optional[Range] = None + + @field_validator("auth", "elicitation", "session", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + + +class NewSessionRequest(InitialConfigRequestModel): + cwd: str """ - The current text selection range, if any. + The working directory for this session. Must be an absolute path. """ - trigger_kind: Annotated[ - Union[Literal["automatic"], Literal["diagnostic"], Literal["manual"], str], Field(alias="triggerKind") - ] + additional_directories: Annotated[Optional[List[str]], Field(alias="additionalDirectories")] = [] """ - What triggered this suggestion request. + Additional workspace roots for this session. Each path MUST be absolute. + + These expand the session's workspace scope without changing `cwd`, which + remains the base for relative paths. When omitted or empty, no + additional roots are activated for the new session. + """ + mcp_servers: Annotated[ + Optional[List[Union[HttpMcpServer, AcpMcpServer, StdioMcpServer, OtherMcpServer]]], + Field(alias="mcpServers", validate_default=True), + ] = [] + """ + List of MCP (Model Context Protocol) servers for the Agent to connect to. + """ + system_prompt: Annotated[Optional[SystemPrompt], Field(alias="systemPrompt")] = None """ - context: Optional[NesSuggestContext] = None + System-level instructions for the new session. + + Optional. Omitted and `null` are equivalent and mean the Agent uses its + own default instructions. Clients MUST only send this when the Agent + advertises `session.systemPrompt`. + """ + config_options: Annotated[ + Optional[List[Union[InitialIdConfigOption, InitialBooleanConfigOption, OtherInitialConfigOption]]], + Field(alias="configOptions", validate_default=True), + ] = [] """ - Context for the suggestion, included based on agent capabilities. + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Initial values for the session's config options. + + Optional. Omitted and `null` are equivalent to an empty list. Clients MUST only send + this when the Agent advertises `session.options`. + + The Agent applies the entries in list order, as if the Client had called + `session/set_config_option` for each entry after the session was set up. Malformed + entries and duplicate `configId` values fail the request with `-32602`. The Agent MUST + ignore an entry whose `configId` is unknown, whose `type` does not match the option, + or whose value is not allowed when it is applied. The `configOptions` in the response contain the values the session actually + has. The Agent SHOULD NOT send `config_option_update` notifications for these entries, + and SHOULD NOT send other `session/update` notifications caused by applying them + before it responds. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("additional_directories", "config_options", "mcp_servers", mode="before") + @classmethod + def empty_list_on_null_validator(cls, v: Any, info: ValidationInfo) -> Any: + return empty_list_on_null(v, info) + class ClientResponseMessage(BaseModel): - id: Optional[Union[int, str]] + id: Union[int, str] """ The id of the request this response answers. """ @@ -5609,47 +6510,26 @@ class ClientResponse(RootModel[Union[ClientResponseMessage, ClientErrorMessage]] """ -class ClientNotification(BaseModel): - method: str +class ToolCallUpdate(BaseModel): + tool_call_id: Annotated[str, Field(alias="toolCallId")] """ - The notification method name. + Unique identifier for this tool call within the session. """ - params: Optional[ - Union[ - CancelSessionNotification, - DidOpenDocumentNotification, - DidChangeDocumentNotification, - DidCloseDocumentNotification, - DidSaveDocumentNotification, - DidFocusDocumentNotification, - AcceptNesNotification, - RejectNesNotification, - MessageMcpNotification, - Any, - ] - ] = None - """ - Method-specific notification parameters. - """ - - -class ToolCallUpdate(BaseModel): - tool_call_id: Annotated[str, Field(alias="toolCallId")] - """ - Unique identifier for this tool call within the session. - """ - name: Optional[str] = None + name: Optional[str] = None """ Programmatic name of the tool being invoked. This field is optional and has patch semantics. Omission means no change, `null` clears the name, and a string replaces it. For a tool - call ID the client has not seen before, omission or `null` means that no + call ID the Client has not seen before, omission or `null` means that no tool name is available. """ title: Optional[str] = None """ - Human-readable title describing what the tool is doing. + Human-readable plain-text title describing what the tool is doing. + + Omission leaves the title unchanged, `null` unsets it, and a string replaces it. + A new tool call starts without a title. """ kind: Optional[ Union[ @@ -5668,12 +6548,16 @@ class ToolCallUpdate(BaseModel): ] = None """ The category of tool being invoked. - Helps clients choose appropriate icons and UI treatment. + Helps Clients choose appropriate icons and UI treatment. + + Omission leaves the kind unchanged, `null` resets it to `other`, and a value replaces it. + A new tool call starts as `other`. """ status: Optional[ Union[ Literal["pending"], Literal["in_progress"], + Literal["paused"], Literal["completed"], Literal["failed"], Literal["cancelled"], @@ -5682,9 +6566,21 @@ class ToolCallUpdate(BaseModel): ] = None """ Current execution status of the tool call. + + Omission leaves the status unchanged, `null` resets it to `pending`, and a value + replaces it. A new tool call starts as `pending`. Agents do not move a tool call + back to `pending` once it has another status. """ content: Optional[ - List[Union[ContentToolCallContent, DiffToolCallContent, TerminalToolCallContent, OtherToolCallContent]] + List[ + Union[ + ContentToolCallContent, + DiffToolCallContent, + TerminalToolCallContent, + SessionToolCallContent, + OtherToolCallContent, + ] + ] ] = None """ Content produced by the tool call. @@ -5692,7 +6588,7 @@ class ToolCallUpdate(BaseModel): locations: Optional[List[ToolCallLocation]] = None """ File locations affected by this tool call. - Enables "follow-along" features in clients. + Enables "follow-along" features in Clients. """ raw_input: Annotated[Optional[Any], Field(alias="rawInput")] = None """ @@ -5702,16 +6598,26 @@ class ToolCallUpdate(BaseModel): """ Raw output returned by the tool. """ + capabilities: Optional[ToolCallCapabilities] = None + """ + Client-initiated controls this tool call currently supports, such as cancellation. + + Omission leaves the capabilities unchanged, `null` clears them, and an object replaces + the whole previous value. A new tool call starts with none. + """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Omitted means no metadata update; `null` is an - explicit clear signal. Implementations MUST NOT make assumptions about values at these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted leaves the stored metadata unchanged. `null` + clears it. An object patches the stored metadata by top-level key: keys it omits are + unchanged, a key set to `null` is removed, and any other value replaces that key's + stored value without merging nested objects. Beyond this patch rule, implementations + MUST NOT assign meaning to keys they do not recognize. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) + See protocol docs: [Metadata Patches](https://agentclientprotocol.com/protocol/v2/draft/extensibility#metadata-patches) """ - @field_validator("kind", "name", "raw_input", "raw_output", "status", "title", mode="wrap") + @field_validator("capabilities", "kind", "name", "raw_input", "raw_output", "status", "title", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -5726,6 +6632,18 @@ class ToolCallPermissionSubject(BaseModel): tool_call: Annotated[ToolCallUpdate, Field(alias="toolCall")] """ Details about the tool call requiring permission. + + Clients apply this to their stored tool call exactly like a `tool_call_update` + notification, in the order it was received, before showing the prompt. A first-seen + `toolCallId` creates the tool call. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -5746,15 +6664,13 @@ class CreateFormRequestElicitationRequestBase(ElicitationRequestScope): class CreateFormSessionElicitationRequest(CreateFormSessionElicitationRequestBase, CreateFormElicitationRequestBase): message: str """ - A human-readable message describing what input is needed. + A plain-text message explaining to the user what the Agent needs and why. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -5764,40 +6680,60 @@ class CreateFormSessionElicitationRequest(CreateFormSessionElicitationRequestBas class CreateFormRequestElicitationRequest(CreateFormRequestElicitationRequestBase, CreateFormElicitationRequestBase): message: str """ - A human-readable message describing what input is needed. + A plain-text message explaining to the user what the Agent needs and why. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - - Optional. Omitted and `null` are equivalent and mean no metadata. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ mode: Literal["form"] = "form" -class NesCapabilities(BaseModel): - events: Optional[NesEventCapabilities] = None +class AgentCapabilities(BaseModel): + session: Optional[SessionCapabilities] = None """ - Events the agent wants to receive. + Session capabilities supported by the Agent. + + Optional. Omitted and `null` are equivalent and mean the Agent does not support the + `session/*` methods. Supplying `{}` means the Agent supports the + baseline session methods: `session/new`, `session/list`, + `session/resume`, `session/close`, `session/prompt`, `session/cancel`, + and `session/update`. """ - context: Optional[NesContextCapabilities] = None + auth: Optional[AgentAuthCapabilities] = None """ - Context the agent wants attached to each suggestion request. + Authentication-related extension capabilities supported by the Agent. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise any + authentication-related extensions. This field does not advertise support + for `auth/login` or `auth/logout`. Those methods are advertised by a + non-empty `authMethods` list in the `initialize` response. + """ + providers: Optional[ProvidersCapabilities] = None + """ + **UNSTABLE** + + This capability is not part of the spec yet, and may be removed or changed at any point. + + Provider configuration capabilities supported by the Agent. + + Optional. Omitted and `null` are equivalent and mean the Agent does not advertise support. + Supplying `{}` means the Agent supports provider configuration methods. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("context", "events", mode="wrap") + @field_validator("auth", "providers", "session", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) @@ -5816,20 +6752,26 @@ class NewSessionResponse(BaseModel): ] = None """ Initial session configuration options. + + Optional. Omitted or empty means no config options are advertised. + Senders MUST use an array, not `null`. + Later `config_option_update` notifications replace this list. """ - available_commands: Annotated[Optional[List[AvailableCommand]], Field(alias="availableCommands")] = None + available_commands: Annotated[ + Optional[List[Union[SlashCommand, SkillCommand, OtherAvailableCommand]]], Field(alias="availableCommands") + ] = None """ - Initial commands the agent can execute in this session. + Initial commands the Agent can execute in this session. Optional. Omitted or empty means no initial commands are advertised. - Senders MUST use an array, not `null`; receivers treat `null` like omission. + Senders MUST use an array, not `null`. Later `available_commands_update` notifications replace this list. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -5840,28 +6782,37 @@ def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHand return skip_invalid_items(v, handler, info) -class SuggestNesResponse(BaseModel): - suggestions: List[ - Union[ - NesEditSuggestionVariant, - NesJumpSuggestionVariant, - NesRenameSuggestionVariant, - NesSearchAndReplaceSuggestionVariant, - OtherNesSuggestion, - ] - ] +class SessionStatusResponse(BaseModel): + status: Union[Literal["open"], Literal["saved"], str] """ - The list of suggestions. + Whether the Agent has the session in memory. + + Required. Clients MUST treat a value they do not recognize as `saved`. + """ + state: Optional[Union[RunningState, IdleState, RequiresActionState, UnknownState, OtherState]] = None + """ + The session's current foreground state, as the same snapshot the Agent sends in + `state_update` notifications. + + Optional. Agents SHOULD include it when `status` is `open`. Omitted and `null` + mean the Agent is not reporting foreground state, and Clients + MUST NOT read that as `idle`. This is a snapshot, not a new transition. Clients + MUST NOT count an `idle` snapshot as a new completion. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("state", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + class ToolCallContentChunkUpdate(ToolCallContentChunk): session_update: Annotated[Literal["tool_call_content_chunk"], Field(alias="sessionUpdate")] = ( @@ -5876,117 +6827,99 @@ class SessionToolCallUpdate(ToolCallUpdate): class ConfigOptionUpdate(ConfigOptionUpdateBase): session_update: Annotated[Literal["config_option_update"], Field(alias="sessionUpdate")] = "config_option_update" - @field_validator("config_options", mode="wrap") - @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) +class SessionSubagentUpdate(SubagentUpdate): + session_update: Annotated[Literal["subagent_update"], Field(alias="sessionUpdate")] = "subagent_update" -class ClientRequest(BaseModel): - id: Optional[Union[int, str]] + +class InitializeRequest(BaseModel): + protocol_version: Annotated[int, Field(alias="protocolVersion", ge=0, le=65535)] """ - The request id used to correlate the matching response. + The latest protocol version supported by the Client. """ - method: str + info: Implementation """ - The method name to invoke. + Information about the implementation sending this initialize request. """ - params: Optional[ - Union[ - InitializeRequest, - LoginAuthRequest, - ListProvidersRequest, - SetProviderRequest, - DisableProviderRequest, - LogoutAuthRequest, - NewSessionRequest, - ListSessionsRequest, - DeleteSessionRequest, - ForkSessionRequest, - ResumeSessionRequest, - CloseSessionRequest, - PromptRequest, - StartNesRequest, - SuggestNesRequest, - CloseNesRequest, - SetSessionConfigOptionIdRequest, - SetSessionConfigOptionBooleanRequest, - SetSessionConfigOptionOtherRequest, - Any, - ] - ] = None + capabilities: Annotated[Optional[ClientCapabilities], Field(validate_default=True)] = {} """ - Method-specific request parameters. + Capabilities supported by the Client. + """ + field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None + """ + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. + + See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ + @field_validator("protocol_version", mode="before") + @classmethod + def coerce_protocol_version_validator(cls, v: Any, info: ValidationInfo) -> Any: + return coerce_protocol_version(v, info) + + @field_validator("capabilities", mode="wrap") + @classmethod + def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return use_default_on_error(v, handler, info) + + +class InitializeProxyRequest(InitializeRequest): + pass + class ToolCallPermissionSubjectVariant(ToolCallPermissionSubject): type: Literal["tool_call"] = "tool_call" -class AgentCapabilities(BaseModel): - session: Optional[SessionCapabilities] = None +class InitializeResponse(BaseModel): + protocol_version: Annotated[int, Field(alias="protocolVersion", ge=0, le=65535)] """ - Session capabilities supported by the agent. + 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. - Optional. Omitted or `null` both mean the agent does not support the - `session/*` method surface. Supplying `{}` means the agent supports the - baseline session methods: `session/new`, `session/prompt`, - `session/cancel`, and `session/update`. - """ - auth: Optional[AgentAuthCapabilities] = None + The Client MUST check that it supports this version and SHOULD disconnect + if it does not. """ - Authentication-related extension capabilities supported by the agent. - - Optional. Omitted or `null` both mean the agent does not advertise any - authentication-related extensions. This field does not advertise support - for `auth/login` or `auth/logout`; those methods are advertised by a - non-empty `authMethods` list in the `initialize` response. + info: Implementation """ - providers: Optional[ProvidersCapabilities] = None + Information about the implementation sending this initialize response. """ - **UNSTABLE** - - This capability is not part of the spec yet, and may be removed or changed at any point. - - Provider configuration capabilities supported by the agent. - - Optional. Omitted or `null` both mean the agent does not advertise support. - Supplying `{}` means the agent supports provider configuration methods. + capabilities: Annotated[Optional[AgentCapabilities], Field(validate_default=True)] = {} """ - nes: Optional[NesCapabilities] = None + Capabilities supported by the Agent. """ - **UNSTABLE** - - This capability is not part of the spec yet, and may be removed or changed at any point. - - NES (Next Edit Suggestions) capabilities supported by the agent. - - Optional. Omitted or `null` both mean the agent does not advertise support - for NES methods. - """ - position_encoding: Annotated[Optional[Literal["utf-16", "utf-32", "utf-8"]], Field(alias="positionEncoding")] = None + auth_methods: Annotated[ + Optional[List[Union[TerminalAuthMethod, AgentAuthMethod, OtherAuthMethod]]], Field(alias="authMethods") + ] = None """ - **UNSTABLE** + Authentication methods supported by the Agent. - This capability is not part of the spec yet, and may be removed or changed at any point. - - The position encoding selected by the agent from the client's supported encodings. + Optional. Omitted or empty means the Agent does not advertise the + `auth/login` and `auth/logout` methods. Supplying one or more methods means + the Agent MUST support both `auth/login` and `auth/logout`. """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ - @field_validator("auth", "nes", "position_encoding", "providers", "session", mode="wrap") + @field_validator("capabilities", mode="wrap") @classmethod def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: return use_default_on_error(v, handler, info) + @field_validator("auth_methods", mode="wrap") + @classmethod + def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: + return skip_invalid_items(v, handler, info) + class UpdateSessionNotification(BaseModel): session_id: Annotated[str, Field(alias="sessionId")] @@ -6013,6 +6946,9 @@ class UpdateSessionNotification(BaseModel): SessionNotice, SessionCompactionUpdate, SessionCompactionSummaryChunk, + SessionReplayComplete, + SessionPromptSuggestionsUpdate, + SessionCursorUpdate, SessionSubagentUpdate, SessionMessageUpdate, SessionMessageChunkUpdate, @@ -6028,14 +6964,76 @@ class UpdateSessionNotification(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ +class ClientRequest(MethodParamsModel): + id: Union[int, str] + """ + The request id used to correlate the matching response. + """ + method: str + """ + The method name to invoke. + """ + params: Optional[ + Union[ + InitializeRequest, + LoginAuthRequest, + ListProvidersRequest, + SetProviderRequest, + DisableProviderRequest, + LogoutAuthRequest, + AuthStatusRequest, + NewSessionRequest, + ListSessionsRequest, + DeleteSessionRequest, + ForkSessionRequest, + ArchiveSessionRequest, + UnarchiveSessionRequest, + SessionStatusRequest, + SessionOptionsRequest, + SetSessionTitleRequest, + ResumeSessionRequest, + CloseSessionRequest, + CancelToolCallRequest, + CancelTerminalRequest, + PromptRequest, + SetSessionConfigOptionIdRequest, + SetSessionConfigOptionBooleanRequest, + SetSessionConfigOptionOtherRequest, + Any, + ] + ] = None + """ + Method-specific request parameters. + """ + + +class ProxyRequest(MethodParamsModel): + id: Union[int, str] + """ + The request id used to correlate the matching response. + """ + method: str + """ + The method name to invoke. + """ + params: Optional[Union[InitializeProxyRequest, ProxySuccessorRequest]] = None + """ + Method-specific request parameters. + """ + + +class InitializeProxyResponse(InitializeResponse): + pass + + class RequestPermissionRequest(BaseModel): session_id: Annotated[str, Field(alias="sessionId")] """ @@ -6043,7 +7041,7 @@ class RequestPermissionRequest(BaseModel): """ title: str """ - Human-readable title for the permission prompt. + Human-readable title shown with the permission prompt, in plain text. This title is specific to the permission prompt and does not update any subject's displayed title. @@ -6051,9 +7049,10 @@ class RequestPermissionRequest(BaseModel): description: Optional[str] = None """ Optional human-readable explanation of why permission is needed. + May contain Markdown. This text is specific to the permission prompt and does not update any - subject's displayed content. Omitted or `null` both mean no separate + subject's displayed content. Omitted and `null` are equivalent and mean no separate permission description was provided. """ subject: Optional[ @@ -6062,7 +7061,7 @@ class RequestPermissionRequest(BaseModel): """ Optional structured context about the operation requiring permission. - Omitted or `null` both mean no structured subject was provided. + Omitted and `null` are equivalent and mean no structured subject was provided. """ options: Annotated[List[PermissionOption], Field(min_length=1)] """ @@ -6071,9 +7070,9 @@ class RequestPermissionRequest(BaseModel): """ field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. + The _meta property is reserved by ACP to allow Clients and Agents to attach additional + metadata to their interactions. Omitted and `null` are equivalent and mean no metadata. + Implementations MUST NOT assign meaning to keys they do not recognize. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) """ @@ -6084,65 +7083,81 @@ def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHa return use_default_on_error(v, handler, info) -class InitializeResponse(BaseModel): - protocol_version: Annotated[int, Field(alias="protocolVersion", ge=0, le=65535)] - """ - The protocol version the client specified if supported by the agent, - or the latest protocol version supported by the agent. - - The client should disconnect, if it doesn't support this version. - """ - info: Implementation - """ - Information about the implementation sending this initialize response. +class AgentResponseMessage(BaseModel): + id: Union[int, str] """ - capabilities: Annotated[Optional[AgentCapabilities], Field(validate_default=True)] = {} + The id of the request this response answers. """ - Capabilities supported by the agent. + result: Union[ + InitializeResponse, + LoginAuthResponse, + ListProvidersResponse, + SetProviderResponse, + DisableProviderResponse, + LogoutAuthResponse, + AuthStatusResponse, + NewSessionResponse, + ListSessionsResponse, + DeleteSessionResponse, + ForkSessionResponse, + ArchiveSessionResponse, + UnarchiveSessionResponse, + SessionStatusResponse, + SessionOptionsResponse, + SetSessionTitleResponse, + ResumeSessionResponse, + CloseSessionResponse, + CancelToolCallResponse, + CancelTerminalResponse, + SetSessionConfigOptionResponse, + PromptResponse, + Any, + ] """ - auth_methods: Annotated[ - Optional[List[Union[TerminalAuthMethod, AgentAuthMethod, OtherAuthMethod]]], Field(alias="authMethods") - ] = None + Method-specific response data. """ - Authentication methods supported by the agent. - Optional. Omitted or empty means the agent does not advertise the - authentication method surface. Supplying one or more valid methods means - the agent MUST support both `auth/login` and `auth/logout`. - """ - field_meta: Annotated[Optional[Dict[str, Any]], Field(alias="_meta")] = None - """ - The _meta property is reserved by ACP to allow clients and agents to attach additional - metadata to their interactions. Implementations MUST NOT make assumptions about values at - these keys. - See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) +class AgentResponse(RootModel[Union[AgentResponseMessage, AgentErrorMessage]]): + root: Union[AgentResponseMessage, AgentErrorMessage] + """ + A JSON-RPC response object. """ - - @field_validator("capabilities", mode="wrap") - @classmethod - def use_default_on_error_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return use_default_on_error(v, handler, info) - - @field_validator("auth_methods", mode="wrap") - @classmethod - def skip_invalid_items_validator(cls, v: Any, handler: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Any: - return skip_invalid_items(v, handler, info) -class AgentNotification(BaseModel): +class AgentNotification(MethodParamsModel): method: str """ The notification method name. """ - params: Optional[Union[UpdateSessionNotification, CompleteElicitationNotification, Any]] = None + params: Optional[ + Union[UpdateSessionNotification, CompleteElicitationNotification, AuthStatusUpdateNotification, Any] + ] = None """ Method-specific notification parameters. """ -class AgentRequest(BaseModel): - id: Optional[Union[int, str]] +class ProxyResponseMessage(BaseModel): + id: Union[int, str] + """ + The id of the request this response answers. + """ + result: Any + """ + Method-specific response data. + """ + + +class ProxyResponse(RootModel[Union[ProxyResponseMessage, ProxyErrorMessage]]): + root: Union[ProxyResponseMessage, ProxyErrorMessage] + """ + A JSON-RPC response object. + """ + + +class AgentRequest(MethodParamsModel): + id: Union[int, str] """ The request id used to correlate the matching response. """ @@ -6168,41 +7183,20 @@ class AgentRequest(BaseModel): """ -class AgentResponseMessage(BaseModel): - id: Optional[Union[int, str]] - """ - The id of the request this response answers. - """ - result: Union[ - InitializeResponse, - LoginAuthResponse, - ListProvidersResponse, - SetProviderResponse, - DisableProviderResponse, - LogoutAuthResponse, - NewSessionResponse, - ListSessionsResponse, - DeleteSessionResponse, - ForkSessionResponse, - ResumeSessionResponse, - CloseSessionResponse, - SetSessionConfigOptionResponse, - PromptResponse, - StartNesResponse, - SuggestNesResponse, - CloseNesResponse, - Any, - ] - """ - Method-specific response data. - """ - - -class AgentResponse(RootModel[Union[AgentResponseMessage, AgentErrorMessage]]): - root: Union[AgentResponseMessage, AgentErrorMessage] - """ - A JSON-RPC response object. - """ - - MessageMcpResponse = Annotated[Union[McpResultResponse, McpErrorResponse], Field(union_mode="left_to_right")] +IdempotencyKey = Annotated[str, Field(min_length=1, max_length=255)] +SetSessionConfigOptionRequest = ( + SetSessionConfigOptionIdRequest | SetSessionConfigOptionBooleanRequest | SetSessionConfigOptionOtherRequest +) +CreateElicitationRequest = ( + CreateOtherSessionElicitationRequest + | CreateOtherRequestElicitationRequest + | CreateFormSessionElicitationRequest + | CreateFormRequestElicitationRequest + | CreateUrlSessionElicitationRequest + | CreateUrlRequestElicitationRequest +) +CreateElicitationResponse = ( + AcceptElicitationResponse | DeclineElicitationResponse | CancelElicitationResponse | OtherElicitationResponse +) +ProxySuccessorResponse = Any diff --git a/tests/test_protocol_negotiation.py b/tests/test_protocol_negotiation.py index 06e763e2..0da3a88e 100644 --- a/tests/test_protocol_negotiation.py +++ b/tests/test_protocol_negotiation.py @@ -102,6 +102,7 @@ async def prompt( | v2.schema.AudioContentBlock | v2.schema.ResourceContentBlock | v2.schema.EmbeddedResourceContentBlock + | v2.schema.SkillContentBlock | v2.schema.OtherContentBlock ], **kwargs: Any, diff --git a/tests/test_stateless_mcp.py b/tests/test_stateless_mcp.py index 6cbf4ff8..37363f06 100644 --- a/tests/test_stateless_mcp.py +++ b/tests/test_stateless_mcp.py @@ -145,8 +145,9 @@ async def handle(**kwargs): return {"error": {"code": -32000, "message": "inner", "data": None, "vendor": 1}} client.outcome = handle + attribution = {"session_id": "session", "tool_call_id": "call"} response = await a.mcp_message( - server_id="s", request_id="logical", method="tools/call", params=inner, trace="outer" + server_id="s", request_id="logical", method="tools/call", params=inner, trace="outer", **attribution ) assert isinstance(response, schema.McpErrorResponse) assert response.error.code == -32000 @@ -156,15 +157,13 @@ async def handle(**kwargs): "data": None, "vendor": 1, } - # v1 1.35 adds the optional `sessionId` and `toolCallId` to the envelope; v2 does not have them yet. - added = {"session_id", "tool_call_id"} & set(schema.MessageMcpRequest.model_fields) assert client.calls == [ { "server_id": "s", "request_id": "logical", "method": "tools/call", "params": inner, - **dict.fromkeys(added), + **attribution, "trace": "outer", } ] diff --git a/tests/test_v2_routing.py b/tests/test_v2_routing.py index af04de61..09db9099 100644 --- a/tests/test_v2_routing.py +++ b/tests/test_v2_routing.py @@ -1,6 +1,5 @@ from __future__ import annotations -import inspect from typing import Any import pytest @@ -8,24 +7,7 @@ from acp.exceptions import RequestError from acp.experimental import v2 -from acp.experimental.v2._methods import protocol_specs from acp.experimental.v2._router import MethodRouter -from acp.experimental.v2.meta import AGENT_METHODS, CLIENT_METHODS - - -@pytest.mark.parametrize( - ("protocol", "connection", "methods"), - [(v2.Agent, v2.ClientSideConnection, AGENT_METHODS), (v2.Client, v2.AgentSideConnection, CLIENT_METHODS)], -) -def test_protocols_cover_wire_methods_and_match_connection_signatures(protocol, connection, methods) -> None: - requests, notifications = protocol_specs(protocol) - assert {spec.method for spec in (*requests, *notifications)} == set(methods.values()) - for spec in (*requests, *notifications): - assert inspect.signature(getattr(protocol, spec.handler)) == inspect.signature( - getattr(connection, spec.handler) - ) - assert ("mcp/message" in {spec.method for spec in requests}) == (protocol is v2.Client) - assert ("mcp/message" in {spec.method for spec in notifications}) == (protocol is v2.Agent) @pytest.mark.asyncio @@ -65,6 +47,9 @@ async def mcp_message(self, **kwargs: Any) -> Any: assert agent.calls == 0 with pytest.raises(ValidationError): await router("session/prompt", {"sessionId": "s", "prompt": []}, False) + assert agent.calls == 0 + with pytest.raises(ValidationError): + await router("session/prompt", {"sessionId": "s", "prompt": [{"type": "text", "text": "hi"}]}, False) assert agent.calls == 1 assert isinstance(await router("auth/logout", {}, False), v2.schema.LogoutAuthResponse) with pytest.raises(RequestError) as error: @@ -112,7 +97,7 @@ async def set_config_option(self, config_id, session_id, value, *, type, **kwarg @pytest.mark.asyncio -@pytest.mark.parametrize("scope", [{"sessionId": "s", "toolCallId": "tool"}, {"requestId": 7}, {"requestId": None}]) +@pytest.mark.parametrize("scope", [{"sessionId": "s", "toolCallId": "tool"}, {"requestId": 7}, {"requestId": "rpc-7"}]) @pytest.mark.parametrize("mode", ["form", "url", "vendor/custom"]) async def test_elicitation_retains_branch_specific_fields(scope, mode) -> None: captured = {} diff --git a/tests/test_v2_runtime.py b/tests/test_v2_runtime.py index 6f623367..935e153d 100644 --- a/tests/test_v2_runtime.py +++ b/tests/test_v2_runtime.py @@ -82,6 +82,7 @@ class SessionAgent(Agent): def __init__(self, *, echo_before_response: bool) -> None: super().__init__() self.echo_before_response = echo_before_response + self.idempotency_key: str | None = None def on_connect(self, connection: v2.AgentSideConnection) -> None: self.connection = connection @@ -101,11 +102,13 @@ async def prompt( | v2.schema.AudioContentBlock | v2.schema.ResourceContentBlock | v2.schema.EmbeddedResourceContentBlock + | v2.schema.SkillContentBlock | v2.schema.OtherContentBlock ], **kwargs: Any, ) -> v2.schema.PromptResponse: request = v2.schema.PromptRequest(session_id=session_id, prompt=prompt, **kwargs) + self.idempotency_key = request.idempotency_key await self.connection.session_update( session_id=request.session_id, update=v2.schema.RunningSessionStateUpdate() ) @@ -180,6 +183,34 @@ async def test_v2_runtime_initializes_and_routes_generated_models() -> None: await agent_connection.close() +@pytest.mark.asyncio +async def test_fork_session_preserves_positional_arguments_and_forwards_beta_fields() -> None: + class ForkAgent(Agent): + async def fork_session(self, **kwargs: Any) -> v2.schema.ForkSessionResponse: + request = v2.schema.ForkSessionRequest(**kwargs) + assert request.additional_directories == ["/extra"] + assert request.mcp_servers == [] + assert request.cursor_id == "cursor-1" + assert request.config_options == [v2.schema.InitialIdConfigOption(config_id="model", value="small")] + return v2.schema.ForkSessionResponse(session_id="forked") + + client_transport, agent_transport = memory_transport_pair() + async with ( + v2.AgentSideConnection(ForkAgent(), agent_transport), + v2.ClientSideConnection(Client(), client_transport) as connection, + ): + await connection.initialize(v2.PROTOCOL_VERSION, initialize_request().info) + response = await connection.fork_session( + "original", + "/workspace", + ["/extra"], + [], + config_options=[v2.schema.InitialIdConfigOption(config_id="model", value="small")], + cursor_id="cursor-1", + ) + assert response.session_id == "forked" + + @pytest.mark.asyncio async def test_v2_runtime_rejects_calls_before_initialize() -> None: client_transport, agent_transport = memory_transport_pair() @@ -270,8 +301,12 @@ async def test_session_updates_are_delivered_independently_from_prompt(echo_befo request = v2.schema.PromptRequest( session_id=session.session_id, prompt=[v2.schema.TextContentBlock(text="hello")], + idempotency_key="retry-key", + ) + response = await client_connection.prompt( + session_id=request.session_id, prompt=request.prompt, idempotency_key=request.idempotency_key ) - response = await client_connection.prompt(session_id=request.session_id, prompt=request.prompt) + assert agent.idempotency_key == request.idempotency_key if not echo_before_response: await agent.echo_prompt(request) # Completion is independent traffic, sent after prompt acceptance. @@ -506,7 +541,7 @@ async def create_elicitation(self, message, mode, **kwargs): url="https://example.com/", trace="url", ) - await agent_connection.create_elicitation("Input", "vendor/custom", request_id=None) + await agent_connection.create_elicitation("Input", "vendor/custom", request_id="rpc-7") assert elicitations[0]["session_id"] == "s" assert elicitations[0]["tool_call_id"] == "tool" assert elicitations[0]["trace"] == "form" @@ -514,7 +549,9 @@ async def create_elicitation(self, message, mode, **kwargs): assert elicitations[1]["request_id"] == 7 assert elicitations[1]["elicitation_id"] == "e" assert elicitations[1]["trace"] == "url" - assert elicitations[2]["request_id"] is None + assert elicitations[2]["request_id"] == "rpc-7" + with pytest.raises(ValueError, match="either session_id or request_id"): + await agent_connection.create_elicitation("Input", "vendor/custom") with pytest.raises(ValueError, match="either session_id or request_id"): await agent_connection.create_elicitation("Input", "vendor/custom", session_id="s", request_id=7) @@ -584,3 +621,92 @@ async def handle_extension_request(self, method: str, params: Any) -> Any: assert handled == [] finally: await agent_connection.close() + + +@pytest.mark.asyncio +async def test_beta4_session_auth_and_cancel_methods_round_trip() -> None: + received: list[tuple[str, dict[str, Any]]] = [] + auth_updates: asyncio.Queue[dict[str, Any]] = asyncio.Queue() + + class Beta4Agent(Agent): + async def auth_status(self, **kwargs: Any) -> v2.schema.AuthStatusResponse: + received.append(("auth_status", kwargs)) + return v2.schema.AuthStatusResponse(state="authenticated") + + async def archive_session(self, session_id: str, **kwargs: Any) -> None: + received.append(("archive_session", {"session_id": session_id, **kwargs})) + + async def unarchive_session(self, session_id: str, **kwargs: Any) -> None: + received.append(("unarchive_session", {"session_id": session_id, **kwargs})) + + async def session_status(self, session_id: str, **kwargs: Any) -> v2.schema.SessionStatusResponse: + received.append(("session_status", {"session_id": session_id, **kwargs})) + return v2.schema.SessionStatusResponse(status="open") + + async def session_options( + self, + cwd: str, + additional_directories: list[str] | None = None, + session_id: str | None = None, + **kwargs: Any, + ) -> v2.schema.SessionOptionsResponse: + received.append(( + "session_options", + {"cwd": cwd, "additional_directories": additional_directories, "session_id": session_id, **kwargs}, + )) + return v2.schema.SessionOptionsResponse(config_options=[]) + + async def set_session_title( + self, session_id: str, title: str, **kwargs: Any + ) -> v2.schema.SetSessionTitleResponse: + received.append(("set_session_title", {"session_id": session_id, "title": title, **kwargs})) + return v2.schema.SetSessionTitleResponse(title=title) + + async def cancel_tool_call(self, session_id: str, tool_call_id: str, **kwargs: Any) -> None: + received.append(("cancel_tool_call", {"session_id": session_id, "tool_call_id": tool_call_id, **kwargs})) + + async def cancel_terminal(self, session_id: str, terminal_id: str, **kwargs: Any) -> None: + received.append(("cancel_terminal", {"session_id": session_id, "terminal_id": terminal_id, **kwargs})) + + class Beta4Client(Client): + async def auth_status_update( + self, state: str, accounts: list[v2.schema.AuthAccount] | None = None, **kwargs: Any + ) -> None: + await auth_updates.put({"state": state, "accounts": accounts, **kwargs}) + + client_transport, agent_transport = memory_transport_pair() + async with ( + v2.AgentSideConnection(Beta4Agent(), agent_transport) as agent_connection, + v2.ClientSideConnection(Beta4Client(), client_transport) as client_connection, + ): + await client_connection.initialize(v2.PROTOCOL_VERSION, initialize_request().info) + + assert (await client_connection.auth_status(trace="a")).state == "authenticated" + assert isinstance(await client_connection.archive_session("s-1", trace="b"), v2.schema.ArchiveSessionResponse) + assert isinstance( + await client_connection.unarchive_session("s-1", trace="c"), v2.schema.UnarchiveSessionResponse + ) + assert (await client_connection.session_status("s-1", trace="d")).status == "open" + options = await client_connection.session_options("/work", additional_directories=["/extra"], session_id="s-1") + assert options.config_options == [] + assert (await client_connection.set_session_title("s-1", "Renamed")).title == "Renamed" + assert isinstance(await client_connection.cancel_tool_call("s-1", "call-1"), v2.schema.CancelToolCallResponse) + assert isinstance(await client_connection.cancel_terminal("s-1", "term-1"), v2.schema.CancelTerminalResponse) + + await agent_connection.auth_status_update(state="unauthenticated", trace="u") + assert await asyncio.wait_for(auth_updates.get(), timeout=1) == { + "state": "unauthenticated", + "accounts": None, + "trace": "u", + } + + assert [name for name, _ in received] == [ + "auth_status", + "archive_session", + "unarchive_session", + "session_status", + "session_options", + "set_session_title", + "cancel_tool_call", + "cancel_terminal", + ] diff --git a/tests/test_v2_schema.py b/tests/test_v2_schema.py index 496e273a..d6ce7b24 100644 --- a/tests/test_v2_schema.py +++ b/tests/test_v2_schema.py @@ -1,10 +1,13 @@ import pytest -from pydantic import ValidationError +from pydantic import TypeAdapter, ValidationError -from acp.experimental.v2 import PROTOCOL_VERSION +from acp.experimental.v2 import PROTOCOL_VERSION, schema +from acp.experimental.v2.interfaces import CreateElicitationRequest from acp.experimental.v2.meta import PROTOCOL_METHODS from acp.experimental.v2.schema import ( AgentMessageChunk, + IdleSessionStateUpdate, + MessageMcpRequest, OtherSessionUpdate, TextContentBlock, UpdateSessionNotification, @@ -48,3 +51,205 @@ def test_v2_open_union_rejects_malformed_known_updates() -> None: "content": {"type": "text", "text": "hello"}, }, }) + + +def test_idle_state_preserves_failure_details_and_background_snapshot() -> None: + wire = { + "sessionId": "session-1", + "update": { + "sessionUpdate": "state_update", + "state": "idle", + "stopReason": "error", + "error": {"code": -32603, "message": "failed"}, + "background": [], + }, + } + notification = UpdateSessionNotification.model_validate(wire) + assert isinstance(notification.update, IdleSessionStateUpdate) + assert notification.model_dump(by_alias=True, exclude_unset=True) == wire + with pytest.raises(ValidationError): + UpdateSessionNotification.model_validate({ + "sessionId": "session-1", + "update": { + "sessionUpdate": "state_update", + "state": "idle", + "stopReason": "end_turn", + "error": {"code": -32603, "message": "unexpected"}, + }, + }) + + +@pytest.mark.parametrize("mode", ["form", "url", "vendor/custom"]) +@pytest.mark.parametrize("request_id", [7, None]) +def test_elicitation_rejects_overlapping_scopes(mode: str, request_id: int | None) -> None: + with pytest.raises(ValidationError): + TypeAdapter(CreateElicitationRequest).validate_python({ + "mode": mode, + "message": "Input", + "sessionId": "session-1", + "requestId": request_id, + "requestedSchema": {"type": "object", "properties": {}}, + "elicitationId": "e", + "url": "https://example.com/", + }) + + +def test_mcp_tool_call_attribution_requires_a_session() -> None: + with pytest.raises(ValidationError, match="tool_call_id requires session_id"): + MessageMcpRequest.model_validate({ + "serverId": "s", + "requestId": "r", + "method": "tools/call", + "toolCallId": "call", + }) + + +def test_request_envelopes_select_params_by_method_and_preserve_extensions() -> None: + params = {"sessionId": "s", "cwd": "/work", "cursorId": "cursor"} + request = schema.ClientRequest.model_validate({"id": 1, "method": "session/fork", "params": params}) + assert isinstance(request.params, schema.ForkSessionRequest) + assert request.model_dump(by_alias=True, exclude_unset=True)["params"] == params + with pytest.raises(ValidationError): + schema.ClientRequest.model_validate({"id": 1, "method": "session/prompt", "params": params}) + with pytest.raises(ValidationError): + schema.ClientRequest.model_validate({"id": 1, "method": "session/prompt"}) + with pytest.raises(ValidationError): + schema.ClientRequest.model_validate({"id": 1, "method": "session/prompt", "params": None}) + with pytest.raises(ValidationError): + schema.ClientRequest.model_validate({"id": 1, "method": "session/cancel", "params": {"sessionId": "s"}}) + with pytest.raises(ValidationError): + schema.ClientRequest.model_validate({"id": 1, "method": "unknown/method", "params": {}}) + + logout = schema.ClientRequest.model_validate({"id": 2, "method": "auth/logout"}) + assert logout.params is None + + extension_params = {**params, "opaque": True} + extension = schema.ClientRequest.model_validate({"id": 1, "method": "_vendor/custom", "params": extension_params}) + assert extension.model_dump(by_alias=True, exclude_unset=True)["params"] == extension_params + + +def test_method_dispatch_distinguishes_request_and_notification_payloads() -> None: + params = {"serverId": "mcp", "requestId": "r", "method": "tools/list", "sessionId": "s"} + request = schema.AgentRequest.model_validate({"id": 1, "method": "mcp/message", "params": params}) + notification = schema.ClientNotification.model_validate({"method": "mcp/message", "params": params}) + assert isinstance(request.params, schema.MessageMcpRequest) + assert request.params.session_id == "s" + assert isinstance(notification.params, schema.MessageMcpNotification) + + proxy = schema.ProxyRequest.model_validate({ + "id": 1, + "method": "proxy/successor", + "params": {"method": "session/list", "params": {}}, + }) + assert isinstance(proxy.params, schema.ProxySuccessorRequest) + with pytest.raises(ValidationError): + schema.ProxyRequest.model_validate({"id": 1, "method": "proxy/initialize"}) + with pytest.raises(ValidationError): + schema.AgentNotification.model_validate({"method": "session/update", "params": None}) + + +def test_proxy_response_preserves_an_opaque_successor_result() -> None: + wire = { + "id": 1, + "result": { + "protocolVersion": 2, + "info": {"name": "agent", "version": "1"}, + "forwardedField": True, + }, + } + response = schema.ProxyResponse.model_validate(wire) + assert response.model_dump(by_alias=True, exclude_unset=True) == wire + + +def test_available_commands_skip_invalid_entries_and_preserve_extensions() -> None: + commands = [ + {"type": "command", "name": "plan", "description": "Make a plan"}, + {"type": "command", "name": "missing-description"}, + {"type": "_vendor/command", "name": "custom", "description": "Custom command", "opaque": 1}, + ] + update = UpdateSessionNotification.model_validate({ + "sessionId": "s", + "update": {"sessionUpdate": "available_commands_update", "availableCommands": commands}, + }) + assert update.model_dump(by_alias=True, exclude_unset=True)["update"]["availableCommands"] == [ + commands[0], + commands[2], + ] + + +def test_cursor_anchor_resolves_known_types_and_preserves_unknown_ones() -> None: + known = schema.CursorUpdate.model_validate({ + "cursorId": "c", + "anchor": {"type": "user_message", "messageId": "m", "position": "before"}, + }) + assert isinstance(known.anchor, schema.UserMessageCursorAnchor) + with pytest.raises(ValidationError): + schema.CursorUpdate.model_validate({"cursorId": "c", "anchor": {"type": "user_message"}}) + + custom = {"type": "_vendor/custom", "offset": 5} + unknown = schema.CursorUpdate.model_validate({"cursorId": "c", "anchor": custom}) + assert isinstance(unknown.anchor, schema.OtherCursorAnchor) + assert unknown.model_dump(by_alias=True, exclude_unset=True)["anchor"] == custom + + +def test_default_on_null_normalizes_only_annotated_lists() -> None: + omitted = schema.NewSessionRequest(cwd="/work") + explicit_null = schema.NewSessionRequest.model_validate({ + "cwd": "/work", + "mcpServers": None, + "additionalDirectories": None, + "configOptions": None, + }) + assert omitted == explicit_null + assert explicit_null.mcp_servers == explicit_null.additional_directories == explicit_null.config_options == [] + assert explicit_null.model_dump(by_alias=True, exclude_unset=True)["mcpServers"] == [] + with pytest.raises(ValidationError): + schema.NewSessionRequest.model_validate({"cwd": "/work", "mcpServers": {}}) + + +def test_config_options_reject_duplicate_ids_and_malformed_boolean_values() -> None: + option = {"type": "boolean", "configId": "thinking", "value": True} + with pytest.raises(ValidationError, match="duplicate configId"): + schema.NewSessionRequest.model_validate({"cwd": "/work", "configOptions": [option, option]}) + with pytest.raises(ValidationError): + schema.NewSessionRequest.model_validate({"cwd": "/work", "configOptions": [{**option, "value": "true"}]}) + + +def test_version_error_requires_typed_data_and_other_errors_preserve_opaque_data() -> None: + with pytest.raises(ValidationError): + schema.Error.model_validate({"code": -32022, "message": "Version unavailable"}) + data = {"requested": 1, "supported": [2]} + version_error = schema.Error.model_validate({"code": -32022, "message": "Version unavailable", "data": data}) + assert isinstance(version_error.data, schema.UnsupportedProtocolVersionErrorData) + assert version_error.model_dump(mode="json", by_alias=True, exclude_unset=True)["data"] == data + opaque = {**data, "vendor": True} + other_error = schema.Error.model_validate({"code": -32603, "message": "Failed", "data": opaque}) + assert other_error.data == opaque + + +def test_accepted_elicitation_content_preserves_custom_json_values() -> None: + content = {"name": "acp", "tags": ["a", "b"], "custom": {"nested": [1, None, True]}} + response = TypeAdapter(schema.CreateElicitationResponse).validate_python({"action": "accept", "content": content}) + assert isinstance(response, schema.AcceptElicitationResponse) + assert response.content == content + + +def test_select_config_options_use_plain_non_empty_lists() -> None: + option = schema.SessionConfigSelectOption(value="fast", name="Fast") + select = schema.SessionConfigSelect(current_value="fast", options=[option]) + assert select.options == [option] + assert len(select.options) == 1 + with pytest.raises(ValidationError): + schema.SessionConfigSelect(current_value="fast", options=[]) + + +def test_prompt_idempotency_key_accepts_bounded_strings() -> None: + request = schema.PromptRequest( + session_id="s", + prompt=[TextContentBlock(text="hi")], + idempotency_key="retry-key", + ) + assert request.idempotency_key == "retry-key" + for invalid in ("", "k" * 256): + with pytest.raises(ValidationError): + schema.PromptRequest(session_id="s", prompt=[TextContentBlock(text="hi")], idempotency_key=invalid)