From 4b966b7853948a40b84b07c8a1cd3456df34b4e1 Mon Sep 17 00:00:00 2001 From: Chojan Shang Date: Wed, 6 May 2026 15:44:58 +0000 Subject: [PATCH 1/2] feat: bump acp protocol to 0.12.2 Signed-off-by: Chojan Shang --- pyproject.toml | 2 +- schema/VERSION | 2 +- schema/meta.json | 16 + schema/schema.json | 6709 +++++++++++++++++++++++++--------- scripts/gen_schema.py | 18 + src/acp/client/connection.py | 71 +- src/acp/interfaces.py | 15 +- src/acp/meta.py | 18 +- src/acp/schema.py | 2877 ++++++++++++--- tests/test_rpc.py | 102 +- uv.lock | 2 +- 11 files changed, 7643 insertions(+), 2189 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 036b8fb..09a07d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "agent-client-protocol" -version = "0.9.0" +version = "0.12.2" description = "A Python implement of Agent Client Protocol (ACP, by Zed Industries)" authors = [ { name = "Chojan Shang", email = "psiace@apache.org" }, diff --git a/schema/VERSION b/schema/VERSION index 62d2bd0..f1d3366 100644 --- a/schema/VERSION +++ b/schema/VERSION @@ -1 +1 @@ -refs/tags/v0.11.2 +refs/tags/v0.12.2 diff --git a/schema/meta.json b/schema/meta.json index bfa8448..6d1dd24 100644 --- a/schema/meta.json +++ b/schema/meta.json @@ -1,7 +1,21 @@ { "agentMethods": { "authenticate": "authenticate", + "document_did_change": "document/didChange", + "document_did_close": "document/didClose", + "document_did_focus": "document/didFocus", + "document_did_open": "document/didOpen", + "document_did_save": "document/didSave", "initialize": "initialize", + "logout": "logout", + "nes_accept": "nes/accept", + "nes_close": "nes/close", + "nes_reject": "nes/reject", + "nes_start": "nes/start", + "nes_suggest": "nes/suggest", + "providers_disable": "providers/disable", + "providers_list": "providers/list", + "providers_set": "providers/set", "session_cancel": "session/cancel", "session_close": "session/close", "session_fork": "session/fork", @@ -15,6 +29,8 @@ "session_set_model": "session/set_model" }, "clientMethods": { + "elicitation_complete": "elicitation/complete", + "elicitation_create": "elicitation/create", "fs_read_text_file": "fs/read_text_file", "fs_write_text_file": "fs/write_text_file", "session_request_permission": "session/request_permission", diff --git a/schema/schema.json b/schema/schema.json index f679c1a..709a0d9 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1,5 +1,62 @@ { "$defs": { + "AcceptNesNotification": { + "description": "Notification sent when a suggestion is accepted.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "id": { + "description": "The ID of the accepted suggestion.", + "type": "string" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session ID for this notification." + } + }, + "required": [ + "sessionId", + "id" + ], + "type": "object", + "x-method": "nes/accept", + "x-side": "agent" + }, + "AgentAuthCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication-related capabilities supported by the agent.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "logout": { + "anyOf": [ + { + "$ref": "#/$defs/LogoutCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent supports the logout method.\n\nBy supplying `{}` it means that the agent supports the logout method." + } + }, + "type": "object" + }, "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/initialization#agent-capabilities)", "properties": { @@ -11,6 +68,15 @@ "null" ] }, + "auth": { + "allOf": [ + { + "$ref": "#/$defs/AgentAuthCapabilities" + } + ], + "default": {}, + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication-related capabilities supported by the agent." + }, "loadSession": { "default": false, "description": "Whether the agent supports `session/load`.", @@ -28,6 +94,28 @@ }, "description": "MCP capabilities supported by the agent." }, + "nes": { + "anyOf": [ + { + "$ref": "#/$defs/NesCapabilities" + }, + { + "type": "null" + } + ], + "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." + }, + "positionEncoding": { + "anyOf": [ + { + "$ref": "#/$defs/PositionEncodingKind" + }, + { + "type": "null" + } + ], + "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." + }, "promptCapabilities": { "allOf": [ { @@ -41,6 +129,17 @@ }, "description": "Prompt capabilities supported by the agent." }, + "providers": { + "anyOf": [ + { + "$ref": "#/$defs/ProvidersCapabilities" + }, + { + "type": "null" + } + ], + "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\nBy supplying `{}` it means that the agent supports provider configuration methods." + }, "sessionCapabilities": { "allOf": [ { @@ -70,6 +169,15 @@ "description": "Handles session update notifications from the agent.\n\nThis is a notification endpoint (no response expected) that receives\nreal-time updates about session progress, including 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 responding with the cancelled stop reason.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", "title": "SessionNotification" }, + { + "allOf": [ + { + "$ref": "#/$defs/CompleteElicitationNotification" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification that a URL-based elicitation has completed.", + "title": "CompleteElicitationNotification" + }, { "allOf": [ { @@ -178,6 +286,15 @@ "description": "Kills the terminal command without releasing the terminal\n\nWhile `terminal/release` will also kill the command, this method will keep\nthe `TerminalId` valid so it can be used with other methods.\n\nThis method can be helpful when implementing command timeouts which terminate\nthe command as soon as elapsed, and then get the final output so it can be sent\nto the model.\n\nNote: Call `terminal/release` when `TerminalId` is no longer needed.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", "title": "KillTerminalRequest" }, + { + "allOf": [ + { + "$ref": "#/$defs/CreateElicitationRequest" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequests structured user input via a form or URL.", + "title": "CreateElicitationRequest" + }, { "allOf": [ { @@ -228,6 +345,38 @@ ], "title": "AuthenticateResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/ListProvidersResponse" + } + ], + "title": "ListProvidersResponse" + }, + { + "allOf": [ + { + "$ref": "#/$defs/SetProvidersResponse" + } + ], + "title": "SetProvidersResponse" + }, + { + "allOf": [ + { + "$ref": "#/$defs/DisableProvidersResponse" + } + ], + "title": "DisableProvidersResponse" + }, + { + "allOf": [ + { + "$ref": "#/$defs/LogoutResponse" + } + ], + "title": "LogoutResponse" + }, { "allOf": [ { @@ -308,6 +457,30 @@ ], "title": "SetSessionModelResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/StartNesResponse" + } + ], + "title": "StartNesResponse" + }, + { + "allOf": [ + { + "$ref": "#/$defs/SuggestNesResponse" + } + ], + "title": "SuggestNesResponse" + }, + { + "allOf": [ + { + "$ref": "#/$defs/CloseNesResponse" + } + ], + "title": "CloseNesResponse" + }, { "allOf": [ { @@ -795,6 +968,33 @@ ], "type": "object" }, + "BooleanPropertySchema": { + "description": "Schema for boolean properties in an elicitation form.", + "properties": { + "default": { + "description": "Default value.", + "type": [ + "boolean", + "null" + ] + }, + "description": { + "description": "Human-readable description.", + "type": [ + "string", + "null" + ] + }, + "title": { + "description": "Optional title for the property.", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, "CancelNotification": { "description": "Notification to cancel ongoing operations for a session.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)", "properties": { @@ -871,6 +1071,17 @@ }, "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication capabilities supported by the client.\nDetermines which authentication method types the agent may include\nin its `InitializeResponse`." }, + "elicitation": { + "anyOf": [ + { + "$ref": "#/$defs/ElicitationCapabilities" + }, + { + "type": "null" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nElicitation capabilities supported by the client.\nDetermines which elicitation modes the agent may use." + }, "fs": { "allOf": [ { @@ -883,6 +1094,24 @@ }, "description": "File system capabilities supported by the client.\nDetermines which file operations the agent can request." }, + "nes": { + "anyOf": [ + { + "$ref": "#/$defs/ClientNesCapabilities" + }, + { + "type": "null" + } + ], + "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." + }, + "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.", + "items": { + "$ref": "#/$defs/PositionEncodingKind" + }, + "type": "array" + }, "terminal": { "default": false, "description": "Whether the Client support all `terminal/*` methods.", @@ -891,6 +1120,53 @@ }, "type": "object" }, + "ClientNesCapabilities": { + "description": "NES capabilities advertised by the client during initialization.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "jump": { + "anyOf": [ + { + "$ref": "#/$defs/NesJumpCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the client supports the `jump` suggestion kind." + }, + "rename": { + "anyOf": [ + { + "$ref": "#/$defs/NesRenameCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the client supports the `rename` suggestion kind." + }, + "searchAndReplace": { + "anyOf": [ + { + "$ref": "#/$defs/NesSearchAndReplaceCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the client supports the `searchAndReplace` suggestion kind." + } + }, + "type": "object" + }, "ClientNotification": { "properties": { "method": { @@ -909,6 +1185,69 @@ "description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel an ongoing prompt turn.\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- Respond to the original `session/prompt` request with `StopReason::Cancelled`\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)", "title": "CancelNotification" }, + { + "allOf": [ + { + "$ref": "#/$defs/DidOpenDocumentNotification" + } + ], + "description": "**UNSTABLE**\n\nNotification sent when a file is opened in the editor.", + "title": "DidOpenDocumentNotification" + }, + { + "allOf": [ + { + "$ref": "#/$defs/DidChangeDocumentNotification" + } + ], + "description": "**UNSTABLE**\n\nNotification sent when a file is edited.", + "title": "DidChangeDocumentNotification" + }, + { + "allOf": [ + { + "$ref": "#/$defs/DidCloseDocumentNotification" + } + ], + "description": "**UNSTABLE**\n\nNotification sent when a file is closed.", + "title": "DidCloseDocumentNotification" + }, + { + "allOf": [ + { + "$ref": "#/$defs/DidSaveDocumentNotification" + } + ], + "description": "**UNSTABLE**\n\nNotification sent when a file is saved.", + "title": "DidSaveDocumentNotification" + }, + { + "allOf": [ + { + "$ref": "#/$defs/DidFocusDocumentNotification" + } + ], + "description": "**UNSTABLE**\n\nNotification sent when a file becomes the active editor tab.", + "title": "DidFocusDocumentNotification" + }, + { + "allOf": [ + { + "$ref": "#/$defs/AcceptNesNotification" + } + ], + "description": "**UNSTABLE**\n\nNotification sent when a suggestion is accepted.", + "title": "AcceptNesNotification" + }, + { + "allOf": [ + { + "$ref": "#/$defs/RejectNesNotification" + } + ], + "description": "**UNSTABLE**\n\nNotification sent when a suggestion is rejected.", + "title": "RejectNesNotification" + }, { "allOf": [ { @@ -966,28 +1305,64 @@ { "allOf": [ { - "$ref": "#/$defs/NewSessionRequest" + "$ref": "#/$defs/ListProvidersRequest" } ], - "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/session-setup)", - "title": "NewSessionRequest" + "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.", + "title": "ListProvidersRequest" }, { "allOf": [ { - "$ref": "#/$defs/LoadSessionRequest" + "$ref": "#/$defs/SetProvidersRequest" } ], - "description": "Loads an existing session to resume a previous conversation.\n\nThis method is only available if the agent advertises the `loadSession` capability.\n\nThe agent should:\n- Restore the session context and conversation history\n- Connect to the specified MCP servers\n- Stream the entire conversation history back to the client via notifications\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)", - "title": "LoadSessionRequest" + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nReplaces the configuration for a provider.", + "title": "SetProvidersRequest" }, { "allOf": [ { - "$ref": "#/$defs/ListSessionsRequest" + "$ref": "#/$defs/DisableProvidersRequest" } ], - "description": "Lists existing sessions known to the agent.\n\nThis method is only available if the agent advertises the `sessionCapabilities.list` capability.\n\nThe agent should return metadata about sessions with optional filtering and pagination support.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nDisables a provider.", + "title": "DisableProvidersRequest" + }, + { + "allOf": [ + { + "$ref": "#/$defs/LogoutRequest" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLogs out of the current authenticated state.\n\nAfter a successful logout, all new sessions will require authentication.\nThere is no guarantee about the behavior of already running sessions.", + "title": "LogoutRequest" + }, + { + "allOf": [ + { + "$ref": "#/$defs/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/session-setup)", + "title": "NewSessionRequest" + }, + { + "allOf": [ + { + "$ref": "#/$defs/LoadSessionRequest" + } + ], + "description": "Loads an existing session to resume a previous conversation.\n\nThis method is only available if the agent advertises the `loadSession` capability.\n\nThe agent should:\n- Restore the session context and conversation history\n- Connect to the specified MCP servers\n- Stream the entire conversation history back to the client via notifications\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)", + "title": "LoadSessionRequest" + }, + { + "allOf": [ + { + "$ref": "#/$defs/ListSessionsRequest" + } + ], + "description": "Lists existing sessions known to the agent.\n\nThis method is only available if the agent advertises the `sessionCapabilities.list` capability.\n\nThe agent should return metadata about sessions with optional filtering and pagination support.", "title": "ListSessionsRequest" }, { @@ -1005,7 +1380,7 @@ "$ref": "#/$defs/ResumeSessionRequest" } ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResumes an existing session without returning previous messages.\n\nThis method is only available if the agent advertises the `session.resume` capability.\n\nThe agent should resume the session context, allowing the conversation to continue\nwithout replaying the message history (unlike `session/load`).", + "description": "Resumes an existing session without returning previous messages.\n\nThis method is only available if the agent advertises the `sessionCapabilities.resume` capability.\n\nThe agent should resume the session context, allowing the conversation to continue\nwithout replaying the message history (unlike `session/load`).", "title": "ResumeSessionRequest" }, { @@ -1014,7 +1389,7 @@ "$ref": "#/$defs/CloseSessionRequest" } ], - "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 session and frees up any resources associated with it.\n\nThis method is only available if the agent advertises the `session.close` capability.\n\nThe agent must cancel any ongoing work (as if `session/cancel` was called)\nand then free up any resources associated with the session.", + "description": "Closes an active session and frees up any resources associated with it.\n\nThis method is only available if the agent advertises the `sessionCapabilities.close` capability.\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": "CloseSessionRequest" }, { @@ -1053,6 +1428,33 @@ "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSelect a model for a given session.", "title": "SetSessionModelRequest" }, + { + "allOf": [ + { + "$ref": "#/$defs/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": "StartNesRequest" + }, + { + "allOf": [ + { + "$ref": "#/$defs/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": "SuggestNesRequest" + }, + { + "allOf": [ + { + "$ref": "#/$defs/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": "CloseNesRequest" + }, { "allOf": [ { @@ -1151,6 +1553,14 @@ ], "title": "KillTerminalResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/CreateElicitationResponse" + } + ], + "title": "CreateElicitationResponse" + }, { "allOf": [ { @@ -1189,8 +1599,51 @@ ], "x-docs-ignore": true }, + "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.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the NES session to close." + } + }, + "required": [ + "sessionId" + ], + "type": "object", + "x-method": "nes/close", + "x-side": "agent" + }, + "CloseNesResponse": { + "description": "Response from closing an NES session.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object", + "x-method": "nes/close", + "x-side": "agent" + }, "CloseSessionRequest": { - "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 closing an active session.\n\nIf supported, the agent **must** cancel any ongoing work related to the session\n(treat it as if `session/cancel` was called) and then free up any resources\nassociated with the session.\n\nOnly available if the Agent supports the `session.close` capability.", + "description": "Request parameters for closing an active session.\n\nIf supported, the agent **must** cancel any ongoing work related to the session\n(treat it as if `session/cancel` was called) and then free up any resources\nassociated with the session.\n\nOnly available if the Agent supports the `sessionCapabilities.close` capability.", "properties": { "_meta": { "additionalProperties": true, @@ -1217,7 +1670,7 @@ "x-side": "agent" }, "CloseSessionResponse": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from closing a session.", + "description": "Response from closing a session.", "properties": { "_meta": { "additionalProperties": true, @@ -1232,6 +1685,33 @@ "x-method": "session/close", "x-side": "agent" }, + "CompleteElicitationNotification": { + "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 a URL-based elicitation is complete.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "elicitationId": { + "allOf": [ + { + "$ref": "#/$defs/ElicitationId" + } + ], + "description": "The ID of the elicitation that completed." + } + }, + "required": [ + "elicitationId" + ], + "type": "object", + "x-method": "elicitation/complete", + "x-side": "client" + }, "ConfigOptionUpdate": { "description": "Session configuration options have been updated.", "properties": { @@ -1430,6 +1910,135 @@ ], "type": "object" }, + "CreateElicitationRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest 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.", + "discriminator": { + "propertyName": "mode" + }, + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/ElicitationFormMode" + } + ], + "description": "Form-based elicitation where the client renders a form from the provided schema.", + "properties": { + "mode": { + "const": "form", + "type": "string" + } + }, + "required": [ + "mode" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/ElicitationUrlMode" + } + ], + "description": "URL-based elicitation where the client directs the user to a URL.", + "properties": { + "mode": { + "const": "url", + "type": "string" + } + }, + "required": [ + "mode" + ], + "type": "object" + } + ], + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "message": { + "description": "A human-readable message describing what input is needed.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object", + "x-method": "elicitation/create", + "x-side": "client" + }, + "CreateElicitationResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from the client to an elicitation request.", + "discriminator": { + "propertyName": "action" + }, + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/ElicitationAcceptAction" + } + ], + "description": "The user accepted and provided content.", + "properties": { + "action": { + "const": "accept", + "type": "string" + } + }, + "required": [ + "action" + ], + "type": "object" + }, + { + "description": "The user declined the elicitation.", + "properties": { + "action": { + "const": "decline", + "type": "string" + } + }, + "required": [ + "action" + ], + "type": "object" + }, + { + "description": "The elicitation was cancelled.", + "properties": { + "action": { + "const": "cancel", + "type": "string" + } + }, + "required": [ + "action" + ], + "type": "object" + } + ], + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object", + "x-method": "elicitation/create", + "x-side": "client" + }, "CreateTerminalRequest": { "description": "Request to create a new terminal and execute a command.", "properties": { @@ -1540,8 +2149,8 @@ ], "type": "object" }, - "Diff": { - "description": "A diff representing file modifications.\n\nShows changes to files in a format suitable for display in the client UI.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)", + "DidChangeDocumentNotification": { + "description": "Notification sent when a file is edited.", "properties": { "_meta": { "additionalProperties": true, @@ -1551,30 +2160,43 @@ "null" ] }, - "newText": { - "description": "The new content after modification.", - "type": "string" + "contentChanges": { + "description": "The content changes.", + "items": { + "$ref": "#/$defs/TextDocumentContentChangeEvent" + }, + "type": "array" }, - "oldText": { - "description": "The original content (None for new files).", - "type": [ - "string", - "null" - ] + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session ID for this notification." }, - "path": { - "description": "The file path being modified.", + "uri": { + "description": "The URI of the changed document.", "type": "string" + }, + "version": { + "description": "The new version number of the document.", + "format": "int64", + "type": "integer" } }, "required": [ - "path", - "newText" + "sessionId", + "uri", + "version", + "contentChanges" ], - "type": "object" + "type": "object", + "x-method": "document/didChange", + "x-side": "agent" }, - "EmbeddedResource": { - "description": "The contents of a resource, embedded into a prompt or tool call result.", + "DidCloseDocumentNotification": { + "description": "Notification sent when a file is closed.", "properties": { "_meta": { "additionalProperties": true, @@ -1584,48 +2206,85 @@ "null" ] }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, + "sessionId": { + "allOf": [ { - "type": "null" + "$ref": "#/$defs/SessionId" } - ] + ], + "description": "The session ID for this notification." }, - "resource": { - "$ref": "#/$defs/EmbeddedResourceResource" + "uri": { + "description": "The URI of the closed document.", + "type": "string" } }, "required": [ - "resource" + "sessionId", + "uri" ], - "type": "object" + "type": "object", + "x-method": "document/didClose", + "x-side": "agent" }, - "EmbeddedResourceResource": { - "anyOf": [ - { + "DidFocusDocumentNotification": { + "description": "Notification sent when a file becomes the active editor tab.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "position": { "allOf": [ { - "$ref": "#/$defs/TextResourceContents" + "$ref": "#/$defs/Position" } ], - "title": "TextResourceContents" + "description": "The current cursor position." }, - { + "sessionId": { "allOf": [ { - "$ref": "#/$defs/BlobResourceContents" + "$ref": "#/$defs/SessionId" } ], - "title": "BlobResourceContents" + "description": "The session ID for this notification." + }, + "uri": { + "description": "The URI of the focused document.", + "type": "string" + }, + "version": { + "description": "The version number of the document.", + "format": "int64", + "type": "integer" + }, + "visibleRange": { + "allOf": [ + { + "$ref": "#/$defs/Range" + } + ], + "description": "The portion of the file currently visible in the editor viewport." } + }, + "required": [ + "sessionId", + "uri", + "version", + "position", + "visibleRange" ], - "description": "Resource content that can be embedded in a message." + "type": "object", + "x-method": "document/didFocus", + "x-side": "agent" }, - "EnvVariable": { - "description": "An environment variable to set when launching an MCP server.", + "DidOpenDocumentNotification": { + "description": "Notification sent when a file is opened in the editor.", "properties": { "_meta": { "additionalProperties": true, @@ -1635,124 +2294,77 @@ "null" ] }, - "name": { - "description": "The name of the environment variable.", + "languageId": { + "description": "The language identifier of the document (e.g., \"rust\", \"python\").", "type": "string" }, - "value": { - "description": "The value to set for the environment variable.", + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session ID for this notification." + }, + "text": { + "description": "The full text content of the document.", "type": "string" + }, + "uri": { + "description": "The URI of the opened document.", + "type": "string" + }, + "version": { + "description": "The version number of the document.", + "format": "int64", + "type": "integer" } }, "required": [ - "name", - "value" + "sessionId", + "uri", + "languageId", + "version", + "text" ], - "type": "object" + "type": "object", + "x-method": "document/didOpen", + "x-side": "agent" }, - "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)", + "DidSaveDocumentNotification": { + "description": "Notification sent when a file is saved.", "properties": { - "code": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "sessionId": { "allOf": [ { - "$ref": "#/$defs/ErrorCode" + "$ref": "#/$defs/SessionId" } ], - "description": "A number indicating the error type that occurred.\nThis must be an integer as defined in the JSON-RPC specification." - }, - "data": { - "description": "Optional primitive or structured value that contains additional information about the error.\nThis may include debugging information or context-specific details." + "description": "The session ID for this notification." }, - "message": { - "description": "A string providing a short description of the error.\nThe message should be limited to a concise single sentence.", + "uri": { + "description": "The URI of the saved document.", "type": "string" } }, "required": [ - "code", - "message" - ], - "type": "object" - }, - "ErrorCode": { - "anyOf": [ - { - "const": -32700, - "description": "**Parse error**: Invalid JSON was received by the server.\nAn error occurred on the server while parsing the JSON text.", - "format": "int32", - "title": "Parse error", - "type": "integer" - }, - { - "const": -32600, - "description": "**Invalid request**: The JSON sent is not a valid Request object.", - "format": "int32", - "title": "Invalid request", - "type": "integer" - }, - { - "const": -32601, - "description": "**Method not found**: The method does not exist or is not available.", - "format": "int32", - "title": "Method not found", - "type": "integer" - }, - { - "const": -32602, - "description": "**Invalid params**: Invalid method parameter(s).", - "format": "int32", - "title": "Invalid params", - "type": "integer" - }, - { - "const": -32603, - "description": "**Internal error**: Internal JSON-RPC error.\nReserved for implementation-defined server errors.", - "format": "int32", - "title": "Internal error", - "type": "integer" - }, - { - "const": -32800, - "description": "**Request cancelled**: **UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nExecution of the method was aborted either due to a cancellation request from the caller or\nbecause of resource constraints or shutdown.", - "format": "int32", - "title": "Request cancelled", - "type": "integer" - }, - { - "const": -32000, - "description": "**Authentication required**: Authentication is required before this operation can be performed.", - "format": "int32", - "title": "Authentication required", - "type": "integer" - }, - { - "const": -32002, - "description": "**Resource not found**: A given resource, such as a file, was not found.", - "format": "int32", - "title": "Resource not found", - "type": "integer" - }, - { - "description": "Other undefined error code.", - "format": "int32", - "title": "Other", - "type": "integer" - } + "sessionId", + "uri" ], - "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." - }, - "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/extensibility)" - }, - "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/extensibility)" - }, - "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/extensibility)" + "type": "object", + "x-method": "document/didSave", + "x-side": "agent" }, - "FileSystemCapabilities": { - "description": "File system capabilities that a client may support.\n\nSee protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)", + "Diff": { + "description": "A diff representing file modifications.\n\nShows changes to files in a format suitable for display in the client UI.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)", "properties": { "_meta": { "additionalProperties": true, @@ -1762,21 +2374,30 @@ "null" ] }, - "readTextFile": { - "default": false, - "description": "Whether the Client supports `fs/read_text_file` requests.", - "type": "boolean" + "newText": { + "description": "The new content after modification.", + "type": "string" }, - "writeTextFile": { - "default": false, - "description": "Whether the Client supports `fs/write_text_file` requests.", - "type": "boolean" + "oldText": { + "description": "The original content (None for new files).", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "The file path being modified.", + "type": "string" } }, + "required": [ + "path", + "newText" + ], "type": "object" }, - "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.", + "DisableProvidersRequest": { + "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`.", "properties": { "_meta": { "additionalProperties": true, @@ -1786,36 +2407,20 @@ "null" ] }, - "cwd": { - "description": "The working directory for this session.", + "id": { + "description": "Provider id to disable.", "type": "string" - }, - "mcpServers": { - "description": "List of MCP servers to connect to for this session.", - "items": { - "$ref": "#/$defs/McpServer" - }, - "type": "array" - }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "The ID of the session to fork." } }, "required": [ - "sessionId", - "cwd" + "id" ], "type": "object", - "x-method": "session/fork", + "x-method": "providers/disable", "x-side": "agent" }, - "ForkSessionResponse": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from forking an existing session.", + "DisableProvidersResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `providers/disable`.", "properties": { "_meta": { "additionalProperties": true, @@ -1824,83 +2429,30 @@ "object", "null" ] - }, - "configOptions": { - "description": "Initial session configuration options if supported by the Agent.", - "items": { - "$ref": "#/$defs/SessionConfigOption" + } + }, + "type": "object", + "x-method": "providers/disable", + "x-side": "agent" + }, + "ElicitationAcceptAction": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe user accepted the elicitation and provided content.", + "properties": { + "content": { + "additionalProperties": { + "$ref": "#/$defs/ElicitationContentValue" }, + "description": "The user-provided content, if any, as an object matching the requested schema.", "type": [ - "array", + "object", "null" ] - }, - "models": { - "anyOf": [ - { - "$ref": "#/$defs/SessionModelState" - }, - { - "type": "null" - } - ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" - }, - "modes": { - "anyOf": [ - { - "$ref": "#/$defs/SessionModeState" - }, - { - "type": "null" - } - ], - "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" - }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "Unique identifier for the newly created forked session." - } - }, - "required": [ - "sessionId" - ], - "type": "object", - "x-method": "session/fork", - "x-side": "agent" - }, - "HttpHeader": { - "description": "An HTTP header to set when making requests to the MCP server.", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] - }, - "name": { - "description": "The name of the HTTP header.", - "type": "string" - }, - "value": { - "description": "The value to set for the HTTP header.", - "type": "string" } }, - "required": [ - "name", - "value" - ], "type": "object" }, - "ImageContent": { - "description": "An image provided to or from an LLM.", + "ElicitationCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nElicitation capabilities supported by the client.", "properties": { "_meta": { "additionalProperties": true, @@ -1910,70 +2462,62 @@ "null" ] }, - "annotations": { + "form": { "anyOf": [ { - "$ref": "#/$defs/Annotations" + "$ref": "#/$defs/ElicitationFormCapabilities" }, { "type": "null" } - ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" + ], + "description": "Whether the client supports form-based elicitation." }, - "uri": { - "type": [ - "string", - "null" - ] + "url": { + "anyOf": [ + { + "$ref": "#/$defs/ElicitationUrlCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the client supports URL-based elicitation." } }, - "required": [ - "data", - "mimeType" - ], "type": "object" }, - "Implementation": { - "description": "Metadata about the implementation of the client or agent.\nDescribes the name and version of an MCP implementation, with an optional\ntitle for UI representation.", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] - }, - "name": { - "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn\u2019t present.", + "ElicitationContentValue": { + "anyOf": [ + { + "title": "String", "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.", - "type": [ - "string", - "null" - ] + { + "format": "int64", + "title": "Integer", + "type": "integer" }, - "version": { - "description": "Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. \"1.0.0\").", - "type": "string" + { + "format": "double", + "title": "Number", + "type": "number" + }, + { + "title": "Boolean", + "type": "boolean" + }, + { + "items": { + "type": "string" + }, + "title": "StringArray", + "type": "array" } - }, - "required": [ - "name", - "version" - ], - "type": "object" + ] }, - "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/initialization)", + "ElicitationFormCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nForm-based elicitation capabilities.", "properties": { "_meta": { "additionalProperties": true, @@ -1982,232 +2526,263 @@ "object", "null" ] - }, - "clientCapabilities": { + } + }, + "type": "object" + }, + "ElicitationFormMode": { + "anyOf": [ + { "allOf": [ { - "$ref": "#/$defs/ClientCapabilities" + "$ref": "#/$defs/ElicitationSessionScope" } ], - "default": { - "auth": { - "terminal": false - }, - "fs": { - "readTextFile": false, - "writeTextFile": false - }, - "terminal": false - }, - "description": "Capabilities supported by the client." + "description": "Tied to a session, optionally to a specific tool call within that session.", + "title": "Session" }, - "clientInfo": { - "anyOf": [ - { - "$ref": "#/$defs/Implementation" - }, + { + "allOf": [ { - "type": "null" + "$ref": "#/$defs/ElicitationRequestScope" } ], - "description": "Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required." - }, - "protocolVersion": { + "description": "Tied to a specific JSON-RPC request outside of a session\n(e.g., during auth/configuration phases before any session is started).", + "title": "Request" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nForm-based elicitation mode where the client renders a form from the provided schema.", + "properties": { + "requestedSchema": { "allOf": [ { - "$ref": "#/$defs/ProtocolVersion" + "$ref": "#/$defs/ElicitationSchema" } ], - "description": "The latest protocol version supported by the client." + "description": "A JSON Schema describing the form fields to present to the user." } }, "required": [ - "protocolVersion" + "requestedSchema" ], - "type": "object", - "x-method": "initialize", - "x-side": "agent" + "type": "object" }, - "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/initialization)", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] - }, - "agentCapabilities": { + "ElicitationId": { + "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 elicitation.", + "type": "string" + }, + "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.", + "discriminator": { + "propertyName": "type" + }, + "oneOf": [ + { "allOf": [ { - "$ref": "#/$defs/AgentCapabilities" + "$ref": "#/$defs/StringPropertySchema" } ], - "default": { - "loadSession": false, - "mcpCapabilities": { - "http": false, - "sse": false - }, - "promptCapabilities": { - "audio": false, - "embeddedContext": false, - "image": false - }, - "sessionCapabilities": {} + "description": "String property (or single-select enum when `enum`/`oneOf` is set).", + "properties": { + "type": { + "const": "string", + "type": "string" + } }, - "description": "Capabilities supported by the agent." + "required": [ + "type" + ], + "type": "object" }, - "agentInfo": { - "anyOf": [ - { - "$ref": "#/$defs/Implementation" - }, + { + "allOf": [ { - "type": "null" + "$ref": "#/$defs/NumberPropertySchema" } ], - "description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required." + "description": "Number (floating-point) property.", + "properties": { + "type": { + "const": "number", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" }, - "authMethods": { - "default": [], - "description": "Authentication methods supported by the agent.", - "items": { - "$ref": "#/$defs/AuthMethod" + { + "allOf": [ + { + "$ref": "#/$defs/IntegerPropertySchema" + } + ], + "description": "Integer property.", + "properties": { + "type": { + "const": "integer", + "type": "string" + } }, - "type": "array" + "required": [ + "type" + ], + "type": "object" }, - "protocolVersion": { + { "allOf": [ { - "$ref": "#/$defs/ProtocolVersion" + "$ref": "#/$defs/BooleanPropertySchema" } ], - "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." - } - }, - "required": [ - "protocolVersion" - ], - "type": "object", - "x-method": "initialize", - "x-side": "agent" - }, - "KillTerminalRequest": { - "description": "Request to kill a terminal without releasing it.", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] + "description": "Boolean property.", + "properties": { + "type": { + "const": "boolean", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" }, - "sessionId": { + { "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/MultiSelectPropertySchema" } ], - "description": "The session ID for this request." - }, - "terminalId": { - "description": "The ID of the terminal to kill.", - "type": "string" + "description": "Multi-select array property.", + "properties": { + "type": { + "const": "array", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" } - }, - "required": [ - "sessionId", - "terminalId" - ], - "type": "object", - "x-method": "terminal/kill", - "x-side": "client" + ] }, - "KillTerminalResponse": { - "description": "Response to `terminal/kill` method", + "ElicitationRequestScope": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest-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).", "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] + "requestId": { + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ], + "description": "The request this elicitation is tied to." } }, - "type": "object", - "x-method": "terminal/kill", - "x-side": "client" + "required": [ + "requestId" + ], + "type": "object" }, - "ListSessionsRequest": { - "description": "Request parameters for listing existing sessions.\n\nOnly available if the Agent supports the `sessionCapabilities.list` capability.", + "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.", "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", + "description": { + "description": "Optional description of what this schema represents.", "type": [ - "object", + "string", "null" ] }, - "cursor": { - "description": "Opaque cursor token from a previous response's nextCursor field for cursor-based pagination", + "properties": { + "additionalProperties": { + "$ref": "#/$defs/ElicitationPropertySchema" + }, + "default": {}, + "description": "Property definitions (must be primitive types).", + "type": "object" + }, + "required": { + "description": "List of required property names.", + "items": { + "type": "string" + }, "type": [ - "string", + "array", "null" ] }, - "cwd": { - "description": "Filter sessions by working directory. Must be an absolute path.", + "title": { + "description": "Optional title for the schema.", "type": [ "string", "null" ] + }, + "type": { + "allOf": [ + { + "$ref": "#/$defs/ElicitationSchemaType" + } + ], + "default": "object", + "description": "Type discriminator. Always `\"object\"`." } }, - "type": "object", - "x-method": "session/list", - "x-side": "agent" + "type": "object" }, - "ListSessionsResponse": { - "description": "Response from listing sessions.", + "ElicitationSchemaType": { + "description": "Type discriminator for elicitation schemas.", + "oneOf": [ + { + "const": "object", + "description": "Object schema type.", + "type": "string" + } + ] + }, + "ElicitationSessionScope": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSession-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.", "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] - }, - "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.", - "type": [ - "string", - "null" - ] + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session this elicitation is tied to." }, - "sessions": { - "description": "Array of session information objects", - "items": { - "$ref": "#/$defs/SessionInfo" - }, - "type": "array" + "toolCallId": { + "anyOf": [ + { + "$ref": "#/$defs/ToolCallId" + }, + { + "type": "null" + } + ], + "description": "Optional tool call within the session." } }, "required": [ - "sessions" + "sessionId" ], - "type": "object", - "x-method": "session/list", - "x-side": "agent" + "type": "object" }, - "LoadSessionRequest": { - "description": "Request parameters for loading an existing session.\n\nOnly available if the Agent supports the `loadSession` capability.\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)", + "ElicitationStringType": { + "description": "Items definition for untitled multi-select enum properties.", + "oneOf": [ + { + "const": "string", + "description": "String schema type.", + "type": "string" + } + ] + }, + "ElicitationUrlCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nURL-based elicitation capabilities.", "properties": { "_meta": { "additionalProperties": true, @@ -2216,38 +2791,55 @@ "object", "null" ] + } + }, + "type": "object" + }, + "ElicitationUrlMode": { + "anyOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/ElicitationSessionScope" + } + ], + "description": "Tied to a session, optionally to a specific tool call within that session.", + "title": "Session" }, - "cwd": { - "description": "The working directory for this session.", - "type": "string" - }, - "mcpServers": { - "description": "List of MCP servers to connect to for this session.", - "items": { - "$ref": "#/$defs/McpServer" - }, - "type": "array" - }, - "sessionId": { + { "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/ElicitationRequestScope" } ], - "description": "The ID of the session to load." + "description": "Tied to a specific JSON-RPC request outside of a session\n(e.g., during auth/configuration phases before any session is started).", + "title": "Request" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nURL-based elicitation mode where the client directs the user to a URL.", + "properties": { + "elicitationId": { + "allOf": [ + { + "$ref": "#/$defs/ElicitationId" + } + ], + "description": "The unique identifier for this elicitation." + }, + "url": { + "description": "The URL to direct the user to.", + "format": "uri", + "type": "string" } }, "required": [ - "mcpServers", - "cwd", - "sessionId" + "elicitationId", + "url" ], - "type": "object", - "x-method": "session/load", - "x-side": "agent" + "type": "object" }, - "LoadSessionResponse": { - "description": "Response from loading an existing session.", + "EmbeddedResource": { + "description": "The contents of a resource, embedded into a prompt or tool call result.", "properties": { "_meta": { "additionalProperties": true, @@ -2257,45 +2849,66 @@ "null" ] }, - "configOptions": { - "description": "Initial session configuration options if supported by the Agent.", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, - "type": [ - "array", - "null" - ] - }, - "models": { + "annotations": { "anyOf": [ { - "$ref": "#/$defs/SessionModelState" + "$ref": "#/$defs/Annotations" }, { "type": "null" } - ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" + ] }, - "modes": { - "anyOf": [ + "resource": { + "$ref": "#/$defs/EmbeddedResourceResource" + } + }, + "required": [ + "resource" + ], + "type": "object" + }, + "EmbeddedResourceResource": { + "anyOf": [ + { + "allOf": [ { - "$ref": "#/$defs/SessionModeState" - }, + "$ref": "#/$defs/TextResourceContents" + } + ], + "title": "TextResourceContents" + }, + { + "allOf": [ { - "type": "null" + "$ref": "#/$defs/BlobResourceContents" } ], - "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + "title": "BlobResourceContents" } - }, - "type": "object", - "x-method": "session/load", - "x-side": "agent" + ], + "description": "Resource content that can be embedded in a message." }, - "McpCapabilities": { - "description": "MCP capabilities supported by the agent", + "EnumOption": { + "description": "A titled enum option with a const value and human-readable title.", + "properties": { + "const": { + "description": "The constant value for this option.", + "type": "string" + }, + "title": { + "description": "Human-readable title for this option.", + "type": "string" + } + }, + "required": [ + "const", + "title" + ], + "type": "object" + }, + "EnvVariable": { + "description": "An environment variable to set when launching an MCP server.", "properties": { "_meta": { "additionalProperties": true, @@ -2305,71 +2918,131 @@ "null" ] }, - "http": { - "default": false, - "description": "Agent supports [`McpServer::Http`].", - "type": "boolean" + "name": { + "description": "The name of the environment variable.", + "type": "string" }, - "sse": { - "default": false, - "description": "Agent supports [`McpServer::Sse`].", - "type": "boolean" + "value": { + "description": "The value to set for the environment variable.", + "type": "string" } }, + "required": [ + "name", + "value" + ], "type": "object" }, - "McpServer": { - "anyOf": [ - { + "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)", + "properties": { + "code": { "allOf": [ { - "$ref": "#/$defs/McpServerHttp" - } - ], - "description": "HTTP transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.http` is `true`.", - "properties": { - "type": { - "const": "http", - "type": "string" + "$ref": "#/$defs/ErrorCode" } - }, - "required": [ - "type" ], - "type": "object" + "description": "A number indicating the error type that occurred.\nThis must be an integer as defined in the JSON-RPC specification." + }, + "data": { + "description": "Optional primitive or structured value that contains additional information about the error.\nThis may include debugging information or context-specific details." + }, + "message": { + "description": "A string providing a short description of the error.\nThe message should be limited to a concise single sentence.", + "type": "string" + } + }, + "required": [ + "code", + "message" + ], + "type": "object" + }, + "ErrorCode": { + "anyOf": [ + { + "const": -32700, + "description": "**Parse error**: Invalid JSON was received by the server.\nAn error occurred on the server while parsing the JSON text.", + "format": "int32", + "title": "Parse error", + "type": "integer" }, { - "allOf": [ - { - "$ref": "#/$defs/McpServerSse" - } - ], - "description": "SSE transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.sse` is `true`.", - "properties": { - "type": { - "const": "sse", - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" + "const": -32600, + "description": "**Invalid request**: The JSON sent is not a valid Request object.", + "format": "int32", + "title": "Invalid request", + "type": "integer" }, { - "allOf": [ - { - "$ref": "#/$defs/McpServerStdio" - } - ], - "description": "Stdio transport configuration\n\nAll Agents MUST support this transport.", - "title": "stdio" + "const": -32601, + "description": "**Method not found**: The method does not exist or is not available.", + "format": "int32", + "title": "Method not found", + "type": "integer" + }, + { + "const": -32602, + "description": "**Invalid params**: Invalid method parameter(s).", + "format": "int32", + "title": "Invalid params", + "type": "integer" + }, + { + "const": -32603, + "description": "**Internal error**: Internal JSON-RPC error.\nReserved for implementation-defined server errors.", + "format": "int32", + "title": "Internal error", + "type": "integer" + }, + { + "const": -32800, + "description": "**Request cancelled**: **UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nExecution of the method was aborted either due to a cancellation request from the caller or\nbecause of resource constraints or shutdown.", + "format": "int32", + "title": "Request cancelled", + "type": "integer" + }, + { + "const": -32000, + "description": "**Authentication required**: Authentication is required before this operation can be performed.", + "format": "int32", + "title": "Authentication required", + "type": "integer" + }, + { + "const": -32002, + "description": "**Resource not found**: A given resource, such as a file, was not found.", + "format": "int32", + "title": "Resource not found", + "type": "integer" + }, + { + "const": -32042, + "description": "**URL elicitation required**: **UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe agent requires user input via a URL-based elicitation before it can proceed.", + "format": "int32", + "title": "URL elicitation required", + "type": "integer" + }, + { + "description": "Other undefined error code.", + "format": "int32", + "title": "Other", + "type": "integer" } ], - "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/session-setup#mcp-servers)" + "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." }, - "McpServerHttp": { - "description": "HTTP transport configuration for MCP.", + "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/extensibility)" + }, + "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/extensibility)" + }, + "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/extensibility)" + }, + "FileSystemCapabilities": { + "description": "File system capabilities that a client may support.\n\nSee protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)", "properties": { "_meta": { "additionalProperties": true, @@ -2379,31 +3052,21 @@ "null" ] }, - "headers": { - "description": "HTTP headers to set when making requests to the MCP server.", - "items": { - "$ref": "#/$defs/HttpHeader" - }, - "type": "array" - }, - "name": { - "description": "Human-readable name identifying this MCP server.", - "type": "string" + "readTextFile": { + "default": false, + "description": "Whether the Client supports `fs/read_text_file` requests.", + "type": "boolean" }, - "url": { - "description": "URL to the MCP server.", - "type": "string" + "writeTextFile": { + "default": false, + "description": "Whether the Client supports `fs/write_text_file` requests.", + "type": "boolean" } }, - "required": [ - "name", - "url", - "headers" - ], "type": "object" }, - "McpServerSse": { - "description": "SSE transport configuration for MCP.", + "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.", "properties": { "_meta": { "additionalProperties": true, @@ -2413,31 +3076,43 @@ "null" ] }, - "headers": { - "description": "HTTP headers to set when making requests to the MCP server.", + "additionalDirectories": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional 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.", "items": { - "$ref": "#/$defs/HttpHeader" + "type": "string" }, "type": "array" }, - "name": { - "description": "Human-readable name identifying this MCP server.", + "cwd": { + "description": "The working directory for this session.", "type": "string" }, - "url": { - "description": "URL to the MCP server.", - "type": "string" + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "items": { + "$ref": "#/$defs/McpServer" + }, + "type": "array" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to fork." } }, "required": [ - "name", - "url", - "headers" + "sessionId", + "cwd" ], - "type": "object" + "type": "object", + "x-method": "session/fork", + "x-side": "agent" }, - "McpServerStdio": { - "description": "Stdio transport configuration for MCP.", + "ForkSessionResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from forking an existing session.", "properties": { "_meta": { "additionalProperties": true, @@ -2447,43 +3122,56 @@ "null" ] }, - "args": { - "description": "Command-line arguments to pass to the MCP server.", + "configOptions": { + "description": "Initial session configuration options if supported by the Agent.", "items": { - "type": "string" + "$ref": "#/$defs/SessionConfigOption" }, - "type": "array" + "type": [ + "array", + "null" + ] }, - "command": { - "description": "Path to the MCP server executable.", - "type": "string" + "models": { + "anyOf": [ + { + "$ref": "#/$defs/SessionModelState" + }, + { + "type": "null" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" }, - "env": { - "description": "Environment variables to set when launching the MCP server.", - "items": { - "$ref": "#/$defs/EnvVariable" - }, - "type": "array" + "modes": { + "anyOf": [ + { + "$ref": "#/$defs/SessionModeState" + }, + { + "type": "null" + } + ], + "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" }, - "name": { - "description": "Human-readable name identifying this MCP server.", - "type": "string" + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "Unique identifier for the newly created forked session." } }, "required": [ - "name", - "command", - "args", - "env" + "sessionId" ], - "type": "object" - }, - "ModelId": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA unique identifier for a model.", - "type": "string" + "type": "object", + "x-method": "session/fork", + "x-side": "agent" }, - "ModelInfo": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInformation about a selectable model.", + "HttpHeader": { + "description": "An HTTP header to set when making requests to the MCP server.", "properties": { "_meta": { "additionalProperties": true, @@ -2493,34 +3181,63 @@ "null" ] }, - "description": { - "description": "Optional description of the model.", + "name": { + "description": "The name of the HTTP header.", + "type": "string" + }, + "value": { + "description": "The value to set for the HTTP header.", + "type": "string" + } + }, + "required": [ + "name", + "value" + ], + "type": "object" + }, + "ImageContent": { + "description": "An image provided to or from an LLM.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", "type": [ - "string", + "object", "null" ] }, - "modelId": { - "allOf": [ + "annotations": { + "anyOf": [ { - "$ref": "#/$defs/ModelId" + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" } - ], - "description": "Unique identifier for the model." + ] }, - "name": { - "description": "Human-readable name of the model.", + "data": { + "type": "string" + }, + "mimeType": { "type": "string" + }, + "uri": { + "type": [ + "string", + "null" + ] } }, "required": [ - "modelId", - "name" + "data", + "mimeType" ], "type": "object" }, - "NewSessionRequest": { - "description": "Request parameters for creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)", + "Implementation": { + "description": "Metadata about the implementation of the client or agent.\nDescribes the name and version of an MCP implementation, with an optional\ntitle for UI representation.", "properties": { "_meta": { "additionalProperties": true, @@ -2530,28 +3247,30 @@ "null" ] }, - "cwd": { - "description": "The working directory for this session. Must be an absolute path.", + "name": { + "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn\u2019t present.", "type": "string" }, - "mcpServers": { - "description": "List of MCP (Model Context Protocol) servers the agent should connect to.", - "items": { - "$ref": "#/$defs/McpServer" - }, - "type": "array" + "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.", + "type": [ + "string", + "null" + ] + }, + "version": { + "description": "Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. \"1.0.0\").", + "type": "string" } }, "required": [ - "cwd", - "mcpServers" + "name", + "version" ], - "type": "object", - "x-method": "session/new", - "x-side": "agent" + "type": "object" }, - "NewSessionResponse": { - "description": "Response from creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)", + "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/initialization)", "properties": { "_meta": { "additionalProperties": true, @@ -2561,56 +3280,53 @@ "null" ] }, - "configOptions": { - "description": "Initial session configuration options if supported by the Agent.", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, - "type": [ - "array", - "null" - ] - }, - "models": { - "anyOf": [ - { - "$ref": "#/$defs/SessionModelState" - }, + "clientCapabilities": { + "allOf": [ { - "type": "null" + "$ref": "#/$defs/ClientCapabilities" } ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" + "default": { + "auth": { + "terminal": false + }, + "fs": { + "readTextFile": false, + "writeTextFile": false + }, + "terminal": false + }, + "description": "Capabilities supported by the client." }, - "modes": { + "clientInfo": { "anyOf": [ { - "$ref": "#/$defs/SessionModeState" + "$ref": "#/$defs/Implementation" }, { "type": "null" } ], - "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + "description": "Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required." }, - "sessionId": { + "protocolVersion": { "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/ProtocolVersion" } ], - "description": "Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation." + "description": "The latest protocol version supported by the client." } }, "required": [ - "sessionId" + "protocolVersion" ], "type": "object", - "x-method": "session/new", + "x-method": "initialize", "x-side": "agent" }, - "PermissionOption": { - "description": "An option presented to the user when requesting permission.", + "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/initialization)", "properties": { "_meta": { "additionalProperties": true, @@ -2620,89 +3336,109 @@ "null" ] }, - "kind": { + "agentCapabilities": { "allOf": [ { - "$ref": "#/$defs/PermissionOptionKind" + "$ref": "#/$defs/AgentCapabilities" } ], - "description": "Hint about the nature of this permission option." + "default": { + "auth": {}, + "loadSession": false, + "mcpCapabilities": { + "http": false, + "sse": false + }, + "promptCapabilities": { + "audio": false, + "embeddedContext": false, + "image": false + }, + "sessionCapabilities": {} + }, + "description": "Capabilities supported by the agent." }, - "name": { - "description": "Human-readable label to display to the user.", - "type": "string" + "agentInfo": { + "anyOf": [ + { + "$ref": "#/$defs/Implementation" + }, + { + "type": "null" + } + ], + "description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required." }, - "optionId": { + "authMethods": { + "default": [], + "description": "Authentication methods supported by the agent.", + "items": { + "$ref": "#/$defs/AuthMethod" + }, + "type": "array" + }, + "protocolVersion": { "allOf": [ { - "$ref": "#/$defs/PermissionOptionId" + "$ref": "#/$defs/ProtocolVersion" } ], - "description": "Unique identifier for this permission option." + "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." } }, "required": [ - "optionId", - "name", - "kind" + "protocolVersion" ], - "type": "object" - }, - "PermissionOptionId": { - "description": "Unique identifier for a permission option.", - "type": "string" + "type": "object", + "x-method": "initialize", + "x-side": "agent" }, - "PermissionOptionKind": { - "description": "The type of permission option being presented to the user.\n\nHelps clients choose appropriate icons and UI treatment.", - "oneOf": [ - { - "const": "allow_once", - "description": "Allow this operation only this time.", - "type": "string" + "IntegerPropertySchema": { + "description": "Schema for integer properties in an elicitation form.", + "properties": { + "default": { + "description": "Default value.", + "format": "int64", + "type": [ + "integer", + "null" + ] }, - { - "const": "allow_always", - "description": "Allow this operation and remember the choice.", - "type": "string" + "description": { + "description": "Human-readable description.", + "type": [ + "string", + "null" + ] }, - { - "const": "reject_once", - "description": "Reject this operation only this time.", - "type": "string" + "maximum": { + "description": "Maximum value (inclusive).", + "format": "int64", + "type": [ + "integer", + "null" + ] }, - { - "const": "reject_always", - "description": "Reject this operation and remember the choice.", - "type": "string" - } - ] - }, - "Plan": { - "description": "An execution plan for accomplishing complex tasks.\n\nPlans consist of multiple entries representing individual tasks or goals.\nAgents report plans to clients to provide visibility into their execution strategy.\nPlans can evolve during execution as the agent discovers new requirements or completes tasks.\n\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", + "minimum": { + "description": "Minimum value (inclusive).", + "format": "int64", "type": [ - "object", + "integer", "null" ] }, - "entries": { - "description": "The list of tasks to be accomplished.\n\nWhen updating a plan, the agent must send a complete list of all entries\nwith their current status. The client replaces the entire plan with each update.", - "items": { - "$ref": "#/$defs/PlanEntry" - }, - "type": "array" + "title": { + "description": "Optional title for the property.", + "type": [ + "string", + "null" + ] } }, - "required": [ - "entries" - ], "type": "object" }, - "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/agent-plan#plan-entries)", + "KillTerminalRequest": { + "description": "Request to kill a terminal without releasing it.", "properties": { "_meta": { "additionalProperties": true, @@ -2712,76 +3448,29 @@ "null" ] }, - "content": { - "description": "Human-readable description of what this task aims to accomplish.", - "type": "string" - }, - "priority": { + "sessionId": { "allOf": [ { - "$ref": "#/$defs/PlanEntryPriority" + "$ref": "#/$defs/SessionId" } ], - "description": "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal." + "description": "The session ID for this request." }, - "status": { - "allOf": [ - { - "$ref": "#/$defs/PlanEntryStatus" - } - ], - "description": "Current execution status of this task." + "terminalId": { + "description": "The ID of the terminal to kill.", + "type": "string" } }, "required": [ - "content", - "priority", - "status" + "sessionId", + "terminalId" ], - "type": "object" - }, - "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/agent-plan#plan-entries)", - "oneOf": [ - { - "const": "high", - "description": "High priority task - critical to the overall goal.", - "type": "string" - }, - { - "const": "medium", - "description": "Medium priority task - important but not critical.", - "type": "string" - }, - { - "const": "low", - "description": "Low priority task - nice to have but not essential.", - "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/agent-plan#plan-entries)", - "oneOf": [ - { - "const": "pending", - "description": "The task has not started yet.", - "type": "string" - }, - { - "const": "in_progress", - "description": "The task is currently being worked on.", - "type": "string" - }, - { - "const": "completed", - "description": "The task has been successfully completed.", - "type": "string" - } - ] + "type": "object", + "x-method": "terminal/kill", + "x-side": "client" }, - "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/initialization#prompt-capabilities)", + "KillTerminalResponse": { + "description": "Response to `terminal/kill` method", "properties": { "_meta": { "additionalProperties": true, @@ -2790,27 +3479,14 @@ "object", "null" ] - }, - "audio": { - "default": false, - "description": "Agent supports [`ContentBlock::Audio`].", - "type": "boolean" - }, - "embeddedContext": { - "default": false, - "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.", - "type": "boolean" - }, - "image": { - "default": false, - "description": "Agent supports [`ContentBlock::Image`].", - "type": "boolean" } }, - "type": "object" + "type": "object", + "x-method": "terminal/kill", + "x-side": "client" }, - "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/prompt-turn#1-user-message)", + "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`.", "properties": { "_meta": { "additionalProperties": true, @@ -2819,40 +3495,40 @@ "object", "null" ] - }, - "messageId": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA client-generated unique identifier for this user message.\n\nIf provided, the Agent SHOULD echo this value as `userMessageId` in the\n[`PromptResponse`] to confirm it was recorded.\nBoth clients and agents MUST use UUID format for message IDs.", + } + }, + "type": "object", + "x-method": "providers/list", + "x-side": "agent" + }, + "ListProvidersResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `providers/list`.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", "type": [ - "string", + "object", "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.", + "providers": { + "description": "Configurable providers with current routing info suitable for UI display.", "items": { - "$ref": "#/$defs/ContentBlock" + "$ref": "#/$defs/ProviderInfo" }, "type": "array" - }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "The ID of the session to send this user message to" } }, "required": [ - "sessionId", - "prompt" + "providers" ], "type": "object", - "x-method": "session/prompt", + "x-method": "providers/list", "x-side": "agent" }, - "PromptResponse": { - "description": "Response from processing a user prompt.\n\nSee protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)", + "ListSessionsRequest": { + "description": "Request parameters for listing existing sessions.\n\nOnly available if the Agent supports the `sessionCapabilities.list` capability.", "properties": { "_meta": { "additionalProperties": true, @@ -2862,49 +3538,34 @@ "null" ] }, - "stopReason": { - "allOf": [ - { - "$ref": "#/$defs/StopReason" - } - ], - "description": "Indicates why the agent stopped processing the turn." + "additionalDirectories": { + "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 the exact ordered additional workspace roots. Each path must be absolute.\n\nThis filter applies only when the field is present and non-empty. When\nomitted or empty, no additional-root filter is applied.", + "items": { + "type": "string" + }, + "type": "array" }, - "usage": { - "anyOf": [ - { - "$ref": "#/$defs/Usage" - }, - { - "type": "null" - } - ], - "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 this turn (optional)." + "cursor": { + "description": "Opaque cursor token from a previous response's nextCursor field for cursor-based pagination", + "type": [ + "string", + "null" + ] }, - "userMessageId": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe acknowledged user message ID.\n\nIf the client provided a `messageId` in the [`PromptRequest`], the agent echoes it here\nto confirm it was recorded. If the client did not provide one, the agent MAY assign one\nand return it here. Absence of this field indicates the agent did not record a message ID.", + "cwd": { + "description": "Filter sessions by working directory. Must be an absolute path.", "type": [ "string", "null" ] } }, - "required": [ - "stopReason" - ], "type": "object", - "x-method": "session/prompt", + "x-method": "session/list", "x-side": "agent" }, - "ProtocolVersion": { - "description": "Protocol version identifier.\n\nThis version is only bumped for breaking changes.\nNon-breaking changes should be introduced via capabilities.", - "format": "uint16", - "maximum": 65535, - "minimum": 0, - "type": "integer" - }, - "ReadTextFileRequest": { - "description": "Request to read content from a text file.\n\nOnly available if the client supports the `fs.readTextFile` capability.", + "ListSessionsResponse": { + "description": "Response from listing sessions.", "properties": { "_meta": { "additionalProperties": true, @@ -2914,47 +3575,65 @@ "null" ] }, - "limit": { - "description": "Maximum number of lines to read.", - "format": "uint32", - "minimum": 0, - "type": [ - "integer", - "null" - ] - }, - "line": { - "description": "Line number to start reading from (1-based).", - "format": "uint32", - "minimum": 0, + "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.", "type": [ - "integer", + "string", "null" ] }, - "path": { - "description": "Absolute path to the file to read.", - "type": "string" - }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "The session ID for this request." + "sessions": { + "description": "Array of session information objects", + "items": { + "$ref": "#/$defs/SessionInfo" + }, + "type": "array" } }, "required": [ - "sessionId", - "path" + "sessions" ], "type": "object", - "x-method": "fs/read_text_file", - "x-side": "client" + "x-method": "session/list", + "x-side": "agent" }, - "ReadTextFileResponse": { - "description": "Response containing the contents of a text file.", + "LlmProtocol": { + "anyOf": [ + { + "const": "anthropic", + "description": "Anthropic API protocol.", + "type": "string" + }, + { + "const": "openai", + "description": "OpenAI API protocol.", + "type": "string" + }, + { + "const": "azure", + "description": "Azure OpenAI API protocol.", + "type": "string" + }, + { + "const": "vertex", + "description": "Google Vertex AI API protocol.", + "type": "string" + }, + { + "const": "bedrock", + "description": "AWS Bedrock API protocol.", + "type": "string" + }, + { + "description": "Unknown or custom protocol.", + "title": "other", + "type": "string" + } + ], + "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." + }, + "LoadSessionRequest": { + "description": "Request parameters for loading an existing session.\n\nOnly available if the Agent supports the `loadSession` capability.\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)", "properties": { "_meta": { "additionalProperties": true, @@ -2964,19 +3643,44 @@ "null" ] }, - "content": { + "additionalDirectories": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional 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 loaded\nsession.", + "items": { + "type": "string" + }, + "type": "array" + }, + "cwd": { + "description": "The working directory for this session.", "type": "string" + }, + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "items": { + "$ref": "#/$defs/McpServer" + }, + "type": "array" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to load." } }, "required": [ - "content" + "mcpServers", + "cwd", + "sessionId" ], "type": "object", - "x-method": "fs/read_text_file", - "x-side": "client" + "x-method": "session/load", + "x-side": "agent" }, - "ReleaseTerminalRequest": { - "description": "Request to release a terminal and free its resources.", + "LoadSessionResponse": { + "description": "Response from loading an existing session.", "properties": { "_meta": { "additionalProperties": true, @@ -2986,29 +3690,59 @@ "null" ] }, - "sessionId": { - "allOf": [ + "configOptions": { + "description": "Initial session configuration options if supported by the Agent.", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "type": [ + "array", + "null" + ] + }, + "models": { + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/SessionModelState" + }, + { + "type": "null" } ], - "description": "The session ID for this request." + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" }, - "terminalId": { - "description": "The ID of the terminal to release.", - "type": "string" + "modes": { + "anyOf": [ + { + "$ref": "#/$defs/SessionModeState" + }, + { + "type": "null" + } + ], + "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" } }, - "required": [ - "sessionId", - "terminalId" - ], "type": "object", - "x-method": "terminal/release", - "x-side": "client" + "x-method": "session/load", + "x-side": "agent" }, - "ReleaseTerminalResponse": { - "description": "Response to terminal/release method", + "LogoutCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLogout capabilities supported by the agent.\n\nBy supplying `{}` it means that the agent supports the logout method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "LogoutRequest": { + "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 logout method.\n\nTerminates the current authenticated session.", "properties": { "_meta": { "additionalProperties": true, @@ -3020,68 +3754,101 @@ } }, "type": "object", - "x-method": "terminal/release", - "x-side": "client" + "x-method": "logout", + "x-side": "agent" }, - "RequestId": { - "anyOf": [ - { - "title": "Null", - "type": "null" + "LogoutResponse": { + "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 `logout` method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object", + "x-method": "logout", + "x-side": "agent" + }, + "McpCapabilities": { + "description": "MCP capabilities supported by the agent", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] }, - { - "format": "int64", - "title": "Number", - "type": "integer" + "http": { + "default": false, + "description": "Agent supports [`McpServer::Http`].", + "type": "boolean" }, - { - "title": "Str", - "type": "string" + "sse": { + "default": false, + "description": "Agent supports [`McpServer::Sse`].", + "type": "boolean" } - ], - "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." - }, - "RequestPermissionOutcome": { - "description": "The outcome of a permission request.", - "discriminator": { - "propertyName": "outcome" }, - "oneOf": [ + "type": "object" + }, + "McpServer": { + "anyOf": [ { - "description": "The prompt turn was cancelled before the user responded.\n\nWhen a client sends a `session/cancel` notification to cancel an ongoing\nprompt turn, it MUST respond to all pending `session/request_permission`\nrequests with this `Cancelled` outcome.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)", + "allOf": [ + { + "$ref": "#/$defs/McpServerHttp" + } + ], + "description": "HTTP transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.http` is `true`.", "properties": { - "outcome": { - "const": "cancelled", + "type": { + "const": "http", "type": "string" } }, "required": [ - "outcome" + "type" ], "type": "object" }, { "allOf": [ { - "$ref": "#/$defs/SelectedPermissionOutcome" + "$ref": "#/$defs/McpServerSse" } ], - "description": "The user selected one of the provided options.", + "description": "SSE transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.sse` is `true`.", "properties": { - "outcome": { - "const": "selected", + "type": { + "const": "sse", "type": "string" } }, "required": [ - "outcome" + "type" ], "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/McpServerStdio" + } + ], + "description": "Stdio transport configuration\n\nAll Agents MUST support this transport.", + "title": "stdio" } - ] + ], + "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/session-setup#mcp-servers)" }, - "RequestPermissionRequest": { - "description": "Request for user permission to execute a tool call.\n\nSent when the agent needs authorization before performing a sensitive operation.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)", + "McpServerHttp": { + "description": "HTTP transport configuration for MCP.", "properties": { "_meta": { "additionalProperties": true, @@ -3091,68 +3858,31 @@ "null" ] }, - "options": { - "description": "Available permission options for the user to choose from.", + "headers": { + "description": "HTTP headers to set when making requests to the MCP server.", "items": { - "$ref": "#/$defs/PermissionOption" + "$ref": "#/$defs/HttpHeader" }, "type": "array" }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "The session ID for this request." + "name": { + "description": "Human-readable name identifying this MCP server.", + "type": "string" }, - "toolCall": { - "allOf": [ - { - "$ref": "#/$defs/ToolCallUpdate" - } - ], - "description": "Details about the tool call requiring permission." - } - }, - "required": [ - "sessionId", - "toolCall", - "options" - ], - "type": "object", - "x-method": "session/request_permission", - "x-side": "client" - }, - "RequestPermissionResponse": { - "description": "Response to a permission request.", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] - }, - "outcome": { - "allOf": [ - { - "$ref": "#/$defs/RequestPermissionOutcome" - } - ], - "description": "The user's decision on the permission request." + "url": { + "description": "URL to the MCP server.", + "type": "string" } }, "required": [ - "outcome" + "name", + "url", + "headers" ], - "type": "object", - "x-method": "session/request_permission", - "x-side": "client" + "type": "object" }, - "ResourceLink": { - "description": "A resource that the server is capable of reading, included in a prompt or tool call result.", + "McpServerSse": { + "description": "SSE transport configuration for MCP.", "properties": { "_meta": { "additionalProperties": true, @@ -3162,56 +3892,31 @@ "null" ] }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "description": { - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "type": [ - "string", - "null" - ] + "headers": { + "description": "HTTP headers to set when making requests to the MCP server.", + "items": { + "$ref": "#/$defs/HttpHeader" + }, + "type": "array" }, "name": { + "description": "Human-readable name identifying this MCP server.", "type": "string" }, - "size": { - "format": "int64", - "type": [ - "integer", - "null" - ] - }, - "title": { - "type": [ - "string", - "null" - ] - }, - "uri": { + "url": { + "description": "URL to the MCP server.", "type": "string" } }, "required": [ "name", - "uri" + "url", + "headers" ], "type": "object" }, - "ResumeSessionRequest": { - "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 resuming an existing session.\n\nResumes an existing session without returning previous messages (unlike `session/load`).\nThis is useful for agents that can resume sessions but don't implement full session loading.\n\nOnly available if the Agent supports the `session.resume` capability.", + "McpServerStdio": { + "description": "Stdio transport configuration for MCP.", "properties": { "_meta": { "additionalProperties": true, @@ -3221,36 +3926,43 @@ "null" ] }, - "cwd": { - "description": "The working directory for this session.", + "args": { + "description": "Command-line arguments to pass to the MCP server.", + "items": { + "type": "string" + }, + "type": "array" + }, + "command": { + "description": "Path to the MCP server executable.", "type": "string" }, - "mcpServers": { - "description": "List of MCP servers to connect to for this session.", + "env": { + "description": "Environment variables to set when launching the MCP server.", "items": { - "$ref": "#/$defs/McpServer" + "$ref": "#/$defs/EnvVariable" }, "type": "array" }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "The ID of the session to resume." + "name": { + "description": "Human-readable name identifying this MCP server.", + "type": "string" } }, "required": [ - "sessionId", - "cwd" + "name", + "command", + "args", + "env" ], - "type": "object", - "x-method": "session/resume", - "x-side": "agent" + "type": "object" }, - "ResumeSessionResponse": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from resuming an existing session.", + "ModelId": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA unique identifier for a model.", + "type": "string" + }, + "ModelInfo": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInformation about a selectable model.", "properties": { "_meta": { "additionalProperties": true, @@ -3260,78 +3972,116 @@ "null" ] }, - "configOptions": { - "description": "Initial session configuration options if supported by the Agent.", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, + "description": { + "description": "Optional description of the model.", "type": [ - "array", + "string", "null" ] }, - "models": { - "anyOf": [ - { - "$ref": "#/$defs/SessionModelState" - }, + "modelId": { + "allOf": [ { - "type": "null" + "$ref": "#/$defs/ModelId" } ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" + "description": "Unique identifier for the model." }, - "modes": { - "anyOf": [ + "name": { + "description": "Human-readable name of the model.", + "type": "string" + } + }, + "required": [ + "modelId", + "name" + ], + "type": "object" + }, + "MultiSelectItems": { + "anyOf": [ + { + "allOf": [ { - "$ref": "#/$defs/SessionModeState" - }, + "$ref": "#/$defs/UntitledMultiSelectItems" + } + ], + "description": "Untitled multi-select items with plain string values.", + "title": "Untitled" + }, + { + "allOf": [ { - "type": "null" + "$ref": "#/$defs/TitledMultiSelectItems" } ], - "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + "description": "Titled multi-select items with human-readable labels.", + "title": "Titled" } - }, - "type": "object", - "x-method": "session/resume", - "x-side": "agent" - }, - "Role": { - "description": "The sender or recipient of messages and data in a conversation.", - "enum": [ - "assistant", - "user" ], - "type": "string" + "description": "Items for a multi-select (array) property schema." }, - "SelectedPermissionOutcome": { - "description": "The user selected one of the provided options.", + "MultiSelectPropertySchema": { + "description": "Schema for multi-select (array) properties in an elicitation form.", "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", + "default": { + "description": "Default selected values.", + "items": { + "type": "string" + }, "type": [ - "object", + "array", "null" ] }, - "optionId": { + "description": { + "description": "Human-readable description.", + "type": [ + "string", + "null" + ] + }, + "items": { "allOf": [ { - "$ref": "#/$defs/PermissionOptionId" + "$ref": "#/$defs/MultiSelectItems" } ], - "description": "The ID of the option the user selected." + "description": "The items definition describing allowed values." + }, + "maxItems": { + "description": "Maximum number of items to select.", + "format": "uint64", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "minItems": { + "description": "Minimum number of items to select.", + "format": "uint64", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "title": { + "description": "Optional title for the property.", + "type": [ + "string", + "null" + ] } }, "required": [ - "optionId" + "items" ], "type": "object" }, - "SessionCapabilities": { - "description": "Session capabilities supported by the agent.\n\nAs a baseline, all Agents **MUST** support `session/new`, `session/prompt`, `session/cancel`, and `session/update`.\n\nOptionally, they **MAY** support other session methods and notifications by specifying additional capabilities.\n\nNote: `session/load` is still handled by the top-level `load_session` capability. This will be unified in future versions of the protocol.\n\nSee protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)", + "NesCapabilities": { + "description": "NES capabilities advertised by the agent during initialization.", "properties": { "_meta": { "additionalProperties": true, @@ -3341,230 +4091,188 @@ "null" ] }, - "close": { + "context": { "anyOf": [ { - "$ref": "#/$defs/SessionCloseCapabilities" + "$ref": "#/$defs/NesContextCapabilities" }, { "type": "null" } ], - "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/close`." + "description": "Context the agent wants attached to each suggestion request." }, - "fork": { + "events": { "anyOf": [ { - "$ref": "#/$defs/SessionForkCapabilities" + "$ref": "#/$defs/NesEventCapabilities" }, { "type": "null" } ], - "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`." + "description": "Events the agent wants to receive." + } + }, + "type": "object" + }, + "NesContextCapabilities": { + "description": "Context capabilities the agent wants attached to each suggestion request.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] }, - "list": { + "diagnostics": { "anyOf": [ { - "$ref": "#/$defs/SessionListCapabilities" + "$ref": "#/$defs/NesDiagnosticsCapabilities" }, { "type": "null" } ], - "description": "Whether the agent supports `session/list`." + "description": "Whether the agent wants diagnostics context." }, - "resume": { + "editHistory": { "anyOf": [ { - "$ref": "#/$defs/SessionResumeCapabilities" + "$ref": "#/$defs/NesEditHistoryCapabilities" }, { "type": "null" } ], - "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/resume`." - } - }, - "type": "object" - }, - "SessionCloseCapabilities": { - "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/close` method.\n\nBy supplying `{}` it means that the agent supports closing of sessions.", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] - } - }, - "type": "object" - }, - "SessionConfigBoolean": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA boolean on/off toggle session configuration option payload.", - "properties": { - "currentValue": { - "description": "The current value of the boolean option.", - "type": "boolean" - } - }, - "required": [ - "currentValue" - ], - "type": "object" - }, - "SessionConfigGroupId": { - "description": "Unique identifier for a session configuration option value group.", - "type": "string" - }, - "SessionConfigId": { - "description": "Unique identifier for a session configuration option.", - "type": "string" - }, - "SessionConfigOption": { - "description": "A session configuration option selector and its current state.", - "discriminator": { - "propertyName": "type" - }, - "oneOf": [ - { - "allOf": [ + "description": "Whether the agent wants edit history context." + }, + "openFiles": { + "anyOf": [ { - "$ref": "#/$defs/SessionConfigSelect" - } - ], - "description": "Single-value selector (dropdown).", - "properties": { - "type": { - "const": "select", - "type": "string" + "$ref": "#/$defs/NesOpenFilesCapabilities" + }, + { + "type": "null" } - }, - "required": [ - "type" ], - "type": "object" + "description": "Whether the agent wants open files context." }, - { - "allOf": [ + "recentFiles": { + "anyOf": [ { - "$ref": "#/$defs/SessionConfigBoolean" + "$ref": "#/$defs/NesRecentFilesCapabilities" + }, + { + "type": "null" } ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nBoolean on/off toggle.", - "properties": { - "type": { - "const": "boolean", - "type": "string" + "description": "Whether the agent wants recent files context." + }, + "relatedSnippets": { + "anyOf": [ + { + "$ref": "#/$defs/NesRelatedSnippetsCapabilities" + }, + { + "type": "null" } - }, - "required": [ - "type" ], - "type": "object" - } - ], - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] + "description": "Whether the agent wants related snippets context." }, - "category": { + "userActions": { "anyOf": [ { - "$ref": "#/$defs/SessionConfigOptionCategory" + "$ref": "#/$defs/NesUserActionsCapabilities" }, { "type": "null" } ], - "description": "Optional semantic category for this option (UX only)." + "description": "Whether the agent wants user actions context." + } + }, + "type": "object" + }, + "NesDiagnostic": { + "description": "A diagnostic (error, warning, etc.).", + "properties": { + "message": { + "description": "The diagnostic message.", + "type": "string" }, - "description": { - "description": "Optional description for the Client to display to the user.", - "type": [ - "string", - "null" - ] + "range": { + "allOf": [ + { + "$ref": "#/$defs/Range" + } + ], + "description": "The range of the diagnostic." }, - "id": { + "severity": { "allOf": [ { - "$ref": "#/$defs/SessionConfigId" + "$ref": "#/$defs/NesDiagnosticSeverity" } ], - "description": "Unique identifier for the configuration option." + "description": "The severity of the diagnostic." }, - "name": { - "description": "Human-readable label for the option.", + "uri": { + "description": "The URI of the file containing the diagnostic.", "type": "string" } }, "required": [ - "id", - "name" + "uri", + "range", + "severity", + "message" ], "type": "object" }, - "SessionConfigOptionCategory": { - "anyOf": [ + "NesDiagnosticSeverity": { + "description": "Severity of a diagnostic.", + "oneOf": [ { - "const": "mode", - "description": "Session mode selector.", + "const": "error", + "description": "An error.", "type": "string" }, { - "const": "model", - "description": "Model selector.", + "const": "warning", + "description": "A warning.", "type": "string" }, { - "const": "thought_level", - "description": "Thought/reasoning level selector.", + "const": "information", + "description": "An informational message.", "type": "string" }, { - "description": "Unknown / uncategorized selector.", - "title": "other", + "const": "hint", + "description": "A hint.", "type": "string" } - ], - "description": "Semantic category for a session configuration option.\n\nThis is intended to help Clients distinguish broadly common selectors (e.g. model selector vs\nsession mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,\nplacement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown\ncategories gracefully.\n\nCategory names beginning with `_` are free for custom use, like other ACP extension methods.\nCategory names that do not begin with `_` are reserved for the ACP spec." + ] }, - "SessionConfigSelect": { - "description": "A single-value selector (dropdown) session configuration option payload.", + "NesDiagnosticsCapabilities": { + "description": "Capabilities for diagnostics context.", "properties": { - "currentValue": { - "allOf": [ - { - "$ref": "#/$defs/SessionConfigValueId" - } - ], - "description": "The currently selected value." - }, - "options": { - "allOf": [ - { - "$ref": "#/$defs/SessionConfigSelectOptions" - } - ], - "description": "The set of selectable options." + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] } }, - "required": [ - "currentValue", - "options" - ], "type": "object" }, - "SessionConfigSelectGroup": { - "description": "A group of possible values for a session configuration option.", + "NesDocumentDidChangeCapabilities": { + "description": "Capabilities for `document/didChange` events.", "properties": { "_meta": { "additionalProperties": true, @@ -3574,35 +4282,22 @@ "null" ] }, - "group": { + "syncKind": { "allOf": [ { - "$ref": "#/$defs/SessionConfigGroupId" + "$ref": "#/$defs/TextDocumentSyncKind" } ], - "description": "Unique identifier for this group." - }, - "name": { - "description": "Human-readable label for this group.", - "type": "string" - }, - "options": { - "description": "The set of option values in this group.", - "items": { - "$ref": "#/$defs/SessionConfigSelectOption" - }, - "type": "array" + "description": "The sync kind the agent wants: `\"full\"` or `\"incremental\"`." } }, "required": [ - "group", - "name", - "options" + "syncKind" ], "type": "object" }, - "SessionConfigSelectOption": { - "description": "A possible value for a session configuration option.", + "NesDocumentDidCloseCapabilities": { + "description": "Marker for `document/didClose` capability support.", "properties": { "_meta": { "additionalProperties": true, @@ -3611,60 +4306,26 @@ "object", "null" ] - }, - "description": { - "description": "Optional description for this option value.", + } + }, + "type": "object" + }, + "NesDocumentDidFocusCapabilities": { + "description": "Marker for `document/didFocus` capability support.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", "type": [ - "string", + "object", "null" ] - }, - "name": { - "description": "Human-readable label for this option value.", - "type": "string" - }, - "value": { - "allOf": [ - { - "$ref": "#/$defs/SessionConfigValueId" - } - ], - "description": "Unique identifier for this option value." } }, - "required": [ - "value", - "name" - ], "type": "object" }, - "SessionConfigSelectOptions": { - "anyOf": [ - { - "description": "A flat list of options with no grouping.", - "items": { - "$ref": "#/$defs/SessionConfigSelectOption" - }, - "title": "Ungrouped", - "type": "array" - }, - { - "description": "A list of options grouped under headers.", - "items": { - "$ref": "#/$defs/SessionConfigSelectGroup" - }, - "title": "Grouped", - "type": "array" - } - ], - "description": "Possible values for a session configuration option." - }, - "SessionConfigValueId": { - "description": "Unique identifier for a session configuration option value.", - "type": "string" - }, - "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\nBy supplying `{}` it means that the agent supports forking of sessions.", + "NesDocumentDidOpenCapabilities": { + "description": "Marker for `document/didOpen` capability support.", "properties": { "_meta": { "additionalProperties": true, @@ -3677,12 +4338,22 @@ }, "type": "object" }, - "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/session-setup#session-id)", - "type": "string" - }, - "SessionInfo": { - "description": "Information about a session returned by session/list", + "NesDocumentDidSaveCapabilities": { + "description": "Marker for `document/didSave` capability support.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "NesDocumentEventCapabilities": { + "description": "Document event capabilities the agent wants to receive.", "properties": { "_meta": { "additionalProperties": true, @@ -3692,41 +4363,66 @@ "null" ] }, - "cwd": { - "description": "The working directory for this session. Must be an absolute path.", - "type": "string" - }, - "sessionId": { - "allOf": [ + "didChange": { + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/NesDocumentDidChangeCapabilities" + }, + { + "type": "null" } ], - "description": "Unique identifier for the session" + "description": "Whether the agent wants `document/didChange` events, and the sync kind." }, - "title": { - "description": "Human-readable title for the session", - "type": [ - "string", - "null" - ] + "didClose": { + "anyOf": [ + { + "$ref": "#/$defs/NesDocumentDidCloseCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent wants `document/didClose` events." }, - "updatedAt": { - "description": "ISO 8601 timestamp of last activity", - "type": [ - "string", - "null" - ] + "didFocus": { + "anyOf": [ + { + "$ref": "#/$defs/NesDocumentDidFocusCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent wants `document/didFocus` events." + }, + "didOpen": { + "anyOf": [ + { + "$ref": "#/$defs/NesDocumentDidOpenCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent wants `document/didOpen` events." + }, + "didSave": { + "anyOf": [ + { + "$ref": "#/$defs/NesDocumentDidSaveCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent wants `document/didSave` events." } }, - "required": [ - "sessionId", - "cwd" - ], "type": "object" }, - "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.", + "NesEditHistoryCapabilities": { + "description": "Capabilities for edit history context.", "properties": { "_meta": { "additionalProperties": true, @@ -3736,39 +4432,75 @@ "null" ] }, - "title": { - "description": "Human-readable title for the session. Set to null to clear.", + "maxCount": { + "description": "Maximum number of edit history entries the agent can use.", + "format": "uint32", + "minimum": 0, "type": [ - "string", + "integer", "null" ] + } + }, + "type": "object" + }, + "NesEditHistoryEntry": { + "description": "An entry in the edit history.", + "properties": { + "diff": { + "description": "A diff representing the edit.", + "type": "string" }, - "updatedAt": { - "description": "ISO 8601 timestamp of last activity. Set to null to clear.", - "type": [ - "string", - "null" - ] + "uri": { + "description": "The URI of the edited file.", + "type": "string" } }, + "required": [ + "uri", + "diff" + ], "type": "object" }, - "SessionListCapabilities": { - "description": "Capabilities for the `session/list` method.\n\nBy supplying `{}` it means that the agent supports listing of sessions.", + "NesEditSuggestion": { + "description": "A text edit suggestion.", "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", - "type": [ - "object", - "null" - ] + "cursorPosition": { + "anyOf": [ + { + "$ref": "#/$defs/Position" + }, + { + "type": "null" + } + ], + "description": "Optional suggested cursor position after applying edits." + }, + "edits": { + "description": "The text edits to apply.", + "items": { + "$ref": "#/$defs/NesTextEdit" + }, + "type": "array" + }, + "id": { + "description": "Unique identifier for accept/reject tracking.", + "type": "string" + }, + "uri": { + "description": "The URI of the file to edit.", + "type": "string" } }, + "required": [ + "id", + "uri", + "edits" + ], "type": "object" }, - "SessionMode": { - "description": "A mode the agent can operate in.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "NesEventCapabilities": { + "description": "Event capabilities the agent can consume.", "properties": { "_meta": { "additionalProperties": true, @@ -3778,31 +4510,49 @@ "null" ] }, - "description": { - "type": [ - "string", - "null" - ] + "document": { + "anyOf": [ + { + "$ref": "#/$defs/NesDocumentEventCapabilities" + }, + { + "type": "null" + } + ], + "description": "Document event capabilities." + } + }, + "type": "object" + }, + "NesExcerpt": { + "description": "A code excerpt from a file.", + "properties": { + "endLine": { + "description": "The end line of the excerpt (zero-based).", + "format": "uint32", + "minimum": 0, + "type": "integer" }, - "id": { - "$ref": "#/$defs/SessionModeId" + "startLine": { + "description": "The start line of the excerpt (zero-based).", + "format": "uint32", + "minimum": 0, + "type": "integer" }, - "name": { + "text": { + "description": "The text content of the excerpt.", "type": "string" } }, "required": [ - "id", - "name" + "startLine", + "endLine", + "text" ], "type": "object" }, - "SessionModeId": { - "description": "Unique identifier for a Session Mode.", - "type": "string" - }, - "SessionModeState": { - "description": "The set of modes and the one currently active.", + "NesJumpCapabilities": { + "description": "Marker for jump suggestion support.", "properties": { "_meta": { "additionalProperties": true, @@ -3811,64 +4561,77 @@ "object", "null" ] + } + }, + "type": "object" + }, + "NesJumpSuggestion": { + "description": "A jump-to-location suggestion.", + "properties": { + "id": { + "description": "Unique identifier for accept/reject tracking.", + "type": "string" }, - "availableModes": { - "description": "The set of modes that the Agent can operate in", - "items": { - "$ref": "#/$defs/SessionMode" - }, - "type": "array" - }, - "currentModeId": { + "position": { "allOf": [ { - "$ref": "#/$defs/SessionModeId" + "$ref": "#/$defs/Position" } ], - "description": "The current mode the Agent is in." + "description": "The target position within the file." + }, + "uri": { + "description": "The file to navigate to.", + "type": "string" } }, "required": [ - "currentModeId", - "availableModes" + "id", + "uri", + "position" ], "type": "object" }, - "SessionModelState": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe set of models and the one currently active.", + "NesOpenFile": { + "description": "An open file in the editor.", "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", + "languageId": { + "description": "The language identifier.", + "type": "string" + }, + "lastFocusedMs": { + "description": "Timestamp in milliseconds since epoch of when the file was last focused.", + "format": "uint64", + "minimum": 0, "type": [ - "object", + "integer", "null" ] }, - "availableModels": { - "description": "The set of models that the Agent can use", - "items": { - "$ref": "#/$defs/ModelInfo" - }, - "type": "array" + "uri": { + "description": "The URI of the file.", + "type": "string" }, - "currentModelId": { - "allOf": [ + "visibleRange": { + "anyOf": [ { - "$ref": "#/$defs/ModelId" + "$ref": "#/$defs/Range" + }, + { + "type": "null" } ], - "description": "The current model the Agent is in." + "description": "The visible range in the editor, if any." } }, "required": [ - "currentModelId", - "availableModels" + "uri", + "languageId" ], "type": "object" }, - "SessionNotification": { - "description": "Notification containing a session update from the agent.\n\nUsed to stream real-time progress and results during prompt processing.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", + "NesOpenFilesCapabilities": { + "description": "Capabilities for open files context.", "properties": { "_meta": { "additionalProperties": true, @@ -3877,34 +4640,35 @@ "object", "null" ] + } + }, + "type": "object" + }, + "NesRecentFile": { + "description": "A recently accessed file.", + "properties": { + "languageId": { + "description": "The language identifier.", + "type": "string" }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "The ID of the session this update pertains to." + "text": { + "description": "The full text content of the file.", + "type": "string" }, - "update": { - "allOf": [ - { - "$ref": "#/$defs/SessionUpdate" - } - ], - "description": "The actual update content." + "uri": { + "description": "The URI of the file.", + "type": "string" } }, "required": [ - "sessionId", - "update" + "uri", + "languageId", + "text" ], - "type": "object", - "x-method": "session/update", - "x-side": "client" + "type": "object" }, - "SessionResumeCapabilities": { - "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/resume` method.\n\nBy supplying `{}` it means that the agent supports resuming of sessions.", + "NesRecentFilesCapabilities": { + "description": "Capabilities for recent files context.", "properties": { "_meta": { "additionalProperties": true, @@ -3913,151 +4677,2271 @@ "object", "null" ] + }, + "maxCount": { + "description": "Maximum number of recent files the agent can use.", + "format": "uint32", + "minimum": 0, + "type": [ + "integer", + "null" + ] } }, "type": "object" }, - "SessionUpdate": { - "description": "Different types of updates that can be sent during session processing.\n\nThese updates provide real-time feedback about the agent's progress.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", - "discriminator": { - "propertyName": "sessionUpdate" - }, + "NesRejectReason": { + "description": "The reason a suggestion was rejected.", "oneOf": [ { - "allOf": [ - { - "$ref": "#/$defs/ContentChunk" - } - ], - "description": "A chunk of the user's message being streamed.", - "properties": { - "sessionUpdate": { - "const": "user_message_chunk", - "type": "string" - } - }, - "required": [ - "sessionUpdate" - ], - "type": "object" + "const": "rejected", + "description": "The user explicitly dismissed the suggestion.", + "type": "string" }, { + "const": "ignored", + "description": "The suggestion was shown but the user continued editing without interacting.", + "type": "string" + }, + { + "const": "replaced", + "description": "The suggestion was superseded by a newer suggestion.", + "type": "string" + }, + { + "const": "cancelled", + "description": "The request was cancelled before the agent returned a response.", + "type": "string" + } + ] + }, + "NesRelatedSnippet": { + "description": "A related code snippet from a file.", + "properties": { + "excerpts": { + "description": "The code excerpts.", + "items": { + "$ref": "#/$defs/NesExcerpt" + }, + "type": "array" + }, + "uri": { + "description": "The URI of the file containing the snippets.", + "type": "string" + } + }, + "required": [ + "uri", + "excerpts" + ], + "type": "object" + }, + "NesRelatedSnippetsCapabilities": { + "description": "Capabilities for related snippets context.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "NesRenameCapabilities": { + "description": "Marker for rename suggestion support.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "NesRenameSuggestion": { + "description": "A rename symbol suggestion.", + "properties": { + "id": { + "description": "Unique identifier for accept/reject tracking.", + "type": "string" + }, + "newName": { + "description": "The new name for the symbol.", + "type": "string" + }, + "position": { "allOf": [ { - "$ref": "#/$defs/ContentChunk" + "$ref": "#/$defs/Position" } ], - "description": "A chunk of the agent's response being streamed.", - "properties": { - "sessionUpdate": { - "const": "agent_message_chunk", - "type": "string" - } + "description": "The position of the symbol to rename." + }, + "uri": { + "description": "The file URI containing the symbol.", + "type": "string" + } + }, + "required": [ + "id", + "uri", + "position", + "newName" + ], + "type": "object" + }, + "NesRepository": { + "description": "Repository metadata for an NES session.", + "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" + } + }, + "required": [ + "name", + "owner", + "remoteUrl" + ], + "type": "object" + }, + "NesSearchAndReplaceCapabilities": { + "description": "Marker for search and replace suggestion support.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "NesSearchAndReplaceSuggestion": { + "description": "A search-and-replace suggestion.", + "properties": { + "id": { + "description": "Unique identifier for accept/reject tracking.", + "type": "string" + }, + "isRegex": { + "description": "Whether `search` is a regular expression. Defaults to `false`.", + "type": [ + "boolean", + "null" + ] + }, + "replace": { + "description": "The replacement text.", + "type": "string" + }, + "search": { + "description": "The text or pattern to find.", + "type": "string" + }, + "uri": { + "description": "The file URI to search within.", + "type": "string" + } + }, + "required": [ + "id", + "uri", + "search", + "replace" + ], + "type": "object" + }, + "NesSuggestContext": { + "description": "Context attached to a suggestion request.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "diagnostics": { + "description": "Current diagnostics (errors, warnings).", + "items": { + "$ref": "#/$defs/NesDiagnostic" }, - "required": [ - "sessionUpdate" - ], - "type": "object" + "type": [ + "array", + "null" + ] + }, + "editHistory": { + "description": "Recent edit history.", + "items": { + "$ref": "#/$defs/NesEditHistoryEntry" + }, + "type": [ + "array", + "null" + ] + }, + "openFiles": { + "description": "Currently open files in the editor.", + "items": { + "$ref": "#/$defs/NesOpenFile" + }, + "type": [ + "array", + "null" + ] + }, + "recentFiles": { + "description": "Recently accessed files.", + "items": { + "$ref": "#/$defs/NesRecentFile" + }, + "type": [ + "array", + "null" + ] + }, + "relatedSnippets": { + "description": "Related code snippets.", + "items": { + "$ref": "#/$defs/NesRelatedSnippet" + }, + "type": [ + "array", + "null" + ] }, + "userActions": { + "description": "Recent user actions (typing, navigation, etc.).", + "items": { + "$ref": "#/$defs/NesUserAction" + }, + "type": [ + "array", + "null" + ] + } + }, + "type": "object" + }, + "NesSuggestion": { + "description": "A suggestion returned by the agent.", + "discriminator": { + "propertyName": "kind" + }, + "oneOf": [ { "allOf": [ { - "$ref": "#/$defs/ContentChunk" + "$ref": "#/$defs/NesEditSuggestion" } ], - "description": "A chunk of the agent's internal reasoning being streamed.", + "description": "A text edit suggestion.", "properties": { - "sessionUpdate": { - "const": "agent_thought_chunk", + "kind": { + "const": "edit", "type": "string" } }, "required": [ - "sessionUpdate" + "kind" ], "type": "object" }, { "allOf": [ { - "$ref": "#/$defs/ToolCall" + "$ref": "#/$defs/NesJumpSuggestion" } ], - "description": "Notification that a new tool call has been initiated.", + "description": "A jump-to-location suggestion.", "properties": { - "sessionUpdate": { - "const": "tool_call", + "kind": { + "const": "jump", "type": "string" } }, "required": [ - "sessionUpdate" + "kind" ], "type": "object" }, { "allOf": [ { - "$ref": "#/$defs/ToolCallUpdate" + "$ref": "#/$defs/NesRenameSuggestion" } ], - "description": "Update on the status or results of a tool call.", + "description": "A rename symbol suggestion.", "properties": { - "sessionUpdate": { - "const": "tool_call_update", + "kind": { + "const": "rename", "type": "string" } }, "required": [ - "sessionUpdate" + "kind" ], "type": "object" }, { "allOf": [ { - "$ref": "#/$defs/Plan" + "$ref": "#/$defs/NesSearchAndReplaceSuggestion" } ], - "description": "The agent's execution plan for complex tasks.\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", + "description": "A search-and-replace suggestion.", "properties": { - "sessionUpdate": { - "const": "plan", + "kind": { + "const": "searchAndReplace", "type": "string" } }, "required": [ - "sessionUpdate" + "kind" ], "type": "object" + } + ] + }, + "NesTextEdit": { + "description": "A text edit within a suggestion.", + "properties": { + "newText": { + "description": "The replacement text.", + "type": "string" }, - { + "range": { "allOf": [ { - "$ref": "#/$defs/AvailableCommandsUpdate" - } - ], - "description": "Available commands are ready or have changed", - "properties": { - "sessionUpdate": { - "const": "available_commands_update", - "type": "string" + "$ref": "#/$defs/Range" } - }, - "required": [ - "sessionUpdate" ], - "type": "object" + "description": "The range to replace." + } + }, + "required": [ + "range", + "newText" + ], + "type": "object" + }, + "NesTriggerKind": { + "description": "What triggered the suggestion request.", + "oneOf": [ + { + "const": "automatic", + "description": "Triggered by user typing or cursor movement.", + "type": "string" + }, + { + "const": "diagnostic", + "description": "Triggered by a diagnostic appearing at or near the cursor.", + "type": "string" }, { + "const": "manual", + "description": "Triggered by an explicit user action (keyboard shortcut).", + "type": "string" + } + ] + }, + "NesUserAction": { + "description": "A user action (typing, cursor movement, etc.).", + "properties": { + "action": { + "description": "The kind of action (e.g., \"insertChar\", \"cursorMovement\").", + "type": "string" + }, + "position": { "allOf": [ { - "$ref": "#/$defs/CurrentModeUpdate" + "$ref": "#/$defs/Position" } ], - "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", - "properties": { - "sessionUpdate": { + "description": "The position where the action occurred." + }, + "timestampMs": { + "description": "Timestamp in milliseconds since epoch.", + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "uri": { + "description": "The URI of the file where the action occurred.", + "type": "string" + } + }, + "required": [ + "action", + "uri", + "position", + "timestampMs" + ], + "type": "object" + }, + "NesUserActionsCapabilities": { + "description": "Capabilities for user actions context.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "maxCount": { + "description": "Maximum number of user actions the agent can use.", + "format": "uint32", + "minimum": 0, + "type": [ + "integer", + "null" + ] + } + }, + "type": "object" + }, + "NewSessionRequest": { + "description": "Request parameters for creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "additionalDirectories": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional workspace roots for this session. Each path must be absolute.\n\nThese expand the session's filesystem scope without changing `cwd`, which\nremains the base for relative paths. When omitted or empty, no\nadditional roots are activated for the new session.", + "items": { + "type": "string" + }, + "type": "array" + }, + "cwd": { + "description": "The working directory for this session. Must be an absolute path.", + "type": "string" + }, + "mcpServers": { + "description": "List of MCP (Model Context Protocol) servers the agent should connect to.", + "items": { + "$ref": "#/$defs/McpServer" + }, + "type": "array" + } + }, + "required": [ + "cwd", + "mcpServers" + ], + "type": "object", + "x-method": "session/new", + "x-side": "agent" + }, + "NewSessionResponse": { + "description": "Response from creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "configOptions": { + "description": "Initial session configuration options if supported by the Agent.", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "type": [ + "array", + "null" + ] + }, + "models": { + "anyOf": [ + { + "$ref": "#/$defs/SessionModelState" + }, + { + "type": "null" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" + }, + "modes": { + "anyOf": [ + { + "$ref": "#/$defs/SessionModeState" + }, + { + "type": "null" + } + ], + "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation." + } + }, + "required": [ + "sessionId" + ], + "type": "object", + "x-method": "session/new", + "x-side": "agent" + }, + "NumberPropertySchema": { + "description": "Schema for number (floating-point) properties in an elicitation form.", + "properties": { + "default": { + "description": "Default value.", + "format": "double", + "type": [ + "number", + "null" + ] + }, + "description": { + "description": "Human-readable description.", + "type": [ + "string", + "null" + ] + }, + "maximum": { + "description": "Maximum value (inclusive).", + "format": "double", + "type": [ + "number", + "null" + ] + }, + "minimum": { + "description": "Minimum value (inclusive).", + "format": "double", + "type": [ + "number", + "null" + ] + }, + "title": { + "description": "Optional title for the property.", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "PermissionOption": { + "description": "An option presented to the user when requesting permission.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "kind": { + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionKind" + } + ], + "description": "Hint about the nature of this permission option." + }, + "name": { + "description": "Human-readable label to display to the user.", + "type": "string" + }, + "optionId": { + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionId" + } + ], + "description": "Unique identifier for this permission option." + } + }, + "required": [ + "optionId", + "name", + "kind" + ], + "type": "object" + }, + "PermissionOptionId": { + "description": "Unique identifier for a permission option.", + "type": "string" + }, + "PermissionOptionKind": { + "description": "The type of permission option being presented to the user.\n\nHelps clients choose appropriate icons and UI treatment.", + "oneOf": [ + { + "const": "allow_once", + "description": "Allow this operation only this time.", + "type": "string" + }, + { + "const": "allow_always", + "description": "Allow this operation and remember the choice.", + "type": "string" + }, + { + "const": "reject_once", + "description": "Reject this operation only this time.", + "type": "string" + }, + { + "const": "reject_always", + "description": "Reject this operation and remember the choice.", + "type": "string" + } + ] + }, + "Plan": { + "description": "An execution plan for accomplishing complex tasks.\n\nPlans consist of multiple entries representing individual tasks or goals.\nAgents report plans to clients to provide visibility into their execution strategy.\nPlans can evolve during execution as the agent discovers new requirements or completes tasks.\n\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "entries": { + "description": "The list of tasks to be accomplished.\n\nWhen updating a plan, the agent must send a complete list of all entries\nwith their current status. The client replaces the entire plan with each update.", + "items": { + "$ref": "#/$defs/PlanEntry" + }, + "type": "array" + } + }, + "required": [ + "entries" + ], + "type": "object" + }, + "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/agent-plan#plan-entries)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "content": { + "description": "Human-readable description of what this task aims to accomplish.", + "type": "string" + }, + "priority": { + "allOf": [ + { + "$ref": "#/$defs/PlanEntryPriority" + } + ], + "description": "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal." + }, + "status": { + "allOf": [ + { + "$ref": "#/$defs/PlanEntryStatus" + } + ], + "description": "Current execution status of this task." + } + }, + "required": [ + "content", + "priority", + "status" + ], + "type": "object" + }, + "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/agent-plan#plan-entries)", + "oneOf": [ + { + "const": "high", + "description": "High priority task - critical to the overall goal.", + "type": "string" + }, + { + "const": "medium", + "description": "Medium priority task - important but not critical.", + "type": "string" + }, + { + "const": "low", + "description": "Low priority task - nice to have but not essential.", + "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/agent-plan#plan-entries)", + "oneOf": [ + { + "const": "pending", + "description": "The task has not started yet.", + "type": "string" + }, + { + "const": "in_progress", + "description": "The task is currently being worked on.", + "type": "string" + }, + { + "const": "completed", + "description": "The task has been successfully completed.", + "type": "string" + } + ] + }, + "Position": { + "description": "A zero-based position in a text document.\n\nThe meaning of `character` depends on the negotiated position encoding.", + "properties": { + "character": { + "description": "Zero-based character offset (encoding-dependent).", + "format": "uint32", + "minimum": 0, + "type": "integer" + }, + "line": { + "description": "Zero-based line number.", + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "line", + "character" + ], + "type": "object" + }, + "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": [ + { + "const": "utf-16", + "description": "Character offsets count UTF-16 code units. This is the default.", + "type": "string" + }, + { + "const": "utf-32", + "description": "Character offsets count Unicode code points.", + "type": "string" + }, + { + "const": "utf-8", + "description": "Character offsets count UTF-8 code units (bytes).", + "type": "string" + } + ] + }, + "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/initialization#prompt-capabilities)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "audio": { + "default": false, + "description": "Agent supports [`ContentBlock::Audio`].", + "type": "boolean" + }, + "embeddedContext": { + "default": false, + "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.", + "type": "boolean" + }, + "image": { + "default": false, + "description": "Agent supports [`ContentBlock::Image`].", + "type": "boolean" + } + }, + "type": "object" + }, + "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/prompt-turn#1-user-message)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "messageId": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA client-generated unique identifier for this user message.\n\nIf provided, the Agent SHOULD echo this value as `userMessageId` in the\n[`PromptResponse`] to confirm it was recorded.\nBoth clients and agents MUST use UUID format for message IDs.", + "type": [ + "string", + "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.", + "items": { + "$ref": "#/$defs/ContentBlock" + }, + "type": "array" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to send this user message to" + } + }, + "required": [ + "sessionId", + "prompt" + ], + "type": "object", + "x-method": "session/prompt", + "x-side": "agent" + }, + "PromptResponse": { + "description": "Response from processing a user prompt.\n\nSee protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "stopReason": { + "allOf": [ + { + "$ref": "#/$defs/StopReason" + } + ], + "description": "Indicates why the agent stopped processing the turn." + }, + "usage": { + "anyOf": [ + { + "$ref": "#/$defs/Usage" + }, + { + "type": "null" + } + ], + "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 this turn (optional)." + }, + "userMessageId": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe acknowledged user message ID.\n\nIf the client provided a `messageId` in the [`PromptRequest`], the agent echoes it here\nto confirm it was recorded. If the client did not provide one, the agent MAY assign one\nand return it here. Absence of this field indicates the agent did not record a message ID.", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "stopReason" + ], + "type": "object", + "x-method": "session/prompt", + "x-side": "agent" + }, + "ProtocolVersion": { + "description": "Protocol version identifier.\n\nThis version is only bumped for breaking changes.\nNon-breaking changes should be introduced via capabilities.", + "format": "uint16", + "maximum": 65535, + "minimum": 0, + "type": "integer" + }, + "ProviderCurrentConfig": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCurrent effective non-secret routing configuration for a provider.", + "properties": { + "apiType": { + "allOf": [ + { + "$ref": "#/$defs/LlmProtocol" + } + ], + "description": "Protocol currently used by this provider." + }, + "baseUrl": { + "description": "Base URL currently used by this provider.", + "type": "string" + } + }, + "required": [ + "apiType", + "baseUrl" + ], + "type": "object" + }, + "ProviderInfo": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInformation about a configurable LLM provider.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "current": { + "anyOf": [ + { + "$ref": "#/$defs/ProviderCurrentConfig" + }, + { + "type": "null" + } + ], + "description": "Current effective non-secret routing config.\nNull or omitted means provider is disabled." + }, + "id": { + "description": "Provider identifier, for example \"main\" or \"openai\".", + "type": "string" + }, + "required": { + "description": "Whether this provider is mandatory and cannot be disabled via `providers/disable`.\nIf true, clients must not call `providers/disable` for this id.", + "type": "boolean" + }, + "supported": { + "description": "Supported protocol types for this provider.", + "items": { + "$ref": "#/$defs/LlmProtocol" + }, + "type": "array" + } + }, + "required": [ + "id", + "supported", + "required" + ], + "type": "object" + }, + "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\nBy supplying `{}` it means that the agent supports provider configuration methods.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "Range": { + "description": "A range in a text document, expressed as start and end positions.", + "properties": { + "end": { + "allOf": [ + { + "$ref": "#/$defs/Position" + } + ], + "description": "The end position (exclusive)." + }, + "start": { + "allOf": [ + { + "$ref": "#/$defs/Position" + } + ], + "description": "The start position (inclusive)." + } + }, + "required": [ + "start", + "end" + ], + "type": "object" + }, + "ReadTextFileRequest": { + "description": "Request to read content from a text file.\n\nOnly available if the client supports the `fs.readTextFile` capability.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "limit": { + "description": "Maximum number of lines to read.", + "format": "uint32", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "line": { + "description": "Line number to start reading from (1-based).", + "format": "uint32", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "path": { + "description": "Absolute path to the file to read.", + "type": "string" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session ID for this request." + } + }, + "required": [ + "sessionId", + "path" + ], + "type": "object", + "x-method": "fs/read_text_file", + "x-side": "client" + }, + "ReadTextFileResponse": { + "description": "Response containing the contents of a text file.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "content": { + "type": "string" + } + }, + "required": [ + "content" + ], + "type": "object", + "x-method": "fs/read_text_file", + "x-side": "client" + }, + "RejectNesNotification": { + "description": "Notification sent when a suggestion is rejected.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "id": { + "description": "The ID of the rejected suggestion.", + "type": "string" + }, + "reason": { + "anyOf": [ + { + "$ref": "#/$defs/NesRejectReason" + }, + { + "type": "null" + } + ], + "description": "The reason for rejection." + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session ID for this notification." + } + }, + "required": [ + "sessionId", + "id" + ], + "type": "object", + "x-method": "nes/reject", + "x-side": "agent" + }, + "ReleaseTerminalRequest": { + "description": "Request to release a terminal and free its resources.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session ID for this request." + }, + "terminalId": { + "description": "The ID of the terminal to release.", + "type": "string" + } + }, + "required": [ + "sessionId", + "terminalId" + ], + "type": "object", + "x-method": "terminal/release", + "x-side": "client" + }, + "ReleaseTerminalResponse": { + "description": "Response to terminal/release method", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object", + "x-method": "terminal/release", + "x-side": "client" + }, + "RequestId": { + "anyOf": [ + { + "title": "Null", + "type": "null" + }, + { + "format": "int64", + "title": "Number", + "type": "integer" + }, + { + "title": "Str", + "type": "string" + } + ], + "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." + }, + "RequestPermissionOutcome": { + "description": "The outcome of a permission request.", + "discriminator": { + "propertyName": "outcome" + }, + "oneOf": [ + { + "description": "The prompt turn was cancelled before the user responded.\n\nWhen a client sends a `session/cancel` notification to cancel an ongoing\nprompt turn, it MUST respond to all pending `session/request_permission`\nrequests with this `Cancelled` outcome.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)", + "properties": { + "outcome": { + "const": "cancelled", + "type": "string" + } + }, + "required": [ + "outcome" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/SelectedPermissionOutcome" + } + ], + "description": "The user selected one of the provided options.", + "properties": { + "outcome": { + "const": "selected", + "type": "string" + } + }, + "required": [ + "outcome" + ], + "type": "object" + } + ] + }, + "RequestPermissionRequest": { + "description": "Request for user permission to execute a tool call.\n\nSent when the agent needs authorization before performing a sensitive operation.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "options": { + "description": "Available permission options for the user to choose from.", + "items": { + "$ref": "#/$defs/PermissionOption" + }, + "type": "array" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session ID for this request." + }, + "toolCall": { + "allOf": [ + { + "$ref": "#/$defs/ToolCallUpdate" + } + ], + "description": "Details about the tool call requiring permission." + } + }, + "required": [ + "sessionId", + "toolCall", + "options" + ], + "type": "object", + "x-method": "session/request_permission", + "x-side": "client" + }, + "RequestPermissionResponse": { + "description": "Response to a permission request.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "outcome": { + "allOf": [ + { + "$ref": "#/$defs/RequestPermissionOutcome" + } + ], + "description": "The user's decision on the permission request." + } + }, + "required": [ + "outcome" + ], + "type": "object", + "x-method": "session/request_permission", + "x-side": "client" + }, + "ResourceLink": { + "description": "A resource that the server is capable of reading, included in a prompt or tool call result.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "size": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + }, + "required": [ + "name", + "uri" + ], + "type": "object" + }, + "ResumeSessionRequest": { + "description": "Request parameters for resuming an existing session.\n\nResumes an existing session without returning previous messages (unlike `session/load`).\nThis is useful for agents that can resume sessions but don't implement full session loading.\n\nOnly available if the Agent supports the `sessionCapabilities.resume` capability.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "additionalDirectories": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional 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.", + "items": { + "type": "string" + }, + "type": "array" + }, + "cwd": { + "description": "The working directory for this session.", + "type": "string" + }, + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "items": { + "$ref": "#/$defs/McpServer" + }, + "type": "array" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to resume." + } + }, + "required": [ + "sessionId", + "cwd" + ], + "type": "object", + "x-method": "session/resume", + "x-side": "agent" + }, + "ResumeSessionResponse": { + "description": "Response from resuming an existing session.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "configOptions": { + "description": "Initial session configuration options if supported by the Agent.", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "type": [ + "array", + "null" + ] + }, + "models": { + "anyOf": [ + { + "$ref": "#/$defs/SessionModelState" + }, + { + "type": "null" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" + }, + "modes": { + "anyOf": [ + { + "$ref": "#/$defs/SessionModeState" + }, + { + "type": "null" + } + ], + "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + } + }, + "type": "object", + "x-method": "session/resume", + "x-side": "agent" + }, + "Role": { + "description": "The sender or recipient of messages and data in a conversation.", + "enum": [ + "assistant", + "user" + ], + "type": "string" + }, + "SelectedPermissionOutcome": { + "description": "The user selected one of the provided options.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "optionId": { + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionId" + } + ], + "description": "The ID of the option the user selected." + } + }, + "required": [ + "optionId" + ], + "type": "object" + }, + "SessionAdditionalDirectoriesCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for additional session directories support.\n\nBy supplying `{}` it means that the agent supports the `additionalDirectories` field on\nsupported session lifecycle requests and `session/list`.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "SessionCapabilities": { + "description": "Session capabilities supported by the agent.\n\nAs a baseline, all Agents **MUST** support `session/new`, `session/prompt`, `session/cancel`, and `session/update`.\n\nOptionally, they **MAY** support other session methods and notifications by specifying additional capabilities.\n\nNote: `session/load` is still handled by the top-level `load_session` capability. This will be unified in future versions of the protocol.\n\nSee protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "additionalDirectories": { + "anyOf": [ + { + "$ref": "#/$defs/SessionAdditionalDirectoriesCapabilities" + }, + { + "type": "null" + } + ], + "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 `additionalDirectories` on supported session lifecycle requests and `session/list`." + }, + "close": { + "anyOf": [ + { + "$ref": "#/$defs/SessionCloseCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent supports `session/close`." + }, + "fork": { + "anyOf": [ + { + "$ref": "#/$defs/SessionForkCapabilities" + }, + { + "type": "null" + } + ], + "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`." + }, + "list": { + "anyOf": [ + { + "$ref": "#/$defs/SessionListCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent supports `session/list`." + }, + "resume": { + "anyOf": [ + { + "$ref": "#/$defs/SessionResumeCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent supports `session/resume`." + } + }, + "type": "object" + }, + "SessionCloseCapabilities": { + "description": "Capabilities for the `session/close` method.\n\nBy supplying `{}` it means that the agent supports closing of sessions.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "SessionConfigBoolean": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA boolean on/off toggle session configuration option payload.", + "properties": { + "currentValue": { + "description": "The current value of the boolean option.", + "type": "boolean" + } + }, + "required": [ + "currentValue" + ], + "type": "object" + }, + "SessionConfigGroupId": { + "description": "Unique identifier for a session configuration option value group.", + "type": "string" + }, + "SessionConfigId": { + "description": "Unique identifier for a session configuration option.", + "type": "string" + }, + "SessionConfigOption": { + "description": "A session configuration option selector and its current state.", + "discriminator": { + "propertyName": "type" + }, + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigSelect" + } + ], + "description": "Single-value selector (dropdown).", + "properties": { + "type": { + "const": "select", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigBoolean" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nBoolean on/off toggle.", + "properties": { + "type": { + "const": "boolean", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + } + ], + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "category": { + "anyOf": [ + { + "$ref": "#/$defs/SessionConfigOptionCategory" + }, + { + "type": "null" + } + ], + "description": "Optional semantic category for this option (UX only)." + }, + "description": { + "description": "Optional description for the Client to display to the user.", + "type": [ + "string", + "null" + ] + }, + "id": { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigId" + } + ], + "description": "Unique identifier for the configuration option." + }, + "name": { + "description": "Human-readable label for the option.", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "SessionConfigOptionCategory": { + "anyOf": [ + { + "const": "mode", + "description": "Session mode selector.", + "type": "string" + }, + { + "const": "model", + "description": "Model selector.", + "type": "string" + }, + { + "const": "thought_level", + "description": "Thought/reasoning level selector.", + "type": "string" + }, + { + "description": "Unknown / uncategorized selector.", + "title": "other", + "type": "string" + } + ], + "description": "Semantic category for a session configuration option.\n\nThis is intended to help Clients distinguish broadly common selectors (e.g. model selector vs\nsession mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,\nplacement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown\ncategories gracefully.\n\nCategory names beginning with `_` are free for custom use, like other ACP extension methods.\nCategory names that do not begin with `_` are reserved for the ACP spec." + }, + "SessionConfigSelect": { + "description": "A single-value selector (dropdown) session configuration option payload.", + "properties": { + "currentValue": { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigValueId" + } + ], + "description": "The currently selected value." + }, + "options": { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigSelectOptions" + } + ], + "description": "The set of selectable options." + } + }, + "required": [ + "currentValue", + "options" + ], + "type": "object" + }, + "SessionConfigSelectGroup": { + "description": "A group of possible values for a session configuration option.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "group": { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigGroupId" + } + ], + "description": "Unique identifier for this group." + }, + "name": { + "description": "Human-readable label for this group.", + "type": "string" + }, + "options": { + "description": "The set of option values in this group.", + "items": { + "$ref": "#/$defs/SessionConfigSelectOption" + }, + "type": "array" + } + }, + "required": [ + "group", + "name", + "options" + ], + "type": "object" + }, + "SessionConfigSelectOption": { + "description": "A possible value for a session configuration option.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "description": { + "description": "Optional description for this option value.", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Human-readable label for this option value.", + "type": "string" + }, + "value": { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigValueId" + } + ], + "description": "Unique identifier for this option value." + } + }, + "required": [ + "value", + "name" + ], + "type": "object" + }, + "SessionConfigSelectOptions": { + "anyOf": [ + { + "description": "A flat list of options with no grouping.", + "items": { + "$ref": "#/$defs/SessionConfigSelectOption" + }, + "title": "Ungrouped", + "type": "array" + }, + { + "description": "A list of options grouped under headers.", + "items": { + "$ref": "#/$defs/SessionConfigSelectGroup" + }, + "title": "Grouped", + "type": "array" + } + ], + "description": "Possible values for a session configuration option." + }, + "SessionConfigValueId": { + "description": "Unique identifier for a session configuration option value.", + "type": "string" + }, + "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\nBy supplying `{}` it means that the agent supports forking of sessions.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "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/session-setup#session-id)", + "type": "string" + }, + "SessionInfo": { + "description": "Information about a session returned by session/list", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "additionalDirectories": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthoritative ordered additional workspace roots for this session. Each path must be absolute.\n\nWhen omitted or empty, there are no additional roots for the session.", + "items": { + "type": "string" + }, + "type": "array" + }, + "cwd": { + "description": "The working directory for this session. Must be an absolute path.", + "type": "string" + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "Unique identifier for the session" + }, + "title": { + "description": "Human-readable title for the session", + "type": [ + "string", + "null" + ] + }, + "updatedAt": { + "description": "ISO 8601 timestamp of last activity", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "sessionId", + "cwd" + ], + "type": "object" + }, + "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.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "title": { + "description": "Human-readable title for the session. Set to null to clear.", + "type": [ + "string", + "null" + ] + }, + "updatedAt": { + "description": "ISO 8601 timestamp of last activity. Set to null to clear.", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "SessionListCapabilities": { + "description": "Capabilities for the `session/list` method.\n\nBy supplying `{}` it means that the agent supports listing of sessions.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "SessionMode": { + "description": "A mode the agent can operate in.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "id": { + "$ref": "#/$defs/SessionModeId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "SessionModeId": { + "description": "Unique identifier for a Session Mode.", + "type": "string" + }, + "SessionModeState": { + "description": "The set of modes and the one currently active.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "availableModes": { + "description": "The set of modes that the Agent can operate in", + "items": { + "$ref": "#/$defs/SessionMode" + }, + "type": "array" + }, + "currentModeId": { + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ], + "description": "The current mode the Agent is in." + } + }, + "required": [ + "currentModeId", + "availableModes" + ], + "type": "object" + }, + "SessionModelState": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe set of models and the one currently active.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "availableModels": { + "description": "The set of models that the Agent can use", + "items": { + "$ref": "#/$defs/ModelInfo" + }, + "type": "array" + }, + "currentModelId": { + "allOf": [ + { + "$ref": "#/$defs/ModelId" + } + ], + "description": "The current model the Agent is in." + } + }, + "required": [ + "currentModelId", + "availableModels" + ], + "type": "object" + }, + "SessionNotification": { + "description": "Notification containing a session update from the agent.\n\nUsed to stream real-time progress and results during prompt processing.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session this update pertains to." + }, + "update": { + "allOf": [ + { + "$ref": "#/$defs/SessionUpdate" + } + ], + "description": "The actual update content." + } + }, + "required": [ + "sessionId", + "update" + ], + "type": "object", + "x-method": "session/update", + "x-side": "client" + }, + "SessionResumeCapabilities": { + "description": "Capabilities for the `session/resume` method.\n\nBy supplying `{}` it means that the agent supports resuming of sessions.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + }, + "SessionUpdate": { + "description": "Different types of updates that can be sent during session processing.\n\nThese updates provide real-time feedback about the agent's progress.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", + "discriminator": { + "propertyName": "sessionUpdate" + }, + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], + "description": "A chunk of the user's message being streamed.", + "properties": { + "sessionUpdate": { + "const": "user_message_chunk", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], + "description": "A chunk of the agent's response being streamed.", + "properties": { + "sessionUpdate": { + "const": "agent_message_chunk", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } + ], + "description": "A chunk of the agent's internal reasoning being streamed.", + "properties": { + "sessionUpdate": { + "const": "agent_thought_chunk", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/ToolCall" + } + ], + "description": "Notification that a new tool call has been initiated.", + "properties": { + "sessionUpdate": { + "const": "tool_call", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/ToolCallUpdate" + } + ], + "description": "Update on the status or results of a tool call.", + "properties": { + "sessionUpdate": { + "const": "tool_call_update", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/Plan" + } + ], + "description": "The agent's execution plan for complex tasks.\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", + "properties": { + "sessionUpdate": { + "const": "plan", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/AvailableCommandsUpdate" + } + ], + "description": "Available commands are ready or have changed", + "properties": { + "sessionUpdate": { + "const": "available_commands_update", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/CurrentModeUpdate" + } + ], + "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "properties": { + "sessionUpdate": { "const": "current_mode_update", "type": "string" } @@ -4067,216 +6951,537 @@ ], "type": "object" }, - { + { + "allOf": [ + { + "$ref": "#/$defs/ConfigOptionUpdate" + } + ], + "description": "Session configuration options have been updated.", + "properties": { + "sessionUpdate": { + "const": "config_option_update", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/SessionInfoUpdate" + } + ], + "description": "Session metadata has been updated (title, timestamps, custom metadata)", + "properties": { + "sessionUpdate": { + "const": "session_info_update", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/UsageUpdate" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nContext window and cost update for the session.", + "properties": { + "sessionUpdate": { + "const": "usage_update", + "type": "string" + } + }, + "required": [ + "sessionUpdate" + ], + "type": "object" + } + ] + }, + "SetProvidersRequest": { + "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.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "apiType": { + "allOf": [ + { + "$ref": "#/$defs/LlmProtocol" + } + ], + "description": "Protocol type for this provider." + }, + "baseUrl": { + "description": "Base URL for requests sent through this provider.", + "type": "string" + }, + "headers": { + "additionalProperties": { + "type": "string" + }, + "description": "Full headers map for this provider.\nMay include authorization, routing, or other integration-specific headers.", + "type": "object" + }, + "id": { + "description": "Provider id to configure.", + "type": "string" + } + }, + "required": [ + "id", + "apiType", + "baseUrl" + ], + "type": "object", + "x-method": "providers/set", + "x-side": "agent" + }, + "SetProvidersResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `providers/set`.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object", + "x-method": "providers/set", + "x-side": "agent" + }, + "SetSessionConfigOptionRequest": { + "anyOf": [ + { + "description": "A boolean value (`type: \"boolean\"`).", + "properties": { + "type": { + "const": "boolean", + "type": "string" + }, + "value": { + "description": "The boolean value.", + "type": "boolean" + } + }, + "required": [ + "type", + "value" + ], + "type": "object" + }, + { + "description": "A [`SessionConfigValueId`] string value.\n\nThis is the default when `type` is absent on the wire. Unknown `type`\nvalues with string payloads also gracefully deserialize into this\nvariant.", + "properties": { + "value": { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigValueId" + } + ], + "description": "The value ID." + } + }, + "required": [ + "value" + ], + "title": "value_id", + "type": "object" + } + ], + "description": "Request parameters for setting a session configuration option.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "configId": { + "allOf": [ + { + "$ref": "#/$defs/SessionConfigId" + } + ], + "description": "The ID of the configuration option to set." + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to set the configuration option for." + } + }, + "required": [ + "sessionId", + "configId" + ], + "type": "object", + "x-method": "session/set_config_option", + "x-side": "agent" + }, + "SetSessionConfigOptionResponse": { + "description": "Response to `session/set_config_option` method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "configOptions": { + "description": "The full set of configuration options and their current values.", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "type": "array" + } + }, + "required": [ + "configOptions" + ], + "type": "object", + "x-method": "session/set_config_option", + "x-side": "agent" + }, + "SetSessionModeRequest": { + "description": "Request parameters for setting a session mode.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "modeId": { "allOf": [ { - "$ref": "#/$defs/ConfigOptionUpdate" - } - ], - "description": "Session configuration options have been updated.", - "properties": { - "sessionUpdate": { - "const": "config_option_update", - "type": "string" + "$ref": "#/$defs/SessionModeId" } - }, - "required": [ - "sessionUpdate" ], - "type": "object" + "description": "The ID of the mode to set." }, - { + "sessionId": { "allOf": [ { - "$ref": "#/$defs/SessionInfoUpdate" - } - ], - "description": "Session metadata has been updated (title, timestamps, custom metadata)", - "properties": { - "sessionUpdate": { - "const": "session_info_update", - "type": "string" + "$ref": "#/$defs/SessionId" } - }, - "required": [ - "sessionUpdate" ], - "type": "object" + "description": "The ID of the session to set the mode for." + } + }, + "required": [ + "sessionId", + "modeId" + ], + "type": "object", + "x-method": "session/set_mode", + "x-side": "agent" + }, + "SetSessionModeResponse": { + "description": "Response to `session/set_mode` method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object", + "x-method": "session/set_mode", + "x-side": "agent" + }, + "SetSessionModelRequest": { + "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 a session model.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] }, - { + "modelId": { "allOf": [ { - "$ref": "#/$defs/UsageUpdate" + "$ref": "#/$defs/ModelId" } ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nContext window and cost update for the session.", - "properties": { - "sessionUpdate": { - "const": "usage_update", - "type": "string" + "description": "The ID of the model to set." + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" } - }, - "required": [ - "sessionUpdate" ], - "type": "object" + "description": "The ID of the session to set the model for." } - ] + }, + "required": [ + "sessionId", + "modelId" + ], + "type": "object", + "x-method": "session/set_model", + "x-side": "agent" }, - "SetSessionConfigOptionRequest": { - "anyOf": [ - { - "description": "A boolean value (`type: \"boolean\"`).", - "properties": { - "type": { - "const": "boolean", - "type": "string" + "SetSessionModelResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `session/set_model` method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + } + }, + "type": "object", + "x-method": "session/set_model", + "x-side": "agent" + }, + "StartNesRequest": { + "description": "Request to start an NES session.", + "properties": { + "_meta": { + "additionalProperties": true, + "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/extensibility)", + "type": [ + "object", + "null" + ] + }, + "repository": { + "anyOf": [ + { + "$ref": "#/$defs/NesRepository" }, - "value": { - "description": "The boolean value.", - "type": "boolean" + { + "type": "null" } - }, - "required": [ - "type", - "value" ], - "type": "object" + "description": "Repository metadata, if the workspace is a git repository." }, - { - "description": "A [`SessionConfigValueId`] string value.\n\nThis is the default when `type` is absent on the wire. Unknown `type`\nvalues with string payloads also gracefully deserialize into this\nvariant.", - "properties": { - "value": { - "allOf": [ - { - "$ref": "#/$defs/SessionConfigValueId" - } - ], - "description": "The value ID." - } + "workspaceFolders": { + "description": "The workspace folders.", + "items": { + "$ref": "#/$defs/WorkspaceFolder" }, - "required": [ - "value" - ], - "title": "value_id", - "type": "object" + "type": [ + "array", + "null" + ] + }, + "workspaceUri": { + "description": "The root URI of the workspace.", + "type": [ + "string", + "null" + ] } - ], - "description": "Request parameters for setting a session configuration option.", + }, + "type": "object", + "x-method": "nes/start", + "x-side": "agent" + }, + "StartNesResponse": { + "description": "Response to `nes/start`.", "properties": { "_meta": { "additionalProperties": true, "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/extensibility)", "type": [ - "object", + "object", + "null" + ] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The session ID for the newly started NES session." + } + }, + "required": [ + "sessionId" + ], + "type": "object", + "x-method": "nes/start", + "x-side": "agent" + }, + "StopReason": { + "description": "Reasons why an agent stops processing a prompt turn.\n\nSee protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)", + "oneOf": [ + { + "const": "end_turn", + "description": "The turn ended successfully.", + "type": "string" + }, + { + "const": "max_tokens", + "description": "The turn ended because the agent reached the maximum number of tokens.", + "type": "string" + }, + { + "const": "max_turn_requests", + "description": "The turn ended because the agent reached the maximum number of allowed\nagent requests between user turns.", + "type": "string" + }, + { + "const": "refusal", + "description": "The turn ended because the agent refused to continue. The user prompt\nand everything that comes after it won't be included in the next\nprompt, so this should be reflected in the UI.", + "type": "string" + }, + { + "const": "cancelled", + "description": "The turn was cancelled by the client via `session/cancel`.\n\nThis stop reason MUST be returned when the client sends a `session/cancel`\nnotification, even if the cancellation causes exceptions in underlying operations.\nAgents should catch these exceptions and return this semantically meaningful\nresponse to confirm successful cancellation.", + "type": "string" + } + ] + }, + "StringFormat": { + "description": "String format types for string properties in elicitation schemas.", + "oneOf": [ + { + "const": "email", + "description": "Email address format.", + "type": "string" + }, + { + "const": "uri", + "description": "URI format.", + "type": "string" + }, + { + "const": "date", + "description": "Date format (YYYY-MM-DD).", + "type": "string" + }, + { + "const": "date-time", + "description": "Date-time format (ISO 8601).", + "type": "string" + } + ] + }, + "StringPropertySchema": { + "description": "Schema for string properties in an elicitation form.\n\nWhen `enum` or `oneOf` is set, this represents a single-select enum\nwith `\"type\": \"string\"`.", + "properties": { + "default": { + "description": "Default value.", + "type": [ + "string", + "null" + ] + }, + "description": { + "description": "Human-readable description.", + "type": [ + "string", "null" ] }, - "configId": { - "allOf": [ - { - "$ref": "#/$defs/SessionConfigId" - } - ], - "description": "The ID of the configuration option to set." + "enum": { + "description": "Enum values for untitled single-select enums.", + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] }, - "sessionId": { - "allOf": [ + "format": { + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/StringFormat" + }, + { + "type": "null" } ], - "description": "The ID of the session to set the configuration option for." - } - }, - "required": [ - "sessionId", - "configId" - ], - "type": "object", - "x-method": "session/set_config_option", - "x-side": "agent" - }, - "SetSessionConfigOptionResponse": { - "description": "Response to `session/set_config_option` method.", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", + "description": "String format." + }, + "maxLength": { + "description": "Maximum string length.", + "format": "uint32", + "minimum": 0, "type": [ - "object", + "integer", "null" ] }, - "configOptions": { - "description": "The full set of configuration options and their current values.", + "minLength": { + "description": "Minimum string length.", + "format": "uint32", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "oneOf": { + "description": "Titled enum options for titled single-select enums.", "items": { - "$ref": "#/$defs/SessionConfigOption" + "$ref": "#/$defs/EnumOption" }, - "type": "array" - } - }, - "required": [ - "configOptions" - ], - "type": "object", - "x-method": "session/set_config_option", - "x-side": "agent" - }, - "SetSessionModeRequest": { - "description": "Request parameters for setting a session mode.", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", "type": [ - "object", + "array", "null" ] }, - "modeId": { - "allOf": [ - { - "$ref": "#/$defs/SessionModeId" - } - ], - "description": "The ID of the mode to set." + "pattern": { + "description": "Pattern the string must match.", + "type": [ + "string", + "null" + ] }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "The ID of the session to set the mode for." - } - }, - "required": [ - "sessionId", - "modeId" - ], - "type": "object", - "x-method": "session/set_mode", - "x-side": "agent" - }, - "SetSessionModeResponse": { - "description": "Response to `session/set_mode` method.", - "properties": { - "_meta": { - "additionalProperties": true, - "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/extensibility)", + "title": { + "description": "Optional title for the property.", "type": [ - "object", + "string", "null" ] } }, - "type": "object", - "x-method": "session/set_mode", - "x-side": "agent" + "type": "object" }, - "SetSessionModelRequest": { - "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 a session model.", + "SuggestNesRequest": { + "description": "Request for a code suggestion.", "properties": { "_meta": { "additionalProperties": true, @@ -4286,13 +7491,35 @@ "null" ] }, - "modelId": { + "context": { + "anyOf": [ + { + "$ref": "#/$defs/NesSuggestContext" + }, + { + "type": "null" + } + ], + "description": "Context for the suggestion, included based on agent capabilities." + }, + "position": { "allOf": [ { - "$ref": "#/$defs/ModelId" + "$ref": "#/$defs/Position" } ], - "description": "The ID of the model to set." + "description": "The current cursor position." + }, + "selection": { + "anyOf": [ + { + "$ref": "#/$defs/Range" + }, + { + "type": "null" + } + ], + "description": "The current text selection range, if any." }, "sessionId": { "allOf": [ @@ -4300,19 +7527,39 @@ "$ref": "#/$defs/SessionId" } ], - "description": "The ID of the session to set the model for." + "description": "The session ID for this request." + }, + "triggerKind": { + "allOf": [ + { + "$ref": "#/$defs/NesTriggerKind" + } + ], + "description": "What triggered this suggestion request." + }, + "uri": { + "description": "The URI of the document to suggest for.", + "type": "string" + }, + "version": { + "description": "The version number of the document.", + "format": "int64", + "type": "integer" } }, "required": [ "sessionId", - "modelId" + "uri", + "version", + "position", + "triggerKind" ], "type": "object", - "x-method": "session/set_model", + "x-method": "nes/suggest", "x-side": "agent" }, - "SetSessionModelResponse": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `session/set_model` method.", + "SuggestNesResponse": { + "description": "Response to `nes/suggest`.", "properties": { "_meta": { "additionalProperties": true, @@ -4321,42 +7568,22 @@ "object", "null" ] + }, + "suggestions": { + "description": "The list of suggestions.", + "items": { + "$ref": "#/$defs/NesSuggestion" + }, + "type": "array" } }, + "required": [ + "suggestions" + ], "type": "object", - "x-method": "session/set_model", + "x-method": "nes/suggest", "x-side": "agent" }, - "StopReason": { - "description": "Reasons why an agent stops processing a prompt turn.\n\nSee protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)", - "oneOf": [ - { - "const": "end_turn", - "description": "The turn ended successfully.", - "type": "string" - }, - { - "const": "max_tokens", - "description": "The turn ended because the agent reached the maximum number of tokens.", - "type": "string" - }, - { - "const": "max_turn_requests", - "description": "The turn ended because the agent reached the maximum number of allowed\nagent requests between user turns.", - "type": "string" - }, - { - "const": "refusal", - "description": "The turn ended because the agent refused to continue. The user prompt\nand everything that comes after it won't be included in the next\nprompt, so this should be reflected in the UI.", - "type": "string" - }, - { - "const": "cancelled", - "description": "The turn was cancelled by the client via `session/cancel`.\n\nThis stop reason MUST be returned when the client sends a `session/cancel`\nnotification, even if the cancellation causes exceptions in underlying operations.\nAgents should catch these exceptions and return this semantically meaningful\nresponse to confirm successful cancellation.", - "type": "string" - } - ] - }, "Terminal": { "description": "Embed a terminal created with `terminal/create` by its id.\n\nThe terminal must be added before calling `terminal/release`.\n\nSee protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminals)", "properties": { @@ -4508,6 +7735,45 @@ ], "type": "object" }, + "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.", + "properties": { + "range": { + "anyOf": [ + { + "$ref": "#/$defs/Range" + }, + { + "type": "null" + } + ], + "description": "The range of the document that changed. If `None`, the entire content is replaced." + }, + "text": { + "description": "The new text for the range, or the full document content if `range` is `None`.", + "type": "string" + } + }, + "required": [ + "text" + ], + "type": "object" + }, + "TextDocumentSyncKind": { + "description": "How the agent wants document changes delivered.", + "oneOf": [ + { + "const": "full", + "description": "Client sends the entire file content on each change.", + "type": "string" + }, + { + "const": "incremental", + "description": "Client sends only the changed ranges.", + "type": "string" + } + ] + }, "TextResourceContents": { "description": "Text-based resource contents.", "properties": { @@ -4538,6 +7804,22 @@ ], "type": "object" }, + "TitledMultiSelectItems": { + "description": "Items definition for titled multi-select enum properties.", + "properties": { + "anyOf": { + "description": "Titled enum options.", + "items": { + "$ref": "#/$defs/EnumOption" + }, + "type": "array" + } + }, + "required": [ + "anyOf" + ], + "type": "object" + }, "ToolCall": { "description": "Represents 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\nSee protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls)", "properties": { @@ -4881,6 +8163,31 @@ ], "type": "object" }, + "UntitledMultiSelectItems": { + "description": "Items definition for untitled multi-select enum properties.", + "properties": { + "enum": { + "description": "Allowed enum values.", + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "allOf": [ + { + "$ref": "#/$defs/ElicitationStringType" + } + ], + "description": "Item type discriminator. Must be `\"string\"`." + } + }, + "required": [ + "type", + "enum" + ], + "type": "object" + }, "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 a prompt turn.", "properties": { @@ -5042,6 +8349,24 @@ "x-method": "terminal/wait_for_exit", "x-side": "client" }, + "WorkspaceFolder": { + "description": "A workspace folder.", + "properties": { + "name": { + "description": "The display name of the folder.", + "type": "string" + }, + "uri": { + "description": "The URI of the folder.", + "type": "string" + } + }, + "required": [ + "uri", + "name" + ], + "type": "object" + }, "WriteTextFileRequest": { "description": "Request to write content to a text file.\n\nOnly available if the client supports the `fs.writeTextFile` capability.", "properties": { diff --git a/scripts/gen_schema.py b/scripts/gen_schema.py index ad9c6fb..9a181c9 100644 --- a/scripts/gen_schema.py +++ b/scripts/gen_schema.py @@ -71,6 +71,24 @@ "ToolCallContent1": "ContentToolCallContent", "ToolCallContent2": "FileEditToolCallContent", "ToolCallContent3": "TerminalToolCallContent", + "CreateElicitationRequest1": "CreateFormElicitationRequest", + "CreateElicitationRequest2": "CreateUrlElicitationRequest", + "CreateElicitationResponse1": "AcceptElicitationResponse", + "CreateElicitationResponse2": "DeclineElicitationResponse", + "CreateElicitationResponse3": "CancelElicitationResponse", + "ElicitationFormMode1": "ElicitationFormSessionMode", + "ElicitationFormMode2": "ElicitationFormRequestMode", + "ElicitationPropertySchema1": "ElicitationStringPropertySchema", + "ElicitationPropertySchema2": "ElicitationNumberPropertySchema", + "ElicitationPropertySchema3": "ElicitationIntegerPropertySchema", + "ElicitationPropertySchema4": "ElicitationBooleanPropertySchema", + "ElicitationPropertySchema5": "ElicitationMultiSelectPropertySchema", + "ElicitationUrlMode1": "ElicitationUrlSessionMode", + "ElicitationUrlMode2": "ElicitationUrlRequestMode", + "NesSuggestion1": "NesEditSuggestionVariant", + "NesSuggestion2": "NesJumpSuggestionVariant", + "NesSuggestion3": "NesRenameSuggestionVariant", + "NesSuggestion4": "NesSearchAndReplaceSuggestionVariant", } ENUM_LITERAL_MAP: dict[str, tuple[str, ...]] = { diff --git a/src/acp/client/connection.py b/src/acp/client/connection.py index bb8fdc2..024884a 100644 --- a/src/acp/client/connection.py +++ b/src/acp/client/connection.py @@ -98,13 +98,22 @@ async def initialize( @param_model(NewSessionRequest) async def new_session( - self, cwd: str, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any + self, + cwd: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, ) -> NewSessionResponse: resolved_mcp_servers = mcp_servers or [] return await request_model( self._conn, AGENT_METHODS["session_new"], - NewSessionRequest(cwd=cwd, mcp_servers=resolved_mcp_servers, field_meta=kwargs or None), + NewSessionRequest( + cwd=cwd, + additional_directories=additional_directories, + mcp_servers=resolved_mcp_servers, + field_meta=kwargs or None, + ), NewSessionResponse, ) @@ -113,6 +122,7 @@ async def load_session( self, cwd: str, session_id: str, + additional_directories: list[str] | None = None, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> LoadSessionResponse: @@ -121,19 +131,29 @@ async def load_session( self._conn, AGENT_METHODS["session_load"], LoadSessionRequest( - cwd=cwd, mcp_servers=resolved_mcp_servers, session_id=session_id, field_meta=kwargs or None + cwd=cwd, + additional_directories=additional_directories, + mcp_servers=resolved_mcp_servers, + session_id=session_id, + field_meta=kwargs or None, ), LoadSessionResponse, ) @param_model(ListSessionsRequest) async def list_sessions( - self, cursor: str | None = None, cwd: str | None = None, **kwargs: Any + self, + additional_directories: list[str] | None = None, + cursor: str | None = None, + cwd: str | None = None, + **kwargs: Any, ) -> ListSessionsResponse: return await request_model_from_dict( self._conn, AGENT_METHODS["session_list"], - ListSessionsRequest(cursor=cursor, cwd=cwd, field_meta=kwargs or None), + ListSessionsRequest( + additional_directories=additional_directories, cursor=cursor, cwd=cwd, field_meta=kwargs or None + ), ListSessionsResponse, ) @@ -161,25 +181,15 @@ async def set_config_option( ) -> SetSessionConfigOptionResponse: request = ( SetSessionConfigOptionBooleanRequest( - config_id=config_id, - session_id=session_id, - type="boolean", - value=value, - field_meta=kwargs or None, + config_id=config_id, session_id=session_id, type="boolean", value=value, field_meta=kwargs or None ) if isinstance(value, bool) else SetSessionConfigOptionSelectRequest( - config_id=config_id, - session_id=session_id, - value=value, - field_meta=kwargs or None, + config_id=config_id, session_id=session_id, value=value, field_meta=kwargs or None ) ) return await request_model_from_dict( - self._conn, - AGENT_METHODS["session_set_config_option"], - request, - SetSessionConfigOptionResponse, + self._conn, AGENT_METHODS["session_set_config_option"], request, SetSessionConfigOptionResponse ) @param_model(AuthenticateRequest) @@ -208,12 +218,7 @@ async def prompt( return await request_model( self._conn, AGENT_METHODS["session_prompt"], - PromptRequest( - prompt=prompt, - session_id=session_id, - message_id=message_id, - field_meta=kwargs or None, - ), + PromptRequest(prompt=prompt, session_id=session_id, message_id=message_id, field_meta=kwargs or None), PromptResponse, ) @@ -222,13 +227,20 @@ async def fork_session( self, cwd: str, session_id: str, + additional_directories: list[str] | None = None, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> ForkSessionResponse: return await request_model( self._conn, AGENT_METHODS["session_fork"], - ForkSessionRequest(session_id=session_id, cwd=cwd, mcp_servers=mcp_servers, field_meta=kwargs or None), + ForkSessionRequest( + session_id=session_id, + cwd=cwd, + additional_directories=additional_directories, + mcp_servers=mcp_servers, + field_meta=kwargs or None, + ), ForkSessionResponse, ) @@ -237,13 +249,20 @@ async def resume_session( self, cwd: str, session_id: str, + additional_directories: list[str] | None = None, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> ResumeSessionResponse: return await request_model( self._conn, AGENT_METHODS["session_resume"], - ResumeSessionRequest(session_id=session_id, cwd=cwd, mcp_servers=mcp_servers, field_meta=kwargs or None), + ResumeSessionRequest( + session_id=session_id, + cwd=cwd, + additional_directories=additional_directories, + mcp_servers=mcp_servers, + field_meta=kwargs or None, + ), ResumeSessionResponse, ) diff --git a/src/acp/interfaces.py b/src/acp/interfaces.py index 2decdb2..0568731 100644 --- a/src/acp/interfaces.py +++ b/src/acp/interfaces.py @@ -157,7 +157,11 @@ async def initialize( @param_model(NewSessionRequest) async def new_session( - self, cwd: str, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any + self, + cwd: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, ) -> NewSessionResponse: ... @param_model(LoadSessionRequest) @@ -165,13 +169,18 @@ async def load_session( self, cwd: str, session_id: str, + additional_directories: list[str] | None = None, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> LoadSessionResponse | None: ... @param_model(ListSessionsRequest) async def list_sessions( - self, cursor: str | None = None, cwd: str | None = None, **kwargs: Any + self, + additional_directories: list[str] | None = None, + cursor: str | None = None, + cwd: str | None = None, + **kwargs: Any, ) -> ListSessionsResponse: ... @param_model(SetSessionModeRequest) @@ -210,6 +219,7 @@ async def fork_session( self, cwd: str, session_id: str, + additional_directories: list[str] | None = None, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> ForkSessionResponse: ... @@ -219,6 +229,7 @@ async def resume_session( self, cwd: str, session_id: str, + additional_directories: list[str] | None = None, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> ResumeSessionResponse: ... diff --git a/src/acp/meta.py b/src/acp/meta.py index bc57869..ed9a25f 100644 --- a/src/acp/meta.py +++ b/src/acp/meta.py @@ -1,8 +1,22 @@ # Generated from schema/meta.json. Do not edit by hand. -# Schema ref: refs/tags/v0.11.2 +# Schema ref: refs/tags/v0.12.2 AGENT_METHODS = { "authenticate": "authenticate", + "document_did_change": "document/didChange", + "document_did_close": "document/didClose", + "document_did_focus": "document/didFocus", + "document_did_open": "document/didOpen", + "document_did_save": "document/didSave", "initialize": "initialize", + "logout": "logout", + "nes_accept": "nes/accept", + "nes_close": "nes/close", + "nes_reject": "nes/reject", + "nes_start": "nes/start", + "nes_suggest": "nes/suggest", + "providers_disable": "providers/disable", + "providers_list": "providers/list", + "providers_set": "providers/set", "session_cancel": "session/cancel", "session_close": "session/close", "session_fork": "session/fork", @@ -16,6 +30,8 @@ "session_set_model": "session/set_model", } CLIENT_METHODS = { + "elicitation_complete": "elicitation/complete", + "elicitation_create": "elicitation/create", "fs_read_text_file": "fs/read_text_file", "fs_write_text_file": "fs/write_text_file", "session_request_permission": "session/request_permission", diff --git a/src/acp/schema.py b/src/acp/schema.py index 32031c4..e942245 100644 --- a/src/acp/schema.py +++ b/src/acp/schema.py @@ -1,12 +1,12 @@ # Generated from schema/schema.json. Do not edit by hand. -# Schema ref: refs/tags/v0.11.2 +# Schema ref: refs/tags/v0.12.2 from __future__ import annotations from enum import Enum from typing import Annotated, Any, Dict, List, Literal, Optional, Union -from pydantic import BaseModel as _BaseModel, Field, RootModel, ConfigDict +from pydantic import AnyUrl, BaseModel as _BaseModel, Field, RootModel, ConfigDict PermissionOptionKind = Literal["allow_once", "allow_always", "reject_once", "reject_always"] PlanEntryPriority = Literal["high", "medium", "low"] @@ -245,6 +245,30 @@ class BlobResourceContents(BaseModel): uri: str +class BooleanPropertySchema(BaseModel): + # Default value. + default: Annotated[Optional[bool], Field(description="Default value.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None + + +class CloseNesResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + class CloseSessionResponse(BaseModel): # 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 @@ -267,6 +291,38 @@ class Cost(BaseModel): currency: Annotated[str, Field(description='ISO 4217 currency code (e.g., "USD", "EUR").')] +class DeclineElicitationResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + action: Literal["decline"] + + +class CancelElicitationResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + action: Literal["cancel"] + + class CreateTerminalResponse(BaseModel): # 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 @@ -314,6 +370,91 @@ class Diff(BaseModel): path: Annotated[str, Field(description="The file path being modified.")] +class DisableProvidersRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Provider id to disable. + id: Annotated[str, Field(description="Provider id to disable.")] + + +class DisableProvidersResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + +class ElicitationAcceptAction(BaseModel): + # The user-provided content, if any, as an object matching the requested schema. + content: Annotated[ + Optional[Dict[str, Any]], + Field(description="The user-provided content, if any, as an object matching the requested schema."), + ] = None + + +class ElicitationContentValue(RootModel[Union[str, int, float, bool, List[str]]]): + root: Union[str, int, float, bool, List[str]] + + +class ElicitationFormCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + +class ElicitationBooleanPropertySchema(BooleanPropertySchema): + type: Literal["boolean"] + + +class ElicitationUrlCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + +class EnumOption(BaseModel): + # The constant value for this option. + const: Annotated[str, Field(description="The constant value for this option.")] + # Human-readable title for this option. + title: Annotated[str, Field(description="Human-readable title for this option.")] + + class EnvVariable(BaseModel): # 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 @@ -424,6 +565,19 @@ class Implementation(BaseModel): ] +class IntegerPropertySchema(BaseModel): + # Default value. + default: Annotated[Optional[int], Field(description="Default value.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # Maximum value (inclusive). + maximum: Annotated[Optional[int], Field(description="Maximum value (inclusive).")] = None + # Minimum value (inclusive). + minimum: Annotated[Optional[int], Field(description="Minimum value (inclusive).")] = None + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None + + class KillTerminalResponse(BaseModel): # 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 @@ -439,6 +593,21 @@ class KillTerminalResponse(BaseModel): ] = None +class ListProvidersRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + class ListSessionsRequest(BaseModel): # 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 @@ -452,6 +621,21 @@ class ListSessionsRequest(BaseModel): 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/extensibility)", ), ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Filter sessions by the exact ordered additional workspace roots. Each path must be absolute. + # + # This filter applies only when the field is present and non-empty. When + # omitted or empty, no additional-root filter is applied. + additional_directories: Annotated[ + Optional[List[str]], + Field( + alias="additionalDirectories", + 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 the exact ordered additional workspace roots. Each path must be absolute.\n\nThis filter applies only when the field is present and non-empty. When\nomitted or empty, no additional-root filter is applied.", + ), + ] = None # Opaque cursor token from a previous response's nextCursor field for cursor-based pagination cursor: Annotated[ Optional[str], @@ -466,6 +650,51 @@ class ListSessionsRequest(BaseModel): ] = None +class LogoutCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + +class LogoutRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + +class LogoutResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + class McpCapabilities(BaseModel): # 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 @@ -583,7 +812,7 @@ class ModelInfo(BaseModel): name: Annotated[str, Field(description="Human-readable name of the model.")] -class PromptCapabilities(BaseModel): +class NesDiagnosticsCapabilities(BaseModel): # 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. @@ -596,24 +825,24 @@ class PromptCapabilities(BaseModel): 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/extensibility)", ), ] = None - # Agent supports [`ContentBlock::Audio`]. - audio: Annotated[Optional[bool], Field(description="Agent supports [`ContentBlock::Audio`].")] = False - # Agent supports embedded context in `session/prompt` requests. + + +class NesDocumentDidCloseCapabilities(BaseModel): + # 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. # - # When enabled, the Client is allowed to include [`ContentBlock::Resource`] - # in prompt requests for pieces of context that are referenced in the message. - embedded_context: Annotated[ - Optional[bool], + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], Field( - alias="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.", + alias="_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/extensibility)", ), - ] = False - # Agent supports [`ContentBlock::Image`]. - image: Annotated[Optional[bool], Field(description="Agent supports [`ContentBlock::Image`].")] = False + ] = None -class ReadTextFileResponse(BaseModel): +class NesDocumentDidFocusCapabilities(BaseModel): # 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. @@ -626,10 +855,9 @@ class ReadTextFileResponse(BaseModel): 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/extensibility)", ), ] = None - content: str -class ReleaseTerminalResponse(BaseModel): +class NesDocumentDidOpenCapabilities(BaseModel): # 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. @@ -644,16 +872,7 @@ class ReleaseTerminalResponse(BaseModel): ] = None -class DeniedOutcome(BaseModel): - outcome: Literal["cancelled"] - - -class Role(Enum): - assistant = "assistant" - user = "user" - - -class SelectedPermissionOutcome(BaseModel): +class NesDocumentDidSaveCapabilities(BaseModel): # 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. @@ -666,14 +885,9 @@ class SelectedPermissionOutcome(BaseModel): 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/extensibility)", ), ] = None - # The ID of the option the user selected. - option_id: Annotated[ - str, - Field(alias="optionId", description="The ID of the option the user selected."), - ] -class SessionCloseCapabilities(BaseModel): +class NesEditHistoryCapabilities(BaseModel): # 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. @@ -686,17 +900,48 @@ class SessionCloseCapabilities(BaseModel): 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/extensibility)", ), ] = None + # Maximum number of edit history entries the agent can use. + max_count: Annotated[ + Optional[int], + Field( + alias="maxCount", + description="Maximum number of edit history entries the agent can use.", + ge=0, + ), + ] = None -class SessionConfigBoolean(BaseModel): - # The current value of the boolean option. - current_value: Annotated[ - bool, - Field(alias="currentValue", description="The current value of the boolean option."), +class NesEditHistoryEntry(BaseModel): + # A diff representing the edit. + diff: Annotated[str, Field(description="A diff representing the edit.")] + # The URI of the edited file. + uri: Annotated[str, Field(description="The URI of the edited file.")] + + +class NesExcerpt(BaseModel): + # The end line of the excerpt (zero-based). + end_line: Annotated[ + int, + Field( + alias="endLine", + description="The end line of the excerpt (zero-based).", + ge=0, + ), + ] + # The start line of the excerpt (zero-based). + start_line: Annotated[ + int, + Field( + alias="startLine", + description="The start line of the excerpt (zero-based).", + ge=0, + ), ] + # The text content of the excerpt. + text: Annotated[str, Field(description="The text content of the excerpt.")] -class SessionForkCapabilities(BaseModel): +class NesJumpCapabilities(BaseModel): # 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. @@ -711,7 +956,7 @@ class SessionForkCapabilities(BaseModel): ] = None -class SessionInfo(BaseModel): +class NesOpenFilesCapabilities(BaseModel): # 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. @@ -724,23 +969,18 @@ class SessionInfo(BaseModel): 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/extensibility)", ), ] = None - # The working directory for this session. Must be an absolute path. - cwd: Annotated[ - str, - Field(description="The working directory for this session. Must be an absolute path."), - ] - # Unique identifier for the session - session_id: Annotated[str, Field(alias="sessionId", description="Unique identifier for the session")] - # Human-readable title for the session - title: Annotated[Optional[str], Field(description="Human-readable title for the session")] = None - # ISO 8601 timestamp of last activity - updated_at: Annotated[ - Optional[str], - Field(alias="updatedAt", description="ISO 8601 timestamp of last activity"), - ] = None -class _SessionInfoUpdate(BaseModel): +class NesRecentFile(BaseModel): + # The language identifier. + language_id: Annotated[str, Field(alias="languageId", description="The language identifier.")] + # The full text content of the file. + text: Annotated[str, Field(description="The full text content of the file.")] + # The URI of the file. + uri: Annotated[str, Field(description="The URI of the file.")] + + +class NesRecentFilesCapabilities(BaseModel): # 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. @@ -753,22 +993,25 @@ class _SessionInfoUpdate(BaseModel): 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/extensibility)", ), ] = None - # Human-readable title for the session. Set to null to clear. - title: Annotated[ - Optional[str], - Field(description="Human-readable title for the session. Set to null to clear."), - ] = None - # ISO 8601 timestamp of last activity. Set to null to clear. - updated_at: Annotated[ - Optional[str], + # Maximum number of recent files the agent can use. + max_count: Annotated[ + Optional[int], Field( - alias="updatedAt", - description="ISO 8601 timestamp of last activity. Set to null to clear.", + alias="maxCount", + description="Maximum number of recent files the agent can use.", + ge=0, ), ] = None -class SessionListCapabilities(BaseModel): +class NesRelatedSnippet(BaseModel): + # The code excerpts. + excerpts: Annotated[List[NesExcerpt], Field(description="The code excerpts.")] + # The URI of the file containing the snippets. + uri: Annotated[str, Field(description="The URI of the file containing the snippets.")] + + +class NesRelatedSnippetsCapabilities(BaseModel): # 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. @@ -783,7 +1026,7 @@ class SessionListCapabilities(BaseModel): ] = None -class SessionModelState(BaseModel): +class NesRenameCapabilities(BaseModel): # 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. @@ -796,22 +1039,18 @@ class SessionModelState(BaseModel): 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/extensibility)", ), ] = None - # The set of models that the Agent can use - available_models: Annotated[ - List[ModelInfo], - Field( - alias="availableModels", - description="The set of models that the Agent can use", - ), - ] - # The current model the Agent is in. - current_model_id: Annotated[ - str, - Field(alias="currentModelId", description="The current model the Agent is in."), - ] -class SessionResumeCapabilities(BaseModel): +class NesRepository(BaseModel): + # The repository name. + name: Annotated[str, Field(description="The repository name.")] + # The repository owner. + owner: Annotated[str, Field(description="The repository owner.")] + # The remote URL of the repository. + remote_url: Annotated[str, Field(alias="remoteUrl", description="The remote URL of the repository.")] + + +class NesSearchAndReplaceCapabilities(BaseModel): # 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. @@ -826,11 +1065,30 @@ class SessionResumeCapabilities(BaseModel): ] = None -class SessionInfoUpdate(_SessionInfoUpdate): - session_update: Annotated[Literal["session_info_update"], Field(alias="sessionUpdate")] +class NesSearchAndReplaceSuggestion(BaseModel): + # Unique identifier for accept/reject tracking. + id: Annotated[str, Field(description="Unique identifier for accept/reject tracking.")] + # Whether `search` is a regular expression. Defaults to `false`. + is_regex: Annotated[ + Optional[bool], + Field( + alias="isRegex", + description="Whether `search` is a regular expression. Defaults to `false`.", + ), + ] = None + # The replacement text. + replace: Annotated[str, Field(description="The replacement text.")] + # The text or pattern to find. + search: Annotated[str, Field(description="The text or pattern to find.")] + # The file URI to search within. + uri: Annotated[str, Field(description="The file URI to search within.")] -class SetSessionConfigOptionBooleanRequest(BaseModel): +class NesSearchAndReplaceSuggestionVariant(NesSearchAndReplaceSuggestion): + kind: Literal["searchAndReplace"] + + +class NesUserActionsCapabilities(BaseModel): # 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. @@ -843,25 +1101,41 @@ class SetSessionConfigOptionBooleanRequest(BaseModel): 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/extensibility)", ), ] = None - # The ID of the configuration option to set. - config_id: Annotated[ - str, - Field(alias="configId", description="The ID of the configuration option to set."), - ] - # The ID of the session to set the configuration option for. - session_id: Annotated[ - str, + # Maximum number of user actions the agent can use. + max_count: Annotated[ + Optional[int], Field( - alias="sessionId", - description="The ID of the session to set the configuration option for.", + alias="maxCount", + description="Maximum number of user actions the agent can use.", + ge=0, ), + ] = None + + +class NumberPropertySchema(BaseModel): + # Default value. + default: Annotated[Optional[float], Field(description="Default value.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # Maximum value (inclusive). + maximum: Annotated[Optional[float], Field(description="Maximum value (inclusive).")] = None + # Minimum value (inclusive). + minimum: Annotated[Optional[float], Field(description="Minimum value (inclusive).")] = None + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None + + +class Position(BaseModel): + # Zero-based character offset (encoding-dependent). + character: Annotated[ + int, + Field(description="Zero-based character offset (encoding-dependent).", ge=0), ] - type: Literal["boolean"] - # The boolean value. - value: Annotated[bool, Field(description="The boolean value.")] + # Zero-based line number. + line: Annotated[int, Field(description="Zero-based line number.", ge=0)] -class SetSessionConfigOptionSelectRequest(BaseModel): +class PromptCapabilities(BaseModel): # 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. @@ -874,24 +1148,37 @@ class SetSessionConfigOptionSelectRequest(BaseModel): 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/extensibility)", ), ] = None - # The ID of the configuration option to set. - config_id: Annotated[ + # Agent supports [`ContentBlock::Audio`]. + audio: Annotated[Optional[bool], Field(description="Agent supports [`ContentBlock::Audio`].")] = False + # 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. + embedded_context: Annotated[ + Optional[bool], + Field( + alias="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.", + ), + ] = False + # Agent supports [`ContentBlock::Image`]. + image: Annotated[Optional[bool], Field(description="Agent supports [`ContentBlock::Image`].")] = False + + +class ProviderCurrentConfig(BaseModel): + # Protocol currently used by this provider. + api_type: Annotated[ str, - Field(alias="configId", description="The ID of the configuration option to set."), + Field(alias="apiType", description="Protocol currently used by this provider."), ] - # The ID of the session to set the configuration option for. - session_id: Annotated[ + # Base URL currently used by this provider. + base_url: Annotated[ str, - Field( - alias="sessionId", - description="The ID of the session to set the configuration option for.", - ), + Field(alias="baseUrl", description="Base URL currently used by this provider."), ] - # The value ID. - value: Annotated[str, Field(description="The value ID.")] -class SetSessionModeRequest(BaseModel): +class ProviderInfo(BaseModel): # 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. @@ -904,16 +1191,27 @@ class SetSessionModeRequest(BaseModel): 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/extensibility)", ), ] = None - # The ID of the mode to set. - mode_id: Annotated[str, Field(alias="modeId", description="The ID of the mode to set.")] - # The ID of the session to set the mode for. - session_id: Annotated[ - str, - Field(alias="sessionId", description="The ID of the session to set the mode for."), + # Current effective non-secret routing config. + # Null or omitted means provider is disabled. + current: Annotated[ + Optional[ProviderCurrentConfig], + Field(description="Current effective non-secret routing config.\nNull or omitted means provider is disabled."), + ] = None + # Provider identifier, for example "main" or "openai". + id: Annotated[str, Field(description='Provider identifier, for example "main" or "openai".')] + # Whether this provider is mandatory and cannot be disabled via `providers/disable`. + # If true, clients must not call `providers/disable` for this id. + required: Annotated[ + bool, + Field( + description="Whether this provider is mandatory and cannot be disabled via `providers/disable`.\nIf true, clients must not call `providers/disable` for this id." + ), ] + # Supported protocol types for this provider. + supported: Annotated[List[str], Field(description="Supported protocol types for this provider.")] -class SetSessionModeResponse(BaseModel): +class ProvidersCapabilities(BaseModel): # 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. @@ -928,7 +1226,14 @@ class SetSessionModeResponse(BaseModel): ] = None -class SetSessionModelRequest(BaseModel): +class Range(BaseModel): + # The end position (exclusive). + end: Annotated[Position, Field(description="The end position (exclusive).")] + # The start position (inclusive). + start: Annotated[Position, Field(description="The start position (inclusive).")] + + +class ReadTextFileResponse(BaseModel): # 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. @@ -941,16 +1246,10 @@ class SetSessionModelRequest(BaseModel): 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/extensibility)", ), ] = None - # The ID of the model to set. - model_id: Annotated[str, Field(alias="modelId", description="The ID of the model to set.")] - # The ID of the session to set the model for. - session_id: Annotated[ - str, - Field(alias="sessionId", description="The ID of the session to set the model for."), - ] + content: str -class SetSessionModelResponse(BaseModel): +class ReleaseTerminalResponse(BaseModel): # 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. @@ -965,7 +1264,16 @@ class SetSessionModelResponse(BaseModel): ] = None -class Terminal(BaseModel): +class DeniedOutcome(BaseModel): + outcome: Literal["cancelled"] + + +class Role(Enum): + assistant = "assistant" + user = "user" + + +class SelectedPermissionOutcome(BaseModel): # 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. @@ -978,10 +1286,14 @@ class Terminal(BaseModel): 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/extensibility)", ), ] = None - terminal_id: Annotated[str, Field(alias="terminalId")] + # The ID of the option the user selected. + option_id: Annotated[ + str, + Field(alias="optionId", description="The ID of the option the user selected."), + ] -class TerminalExitStatus(BaseModel): +class SessionAdditionalDirectoriesCapabilities(BaseModel): # 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. @@ -994,23 +1306,32 @@ class TerminalExitStatus(BaseModel): 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/extensibility)", ), ] = None - # The process exit code (may be null if terminated by signal). - exit_code: Annotated[ - Optional[int], + + +class SessionCloseCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], Field( - alias="exitCode", - description="The process exit code (may be null if terminated by signal).", - ge=0, + alias="_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/extensibility)", ), ] = None - # The signal that terminated the process (may be null if exited normally). - signal: Annotated[ - Optional[str], - Field(description="The signal that terminated the process (may be null if exited normally)."), - ] = None -class TerminalOutputRequest(BaseModel): +class SessionConfigBoolean(BaseModel): + # The current value of the boolean option. + current_value: Annotated[ + bool, + Field(alias="currentValue", description="The current value of the boolean option."), + ] + + +class SessionForkCapabilities(BaseModel): # 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. @@ -1023,16 +1344,9 @@ class TerminalOutputRequest(BaseModel): 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/extensibility)", ), ] = None - # The session ID for this request. - session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] - # The ID of the terminal to get output from. - terminal_id: Annotated[ - str, - Field(alias="terminalId", description="The ID of the terminal to get output from."), - ] -class TerminalOutputResponse(BaseModel): +class SessionInfo(BaseModel): # 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. @@ -1045,18 +1359,37 @@ class TerminalOutputResponse(BaseModel): 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/extensibility)", ), ] = None - # Exit status if the command has completed. - exit_status: Annotated[ - Optional[TerminalExitStatus], - Field(alias="exitStatus", description="Exit status if the command has completed."), + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Authoritative ordered additional workspace roots for this session. Each path must be absolute. + # + # When omitted or empty, there are no additional roots for the session. + additional_directories: Annotated[ + Optional[List[str]], + Field( + alias="additionalDirectories", + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthoritative ordered additional workspace roots for this session. Each path must be absolute.\n\nWhen omitted or empty, there are no additional roots for the session.", + ), + ] = None + # The working directory for this session. Must be an absolute path. + cwd: Annotated[ + str, + Field(description="The working directory for this session. Must be an absolute path."), + ] + # Unique identifier for the session + session_id: Annotated[str, Field(alias="sessionId", description="Unique identifier for the session")] + # Human-readable title for the session + title: Annotated[Optional[str], Field(description="Human-readable title for the session")] = None + # ISO 8601 timestamp of last activity + updated_at: Annotated[ + Optional[str], + Field(alias="updatedAt", description="ISO 8601 timestamp of last activity"), ] = None - # The terminal output captured so far. - output: Annotated[str, Field(description="The terminal output captured so far.")] - # Whether the output was truncated due to byte limits. - truncated: Annotated[bool, Field(description="Whether the output was truncated due to byte limits.")] -class TextResourceContents(BaseModel): +class _SessionInfoUpdate(BaseModel): # 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. @@ -1069,20 +1402,22 @@ class TextResourceContents(BaseModel): 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/extensibility)", ), ] = None - mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None - text: str - uri: str - - -class FileEditToolCallContent(Diff): - type: Literal["diff"] - - -class TerminalToolCallContent(Terminal): - type: Literal["terminal"] + # Human-readable title for the session. Set to null to clear. + title: Annotated[ + Optional[str], + Field(description="Human-readable title for the session. Set to null to clear."), + ] = None + # ISO 8601 timestamp of last activity. Set to null to clear. + updated_at: Annotated[ + Optional[str], + Field( + alias="updatedAt", + description="ISO 8601 timestamp of last activity. Set to null to clear.", + ), + ] = None -class ToolCallLocation(BaseModel): +class SessionListCapabilities(BaseModel): # 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. @@ -1095,13 +1430,9 @@ class ToolCallLocation(BaseModel): 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/extensibility)", ), ] = None - # Optional line number within the file. - line: Annotated[Optional[int], Field(description="Optional line number within the file.", ge=0)] = None - # The file path being accessed or modified. - path: Annotated[str, Field(description="The file path being accessed or modified.")] -class UnstructuredCommandInput(BaseModel): +class SessionModelState(BaseModel): # 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. @@ -1114,59 +1445,22 @@ class UnstructuredCommandInput(BaseModel): 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/extensibility)", ), ] = None - # A hint to display when the input hasn't been provided yet - hint: Annotated[ - str, - Field(description="A hint to display when the input hasn't been provided yet"), - ] - - -class Usage(BaseModel): - # Total cache read tokens. - cached_read_tokens: Annotated[ - Optional[int], - Field(alias="cachedReadTokens", description="Total cache read tokens.", ge=0), - ] = None - # Total cache write tokens. - cached_write_tokens: Annotated[ - Optional[int], - Field(alias="cachedWriteTokens", description="Total cache write tokens.", ge=0), - ] = None - # Total input tokens across all turns. - input_tokens: Annotated[ - int, - Field( - alias="inputTokens", - description="Total input tokens across all turns.", - ge=0, - ), - ] - # Total output tokens across all turns. - output_tokens: Annotated[ - int, + # The set of models that the Agent can use + available_models: Annotated[ + List[ModelInfo], Field( - alias="outputTokens", - description="Total output tokens across all turns.", - ge=0, + alias="availableModels", + description="The set of models that the Agent can use", ), ] - # Total thought/reasoning tokens - thought_tokens: Annotated[ - Optional[int], - Field(alias="thoughtTokens", description="Total thought/reasoning tokens", ge=0), - ] = None - # Sum of all token types across session. - total_tokens: Annotated[ - int, - Field( - alias="totalTokens", - description="Sum of all token types across session.", - ge=0, - ), + # The current model the Agent is in. + current_model_id: Annotated[ + str, + Field(alias="currentModelId", description="The current model the Agent is in."), ] -class _UsageUpdate(BaseModel): +class SessionResumeCapabilities(BaseModel): # 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. @@ -1179,15 +1473,13 @@ class _UsageUpdate(BaseModel): 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/extensibility)", ), ] = None - # Cumulative session cost (optional). - cost: Annotated[Optional[Cost], Field(description="Cumulative session cost (optional).")] = None - # Total context window size in tokens. - size: Annotated[int, Field(description="Total context window size in tokens.", ge=0)] - # Tokens currently in context. - used: Annotated[int, Field(description="Tokens currently in context.", ge=0)] -class WaitForTerminalExitRequest(BaseModel): +class SessionInfoUpdate(_SessionInfoUpdate): + session_update: Annotated[Literal["session_info_update"], Field(alias="sessionUpdate")] + + +class SetProvidersRequest(BaseModel): # 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. @@ -1200,16 +1492,29 @@ class WaitForTerminalExitRequest(BaseModel): 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/extensibility)", ), ] = None - # The session ID for this request. - session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] - # The ID of the terminal to wait for. - terminal_id: Annotated[ + # Protocol type for this provider. + api_type: Annotated[str, Field(alias="apiType", description="Protocol type for this provider.")] + # Base URL for requests sent through this provider. + base_url: Annotated[ str, - Field(alias="terminalId", description="The ID of the terminal to wait for."), + Field( + alias="baseUrl", + description="Base URL for requests sent through this provider.", + ), ] + # Full headers map for this provider. + # May include authorization, routing, or other integration-specific headers. + headers: Annotated[ + Optional[Dict[str, str]], + Field( + description="Full headers map for this provider.\nMay include authorization, routing, or other integration-specific headers." + ), + ] = None + # Provider id to configure. + id: Annotated[str, Field(description="Provider id to configure.")] -class WaitForTerminalExitResponse(BaseModel): +class SetProvidersResponse(BaseModel): # 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. @@ -1222,23 +1527,9 @@ class WaitForTerminalExitResponse(BaseModel): 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/extensibility)", ), ] = None - # The process exit code (may be null if terminated by signal). - exit_code: Annotated[ - Optional[int], - Field( - alias="exitCode", - description="The process exit code (may be null if terminated by signal).", - ge=0, - ), - ] = None - # The signal that terminated the process (may be null if exited normally). - signal: Annotated[ - Optional[str], - Field(description="The signal that terminated the process (may be null if exited normally)."), - ] = None -class WriteTextFileRequest(BaseModel): +class SetSessionConfigOptionBooleanRequest(BaseModel): # 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. @@ -1251,15 +1542,25 @@ class WriteTextFileRequest(BaseModel): 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/extensibility)", ), ] = None - # The text content to write to the file. - content: Annotated[str, Field(description="The text content to write to the file.")] - # Absolute path to the file to write. - path: Annotated[str, Field(description="Absolute path to the file to write.")] - # The session ID for this request. - session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # The ID of the configuration option to set. + config_id: Annotated[ + str, + Field(alias="configId", description="The ID of the configuration option to set."), + ] + # The ID of the session to set the configuration option for. + session_id: Annotated[ + str, + Field( + alias="sessionId", + description="The ID of the session to set the configuration option for.", + ), + ] + type: Literal["boolean"] + # The boolean value. + value: Annotated[bool, Field(description="The boolean value.")] -class WriteTextFileResponse(BaseModel): +class SetSessionConfigOptionSelectRequest(BaseModel): # 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. @@ -1272,9 +1573,24 @@ class WriteTextFileResponse(BaseModel): 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/extensibility)", ), ] = None + # The ID of the configuration option to set. + config_id: Annotated[ + str, + Field(alias="configId", description="The ID of the configuration option to set."), + ] + # The ID of the session to set the configuration option for. + session_id: Annotated[ + str, + Field( + alias="sessionId", + description="The ID of the session to set the configuration option for.", + ), + ] + # The value ID. + value: Annotated[str, Field(description="The value ID.")] -class Annotations(BaseModel): +class SetSessionModeRequest(BaseModel): # 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. @@ -1287,12 +1603,16 @@ class Annotations(BaseModel): 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/extensibility)", ), ] = None - audience: Optional[List[Role]] = None - last_modified: Annotated[Optional[str], Field(alias="lastModified")] = None - priority: Optional[float] = None + # The ID of the mode to set. + mode_id: Annotated[str, Field(alias="modeId", description="The ID of the mode to set.")] + # The ID of the session to set the mode for. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The ID of the session to set the mode for."), + ] -class AudioContent(BaseModel): +class SetSessionModeResponse(BaseModel): # 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. @@ -1305,28 +1625,9 @@ class AudioContent(BaseModel): 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/extensibility)", ), ] = None - annotations: Optional[Annotations] = None - data: str - mime_type: Annotated[str, Field(alias="mimeType")] - - -class EnvVarAuthMethod(AuthMethodEnvVar): - type: Literal["env_var"] - - -class TerminalAuthMethod(AuthMethodTerminal): - type: Literal["terminal"] - - -class AvailableCommandInput(RootModel[UnstructuredCommandInput]): - # The input specification for a command. - root: Annotated[ - UnstructuredCommandInput, - Field(description="The input specification for a command."), - ] -class CancelNotification(BaseModel): +class SetSessionModelRequest(BaseModel): # 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. @@ -1339,17 +1640,16 @@ class CancelNotification(BaseModel): 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/extensibility)", ), ] = None - # The ID of the session to cancel operations for. + # The ID of the model to set. + model_id: Annotated[str, Field(alias="modelId", description="The ID of the model to set.")] + # The ID of the session to set the model for. session_id: Annotated[ str, - Field( - alias="sessionId", - description="The ID of the session to cancel operations for.", - ), + Field(alias="sessionId", description="The ID of the session to set the model for."), ] -class CancelRequestNotification(BaseModel): +class SetSessionModelResponse(BaseModel): # 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. @@ -1362,14 +1662,9 @@ class CancelRequestNotification(BaseModel): 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/extensibility)", ), ] = None - # The ID of the request to cancel. - request_id: Annotated[ - Optional[Union[int, str]], - Field(alias="requestId", description="The ID of the request to cancel."), - ] = None -class ClientCapabilities(BaseModel): +class StartNesResponse(BaseModel): # 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. @@ -1382,40 +1677,53 @@ class ClientCapabilities(BaseModel): 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/extensibility)", ), ] = None - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. - # - # Authentication capabilities supported by the client. - # Determines which authentication method types the agent may include - # in its `InitializeResponse`. - auth: Annotated[ - Optional[AuthCapabilities], - Field( - description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication capabilities supported by the client.\nDetermines which authentication method types the agent may include\nin its `InitializeResponse`." - ), - ] = {"terminal": False} - # File system capabilities supported by the client. - # Determines which file operations the agent can request. - fs: Annotated[ - Optional[FileSystemCapabilities], + # The session ID for the newly started NES session. + session_id: Annotated[ + str, Field( - description="File system capabilities supported by the client.\nDetermines which file operations the agent can request." + alias="sessionId", + description="The session ID for the newly started NES session.", ), - ] = FileSystemCapabilities() - # Whether the Client support all `terminal/*` methods. - terminal: Annotated[ - Optional[bool], - Field(description="Whether the Client support all `terminal/*` methods."), - ] = False + ] -class ClientNotification(BaseModel): - method: str - params: Optional[Union[CancelNotification, Any]] = None +class StringPropertySchema(BaseModel): + # Default value. + default: Annotated[Optional[str], Field(description="Default value.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # Enum values for untitled single-select enums. + enum: Annotated[ + Optional[List[str]], + Field(description="Enum values for untitled single-select enums."), + ] = None + # String format. + format: Annotated[Optional[str], Field(description="String format.")] = None + # Maximum string length. + max_length: Annotated[ + Optional[int], + Field(alias="maxLength", description="Maximum string length.", ge=0), + ] = None + # Minimum string length. + min_length: Annotated[ + Optional[int], + Field(alias="minLength", description="Minimum string length.", ge=0), + ] = None + # Titled enum options for titled single-select enums. + one_of: Annotated[ + Optional[List[EnumOption]], + Field( + alias="oneOf", + description="Titled enum options for titled single-select enums.", + ), + ] = None + # Pattern the string must match. + pattern: Annotated[Optional[str], Field(description="Pattern the string must match.")] = None + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None -class CloseSessionRequest(BaseModel): +class Terminal(BaseModel): # 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. @@ -1428,15 +1736,10 @@ class CloseSessionRequest(BaseModel): 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/extensibility)", ), ] = None - # The ID of the session to close. - session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to close.")] - - -class AudioContentBlock(AudioContent): - type: Literal["audio"] + terminal_id: Annotated[str, Field(alias="terminalId")] -class CreateTerminalRequest(BaseModel): +class TerminalExitStatus(BaseModel): # 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. @@ -1449,41 +1752,685 @@ class CreateTerminalRequest(BaseModel): 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/extensibility)", ), ] = None - # Array of command arguments. - args: Annotated[Optional[List[str]], Field(description="Array of command arguments.")] = None - # The command to execute. - command: Annotated[str, Field(description="The command to execute.")] - # Working directory for the command (absolute path). - cwd: Annotated[ - Optional[str], - Field(description="Working directory for the command (absolute path)."), - ] = None - # Environment variables for the command. - env: Annotated[ - Optional[List[EnvVariable]], - Field(description="Environment variables for the command."), - ] = None - # Maximum number of output bytes to retain. - # - # When the limit is exceeded, the Client truncates from the beginning of the output - # to stay within the limit. - # - # The Client MUST ensure truncation happens at a character boundary to maintain valid - # string output, even if this means the retained output is slightly less than the - # specified limit. - output_byte_limit: Annotated[ + # The process exit code (may be null if terminated by signal). + exit_code: Annotated[ Optional[int], Field( - alias="outputByteLimit", + alias="exitCode", + description="The process exit code (may be null if terminated by signal).", + ge=0, + ), + ] = None + # The signal that terminated the process (may be null if exited normally). + signal: Annotated[ + Optional[str], + Field(description="The signal that terminated the process (may be null if exited normally)."), + ] = None + + +class TerminalOutputRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # The ID of the terminal to get output from. + terminal_id: Annotated[ + str, + Field(alias="terminalId", description="The ID of the terminal to get output from."), + ] + + +class TerminalOutputResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Exit status if the command has completed. + exit_status: Annotated[ + Optional[TerminalExitStatus], + Field(alias="exitStatus", description="Exit status if the command has completed."), + ] = None + # The terminal output captured so far. + output: Annotated[str, Field(description="The terminal output captured so far.")] + # Whether the output was truncated due to byte limits. + truncated: Annotated[bool, Field(description="Whether the output was truncated due to byte limits.")] + + +class TextDocumentContentChangeEvent(BaseModel): + # The range of the document that changed. If `None`, the entire content is replaced. + range: Annotated[ + Optional[Range], + Field(description="The range of the document that changed. If `None`, the entire content is replaced."), + ] = None + # The new text for the range, or the full document content if `range` is `None`. + text: Annotated[ + str, + Field(description="The new text for the range, or the full document content if `range` is `None`."), + ] + + +class TextResourceContents(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None + text: str + uri: str + + +class TitledMultiSelectItems(BaseModel): + # Titled enum options. + any_of: Annotated[List[EnumOption], Field(alias="anyOf", description="Titled enum options.")] + + +class FileEditToolCallContent(Diff): + type: Literal["diff"] + + +class TerminalToolCallContent(Terminal): + type: Literal["terminal"] + + +class ToolCallLocation(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Optional line number within the file. + line: Annotated[Optional[int], Field(description="Optional line number within the file.", ge=0)] = None + # The file path being accessed or modified. + path: Annotated[str, Field(description="The file path being accessed or modified.")] + + +class UnstructuredCommandInput(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # A hint to display when the input hasn't been provided yet + hint: Annotated[ + str, + Field(description="A hint to display when the input hasn't been provided yet"), + ] + + +class UntitledMultiSelectItems(BaseModel): + # Allowed enum values. + enum: Annotated[List[str], Field(description="Allowed enum values.")] + # Item type discriminator. Must be `"string"`. + type: Annotated[str, Field(description='Item type discriminator. Must be `"string"`.')] + + +class Usage(BaseModel): + # Total cache read tokens. + cached_read_tokens: Annotated[ + Optional[int], + Field(alias="cachedReadTokens", description="Total cache read tokens.", ge=0), + ] = None + # Total cache write tokens. + cached_write_tokens: Annotated[ + Optional[int], + Field(alias="cachedWriteTokens", description="Total cache write tokens.", ge=0), + ] = None + # Total input tokens across all turns. + input_tokens: Annotated[ + int, + Field( + alias="inputTokens", + description="Total input tokens across all turns.", + ge=0, + ), + ] + # Total output tokens across all turns. + output_tokens: Annotated[ + int, + Field( + alias="outputTokens", + description="Total output tokens across all turns.", + ge=0, + ), + ] + # Total thought/reasoning tokens + thought_tokens: Annotated[ + Optional[int], + Field(alias="thoughtTokens", description="Total thought/reasoning tokens", ge=0), + ] = None + # Sum of all token types across session. + total_tokens: Annotated[ + int, + Field( + alias="totalTokens", + description="Sum of all token types across session.", + ge=0, + ), + ] + + +class _UsageUpdate(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Cumulative session cost (optional). + cost: Annotated[Optional[Cost], Field(description="Cumulative session cost (optional).")] = None + # Total context window size in tokens. + size: Annotated[int, Field(description="Total context window size in tokens.", ge=0)] + # Tokens currently in context. + used: Annotated[int, Field(description="Tokens currently in context.", ge=0)] + + +class WaitForTerminalExitRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # The ID of the terminal to wait for. + terminal_id: Annotated[ + str, + Field(alias="terminalId", description="The ID of the terminal to wait for."), + ] + + +class WaitForTerminalExitResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The process exit code (may be null if terminated by signal). + exit_code: Annotated[ + Optional[int], + Field( + alias="exitCode", + description="The process exit code (may be null if terminated by signal).", + ge=0, + ), + ] = None + # The signal that terminated the process (may be null if exited normally). + signal: Annotated[ + Optional[str], + Field(description="The signal that terminated the process (may be null if exited normally)."), + ] = None + + +class WorkspaceFolder(BaseModel): + # The display name of the folder. + name: Annotated[str, Field(description="The display name of the folder.")] + # The URI of the folder. + uri: Annotated[str, Field(description="The URI of the folder.")] + + +class WriteTextFileRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The text content to write to the file. + content: Annotated[str, Field(description="The text content to write to the file.")] + # Absolute path to the file to write. + path: Annotated[str, Field(description="Absolute path to the file to write.")] + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + + +class WriteTextFileResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + + +class AcceptNesNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The ID of the accepted suggestion. + id: Annotated[str, Field(description="The ID of the accepted suggestion.")] + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + + +class AgentAuthCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Whether the agent supports the logout method. + # + # By supplying `{}` it means that the agent supports the logout method. + logout: Annotated[ + Optional[LogoutCapabilities], + Field( + description="Whether the agent supports the logout method.\n\nBy supplying `{}` it means that the agent supports the logout method." + ), + ] = None + + +class Annotations(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + audience: Optional[List[Role]] = None + last_modified: Annotated[Optional[str], Field(alias="lastModified")] = None + priority: Optional[float] = None + + +class AudioContent(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + annotations: Optional[Annotations] = None + data: str + mime_type: Annotated[str, Field(alias="mimeType")] + + +class EnvVarAuthMethod(AuthMethodEnvVar): + type: Literal["env_var"] + + +class TerminalAuthMethod(AuthMethodTerminal): + type: Literal["terminal"] + + +class AvailableCommandInput(RootModel[UnstructuredCommandInput]): + # The input specification for a command. + root: Annotated[ + UnstructuredCommandInput, + Field(description="The input specification for a command."), + ] + + +class CancelNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The ID of the session to cancel operations for. + session_id: Annotated[ + str, + Field( + alias="sessionId", + description="The ID of the session to cancel operations for.", + ), + ] + + +class CancelRequestNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The ID of the request to cancel. + request_id: Annotated[ + Optional[Union[int, str]], + Field(alias="requestId", description="The ID of the request to cancel."), + ] = None + + +class ClientNesCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Whether the client supports the `jump` suggestion kind. + jump: Annotated[ + Optional[NesJumpCapabilities], + Field(description="Whether the client supports the `jump` suggestion kind."), + ] = None + # Whether the client supports the `rename` suggestion kind. + rename: Annotated[ + Optional[NesRenameCapabilities], + Field(description="Whether the client supports the `rename` suggestion kind."), + ] = None + # Whether the client supports the `searchAndReplace` suggestion kind. + search_and_replace: Annotated[ + Optional[NesSearchAndReplaceCapabilities], + Field( + alias="searchAndReplace", + description="Whether the client supports the `searchAndReplace` suggestion kind.", + ), + ] = None + + +class CloseNesRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The ID of the NES session to close. + session_id: Annotated[str, Field(alias="sessionId", description="The ID of the NES session to close.")] + + +class CloseSessionRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The ID of the session to close. + session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to close.")] + + +class CompleteElicitationNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The ID of the elicitation that completed. + elicitation_id: Annotated[ + str, + Field( + alias="elicitationId", + description="The ID of the elicitation that completed.", + ), + ] + + +class AudioContentBlock(AudioContent): + type: Literal["audio"] + + +class AcceptElicitationResponse(ElicitationAcceptAction): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + action: Literal["accept"] + + +class CreateTerminalRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Array of command arguments. + args: Annotated[Optional[List[str]], Field(description="Array of command arguments.")] = None + # The command to execute. + command: Annotated[str, Field(description="The command to execute.")] + # Working directory for the command (absolute path). + cwd: Annotated[ + Optional[str], + Field(description="Working directory for the command (absolute path)."), + ] = None + # Environment variables for the command. + env: Annotated[ + Optional[List[EnvVariable]], + Field(description="Environment variables for the command."), + ] = None + # Maximum number of output bytes to retain. + # + # When the limit is exceeded, the Client truncates from the beginning of the output + # to stay within the limit. + # + # The Client MUST ensure truncation happens at a character boundary to maintain valid + # string output, even if this means the retained output is slightly less than the + # specified limit. + output_byte_limit: Annotated[ + Optional[int], + Field( + alias="outputByteLimit", description="Maximum number of output bytes to retain.\n\nWhen the limit is exceeded, the Client truncates from the beginning of the output\nto stay within the limit.\n\nThe Client MUST ensure truncation happens at a character boundary to maintain valid\nstring output, even if this means the retained output is slightly less than the\nspecified limit.", ge=0, ), ] = None - # The session ID for this request. - session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + + +class _CurrentModeUpdate(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The ID of the current mode + current_mode_id: Annotated[str, Field(alias="currentModeId", description="The ID of the current mode")] + + +class DidChangeDocumentNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The content changes. + content_changes: Annotated[ + List[TextDocumentContentChangeEvent], + Field(alias="contentChanges", description="The content changes."), + ] + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + # The URI of the changed document. + uri: Annotated[str, Field(description="The URI of the changed document.")] + # The new version number of the document. + version: Annotated[int, Field(description="The new version number of the document.")] + + +class DidCloseDocumentNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + # The URI of the closed document. + uri: Annotated[str, Field(description="The URI of the closed document.")] -class _CurrentModeUpdate(BaseModel): +class DidFocusDocumentNotification(BaseModel): # 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. @@ -1496,8 +2443,179 @@ class _CurrentModeUpdate(BaseModel): 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/extensibility)", ), ] = None - # The ID of the current mode - current_mode_id: Annotated[str, Field(alias="currentModeId", description="The ID of the current mode")] + # The current cursor position. + position: Annotated[Position, Field(description="The current cursor position.")] + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + # The URI of the focused document. + uri: Annotated[str, Field(description="The URI of the focused document.")] + # The version number of the document. + version: Annotated[int, Field(description="The version number of the document.")] + # The portion of the file currently visible in the editor viewport. + visible_range: Annotated[ + Range, + Field( + alias="visibleRange", + description="The portion of the file currently visible in the editor viewport.", + ), + ] + + +class DidOpenDocumentNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The language identifier of the document (e.g., "rust", "python"). + language_id: Annotated[ + str, + Field( + alias="languageId", + description='The language identifier of the document (e.g., "rust", "python").', + ), + ] + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + # The full text content of the document. + text: Annotated[str, Field(description="The full text content of the document.")] + # The URI of the opened document. + uri: Annotated[str, Field(description="The URI of the opened document.")] + # The version number of the document. + version: Annotated[int, Field(description="The version number of the document.")] + + +class DidSaveDocumentNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + # The URI of the saved document. + uri: Annotated[str, Field(description="The URI of the saved document.")] + + +class ElicitationCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Whether the client supports form-based elicitation. + form: Annotated[ + Optional[ElicitationFormCapabilities], + Field(description="Whether the client supports form-based elicitation."), + ] = None + # Whether the client supports URL-based elicitation. + url: Annotated[ + Optional[ElicitationUrlCapabilities], + Field(description="Whether the client supports URL-based elicitation."), + ] = None + + +class ElicitationStringPropertySchema(StringPropertySchema): + type: Literal["string"] + + +class ElicitationNumberPropertySchema(NumberPropertySchema): + type: Literal["number"] + + +class ElicitationIntegerPropertySchema(IntegerPropertySchema): + type: Literal["integer"] + + +class ElicitationRequestScope(BaseModel): + # The request this elicitation is tied to. + request_id: Annotated[ + Optional[Union[int, str]], + Field(alias="requestId", description="The request this elicitation is tied to."), + ] = None + + +class ElicitationSessionScope(BaseModel): + # The session this elicitation is tied to. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session this elicitation is tied to."), + ] + # Optional tool call within the session. + tool_call_id: Annotated[ + Optional[str], + Field(alias="toolCallId", description="Optional tool call within the session."), + ] = None + + +class ElicitationUrlSessionMode(ElicitationSessionScope): + # The unique identifier for this elicitation. + elicitation_id: Annotated[ + str, + Field( + alias="elicitationId", + description="The unique identifier for this elicitation.", + ), + ] + # The URL to direct the user to. + url: Annotated[AnyUrl, Field(description="The URL to direct the user to.")] + + +class ElicitationUrlRequestMode(ElicitationRequestScope): + # The unique identifier for this elicitation. + elicitation_id: Annotated[ + str, + Field( + alias="elicitationId", + description="The unique identifier for this elicitation.", + ), + ] + # The URL to direct the user to. + url: Annotated[AnyUrl, Field(description="The URL to direct the user to.")] + + +class ElicitationUrlMode(RootModel[Union[ElicitationUrlSessionMode, ElicitationUrlRequestMode]]): + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # URL-based elicitation mode where the client directs the user to a URL. + root: Annotated[ + Union[ElicitationUrlSessionMode, ElicitationUrlRequestMode], + Field( + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nURL-based elicitation mode where the client directs the user to a URL." + ), + ] class Error(BaseModel): @@ -1546,7 +2664,7 @@ class ImageContent(BaseModel): uri: Optional[str] = None -class InitializeRequest(BaseModel): +class KillTerminalRequest(BaseModel): # 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. @@ -1559,37 +2677,91 @@ class InitializeRequest(BaseModel): 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/extensibility)", ), ] = None - # Capabilities supported by the client. - client_capabilities: Annotated[ - Optional[ClientCapabilities], + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # The ID of the terminal to kill. + terminal_id: Annotated[str, Field(alias="terminalId", description="The ID of the terminal to kill.")] + + +class ListProvidersResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], Field( - alias="clientCapabilities", - description="Capabilities supported by the client.", + alias="_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/extensibility)", ), - ] = ClientCapabilities() - # Information about the Client name and version sent to the Agent. + ] = None + # Configurable providers with current routing info suitable for UI display. + providers: Annotated[ + List[ProviderInfo], + Field(description="Configurable providers with current routing info suitable for UI display."), + ] + + +class ListSessionsResponse(BaseModel): + # 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. # - # Note: in future versions of the protocol, this will be required. - client_info: Annotated[ - Optional[Implementation], + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], Field( - alias="clientInfo", - description="Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required.", + alias="_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/extensibility)", ), ] = None - # The latest protocol version supported by the client. - protocol_version: Annotated[ - int, + # 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. + next_cursor: Annotated[ + Optional[str], Field( - alias="protocolVersion", - description="The latest protocol version supported by the client.", - ge=0, - le=65535, + alias="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.", ), + ] = None + # Array of session information objects + sessions: Annotated[List[SessionInfo], Field(description="Array of session information objects")] + + +class HttpMcpServer(McpServerHttp): + type: Literal["http"] + + +class SseMcpServer(McpServerSse): + type: Literal["sse"] + + +class MultiSelectPropertySchema(BaseModel): + # Default selected values. + default: Annotated[Optional[List[str]], Field(description="Default selected values.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # The items definition describing allowed values. + items: Annotated[ + Union[UntitledMultiSelectItems, TitledMultiSelectItems], + Field(description="The items definition describing allowed values."), ] + # Maximum number of items to select. + max_items: Annotated[ + Optional[int], + Field(alias="maxItems", description="Maximum number of items to select.", ge=0), + ] = None + # Minimum number of items to select. + min_items: Annotated[ + Optional[int], + Field(alias="minItems", description="Minimum number of items to select.", ge=0), + ] = None + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None -class KillTerminalRequest(BaseModel): +class NesContextCapabilities(BaseModel): # 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. @@ -1602,13 +2774,62 @@ class KillTerminalRequest(BaseModel): 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/extensibility)", ), ] = None - # The session ID for this request. - session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] - # The ID of the terminal to kill. - terminal_id: Annotated[str, Field(alias="terminalId", description="The ID of the terminal to kill.")] + # Whether the agent wants diagnostics context. + diagnostics: Annotated[ + Optional[NesDiagnosticsCapabilities], + Field(description="Whether the agent wants diagnostics context."), + ] = None + # Whether the agent wants edit history context. + edit_history: Annotated[ + Optional[NesEditHistoryCapabilities], + Field( + alias="editHistory", + description="Whether the agent wants edit history context.", + ), + ] = None + # Whether the agent wants open files context. + open_files: Annotated[ + Optional[NesOpenFilesCapabilities], + Field(alias="openFiles", description="Whether the agent wants open files context."), + ] = None + # Whether the agent wants recent files context. + recent_files: Annotated[ + Optional[NesRecentFilesCapabilities], + Field( + alias="recentFiles", + description="Whether the agent wants recent files context.", + ), + ] = None + # Whether the agent wants related snippets context. + related_snippets: Annotated[ + Optional[NesRelatedSnippetsCapabilities], + Field( + alias="relatedSnippets", + description="Whether the agent wants related snippets context.", + ), + ] = None + # Whether the agent wants user actions context. + user_actions: Annotated[ + Optional[NesUserActionsCapabilities], + Field( + alias="userActions", + description="Whether the agent wants user actions context.", + ), + ] = None -class ListSessionsResponse(BaseModel): +class NesDiagnostic(BaseModel): + # The diagnostic message. + message: Annotated[str, Field(description="The diagnostic message.")] + # The range of the diagnostic. + range: Annotated[Range, Field(description="The range of the diagnostic.")] + # The severity of the diagnostic. + severity: Annotated[str, Field(description="The severity of the diagnostic.")] + # The URI of the file containing the diagnostic. + uri: Annotated[str, Field(description="The URI of the file containing the diagnostic.")] + + +class NesDocumentDidChangeCapabilities(BaseModel): # 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. @@ -1621,25 +2842,166 @@ class ListSessionsResponse(BaseModel): 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/extensibility)", ), ] = None - # 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. - next_cursor: Annotated[ - Optional[str], + # The sync kind the agent wants: `"full"` or `"incremental"`. + sync_kind: Annotated[ + str, + Field( + alias="syncKind", + description='The sync kind the agent wants: `"full"` or `"incremental"`.', + ), + ] + + +class NesDocumentEventCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Whether the agent wants `document/didChange` events, and the sync kind. + did_change: Annotated[ + Optional[NesDocumentDidChangeCapabilities], + Field( + alias="didChange", + description="Whether the agent wants `document/didChange` events, and the sync kind.", + ), + ] = None + # Whether the agent wants `document/didClose` events. + did_close: Annotated[ + Optional[NesDocumentDidCloseCapabilities], + Field( + alias="didClose", + description="Whether the agent wants `document/didClose` events.", + ), + ] = None + # Whether the agent wants `document/didFocus` events. + did_focus: Annotated[ + Optional[NesDocumentDidFocusCapabilities], + Field( + alias="didFocus", + description="Whether the agent wants `document/didFocus` events.", + ), + ] = None + # Whether the agent wants `document/didOpen` events. + did_open: Annotated[ + Optional[NesDocumentDidOpenCapabilities], + Field( + alias="didOpen", + description="Whether the agent wants `document/didOpen` events.", + ), + ] = None + # Whether the agent wants `document/didSave` events. + did_save: Annotated[ + Optional[NesDocumentDidSaveCapabilities], + Field( + alias="didSave", + description="Whether the agent wants `document/didSave` events.", + ), + ] = None + + +class NesEventCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Document event capabilities. + document: Annotated[ + Optional[NesDocumentEventCapabilities], + Field(description="Document event capabilities."), + ] = None + + +class NesJumpSuggestion(BaseModel): + # Unique identifier for accept/reject tracking. + id: Annotated[str, Field(description="Unique identifier for accept/reject tracking.")] + # The target position within the file. + position: Annotated[Position, Field(description="The target position within the file.")] + # The file to navigate to. + uri: Annotated[str, Field(description="The file to navigate to.")] + + +class NesOpenFile(BaseModel): + # The language identifier. + language_id: Annotated[str, Field(alias="languageId", description="The language identifier.")] + # Timestamp in milliseconds since epoch of when the file was last focused. + last_focused_ms: Annotated[ + Optional[int], Field( - alias="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.", + alias="lastFocusedMs", + description="Timestamp in milliseconds since epoch of when the file was last focused.", + ge=0, ), ] = None - # Array of session information objects - sessions: Annotated[List[SessionInfo], Field(description="Array of session information objects")] + # The URI of the file. + uri: Annotated[str, Field(description="The URI of the file.")] + # The visible range in the editor, if any. + visible_range: Annotated[ + Optional[Range], + Field(alias="visibleRange", description="The visible range in the editor, if any."), + ] = None -class HttpMcpServer(McpServerHttp): - type: Literal["http"] +class NesRenameSuggestion(BaseModel): + # Unique identifier for accept/reject tracking. + id: Annotated[str, Field(description="Unique identifier for accept/reject tracking.")] + # The new name for the symbol. + new_name: Annotated[str, Field(alias="newName", description="The new name for the symbol.")] + # The position of the symbol to rename. + position: Annotated[Position, Field(description="The position of the symbol to rename.")] + # The file URI containing the symbol. + uri: Annotated[str, Field(description="The file URI containing the symbol.")] -class SseMcpServer(McpServerSse): - type: Literal["sse"] +class NesJumpSuggestionVariant(NesJumpSuggestion): + kind: Literal["jump"] + + +class NesRenameSuggestionVariant(NesRenameSuggestion): + kind: Literal["rename"] + + +class NesTextEdit(BaseModel): + # The replacement text. + new_text: Annotated[str, Field(alias="newText", description="The replacement text.")] + # The range to replace. + range: Annotated[Range, Field(description="The range to replace.")] + + +class NesUserAction(BaseModel): + # The kind of action (e.g., "insertChar", "cursorMovement"). + action: Annotated[ + str, + Field(description='The kind of action (e.g., "insertChar", "cursorMovement").'), + ] + # The position where the action occurred. + position: Annotated[Position, Field(description="The position where the action occurred.")] + # Timestamp in milliseconds since epoch. + timestamp_ms: Annotated[ + int, + Field( + alias="timestampMs", + description="Timestamp in milliseconds since epoch.", + ge=0, + ), + ] + # The URI of the file where the action occurred. + uri: Annotated[str, Field(description="The URI of the file where the action occurred.")] class NewSessionRequest(BaseModel): @@ -1655,6 +3017,22 @@ class NewSessionRequest(BaseModel): 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/extensibility)", ), ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Additional workspace roots for this session. Each path must be absolute. + # + # These expand the session's filesystem scope without changing `cwd`, which + # remains the base for relative paths. When omitted or empty, no + # additional roots are activated for the new session. + additional_directories: Annotated[ + Optional[List[str]], + Field( + alias="additionalDirectories", + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional workspace roots for this session. Each path must be absolute.\n\nThese expand the session's filesystem scope without changing `cwd`, which\nremains the base for relative paths. When omitted or empty, no\nadditional roots are activated for the new session.", + ), + ] = None # The working directory for this session. Must be an absolute path. cwd: Annotated[ str, @@ -1803,6 +3181,30 @@ class ReadTextFileRequest(BaseModel): session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] +class RejectNesNotification(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The ID of the rejected suggestion. + id: Annotated[str, Field(description="The ID of the rejected suggestion.")] + # The reason for rejection. + reason: Annotated[Optional[str], Field(description="The reason for rejection.")] = None + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + + class ReleaseTerminalRequest(BaseModel): # 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 @@ -1884,6 +3286,22 @@ class ResumeSessionRequest(BaseModel): 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/extensibility)", ), ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # 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. + additional_directories: Annotated[ + Optional[List[str]], + Field( + alias="additionalDirectories", + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional 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.", + ), + ] = None # The working directory for this session. cwd: Annotated[str, Field(description="The working directory for this session.")] # List of MCP servers to connect to for this session. @@ -1915,12 +3333,18 @@ class SessionCapabilities(BaseModel): # # This capability is not part of the spec yet, and may be removed or changed at any point. # + # Whether the agent supports `additionalDirectories` on supported session lifecycle requests and `session/list`. + additional_directories: Annotated[ + Optional[SessionAdditionalDirectoriesCapabilities], + Field( + alias="additionalDirectories", + 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 `additionalDirectories` on supported session lifecycle requests and `session/list`.", + ), + ] = None # Whether the agent supports `session/close`. close: Annotated[ Optional[SessionCloseCapabilities], - Field( - 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/close`." - ), + Field(description="Whether the agent supports `session/close`."), ] = None # **UNSTABLE** # @@ -1938,16 +3362,10 @@ class SessionCapabilities(BaseModel): Optional[SessionListCapabilities], Field(description="Whether the agent supports `session/list`."), ] = 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/resume`. resume: Annotated[ Optional[SessionResumeCapabilities], - Field( - 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/resume`." - ), + Field(description="Whether the agent supports `session/resume`."), ] = None @@ -2057,7 +3475,7 @@ class UsageUpdate(_UsageUpdate): session_update: Annotated[Literal["usage_update"], Field(alias="sessionUpdate")] -class TextContent(BaseModel): +class StartNesRequest(BaseModel): # 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. @@ -2070,11 +3488,24 @@ class TextContent(BaseModel): 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/extensibility)", ), ] = None - annotations: Optional[Annotations] = None - text: str + # Repository metadata, if the workspace is a git repository. + repository: Annotated[ + Optional[NesRepository], + Field(description="Repository metadata, if the workspace is a git repository."), + ] = None + # The workspace folders. + workspace_folders: Annotated[ + Optional[List[WorkspaceFolder]], + Field(alias="workspaceFolders", description="The workspace folders."), + ] = None + # The root URI of the workspace. + workspace_uri: Annotated[ + Optional[str], + Field(alias="workspaceUri", description="The root URI of the workspace."), + ] = None -class AgentCapabilities(BaseModel): +class TextContent(BaseModel): # 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. @@ -2087,33 +3518,8 @@ class AgentCapabilities(BaseModel): 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/extensibility)", ), ] = None - # Whether the agent supports `session/load`. - load_session: Annotated[ - Optional[bool], - Field( - alias="loadSession", - description="Whether the agent supports `session/load`.", - ), - ] = False - # MCP capabilities supported by the agent. - mcp_capabilities: Annotated[ - Optional[McpCapabilities], - Field( - alias="mcpCapabilities", - description="MCP capabilities supported by the agent.", - ), - ] = McpCapabilities() - # Prompt capabilities supported by the agent. - prompt_capabilities: Annotated[ - Optional[PromptCapabilities], - Field( - alias="promptCapabilities", - description="Prompt capabilities supported by the agent.", - ), - ] = PromptCapabilities() - session_capabilities: Annotated[Optional[SessionCapabilities], Field(alias="sessionCapabilities")] = ( - SessionCapabilities() - ) + annotations: Optional[Annotations] = None + text: str class AgentErrorMessage(BaseModel): @@ -2182,6 +3588,99 @@ class _AvailableCommandsUpdate(BaseModel): ] +class ClientCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Authentication capabilities supported by the client. + # Determines which authentication method types the agent may include + # in its `InitializeResponse`. + auth: Annotated[ + Optional[AuthCapabilities], + Field( + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication capabilities supported by the client.\nDetermines which authentication method types the agent may include\nin its `InitializeResponse`." + ), + ] = {"terminal": False} + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Elicitation capabilities supported by the client. + # Determines which elicitation modes the agent may use. + elicitation: Annotated[ + Optional[ElicitationCapabilities], + Field( + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nElicitation capabilities supported by the client.\nDetermines which elicitation modes the agent may use." + ), + ] = None + # File system capabilities supported by the client. + # Determines which file operations the agent can request. + fs: Annotated[ + Optional[FileSystemCapabilities], + Field( + description="File system capabilities supported by the client.\nDetermines which file operations the agent can request." + ), + ] = FileSystemCapabilities() + # **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 client. + nes: Annotated[ + Optional[ClientNesCapabilities], + Field( + 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." + ), + ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # The position encodings supported by the client, in order of preference. + position_encodings: Annotated[ + Optional[List[str]], + Field( + alias="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.", + ), + ] = None + # Whether the Client support all `terminal/*` methods. + terminal: Annotated[ + Optional[bool], + Field(description="Whether the Client support all `terminal/*` methods."), + ] = False + + +class ClientNotification(BaseModel): + method: str + params: Optional[ + Union[ + CancelNotification, + DidOpenDocumentNotification, + DidChangeDocumentNotification, + DidCloseDocumentNotification, + DidSaveDocumentNotification, + DidFocusDocumentNotification, + AcceptNesNotification, + RejectNesNotification, + Any, + ] + ] = None + + class ClientResponseMessage(BaseModel): # JSON RPC Request Id # @@ -2214,6 +3713,11 @@ class ClientResponseMessage(BaseModel): ReleaseTerminalResponse, WaitForTerminalExitResponse, KillTerminalResponse, + Union[ + AcceptElicitationResponse, + DeclineElicitationResponse, + CancelElicitationResponse, + ], Any, ], Field( @@ -2257,6 +3761,61 @@ class ResourceContentBlock(ResourceLink): type: Literal["resource_link"] +class CreateUrlElicitationRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # A human-readable message describing what input is needed. + message: Annotated[ + str, + Field(description="A human-readable message describing what input is needed."), + ] + mode: Literal["url"] + + +class ElicitationMultiSelectPropertySchema(MultiSelectPropertySchema): + type: Literal["array"] + + +class ElicitationSchema(BaseModel): + # Optional description of what this schema represents. + description: Annotated[ + Optional[str], + Field(description="Optional description of what this schema represents."), + ] = None + # Property definitions (must be primitive types). + properties: Annotated[ + Optional[ + Dict[ + str, + Union[ + ElicitationStringPropertySchema, + ElicitationNumberPropertySchema, + ElicitationIntegerPropertySchema, + ElicitationBooleanPropertySchema, + ElicitationMultiSelectPropertySchema, + ], + ] + ], + Field(description="Property definitions (must be primitive types)."), + ] = {} + # List of required property names. + required: Annotated[Optional[List[str]], Field(description="List of required property names.")] = None + # Optional title for the schema. + title: Annotated[Optional[str], Field(description="Optional title for the schema.")] = None + # Type discriminator. Always `"object"`. + type: Annotated[Optional[str], Field(description='Type discriminator. Always `"object"`.')] = "object" + + class EmbeddedResource(BaseModel): # 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 @@ -2291,6 +3850,22 @@ class ForkSessionRequest(BaseModel): 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/extensibility)", ), ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # 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 forked + # session. + additional_directories: Annotated[ + Optional[List[str]], + Field( + alias="additionalDirectories", + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional 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.", + ), + ] = None # The working directory for this session. cwd: Annotated[str, Field(description="The working directory for this session.")] # List of MCP servers to connect to for this session. @@ -2305,7 +3880,7 @@ class ForkSessionRequest(BaseModel): session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to fork.")] -class InitializeResponse(BaseModel): +class InitializeRequest(BaseModel): # 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. @@ -2318,41 +3893,30 @@ class InitializeResponse(BaseModel): 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/extensibility)", ), ] = None - # Capabilities supported by the agent. - agent_capabilities: Annotated[ - Optional[AgentCapabilities], + # Capabilities supported by the client. + client_capabilities: Annotated[ + Optional[ClientCapabilities], Field( - alias="agentCapabilities", - description="Capabilities supported by the agent.", + alias="clientCapabilities", + description="Capabilities supported by the client.", ), - ] = AgentCapabilities() - # Information about the Agent name and version sent to the Client. + ] = ClientCapabilities() + # Information about the Client name and version sent to the Agent. # # Note: in future versions of the protocol, this will be required. - agent_info: Annotated[ + client_info: Annotated[ Optional[Implementation], Field( - alias="agentInfo", - description="Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required.", + alias="clientInfo", + description="Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required.", ), ] = None - # Authentication methods supported by the agent. - auth_methods: Annotated[ - Optional[List[Union[EnvVarAuthMethod, TerminalAuthMethod, AuthMethodAgent]]], - Field( - alias="authMethods", - description="Authentication methods supported by the agent.", - ), - ] = [] - # 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. + # The latest protocol version supported by the client. protocol_version: Annotated[ int, Field( alias="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 latest protocol version supported by the client.", ge=0, le=65535, ), @@ -2372,6 +3936,22 @@ class LoadSessionRequest(BaseModel): 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/extensibility)", ), ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # 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 loaded + # session. + additional_directories: Annotated[ + Optional[List[str]], + Field( + alias="additionalDirectories", + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional 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 loaded\nsession.", + ), + ] = None # The working directory for this session. cwd: Annotated[str, Field(description="The working directory for this session.")] # List of MCP servers to connect to for this session. @@ -2386,6 +3966,100 @@ class LoadSessionRequest(BaseModel): session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to load.")] +class NesCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Context the agent wants attached to each suggestion request. + context: Annotated[ + Optional[NesContextCapabilities], + Field(description="Context the agent wants attached to each suggestion request."), + ] = None + # Events the agent wants to receive. + events: Annotated[ + Optional[NesEventCapabilities], + Field(description="Events the agent wants to receive."), + ] = None + + +class NesEditSuggestion(BaseModel): + # Optional suggested cursor position after applying edits. + cursor_position: Annotated[ + Optional[Position], + Field( + alias="cursorPosition", + description="Optional suggested cursor position after applying edits.", + ), + ] = None + # The text edits to apply. + edits: Annotated[List[NesTextEdit], Field(description="The text edits to apply.")] + # Unique identifier for accept/reject tracking. + id: Annotated[str, Field(description="Unique identifier for accept/reject tracking.")] + # The URI of the file to edit. + uri: Annotated[str, Field(description="The URI of the file to edit.")] + + +class NesSuggestContext(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Current diagnostics (errors, warnings). + diagnostics: Annotated[ + Optional[List[NesDiagnostic]], + Field(description="Current diagnostics (errors, warnings)."), + ] = None + # Recent edit history. + edit_history: Annotated[ + Optional[List[NesEditHistoryEntry]], + Field(alias="editHistory", description="Recent edit history."), + ] = None + # Currently open files in the editor. + open_files: Annotated[ + Optional[List[NesOpenFile]], + Field(alias="openFiles", description="Currently open files in the editor."), + ] = None + # Recently accessed files. + recent_files: Annotated[ + Optional[List[NesRecentFile]], + Field(alias="recentFiles", description="Recently accessed files."), + ] = None + # Related code snippets. + related_snippets: Annotated[ + Optional[List[NesRelatedSnippet]], + Field(alias="relatedSnippets", description="Related code snippets."), + ] = None + # Recent user actions (typing, navigation, etc.). + user_actions: Annotated[ + Optional[List[NesUserAction]], + Field( + alias="userActions", + description="Recent user actions (typing, navigation, etc.).", + ), + ] = None + + +class NesEditSuggestionVariant(NesEditSuggestion): + kind: Literal["edit"] + + class Plan(BaseModel): # 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 @@ -2443,6 +4117,157 @@ class AvailableCommandsUpdate(_AvailableCommandsUpdate): session_update: Annotated[Literal["available_commands_update"], Field(alias="sessionUpdate")] +class SuggestNesRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Context for the suggestion, included based on agent capabilities. + context: Annotated[ + Optional[NesSuggestContext], + Field(description="Context for the suggestion, included based on agent capabilities."), + ] = None + # The current cursor position. + position: Annotated[Position, Field(description="The current cursor position.")] + # The current text selection range, if any. + selection: Annotated[Optional[Range], Field(description="The current text selection range, if any.")] = None + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # What triggered this suggestion request. + trigger_kind: Annotated[ + str, + Field(alias="triggerKind", description="What triggered this suggestion request."), + ] + # The URI of the document to suggest for. + uri: Annotated[str, Field(description="The URI of the document to suggest for.")] + # The version number of the document. + version: Annotated[int, Field(description="The version number of the document.")] + + +class SuggestNesResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # The list of suggestions. + suggestions: Annotated[ + List[ + Union[ + NesEditSuggestionVariant, + NesJumpSuggestionVariant, + NesRenameSuggestionVariant, + NesSearchAndReplaceSuggestionVariant, + ] + ], + Field(description="The list of suggestions."), + ] + + +class AgentCapabilities(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Authentication-related capabilities supported by the agent. + auth: Annotated[ + Optional[AgentAuthCapabilities], + Field( + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication-related capabilities supported by the agent." + ), + ] = {} + # Whether the agent supports `session/load`. + load_session: Annotated[ + Optional[bool], + Field( + alias="loadSession", + description="Whether the agent supports `session/load`.", + ), + ] = False + # MCP capabilities supported by the agent. + mcp_capabilities: Annotated[ + Optional[McpCapabilities], + Field( + alias="mcpCapabilities", + description="MCP capabilities supported by the agent.", + ), + ] = McpCapabilities() + # **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. + nes: Annotated[ + Optional[NesCapabilities], + Field( + 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." + ), + ] = None + # **UNSTABLE** + # + # 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. + position_encoding: Annotated[ + Optional[str], + Field( + alias="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.", + ), + ] = None + # Prompt capabilities supported by the agent. + prompt_capabilities: Annotated[ + Optional[PromptCapabilities], + Field( + alias="promptCapabilities", + description="Prompt capabilities supported by the agent.", + ), + ] = PromptCapabilities() + # **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. + # + # By supplying `{}` it means that the agent supports provider configuration methods. + providers: Annotated[ + Optional[ProvidersCapabilities], + Field( + 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\nBy supplying `{}` it means that the agent supports provider configuration methods." + ), + ] = None + session_capabilities: Annotated[Optional[SessionCapabilities], Field(alias="sessionCapabilities")] = ( + SessionCapabilities() + ) + + class EmbeddedResourceContentBlock(EmbeddedResource): type: Literal["resource"] @@ -2485,6 +4310,96 @@ class ContentChunk(BaseModel): ] = None +class ElicitationFormSessionMode(ElicitationSessionScope): + # A JSON Schema describing the form fields to present to the user. + requested_schema: Annotated[ + ElicitationSchema, + Field( + alias="requestedSchema", + description="A JSON Schema describing the form fields to present to the user.", + ), + ] + + +class ElicitationFormRequestMode(ElicitationRequestScope): + # A JSON Schema describing the form fields to present to the user. + requested_schema: Annotated[ + ElicitationSchema, + Field( + alias="requestedSchema", + description="A JSON Schema describing the form fields to present to the user.", + ), + ] + + +class ElicitationFormMode(RootModel[Union[ElicitationFormSessionMode, ElicitationFormRequestMode]]): + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Form-based elicitation mode where the client renders a form from the provided schema. + root: Annotated[ + Union[ElicitationFormSessionMode, ElicitationFormRequestMode], + Field( + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nForm-based elicitation mode where the client renders a form from the provided schema." + ), + ] + + +class InitializeResponse(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # Capabilities supported by the agent. + agent_capabilities: Annotated[ + Optional[AgentCapabilities], + Field( + alias="agentCapabilities", + description="Capabilities supported by the agent.", + ), + ] = AgentCapabilities() + # Information about the Agent name and version sent to the Client. + # + # Note: in future versions of the protocol, this will be required. + agent_info: Annotated[ + Optional[Implementation], + Field( + alias="agentInfo", + description="Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required.", + ), + ] = None + # Authentication methods supported by the agent. + auth_methods: Annotated[ + Optional[List[Union[EnvVarAuthMethod, TerminalAuthMethod, AuthMethodAgent]]], + Field( + alias="authMethods", + description="Authentication methods supported by the agent.", + ), + ] = [] + # 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. + protocol_version: Annotated[ + int, + Field( + alias="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.", + ge=0, + le=65535, + ), + ] + + class PromptRequest(BaseModel): # 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 @@ -2594,6 +4509,10 @@ class ClientRequest(BaseModel): Union[ InitializeRequest, AuthenticateRequest, + ListProvidersRequest, + SetProvidersRequest, + DisableProvidersRequest, + LogoutRequest, NewSessionRequest, LoadSessionRequest, ListSessionsRequest, @@ -2603,6 +4522,9 @@ class ClientRequest(BaseModel): SetSessionModeRequest, PromptRequest, SetSessionModelRequest, + StartNesRequest, + SuggestNesRequest, + CloseNesRequest, Union[SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionSelectRequest], Any, ] @@ -2631,6 +4553,27 @@ class Content(BaseModel): ] +class CreateFormElicitationRequest(BaseModel): + # 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/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], + Field( + alias="_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/extensibility)", + ), + ] = None + # A human-readable message describing what input is needed. + message: Annotated[ + str, + Field(description="A human-readable message describing what input is needed."), + ] + mode: Literal["form"] + + class SessionConfigOptionSelect(SessionConfigSelect): # 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 @@ -3065,6 +5008,7 @@ class AgentRequest(BaseModel): ReleaseTerminalRequest, WaitForTerminalExitRequest, KillTerminalRequest, + Union[CreateFormElicitationRequest, CreateUrlElicitationRequest], Any, ] ] = None @@ -3096,6 +5040,10 @@ class AgentResponseMessage(BaseModel): Union[ InitializeResponse, AuthenticateResponse, + ListProvidersResponse, + SetProvidersResponse, + DisableProvidersResponse, + LogoutResponse, NewSessionResponse, LoadSessionResponse, ListSessionsResponse, @@ -3106,6 +5054,9 @@ class AgentResponseMessage(BaseModel): SetSessionConfigOptionResponse, PromptResponse, SetSessionModelResponse, + StartNesResponse, + SuggestNesResponse, + CloseNesResponse, Any, ], Field( @@ -3164,4 +5115,4 @@ class SessionNotification(BaseModel): class AgentNotification(BaseModel): method: str - params: Optional[Union[SessionNotification, Any]] = None + params: Optional[Union[SessionNotification, CompleteElicitationNotification, Any]] = None diff --git a/tests/test_rpc.py b/tests/test_rpc.py index b30e358..19bdc6c 100644 --- a/tests/test_rpc.py +++ b/tests/test_rpc.py @@ -2,7 +2,7 @@ import json import sys from pathlib import Path -from typing import Any +from typing import Any, cast import pytest @@ -36,6 +36,7 @@ DeniedOutcome, EmbeddedResourceContentBlock, EnvVariable, + ForkSessionResponse, HttpMcpServer, ImageContentBlock, Implementation, @@ -43,6 +44,7 @@ McpServerStdio, PermissionOption, ResourceContentBlock, + ResumeSessionResponse, SseMcpServer, TextContentBlock, ToolCallLocation, @@ -51,7 +53,7 @@ ToolCallUpdate, UserMessageChunk, ) -from tests.conftest import TestClient +from tests.conftest import TestAgent, TestClient # ------------------------ Tests -------------------------- @@ -327,6 +329,102 @@ async def test_list_sessions_stable(connect, agent, client): assert resp.sessions == [] +@pytest.mark.asyncio +async def test_session_additional_directories_roundtrip(server): + class _AdditionalDirectoriesAgent(TestAgent): + __test__ = False + + def __init__(self) -> None: + super().__init__() + self.calls: dict[str, list[str] | None] = {} + + async def new_session( + self, + cwd: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, + ) -> NewSessionResponse: + self.calls["new"] = additional_directories + return NewSessionResponse(session_id="sess") + + async def load_session( + self, + cwd: str, + session_id: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, + ) -> LoadSessionResponse | None: + self.calls["load"] = additional_directories + return LoadSessionResponse() + + async def list_sessions( + self, + additional_directories: list[str] | None = None, + cursor: str | None = None, + cwd: str | None = None, + **kwargs: Any, + ) -> ListSessionsResponse: + self.calls["list"] = additional_directories + return ListSessionsResponse(sessions=[]) + + async def fork_session( + self, + cwd: str, + session_id: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, + ) -> ForkSessionResponse: + self.calls["fork"] = additional_directories + return ForkSessionResponse(session_id="forked") + + async def resume_session( + self, + cwd: str, + session_id: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, + ) -> ResumeSessionResponse: + self.calls["resume"] = additional_directories + return ResumeSessionResponse() + + agent = _AdditionalDirectoriesAgent() + agent_side = AgentSideConnection( + cast(Agent, agent), + server.server_writer, + server.server_reader, + listening=True, + use_unstable_protocol=True, + ) + client_side = ClientSideConnection( + TestClient(), + server.client_writer, + server.client_reader, + use_unstable_protocol=True, + ) + directories = ["/workspace/lib", "/workspace/tools"] + + await client_side.new_session(cwd="/workspace", additional_directories=directories) + await client_side.load_session(cwd="/workspace", session_id="sess", additional_directories=directories) + await client_side.list_sessions(cwd="/workspace", additional_directories=directories) + await client_side.fork_session(cwd="/workspace", session_id="sess", additional_directories=directories) + await client_side.resume_session(cwd="/workspace", session_id="sess", additional_directories=directories) + + assert agent.calls == { + "new": directories, + "load": directories, + "list": directories, + "fork": directories, + "resume": directories, + } + + await client_side.close() + await agent_side.close() + + @pytest.mark.asyncio async def test_ignore_invalid_messages(connect, server): connect(connect_agent=True, connect_client=False) diff --git a/uv.lock b/uv.lock index eda1e22..a1d2bd7 100644 --- a/uv.lock +++ b/uv.lock @@ -4,7 +4,7 @@ requires-python = ">=3.10, <3.15" [[package]] name = "agent-client-protocol" -version = "0.9.0" +version = "0.12.2" source = { editable = "." } dependencies = [ { name = "pydantic" }, From 8bbc6f4e6e66f00dab2e3ef8bd8f65c0f0a82370 Mon Sep 17 00:00:00 2001 From: Chojan Shang Date: Wed, 6 May 2026 16:30:55 +0000 Subject: [PATCH 2/2] *: refine Signed-off-by: Chojan Shang --- docs/quickstart.md | 16 ++++++----- examples/agent.py | 16 +++++++++-- examples/client.py | 14 ++++++++-- examples/echo_agent.py | 9 ++++-- examples/gemini.py | 63 ++++++++++++++++++++++++++++++++++-------- pyproject.toml | 2 +- uv.lock | 2 +- 7 files changed, 93 insertions(+), 29 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 08a6602..5e79205 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -92,8 +92,9 @@ import asyncio import sys from pathlib import Path from typing import Any +from uuid import uuid4 -from acp import spawn_agent_process, text_block +from acp import PROTOCOL_VERSION, spawn_agent_process, text_block from acp.interfaces import Client @@ -110,11 +111,12 @@ class SimpleClient(Client): async def main() -> None: script = Path("examples/echo_agent.py") async with spawn_agent_process(SimpleClient(), sys.executable, str(script)) as (conn, _proc): - await conn.initialize(protocol_version=1) + await conn.initialize(protocol_version=PROTOCOL_VERSION) session = await conn.new_session(cwd=str(script.parent), mcp_servers=[]) await conn.prompt( session_id=session.session_id, prompt=[text_block("Hello from spawn!")], + message_id=str(uuid4()), ) asyncio.run(main()) @@ -133,9 +135,9 @@ from acp import Agent, PromptResponse class MyAgent(Agent): - async def prompt(self, prompt, session_id, **kwargs) -> PromptResponse: + async def prompt(self, prompt, session_id, message_id=None, **kwargs) -> PromptResponse: # inspect prompt, stream updates, then finish the turn - return PromptResponse(stop_reason="end_turn") + return PromptResponse(stop_reason="end_turn", user_message_id=message_id) ``` Run it with `run_agent()` inside an async entrypoint and wire it to your client. Refer to: @@ -143,7 +145,7 @@ Run it with `run_agent()` inside an async entrypoint and wire it to your client. - [`examples/echo_agent.py`](https://github.com/agentclientprotocol/python-sdk/blob/main/examples/echo_agent.py) for the smallest streaming agent - [`examples/agent.py`](https://github.com/agentclientprotocol/python-sdk/blob/main/examples/agent.py) for an implementation that negotiates capabilities and streams richer updates - [`examples/duet.py`](https://github.com/agentclientprotocol/python-sdk/blob/main/examples/duet.py) to see `spawn_agent_process` in action alongside the interactive client -- [`examples/gemini.py`](https://github.com/agentclientprotocol/python-sdk/blob/main/examples/gemini.py) to drive the Gemini CLI (`--experimental-acp`) directly from Python +- [`examples/gemini.py`](https://github.com/agentclientprotocol/python-sdk/blob/main/examples/gemini.py) to drive the Gemini CLI (`--acp`) directly from Python Need builders for common payloads? `acp.helpers` mirrors the Go/TS helper APIs: @@ -167,8 +169,8 @@ _Have the Gemini CLI installed? Run the bridge to exercise permission flows._ If you have the Gemini CLI installed and authenticated: ```bash -python examples/gemini.py --yolo # auto-approve permission prompts -python examples/gemini.py --sandbox --model gemini-1.5-pro +python examples/gemini.py --skip-trust --yolo # auto-approve permission prompts +python examples/gemini.py --skip-trust --sandbox --model gemini-1.5-pro ``` Environment helpers: diff --git a/examples/agent.py b/examples/agent.py index af9979e..6182580 100644 --- a/examples/agent.py +++ b/examples/agent.py @@ -65,7 +65,11 @@ async def authenticate(self, method_id: str, **kwargs: Any) -> AuthenticateRespo return AuthenticateResponse() async def new_session( - self, cwd: str, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio], **kwargs: Any + self, + cwd: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, ) -> NewSessionResponse: logging.info("Received new session request") session_id = str(self._next_session_id) @@ -74,7 +78,12 @@ async def new_session( return NewSessionResponse(session_id=session_id, modes=None) async def load_session( - self, cwd: str, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio], session_id: str, **kwargs: Any + self, + cwd: str, + session_id: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, ) -> LoadSessionResponse | None: logging.info("Received load session request %s", session_id) self._sessions.add(session_id) @@ -94,6 +103,7 @@ async def prompt( | EmbeddedResourceContentBlock ], session_id: str, + message_id: str | None = None, **kwargs: Any, ) -> PromptResponse: logging.info("Received prompt request for session %s", session_id) @@ -103,7 +113,7 @@ async def prompt( await self._send_agent_message(session_id, text_block("Client sent:")) for block in prompt: await self._send_agent_message(session_id, block) - return PromptResponse(stop_reason="end_turn") + return PromptResponse(stop_reason="end_turn", user_message_id=message_id) async def cancel(self, session_id: str, **kwargs: Any) -> None: logging.info("Received cancel notification for session %s", session_id) diff --git a/examples/client.py b/examples/client.py index 2abcc1a..138ab7f 100644 --- a/examples/client.py +++ b/examples/client.py @@ -6,6 +6,7 @@ import sys from pathlib import Path from typing import Any +from uuid import uuid4 from acp import ( PROTOCOL_VERSION, @@ -22,6 +23,7 @@ AudioContentBlock, AvailableCommandsUpdate, ClientCapabilities, + ConfigOptionUpdate, CreateTerminalResponse, CurrentModeUpdate, EmbeddedResourceContentBlock, @@ -34,11 +36,13 @@ ReleaseTerminalResponse, RequestPermissionResponse, ResourceContentBlock, + SessionInfoUpdate, TerminalOutputResponse, TextContentBlock, - ToolCall, ToolCallProgress, ToolCallStart, + ToolCallUpdate, + UsageUpdate, UserMessageChunk, WaitForTerminalExitResponse, WriteTextFileResponse, @@ -47,7 +51,7 @@ class ExampleClient(Client): async def request_permission( - self, options: list[PermissionOption], session_id: str, tool_call: ToolCall, **kwargs: Any + self, options: list[PermissionOption], session_id: str, tool_call: ToolCallUpdate, **kwargs: Any ) -> RequestPermissionResponse: raise RequestError.method_not_found("session/request_permission") @@ -99,7 +103,10 @@ async def session_update( | ToolCallProgress | AgentPlanUpdate | AvailableCommandsUpdate - | CurrentModeUpdate, + | CurrentModeUpdate + | ConfigOptionUpdate + | SessionInfoUpdate + | UsageUpdate, **kwargs: Any, ) -> None: if not isinstance(update, AgentMessageChunk): @@ -151,6 +158,7 @@ async def interactive_loop(conn: ClientSideConnection, session_id: str) -> None: await conn.prompt( session_id=session_id, prompt=[text_block(line)], + message_id=str(uuid4()), ) except Exception as exc: logging.error("Prompt failed: %s", exc) # noqa: TRY400 diff --git a/examples/echo_agent.py b/examples/echo_agent.py index 0f376fb..3eec09c 100644 --- a/examples/echo_agent.py +++ b/examples/echo_agent.py @@ -48,7 +48,11 @@ async def initialize( return InitializeResponse(protocol_version=protocol_version) async def new_session( - self, cwd: str, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio], **kwargs: Any + self, + cwd: str, + additional_directories: list[str] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + **kwargs: Any, ) -> NewSessionResponse: return NewSessionResponse(session_id=uuid4().hex) @@ -62,6 +66,7 @@ async def prompt( | EmbeddedResourceContentBlock ], session_id: str, + message_id: str | None = None, **kwargs: Any, ) -> PromptResponse: for block in prompt: @@ -71,7 +76,7 @@ async def prompt( chunk.content.field_meta = {"echo": True} await self._conn.session_update(session_id=session_id, update=chunk, source="echo_agent") - return PromptResponse(stop_reason="end_turn") + return PromptResponse(stop_reason="end_turn", user_message_id=message_id) async def main() -> None: diff --git a/examples/gemini.py b/examples/gemini.py index 60eed0a..bc824af 100644 --- a/examples/gemini.py +++ b/examples/gemini.py @@ -27,6 +27,7 @@ AllowedOutcome, AvailableCommandsUpdate, ClientCapabilities, + ConfigOptionUpdate, CreateTerminalResponse, CurrentModeUpdate, DeniedOutcome, @@ -40,12 +41,14 @@ ReleaseTerminalResponse, RequestPermissionResponse, ResourceContentBlock, + SessionInfoUpdate, TerminalOutputResponse, TerminalToolCallContent, TextContentBlock, - ToolCall, ToolCallProgress, ToolCallStart, + ToolCallUpdate, + UsageUpdate, UserMessageChunk, WaitForTerminalExitResponse, WriteTextFileResponse, @@ -59,7 +62,7 @@ def __init__(self, auto_approve: bool) -> None: self._auto_approve = auto_approve async def request_permission( - self, options: list[PermissionOption], session_id: str, tool_call: ToolCall, **kwargs: Any + self, options: list[PermissionOption], session_id: str, tool_call: ToolCallUpdate, **kwargs: Any ) -> RequestPermissionResponse: if self._auto_approve: option = _pick_preferred_option(options) @@ -122,7 +125,10 @@ async def session_update( # noqa: C901 | ToolCallProgress | AgentPlanUpdate | AvailableCommandsUpdate - | CurrentModeUpdate, + | CurrentModeUpdate + | ConfigOptionUpdate + | SessionInfoUpdate + | UsageUpdate, **kwargs: Any, ) -> None: if isinstance(update, AgentMessageChunk): @@ -227,7 +233,18 @@ def _print_text_content(content: object) -> None: print(text) -async def interactive_loop(conn: ClientSideConnection, session_id: str) -> None: +async def _send_prompt(conn: ClientSideConnection, session_id: str, prompt: str, timeout: float | None) -> None: + request = conn.prompt( + session_id=session_id, + prompt=[text_block(prompt)], + ) + if timeout is None: + await request + return + await asyncio.wait_for(request, timeout=timeout) + + +async def interactive_loop(conn: ClientSideConnection, session_id: str, prompt_timeout: float | None) -> None: print("Type a message and press Enter to send.") print("Commands: :cancel, :exit") @@ -248,10 +265,11 @@ async def interactive_loop(conn: ClientSideConnection, session_id: str) -> None: continue try: - await conn.prompt( - session_id=session_id, - prompt=[text_block(line)], - ) + await _send_prompt(conn, session_id, line, prompt_timeout) + except asyncio.TimeoutError: + print("prompt timed out waiting for final ACP response", file=sys.stderr) + with contextlib.suppress(Exception): + await asyncio.wait_for(conn.cancel(session_id=session_id), timeout=2) except RequestError as err: _print_request_error("prompt", err) except Exception as exc: @@ -274,10 +292,20 @@ async def run(argv: list[str]) -> int: # noqa: C901 parser = argparse.ArgumentParser(description="Interact with the Gemini CLI over ACP.") parser.add_argument("--gemini", help="Path to the Gemini CLI binary") parser.add_argument("--model", help="Model identifier to pass to Gemini") + parser.add_argument("--prompt", help="Send one prompt and exit") + parser.add_argument( + "--prompt-timeout", + type=float, + default=120.0, + help="Seconds to wait for session/prompt to finish; use 0 to disable", + ) parser.add_argument("--sandbox", action="store_true", help="Enable Gemini sandbox mode") parser.add_argument("--debug", action="store_true", help="Pass --debug to Gemini") + parser.add_argument("--experimental-acp", action="store_true", help="Use Gemini's deprecated ACP flag") + parser.add_argument("--skip-trust", action="store_true", help="Trust the current workspace for this session") parser.add_argument("--yolo", action="store_true", help="Auto-approve permission prompts") args = parser.parse_args(argv[1:]) + prompt_timeout = None if args.prompt_timeout == 0 else args.prompt_timeout try: gemini_path = _resolve_gemini_cli(args.gemini) @@ -285,13 +313,15 @@ async def run(argv: list[str]) -> int: # noqa: C901 print(exc, file=sys.stderr) return 1 - cmd = [gemini_path, "--experimental-acp"] + cmd = [gemini_path, "--experimental-acp" if args.experimental_acp else "--acp"] if args.model: cmd += ["--model", args.model] if args.sandbox: cmd.append("--sandbox") if args.debug: cmd.append("--debug") + if args.skip_trust: + cmd.append("--skip-trust") try: proc = await asyncio.create_subprocess_exec( @@ -350,7 +380,15 @@ async def run(argv: list[str]) -> int: # noqa: C901 print(f"📝 Created session: {session.session_id}") try: - await interactive_loop(conn, session.session_id) + if args.prompt is None: + await interactive_loop(conn, session.session_id, prompt_timeout) + else: + await _send_prompt(conn, session.session_id, args.prompt, prompt_timeout) + except asyncio.TimeoutError: + print("prompt timed out waiting for final ACP response", file=sys.stderr) + with contextlib.suppress(Exception): + await asyncio.wait_for(conn.cancel(session_id=session.session_id), timeout=2) + return 1 finally: await _shutdown(proc, conn) @@ -373,14 +411,15 @@ def _print_request_error(stage: str, err: RequestError) -> None: async def _shutdown(proc: asyncio.subprocess.Process, conn: ClientSideConnection) -> None: with contextlib.suppress(Exception): - await conn.close() + await asyncio.wait_for(conn.close(), timeout=2) if proc.returncode is None: proc.terminate() try: await asyncio.wait_for(proc.wait(), timeout=5) except asyncio.TimeoutError: proc.kill() - await proc.wait() + with contextlib.suppress(Exception): + await asyncio.wait_for(proc.wait(), timeout=5) def main(argv: list[str] | None = None) -> int: diff --git a/pyproject.toml b/pyproject.toml index 09a07d8..e8eb93d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "agent-client-protocol" -version = "0.12.2" +version = "0.10.0" description = "A Python implement of Agent Client Protocol (ACP, by Zed Industries)" authors = [ { name = "Chojan Shang", email = "psiace@apache.org" }, diff --git a/uv.lock b/uv.lock index a1d2bd7..8ac1c1f 100644 --- a/uv.lock +++ b/uv.lock @@ -4,7 +4,7 @@ requires-python = ">=3.10, <3.15" [[package]] name = "agent-client-protocol" -version = "0.12.2" +version = "0.10.0" source = { editable = "." } dependencies = [ { name = "pydantic" },