diff --git a/docs/index.md b/docs/index.md index 4f70105..88dc076 100644 --- a/docs/index.md +++ b/docs/index.md @@ -38,6 +38,7 @@ Next steps live in the [Quickstart](quickstart.md): launch the echo agent, wire | Real-world adopters | [use-cases.md](use-cases.md) | | Contrib helpers | [contrib.md](contrib.md) | | Releasing workflow | [releasing.md](releasing.md) | +| Upgrade to 0.11 | [migration-guide-0.11.md](migration-guide-0.11.md) | | Example scripts | [github.com/agentclientprotocol/python-sdk/tree/main/examples](https://github.com/agentclientprotocol/python-sdk/tree/main/examples) | ## Choose a path @@ -52,6 +53,7 @@ Next steps live in the [Quickstart](quickstart.md): launch the echo agent, wire - [Use Cases](use-cases.md) — real adopters with succinct descriptions of what they build. - [Experimental Contrib](contrib.md) — deep dives on the `acp.contrib` utilities. - [Releasing](releasing.md) — schema upgrade process, versioning policy, and publishing checklist. +- [0.11 Migration Guide](migration-guide-0.11.md) — interface signature updates, elicitation, and schema notes for 0.10 users. Need API-level details? Browse the source in `src/acp/` or generate docs with `mkdocstrings`. diff --git a/docs/migration-guide-0.11.md b/docs/migration-guide-0.11.md new file mode 100644 index 0000000..a34ab5b --- /dev/null +++ b/docs/migration-guide-0.11.md @@ -0,0 +1,144 @@ +# Migrating to ACP Python SDK 0.11 + +ACP Python SDK 0.11 updates the generated bindings to `schema-v1.16.0` and aligns the high-level interfaces with the new schema. Most applications only need to update method signatures and review the new unstable capabilities. Agents and clients that already pass keyword arguments are the easiest to migrate. + +## 1. Regenerate schema-derived code + +If your project vendors ACP schema files, generated models, or protocol metadata, regenerate them against the same upstream schema tag: + +```bash +ACP_SCHEMA_VERSION=schema-v1.16.0 make gen-all +``` + +The SDK package version is `0.11.0`, while the protocol schema tag is `schema-v1.16.0`. + +## 2. Update interface method signatures + +Several generated request models changed field order or fields. The SDK now exposes those shapes through `Agent` and `Client` protocol methods. Prefer keyword calls when invoking connection helpers; keyword calls are stable across field-order changes. + +### Client methods + +Update client implementations from the 0.10 positional order: + +```python +async def request_permission(self, options, session_id, tool_call, **kwargs): ... +async def write_text_file(self, content, path, session_id, **kwargs): ... +async def read_text_file(self, path, session_id, limit=None, line=None, **kwargs): ... +async def create_terminal(self, command, session_id, args=None, cwd=None, env=None, **kwargs): ... +``` + +to the 0.11 order: + +```python +async def request_permission(self, session_id, tool_call, options, **kwargs): ... +async def write_text_file(self, session_id, path, content, **kwargs): ... +async def read_text_file(self, session_id, path, line=None, limit=None, **kwargs): ... +async def create_terminal(self, session_id, command, args=None, env=None, cwd=None, **kwargs): ... +``` + +### Agent methods + +Update agent implementations from the 0.10 prompt and mode signatures: + +```python +async def set_session_mode(self, mode_id, session_id, **kwargs): ... +async def prompt(self, prompt, session_id, message_id=None, **kwargs): ... +``` + +to the 0.11 signatures: + +```python +async def set_session_mode(self, session_id, mode_id, **kwargs): ... +async def prompt(self, session_id, prompt, **kwargs): ... +``` + +The `message_id` field was removed from `PromptRequest`. If your client generated a user message ID before calling `conn.prompt(...)`, stop passing it there. Message IDs now belong to streamed content chunks such as `UserMessageChunk` and `AgentMessageChunk`. + +## 3. Remove `session/model` handling + +The generated `SetSessionModelRequest` and `SetSessionModelResponse` types are no longer exported, and the `Agent.set_session_model(...)` protocol method is gone. If your agent used this endpoint to switch models, move that behavior into session modes or configuration options exposed through `set_session_mode(...)` and `set_config_option(...)`. + +## 4. Handle elicitation if your agent or client advertises it + +0.11 adds schema and connection support for the unstable `elicitation/create` request and `elicitation/complete` notification. + +Clients that advertise elicitation support should implement: + +```python +from typing import Any + +from acp import AcceptElicitationResponse, Client, CreateElicitationResponse, ElicitationMode + + +class MyClient(Client): + async def create_elicitation( + self, + message: str, + mode: ElicitationMode, + **kwargs: Any, + ) -> CreateElicitationResponse: + return AcceptElicitationResponse(action="accept", content={}) + + async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None: + ... +``` + +Agents can request structured input through the connected client: + +```python +from acp import ( + ElicitationFormSessionMode, + ElicitationSchema, + ElicitationStringPropertySchema, +) + +response = await client_conn.create_elicitation( + message="Choose a deployment target", + mode=ElicitationFormSessionMode( + session_id=session_id, + requested_schema=ElicitationSchema( + properties={"target": ElicitationStringPropertySchema(type="string")}, + required=["target"], + ), + ), +) +``` + +For URL-based flows, use `ElicitationUrlSessionMode` or `ElicitationUrlRequestMode` and call `complete_elicitation(...)` once the external flow finishes. + +## 5. Review new session update variants + +Clients that exhaustively match `session_update` variants should add the new plan update variants: + +```python +from acp.schema import AgentPlanContentUpdate, AgentPlanRemovedUpdate + +async def session_update(self, session_id, update, **kwargs): + if isinstance(update, AgentPlanContentUpdate): + ... + elif isinstance(update, AgentPlanRemovedUpdate): + ... +``` + +The existing full-plan `AgentPlanUpdate` variant remains available. + +## 6. Review MCP server configuration types + +Session creation, loading, forking, and resuming now accept `AcpMcpServer` in addition to HTTP, SSE, and stdio MCP server definitions: + +```python +from acp.schema import AcpMcpServer, HttpMcpServer, McpServerStdio, SseMcpServer +``` + +If you validate `mcp_servers` with your own union, add `AcpMcpServer` to keep accepting all SDK-supported server types. + +## 7. Re-run examples and checks + +After changing signatures, run the standard gates: + +```bash +make check +make test +``` + +Also run any example or integration that subclasses `Agent` or `Client`. Positional argument bugs usually surface there first; using keyword arguments for connection calls avoids most of them. diff --git a/docs/quickstart.md b/docs/quickstart.md index 79a5a0e..04ef33d 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -71,7 +71,7 @@ Or, if using `uv`: "args": [ "run", "/abs/path/to/agentclientprotocol/python-sdk/examples/echo_agent.py" - ], + ] } } } @@ -92,7 +92,6 @@ import asyncio import sys from pathlib import Path from typing import Any -from uuid import uuid4 from acp import PROTOCOL_VERSION, spawn_agent_process, text_block from acp.interfaces import Client @@ -100,7 +99,7 @@ from acp.interfaces import Client class SimpleClient(Client): async def request_permission( - self, options, session_id, tool_call, **kwargs: Any + self, session_id, tool_call, options, **kwargs: Any ): return {"outcome": {"outcome": "cancelled"}} @@ -116,7 +115,6 @@ async def main() -> None: await conn.prompt( session_id=session.session_id, prompt=[text_block("Hello from spawn!")], - message_id=str(uuid4()), ) asyncio.run(main()) @@ -135,9 +133,9 @@ from acp import Agent, PromptResponse class MyAgent(Agent): - async def prompt(self, prompt, session_id, message_id=None, **kwargs) -> PromptResponse: + async def prompt(self, session_id, prompt, **kwargs) -> PromptResponse: # inspect prompt, stream updates, then finish the turn - return PromptResponse(stop_reason="end_turn", user_message_id=message_id) + return PromptResponse(stop_reason="end_turn") ``` Run it with `run_agent()` inside an async entrypoint and wire it to your client. Refer to: diff --git a/docs/releasing.md b/docs/releasing.md index 0e3c42a..68fd50e 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -4,9 +4,9 @@ Every package release tracks an upstream ACP schema tag from [`agentclientprotoc ## Prep checklist -1. **Choose the schema tag** (e.g. `v0.4.5`) and regenerate artifacts: +1. **Choose the schema tag** (e.g. `schema-v1.16.0`) and regenerate artifacts: ```bash - ACP_SCHEMA_VERSION=v0.4.5 make gen-all + ACP_SCHEMA_VERSION=schema-v1.16.0 make gen-all ``` This refreshes `schema/` and the generated `src/acp/schema.py`. 2. **Bump the SDK version** in `pyproject.toml` using a PEP 440 version string (for example `0.9.0a1` for an alpha release), and sync `uv.lock` if the lockfile is tracked. diff --git a/examples/agent.py b/examples/agent.py index 6182580..9ee0272 100644 --- a/examples/agent.py +++ b/examples/agent.py @@ -89,12 +89,13 @@ async def load_session( self._sessions.add(session_id) return LoadSessionResponse() - async def set_session_mode(self, mode_id: str, session_id: str, **kwargs: Any) -> SetSessionModeResponse | None: + async def set_session_mode(self, session_id: str, mode_id: str, **kwargs: Any) -> SetSessionModeResponse | None: logging.info("Received set session mode request %s -> %s", session_id, mode_id) return SetSessionModeResponse() async def prompt( self, + session_id: str, prompt: list[ TextContentBlock | ImageContentBlock @@ -102,8 +103,6 @@ async def prompt( | ResourceContentBlock | EmbeddedResourceContentBlock ], - session_id: str, - message_id: str | None = None, **kwargs: Any, ) -> PromptResponse: logging.info("Received prompt request for session %s", session_id) @@ -113,7 +112,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", user_message_id=message_id) + return PromptResponse(stop_reason="end_turn") 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 138ab7f..653aaad 100644 --- a/examples/client.py +++ b/examples/client.py @@ -6,7 +6,6 @@ import sys from pathlib import Path from typing import Any -from uuid import uuid4 from acp import ( PROTOCOL_VERSION, @@ -18,14 +17,19 @@ from acp.core import ClientSideConnection from acp.schema import ( AgentMessageChunk, + AgentPlanContentUpdate, + AgentPlanRemovedUpdate, AgentPlanUpdate, AgentThoughtChunk, AudioContentBlock, AvailableCommandsUpdate, ClientCapabilities, ConfigOptionUpdate, + CreateElicitationResponse, CreateTerminalResponse, CurrentModeUpdate, + DeclineElicitationResponse, + ElicitationMode, EmbeddedResourceContentBlock, EnvVariable, ImageContentBlock, @@ -51,27 +55,27 @@ class ExampleClient(Client): async def request_permission( - self, options: list[PermissionOption], session_id: str, tool_call: ToolCallUpdate, **kwargs: Any + self, session_id: str, tool_call: ToolCallUpdate, options: list[PermissionOption], **kwargs: Any ) -> RequestPermissionResponse: raise RequestError.method_not_found("session/request_permission") async def write_text_file( - self, content: str, path: str, session_id: str, **kwargs: Any + self, session_id: str, path: str, content: str, **kwargs: Any ) -> WriteTextFileResponse | None: raise RequestError.method_not_found("fs/write_text_file") async def read_text_file( - self, path: str, session_id: str, limit: int | None = None, line: int | None = None, **kwargs: Any + self, session_id: str, path: str, line: int | None = None, limit: int | None = None, **kwargs: Any ) -> ReadTextFileResponse: raise RequestError.method_not_found("fs/read_text_file") async def create_terminal( self, - command: str, session_id: str, + command: str, args: list[str] | None = None, - cwd: str | None = None, env: list[EnvVariable] | None = None, + cwd: str | None = None, output_byte_limit: int | None = None, **kwargs: Any, ) -> CreateTerminalResponse: @@ -93,6 +97,13 @@ async def wait_for_terminal_exit( async def kill_terminal(self, session_id: str, terminal_id: str, **kwargs: Any) -> KillTerminalResponse | None: raise RequestError.method_not_found("terminal/kill") + async def create_elicitation(self, message: str, mode: ElicitationMode, **kwargs: Any) -> CreateElicitationResponse: + print(f"| Agent requested input: {message} ({type(mode).__name__})") + return DeclineElicitationResponse(action="decline") + + async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None: + print(f"| Agent completed elicitation: {elicitation_id}") + async def session_update( self, session_id: str, @@ -102,6 +113,8 @@ async def session_update( | ToolCallStart | ToolCallProgress | AgentPlanUpdate + | AgentPlanContentUpdate + | AgentPlanRemovedUpdate | AvailableCommandsUpdate | CurrentModeUpdate | ConfigOptionUpdate @@ -158,7 +171,6 @@ 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 3eec09c..ffb84bc 100644 --- a/examples/echo_agent.py +++ b/examples/echo_agent.py @@ -58,6 +58,7 @@ async def new_session( async def prompt( self, + session_id: str, prompt: list[ TextContentBlock | ImageContentBlock @@ -65,8 +66,6 @@ async def prompt( | ResourceContentBlock | EmbeddedResourceContentBlock ], - session_id: str, - message_id: str | None = None, **kwargs: Any, ) -> PromptResponse: for block in prompt: @@ -76,7 +75,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", user_message_id=message_id) + return PromptResponse(stop_reason="end_turn") async def main() -> None: diff --git a/examples/gemini.py b/examples/gemini.py index 85c862f..ebbb244 100644 --- a/examples/gemini.py +++ b/examples/gemini.py @@ -22,15 +22,20 @@ from acp.core import ClientSideConnection from acp.schema import ( AgentMessageChunk, + AgentPlanContentUpdate, + AgentPlanRemovedUpdate, AgentPlanUpdate, AgentThoughtChunk, AllowedOutcome, AvailableCommandsUpdate, ClientCapabilities, ConfigOptionUpdate, + CreateElicitationResponse, CreateTerminalResponse, CurrentModeUpdate, + DeclineElicitationResponse, DeniedOutcome, + ElicitationMode, EmbeddedResourceContentBlock, EnvVariable, FileEditToolCallContent, @@ -62,7 +67,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: ToolCallUpdate, **kwargs: Any + self, session_id: str, tool_call: ToolCallUpdate, options: list[PermissionOption], **kwargs: Any ) -> RequestPermissionResponse: if self._auto_approve: option = _pick_preferred_option(options) @@ -93,7 +98,7 @@ async def request_permission( print("Invalid selection, try again.") async def write_text_file( - self, content: str, path: str, session_id: str, **kwargs: Any + self, session_id: str, path: str, content: str, **kwargs: Any ) -> WriteTextFileResponse | None: pathlib_path = Path(path) if not pathlib_path.is_absolute(): @@ -104,7 +109,7 @@ async def write_text_file( return WriteTextFileResponse() async def read_text_file( - self, path: str, session_id: str, limit: int | None = None, line: int | None = None, **kwargs: Any + self, session_id: str, path: str, line: int | None = None, limit: int | None = None, **kwargs: Any ) -> ReadTextFileResponse: pathlib_path = Path(path) if not pathlib_path.is_absolute(): @@ -124,6 +129,8 @@ async def session_update( # noqa: C901 | ToolCallStart | ToolCallProgress | AgentPlanUpdate + | AgentPlanContentUpdate + | AgentPlanRemovedUpdate | AvailableCommandsUpdate | CurrentModeUpdate | ConfigOptionUpdate @@ -143,6 +150,10 @@ async def session_update( # noqa: C901 print("\n[plan]") for entry in update.entries: print(f" - {entry.status.upper():<10} {entry.content}") + elif isinstance(update, AgentPlanContentUpdate): + print(f"\n[plan update] {update.plan.id}") + elif isinstance(update, AgentPlanRemovedUpdate): + print(f"\n[plan removed] {update.id}") elif isinstance(update, ToolCallStart): print(f"\nšŸ”§ {update.title} ({update.status or 'pending'})") elif isinstance(update, ToolCallProgress): @@ -162,17 +173,24 @@ async def session_update( # noqa: C901 # Optional / terminal-related methods --------------------------------- async def create_terminal( self, - command: str, session_id: str, + command: str, args: list[str] | None = None, - cwd: str | None = None, env: list[EnvVariable] | None = None, + cwd: str | None = None, output_byte_limit: int | None = None, **kwargs: Any, ) -> CreateTerminalResponse: print(f"[Client] createTerminal: {command} {args or []} (cwd={cwd})") return CreateTerminalResponse(terminal_id="term-1") + async def create_elicitation(self, message: str, mode: ElicitationMode, **kwargs: Any) -> CreateElicitationResponse: + print(f"\n[elicitation] {message} ({type(mode).__name__})") + return DeclineElicitationResponse(action="decline") + + async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None: + print(f"\n[elicitation complete] {elicitation_id}") + async def terminal_output(self, session_id: str, terminal_id: str, **kwargs: Any) -> TerminalOutputResponse: print(f"[Client] terminalOutput: {session_id} {terminal_id}") return TerminalOutputResponse(output="", truncated=False) diff --git a/mkdocs.yml b/mkdocs.yml index 6a7a76e..09e3ea4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -13,6 +13,7 @@ nav: - Use Cases: use-cases.md - Experimental Contrib: contrib.md - Releasing: releasing.md + - 0.11 Migration Guide: migration-guide-0.11.md - 0.7 Migration Guide: migration-guide-0.7.md - 0.8 Migration Guide: migration-guide-0.8.md plugins: diff --git a/pyproject.toml b/pyproject.toml index eaab0e0..6432be2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "agent-client-protocol" -version = "0.10.1" +version = "0.11.0" 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 f1d3366..994766d 100644 --- a/schema/VERSION +++ b/schema/VERSION @@ -1 +1 @@ -refs/tags/v0.12.2 +refs/tags/schema-v1.16.0 diff --git a/schema/meta.json b/schema/meta.json index 6d1dd24..d8937f3 100644 --- a/schema/meta.json +++ b/schema/meta.json @@ -1,48 +1,52 @@ { + "version": 1, "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", + "authenticate": "authenticate", "providers_list": "providers/list", "providers_set": "providers/set", - "session_cancel": "session/cancel", - "session_close": "session/close", - "session_fork": "session/fork", - "session_list": "session/list", - "session_load": "session/load", + "providers_disable": "providers/disable", "session_new": "session/new", + "session_load": "session/load", + "session_set_mode": "session/set_mode", + "session_set_config_option": "session/set_config_option", "session_prompt": "session/prompt", + "session_cancel": "session/cancel", + "mcp_message": "mcp/message", + "session_list": "session/list", + "session_delete": "session/delete", + "session_fork": "session/fork", "session_resume": "session/resume", - "session_set_config_option": "session/set_config_option", - "session_set_mode": "session/set_mode", - "session_set_model": "session/set_model" + "session_close": "session/close", + "logout": "logout", + "nes_start": "nes/start", + "nes_suggest": "nes/suggest", + "nes_accept": "nes/accept", + "nes_reject": "nes/reject", + "nes_close": "nes/close", + "document_did_open": "document/didOpen", + "document_did_change": "document/didChange", + "document_did_close": "document/didClose", + "document_did_save": "document/didSave", + "document_did_focus": "document/didFocus" }, "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", "session_update": "session/update", + "fs_write_text_file": "fs/write_text_file", + "fs_read_text_file": "fs/read_text_file", "terminal_create": "terminal/create", - "terminal_kill": "terminal/kill", "terminal_output": "terminal/output", "terminal_release": "terminal/release", - "terminal_wait_for_exit": "terminal/wait_for_exit" + "terminal_wait_for_exit": "terminal/wait_for_exit", + "terminal_kill": "terminal/kill", + "mcp_connect": "mcp/connect", + "mcp_message": "mcp/message", + "mcp_disconnect": "mcp/disconnect", + "elicitation_create": "elicitation/create", + "elicitation_complete": "elicitation/complete" }, "protocolMethods": { "cancel_request": "$/cancel_request" - }, - "version": 1 + } } diff --git a/schema/schema.json b/schema/schema.json index 709a0d9..a117ee8 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1,194 +1,122 @@ { - "$defs": { - "AcceptNesNotification": { - "description": "Notification sent when a suggestion is accepted.", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Agent Client Protocol", + "anyOf": [ + { + "title": "Agent", + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "type": "object", "properties": { - "_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" + "jsonrpc": { + "type": "string", + "enum": [ + "2.0" ] - }, - "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" + "jsonrpc" ], - "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" - }, + "anyOf": [ + { + "title": "Request", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/AgentRequest" } - ], - "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": { - "_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" ] }, - "auth": { + { + "title": "Response", "allOf": [ { - "$ref": "#/$defs/AgentAuthCapabilities" + "$ref": "#/$defs/AgentResponse" } - ], - "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`.", - "type": "boolean" + ] }, - "mcpCapabilities": { + { + "title": "Notification", "allOf": [ { - "$ref": "#/$defs/McpCapabilities" - } - ], - "default": { - "http": false, - "sse": false - }, - "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" + "$ref": "#/$defs/AgentNotification" } - ], - "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": { + ] + } + ] + }, + { + "title": "Client", + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "type": "object", + "properties": { + "jsonrpc": { + "type": "string", + "enum": [ + "2.0" + ] + } + }, + "required": [ + "jsonrpc" + ], + "anyOf": [ + { + "title": "Request", "allOf": [ { - "$ref": "#/$defs/PromptCapabilities" + "$ref": "#/$defs/ClientRequest" } - ], - "default": { - "audio": false, - "embeddedContext": false, - "image": false - }, - "description": "Prompt capabilities supported by the agent." + ] }, - "providers": { - "anyOf": [ - { - "$ref": "#/$defs/ProvidersCapabilities" - }, + { + "title": "Response", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/ClientResponse" } - ], - "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": { + { + "title": "Notification", "allOf": [ { - "$ref": "#/$defs/SessionCapabilities" + "$ref": "#/$defs/ClientNotification" } - ], - "default": {} + ] } - }, - "type": "object" + ] }, - "AgentNotification": { + { + "title": "ProtocolLevel", + "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "type": "object", "properties": { + "jsonrpc": { + "type": "string", + "enum": [ + "2.0" + ] + }, "method": { + "description": "The notification method name.", "type": "string" }, "params": { + "description": "Method-specific notification parameters.", "anyOf": [ { + "description": "General protocol-level notifications that all sides are expected to\nimplement.\n\nNotifications whose methods start with '$/' are messages which\nare protocol implementation dependent and might not be implementable in all\nclients or agents. For example if the implementation uses a single threaded\nsynchronous programming language then there is little it can do to react to\na `$/cancel_request` notification. If an agent or client receives\nnotifications starting with '$/' it is free to ignore the notification.\n\nNotifications do not expect a response.", "anyOf": [ { + "title": "CancelRequestNotification", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or\nchanged at any point.\n\nCancels an ongoing request.\n\nThis is a notification sent by the side that sent a request to cancel that request.\n\nUpon receiving this notification, the receiver:\n\n1. MUST cancel the corresponding request activity and all nested activities\n2. MAY send any pending notifications.\n3. MUST send one of these responses for the original request:\n - Valid response with appropriate data (partial results or cancellation marker)\n - Error response with code `-32800` (Cancelled)\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)", "allOf": [ { - "$ref": "#/$defs/SessionNotification" - } - ], - "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" + "$ref": "#/$defs/CancelRequestNotification" } - ], - "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": [ - { - "$ref": "#/$defs/ExtNotification" - } - ], - "description": "Handles extension notifications from the agent.\n\nAllows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtNotification" + ] } - ], - "description": "All possible notifications that an agent can send to a client.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly - use the notification methods on the [`Client`] trait instead.\n\nNotifications do not expect a response." + ] }, { "type": "null" @@ -197,115 +125,153 @@ } }, "required": [ + "jsonrpc", "method" ], - "type": "object", "x-docs-ignore": true - }, + } + ], + "$defs": { "AgentRequest": { + "description": "A JSON-RPC request object.", + "type": "object", "properties": { "id": { - "$ref": "#/$defs/RequestId" + "description": "The request id used to correlate the matching response.", + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ] }, "method": { + "description": "The method name to invoke.", "type": "string" }, "params": { + "description": "Method-specific request parameters.", "anyOf": [ { + "description": "All possible requests that an agent can send to a client.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly.\n\nThis enum encompasses all method calls from agent to client.", "anyOf": [ { + "title": "WriteTextFileRequest", + "description": "Writes content to a text file in the client's file system.\n\nOnly available if the client advertises the `fs.writeTextFile` capability.\nAllows the agent to create or modify files within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)", "allOf": [ { "$ref": "#/$defs/WriteTextFileRequest" } - ], - "description": "Writes content to a text file in the client's file system.\n\nOnly available if the client advertises the `fs.writeTextFile` capability.\nAllows the agent to create or modify files within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)", - "title": "WriteTextFileRequest" + ] }, { + "title": "ReadTextFileRequest", + "description": "Reads content from a text file in the client's file system.\n\nOnly available if the client advertises the `fs.readTextFile` capability.\nAllows the agent to access file contents within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)", "allOf": [ { "$ref": "#/$defs/ReadTextFileRequest" } - ], - "description": "Reads content from a text file in the client's file system.\n\nOnly available if the client advertises the `fs.readTextFile` capability.\nAllows the agent to access file contents within the client's environment.\n\nSee protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)", - "title": "ReadTextFileRequest" + ] }, { + "title": "RequestPermissionRequest", + "description": "Requests permission from the user for a tool call operation.\n\nCalled by the agent when it needs user authorization before executing\na potentially sensitive operation. The client should present the options\nto the user and return their decision.\n\nIf the client cancels the prompt turn via `session/cancel`, it MUST\nrespond to this request with `RequestPermissionOutcome::Cancelled`.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)", "allOf": [ { "$ref": "#/$defs/RequestPermissionRequest" } - ], - "description": "Requests permission from the user for a tool call operation.\n\nCalled by the agent when it needs user authorization before executing\na potentially sensitive operation. The client should present the options\nto the user and return their decision.\n\nIf the client cancels the prompt turn via `session/cancel`, it MUST\nrespond to this request with `RequestPermissionOutcome::Cancelled`.\n\nSee protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)", - "title": "RequestPermissionRequest" + ] }, { + "title": "CreateTerminalRequest", + "description": "Executes a command in a new terminal\n\nOnly available if the `terminal` Client capability is set to `true`.\n\nReturns a `TerminalId` that can be used with other terminal methods\nto get the current output, wait for exit, and kill the command.\n\nThe `TerminalId` can also be used to embed the terminal in a tool call\nby using the `ToolCallContent::Terminal` variant.\n\nThe Agent is responsible for releasing the terminal by using the `terminal/release`\nmethod.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", "allOf": [ { "$ref": "#/$defs/CreateTerminalRequest" } - ], - "description": "Executes a command in a new terminal\n\nOnly available if the `terminal` Client capability is set to `true`.\n\nReturns a `TerminalId` that can be used with other terminal methods\nto get the current output, wait for exit, and kill the command.\n\nThe `TerminalId` can also be used to embed the terminal in a tool call\nby using the `ToolCallContent::Terminal` variant.\n\nThe Agent is responsible for releasing the terminal by using the `terminal/release`\nmethod.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "CreateTerminalRequest" + ] }, { + "title": "TerminalOutputRequest", + "description": "Gets the terminal output and exit status\n\nReturns the current content in the terminal without waiting for the command to exit.\nIf the command has already exited, the exit status is included.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", "allOf": [ { "$ref": "#/$defs/TerminalOutputRequest" } - ], - "description": "Gets the terminal output and exit status\n\nReturns the current content in the terminal without waiting for the command to exit.\nIf the command has already exited, the exit status is included.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "TerminalOutputRequest" + ] }, { + "title": "ReleaseTerminalRequest", + "description": "Releases a terminal\n\nThe command is killed if it hasn't exited yet. Use `terminal/wait_for_exit`\nto wait for the command to exit before releasing the terminal.\n\nAfter release, the `TerminalId` can no longer be used with other `terminal/*` methods,\nbut tool calls that already contain it, continue to display its output.\n\nThe `terminal/kill` method can be used to terminate the command without releasing\nthe terminal, allowing the Agent to call `terminal/output` and other methods.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", "allOf": [ { "$ref": "#/$defs/ReleaseTerminalRequest" } - ], - "description": "Releases a terminal\n\nThe command is killed if it hasn't exited yet. Use `terminal/wait_for_exit`\nto wait for the command to exit before releasing the terminal.\n\nAfter release, the `TerminalId` can no longer be used with other `terminal/*` methods,\nbut tool calls that already contain it, continue to display its output.\n\nThe `terminal/kill` method can be used to terminate the command without releasing\nthe terminal, allowing the Agent to call `terminal/output` and other methods.\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "ReleaseTerminalRequest" + ] }, { + "title": "WaitForTerminalExitRequest", + "description": "Waits for the terminal command to exit and return its exit status\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", "allOf": [ { "$ref": "#/$defs/WaitForTerminalExitRequest" } - ], - "description": "Waits for the terminal command to exit and return its exit status\n\nSee protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)", - "title": "WaitForTerminalExitRequest" + ] }, { + "title": "KillTerminalRequest", + "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)", "allOf": [ { "$ref": "#/$defs/KillTerminalRequest" } - ], - "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" + ] }, { + "title": "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.", "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" + ] }, { + "title": "ConnectMcpRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nOpens an MCP-over-ACP connection.", "allOf": [ { - "$ref": "#/$defs/ExtRequest" + "$ref": "#/$defs/ConnectMcpRequest" + } + ] + }, + { + "title": "MessageMcpRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nExchanges an MCP-over-ACP message.", + "allOf": [ + { + "$ref": "#/$defs/MessageMcpRequest" + } + ] + }, + { + "title": "DisconnectMcpRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCloses an MCP-over-ACP connection.", + "allOf": [ + { + "$ref": "#/$defs/DisconnectMcpRequest" } - ], + ] + }, + { + "title": "ExtMethodRequest", "description": "Handles extension method requests from the agent.\n\nAllows the Agent to send an arbitrary request that is not part of the ACP spec.\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtMethodRequest" + "allOf": [ + { + "$ref": "#/$defs/ExtRequest" + } + ] } - ], - "description": "All possible requests that an agent can send to a client.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly - instead, use the methods on the [`Client`] trait.\n\nThis enum encompasses all method calls from agent to client." + ] }, { "type": "null" @@ -317,3401 +283,3815 @@ "id", "method" ], - "type": "object", "x-docs-ignore": true }, - "AgentResponse": { + "RequestId": { + "description": "JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null \\[1\\] and Numbers SHOULD NOT contain fractional parts \\[2\\]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n\\[1\\] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n\\[2\\] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.", "anyOf": [ { - "properties": { - "id": { - "$ref": "#/$defs/RequestId" - }, - "result": { - "anyOf": [ - { - "allOf": [ - { - "$ref": "#/$defs/InitializeResponse" - } - ], - "title": "InitializeResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/AuthenticateResponse" - } - ], - "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": [ - { - "$ref": "#/$defs/NewSessionResponse" - } - ], - "title": "NewSessionResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/LoadSessionResponse" - } - ], - "title": "LoadSessionResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ListSessionsResponse" - } - ], - "title": "ListSessionsResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ForkSessionResponse" - } - ], - "title": "ForkSessionResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ResumeSessionResponse" - } - ], - "title": "ResumeSessionResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/CloseSessionResponse" - } - ], - "title": "CloseSessionResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SetSessionModeResponse" - } - ], - "title": "SetSessionModeResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SetSessionConfigOptionResponse" - } - ], - "title": "SetSessionConfigOptionResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/PromptResponse" - } - ], - "title": "PromptResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SetSessionModelResponse" - } - ], - "title": "SetSessionModelResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/StartNesResponse" - } - ], - "title": "StartNesResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SuggestNesResponse" - } - ], - "title": "SuggestNesResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/CloseNesResponse" - } - ], - "title": "CloseNesResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ExtResponse" - } - ], - "title": "ExtMethodResponse" - } - ], - "description": "All possible responses that an agent can send to a client.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `ClientRequest` variants." - } - }, - "required": [ - "id", - "result" - ], - "title": "Result", - "type": "object" + "title": "Null", + "description": "The JSON-RPC `null` request id.", + "type": "null" }, { - "properties": { - "error": { - "$ref": "#/$defs/Error" - }, - "id": { - "$ref": "#/$defs/RequestId" - } - }, - "required": [ - "id", - "error" - ], - "title": "Error", - "type": "object" + "title": "Number", + "description": "A numeric JSON-RPC request id.", + "type": "integer", + "format": "int64" + }, + { + "title": "Str", + "description": "A string JSON-RPC request id.", + "type": "string" } - ], - "x-docs-ignore": true + ] }, - "Annotations": { - "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed", + "WriteTextFileRequest": { + "description": "Request to write content to a text file.\n\nOnly available if the client supports the `fs.writeTextFile` capability.", + "type": "object", "properties": { + "sessionId": { + "description": "The session ID for this request.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "path": { + "description": "Absolute path to the file to write.", + "type": "string" + }, + "content": { + "description": "The text content to write to the file.", + "type": "string" + }, "_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" + ], + "additionalProperties": true + } + }, + "required": [ + "sessionId", + "path", + "content" + ], + "x-side": "client", + "x-method": "fs/write_text_file" + }, + "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" + }, + "ReadTextFileRequest": { + "description": "Request to read content from a text file.\n\nOnly available if the client supports the `fs.readTextFile` capability.", + "type": "object", + "properties": { + "sessionId": { + "description": "The session ID for this request.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } ] }, - "audience": { - "items": { - "$ref": "#/$defs/Role" - }, + "path": { + "description": "Absolute path to the file to read.", + "type": "string" + }, + "line": { + "description": "Line number to start reading from (1-based).", "type": [ - "array", + "integer", "null" - ] + ], + "format": "uint32", + "minimum": 0 }, - "lastModified": { + "limit": { + "description": "Maximum number of lines to read.", "type": [ - "string", + "integer", "null" - ] + ], + "format": "uint32", + "minimum": 0 }, - "priority": { - "format": "double", + "_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)", "type": [ - "number", + "object", "null" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "sessionId", + "path" + ], + "x-side": "client", + "x-method": "fs/read_text_file" }, - "AudioContent": { - "description": "Audio provided to or from an LLM.", + "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)", + "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" + "sessionId": { + "description": "The session ID for this request.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } ] }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, + "toolCall": { + "description": "Details about the tool call requiring permission.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/ToolCallUpdate" } ] }, - "data": { - "type": "string" + "options": { + "description": "Available permission options for the user to choose from.", + "type": "array", + "items": { + "$ref": "#/$defs/PermissionOption" + } }, - "mimeType": { - "type": "string" - } - }, - "required": [ - "data", - "mimeType" - ], - "type": "object" - }, - "AuthCapabilities": { - "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.\n\nAdvertised during initialization to inform the agent which authentication\nmethod types the client can handle. This governs opt-in types that require\nadditional client-side support.", - "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" - ] - }, - "terminal": { - "default": false, - "description": "Whether the client supports `terminal` authentication methods.\n\nWhen `true`, the agent may include `terminal` entries in its authentication methods.", - "type": "boolean" + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "sessionId", + "toolCall", + "options" + ], + "x-side": "client", + "x-method": "session/request_permission" }, - "AuthEnvVar": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nDescribes a single environment variable for an [`AuthMethodEnvVar`] authentication method.", + "ToolCallUpdate": { + "description": "An update to an existing tool call.\n\nUsed to report progress and results as tools execute. All fields except\nthe tool call ID are optional - only changed fields need to be included.\n\nSee protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)", + "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" + "toolCallId": { + "description": "The ID of the tool call being updated.", + "allOf": [ + { + "$ref": "#/$defs/ToolCallId" + } ] }, - "label": { - "description": "Human-readable label for this variable, displayed in client UI.", + "kind": { + "description": "Update the tool kind.", + "anyOf": [ + { + "$ref": "#/$defs/ToolKind" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "status": { + "description": "Update the execution status.", + "anyOf": [ + { + "$ref": "#/$defs/ToolCallStatus" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "title": { + "description": "Update the human-readable title.", "type": [ "string", "null" ] }, - "name": { - "description": "The environment variable name (e.g. `\"OPENAI_API_KEY\"`).", - "type": "string" + "content": { + "description": "Replace the content collection.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ToolCallContent" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "optional": { - "default": false, - "description": "Whether this variable is optional.\n\nDefaults to `false`.", - "type": "boolean" + "locations": { + "description": "Replace the locations collection.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/ToolCallLocation" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "secret": { - "default": true, - "description": "Whether this value is a secret (e.g. API key, token).\nClients should use a password-style input for secret vars.\n\nDefaults to `true`.", - "type": "boolean" + "rawInput": { + "description": "Update the raw input." + }, + "rawOutput": { + "description": "Update the raw output." + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "name" - ], - "type": "object" + "toolCallId" + ] }, - "AuthMethod": { - "anyOf": [ + "ToolCallId": { + "description": "Unique identifier for a tool call within a session.", + "type": "string" + }, + "ToolKind": { + "description": "Categories of tools that can be invoked.\n\nTool kinds help clients choose appropriate icons and optimize how they\ndisplay tool execution progress.\n\nSee protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)", + "oneOf": [ + { + "description": "Reading files or data.", + "type": "string", + "const": "read" + }, + { + "description": "Modifying files or content.", + "type": "string", + "const": "edit" + }, + { + "description": "Removing files or data.", + "type": "string", + "const": "delete" + }, + { + "description": "Moving or renaming files.", + "type": "string", + "const": "move" + }, + { + "description": "Searching for information.", + "type": "string", + "const": "search" + }, + { + "description": "Running commands or code.", + "type": "string", + "const": "execute" + }, + { + "description": "Internal reasoning or planning.", + "type": "string", + "const": "think" + }, + { + "description": "Retrieving external data.", + "type": "string", + "const": "fetch" + }, + { + "description": "Switching the current session mode.", + "type": "string", + "const": "switch_mode" + }, + { + "description": "Other tool types (default).", + "type": "string", + "const": "other" + } + ] + }, + "ToolCallStatus": { + "description": "Execution status of a tool call.\n\nTool calls progress through different statuses during their lifecycle.\n\nSee protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls#status)", + "oneOf": [ + { + "description": "The tool call hasn't started running yet because the input is either\nstreaming or we're awaiting approval.", + "type": "string", + "const": "pending" + }, + { + "description": "The tool call is currently running.", + "type": "string", + "const": "in_progress" + }, + { + "description": "The tool call completed successfully.", + "type": "string", + "const": "completed" + }, + { + "description": "The tool call failed with an error.", + "type": "string", + "const": "failed" + } + ] + }, + "ToolCallContent": { + "description": "Content produced by a tool call.\n\nTool calls can produce different types of content including\nstandard content blocks (text, images) or file diffs.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)", + "oneOf": [ { + "description": "Standard content block (text, images, resources).", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "content" + } + }, + "required": [ + "type" + ], "allOf": [ { - "$ref": "#/$defs/AuthMethodEnvVar" + "$ref": "#/$defs/Content" } - ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUser provides a key that the client passes to the agent as an environment variable.", + ] + }, + { + "description": "File modification shown as a diff.", + "type": "object", "properties": { "type": { - "const": "env_var", - "type": "string" + "type": "string", + "const": "diff" } }, "required": [ "type" ], - "type": "object" + "allOf": [ + { + "$ref": "#/$defs/Diff" + } + ] }, { + "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)", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "terminal" + } + }, + "required": [ + "type" + ], "allOf": [ { - "$ref": "#/$defs/AuthMethodTerminal" + "$ref": "#/$defs/Terminal" + } + ] + } + ], + "discriminator": { + "propertyName": "type" + } + }, + "ContentBlock": { + "description": "Content blocks represent displayable information in the Agent Client Protocol.\n\nThey provide a structured way to handle various types of user-facing content\u2014whether\nit's text from language models, images for analysis, or embedded resources for context.\n\nContent blocks appear in:\n- User prompts sent via `session/prompt`\n- Language model output streamed through `session/update` notifications\n- Progress updates and results from tool calls\n\nThis structure is compatible with the Model Context Protocol (MCP), enabling\nagents to seamlessly forward content from MCP tool outputs without transformation.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/content)", + "oneOf": [ + { + "description": "Text content. May be plain text or formatted with Markdown.\n\nAll agents MUST support text content blocks in prompts.\nClients SHOULD render this text as Markdown.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" } + }, + "required": [ + "type" ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nClient runs an interactive terminal for the user to authenticate via a TUI.", + "allOf": [ + { + "$ref": "#/$defs/TextContent" + } + ] + }, + { + "description": "Images for visual context or analysis.\n\nRequires the `image` prompt capability when included in prompts.", + "type": "object", "properties": { "type": { - "const": "terminal", - "type": "string" + "type": "string", + "const": "image" } }, "required": [ "type" ], - "type": "object" + "allOf": [ + { + "$ref": "#/$defs/ImageContent" + } + ] }, { + "description": "Audio data for transcription or analysis.\n\nRequires the `audio` prompt capability when included in prompts.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + } + }, + "required": [ + "type" + ], "allOf": [ { - "$ref": "#/$defs/AuthMethodAgent" + "$ref": "#/$defs/AudioContent" + } + ] + }, + { + "description": "References to resources that the agent can access.\n\nAll agents MUST support resource links in prompts.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "resource_link" } + }, + "required": [ + "type" ], - "description": "Agent handles authentication itself.\n\nThis is the default when no `type` is specified.", - "title": "agent" + "allOf": [ + { + "$ref": "#/$defs/ResourceLink" + } + ] + }, + { + "description": "Complete resource contents embedded directly in the message.\n\nPreferred for including context as it avoids extra round-trips.\n\nRequires the `embeddedContext` prompt capability when included in prompts.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "resource" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/EmbeddedResource" + } + ] } ], - "description": "Describes an available authentication method.\n\nThe `type` field acts as the discriminator in the serialized JSON form.\nWhen no `type` is present, the method is treated as `agent`." + "discriminator": { + "propertyName": "type" + } }, - "AuthMethodAgent": { - "description": "Agent handles authentication itself.\n\nThis is the default authentication method type.", + "Annotations": { + "description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed", + "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)", + "audience": { + "description": "Intended recipients for this content, such as the user or assistant.", "type": [ - "object", + "array", "null" - ] - }, - "description": { - "description": "Optional description providing more details about this authentication method.", + ], + "items": { + "$ref": "#/$defs/Role" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "lastModified": { + "description": "Timestamp indicating when the underlying resource was last modified.", "type": [ "string", "null" ] }, - "id": { - "description": "Unique identifier for this authentication method.", - "type": "string" + "priority": { + "description": "Relative importance of this content when clients choose what to surface.", + "type": [ + "number", + "null" + ], + "format": "double" }, - "name": { - "description": "Human-readable name of the authentication method.", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "type": "object" - }, - "AuthMethodEnvVar": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nEnvironment variable authentication method.\n\nThe user provides credentials that the client passes to the agent as environment variables.", - "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" - ] + ], + "additionalProperties": true + } + } + }, + "Role": { + "description": "The sender or recipient of messages and data in a conversation.", + "oneOf": [ + { + "description": "The assistant side of a conversation.", + "type": "string", + "const": "assistant" }, - "description": { - "description": "Optional description providing more details about this authentication method.", - "type": [ - "string", - "null" - ] + { + "description": "The user side of a conversation.", + "type": "string", + "const": "user" + } + ] + }, + "TextContent": { + "description": "Text provided to or from an LLM.", + "type": "object", + "properties": { + "annotations": { + "description": "Optional annotations that help clients decide how to display or route this content.", + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - "id": { - "description": "Unique identifier for this authentication method.", + "text": { + "description": "Text payload carried by this content block.", "type": "string" }, - "link": { - "description": "Optional link to a page where the user can obtain their credentials.", + "_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)", "type": [ - "string", + "object", "null" - ] - }, - "name": { - "description": "Human-readable name of the authentication method.", - "type": "string" - }, - "vars": { - "description": "The environment variables the client should set.", - "items": { - "$ref": "#/$defs/AuthEnvVar" - }, - "type": "array" + ], + "additionalProperties": true } }, "required": [ - "id", - "name", - "vars" - ], - "type": "object" + "text" + ] }, - "AuthMethodTerminal": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nTerminal-based authentication method.\n\nThe client runs an interactive terminal for the user to authenticate via a TUI.", + "ImageContent": { + "description": "An image provided to or from an LLM.", + "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" - ] + "annotations": { + "description": "Optional annotations that help clients decide how to display or route this content.", + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - "args": { - "description": "Additional arguments to pass when running the agent binary for terminal auth.", - "items": { - "type": "string" - }, - "type": "array" + "data": { + "description": "Base64-encoded media payload.", + "type": "string" }, - "description": { - "description": "Optional description providing more details about this authentication method.", + "mimeType": { + "description": "MIME type describing the encoded media payload.", + "type": "string" + }, + "uri": { + "description": "URI associated with this resource or media payload.", "type": [ "string", "null" ] }, - "env": { - "additionalProperties": { - "type": "string" - }, - "description": "Additional environment variables to set when running the agent binary for terminal auth.", - "type": "object" - }, - "id": { - "description": "Unique identifier for this authentication method.", - "type": "string" - }, - "name": { - "description": "Human-readable name of the authentication method.", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "type": "object" - }, - "AuthenticateRequest": { - "description": "Request parameters for the authenticate method.\n\nSpecifies which authentication method to use.", - "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" - ] - }, - "methodId": { - "description": "The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response.", - "type": "string" + ], + "additionalProperties": true } }, "required": [ - "methodId" - ], - "type": "object", - "x-method": "authenticate", - "x-side": "agent" + "data", + "mimeType" + ] }, - "AuthenticateResponse": { - "description": "Response to the `authenticate` 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" - ] - } - }, + "AudioContent": { + "description": "Audio provided to or from an LLM.", "type": "object", - "x-method": "authenticate", - "x-side": "agent" - }, - "AvailableCommand": { - "description": "Information about a command.", "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": "Human-readable description of what the command does.", - "type": "string" - }, - "input": { + "annotations": { + "description": "Optional annotations that help clients decide how to display or route this content.", "anyOf": [ { - "$ref": "#/$defs/AvailableCommandInput" + "$ref": "#/$defs/Annotations" }, { "type": "null" } ], - "description": "Input for the command if required" + "x-deserialize-default-on-error": true }, - "name": { - "description": "Command name (e.g., `create_plan`, `research_codebase`).", + "data": { + "description": "Base64-encoded media payload.", "type": "string" - } - }, - "required": [ - "name", - "description" - ], - "type": "object" - }, - "AvailableCommandInput": { - "anyOf": [ - { - "allOf": [ - { - "$ref": "#/$defs/UnstructuredCommandInput" - } - ], - "description": "All text that was typed after the command name is provided as input.", - "title": "unstructured" - } - ], - "description": "The input specification for a command." - }, - "AvailableCommandsUpdate": { - "description": "Available commands are ready or have changed", - "properties": { + }, + "mimeType": { + "description": "MIME type describing the encoded media payload.", + "type": "string" + }, "_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" - ] - }, - "availableCommands": { - "description": "Commands the agent can execute", - "items": { - "$ref": "#/$defs/AvailableCommand" - }, - "type": "array" + ], + "additionalProperties": true } }, "required": [ - "availableCommands" - ], - "type": "object" + "data", + "mimeType" + ] }, - "BlobResourceContents": { - "description": "Binary resource contents.", + "ResourceLink": { + "description": "A resource that the server is capable of reading, included in a prompt or tool call result.", + "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)", + "annotations": { + "description": "Optional annotations that help clients decide how to display or route this content.", + "anyOf": [ + { + "$ref": "#/$defs/Annotations" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "description": { + "description": "Optional human-readable details shown with this protocol object.", "type": [ - "object", + "string", "null" ] }, - "blob": { - "type": "string" - }, "mimeType": { + "description": "MIME type describing the encoded media payload.", "type": [ "string", "null" ] }, - "uri": { + "name": { + "description": "Human-readable name shown for this protocol object.", "type": "string" - } - }, - "required": [ - "blob", - "uri" - ], - "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.", + "size": { + "description": "Optional size of the linked resource in bytes, if known.", "type": [ - "string", + "integer", "null" - ] + ], + "format": "int64" }, "title": { - "description": "Optional title for the property.", + "description": "Optional display title for end-user UI.", "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": { + }, + "uri": { + "description": "URI associated with this resource or media payload.", + "type": "string" + }, "_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" + ], + "additionalProperties": true + } + }, + "required": [ + "name", + "uri" + ] + }, + "EmbeddedResourceResource": { + "description": "Resource content that can be embedded in a message.", + "anyOf": [ + { + "title": "TextResourceContents", + "description": "Text resource contents embedded directly in the message.", + "allOf": [ + { + "$ref": "#/$defs/TextResourceContents" + } ] }, - "sessionId": { + { + "title": "BlobResourceContents", + "description": "Binary resource contents embedded directly in the message.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/BlobResourceContents" } - ], - "description": "The ID of the session to cancel operations for." + ] } - }, - "required": [ - "sessionId" - ], - "type": "object", - "x-method": "session/cancel", - "x-side": "agent" + ] }, - "CancelRequestNotification": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification to cancel an ongoing request.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)", + "TextResourceContents": { + "description": "Text-based resource contents.", + "type": "object", "properties": { + "mimeType": { + "description": "MIME type describing the encoded media payload.", + "type": [ + "string", + "null" + ] + }, + "text": { + "description": "Text payload carried by this content block.", + "type": "string" + }, + "uri": { + "description": "URI associated with this resource or media payload.", + "type": "string" + }, "_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 ID of the request to cancel." + "additionalProperties": true } }, "required": [ - "requestId" - ], - "type": "object", - "x-method": "$/cancel_request", - "x-side": "protocol" + "text", + "uri" + ] }, - "ClientCapabilities": { - "description": "Capabilities supported by the client.\n\nAdvertised during initialization to inform the agent about\navailable features and methods.\n\nSee protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)", + "BlobResourceContents": { + "description": "Binary resource contents.", + "type": "object", "properties": { + "blob": { + "description": "Base64-encoded bytes for a binary resource payload.", + "type": "string" + }, + "mimeType": { + "description": "MIME type describing the encoded media payload.", + "type": [ + "string", + "null" + ] + }, + "uri": { + "description": "URI associated with this resource or media payload.", + "type": "string" + }, "_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" - ] - }, - "auth": { - "allOf": [ - { - "$ref": "#/$defs/AuthCapabilities" - } ], - "default": { - "terminal": false - }, - "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": { + "additionalProperties": true + } + }, + "required": [ + "blob", + "uri" + ] + }, + "EmbeddedResource": { + "description": "The contents of a resource, embedded into a prompt or tool call result.", + "type": "object", + "properties": { + "annotations": { + "description": "Optional annotations that help clients decide how to display or route this content.", "anyOf": [ { - "$ref": "#/$defs/ElicitationCapabilities" + "$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\nElicitation capabilities supported by the client.\nDetermines which elicitation modes the agent may use." + "x-deserialize-default-on-error": true }, - "fs": { + "resource": { + "description": "Embedded resource payload, either text or binary data.", "allOf": [ { - "$ref": "#/$defs/FileSystemCapabilities" + "$ref": "#/$defs/EmbeddedResourceResource" } - ], - "default": { - "readTextFile": false, - "writeTextFile": false - }, - "description": "File system capabilities supported by the client.\nDetermines which file operations the agent can request." + ] }, - "nes": { - "anyOf": [ - { - "$ref": "#/$defs/ClientNesCapabilities" - }, - { - "type": "null" - } + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "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.", - "type": "boolean" + "additionalProperties": true } }, - "type": "object" + "required": [ + "resource" + ] }, - "ClientNesCapabilities": { - "description": "NES capabilities advertised by the client during initialization.", + "Content": { + "description": "Standard content block (text, images, resources).", + "type": "object", "properties": { + "content": { + "description": "The actual content block.", + "allOf": [ + { + "$ref": "#/$defs/ContentBlock" + } + ] + }, "_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" + ], + "additionalProperties": true + } + }, + "required": [ + "content" + ] + }, + "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)", + "type": "object", + "properties": { + "path": { + "description": "The file path being modified.", + "type": "string" + }, + "oldText": { + "description": "The original content (None for new files).", + "type": [ + "string", + "null" ] }, - "jump": { - "anyOf": [ - { - "$ref": "#/$defs/NesJumpCapabilities" - }, - { - "type": "null" - } - ], - "description": "Whether the client supports the `jump` suggestion kind." + "newText": { + "description": "The new content after modification.", + "type": "string" }, - "rename": { - "anyOf": [ - { - "$ref": "#/$defs/NesRenameCapabilities" - }, - { - "type": "null" - } + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "description": "Whether the client supports the `rename` suggestion kind." - }, - "searchAndReplace": { - "anyOf": [ - { - "$ref": "#/$defs/NesSearchAndReplaceCapabilities" - }, + "additionalProperties": true + } + }, + "required": [ + "path", + "newText" + ] + }, + "TerminalId": { + "description": "Typed identifier used for terminal values on the wire.", + "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)", + "type": "object", + "properties": { + "terminalId": { + "description": "Identifier of the terminal instance to embed in the content stream.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/TerminalId" } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "description": "Whether the client supports the `searchAndReplace` suggestion kind." + "additionalProperties": true } }, - "type": "object" + "required": [ + "terminalId" + ] }, - "ClientNotification": { - "properties": { - "method": { + "ToolCallLocation": { + "description": "A file location being accessed or modified by a tool.\n\nEnables clients to implement \"follow-along\" features that track\nwhich files the agent is working with in real-time.\n\nSee protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)", + "type": "object", + "properties": { + "path": { + "description": "The file path being accessed or modified.", "type": "string" }, - "params": { - "anyOf": [ - { - "anyOf": [ - { - "allOf": [ - { - "$ref": "#/$defs/CancelNotification" - } - ], - "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": [ - { - "$ref": "#/$defs/ExtNotification" - } - ], - "description": "Handles extension notifications from the client.\n\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtNotification" - } - ], - "description": "All possible notifications that a client can send to an agent.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly - use the notification methods on the [`Agent`] trait instead.\n\nNotifications do not expect a response." - }, - { - "type": "null" - } - ] + "line": { + "description": "Optional line number within the file.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "method" - ], - "type": "object", - "x-docs-ignore": true + "path" + ] }, - "ClientRequest": { + "PermissionOption": { + "description": "An option presented to the user when requesting permission.", + "type": "object", "properties": { - "id": { - "$ref": "#/$defs/RequestId" + "optionId": { + "description": "Unique identifier for this permission option.", + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionId" + } + ] }, - "method": { + "name": { + "description": "Human-readable label to display to the user.", "type": "string" }, - "params": { - "anyOf": [ - { - "anyOf": [ - { - "allOf": [ - { - "$ref": "#/$defs/InitializeRequest" - } - ], - "description": "Establishes the connection with a client and negotiates protocol capabilities.\n\nThis method is called once at the beginning of the connection to:\n- Negotiate the protocol version to use\n- Exchange capability information between client and agent\n- Determine available authentication methods\n\nThe agent should respond with its supported protocol version and capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", - "title": "InitializeRequest" - }, - { - "allOf": [ - { - "$ref": "#/$defs/AuthenticateRequest" - } - ], - "description": "Authenticates the client using the specified authentication method.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", - "title": "AuthenticateRequest" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ListProvidersRequest" - } - ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLists providers that can be configured by the client.", - "title": "ListProvidersRequest" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SetProvidersRequest" - } - ], - "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/DisableProvidersRequest" - } - ], - "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" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ForkSessionRequest" - } - ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nForks an existing session to create a new independent session.\n\nThis method is only available if the agent advertises the `session.fork` capability.\n\nThe agent should create a new session with the same conversation context as the\noriginal, allowing operations like generating summaries without affecting the\noriginal session's history.", - "title": "ForkSessionRequest" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ResumeSessionRequest" - } - ], - "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" - }, - { - "allOf": [ - { - "$ref": "#/$defs/CloseSessionRequest" - } - ], - "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" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SetSessionModeRequest" - } - ], - "description": "Sets the current mode for a session.\n\nAllows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\nthat affect system prompts, tool availability, and permission behaviors.\n\nThe mode must be one of the modes advertised in `availableModes` during session\ncreation or loading. Agents may also change modes autonomously and notify the\nclient via `current_mode_update` notifications.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", - "title": "SetSessionModeRequest" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SetSessionConfigOptionRequest" - } - ], - "description": "Sets the current value for a session configuration option.", - "title": "SetSessionConfigOptionRequest" - }, - { - "allOf": [ - { - "$ref": "#/$defs/PromptRequest" - } - ], - "description": "Processes a user prompt within a session.\n\nThis method handles the whole lifecycle of a prompt:\n- Receives user messages with optional context (files, images, etc.)\n- Processes the prompt using language models\n- Reports language model content and tool calls to the Clients\n- Requests permission to run tools\n- Executes any requested tool calls\n- Returns when the turn is complete with a stop reason\n\nSee protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)", - "title": "PromptRequest" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SetSessionModelRequest" - } - ], - "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": [ - { - "$ref": "#/$defs/ExtRequest" - } - ], - "description": "Handles extension method requests from the client.\n\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", - "title": "ExtMethodRequest" - } - ], - "description": "All possible requests that a client can send to an agent.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly - instead, use the methods on the [`Agent`] trait.\n\nThis enum encompasses all method calls from client to agent." - }, + "kind": { + "description": "Hint about the nature of this permission option.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/PermissionOptionKind" } ] + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "id", - "method" - ], - "type": "object", - "x-docs-ignore": true + "optionId", + "name", + "kind" + ] }, - "ClientResponse": { - "anyOf": [ + "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": [ { - "properties": { - "id": { - "$ref": "#/$defs/RequestId" - }, - "result": { - "anyOf": [ - { - "allOf": [ - { - "$ref": "#/$defs/WriteTextFileResponse" - } - ], - "title": "WriteTextFileResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ReadTextFileResponse" - } - ], - "title": "ReadTextFileResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/RequestPermissionResponse" - } - ], - "title": "RequestPermissionResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/CreateTerminalResponse" - } - ], - "title": "CreateTerminalResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/TerminalOutputResponse" - } - ], - "title": "TerminalOutputResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ReleaseTerminalResponse" - } - ], - "title": "ReleaseTerminalResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/WaitForTerminalExitResponse" - } - ], - "title": "WaitForTerminalExitResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/KillTerminalResponse" - } - ], - "title": "KillTerminalResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/CreateElicitationResponse" - } - ], - "title": "CreateElicitationResponse" - }, - { - "allOf": [ - { - "$ref": "#/$defs/ExtResponse" - } - ], - "title": "ExtMethodResponse" - } - ], - "description": "All possible responses that a client can send to an agent.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `AgentRequest` variants." - } - }, - "required": [ - "id", - "result" - ], - "title": "Result", - "type": "object" + "description": "Allow this operation only this time.", + "type": "string", + "const": "allow_once" }, { - "properties": { - "error": { - "$ref": "#/$defs/Error" - }, - "id": { - "$ref": "#/$defs/RequestId" + "description": "Allow this operation and remember the choice.", + "type": "string", + "const": "allow_always" + }, + { + "description": "Reject this operation only this time.", + "type": "string", + "const": "reject_once" + }, + { + "description": "Reject this operation and remember the choice.", + "type": "string", + "const": "reject_always" + } + ] + }, + "CreateTerminalRequest": { + "description": "Request to create a new terminal and execute a command.", + "type": "object", + "properties": { + "sessionId": { + "description": "The session ID for this request.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" } - }, - "required": [ - "id", - "error" + ] + }, + "command": { + "description": "The command to execute.", + "type": "string" + }, + "args": { + "description": "Array of command arguments.", + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "description": "Environment variables for the command.", + "type": "array", + "items": { + "$ref": "#/$defs/EnvVariable" + } + }, + "cwd": { + "description": "Working directory for the command (absolute path).", + "type": [ + "string", + "null" + ] + }, + "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.", + "type": [ + "integer", + "null" ], - "title": "Error", - "type": "object" + "format": "uint64", + "minimum": 0 + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } + }, + "required": [ + "sessionId", + "command" ], - "x-docs-ignore": true + "x-side": "client", + "x-method": "terminal/create" }, - "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.", + "EnvVariable": { + "description": "An environment variable to set when launching an MCP server.", + "type": "object", "properties": { + "name": { + "description": "The name of the environment variable.", + "type": "string" + }, + "value": { + "description": "The value to set for the environment variable.", + "type": "string" + }, "_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" - ] - }, + ], + "additionalProperties": true + } + }, + "required": [ + "name", + "value" + ] + }, + "TerminalOutputRequest": { + "description": "Request to get the current output and status of a terminal.", + "type": "object", + "properties": { "sessionId": { + "description": "The session ID for this request.", "allOf": [ { "$ref": "#/$defs/SessionId" } + ] + }, + "terminalId": { + "description": "The ID of the terminal to get output from.", + "allOf": [ + { + "$ref": "#/$defs/TerminalId" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "description": "The ID of the NES session to close." + "additionalProperties": true } }, "required": [ - "sessionId" + "sessionId", + "terminalId" ], - "type": "object", - "x-method": "nes/close", - "x-side": "agent" + "x-side": "client", + "x-method": "terminal/output" }, - "CloseNesResponse": { - "description": "Response from closing an NES session.", + "ReleaseTerminalRequest": { + "description": "Request to release a terminal and free its resources.", + "type": "object", "properties": { + "sessionId": { + "description": "The session ID for this request.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "terminalId": { + "description": "The ID of the terminal to release.", + "allOf": [ + { + "$ref": "#/$defs/TerminalId" + } + ] + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "nes/close", - "x-side": "agent" + "required": [ + "sessionId", + "terminalId" + ], + "x-side": "client", + "x-method": "terminal/release" }, - "CloseSessionRequest": { - "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.", + "WaitForTerminalExitRequest": { + "description": "Request to wait for a terminal command to exit.", + "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" - ] - }, "sessionId": { + "description": "The session ID for this request.", "allOf": [ { "$ref": "#/$defs/SessionId" } + ] + }, + "terminalId": { + "description": "The ID of the terminal to wait for.", + "allOf": [ + { + "$ref": "#/$defs/TerminalId" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "description": "The ID of the session to close." + "additionalProperties": true } }, "required": [ - "sessionId" + "sessionId", + "terminalId" ], - "type": "object", - "x-method": "session/close", - "x-side": "agent" + "x-side": "client", + "x-method": "terminal/wait_for_exit" }, - "CloseSessionResponse": { - "description": "Response from closing a session.", + "KillTerminalRequest": { + "description": "Request to kill a terminal without releasing it.", + "type": "object", "properties": { + "sessionId": { + "description": "The session ID for this request.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "terminalId": { + "description": "The ID of the terminal to kill.", + "allOf": [ + { + "$ref": "#/$defs/TerminalId" + } + ] + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "session/close", - "x-side": "agent" + "required": [ + "sessionId", + "terminalId" + ], + "x-side": "client", + "x-method": "terminal/kill" }, - "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.", + "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.", + "type": "object", "properties": { + "message": { + "description": "A human-readable message describing what input is needed.", + "type": "string" + }, "_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" + ], + "additionalProperties": true + } + }, + "oneOf": [ + { + "description": "Form-based elicitation where the client renders a form from the provided schema.", + "type": "object", + "properties": { + "mode": { + "type": "string", + "const": "form" + } + }, + "required": [ + "mode" + ], + "allOf": [ + { + "$ref": "#/$defs/ElicitationFormMode" + } ] }, - "elicitationId": { + { + "description": "URL-based elicitation where the client directs the user to a URL.", + "type": "object", + "properties": { + "mode": { + "type": "string", + "const": "url" + } + }, + "required": [ + "mode" + ], "allOf": [ { - "$ref": "#/$defs/ElicitationId" + "$ref": "#/$defs/ElicitationUrlMode" } - ], - "description": "The ID of the elicitation that completed." + ] } + ], + "discriminator": { + "propertyName": "mode" }, "required": [ - "elicitationId" + "message" ], - "type": "object", - "x-method": "elicitation/complete", - "x-side": "client" + "x-side": "client", + "x-method": "elicitation/create" }, - "ConfigOptionUpdate": { - "description": "Session configuration options have been updated.", + "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.", + "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" + "sessionId": { + "description": "The session this elicitation is tied to.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } ] }, - "configOptions": { - "description": "The full set of configuration options and their current values.", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, - "type": "array" + "toolCallId": { + "description": "Optional tool call within the session.", + "anyOf": [ + { + "$ref": "#/$defs/ToolCallId" + }, + { + "type": "null" + } + ] } }, "required": [ - "configOptions" - ], - "type": "object" + "sessionId" + ] }, - "Content": { - "description": "Standard content block (text, images, resources).", + "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).", + "type": "object", + "properties": { + "requestId": { + "description": "The request this elicitation is tied to.", + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ] + } + }, + "required": [ + "requestId" + ] + }, + "ElicitationSchema": { + "description": "Type-safe elicitation schema for requesting structured user input.\n\nThis represents a JSON Schema object with primitive-typed properties,\nas required by the elicitation specification.", + "type": "object", "properties": { + "type": { + "description": "Type discriminator. Always `\"object\"`.", + "default": "object", + "allOf": [ + { + "$ref": "#/$defs/ElicitationSchemaType" + } + ] + }, + "title": { + "description": "Optional title for the schema.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "description": "Property definitions (must be primitive types).", + "type": "object", + "default": {}, + "additionalProperties": { + "$ref": "#/$defs/ElicitationPropertySchema" + } + }, + "required": { + "description": "List of required property names.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "description": { + "description": "Optional description of what this schema represents.", + "type": [ + "string", + "null" + ] + }, "_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": { - "allOf": [ - { - "$ref": "#/$defs/ContentBlock" - } ], - "description": "The actual content block." + "additionalProperties": true } - }, - "required": [ - "content" - ], - "type": "object" + } }, - "ContentBlock": { - "description": "Content blocks represent displayable information in the Agent Client Protocol.\n\nThey provide a structured way to handle various types of user-facing content\u2014whether\nit's text from language models, images for analysis, or embedded resources for context.\n\nContent blocks appear in:\n- User prompts sent via `session/prompt`\n- Language model output streamed through `session/update` notifications\n- Progress updates and results from tool calls\n\nThis structure is compatible with the Model Context Protocol (MCP), enabling\nagents to seamlessly forward content from MCP tool outputs without transformation.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/content)", - "discriminator": { - "propertyName": "type" - }, + "ElicitationSchemaType": { + "description": "Type discriminator for elicitation schemas.", "oneOf": [ { - "allOf": [ - { - "$ref": "#/$defs/TextContent" - } - ], - "description": "Text content. May be plain text or formatted with Markdown.\n\nAll agents MUST support text content blocks in prompts.\nClients SHOULD render this text as Markdown.", + "description": "Object schema type.", + "type": "string", + "const": "object" + } + ] + }, + "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.", + "oneOf": [ + { + "description": "String property (or single-select enum when `enum`/`oneOf` is set).", + "type": "object", "properties": { "type": { - "const": "text", - "type": "string" + "type": "string", + "const": "string" } }, "required": [ "type" ], - "type": "object" - }, - { "allOf": [ { - "$ref": "#/$defs/ImageContent" + "$ref": "#/$defs/StringPropertySchema" } - ], - "description": "Images for visual context or analysis.\n\nRequires the `image` prompt capability when included in prompts.", + ] + }, + { + "description": "Number (floating-point) property.", + "type": "object", "properties": { "type": { - "const": "image", - "type": "string" + "type": "string", + "const": "number" } }, "required": [ "type" ], - "type": "object" - }, - { "allOf": [ { - "$ref": "#/$defs/AudioContent" + "$ref": "#/$defs/NumberPropertySchema" } - ], - "description": "Audio data for transcription or analysis.\n\nRequires the `audio` prompt capability when included in prompts.", + ] + }, + { + "description": "Integer property.", + "type": "object", "properties": { "type": { - "const": "audio", - "type": "string" + "type": "string", + "const": "integer" } }, "required": [ "type" ], - "type": "object" - }, - { "allOf": [ { - "$ref": "#/$defs/ResourceLink" + "$ref": "#/$defs/IntegerPropertySchema" } - ], - "description": "References to resources that the agent can access.\n\nAll agents MUST support resource links in prompts.", + ] + }, + { + "description": "Boolean property.", + "type": "object", "properties": { "type": { - "const": "resource_link", - "type": "string" + "type": "string", + "const": "boolean" } }, "required": [ "type" ], - "type": "object" - }, - { "allOf": [ { - "$ref": "#/$defs/EmbeddedResource" + "$ref": "#/$defs/BooleanPropertySchema" } - ], - "description": "Complete resource contents embedded directly in the message.\n\nPreferred for including context as it avoids extra round-trips.\n\nRequires the `embeddedContext` prompt capability when included in prompts.", + ] + }, + { + "description": "Multi-select array property.", + "type": "object", "properties": { "type": { - "const": "resource", - "type": "string" + "type": "string", + "const": "array" } }, "required": [ "type" ], - "type": "object" + "allOf": [ + { + "$ref": "#/$defs/MultiSelectPropertySchema" + } + ] + } + ], + "discriminator": { + "propertyName": "type" + } + }, + "StringFormat": { + "description": "String format types for string properties in elicitation schemas.", + "oneOf": [ + { + "description": "Email address format.", + "type": "string", + "const": "email" + }, + { + "description": "URI format.", + "type": "string", + "const": "uri" + }, + { + "description": "Date format (YYYY-MM-DD).", + "type": "string", + "const": "date" + }, + { + "description": "Date-time format (ISO 8601).", + "type": "string", + "const": "date-time" + } + ] + }, + "EnumOption": { + "description": "A titled enum option with a const value and human-readable title.", + "type": "object", + "properties": { + "const": { + "description": "The constant value for this option.", + "type": "string" + }, + "title": { + "description": "Human-readable title for this option.", + "type": "string" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } + }, + "required": [ + "const", + "title" ] }, - "ContentChunk": { - "description": "A streamed item of content", + "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\"`.", + "type": "object", "properties": { + "title": { + "description": "Optional title for the property.", + "type": [ + "string", + "null" + ] + }, + "description": { + "description": "Human-readable description.", + "type": [ + "string", + "null" + ] + }, + "minLength": { + "description": "Minimum string length.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "maxLength": { + "description": "Maximum string length.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "pattern": { + "description": "Pattern the string must match.", + "type": [ + "string", + "null" + ] + }, + "format": { + "description": "String format.", + "anyOf": [ + { + "$ref": "#/$defs/StringFormat" + }, + { + "type": "null" + } + ] + }, + "default": { + "description": "Default value.", + "type": [ + "string", + "null" + ] + }, + "enum": { + "description": "Enum values for untitled single-select enums.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "oneOf": { + "description": "Titled enum options for titled single-select enums.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/EnumOption" + } + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true + } + } + }, + "NumberPropertySchema": { + "description": "Schema for number (floating-point) properties in an elicitation form.", + "type": "object", + "properties": { + "title": { + "description": "Optional title for the property.", + "type": [ + "string", + "null" + ] + }, + "description": { + "description": "Human-readable description.", + "type": [ + "string", + "null" + ] + }, + "minimum": { + "description": "Minimum value (inclusive).", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "maximum": { + "description": "Maximum value (inclusive).", + "type": [ + "number", + "null" + ], + "format": "double" + }, + "default": { + "description": "Default value.", + "type": [ + "number", + "null" + ], + "format": "double" + }, "_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" + ], + "additionalProperties": true + } + } + }, + "IntegerPropertySchema": { + "description": "Schema for integer properties in an elicitation form.", + "type": "object", + "properties": { + "title": { + "description": "Optional title for the property.", + "type": [ + "string", "null" ] }, - "content": { - "allOf": [ - { - "$ref": "#/$defs/ContentBlock" - } - ], - "description": "A single item of content" - }, - "messageId": { - "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 the message this chunk belongs to.\n\nAll chunks belonging to the same message share the same `messageId`.\nA change in `messageId` indicates a new message has started.\nBoth clients and agents MUST use UUID format for message IDs.", + "description": { + "description": "Human-readable description.", "type": [ "string", "null" ] - } - }, - "required": [ - "content" - ], - "type": "object" - }, - "Cost": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCost information for a session.", - "properties": { - "amount": { - "description": "Total cumulative cost for session.", - "format": "double", - "type": "number" }, - "currency": { - "description": "ISO 4217 currency code (e.g., \"USD\", \"EUR\").", - "type": "string" - } - }, - "required": [ - "amount", - "currency" - ], - "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" + "minimum": { + "description": "Minimum value (inclusive).", + "type": [ + "integer", + "null" ], - "type": "object" + "format": "int64" }, - { - "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)", + "maximum": { + "description": "Maximum value (inclusive).", "type": [ - "object", + "integer", "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" + "format": "int64" }, - { - "description": "The user declined the elicitation.", - "properties": { - "action": { - "const": "decline", - "type": "string" - } - }, - "required": [ - "action" + "default": { + "description": "Default value.", + "type": [ + "integer", + "null" ], - "type": "object" + "format": "int64" }, - { - "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" - ] + ], + "additionalProperties": true } - }, - "type": "object", - "x-method": "elicitation/create", - "x-side": "client" + } }, - "CreateTerminalRequest": { - "description": "Request to create a new terminal and execute a command.", + "BooleanPropertySchema": { + "description": "Schema for boolean properties in an elicitation form.", + "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)", + "title": { + "description": "Optional title for the property.", "type": [ - "object", + "string", "null" ] }, - "args": { - "description": "Array of command arguments.", - "items": { - "type": "string" - }, - "type": "array" - }, - "command": { - "description": "The command to execute.", - "type": "string" - }, - "cwd": { - "description": "Working directory for the command (absolute path).", + "description": { + "description": "Human-readable description.", "type": [ "string", "null" ] }, - "env": { - "description": "Environment variables for the command.", - "items": { - "$ref": "#/$defs/EnvVariable" - }, - "type": "array" + "default": { + "description": "Default value.", + "type": [ + "boolean", + "null" + ] }, - "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.", - "format": "uint64", - "minimum": 0, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", "type": [ - "integer", + "object", "null" + ], + "additionalProperties": true + } + } + }, + "MultiSelectItems": { + "description": "Items for a multi-select (array) property schema.", + "anyOf": [ + { + "title": "Untitled", + "description": "Untitled multi-select items with plain string values.", + "allOf": [ + { + "$ref": "#/$defs/UntitledMultiSelectItems" + } ] }, - "sessionId": { + { + "title": "Titled", + "description": "Titled multi-select items with human-readable labels.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/TitledMultiSelectItems" } - ], - "description": "The session ID for this request." + ] } - }, - "required": [ - "sessionId", - "command" - ], - "type": "object", - "x-method": "terminal/create", - "x-side": "client" + ] }, - "CreateTerminalResponse": { - "description": "Response containing the ID of the created terminal.", + "UntitledMultiSelectItems": { + "description": "Items definition for untitled multi-select enum properties.", + "type": "object", "properties": { + "type": { + "description": "Item type discriminator. Must be `\"string\"`.", + "allOf": [ + { + "$ref": "#/$defs/ElicitationStringType" + } + ] + }, + "enum": { + "description": "Allowed enum values.", + "type": "array", + "items": { + "type": "string" + } + }, "_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" - ] - }, - "terminalId": { - "description": "The unique identifier for the created terminal.", - "type": "string" + ], + "additionalProperties": true } }, "required": [ - "terminalId" - ], - "type": "object", - "x-method": "terminal/create", - "x-side": "client" + "type", + "enum" + ] }, - "CurrentModeUpdate": { - "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "ElicitationStringType": { + "description": "Items definition for untitled multi-select enum properties.", + "oneOf": [ + { + "description": "String schema type.", + "type": "string", + "const": "string" + } + ] + }, + "TitledMultiSelectItems": { + "description": "Items definition for titled multi-select enum properties.", + "type": "object", "properties": { + "anyOf": { + "description": "Titled enum options.", + "type": "array", + "items": { + "$ref": "#/$defs/EnumOption" + } + }, "_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" - ] - }, - "currentModeId": { - "allOf": [ - { - "$ref": "#/$defs/SessionModeId" - } ], - "description": "The ID of the current mode" + "additionalProperties": true } }, "required": [ - "currentModeId" - ], - "type": "object" + "anyOf" + ] }, - "DidChangeDocumentNotification": { - "description": "Notification sent when a file is edited.", + "MultiSelectPropertySchema": { + "description": "Schema for multi-select (array) properties in an elicitation form.", + "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)", + "title": { + "description": "Optional title for the property.", "type": [ - "object", + "string", "null" ] }, - "contentChanges": { - "description": "The content changes.", - "items": { - "$ref": "#/$defs/TextDocumentContentChangeEvent" - }, - "type": "array" + "description": { + "description": "Human-readable description.", + "type": [ + "string", + "null" + ] }, - "sessionId": { + "minItems": { + "description": "Minimum number of items to select.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "maxItems": { + "description": "Maximum number of items to select.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "items": { + "description": "The items definition describing allowed values.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/MultiSelectItems" } - ], - "description": "The session ID for this notification." + ] }, - "uri": { - "description": "The URI of the changed document.", - "type": "string" + "default": { + "description": "Default selected values.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } }, - "version": { - "description": "The new version number of the document.", - "format": "int64", - "type": "integer" - } - }, - "required": [ - "sessionId", - "uri", - "version", - "contentChanges" - ], - "type": "object", - "x-method": "document/didChange", - "x-side": "agent" - }, - "DidCloseDocumentNotification": { - "description": "Notification sent when a file is closed.", - "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 notification." - }, - "uri": { - "description": "The URI of the closed document.", - "type": "string" + "additionalProperties": true } }, "required": [ - "sessionId", - "uri" - ], - "type": "object", - "x-method": "document/didClose", - "x-side": "agent" + "items" + ] }, - "DidFocusDocumentNotification": { - "description": "Notification sent when a file becomes the active editor tab.", + "ElicitationFormMode": { + "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.", + "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" - ] - }, - "position": { + "requestedSchema": { + "description": "A JSON Schema describing the form fields to present to the user.", "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/ElicitationSchema" } - ], - "description": "The current cursor position." - }, - "sessionId": { + ] + } + }, + "anyOf": [ + { + "title": "Session", + "description": "Tied to a session, optionally to a specific tool call within that session.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/ElicitationSessionScope" } - ], - "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": { + { + "title": "Request", + "description": "Tied to a specific JSON-RPC request outside of a session\n(e.g., during auth/configuration phases before any session is started).", "allOf": [ { - "$ref": "#/$defs/Range" + "$ref": "#/$defs/ElicitationRequestScope" } - ], - "description": "The portion of the file currently visible in the editor viewport." + ] } - }, - "required": [ - "sessionId", - "uri", - "version", - "position", - "visibleRange" ], - "type": "object", - "x-method": "document/didFocus", - "x-side": "agent" + "required": [ + "requestedSchema" + ] }, - "DidOpenDocumentNotification": { - "description": "Notification sent when a file is opened in the editor.", + "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" + }, + "ElicitationUrlMode": { + "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.", + "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" - ] - }, - "languageId": { - "description": "The language identifier of the document (e.g., \"rust\", \"python\").", - "type": "string" - }, - "sessionId": { + "elicitationId": { + "description": "The unique identifier for this elicitation.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/ElicitationId" } - ], - "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" + "url": { + "description": "The URL to direct the user to.", + "type": "string", + "format": "uri" } }, - "required": [ - "sessionId", - "uri", - "languageId", - "version", - "text" - ], - "type": "object", - "x-method": "document/didOpen", - "x-side": "agent" - }, - "DidSaveDocumentNotification": { - "description": "Notification sent when a file is saved.", - "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" + "anyOf": [ + { + "title": "Session", + "description": "Tied to a session, optionally to a specific tool call within that session.", + "allOf": [ + { + "$ref": "#/$defs/ElicitationSessionScope" + } ] }, - "sessionId": { + { + "title": "Request", + "description": "Tied to a specific JSON-RPC request outside of a session\n(e.g., during auth/configuration phases before any session is started).", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/ElicitationRequestScope" } - ], - "description": "The session ID for this notification." - }, - "uri": { - "description": "The URI of the saved document.", - "type": "string" + ] } - }, - "required": [ - "sessionId", - "uri" ], - "type": "object", - "x-method": "document/didSave", - "x-side": "agent" + "required": [ + "elicitationId", + "url" + ] }, - "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)", + "ConnectMcpRequest": { + "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 `mcp/connect`.", + "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" + "acpId": { + "description": "The ACP MCP server ID that was provided by the component declaring the MCP server.", + "allOf": [ + { + "$ref": "#/$defs/McpServerAcpId" + } ] }, - "newText": { - "description": "The new content after modification.", - "type": "string" - }, - "oldText": { - "description": "The original content (None for new files).", + "_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)", "type": [ - "string", + "object", "null" - ] - }, - "path": { - "description": "The file path being modified.", - "type": "string" + ], + "additionalProperties": true } }, "required": [ - "path", - "newText" + "acpId" ], - "type": "object" + "x-side": "client", + "x-method": "mcp/connect" }, - "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`.", + "McpServerAcpId": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for an MCP server using the ACP transport.\n\nThe value is opaque and generated by the ACP component providing the MCP server. It is\nused by `mcp/connect` to route connection requests back to the component that declared the\nserver.", + "type": "string" + }, + "MessageMcpRequest": { + "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 `mcp/message`.", + "type": "object", "properties": { + "connectionId": { + "description": "The MCP-over-ACP connection this message is sent on.", + "allOf": [ + { + "$ref": "#/$defs/McpConnectionId" + } + ] + }, + "method": { + "description": "The inner MCP method name.", + "type": "string" + }, + "params": { + "description": "Optional inner MCP params.\n\nIf omitted or set to `null`, the inner MCP message has no params.", + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, "_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": "Provider id to disable.", - "type": "string" + ], + "additionalProperties": true } }, "required": [ - "id" + "connectionId", + "method" ], - "type": "object", - "x-method": "providers/disable", - "x-side": "agent" + "x-side": "both", + "x-method": "mcp/message" }, - "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`.", + "McpConnectionId": { + "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 an active MCP-over-ACP connection.", + "type": "string" + }, + "DisconnectMcpRequest": { + "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 `mcp/disconnect`.", + "type": "object", "properties": { + "connectionId": { + "description": "The MCP-over-ACP connection to close.", + "allOf": [ + { + "$ref": "#/$defs/McpConnectionId" + } + ] + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "providers/disable", - "x-side": "agent" + "required": [ + "connectionId" + ], + "x-side": "client", + "x-method": "mcp/disconnect" }, - "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.", + "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)" + }, + "AgentResponse": { + "description": "A JSON-RPC response object.", + "anyOf": [ + { + "title": "Result", + "description": "A successful JSON-RPC response.", + "type": "object", + "properties": { + "id": { + "description": "The id of the request this response answers.", + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ] + }, + "result": { + "description": "Method-specific response data.", + "anyOf": [ + { + "title": "InitializeResponse", + "description": "Successful result returned for a `initialize` request.", + "allOf": [ + { + "$ref": "#/$defs/InitializeResponse" + } + ] + }, + { + "title": "AuthenticateResponse", + "description": "Successful result returned for a `authenticate` request.", + "allOf": [ + { + "$ref": "#/$defs/AuthenticateResponse" + } + ] + }, + { + "title": "ListProvidersResponse", + "description": "Successful result returned for a `providers/list` request.", + "allOf": [ + { + "$ref": "#/$defs/ListProvidersResponse" + } + ] + }, + { + "title": "SetProviderResponse", + "description": "Successful result returned for a `providers/set` request.", + "allOf": [ + { + "$ref": "#/$defs/SetProviderResponse" + } + ] + }, + { + "title": "DisableProviderResponse", + "description": "Successful result returned for a `providers/disable` request.", + "allOf": [ + { + "$ref": "#/$defs/DisableProviderResponse" + } + ] + }, + { + "title": "LogoutResponse", + "description": "Successful result returned for a `logout` request.", + "allOf": [ + { + "$ref": "#/$defs/LogoutResponse" + } + ] + }, + { + "title": "NewSessionResponse", + "description": "Successful result returned for a `session/new` request.", + "allOf": [ + { + "$ref": "#/$defs/NewSessionResponse" + } + ] + }, + { + "title": "LoadSessionResponse", + "description": "Successful result returned for a `session/load` request.", + "allOf": [ + { + "$ref": "#/$defs/LoadSessionResponse" + } + ] + }, + { + "title": "ListSessionsResponse", + "description": "Successful result returned for a `session/list` request.", + "allOf": [ + { + "$ref": "#/$defs/ListSessionsResponse" + } + ] + }, + { + "title": "DeleteSessionResponse", + "description": "Successful result returned for a `session/delete` request.", + "allOf": [ + { + "$ref": "#/$defs/DeleteSessionResponse" + } + ] + }, + { + "title": "ForkSessionResponse", + "description": "Successful result returned for a `session/fork` request.", + "allOf": [ + { + "$ref": "#/$defs/ForkSessionResponse" + } + ] + }, + { + "title": "ResumeSessionResponse", + "description": "Successful result returned for a `session/resume` request.", + "allOf": [ + { + "$ref": "#/$defs/ResumeSessionResponse" + } + ] + }, + { + "title": "CloseSessionResponse", + "description": "Successful result returned for a `session/close` request.", + "allOf": [ + { + "$ref": "#/$defs/CloseSessionResponse" + } + ] + }, + { + "title": "SetSessionModeResponse", + "description": "Successful result returned for a `session/set_mode` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionModeResponse" + } + ] + }, + { + "title": "SetSessionConfigOptionResponse", + "description": "Successful result returned for a `session/set_config_option` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionConfigOptionResponse" + } + ] + }, + { + "title": "PromptResponse", + "description": "Successful result returned for a `session/prompt` request.", + "allOf": [ + { + "$ref": "#/$defs/PromptResponse" + } + ] + }, + { + "title": "StartNesResponse", + "description": "Successful result returned for a `nes/start` request.", + "allOf": [ + { + "$ref": "#/$defs/StartNesResponse" + } + ] + }, + { + "title": "SuggestNesResponse", + "description": "Successful result returned for a `nes/suggest` request.", + "allOf": [ + { + "$ref": "#/$defs/SuggestNesResponse" + } + ] + }, + { + "title": "CloseNesResponse", + "description": "Successful result returned for a `nes/close` request.", + "allOf": [ + { + "$ref": "#/$defs/CloseNesResponse" + } + ] + }, + { + "title": "ExtMethodResponse", + "description": "Successful result returned by an extension method outside the core ACP method set.", + "allOf": [ + { + "$ref": "#/$defs/ExtResponse" + } + ] + }, + { + "title": "MessageMcpResponse", + "description": "Successful result returned by an MCP-over-ACP `mcp/message` request.", + "allOf": [ + { + "$ref": "#/$defs/MessageMcpResponse" + } + ] + } + ] + } + }, + "required": [ + "id", + "result" + ] + }, + { + "title": "Error", + "description": "A failed JSON-RPC response.", + "type": "object", + "properties": { + "id": { + "description": "The id of the request this response answers.", + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ] + }, + "error": { + "description": "Method-specific error data.", + "allOf": [ + { + "$ref": "#/$defs/Error" + } + ] + } + }, + "required": [ + "id", + "error" + ] + } + ], + "x-docs-ignore": true + }, + "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)", + "type": "object", "properties": { - "content": { - "additionalProperties": { - "$ref": "#/$defs/ElicitationContentValue" + "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.", + "allOf": [ + { + "$ref": "#/$defs/ProtocolVersion" + } + ] + }, + "agentCapabilities": { + "description": "Capabilities supported by the agent.", + "default": { + "loadSession": false, + "promptCapabilities": { + "image": false, + "audio": false, + "embeddedContext": false + }, + "mcpCapabilities": { + "http": false, + "sse": false, + "acp": false + }, + "sessionCapabilities": {}, + "auth": {} }, - "description": "The user-provided content, if any, as an object matching the requested schema.", + "allOf": [ + { + "$ref": "#/$defs/AgentCapabilities" + } + ] + }, + "authMethods": { + "description": "Authentication methods supported by the agent.", + "type": "array", + "items": { + "$ref": "#/$defs/AuthMethod" + }, + "default": [], + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "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.", + "anyOf": [ + { + "$ref": "#/$defs/Implementation" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", "type": [ "object", "null" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "protocolVersion" + ], + "x-side": "agent", + "x-method": "initialize" }, - "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.", + "ProtocolVersion": { + "description": "Protocol version identifier.\n\nThis version is only bumped for breaking changes.\nNon-breaking changes should be introduced via capabilities.", + "type": "integer", + "format": "uint16", + "minimum": 0, + "maximum": 65535 + }, + "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)", + "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" + "loadSession": { + "description": "Whether the agent supports `session/load`.", + "type": "boolean", + "default": false + }, + "promptCapabilities": { + "description": "Prompt capabilities supported by the agent.", + "default": { + "image": false, + "audio": false, + "embeddedContext": false + }, + "allOf": [ + { + "$ref": "#/$defs/PromptCapabilities" + } ] }, - "form": { + "mcpCapabilities": { + "description": "MCP capabilities supported by the agent.", + "default": { + "http": false, + "sse": false, + "acp": false + }, + "allOf": [ + { + "$ref": "#/$defs/McpCapabilities" + } + ] + }, + "sessionCapabilities": { + "description": "Session lifecycle and prompt capabilities advertised by the agent.", + "default": {}, + "allOf": [ + { + "$ref": "#/$defs/SessionCapabilities" + } + ] + }, + "auth": { + "description": "Authentication-related capabilities supported by the agent.", + "default": {}, + "allOf": [ + { + "$ref": "#/$defs/AgentAuthCapabilities" + } + ] + }, + "providers": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProvider configuration capabilities supported by the agent.\n\nBy supplying `{}` it means that the agent supports provider configuration methods.", "anyOf": [ { - "$ref": "#/$defs/ElicitationFormCapabilities" + "$ref": "#/$defs/ProvidersCapabilities" }, { "type": "null" } ], - "description": "Whether the client supports form-based elicitation." + "x-deserialize-default-on-error": true }, - "url": { + "nes": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNES (Next Edit Suggestions) capabilities supported by the agent.", "anyOf": [ { - "$ref": "#/$defs/ElicitationUrlCapabilities" + "$ref": "#/$defs/NesCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "positionEncoding": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe position encoding selected by the agent from the client's supported encodings.", + "anyOf": [ + { + "$ref": "#/$defs/PositionEncodingKind" }, { "type": "null" } ], - "description": "Whether the client supports URL-based elicitation." + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - }, - "type": "object" + } }, - "ElicitationContentValue": { - "anyOf": [ - { - "title": "String", - "type": "string" - }, - { - "format": "int64", - "title": "Integer", - "type": "integer" + "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)", + "type": "object", + "properties": { + "image": { + "description": "Agent supports [`ContentBlock::Image`].", + "type": "boolean", + "default": false }, - { - "format": "double", - "title": "Number", - "type": "number" + "audio": { + "description": "Agent supports [`ContentBlock::Audio`].", + "type": "boolean", + "default": false }, - { - "title": "Boolean", - "type": "boolean" + "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.", + "type": "boolean", + "default": false }, - { - "items": { - "type": "string" - }, - "title": "StringArray", - "type": "array" + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - ] + } }, - "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.", + "McpCapabilities": { + "description": "MCP capabilities supported by the agent", + "type": "object", "properties": { + "http": { + "description": "Agent supports [`McpServer::Http`].", + "type": "boolean", + "default": false + }, + "sse": { + "description": "Agent supports [`McpServer::Sse`].", + "type": "boolean", + "default": false + }, + "acp": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAgent supports [`McpServer::Acp`].", + "type": "boolean", + "default": false + }, "_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" - ] + ], + "additionalProperties": true } - }, - "type": "object" + } }, - "ElicitationFormMode": { - "anyOf": [ - { - "allOf": [ + "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)", + "type": "object", + "properties": { + "list": { + "description": "Whether the agent supports `session/list`.", + "anyOf": [ { - "$ref": "#/$defs/ElicitationSessionScope" - } - ], - "description": "Tied to a session, optionally to a specific tool call within that session.", - "title": "Session" - }, - { - "allOf": [ + "$ref": "#/$defs/SessionListCapabilities" + }, { - "$ref": "#/$defs/ElicitationRequestScope" + "type": "null" } ], - "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": [ + "x-deserialize-default-on-error": true + }, + "delete": { + "description": "Whether the agent supports `session/delete`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports deleting sessions from `session/list`.", + "anyOf": [ { - "$ref": "#/$defs/ElicitationSchema" - } - ], - "description": "A JSON Schema describing the form fields to present to the user." - } - }, - "required": [ - "requestedSchema" - ], - "type": "object" - }, - "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/SessionDeleteCapabilities" + }, { - "$ref": "#/$defs/StringPropertySchema" - } - ], - "description": "String property (or single-select enum when `enum`/`oneOf` is set).", - "properties": { - "type": { - "const": "string", - "type": "string" + "type": "null" } - }, - "required": [ - "type" ], - "type": "object" + "x-deserialize-default-on-error": true }, - { - "allOf": [ + "additionalDirectories": { + "description": "Whether the agent supports `additionalDirectories` on supported session lifecycle requests.\n\nAgents that also support `session/list` may return\n`SessionInfo.additionalDirectories` to report the complete ordered\nadditional-root list associated with a listed session.", + "anyOf": [ { - "$ref": "#/$defs/NumberPropertySchema" - } - ], - "description": "Number (floating-point) property.", - "properties": { - "type": { - "const": "number", - "type": "string" + "$ref": "#/$defs/SessionAdditionalDirectoriesCapabilities" + }, + { + "type": "null" } - }, - "required": [ - "type" ], - "type": "object" + "x-deserialize-default-on-error": true }, - { - "allOf": [ + "fork": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the agent supports `session/fork`.", + "anyOf": [ { - "$ref": "#/$defs/IntegerPropertySchema" - } - ], - "description": "Integer property.", - "properties": { - "type": { - "const": "integer", - "type": "string" + "$ref": "#/$defs/SessionForkCapabilities" + }, + { + "type": "null" } - }, - "required": [ - "type" ], - "type": "object" + "x-deserialize-default-on-error": true }, - { - "allOf": [ + "resume": { + "description": "Whether the agent supports `session/resume`.", + "anyOf": [ { - "$ref": "#/$defs/BooleanPropertySchema" - } - ], - "description": "Boolean property.", - "properties": { - "type": { - "const": "boolean", - "type": "string" - } - }, - "required": [ - "type" + "$ref": "#/$defs/SessionResumeCapabilities" + }, + { + "type": "null" + } ], - "type": "object" + "x-deserialize-default-on-error": true }, - { - "allOf": [ + "close": { + "description": "Whether the agent supports `session/close`.", + "anyOf": [ { - "$ref": "#/$defs/MultiSelectPropertySchema" + "$ref": "#/$defs/SessionCloseCapabilities" + }, + { + "type": "null" } ], - "description": "Multi-select array property.", - "properties": { - "type": { - "const": "array", - "type": "string" - } - }, - "required": [ - "type" + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "type": "object" + "additionalProperties": true } - ] + } }, - "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).", + "SessionListCapabilities": { + "description": "Capabilities for the `session/list` method.\n\nBy supplying `{}` it means that the agent supports listing of sessions.", + "type": "object", "properties": { - "requestId": { - "allOf": [ - { - "$ref": "#/$defs/RequestId" - } + "_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)", + "type": [ + "object", + "null" ], - "description": "The request this elicitation is tied to." + "additionalProperties": true } - }, - "required": [ - "requestId" - ], - "type": "object" + } }, - "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.", + "SessionDeleteCapabilities": { + "description": "Capabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.", + "type": "object", "properties": { - "description": { - "description": "Optional description of what this schema represents.", + "_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)", "type": [ - "string", + "object", "null" - ] - }, - "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" - }, + ], + "additionalProperties": true + } + } + }, + "SessionAdditionalDirectoriesCapabilities": { + "description": "Capabilities for additional session directories support.\n\nBy supplying `{}` it means that the agent supports the `additionalDirectories`\nfield on supported session lifecycle requests. Agents that also support\n`session/list` may return `SessionInfo.additionalDirectories` to report the\ncomplete ordered additional-root list associated with a listed session.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", "type": [ - "array", + "object", "null" - ] - }, - "title": { - "description": "Optional title for the schema.", + ], + "additionalProperties": true + } + } + }, + "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.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", "type": [ - "string", + "object", "null" - ] - }, - "type": { - "allOf": [ - { - "$ref": "#/$defs/ElicitationSchemaType" - } ], - "default": "object", - "description": "Type discriminator. Always `\"object\"`." + "additionalProperties": true } - }, - "type": "object" + } }, - "ElicitationSchemaType": { - "description": "Type discriminator for elicitation schemas.", - "oneOf": [ - { - "const": "object", - "description": "Object schema type.", - "type": "string" + "SessionResumeCapabilities": { + "description": "Capabilities for the `session/resume` method.\n\nBy supplying `{}` it means that the agent supports resuming of sessions.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - ] + } }, - "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.", + "SessionCloseCapabilities": { + "description": "Capabilities for the `session/close` method.\n\nBy supplying `{}` it means that the agent supports closing of sessions.", + "type": "object", "properties": { - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "description": "The session this elicitation is tied to." - }, - "toolCallId": { + "additionalProperties": true + } + } + }, + "AgentAuthCapabilities": { + "description": "Authentication-related capabilities supported by the agent.", + "type": "object", + "properties": { + "logout": { + "description": "Whether the agent supports the logout method.\n\nBy supplying `{}` it means that the agent supports the logout method.", "anyOf": [ { - "$ref": "#/$defs/ToolCallId" + "$ref": "#/$defs/LogoutCapabilities" }, { "type": "null" } ], - "description": "Optional tool call within the session." + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - }, - "required": [ - "sessionId" - ], - "type": "object" + } }, - "ElicitationStringType": { - "description": "Items definition for untitled multi-select enum properties.", - "oneOf": [ - { - "const": "string", - "description": "String schema type.", - "type": "string" + "LogoutCapabilities": { + "description": "Logout capabilities supported by the agent.\n\nBy supplying `{}` it means that the agent supports the logout method.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - ] + } }, - "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.", + "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.", + "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" - ] + ], + "additionalProperties": true } - }, - "type": "object" + } }, - "ElicitationUrlMode": { - "anyOf": [ - { - "allOf": [ + "NesCapabilities": { + "description": "NES capabilities advertised by the agent during initialization.", + "type": "object", + "properties": { + "events": { + "description": "Events the agent wants to receive.", + "anyOf": [ { - "$ref": "#/$defs/ElicitationSessionScope" + "$ref": "#/$defs/NesEventCapabilities" + }, + { + "type": "null" } ], - "description": "Tied to a session, optionally to a specific tool call within that session.", - "title": "Session" + "x-deserialize-default-on-error": true }, - { - "allOf": [ + "context": { + "description": "Context the agent wants attached to each suggestion request.", + "anyOf": [ { - "$ref": "#/$defs/ElicitationRequestScope" + "$ref": "#/$defs/NesContextCapabilities" + }, + { + "type": "null" } ], - "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" + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - ], - "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.", + } + }, + "NesEventCapabilities": { + "description": "Event capabilities the agent can consume.", + "type": "object", "properties": { - "elicitationId": { - "allOf": [ + "document": { + "description": "Document event capabilities.", + "anyOf": [ { - "$ref": "#/$defs/ElicitationId" + "$ref": "#/$defs/NesDocumentEventCapabilities" + }, + { + "type": "null" } ], - "description": "The unique identifier for this elicitation." + "x-deserialize-default-on-error": true }, - "url": { - "description": "The URL to direct the user to.", - "format": "uri", - "type": "string" - } - }, - "required": [ - "elicitationId", - "url" - ], - "type": "object" - }, - "EmbeddedResource": { - "description": "The contents of a resource, embedded into 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" - ] + ], + "additionalProperties": true + } + } + }, + "NesDocumentEventCapabilities": { + "description": "Document event capabilities the agent wants to receive.", + "type": "object", + "properties": { + "didOpen": { + "description": "Whether the agent wants `document/didOpen` events.", + "anyOf": [ + { + "$ref": "#/$defs/NesDocumentDidOpenCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - "annotations": { + "didChange": { + "description": "Whether the agent wants `document/didChange` events, and the sync kind.", "anyOf": [ { - "$ref": "#/$defs/Annotations" + "$ref": "#/$defs/NesDocumentDidChangeCapabilities" }, { "type": "null" } - ] + ], + "x-deserialize-default-on-error": true }, - "resource": { - "$ref": "#/$defs/EmbeddedResourceResource" - } - }, - "required": [ - "resource" - ], - "type": "object" - }, - "EmbeddedResourceResource": { - "anyOf": [ - { - "allOf": [ + "didClose": { + "description": "Whether the agent wants `document/didClose` events.", + "anyOf": [ { - "$ref": "#/$defs/TextResourceContents" + "$ref": "#/$defs/NesDocumentDidCloseCapabilities" + }, + { + "type": "null" } ], - "title": "TextResourceContents" + "x-deserialize-default-on-error": true }, - { - "allOf": [ + "didSave": { + "description": "Whether the agent wants `document/didSave` events.", + "anyOf": [ { - "$ref": "#/$defs/BlobResourceContents" + "$ref": "#/$defs/NesDocumentDidSaveCapabilities" + }, + { + "type": "null" } ], - "title": "BlobResourceContents" - } - ], - "description": "Resource content that can be embedded in a message." - }, - "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" + "x-deserialize-default-on-error": true }, - "title": { - "description": "Human-readable title for this option.", - "type": "string" + "didFocus": { + "description": "Whether the agent wants `document/didFocus` events.", + "anyOf": [ + { + "$ref": "#/$defs/NesDocumentDidFocusCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - }, - "required": [ - "const", - "title" - ], - "type": "object" + } }, - "EnvVariable": { - "description": "An environment variable to set when launching an MCP server.", + "NesDocumentDidOpenCapabilities": { + "description": "Marker for `document/didOpen` capability support.", + "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" - ] - }, - "name": { - "description": "The name of the environment variable.", - "type": "string" - }, - "value": { - "description": "The value to set for the environment variable.", - "type": "string" + ], + "additionalProperties": true } - }, - "required": [ - "name", - "value" - ], - "type": "object" + } }, - "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)", + "NesDocumentDidChangeCapabilities": { + "description": "Capabilities for `document/didChange` events.", + "type": "object", "properties": { - "code": { + "syncKind": { + "description": "The sync kind the agent wants: `\"full\"` or `\"incremental\"`.", "allOf": [ { - "$ref": "#/$defs/ErrorCode" + "$ref": "#/$defs/TextDocumentSyncKind" } - ], - "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" + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "code", - "message" - ], - "type": "object" + "syncKind" + ] }, - "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" - }, + "TextDocumentSyncKind": { + "description": "How the agent wants document changes delivered.", + "oneOf": [ { - "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": "Client sends the entire file content on each change.", + "type": "string", + "const": "full" }, { - "description": "Other undefined error code.", - "format": "int32", - "title": "Other", - "type": "integer" + "description": "Client sends only the changed ranges.", + "type": "string", + "const": "incremental" } - ], - "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)" + ] }, - "FileSystemCapabilities": { - "description": "File system capabilities that a client may support.\n\nSee protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)", + "NesDocumentDidCloseCapabilities": { + "description": "Marker for `document/didClose` capability support.", + "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" - ] - }, - "readTextFile": { - "default": false, - "description": "Whether the Client supports `fs/read_text_file` requests.", - "type": "boolean" - }, - "writeTextFile": { - "default": false, - "description": "Whether the Client supports `fs/write_text_file` requests.", - "type": "boolean" + ], + "additionalProperties": true } - }, - "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.", + "NesDocumentDidSaveCapabilities": { + "description": "Marker for `document/didSave` capability support.", + "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" - ] - }, - "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": { - "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 fork." + "additionalProperties": true } - }, - "required": [ - "sessionId", - "cwd" - ], - "type": "object", - "x-method": "session/fork", - "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.", + "NesDocumentDidFocusCapabilities": { + "description": "Marker for `document/didFocus` capability support.", + "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" - ] + ], + "additionalProperties": true + } + } + }, + "NesContextCapabilities": { + "description": "Context capabilities the agent wants attached to each suggestion request.", + "type": "object", + "properties": { + "recentFiles": { + "description": "Whether the agent wants recent files context.", + "anyOf": [ + { + "$ref": "#/$defs/NesRecentFilesCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "relatedSnippets": { + "description": "Whether the agent wants related snippets context.", + "anyOf": [ + { + "$ref": "#/$defs/NesRelatedSnippetsCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - "configOptions": { - "description": "Initial session configuration options if supported by the Agent.", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, - "type": [ - "array", - "null" - ] + "editHistory": { + "description": "Whether the agent wants edit history context.", + "anyOf": [ + { + "$ref": "#/$defs/NesEditHistoryCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - "models": { + "userActions": { + "description": "Whether the agent wants user actions context.", "anyOf": [ { - "$ref": "#/$defs/SessionModelState" + "$ref": "#/$defs/NesUserActionsCapabilities" }, { "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" + "x-deserialize-default-on-error": true }, - "modes": { + "openFiles": { + "description": "Whether the agent wants open files context.", "anyOf": [ { - "$ref": "#/$defs/SessionModeState" + "$ref": "#/$defs/NesOpenFilesCapabilities" }, { "type": "null" } ], - "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + "x-deserialize-default-on-error": true }, - "sessionId": { - "allOf": [ + "diagnostics": { + "description": "Whether the agent wants diagnostics context.", + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/NesDiagnosticsCapabilities" + }, + { + "type": "null" } ], - "description": "Unique identifier for the newly created forked session." + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - }, - "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.", + "NesRecentFilesCapabilities": { + "description": "Capabilities for recent files context.", + "type": "object", "properties": { + "maxCount": { + "description": "Maximum number of recent files the agent can use.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, "_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" + ], + "additionalProperties": true } - }, - "required": [ - "name", - "value" - ], - "type": "object" + } }, - "ImageContent": { - "description": "An image provided to or from an LLM.", + "NesRelatedSnippetsCapabilities": { + "description": "Capabilities for related snippets context.", + "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" - ] - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" - }, - "uri": { - "type": [ - "string", - "null" - ] + ], + "additionalProperties": true } - }, - "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.", + "NesEditHistoryCapabilities": { + "description": "Capabilities for edit history context.", + "type": "object", "properties": { + "maxCount": { + "description": "Maximum number of edit history entries the agent can use.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, "_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.", - "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.", + ], + "additionalProperties": true + } + } + }, + "NesUserActionsCapabilities": { + "description": "Capabilities for user actions context.", + "type": "object", + "properties": { + "maxCount": { + "description": "Maximum number of user actions the agent can use.", "type": [ - "string", + "integer", "null" - ] + ], + "format": "uint32", + "minimum": 0 }, - "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" + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - }, - "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)", + "NesOpenFilesCapabilities": { + "description": "Capabilities for open files context.", + "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" - ] - }, - "clientCapabilities": { - "allOf": [ - { - "$ref": "#/$defs/ClientCapabilities" - } - ], - "default": { - "auth": { - "terminal": false - }, - "fs": { - "readTextFile": false, - "writeTextFile": false - }, - "terminal": false - }, - "description": "Capabilities supported by the client." - }, - "clientInfo": { - "anyOf": [ - { - "$ref": "#/$defs/Implementation" - }, - { - "type": "null" - } - ], - "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": { - "allOf": [ - { - "$ref": "#/$defs/ProtocolVersion" - } ], - "description": "The latest protocol version supported by the client." + "additionalProperties": true } - }, - "required": [ - "protocolVersion" - ], - "type": "object", - "x-method": "initialize", - "x-side": "agent" + } }, - "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)", + "NesDiagnosticsCapabilities": { + "description": "Capabilities for diagnostics context.", + "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" - ] + ], + "additionalProperties": true + } + } + }, + "PositionEncodingKind": { + "description": "The encoding used for character offsets in positions.\n\nFollows the same conventions as LSP 3.17. The default is UTF-16.", + "oneOf": [ + { + "description": "Character offsets count UTF-16 code units. This is the default.", + "type": "string", + "const": "utf-16" }, - "agentCapabilities": { - "allOf": [ - { - "$ref": "#/$defs/AgentCapabilities" + { + "description": "Character offsets count Unicode code points.", + "type": "string", + "const": "utf-32" + }, + { + "description": "Character offsets count UTF-8 code units (bytes).", + "type": "string", + "const": "utf-8" + } + ] + }, + "AuthMethod": { + "description": "Describes an available authentication method.\n\nThe `type` field acts as the discriminator in the serialized JSON form.\nWhen no `type` is present, the method is treated as `agent`.", + "anyOf": [ + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUser provides a key that the client passes to the agent as an environment variable.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "env_var" } - ], - "default": { - "auth": {}, - "loadSession": false, - "mcpCapabilities": { - "http": false, - "sse": false - }, - "promptCapabilities": { - "audio": false, - "embeddedContext": false, - "image": false - }, - "sessionCapabilities": {} }, - "description": "Capabilities supported by the agent." - }, - "agentInfo": { - "anyOf": [ - { - "$ref": "#/$defs/Implementation" - }, + "required": [ + "type" + ], + "allOf": [ { - "type": "null" + "$ref": "#/$defs/AuthMethodEnvVar" } - ], - "description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required." + ] }, - "authMethods": { - "default": [], - "description": "Authentication methods supported by the agent.", - "items": { - "$ref": "#/$defs/AuthMethod" + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nClient runs an interactive terminal for the user to authenticate via a TUI.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "terminal" + } }, - "type": "array" + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/AuthMethodTerminal" + } + ] }, - "protocolVersion": { + { + "title": "agent", + "description": "Agent handles authentication itself.\n\nThis is the default when no `type` is specified.", "allOf": [ { - "$ref": "#/$defs/ProtocolVersion" + "$ref": "#/$defs/AuthMethodAgent" } - ], - "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" + ] }, - "IntegerPropertySchema": { - "description": "Schema for integer properties in an elicitation form.", + "AuthMethodId": { + "description": "Typed identifier used for auth method values on the wire.", + "type": "string" + }, + "AuthEnvVar": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nDescribes a single environment variable for an [`AuthMethodEnvVar`] authentication method.", + "type": "object", "properties": { - "default": { - "description": "Default value.", - "format": "int64", - "type": [ - "integer", - "null" - ] + "name": { + "description": "The environment variable name (e.g. `\"OPENAI_API_KEY\"`).", + "type": "string" }, - "description": { - "description": "Human-readable description.", + "label": { + "description": "Human-readable label for this variable, displayed in client UI.", "type": [ "string", "null" ] }, - "maximum": { - "description": "Maximum value (inclusive).", - "format": "int64", + "secret": { + "description": "Whether this value is a secret (e.g. API key, token).\nClients should use a password-style input for secret vars.\n\nDefaults to `true`.", + "type": "boolean", + "default": true + }, + "optional": { + "description": "Whether this variable is optional.\n\nDefaults to `false`.", + "type": "boolean", + "default": false + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", "type": [ - "integer", + "object", "null" + ], + "additionalProperties": true + } + }, + "required": [ + "name" + ] + }, + "AuthMethodEnvVar": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nEnvironment variable authentication method.\n\nThe user provides credentials that the client passes to the agent as environment variables.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier for this authentication method.", + "allOf": [ + { + "$ref": "#/$defs/AuthMethodId" + } ] }, - "minimum": { - "description": "Minimum value (inclusive).", - "format": "int64", + "name": { + "description": "Human-readable name of the authentication method.", + "type": "string" + }, + "description": { + "description": "Optional description providing more details about this authentication method.", "type": [ - "integer", + "string", "null" ] }, - "title": { - "description": "Optional title for the property.", + "vars": { + "description": "The environment variables the client should set.", + "type": "array", + "items": { + "$ref": "#/$defs/AuthEnvVar" + } + }, + "link": { + "description": "Optional link to a page where the user can obtain their credentials.", "type": [ "string", "null" ] - } - }, - "type": "object" - }, - "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" - ] - }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } ], - "description": "The session ID for this request." - }, - "terminalId": { - "description": "The ID of the terminal to kill.", - "type": "string" + "additionalProperties": true } }, "required": [ - "sessionId", - "terminalId" - ], - "type": "object", - "x-method": "terminal/kill", - "x-side": "client" + "id", + "name", + "vars" + ] }, - "KillTerminalResponse": { - "description": "Response to `terminal/kill` method", + "AuthMethodTerminal": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nTerminal-based authentication method.\n\nThe client runs an interactive terminal for the user to authenticate via a TUI.", + "type": "object", "properties": { + "id": { + "description": "Unique identifier for this authentication method.", + "allOf": [ + { + "$ref": "#/$defs/AuthMethodId" + } + ] + }, + "name": { + "description": "Human-readable name of the authentication method.", + "type": "string" + }, + "description": { + "description": "Optional description providing more details about this authentication method.", + "type": [ + "string", + "null" + ] + }, + "args": { + "description": "Additional arguments to pass when running the agent binary for terminal auth.", + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "description": "Additional environment variables to set when running the agent binary for terminal auth.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "terminal/kill", - "x-side": "client" + "required": [ + "id", + "name" + ] }, - "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`.", + "AuthMethodAgent": { + "description": "Agent handles authentication itself.\n\nThis is the default authentication method type.", + "type": "object", "properties": { + "id": { + "description": "Unique identifier for this authentication method.", + "allOf": [ + { + "$ref": "#/$defs/AuthMethodId" + } + ] + }, + "name": { + "description": "Human-readable name of the authentication method.", + "type": "string" + }, + "description": { + "description": "Optional description providing more details about this authentication method.", + "type": [ + "string", + "null" + ] + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "providers/list", - "x-side": "agent" + "required": [ + "id", + "name" + ] }, - "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`.", + "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.", + "type": "object", "properties": { + "name": { + "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn\u2019t present.", + "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" + ] + }, + "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" + }, "_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" - ] - }, - "providers": { - "description": "Configurable providers with current routing info suitable for UI display.", - "items": { - "$ref": "#/$defs/ProviderInfo" - }, - "type": "array" + ], + "additionalProperties": true } }, "required": [ - "providers" - ], - "type": "object", - "x-method": "providers/list", - "x-side": "agent" + "name", + "version" + ] }, - "ListSessionsRequest": { - "description": "Request parameters for listing existing sessions.\n\nOnly available if the Agent supports the `sessionCapabilities.list` capability.", + "AuthenticateResponse": { + "description": "Response to the `authenticate` method.", + "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" - ] - }, - "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" - }, - "cursor": { - "description": "Opaque cursor token from a previous response's nextCursor field for cursor-based pagination", - "type": [ - "string", - "null" - ] - }, - "cwd": { - "description": "Filter sessions by working directory. Must be an absolute path.", - "type": [ - "string", - "null" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "session/list", - "x-side": "agent" + "x-side": "agent", + "x-method": "authenticate" }, - "ListSessionsResponse": { - "description": "Response from listing sessions.", + "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`.", + "type": "object", "properties": { + "providers": { + "description": "Configurable providers with current routing info suitable for UI display.", + "type": "array", + "items": { + "$ref": "#/$defs/ProviderInfo" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_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" + ], + "additionalProperties": true + } + }, + "required": [ + "providers" + ], + "x-side": "agent", + "x-method": "providers/list" + }, + "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.", + "type": "object", + "properties": { + "id": { + "description": "Provider identifier, for example \"main\" or \"openai\".", + "type": "string" + }, + "supported": { + "description": "Supported protocol types for this provider.", + "type": "array", + "items": { + "$ref": "#/$defs/LlmProtocol" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "required": { + "description": "Whether this provider is mandatory and cannot be disabled via `providers/disable`.\nIf true, clients must not call `providers/disable` for this id.", + "type": "boolean" + }, + "current": { + "description": "Current effective non-secret routing config.\nNull or omitted means provider is disabled.", + "anyOf": [ + { + "$ref": "#/$defs/ProviderCurrentConfig" + }, + { + "type": "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.", + "_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)", "type": [ - "string", + "object", "null" - ] - }, - "sessions": { - "description": "Array of session information objects", - "items": { - "$ref": "#/$defs/SessionInfo" - }, - "type": "array" + ], + "additionalProperties": true } }, "required": [ - "sessions" - ], - "type": "object", - "x-method": "session/list", - "x-side": "agent" + "id", + "supported", + "required" + ] }, "LlmProtocol": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWell-known API protocol identifiers for LLM providers.\n\nAgents and clients MUST handle unknown protocol identifiers gracefully.\n\nProtocol names beginning with `_` are free for custom use, like other ACP extension methods.\nProtocol names that do not begin with `_` are reserved for the ACP spec.", "anyOf": [ { - "const": "anthropic", "description": "Anthropic API protocol.", - "type": "string" + "type": "string", + "const": "anthropic" }, { - "const": "openai", "description": "OpenAI API protocol.", - "type": "string" + "type": "string", + "const": "openai" }, { - "const": "azure", "description": "Azure OpenAI API protocol.", - "type": "string" + "type": "string", + "const": "azure" }, { - "const": "vertex", "description": "Google Vertex AI API protocol.", - "type": "string" + "type": "string", + "const": "vertex" }, { - "const": "bedrock", "description": "AWS Bedrock API protocol.", - "type": "string" + "type": "string", + "const": "bedrock" }, { - "description": "Unknown or custom protocol.", "title": "other", + "description": "Unknown or custom protocol.", "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)", + "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.", + "type": "object", "properties": { + "apiType": { + "description": "Protocol currently used by this provider.", + "allOf": [ + { + "$ref": "#/$defs/LlmProtocol" + } + ] + }, + "baseUrl": { + "description": "Base URL currently used by this provider.", + "type": "string" + }, "_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 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." + "additionalProperties": true } }, "required": [ - "mcpServers", - "cwd", - "sessionId" - ], + "apiType", + "baseUrl" + ] + }, + "SetProviderResponse": { + "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`.", "type": "object", - "x-method": "session/load", - "x-side": "agent" + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "providers/set" }, - "LoadSessionResponse": { - "description": "Response from loading an existing session.", + "DisableProviderResponse": { + "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`.", + "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" - ] - }, - "configOptions": { - "description": "Initial session configuration options if supported by the Agent.", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, + ], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "providers/disable" + }, + "LogoutResponse": { + "description": "Response to the `logout` method.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", "type": [ - "array", + "object", "null" - ] - }, - "models": { - "anyOf": [ - { - "$ref": "#/$defs/SessionModelState" - }, + ], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "logout" + }, + "NewSessionResponse": { + "description": "Response from creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)", + "type": "object", + "properties": { + "sessionId": { + "description": "Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/SessionId" } - ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent" + ] }, "modes": { + "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", "anyOf": [ { "$ref": "#/$defs/SessionModeState" @@ -3720,4808 +4100,5571 @@ "type": "null" } ], - "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + "x-deserialize-default-on-error": true + }, + "configOptions": { + "description": "Initial session configuration options if supported by the Agent.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "session/load", - "x-side": "agent" + "required": [ + "sessionId" + ], + "x-side": "agent", + "x-method": "session/new" }, - "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.", + "SessionModeState": { + "description": "The set of modes and the one currently active.", + "type": "object", "properties": { + "currentModeId": { + "description": "The current mode the Agent is in.", + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ] + }, + "availableModes": { + "description": "The set of modes that the Agent can operate in", + "type": "array", + "items": { + "$ref": "#/$defs/SessionMode" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "currentModeId", + "availableModes" + ] }, - "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.", + "SessionModeId": { + "description": "Unique identifier for a Session Mode.", + "type": "string" + }, + "SessionMode": { + "description": "A mode the agent can operate in.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "type": "object", "properties": { + "id": { + "description": "Stable identifier used to refer to this protocol object in later messages.", + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ] + }, + "name": { + "description": "Human-readable name shown for this protocol object.", + "type": "string" + }, + "description": { + "description": "Optional human-readable details shown with this protocol object.", + "type": [ + "string", + "null" + ] + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "logout", - "x-side": "agent" + "required": [ + "id", + "name" + ] }, - "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.", + "SessionConfigOption": { + "description": "A session configuration option selector and its current state.", + "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)", + "id": { + "description": "Unique identifier for the configuration option.", + "allOf": [ + { + "$ref": "#/$defs/SessionConfigId" + } + ] + }, + "name": { + "description": "Human-readable label for the option.", + "type": "string" + }, + "description": { + "description": "Optional description for the Client to display to the user.", "type": [ - "object", + "string", "null" ] - } - }, - "type": "object", - "x-method": "logout", - "x-side": "agent" - }, - "McpCapabilities": { - "description": "MCP capabilities supported by the agent", - "properties": { + }, + "category": { + "description": "Optional semantic category for this option (UX only).", + "anyOf": [ + { + "$ref": "#/$defs/SessionConfigOptionCategory" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_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" - ] - }, - "http": { - "default": false, - "description": "Agent supports [`McpServer::Http`].", - "type": "boolean" - }, - "sse": { - "default": false, - "description": "Agent supports [`McpServer::Sse`].", - "type": "boolean" + ], + "additionalProperties": true } }, - "type": "object" - }, - "McpServer": { - "anyOf": [ + "required": [ + "id", + "name" + ], + "oneOf": [ { - "allOf": [ - { - "$ref": "#/$defs/McpServerHttp" - } - ], - "description": "HTTP transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.http` is `true`.", + "description": "Single-value selector (dropdown).", + "type": "object", "properties": { "type": { - "const": "http", - "type": "string" + "type": "string", + "const": "select" } }, "required": [ "type" ], - "type": "object" - }, - { "allOf": [ { - "$ref": "#/$defs/McpServerSse" + "$ref": "#/$defs/SessionConfigSelect" } - ], - "description": "SSE transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.sse` is `true`.", + ] + }, + { + "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.", + "type": "object", "properties": { "type": { - "const": "sse", - "type": "string" + "type": "string", + "const": "boolean" } }, "required": [ "type" ], - "type": "object" - }, - { "allOf": [ { - "$ref": "#/$defs/McpServerStdio" + "$ref": "#/$defs/SessionConfigBoolean" } - ], - "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)" + "discriminator": { + "propertyName": "type" + } }, - "McpServerHttp": { - "description": "HTTP transport configuration for MCP.", - "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" - ] + "SessionConfigId": { + "description": "Unique identifier for a session configuration option.", + "type": "string" + }, + "SessionConfigOptionCategory": { + "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.", + "anyOf": [ + { + "description": "Session mode selector.", + "type": "string", + "const": "mode" }, - "headers": { - "description": "HTTP headers to set when making requests to the MCP server.", - "items": { - "$ref": "#/$defs/HttpHeader" - }, - "type": "array" + { + "description": "Model selector.", + "type": "string", + "const": "model" }, - "name": { - "description": "Human-readable name identifying this MCP server.", - "type": "string" + { + "description": "Model-related configuration parameter.", + "type": "string", + "const": "model_config" }, - "url": { - "description": "URL to the MCP server.", + { + "description": "Thought/reasoning level selector.", + "type": "string", + "const": "thought_level" + }, + { + "title": "other", + "description": "Unknown / uncategorized selector.", "type": "string" } - }, - "required": [ - "name", - "url", - "headers" - ], - "type": "object" + ] }, - "McpServerSse": { - "description": "SSE transport configuration for MCP.", + "SessionConfigValueId": { + "description": "Unique identifier for a session configuration option value.", + "type": "string" + }, + "SessionConfigSelectOptions": { + "description": "Possible values for a session configuration option.", + "anyOf": [ + { + "title": "Ungrouped", + "description": "A flat list of options with no grouping.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigSelectOption" + } + }, + { + "title": "Grouped", + "description": "A list of options grouped under headers.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigSelectGroup" + } + } + ] + }, + "SessionConfigSelectOption": { + "description": "A possible value for a session configuration option.", + "type": "object", "properties": { + "value": { + "description": "Unique identifier for this option value.", + "allOf": [ + { + "$ref": "#/$defs/SessionConfigValueId" + } + ] + }, + "name": { + "description": "Human-readable label for this option value.", + "type": "string" + }, + "description": { + "description": "Optional description for this option value.", + "type": [ + "string", + "null" + ] + }, "_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" + ], + "additionalProperties": true + } + }, + "required": [ + "value", + "name" + ] + }, + "SessionConfigSelectGroup": { + "description": "A group of possible values for a session configuration option.", + "type": "object", + "properties": { + "group": { + "description": "Unique identifier for this group.", + "allOf": [ + { + "$ref": "#/$defs/SessionConfigGroupId" + } ] }, - "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.", + "description": "Human-readable label for this group.", "type": "string" }, - "url": { - "description": "URL to the MCP server.", - "type": "string" + "options": { + "description": "The set of option values in this group.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigSelectOption" + } + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ + "group", "name", - "url", - "headers" - ], - "type": "object" + "options" + ] }, - "McpServerStdio": { - "description": "Stdio transport configuration for MCP.", + "SessionConfigGroupId": { + "description": "Unique identifier for a session configuration option value group.", + "type": "string" + }, + "SessionConfigSelect": { + "description": "A single-value selector (dropdown) session configuration option payload.", + "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" + "currentValue": { + "description": "The currently selected value.", + "allOf": [ + { + "$ref": "#/$defs/SessionConfigValueId" + } ] }, - "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" - }, - "env": { - "description": "Environment variables to set when launching the MCP server.", - "items": { - "$ref": "#/$defs/EnvVariable" - }, - "type": "array" - }, - "name": { - "description": "Human-readable name identifying this MCP server.", - "type": "string" + "options": { + "description": "The set of selectable options.", + "allOf": [ + { + "$ref": "#/$defs/SessionConfigSelectOptions" + } + ] + } + }, + "required": [ + "currentValue", + "options" + ] + }, + "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.", + "type": "object", + "properties": { + "currentValue": { + "description": "The current value of the boolean option.", + "type": "boolean" } }, "required": [ - "name", - "command", - "args", - "env" - ], - "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" + "currentValue" + ] }, - "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.", + "LoadSessionResponse": { + "description": "Response from loading an existing session.", + "type": "object", "properties": { + "modes": { + "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "anyOf": [ + { + "$ref": "#/$defs/SessionModeState" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "configOptions": { + "description": "Initial session configuration options if supported by the Agent.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_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" - ] + ], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/load" + }, + "ListSessionsResponse": { + "description": "Response from listing sessions.", + "type": "object", + "properties": { + "sessions": { + "description": "Array of session information objects", + "type": "array", + "items": { + "$ref": "#/$defs/SessionInfo" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "description": { - "description": "Optional description of the model.", + "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" ] }, - "modelId": { - "allOf": [ - { - "$ref": "#/$defs/ModelId" - } + "_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)", + "type": [ + "object", + "null" ], - "description": "Unique identifier for the model." - }, - "name": { - "description": "Human-readable name of the model.", - "type": "string" + "additionalProperties": true } }, "required": [ - "modelId", - "name" + "sessions" ], - "type": "object" + "x-side": "agent", + "x-method": "session/list" }, - "MultiSelectItems": { - "anyOf": [ - { + "SessionInfo": { + "description": "Information about a session returned by session/list", + "type": "object", + "properties": { + "sessionId": { + "description": "Unique identifier for the session", "allOf": [ { - "$ref": "#/$defs/UntitledMultiSelectItems" + "$ref": "#/$defs/SessionId" } - ], - "description": "Untitled multi-select items with plain string values.", - "title": "Untitled" + ] }, - { - "allOf": [ - { - "$ref": "#/$defs/TitledMultiSelectItems" - } - ], - "description": "Titled multi-select items with human-readable labels.", - "title": "Titled" - } - ], - "description": "Items for a multi-select (array) property schema." - }, - "MultiSelectPropertySchema": { - "description": "Schema for multi-select (array) properties in an elicitation form.", - "properties": { - "default": { - "description": "Default selected values.", + "cwd": { + "description": "The working directory for this session. Must be an absolute path.", + "type": "string" + }, + "additionalDirectories": { + "description": "Additional workspace roots reported for this session. Each path must be absolute.\n\nWhen present, this is the complete ordered additional-root list reported\nby the Agent. Omitted and empty values are equivalent: the response\nreports no additional roots.", + "type": "array", "items": { "type": "string" - }, - "type": [ - "array", - "null" - ] + } }, - "description": { - "description": "Human-readable description.", + "title": { + "description": "Human-readable title for the session", "type": [ "string", "null" - ] - }, - "items": { - "allOf": [ - { - "$ref": "#/$defs/MultiSelectItems" - } ], - "description": "The items definition describing allowed values." - }, - "maxItems": { - "description": "Maximum number of items to select.", - "format": "uint64", - "minimum": 0, - "type": [ - "integer", - "null" - ] + "x-deserialize-default-on-error": true }, - "minItems": { - "description": "Minimum number of items to select.", - "format": "uint64", - "minimum": 0, + "updatedAt": { + "description": "ISO 8601 timestamp of last activity", "type": [ - "integer", + "string", "null" - ] + ], + "x-deserialize-default-on-error": true }, - "title": { - "description": "Optional title for the property.", + "_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)", "type": [ - "string", + "object", "null" - ] + ], + "additionalProperties": true } }, "required": [ - "items" - ], - "type": "object" + "sessionId", + "cwd" + ] }, - "NesCapabilities": { - "description": "NES capabilities advertised by the agent during initialization.", + "DeleteSessionResponse": { + "description": "Response from deleting a session.", + "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" - ] - }, - "context": { - "anyOf": [ - { - "$ref": "#/$defs/NesContextCapabilities" - }, - { - "type": "null" - } - ], - "description": "Context the agent wants attached to each suggestion request." - }, - "events": { - "anyOf": [ - { - "$ref": "#/$defs/NesEventCapabilities" - }, - { - "type": "null" - } ], - "description": "Events the agent wants to receive." + "additionalProperties": true } }, - "type": "object" + "x-side": "agent", + "x-method": "session/delete" }, - "NesContextCapabilities": { - "description": "Context capabilities the agent wants attached to each suggestion request.", + "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.", + "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" - ] - }, - "diagnostics": { - "anyOf": [ - { - "$ref": "#/$defs/NesDiagnosticsCapabilities" - }, - { - "type": "null" - } - ], - "description": "Whether the agent wants diagnostics context." - }, - "editHistory": { - "anyOf": [ - { - "$ref": "#/$defs/NesEditHistoryCapabilities" - }, - { - "type": "null" - } - ], - "description": "Whether the agent wants edit history context." - }, - "openFiles": { - "anyOf": [ - { - "$ref": "#/$defs/NesOpenFilesCapabilities" - }, - { - "type": "null" - } - ], - "description": "Whether the agent wants open files context." - }, - "recentFiles": { - "anyOf": [ - { - "$ref": "#/$defs/NesRecentFilesCapabilities" - }, - { - "type": "null" - } - ], - "description": "Whether the agent wants recent files context." - }, - "relatedSnippets": { - "anyOf": [ - { - "$ref": "#/$defs/NesRelatedSnippetsCapabilities" - }, + "sessionId": { + "description": "Unique identifier for the newly created forked session.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/SessionId" } - ], - "description": "Whether the agent wants related snippets context." + ] }, - "userActions": { + "modes": { + "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", "anyOf": [ { - "$ref": "#/$defs/NesUserActionsCapabilities" - }, - { - "type": "null" - } - ], - "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" - }, - "range": { - "allOf": [ + "$ref": "#/$defs/SessionModeState" + }, { - "$ref": "#/$defs/Range" + "type": "null" } ], - "description": "The range of the diagnostic." + "x-deserialize-default-on-error": true }, - "severity": { - "allOf": [ - { - "$ref": "#/$defs/NesDiagnosticSeverity" - } + "configOptions": { + "description": "Initial session configuration options if supported by the Agent.", + "type": [ + "array", + "null" ], - "description": "The severity of the diagnostic." + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "uri": { - "description": "The URI of the file containing the diagnostic.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "uri", - "range", - "severity", - "message" + "sessionId" ], - "type": "object" + "x-side": "agent", + "x-method": "session/fork" }, - "NesDiagnosticSeverity": { - "description": "Severity of a diagnostic.", - "oneOf": [ - { - "const": "error", - "description": "An error.", - "type": "string" - }, - { - "const": "warning", - "description": "A warning.", - "type": "string" + "ResumeSessionResponse": { + "description": "Response from resuming an existing session.", + "type": "object", + "properties": { + "modes": { + "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "anyOf": [ + { + "$ref": "#/$defs/SessionModeState" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - { - "const": "information", - "description": "An informational message.", - "type": "string" + "configOptions": { + "description": "Initial session configuration options if supported by the Agent.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - { - "const": "hint", - "description": "A hint.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - ] + }, + "x-side": "agent", + "x-method": "session/resume" }, - "NesDiagnosticsCapabilities": { - "description": "Capabilities for diagnostics context.", + "CloseSessionResponse": { + "description": "Response from closing a session.", + "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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "x-side": "agent", + "x-method": "session/close" }, - "NesDocumentDidChangeCapabilities": { - "description": "Capabilities for `document/didChange` events.", + "SetSessionModeResponse": { + "description": "Response to `session/set_mode` method.", + "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" - ] - }, - "syncKind": { - "allOf": [ - { - "$ref": "#/$defs/TextDocumentSyncKind" - } ], - "description": "The sync kind the agent wants: `\"full\"` or `\"incremental\"`." + "additionalProperties": true } }, - "required": [ - "syncKind" - ], - "type": "object" + "x-side": "agent", + "x-method": "session/set_mode" }, - "NesDocumentDidCloseCapabilities": { - "description": "Marker for `document/didClose` capability support.", + "SetSessionConfigOptionResponse": { + "description": "Response to `session/set_config_option` method.", + "type": "object", "properties": { + "configOptions": { + "description": "The full set of configuration options and their current values.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "configOptions" + ], + "x-side": "agent", + "x-method": "session/set_config_option" }, - "NesDocumentDidFocusCapabilities": { - "description": "Marker for `document/didFocus` capability support.", + "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)", + "type": "object", "properties": { + "stopReason": { + "description": "Indicates why the agent stopped processing the turn.", + "allOf": [ + { + "$ref": "#/$defs/StopReason" + } + ] + }, + "usage": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nToken usage for this turn (optional).", + "anyOf": [ + { + "$ref": "#/$defs/Usage" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "stopReason" + ], + "x-side": "agent", + "x-method": "session/prompt" }, - "NesDocumentDidOpenCapabilities": { - "description": "Marker for `document/didOpen` capability support.", + "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": [ + { + "description": "The turn ended successfully.", + "type": "string", + "const": "end_turn" + }, + { + "description": "The turn ended because the agent reached the maximum number of tokens.", + "type": "string", + "const": "max_tokens" + }, + { + "description": "The turn ended because the agent reached the maximum number of allowed\nagent requests between user turns.", + "type": "string", + "const": "max_turn_requests" + }, + { + "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": "refusal" + }, + { + "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", + "const": "cancelled" + } + ] + }, + "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.", + "type": "object", "properties": { + "totalTokens": { + "description": "Sum of all token types across session.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "inputTokens": { + "description": "Total input tokens across all turns.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "outputTokens": { + "description": "Total output tokens across all turns.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "thoughtTokens": { + "description": "Total thought/reasoning tokens", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "cachedReadTokens": { + "description": "Total cache read tokens.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "cachedWriteTokens": { + "description": "Total cache write tokens.", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "totalTokens", + "inputTokens", + "outputTokens" + ] }, - "NesDocumentDidSaveCapabilities": { - "description": "Marker for `document/didSave` capability support.", + "StartNesResponse": { + "description": "Response to `nes/start`.", + "type": "object", "properties": { + "sessionId": { + "description": "The session ID for the newly started NES session.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "sessionId" + ], + "x-side": "agent", + "x-method": "nes/start" }, - "NesDocumentEventCapabilities": { - "description": "Document event capabilities the agent wants to receive.", + "SuggestNesResponse": { + "description": "Response to `nes/suggest`.", + "type": "object", "properties": { + "suggestions": { + "description": "The list of suggestions.", + "type": "array", + "items": { + "$ref": "#/$defs/NesSuggestion" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_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" + ], + "additionalProperties": true + } + }, + "required": [ + "suggestions" + ], + "x-side": "agent", + "x-method": "nes/suggest" + }, + "NesSuggestion": { + "description": "A suggestion returned by the agent.", + "oneOf": [ + { + "description": "A text edit suggestion.", + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "edit" + } + }, + "required": [ + "kind" + ], + "allOf": [ + { + "$ref": "#/$defs/NesEditSuggestion" + } ] }, - "didChange": { - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidChangeCapabilities" - }, - { - "type": "null" + { + "description": "A jump-to-location suggestion.", + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "jump" } + }, + "required": [ + "kind" ], - "description": "Whether the agent wants `document/didChange` events, and the sync kind." - }, - "didClose": { - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidCloseCapabilities" - }, + "allOf": [ { - "type": "null" + "$ref": "#/$defs/NesJumpSuggestion" } - ], - "description": "Whether the agent wants `document/didClose` events." + ] }, - "didFocus": { - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidFocusCapabilities" - }, - { - "type": "null" + { + "description": "A rename symbol suggestion.", + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "rename" } + }, + "required": [ + "kind" ], - "description": "Whether the agent wants `document/didFocus` events." - }, - "didOpen": { - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidOpenCapabilities" - }, + "allOf": [ { - "type": "null" + "$ref": "#/$defs/NesRenameSuggestion" } - ], - "description": "Whether the agent wants `document/didOpen` events." + ] }, - "didSave": { - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentDidSaveCapabilities" - }, - { - "type": "null" + { + "description": "A search-and-replace suggestion.", + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "searchAndReplace" } + }, + "required": [ + "kind" ], - "description": "Whether the agent wants `document/didSave` events." + "allOf": [ + { + "$ref": "#/$defs/NesSearchAndReplaceSuggestion" + } + ] } - }, - "type": "object" + ], + "discriminator": { + "propertyName": "kind" + } }, - "NesEditHistoryCapabilities": { - "description": "Capabilities for edit history context.", + "NesTextEdit": { + "description": "A text edit within a suggestion.", + "type": "object", "properties": { + "range": { + "description": "The range to replace.", + "allOf": [ + { + "$ref": "#/$defs/Range" + } + ] + }, + "newText": { + "description": "The replacement text.", + "type": "string" + }, "_meta": { - "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 edit history entries the agent can use.", - "format": "uint32", - "minimum": 0, - "type": [ - "integer", - "null" - ] - } - }, - "type": "object" - }, - "NesEditHistoryEntry": { - "description": "An entry in the edit history.", - "properties": { - "diff": { - "description": "A diff representing the edit.", - "type": "string" - }, - "uri": { - "description": "The URI of the edited file.", - "type": "string" + ], + "additionalProperties": true } }, "required": [ - "uri", - "diff" - ], - "type": "object" + "range", + "newText" + ] }, - "NesEditSuggestion": { - "description": "A text edit suggestion.", + "Range": { + "description": "A range in a text document, expressed as start and end positions.", + "type": "object", "properties": { - "cursorPosition": { - "anyOf": [ + "start": { + "description": "The start position (inclusive).", + "allOf": [ { "$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" + "end": { + "description": "The end position (exclusive).", + "allOf": [ + { + "$ref": "#/$defs/Position" + } + ] }, - "uri": { - "description": "The URI of the file to edit.", - "type": "string" - } - }, - "required": [ - "id", - "uri", - "edits" - ], - "type": "object" - }, - "NesEventCapabilities": { - "description": "Event capabilities the agent can consume.", - "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" - ] - }, - "document": { - "anyOf": [ - { - "$ref": "#/$defs/NesDocumentEventCapabilities" - }, - { - "type": "null" - } ], - "description": "Document event capabilities." + "additionalProperties": true } }, - "type": "object" + "required": [ + "start", + "end" + ] }, - "NesExcerpt": { - "description": "A code excerpt from a file.", + "Position": { + "description": "A zero-based position in a text document.\n\nThe meaning of `character` depends on the negotiated position encoding.", + "type": "object", "properties": { - "endLine": { - "description": "The end line of the excerpt (zero-based).", + "line": { + "description": "Zero-based line number.", + "type": "integer", "format": "uint32", - "minimum": 0, - "type": "integer" + "minimum": 0 }, - "startLine": { - "description": "The start line of the excerpt (zero-based).", + "character": { + "description": "Zero-based character offset (encoding-dependent).", + "type": "integer", "format": "uint32", - "minimum": 0, - "type": "integer" + "minimum": 0 }, - "text": { - "description": "The text content of the excerpt.", - "type": "string" - } - }, - "required": [ - "startLine", - "endLine", - "text" - ], - "type": "object" - }, - "NesJumpCapabilities": { - "description": "Marker for jump 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" - }, - "NesJumpSuggestion": { - "description": "A jump-to-location suggestion.", - "properties": { - "id": { - "description": "Unique identifier for accept/reject tracking.", - "type": "string" - }, - "position": { - "allOf": [ - { - "$ref": "#/$defs/Position" - } ], - "description": "The target position within the file." - }, - "uri": { - "description": "The file to navigate to.", - "type": "string" + "additionalProperties": true } }, "required": [ - "id", - "uri", - "position" - ], - "type": "object" + "line", + "character" + ] }, - "NesOpenFile": { - "description": "An open file in the editor.", + "NesEditSuggestion": { + "description": "A text edit suggestion.", + "type": "object", "properties": { - "languageId": { - "description": "The language identifier.", + "id": { + "description": "Unique identifier for accept/reject tracking.", "type": "string" }, - "lastFocusedMs": { - "description": "Timestamp in milliseconds since epoch of when the file was last focused.", - "format": "uint64", - "minimum": 0, - "type": [ - "integer", - "null" - ] - }, "uri": { - "description": "The URI of the file.", + "description": "The URI of the file to edit.", "type": "string" }, - "visibleRange": { + "edits": { + "description": "The text edits to apply.", + "type": "array", + "items": { + "$ref": "#/$defs/NesTextEdit" + } + }, + "cursorPosition": { + "description": "Optional suggested cursor position after applying edits.", "anyOf": [ { - "$ref": "#/$defs/Range" + "$ref": "#/$defs/Position" }, { "type": "null" } ], - "description": "The visible range in the editor, if any." + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ + "id", "uri", - "languageId" - ], - "type": "object" + "edits" + ] }, - "NesOpenFilesCapabilities": { - "description": "Capabilities for open files context.", + "NesJumpSuggestion": { + "description": "A jump-to-location suggestion.", + "type": "object", "properties": { + "id": { + "description": "Unique identifier for accept/reject tracking.", + "type": "string" + }, + "uri": { + "description": "The file to navigate to.", + "type": "string" + }, + "position": { + "description": "The target position within the file.", + "allOf": [ + { + "$ref": "#/$defs/Position" + } + ] + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "id", + "uri", + "position" + ] }, - "NesRecentFile": { - "description": "A recently accessed file.", + "NesRenameSuggestion": { + "description": "A rename symbol suggestion.", + "type": "object", "properties": { - "languageId": { - "description": "The language identifier.", + "id": { + "description": "Unique identifier for accept/reject tracking.", "type": "string" }, - "text": { - "description": "The full text content of the file.", + "uri": { + "description": "The file URI containing the symbol.", "type": "string" }, - "uri": { - "description": "The URI of the file.", + "position": { + "description": "The position of the symbol to rename.", + "allOf": [ + { + "$ref": "#/$defs/Position" + } + ] + }, + "newName": { + "description": "The new name for the symbol.", "type": "string" - } - }, - "required": [ - "uri", - "languageId", - "text" - ], - "type": "object" - }, - "NesRecentFilesCapabilities": { - "description": "Capabilities for recent files 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 recent files the agent can use.", - "format": "uint32", - "minimum": 0, - "type": [ - "integer", - "null" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "id", + "uri", + "position", + "newName" + ] }, - "NesRejectReason": { - "description": "The reason a suggestion was rejected.", - "oneOf": [ - { - "const": "rejected", - "description": "The user explicitly dismissed the suggestion.", + "NesSearchAndReplaceSuggestion": { + "description": "A search-and-replace suggestion.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier for accept/reject tracking.", "type": "string" }, - { - "const": "ignored", - "description": "The suggestion was shown but the user continued editing without interacting.", + "uri": { + "description": "The file URI to search within.", "type": "string" }, - { - "const": "replaced", - "description": "The suggestion was superseded by a newer suggestion.", + "search": { + "description": "The text or pattern to find.", "type": "string" }, - { - "const": "cancelled", - "description": "The request was cancelled before the agent returned a response.", + "replace": { + "description": "The replacement text.", "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": { + "isRegex": { + "description": "Whether `search` is a regular expression. Defaults to `false`.", + "type": [ + "boolean", + "null" + ] + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "id", + "uri", + "search", + "replace" + ] }, - "NesRenameCapabilities": { - "description": "Marker for rename suggestion support.", + "CloseNesResponse": { + "description": "Response from closing an NES session.", + "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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "x-side": "agent", + "x-method": "nes/close" }, - "NesRenameSuggestion": { - "description": "A rename symbol suggestion.", + "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)" + }, + "MessageMcpResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `mcp/message`.\n\nThis is the inner MCP response result payload. Any JSON value is valid.", + "x-side": "both", + "x-method": "mcp/message" + }, + "Error": { + "description": "JSON-RPC error object.\n\nRepresents an error that occurred during method execution, following the\nJSON-RPC 2.0 error object specification with optional additional data.\n\nSee protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)", + "type": "object", "properties": { - "id": { - "description": "Unique identifier for accept/reject tracking.", - "type": "string" - }, - "newName": { - "description": "The new name for the symbol.", - "type": "string" - }, - "position": { + "code": { + "description": "A number indicating the error type that occurred.\nThis must be an integer as defined in the JSON-RPC specification.", "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/ErrorCode" } - ], - "description": "The position of the symbol to rename." + ] }, - "uri": { - "description": "The file URI containing the symbol.", + "message": { + "description": "A string providing a short description of the error.\nThe message should be limited to a concise single sentence.", "type": "string" + }, + "data": { + "description": "Optional primitive or structured value that contains additional information about the error.\nThis may include debugging information or context-specific details." + } + }, + "required": [ + "code", + "message" + ] + }, + "ErrorCode": { + "description": "Predefined error codes for common JSON-RPC and ACP-specific errors.\n\nThese codes follow the JSON-RPC 2.0 specification for standard errors\nand use the reserved range (-32000 to -32099) for protocol-specific errors.", + "anyOf": [ + { + "title": "Parse error", + "description": "**Parse error**: Invalid JSON was received by the server.\nAn error occurred on the server while parsing the JSON text.", + "type": "integer", + "format": "int32", + "const": -32700 + }, + { + "title": "Invalid request", + "description": "**Invalid request**: The JSON sent is not a valid Request object.", + "type": "integer", + "format": "int32", + "const": -32600 + }, + { + "title": "Method not found", + "description": "**Method not found**: The method does not exist or is not available.", + "type": "integer", + "format": "int32", + "const": -32601 + }, + { + "title": "Invalid params", + "description": "**Invalid params**: Invalid method parameter(s).", + "type": "integer", + "format": "int32", + "const": -32602 + }, + { + "title": "Internal error", + "description": "**Internal error**: Internal JSON-RPC error.\nReserved for implementation-defined server errors.", + "type": "integer", + "format": "int32", + "const": -32603 + }, + { + "title": "Request cancelled", + "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.", + "type": "integer", + "format": "int32", + "const": -32800 + }, + { + "title": "Authentication required", + "description": "**Authentication required**: Authentication is required before this operation can be performed.", + "type": "integer", + "format": "int32", + "const": -32000 + }, + { + "title": "Resource not found", + "description": "**Resource not found**: A given resource, such as a file, was not found.", + "type": "integer", + "format": "int32", + "const": -32002 + }, + { + "title": "URL elicitation required", + "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.", + "type": "integer", + "format": "int32", + "const": -32042 + }, + { + "title": "Other", + "description": "Other undefined error code.", + "type": "integer", + "format": "int32" } - }, - "required": [ - "id", - "uri", - "position", - "newName" - ], - "type": "object" + ] }, - "NesRepository": { - "description": "Repository metadata for an NES session.", + "AgentNotification": { + "description": "A JSON-RPC notification object.", + "type": "object", "properties": { - "name": { - "description": "The repository name.", - "type": "string" - }, - "owner": { - "description": "The repository owner.", + "method": { + "description": "The notification method name.", "type": "string" }, - "remoteUrl": { - "description": "The remote URL of the repository.", - "type": "string" + "params": { + "description": "Method-specific notification parameters.", + "anyOf": [ + { + "description": "All possible notifications that an agent can send to a client.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly.\n\nNotifications do not expect a response.", + "anyOf": [ + { + "title": "SessionNotification", + "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)", + "allOf": [ + { + "$ref": "#/$defs/SessionNotification" + } + ] + }, + { + "title": "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.", + "allOf": [ + { + "$ref": "#/$defs/CompleteElicitationNotification" + } + ] + }, + { + "title": "MessageMcpNotification", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nReceives an MCP-over-ACP notification.", + "allOf": [ + { + "$ref": "#/$defs/MessageMcpNotification" + } + ] + }, + { + "title": "ExtNotification", + "description": "Handles extension notifications from the agent.\n\nAllows the Agent to send an arbitrary notification that is not part of the ACP spec.\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "allOf": [ + { + "$ref": "#/$defs/ExtNotification" + } + ] + } + ] + }, + { + "type": "null" + } + ] } }, "required": [ - "name", - "owner", - "remoteUrl" + "method" ], - "type": "object" + "x-docs-ignore": true }, - "NesSearchAndReplaceCapabilities": { - "description": "Marker for search and replace suggestion support.", + "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)", + "type": "object", "properties": { + "sessionId": { + "description": "The ID of the session this update pertains to.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "update": { + "description": "The actual update content.", + "allOf": [ + { + "$ref": "#/$defs/SessionUpdate" + } + ] + }, "_meta": { - "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" + ], + "additionalProperties": true } }, "required": [ - "id", - "uri", - "search", - "replace" + "sessionId", + "update" ], - "type": "object" + "x-side": "client", + "x-method": "session/update" }, - "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" + "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)", + "oneOf": [ + { + "description": "A chunk of the user's message being streamed.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "user_message_chunk" + } }, - "type": [ - "array", - "null" + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } ] }, - "editHistory": { - "description": "Recent edit history.", - "items": { - "$ref": "#/$defs/NesEditHistoryEntry" + { + "description": "A chunk of the agent's response being streamed.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_message_chunk" + } }, - "type": [ - "array", - "null" + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } ] }, - "openFiles": { - "description": "Currently open files in the editor.", - "items": { - "$ref": "#/$defs/NesOpenFile" + { + "description": "A chunk of the agent's internal reasoning being streamed.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "agent_thought_chunk" + } }, - "type": [ - "array", - "null" + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ContentChunk" + } ] }, - "recentFiles": { - "description": "Recently accessed files.", - "items": { - "$ref": "#/$defs/NesRecentFile" + { + "description": "Notification that a new tool call has been initiated.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "tool_call" + } }, - "type": [ - "array", - "null" + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ToolCall" + } ] }, - "relatedSnippets": { - "description": "Related code snippets.", - "items": { - "$ref": "#/$defs/NesRelatedSnippet" + { + "description": "Update on the status or results of a tool call.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "tool_call_update" + } }, - "type": [ - "array", - "null" + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/ToolCallUpdate" + } ] }, - "userActions": { - "description": "Recent user actions (typing, navigation, etc.).", - "items": { - "$ref": "#/$defs/NesUserAction" + { + "description": "The agent's execution plan for complex tasks.\nSee protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "plan" + } }, - "type": [ - "array", - "null" - ] - } - }, - "type": "object" - }, - "NesSuggestion": { - "description": "A suggestion returned by the agent.", - "discriminator": { - "propertyName": "kind" - }, - "oneOf": [ + "required": [ + "sessionUpdate" + ], + "allOf": [ + { + "$ref": "#/$defs/Plan" + } + ] + }, { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA content update for a plan identified by ID.", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "plan_update" + } + }, + "required": [ + "sessionUpdate" + ], "allOf": [ { - "$ref": "#/$defs/NesEditSuggestion" + "$ref": "#/$defs/PlanUpdate" } - ], - "description": "A text edit suggestion.", + ] + }, + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRemoval notice for a plan identified by ID.", + "type": "object", "properties": { - "kind": { - "const": "edit", - "type": "string" + "sessionUpdate": { + "type": "string", + "const": "plan_removed" } }, "required": [ - "kind" + "sessionUpdate" ], - "type": "object" - }, - { "allOf": [ { - "$ref": "#/$defs/NesJumpSuggestion" + "$ref": "#/$defs/PlanRemoved" } - ], - "description": "A jump-to-location suggestion.", + ] + }, + { + "description": "Available commands are ready or have changed", + "type": "object", "properties": { - "kind": { - "const": "jump", - "type": "string" + "sessionUpdate": { + "type": "string", + "const": "available_commands_update" } }, "required": [ - "kind" + "sessionUpdate" ], - "type": "object" + "allOf": [ + { + "$ref": "#/$defs/AvailableCommandsUpdate" + } + ] }, { + "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "current_mode_update" + } + }, + "required": [ + "sessionUpdate" + ], "allOf": [ { - "$ref": "#/$defs/NesRenameSuggestion" + "$ref": "#/$defs/CurrentModeUpdate" } - ], - "description": "A rename symbol suggestion.", + ] + }, + { + "description": "Session configuration options have been updated.", + "type": "object", "properties": { - "kind": { - "const": "rename", - "type": "string" + "sessionUpdate": { + "type": "string", + "const": "config_option_update" } }, "required": [ - "kind" + "sessionUpdate" ], - "type": "object" + "allOf": [ + { + "$ref": "#/$defs/ConfigOptionUpdate" + } + ] }, { + "description": "Session metadata has been updated (title, timestamps, custom metadata)", + "type": "object", + "properties": { + "sessionUpdate": { + "type": "string", + "const": "session_info_update" + } + }, + "required": [ + "sessionUpdate" + ], "allOf": [ { - "$ref": "#/$defs/NesSearchAndReplaceSuggestion" + "$ref": "#/$defs/SessionInfoUpdate" } - ], - "description": "A search-and-replace suggestion.", + ] + }, + { + "description": "Context window and cost update for the session.", + "type": "object", "properties": { - "kind": { - "const": "searchAndReplace", - "type": "string" + "sessionUpdate": { + "type": "string", + "const": "usage_update" } }, "required": [ - "kind" + "sessionUpdate" ], - "type": "object" + "allOf": [ + { + "$ref": "#/$defs/UsageUpdate" + } + ] } - ] + ], + "discriminator": { + "propertyName": "sessionUpdate" + } }, - "NesTextEdit": { - "description": "A text edit within a suggestion.", + "MessageId": { + "description": "Unique identifier for a message within a session.", + "type": "string" + }, + "ContentChunk": { + "description": "A streamed item of content", + "type": "object", "properties": { - "newText": { - "description": "The replacement text.", - "type": "string" - }, - "range": { + "content": { + "description": "A single item of content", "allOf": [ { - "$ref": "#/$defs/Range" + "$ref": "#/$defs/ContentBlock" + } + ] + }, + "messageId": { + "description": "A unique identifier for the message this chunk belongs to.\n\nAll chunks belonging to the same message share the same `messageId`.\nA change in `messageId` indicates a new message has started.", + "anyOf": [ + { + "$ref": "#/$defs/MessageId" + }, + { + "type": "null" } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "description": "The range to replace." + "additionalProperties": true } }, "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" - } + "content" ] }, - "NesUserAction": { - "description": "A user action (typing, cursor movement, etc.).", + "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)", + "type": "object", "properties": { - "action": { - "description": "The kind of action (e.g., \"insertChar\", \"cursorMovement\").", + "toolCallId": { + "description": "Unique identifier for this tool call within the session.", + "allOf": [ + { + "$ref": "#/$defs/ToolCallId" + } + ] + }, + "title": { + "description": "Human-readable title describing what the tool is doing.", "type": "string" }, - "position": { + "kind": { + "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment.", "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/ToolKind" } - ], - "description": "The position where the action occurred." + ] }, - "timestampMs": { - "description": "Timestamp in milliseconds since epoch.", - "format": "uint64", - "minimum": 0, - "type": "integer" + "status": { + "description": "Current execution status of the tool call.", + "allOf": [ + { + "$ref": "#/$defs/ToolCallStatus" + } + ] }, - "uri": { - "description": "The URI of the file where the action occurred.", - "type": "string" + "content": { + "description": "Content produced by the tool call.", + "type": "array", + "items": { + "$ref": "#/$defs/ToolCallContent" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "locations": { + "description": "File locations affected by this tool call.\nEnables \"follow-along\" features in clients.", + "type": "array", + "items": { + "$ref": "#/$defs/ToolCallLocation" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "rawInput": { + "description": "Raw input parameters sent to the tool." + }, + "rawOutput": { + "description": "Raw output returned by the tool." + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "action", - "uri", - "position", - "timestampMs" - ], - "type": "object" + "toolCallId", + "title" + ] }, - "NesUserActionsCapabilities": { - "description": "Capabilities for user actions context.", + "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)", + "type": "object", "properties": { + "content": { + "description": "Human-readable description of what this task aims to accomplish.", + "type": "string" + }, + "priority": { + "description": "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal.", + "allOf": [ + { + "$ref": "#/$defs/PlanEntryPriority" + } + ] + }, + "status": { + "description": "Current execution status of this task.", + "allOf": [ + { + "$ref": "#/$defs/PlanEntryStatus" + } + ] + }, "_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" - ] + ], + "additionalProperties": true + } + }, + "required": [ + "content", + "priority", + "status" + ] + }, + "PlanEntryPriority": { + "description": "Priority levels for plan entries.\n\nUsed to indicate the relative importance or urgency of different\ntasks in the execution plan.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)", + "oneOf": [ + { + "description": "High priority task - critical to the overall goal.", + "type": "string", + "const": "high" + }, + { + "description": "Medium priority task - important but not critical.", + "type": "string", + "const": "medium" + }, + { + "description": "Low priority task - nice to have but not essential.", + "type": "string", + "const": "low" + } + ] + }, + "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": [ + { + "description": "The task has not started yet.", + "type": "string", + "const": "pending" }, - "maxCount": { - "description": "Maximum number of user actions the agent can use.", - "format": "uint32", - "minimum": 0, - "type": [ - "integer", - "null" - ] + { + "description": "The task is currently being worked on.", + "type": "string", + "const": "in_progress" + }, + { + "description": "The task has been successfully completed.", + "type": "string", + "const": "completed" } - }, - "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)", + "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)", + "type": "object", "properties": { + "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.", + "type": "array", + "items": { + "$ref": "#/$defs/PlanEntry" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_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" + ], + "additionalProperties": true } }, "required": [ - "cwd", - "mcpServers" - ], - "type": "object", - "x-method": "session/new", - "x-side": "agent" + "entries" + ] }, - "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" + "PlanUpdateContent": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUpdated content for a plan.", + "oneOf": [ + { + "description": "Structured plan entries.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "items" + } }, - "type": [ - "array", - "null" + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/PlanItems" + } ] }, - "models": { - "anyOf": [ - { - "$ref": "#/$defs/SessionModelState" - }, - { - "type": "null" + { + "description": "A URI pointing to a file containing the plan.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" } + }, + "required": [ + "type" ], - "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" - }, + "allOf": [ { - "type": "null" + "$ref": "#/$defs/PlanFile" } - ], - "description": "Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + ] }, - "sessionId": { + { + "description": "Raw markdown content for the plan.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "markdown" + } + }, + "required": [ + "type" + ], "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/PlanMarkdown" } - ], - "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" + "discriminator": { + "propertyName": "type" + } }, - "NumberPropertySchema": { - "description": "Schema for number (floating-point) properties in an elicitation form.", + "PlanId": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for a plan within a session.", + "type": "string" + }, + "PlanItems": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented as structured entries.", + "type": "object", "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" + "id": { + "description": "The plan ID to update.", + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } ] }, - "minimum": { - "description": "Minimum value (inclusive).", - "format": "double", - "type": [ - "number", - "null" - ] + "entries": { + "description": "The list of tasks to be accomplished.\n\nWhen updating an item-based plan, the agent must send a complete list of all entries\nwith their current status. The client replaces that plan with each update.", + "type": "array", + "items": { + "$ref": "#/$defs/PlanEntry" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "title": { - "description": "Optional title for the property.", + "_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)", "type": [ - "string", + "object", "null" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "id", + "entries" + ] }, - "PermissionOption": { - "description": "An option presented to the user when requesting permission.", + "PlanFile": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented by a file URI.", + "type": "object", "properties": { + "id": { + "description": "The plan ID to update.", + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ] + }, + "uri": { + "description": "The URI of the file containing the plan.", + "type": "string" + }, "_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": { + ], + "additionalProperties": true + } + }, + "required": [ + "id", + "uri" + ] + }, + "PlanMarkdown": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented as raw markdown content.", + "type": "object", + "properties": { + "id": { + "description": "The plan ID to update.", "allOf": [ { - "$ref": "#/$defs/PermissionOptionKind" + "$ref": "#/$defs/PlanId" } - ], - "description": "Hint about the nature of this permission option." + ] }, - "name": { - "description": "Human-readable label to display to the user.", + "content": { + "description": "Markdown content for the plan.", "type": "string" }, - "optionId": { - "allOf": [ - { - "$ref": "#/$defs/PermissionOptionId" - } + "_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)", + "type": [ + "object", + "null" ], - "description": "Unique identifier for this permission option." + "additionalProperties": true } }, "required": [ - "optionId", - "name", - "kind" - ], - "type": "object" - }, - "PermissionOptionId": { - "description": "Unique identifier for a permission option.", - "type": "string" + "id", + "content" + ] }, - "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" + "PlanUpdate": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA content update for a plan identified by ID.", + "type": "object", + "properties": { + "plan": { + "description": "The updated plan content.", + "allOf": [ + { + "$ref": "#/$defs/PlanUpdateContent" + } + ] }, - { - "const": "reject_always", - "description": "Reject this operation and remember the choice.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } + }, + "required": [ + "plan" ] }, - "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)", + "PlanRemoved": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRemoval notice for a plan identified by ID.", + "type": "object", "properties": { + "id": { + "description": "The plan ID to remove.", + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ] + }, "_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" + ], + "additionalProperties": true } }, "required": [ - "entries" - ], - "type": "object" + "id" + ] }, - "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)", + "AvailableCommand": { + "description": "Information about a command.", + "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" - ] + "name": { + "description": "Command name (e.g., `create_plan`, `research_codebase`).", + "type": "string" }, - "content": { - "description": "Human-readable description of what this task aims to accomplish.", + "description": { + "description": "Human-readable description of what the command does.", "type": "string" }, - "priority": { - "allOf": [ + "input": { + "description": "Input for the command if required", + "anyOf": [ { - "$ref": "#/$defs/PlanEntryPriority" + "$ref": "#/$defs/AvailableCommandInput" + }, + { + "type": "null" } ], - "description": "The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal." + "x-deserialize-default-on-error": true }, - "status": { - "allOf": [ - { - "$ref": "#/$defs/PlanEntryStatus" - } + "_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)", + "type": [ + "object", + "null" ], - "description": "Current execution status of this task." + "additionalProperties": true } }, "required": [ - "content", - "priority", - "status" - ], - "type": "object" + "name", + "description" + ] }, - "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" - }, + "AvailableCommandInput": { + "description": "The input specification for a command.", + "anyOf": [ { - "const": "low", - "description": "Low priority task - nice to have but not essential.", - "type": "string" + "title": "unstructured", + "description": "All text that was typed after the command name is provided as input.", + "allOf": [ + { + "$ref": "#/$defs/UnstructuredCommandInput" + } + ] } ] }, - "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.", + "UnstructuredCommandInput": { + "description": "All text that was typed after the command name is provided as input.", + "type": "object", + "properties": { + "hint": { + "description": "A hint to display when the input hasn't been provided yet", "type": "string" }, - { - "const": "completed", - "description": "The task has been successfully completed.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } + }, + "required": [ + "hint" ] }, - "Position": { - "description": "A zero-based position in a text document.\n\nThe meaning of `character` depends on the negotiated position encoding.", + "AvailableCommandsUpdate": { + "description": "Available commands are ready or have changed", + "type": "object", "properties": { - "character": { - "description": "Zero-based character offset (encoding-dependent).", - "format": "uint32", - "minimum": 0, - "type": "integer" + "availableCommands": { + "description": "Commands the agent can execute", + "type": "array", + "items": { + "$ref": "#/$defs/AvailableCommand" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "line": { - "description": "Zero-based line number.", - "format": "uint32", - "minimum": 0, - "type": "integer" + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "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" - } + "availableCommands" ] }, - "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)", + "CurrentModeUpdate": { + "description": "The current mode of the session has changed\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "type": "object", "properties": { + "currentModeId": { + "description": "The ID of the current mode", + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ] + }, "_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" + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "currentModeId" + ] }, - "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)", + "ConfigOptionUpdate": { + "description": "Session configuration options have been updated.", + "type": "object", "properties": { + "configOptions": { + "description": "The full set of configuration options and their current values.", + "type": "array", + "items": { + "$ref": "#/$defs/SessionConfigOption" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_meta": { - "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" + ], + "additionalProperties": true + } + }, + "required": [ + "configOptions" + ] + }, + "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.", + "type": "object", + "properties": { + "title": { + "description": "Human-readable title for the session. Set to null to clear.", + "type": [ + "string", + "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.", + "updatedAt": { + "description": "ISO 8601 timestamp of last activity. Set to null to clear.", "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" - } + "_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)", + "type": [ + "object", + "null" ], - "description": "The ID of the session to send this user message to" + "additionalProperties": true } - }, - "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)", + "Cost": { + "description": "Cost information for a session.", + "type": "object", "properties": { + "amount": { + "description": "Total cumulative cost for session.", + "type": "number", + "format": "double" + }, + "currency": { + "description": "ISO 4217 currency code (e.g., \"USD\", \"EUR\").", + "type": "string" + }, "_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" - ] + ], + "additionalProperties": true + } + }, + "required": [ + "amount", + "currency" + ] + }, + "UsageUpdate": { + "description": "Context window and cost update for a session.", + "type": "object", + "properties": { + "used": { + "description": "Tokens currently in context.", + "type": "integer", + "format": "uint64", + "minimum": 0 }, - "stopReason": { - "allOf": [ - { - "$ref": "#/$defs/StopReason" - } - ], - "description": "Indicates why the agent stopped processing the turn." + "size": { + "description": "Total context window size in tokens.", + "type": "integer", + "format": "uint64", + "minimum": 0 }, - "usage": { + "cost": { + "description": "Cumulative session cost (optional).", "anyOf": [ { - "$ref": "#/$defs/Usage" + "$ref": "#/$defs/Cost" }, { "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)." + "x-deserialize-default-on-error": true }, - "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.", + "_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)", "type": [ - "string", + "object", "null" - ] + ], + "additionalProperties": true } }, "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" + "used", + "size" + ] }, - "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.", + "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.", + "type": "object", "properties": { - "apiType": { + "elicitationId": { + "description": "The ID of the elicitation that completed.", "allOf": [ { - "$ref": "#/$defs/LlmProtocol" + "$ref": "#/$defs/ElicitationId" } - ], - "description": "Protocol currently used by this provider." + ] }, - "baseUrl": { - "description": "Base URL currently used by this provider.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "apiType", - "baseUrl" + "elicitationId" ], - "type": "object" + "x-side": "client", + "x-method": "elicitation/complete" }, - "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.", + "MessageMcpNotification": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification parameters for `mcp/message`.\n\nThis is used when the wrapped MCP message is a notification and the outer JSON-RPC\nenvelope has no `id`.", + "type": "object", "properties": { + "connectionId": { + "description": "The MCP-over-ACP connection this message is sent on.", + "allOf": [ + { + "$ref": "#/$defs/McpConnectionId" + } + ] + }, + "method": { + "description": "The inner MCP method name.", + "type": "string" + }, + "params": { + "description": "Optional inner MCP params.\n\nIf omitted or set to `null`, the inner MCP message has no params.", + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, "_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" - }, + ], + "additionalProperties": true + } + }, + "required": [ + "connectionId", + "method" + ], + "x-side": "both", + "x-method": "mcp/message" + }, + "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)" + }, + "ClientRequest": { + "description": "A JSON-RPC request object.", + "type": "object", + "properties": { + "id": { + "description": "The request id used to correlate the matching response.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/RequestId" } - ], - "description": "Current effective non-secret routing config.\nNull or omitted means provider is disabled." + ] }, - "id": { - "description": "Provider identifier, for example \"main\" or \"openai\".", + "method": { + "description": "The method name to invoke.", "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" + "params": { + "description": "Method-specific request parameters.", + "anyOf": [ + { + "description": "All possible requests that a client can send to an agent.\n\nThis enum is used internally for routing RPC requests. You typically won't need\nto use this directly.\n\nThis enum encompasses all method calls from client to agent.", + "anyOf": [ + { + "title": "InitializeRequest", + "description": "Establishes the connection with a client and negotiates protocol capabilities.\n\nThis method is called once at the beginning of the connection to:\n- Negotiate the protocol version to use\n- Exchange capability information between client and agent\n- Determine available authentication methods\n\nThe agent should respond with its supported protocol version and capabilities.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", + "allOf": [ + { + "$ref": "#/$defs/InitializeRequest" + } + ] + }, + { + "title": "AuthenticateRequest", + "description": "Authenticates the client using the specified authentication method.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)", + "allOf": [ + { + "$ref": "#/$defs/AuthenticateRequest" + } + ] + }, + { + "title": "ListProvidersRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLists providers that can be configured by the client.", + "allOf": [ + { + "$ref": "#/$defs/ListProvidersRequest" + } + ] + }, + { + "title": "SetProviderRequest", + "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.", + "allOf": [ + { + "$ref": "#/$defs/SetProviderRequest" + } + ] + }, + { + "title": "DisableProviderRequest", + "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.", + "allOf": [ + { + "$ref": "#/$defs/DisableProviderRequest" + } + ] + }, + { + "title": "LogoutRequest", + "description": "Logs 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.", + "allOf": [ + { + "$ref": "#/$defs/LogoutRequest" + } + ] + }, + { + "title": "NewSessionRequest", + "description": "Creates a new conversation session with the agent.\n\nSessions represent independent conversation contexts with their own history and state.\n\nThe agent should:\n- Create a new session context\n- Connect to any specified MCP servers\n- Return a unique session ID for future requests\n\nMay return an `auth_required` error if the agent requires authentication.\n\nSee protocol docs: [Session Setup](https://agentclientprotocol.com/protocol/session-setup)", + "allOf": [ + { + "$ref": "#/$defs/NewSessionRequest" + } + ] + }, + { + "title": "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)", + "allOf": [ + { + "$ref": "#/$defs/LoadSessionRequest" + } + ] + }, + { + "title": "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.", + "allOf": [ + { + "$ref": "#/$defs/ListSessionsRequest" + } + ] + }, + { + "title": "DeleteSessionRequest", + "description": "Deletes an existing session from `session/list`.\n\nThis method is only available if the agent advertises the `sessionCapabilities.delete` capability.", + "allOf": [ + { + "$ref": "#/$defs/DeleteSessionRequest" + } + ] + }, + { + "title": "ForkSessionRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nForks an existing session to create a new independent session.\n\nThis method is only available if the agent advertises the `session.fork` capability.\n\nThe agent should create a new session with the same conversation context as the\noriginal, allowing operations like generating summaries without affecting the\noriginal session's history.", + "allOf": [ + { + "$ref": "#/$defs/ForkSessionRequest" + } + ] + }, + { + "title": "ResumeSessionRequest", + "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`).", + "allOf": [ + { + "$ref": "#/$defs/ResumeSessionRequest" + } + ] + }, + { + "title": "CloseSessionRequest", + "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.", + "allOf": [ + { + "$ref": "#/$defs/CloseSessionRequest" + } + ] + }, + { + "title": "SetSessionModeRequest", + "description": "Sets the current mode for a session.\n\nAllows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\nthat affect system prompts, tool availability, and permission behaviors.\n\nThe mode must be one of the modes advertised in `availableModes` during session\ncreation or loading. Agents may also change modes autonomously and notify the\nclient via `current_mode_update` notifications.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "allOf": [ + { + "$ref": "#/$defs/SetSessionModeRequest" + } + ] + }, + { + "title": "SetSessionConfigOptionRequest", + "description": "Sets the current value for a session configuration option.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionConfigOptionRequest" + } + ] + }, + { + "title": "PromptRequest", + "description": "Processes a user prompt within a session.\n\nThis method handles the whole lifecycle of a prompt:\n- Receives user messages with optional context (files, images, etc.)\n- Processes the prompt using language models\n- Reports language model content and tool calls to the Clients\n- Requests permission to run tools\n- Executes any requested tool calls\n- Returns when the turn is complete with a stop reason\n\nSee protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)", + "allOf": [ + { + "$ref": "#/$defs/PromptRequest" + } + ] + }, + { + "title": "StartNesRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nStarts an NES session.", + "allOf": [ + { + "$ref": "#/$defs/StartNesRequest" + } + ] + }, + { + "title": "SuggestNesRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequests a code suggestion.", + "allOf": [ + { + "$ref": "#/$defs/SuggestNesRequest" + } + ] + }, + { + "title": "CloseNesRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCloses an active NES session and frees up any resources associated with it.\n\nThe agent must cancel any ongoing work and then free up any resources\nassociated with the NES session.", + "allOf": [ + { + "$ref": "#/$defs/CloseNesRequest" + } + ] + }, + { + "title": "MessageMcpRequest", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nExchanges an MCP-over-ACP message.", + "allOf": [ + { + "$ref": "#/$defs/MessageMcpRequest" + } + ] + }, + { + "title": "ExtMethodRequest", + "description": "Handles extension method requests from the client.\n\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "allOf": [ + { + "$ref": "#/$defs/ExtRequest" + } + ] + } + ] + }, + { + "type": "null" + } + ] } }, "required": [ "id", - "supported", - "required" + "method" ], - "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" + "x-docs-ignore": true }, - "Range": { - "description": "A range in a text document, expressed as start and end positions.", + "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)", + "type": "object", "properties": { - "end": { + "protocolVersion": { + "description": "The latest protocol version supported by the client.", "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/ProtocolVersion" } - ], - "description": "The end position (exclusive)." + ] }, - "start": { + "clientCapabilities": { + "description": "Capabilities supported by the client.", + "default": { + "fs": { + "readTextFile": false, + "writeTextFile": false + }, + "terminal": false, + "auth": { + "terminal": false + } + }, "allOf": [ { - "$ref": "#/$defs/Position" + "$ref": "#/$defs/ClientCapabilities" } - ], - "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": [ + "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.", + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/Implementation" + }, + { + "type": "null" } ], - "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": { + "x-deserialize-default-on-error": true + }, "_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" + ], + "additionalProperties": true } }, "required": [ - "content" + "protocolVersion" ], - "type": "object", - "x-method": "fs/read_text_file", - "x-side": "client" + "x-side": "agent", + "x-method": "initialize" }, - "RejectNesNotification": { - "description": "Notification sent when a suggestion is rejected.", + "ClientCapabilities": { + "description": "Capabilities supported by the client.\n\nAdvertised during initialization to inform the agent about\navailable features and methods.\n\nSee protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)", + "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" + "fs": { + "description": "File system capabilities supported by the client.\nDetermines which file operations the agent can request.", + "default": { + "readTextFile": false, + "writeTextFile": false + }, + "allOf": [ + { + "$ref": "#/$defs/FileSystemCapabilities" + } ] }, - "id": { - "description": "The ID of the rejected suggestion.", - "type": "string" + "terminal": { + "description": "Whether the Client support all `terminal/*` methods.", + "type": "boolean", + "default": false }, - "reason": { + "session": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSession-related capabilities supported by the client.", "anyOf": [ { - "$ref": "#/$defs/NesRejectReason" + "$ref": "#/$defs/ClientSessionCapabilities" }, { "type": "null" } ], - "description": "The reason for rejection." + "x-deserialize-default-on-error": true }, - "sessionId": { - "allOf": [ + "plan": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the client supports `plan_update` and `plan_removed` session updates.\n\nOptional. Omitted means the client does not advertise support.\nSupplying `{}` means the client can receive both update types.", + "anyOf": [ { - "$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/PlanCapabilities" + }, { - "$ref": "#/$defs/SessionId" + "type": "null" } ], - "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" + "x-deserialize-default-on-error": true }, - { - "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" - } + "auth": { + "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`.", + "default": { + "terminal": false }, - "required": [ - "outcome" - ], - "type": "object" - }, - { "allOf": [ { - "$ref": "#/$defs/SelectedPermissionOutcome" - } - ], - "description": "The user selected one of the provided options.", - "properties": { - "outcome": { - "const": "selected", - "type": "string" + "$ref": "#/$defs/AuthCapabilities" } - }, - "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": [ + "elicitation": { + "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.", + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/ElicitationCapabilities" + }, + { + "type": "null" } ], - "description": "The session ID for this request." + "x-deserialize-default-on-error": true }, - "toolCall": { - "allOf": [ + "nes": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNES (Next Edit Suggestions) capabilities supported by the client.", + "anyOf": [ { - "$ref": "#/$defs/ToolCallUpdate" + "$ref": "#/$defs/ClientNesCapabilities" + }, + { + "type": "null" } ], - "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": { + "x-deserialize-default-on-error": true + }, + "positionEncodings": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe position encodings supported by the client, in order of preference.", + "type": "array", + "items": { + "$ref": "#/$defs/PositionEncodingKind" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, "_meta": { - "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." + "additionalProperties": true } - }, - "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.", + "FileSystemCapabilities": { + "description": "File system capabilities that a client may support.\n\nSee protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)", + "type": "object", "properties": { + "readTextFile": { + "description": "Whether the Client supports `fs/read_text_file` requests.", + "type": "boolean", + "default": false + }, + "writeTextFile": { + "description": "Whether the Client supports `fs/write_text_file` requests.", + "type": "boolean", + "default": false + }, "_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": { + ], + "additionalProperties": true + } + } + }, + "ClientSessionCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSession-related capabilities supported by the client.", + "type": "object", + "properties": { + "configOptions": { + "description": "Config option capabilities supported by the client.\n\nOmitted or `null` means the client does not advertise support for any\nconfig option extensions.", "anyOf": [ { - "$ref": "#/$defs/Annotations" + "$ref": "#/$defs/SessionConfigOptionsCapabilities" }, { "type": "null" } - ] - }, - "description": { - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" + ], + "x-deserialize-default-on-error": true }, - "size": { - "format": "int64", + "_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)", "type": [ - "integer", + "object", "null" - ] + ], + "additionalProperties": true + } + } + }, + "SessionConfigOptionsCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSession configuration option capabilities supported by the client.", + "type": "object", + "properties": { + "boolean": { + "description": "Whether the client supports boolean session configuration options.\n\nOmitted or `null` means the client does not advertise support.\nSupplying `{}` means agents may include `type: \"boolean\"` entries in\n`configOptions`, and the client may send `session/set_config_option`\nrequests with `type: \"boolean\"` and a boolean `value`.", + "anyOf": [ + { + "$ref": "#/$defs/BooleanConfigOptionCapabilities" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true }, - "title": { + "_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)", "type": [ - "string", + "object", "null" - ] - }, - "uri": { - "type": "string" + ], + "additionalProperties": true } - }, - "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.", + "BooleanConfigOptionCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for boolean session configuration options.\n\nSupplying `{}` means the client supports boolean session configuration options.", + "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" - ] - }, - "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." + "additionalProperties": true } - }, - "required": [ - "sessionId", - "cwd" - ], - "type": "object", - "x-method": "session/resume", - "x-side": "agent" + } }, - "ResumeSessionResponse": { - "description": "Response from resuming an existing session.", + "PlanCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for receiving `plan_update` and `plan_removed` session updates.", + "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" - ] + ], + "additionalProperties": true + } + } + }, + "AuthCapabilities": { + "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.\n\nAdvertised during initialization to inform the agent which authentication\nmethod types the client can handle. This governs opt-in types that require\nadditional client-side support.", + "type": "object", + "properties": { + "terminal": { + "description": "Whether the client supports `terminal` authentication methods.\n\nWhen `true`, the agent may include `terminal` entries in its authentication methods.", + "type": "boolean", + "default": false }, - "configOptions": { - "description": "Initial session configuration options if supported by the Agent.", - "items": { - "$ref": "#/$defs/SessionConfigOption" - }, + "_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)", "type": [ - "array", + "object", "null" - ] - }, - "models": { + ], + "additionalProperties": true + } + } + }, + "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.", + "type": "object", + "properties": { + "form": { + "description": "Whether the client supports form-based elicitation.", "anyOf": [ { - "$ref": "#/$defs/SessionModelState" + "$ref": "#/$defs/ElicitationFormCapabilities" }, { "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" + "x-deserialize-default-on-error": true }, - "modes": { + "url": { + "description": "Whether the client supports URL-based elicitation.", "anyOf": [ { - "$ref": "#/$defs/SessionModeState" + "$ref": "#/$defs/ElicitationUrlCapabilities" }, { "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": { + "x-deserialize-default-on-error": true + }, "_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." + "additionalProperties": true } - }, - "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`.", + "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.", + "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" - ] + ], + "additionalProperties": true } - }, - "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)", + "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.", + "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" - ] - }, - "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": { + "additionalProperties": true + } + } + }, + "ClientNesCapabilities": { + "description": "NES capabilities advertised by the client during initialization.", + "type": "object", + "properties": { + "jump": { + "description": "Whether the client supports the `jump` suggestion kind.", "anyOf": [ { - "$ref": "#/$defs/SessionForkCapabilities" + "$ref": "#/$defs/NesJumpCapabilities" }, { "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`." + "x-deserialize-default-on-error": true }, - "list": { + "rename": { + "description": "Whether the client supports the `rename` suggestion kind.", "anyOf": [ { - "$ref": "#/$defs/SessionListCapabilities" + "$ref": "#/$defs/NesRenameCapabilities" }, { "type": "null" } ], - "description": "Whether the agent supports `session/list`." + "x-deserialize-default-on-error": true }, - "resume": { + "searchAndReplace": { + "description": "Whether the client supports the `searchAndReplace` suggestion kind.", "anyOf": [ { - "$ref": "#/$defs/SessionResumeCapabilities" + "$ref": "#/$defs/NesSearchAndReplaceCapabilities" }, { "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": { + "x-deserialize-default-on-error": true + }, "_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" - ] + ], + "additionalProperties": true } - }, - "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.", + "NesJumpCapabilities": { + "description": "Marker for jump suggestion support.", + "type": "object", "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" + "_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)", + "type": [ + "object", + "null" ], - "type": "object" + "additionalProperties": true } - ], + } + }, + "NesRenameCapabilities": { + "description": "Marker for rename suggestion support.", + "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.", + "additionalProperties": true + } + } + }, + "NesSearchAndReplaceCapabilities": { + "description": "Marker for search and replace suggestion support.", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", "type": [ - "string", + "object", "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" + "additionalProperties": true } - ], - "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.", + "AuthenticateRequest": { + "description": "Request parameters for the authenticate method.\n\nSpecifies which authentication method to use.", + "type": "object", "properties": { - "currentValue": { + "methodId": { + "description": "The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response.", "allOf": [ { - "$ref": "#/$defs/SessionConfigValueId" + "$ref": "#/$defs/AuthMethodId" } - ], - "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" + "additionalProperties": true } }, "required": [ - "group", - "name", - "options" + "methodId" ], - "type": "object" + "x-side": "agent", + "x-method": "authenticate" }, - "SessionConfigSelectOption": { - "description": "A possible value for a session configuration option.", + "ListProvidersRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/list`.", + "type": "object", "properties": { "_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.", + ], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "providers/list" + }, + "SetProviderRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/set`.\n\nReplaces the full configuration for one provider id.", + "type": "object", + "properties": { + "id": { + "description": "Provider id to configure.", "type": "string" }, - "value": { + "apiType": { + "description": "Protocol type for this provider.", "allOf": [ { - "$ref": "#/$defs/SessionConfigValueId" + "$ref": "#/$defs/LlmProtocol" } - ], - "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" + "baseUrl": { + "description": "Base URL for requests sent through this provider.", + "type": "string" + }, + "headers": { + "description": "Full headers map for this provider.\nMay include authorization, routing, or other integration-specific headers.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } + }, + "required": [ + "id", + "apiType", + "baseUrl" ], - "description": "Possible values for a session configuration option." + "x-side": "agent", + "x-method": "providers/set" }, - "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.", + "DisableProviderRequest": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for `providers/disable`.", + "type": "object", "properties": { + "id": { + "description": "Provider id to disable.", + "type": "string" + }, "_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" - ] + ], + "additionalProperties": true } }, - "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" + "required": [ + "id" + ], + "x-side": "agent", + "x-method": "providers/disable" }, - "SessionInfo": { - "description": "Information about a session returned by session/list", + "LogoutRequest": { + "description": "Request parameters for the logout method.\n\nTerminates the current authenticated session.", + "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" - ] - }, - "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" - }, + ], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "logout" + }, + "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)", + "type": "object", + "properties": { "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" + "additionalDirectories": { + "description": "Additional 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.", + "type": "array", + "items": { + "type": "string" + } }, - "title": { - "description": "Human-readable title for the session", - "type": [ - "string", - "null" - ] + "mcpServers": { + "description": "List of MCP (Model Context Protocol) servers the agent should connect to.", + "type": "array", + "items": { + "$ref": "#/$defs/McpServer" + } }, - "updatedAt": { - "description": "ISO 8601 timestamp of last activity", + "_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)", "type": [ - "string", + "object", "null" - ] + ], + "additionalProperties": true } }, "required": [ - "sessionId", - "cwd" + "cwd", + "mcpServers" ], - "type": "object" + "x-side": "agent", + "x-method": "session/new" }, - "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" + "McpServer": { + "description": "Configuration for connecting to an MCP (Model Context Protocol) server.\n\nMCP servers provide tools and context that the agent can use when\nprocessing prompts.\n\nSee protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)", + "anyOf": [ + { + "description": "HTTP transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.http` is `true`.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "http" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/McpServerHttp" + } ] }, - "title": { - "description": "Human-readable title for the session. Set to null to clear.", - "type": [ - "string", - "null" + { + "description": "SSE transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.sse` is `true`.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "sse" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/McpServerSse" + } ] }, - "updatedAt": { - "description": "ISO 8601 timestamp of last activity. Set to null to clear.", - "type": [ - "string", - "null" + { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nACP transport configuration\n\nOnly available when the Agent capabilities indicate `mcp_capabilities.acp` is `true`.\nThe MCP server is provided by an ACP component and communicates over the ACP channel.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "acp" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/McpServerAcp" + } + ] + }, + { + "title": "stdio", + "description": "Stdio transport configuration\n\nAll Agents MUST support this transport.", + "allOf": [ + { + "$ref": "#/$defs/McpServerStdio" + } ] } - }, - "type": "object" + ] }, - "SessionListCapabilities": { - "description": "Capabilities for the `session/list` method.\n\nBy supplying `{}` it means that the agent supports listing of sessions.", + "HttpHeader": { + "description": "An HTTP header to set when making requests to the MCP server.", + "type": "object", "properties": { + "name": { + "description": "The name of the HTTP header.", + "type": "string" + }, + "value": { + "description": "The value to set for the HTTP header.", + "type": "string" + }, "_meta": { - "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" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "name", + "value" + ] }, - "SessionMode": { - "description": "A mode the agent can operate in.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", + "McpServerHttp": { + "description": "HTTP transport configuration for MCP.", + "type": "object", "properties": { + "name": { + "description": "Human-readable name identifying this MCP server.", + "type": "string" + }, + "url": { + "description": "URL to the MCP server.", + "type": "string" + }, + "headers": { + "description": "HTTP headers to set when making requests to the MCP server.", + "type": "array", + "items": { + "$ref": "#/$defs/HttpHeader" + } + }, "_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" + ], + "additionalProperties": true } }, "required": [ - "id", - "name" - ], - "type": "object" - }, - "SessionModeId": { - "description": "Unique identifier for a Session Mode.", - "type": "string" + "name", + "url", + "headers" + ] }, - "SessionModeState": { - "description": "The set of modes and the one currently active.", + "McpServerSse": { + "description": "SSE transport configuration for MCP.", + "type": "object", "properties": { + "name": { + "description": "Human-readable name identifying this MCP server.", + "type": "string" + }, + "url": { + "description": "URL to the MCP server.", + "type": "string" + }, + "headers": { + "description": "HTTP headers to set when making requests to the MCP server.", + "type": "array", + "items": { + "$ref": "#/$defs/HttpHeader" + } + }, "_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." + "additionalProperties": true } }, "required": [ - "currentModeId", - "availableModes" - ], - "type": "object" + "name", + "url", + "headers" + ] }, - "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.", + "McpServerAcp": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nACP transport configuration for MCP.\n\nThe MCP server is provided by an ACP component and communicates over the ACP channel\nusing `mcp/connect`, `mcp/message`, and `mcp/disconnect`.", + "type": "object", "properties": { + "name": { + "description": "Human-readable name identifying this MCP server.", + "type": "string" + }, + "id": { + "description": "Unique identifier for this MCP server, generated by the component providing it.\n\nProviders MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible\non the same ACP connection.", + "allOf": [ + { + "$ref": "#/$defs/McpServerAcpId" + } + ] + }, "_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." + "additionalProperties": true } }, "required": [ - "currentModelId", - "availableModels" - ], - "type": "object" + "name", + "id" + ] }, - "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)", + "McpServerStdio": { + "description": "Stdio transport configuration for MCP.", + "type": "object", "properties": { + "name": { + "description": "Human-readable name identifying this MCP server.", + "type": "string" + }, + "command": { + "description": "Path to the MCP server executable.", + "type": "string" + }, + "args": { + "description": "Command-line arguments to pass to the MCP server.", + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "description": "Environment variables to set when launching the MCP server.", + "type": "array", + "items": { + "$ref": "#/$defs/EnvVariable" + } + }, "_meta": { - "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" - ] + ], + "additionalProperties": true + } + }, + "required": [ + "name", + "command", + "args", + "env" + ] + }, + "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)", + "type": "object", + "properties": { + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "type": "array", + "items": { + "$ref": "#/$defs/McpServer" + } + }, + "cwd": { + "description": "The working directory for this session.", + "type": "string" + }, + "additionalDirectories": { + "description": "Additional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the loaded\nsession. It may differ from any previously used or reported list as long as\nthe request `cwd` matches the session's `cwd`.", + "type": "array", + "items": { + "type": "string" + } }, "sessionId": { + "description": "The ID of the session to load.", "allOf": [ { "$ref": "#/$defs/SessionId" } - ], - "description": "The ID of the session this update pertains to." + ] }, - "update": { - "allOf": [ - { - "$ref": "#/$defs/SessionUpdate" - } + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "description": "The actual update content." + "additionalProperties": true } }, "required": [ - "sessionId", - "update" + "mcpServers", + "cwd", + "sessionId" ], - "type": "object", - "x-method": "session/update", - "x-side": "client" + "x-side": "agent", + "x-method": "session/load" }, - "SessionResumeCapabilities": { - "description": "Capabilities for the `session/resume` method.\n\nBy supplying `{}` it means that the agent supports resuming of sessions.", + "ListSessionsRequest": { + "description": "Request parameters for listing existing sessions.\n\nOnly available if the Agent supports the `sessionCapabilities.list` capability.", + "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)", + "cwd": { + "description": "Filter sessions by working directory. Must be an absolute path.", "type": [ - "object", + "string", "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" - } - }, - "required": [ - "sessionUpdate" - ], - "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" + "cursor": { + "description": "Opaque cursor token from a previous response's nextCursor field for cursor-based pagination", + "type": [ + "string", + "null" + ] }, - { - "allOf": [ - { - "$ref": "#/$defs/SessionInfoUpdate" - } - ], - "description": "Session metadata has been updated (title, timestamps, custom metadata)", - "properties": { - "sessionUpdate": { - "const": "session_info_update", - "type": "string" - } - }, - "required": [ - "sessionUpdate" + "_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)", + "type": [ + "object", + "null" ], - "type": "object" - }, - { + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/list" + }, + "DeleteSessionRequest": { + "description": "Request parameters for deleting an existing session from `session/list`.\n\nOnly available if the Agent supports the `sessionCapabilities.delete` capability.", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session to delete.", "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" + "$ref": "#/$defs/SessionId" } - }, - "required": [ - "sessionUpdate" + ] + }, + "_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)", + "type": [ + "object", + "null" ], - "type": "object" + "additionalProperties": true } - ] + }, + "required": [ + "sessionId" + ], + "x-side": "agent", + "x-method": "session/delete" }, - "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.", + "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.", + "type": "object", "properties": { + "sessionId": { + "description": "The ID of the session to fork.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "cwd": { + "description": "The working directory for this session.", + "type": "string" + }, + "additionalDirectories": { + "description": "Additional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the forked\nsession.", + "type": "array", + "items": { + "type": "string" + } + }, + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "type": "array", + "items": { + "$ref": "#/$defs/McpServer" + } + }, "_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": { + ], + "additionalProperties": true + } + }, + "required": [ + "sessionId", + "cwd" + ], + "x-side": "agent", + "x-method": "session/fork" + }, + "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.", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session to resume.", "allOf": [ { - "$ref": "#/$defs/LlmProtocol" + "$ref": "#/$defs/SessionId" } - ], - "description": "Protocol type for this provider." + ] }, - "baseUrl": { - "description": "Base URL for requests sent through this provider.", + "cwd": { + "description": "The working directory for this session.", "type": "string" }, - "headers": { - "additionalProperties": { + "additionalDirectories": { + "description": "Additional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the resumed\nsession. It may differ from any previously used or reported list as long as\nthe request `cwd` matches the session's `cwd`.", + "type": "array", + "items": { "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" + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "type": "array", + "items": { + "$ref": "#/$defs/McpServer" + } + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "id", - "apiType", - "baseUrl" + "sessionId", + "cwd" ], - "type": "object", - "x-method": "providers/set", - "x-side": "agent" + "x-side": "agent", + "x-method": "session/resume" }, - "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`.", + "CloseSessionRequest": { + "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.", + "type": "object", "properties": { + "sessionId": { + "description": "The ID of the session to close.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, "_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" - ] + ], + "additionalProperties": true } }, + "required": [ + "sessionId" + ], + "x-side": "agent", + "x-method": "session/close" + }, + "SetSessionModeRequest": { + "description": "Request parameters for setting a session mode.", "type": "object", - "x-method": "providers/set", - "x-side": "agent" + "properties": { + "sessionId": { + "description": "The ID of the session to set the mode for.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "modeId": { + "description": "The ID of the mode to set.", + "allOf": [ + { + "$ref": "#/$defs/SessionModeId" + } + ] + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true + } + }, + "required": [ + "sessionId", + "modeId" + ], + "x-side": "agent", + "x-method": "session/set_mode" }, "SetSessionConfigOptionRequest": { + "description": "Request parameters for setting a session configuration option.", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session to set the configuration option for.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "configId": { + "description": "The ID of the configuration option to set.", + "allOf": [ + { + "$ref": "#/$defs/SessionConfigId" + } + ] + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true + } + }, + "required": [ + "sessionId", + "configId" + ], "anyOf": [ { "description": "A boolean value (`type: \"boolean\"`).", + "type": "object", "properties": { - "type": { - "const": "boolean", - "type": "string" - }, "value": { "description": "The boolean value.", "type": "boolean" + }, + "type": { + "type": "string", + "const": "boolean" } }, "required": [ "type", "value" - ], - "type": "object" + ] }, { + "title": "value_id", "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.", + "type": "object", "properties": { "value": { + "description": "The value ID.", "allOf": [ { "$ref": "#/$defs/SessionConfigValueId" } - ], - "description": "The value ID." + ] } }, "required": [ "value" - ], - "title": "value_id", - "type": "object" + ] } ], - "description": "Request parameters for setting a session configuration option.", + "x-side": "agent", + "x-method": "session/set_config_option" + }, + "PromptRequest": { + "description": "Request parameters for sending a user prompt to the agent.\n\nContains the user's message and any additional context.\n\nSee protocol docs: [User Message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)", + "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" - ] - }, - "configId": { - "allOf": [ - { - "$ref": "#/$defs/SessionConfigId" - } - ], - "description": "The ID of the configuration option to set." - }, "sessionId": { + "description": "The ID of the session to send this user message to", "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": { + ] + }, + "prompt": { + "description": "The blocks of content that compose the user's message.\n\nAs a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`],\nwhile other variants are optionally enabled via [`PromptCapabilities`].\n\nThe Client MUST adapt its interface according to [`PromptCapabilities`].\n\nThe client MAY include referenced pieces of context as either\n[`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`].\n\nWhen available, [`ContentBlock::Resource`] is preferred\nas it avoids extra round-trips and allows the message to include\npieces of context from sources the agent may not have access to.", + "type": "array", + "items": { + "$ref": "#/$defs/ContentBlock" + } + }, "_meta": { - "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" + ], + "additionalProperties": true } }, "required": [ - "configOptions" + "sessionId", + "prompt" ], - "type": "object", - "x-method": "session/set_config_option", - "x-side": "agent" + "x-side": "agent", + "x-method": "session/prompt" }, - "SetSessionModeRequest": { - "description": "Request parameters for setting a session mode.", + "StartNesRequest": { + "description": "Request to start an NES session.", + "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)", + "workspaceUri": { + "description": "The root URI of the workspace.", "type": [ - "object", + "string", "null" ] }, - "modeId": { - "allOf": [ - { - "$ref": "#/$defs/SessionModeId" - } + "workspaceFolders": { + "description": "The workspace folders.", + "type": [ + "array", + "null" ], - "description": "The ID of the mode to set." + "items": { + "$ref": "#/$defs/WorkspaceFolder" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "sessionId": { - "allOf": [ + "repository": { + "description": "Repository metadata, if the workspace is a git repository.", + "anyOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/NesRepository" + }, + { + "type": "null" } ], - "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": { + "x-deserialize-default-on-error": true + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "session/set_mode", - "x-side": "agent" + "x-side": "agent", + "x-method": "nes/start" }, - "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.", + "WorkspaceFolder": { + "description": "A workspace folder.", + "type": "object", "properties": { + "uri": { + "description": "The URI of the folder.", + "type": "string" + }, + "name": { + "description": "The display name of the folder.", + "type": "string" + }, "_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/ModelId" - } - ], - "description": "The ID of the model to set." - }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } ], - "description": "The ID of the session to set the model for." + "additionalProperties": true } }, "required": [ - "sessionId", - "modelId" - ], - "type": "object", - "x-method": "session/set_model", - "x-side": "agent" + "uri", + "name" + ] }, - "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.", + "NesRepository": { + "description": "Repository metadata for an NES session.", + "type": "object", "properties": { + "name": { + "description": "The repository name.", + "type": "string" + }, + "owner": { + "description": "The repository owner.", + "type": "string" + }, + "remoteUrl": { + "description": "The remote URL of the repository.", + "type": "string" + }, "_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" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "session/set_model", - "x-side": "agent" + "required": [ + "name", + "owner", + "remoteUrl" + ] }, - "StartNesRequest": { - "description": "Request to start an NES session.", + "SuggestNesRequest": { + "description": "Request for a code suggestion.", + "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" + "sessionId": { + "description": "The session ID for this request.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } ] }, - "repository": { + "uri": { + "description": "The URI of the document to suggest for.", + "type": "string" + }, + "version": { + "description": "The version number of the document.", + "type": "integer", + "format": "int64" + }, + "position": { + "description": "The current cursor position.", + "allOf": [ + { + "$ref": "#/$defs/Position" + } + ] + }, + "selection": { + "description": "The current text selection range, if any.", "anyOf": [ { - "$ref": "#/$defs/NesRepository" + "$ref": "#/$defs/Range" }, { "type": "null" } ], - "description": "Repository metadata, if the workspace is a git repository." + "x-deserialize-default-on-error": true }, - "workspaceFolders": { - "description": "The workspace folders.", - "items": { - "$ref": "#/$defs/WorkspaceFolder" - }, - "type": [ - "array", - "null" + "triggerKind": { + "description": "What triggered this suggestion request.", + "allOf": [ + { + "$ref": "#/$defs/NesTriggerKind" + } ] }, - "workspaceUri": { - "description": "The root URI of the workspace.", - "type": [ - "string", - "null" - ] - } - }, - "type": "object", - "x-method": "nes/start", - "x-side": "agent" - }, - "StartNesResponse": { - "description": "Response to `nes/start`.", - "properties": { + "context": { + "description": "Context for the suggestion, included based on agent capabilities.", + "anyOf": [ + { + "$ref": "#/$defs/NesSuggestContext" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, "_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 the newly started NES session." + "additionalProperties": true } }, "required": [ - "sessionId" + "sessionId", + "uri", + "version", + "position", + "triggerKind" ], - "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" - } - ] + "x-side": "agent", + "x-method": "nes/suggest" }, - "StringFormat": { - "description": "String format types for string properties in elicitation schemas.", + "NesTriggerKind": { + "description": "What triggered the suggestion request.", "oneOf": [ { - "const": "email", - "description": "Email address format.", - "type": "string" - }, - { - "const": "uri", - "description": "URI format.", - "type": "string" + "description": "Triggered by user typing or cursor movement.", + "type": "string", + "const": "automatic" }, { - "const": "date", - "description": "Date format (YYYY-MM-DD).", - "type": "string" + "description": "Triggered by a diagnostic appearing at or near the cursor.", + "type": "string", + "const": "diagnostic" }, { - "const": "date-time", - "description": "Date-time format (ISO 8601).", - "type": "string" + "description": "Triggered by an explicit user action (keyboard shortcut).", + "type": "string", + "const": "manual" } ] }, - "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\"`.", + "NesSuggestContext": { + "description": "Context attached to a suggestion request.", + "type": "object", "properties": { - "default": { - "description": "Default value.", - "type": [ - "string", - "null" - ] - }, - "description": { - "description": "Human-readable description.", + "recentFiles": { + "description": "Recently accessed files.", "type": [ - "string", + "array", "null" - ] - }, - "enum": { - "description": "Enum values for untitled single-select enums.", + ], "items": { - "type": "string" + "$ref": "#/$defs/NesRecentFile" }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "relatedSnippets": { + "description": "Related code snippets.", "type": [ "array", "null" - ] - }, - "format": { - "anyOf": [ - { - "$ref": "#/$defs/StringFormat" - }, - { - "type": "null" - } ], - "description": "String format." + "items": { + "$ref": "#/$defs/NesRelatedSnippet" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "maxLength": { - "description": "Maximum string length.", - "format": "uint32", - "minimum": 0, + "editHistory": { + "description": "Recent edit history.", "type": [ - "integer", + "array", "null" - ] + ], + "items": { + "$ref": "#/$defs/NesEditHistoryEntry" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "minLength": { - "description": "Minimum string length.", - "format": "uint32", - "minimum": 0, + "userActions": { + "description": "Recent user actions (typing, navigation, etc.).", "type": [ - "integer", + "array", "null" - ] - }, - "oneOf": { - "description": "Titled enum options for titled single-select enums.", + ], "items": { - "$ref": "#/$defs/EnumOption" + "$ref": "#/$defs/NesUserAction" }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true + }, + "openFiles": { + "description": "Currently open files in the editor.", "type": [ "array", "null" - ] + ], + "items": { + "$ref": "#/$defs/NesOpenFile" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "pattern": { - "description": "Pattern the string must match.", + "diagnostics": { + "description": "Current diagnostics (errors, warnings).", "type": [ - "string", + "array", "null" - ] + ], + "items": { + "$ref": "#/$defs/NesDiagnostic" + }, + "x-deserialize-default-on-error": true, + "x-deserialize-skip-invalid-items": true }, - "title": { - "description": "Optional title for the property.", + "_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)", "type": [ - "string", + "object", "null" - ] + ], + "additionalProperties": true } - }, - "type": "object" + } }, - "SuggestNesRequest": { - "description": "Request for a code suggestion.", + "NesRecentFile": { + "description": "A recently accessed file.", + "type": "object", "properties": { + "uri": { + "description": "The URI of the file.", + "type": "string" + }, + "languageId": { + "description": "The language identifier.", + "type": "string" + }, + "text": { + "description": "The full text content of the file.", + "type": "string" + }, "_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" - ] - }, - "context": { - "anyOf": [ - { - "$ref": "#/$defs/NesSuggestContext" - }, - { - "type": "null" - } - ], - "description": "Context for the suggestion, included based on agent capabilities." - }, - "position": { - "allOf": [ - { - "$ref": "#/$defs/Position" - } - ], - "description": "The current cursor position." - }, - "selection": { - "anyOf": [ - { - "$ref": "#/$defs/Range" - }, - { - "type": "null" - } - ], - "description": "The current text selection range, if any." - }, - "sessionId": { - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ], - "description": "The session ID for this request." - }, - "triggerKind": { - "allOf": [ - { - "$ref": "#/$defs/NesTriggerKind" - } ], - "description": "What triggered this suggestion request." - }, + "additionalProperties": true + } + }, + "required": [ + "uri", + "languageId", + "text" + ] + }, + "NesRelatedSnippet": { + "description": "A related code snippet from a file.", + "type": "object", + "properties": { "uri": { - "description": "The URI of the document to suggest for.", + "description": "The URI of the file containing the snippets.", "type": "string" }, - "version": { - "description": "The version number of the document.", - "format": "int64", - "type": "integer" + "excerpts": { + "description": "The code excerpts.", + "type": "array", + "items": { + "$ref": "#/$defs/NesExcerpt" + } + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "sessionId", "uri", - "version", - "position", - "triggerKind" - ], - "type": "object", - "x-method": "nes/suggest", - "x-side": "agent" + "excerpts" + ] }, - "SuggestNesResponse": { - "description": "Response to `nes/suggest`.", + "NesExcerpt": { + "description": "A code excerpt from a file.", + "type": "object", "properties": { + "startLine": { + "description": "The start line of the excerpt (zero-based).", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "endLine": { + "description": "The end line of the excerpt (zero-based).", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "text": { + "description": "The text content of the excerpt.", + "type": "string" + }, "_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" - ] - }, - "suggestions": { - "description": "The list of suggestions.", - "items": { - "$ref": "#/$defs/NesSuggestion" - }, - "type": "array" + ], + "additionalProperties": true } }, "required": [ - "suggestions" - ], - "type": "object", - "x-method": "nes/suggest", - "x-side": "agent" + "startLine", + "endLine", + "text" + ] }, - "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)", + "NesEditHistoryEntry": { + "description": "An entry in the edit history.", + "type": "object", "properties": { + "uri": { + "description": "The URI of the edited file.", + "type": "string" + }, + "diff": { + "description": "A diff representing the edit.", + "type": "string" + }, "_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" - ] - }, - "terminalId": { - "type": "string" + ], + "additionalProperties": true } }, "required": [ - "terminalId" - ], - "type": "object" + "uri", + "diff" + ] }, - "TerminalExitStatus": { - "description": "Exit status of a terminal command.", + "NesUserAction": { + "description": "A user action (typing, cursor movement, etc.).", + "type": "object", "properties": { + "action": { + "description": "The kind of action (e.g., \"insertChar\", \"cursorMovement\").", + "type": "string" + }, + "uri": { + "description": "The URI of the file where the action occurred.", + "type": "string" + }, + "position": { + "description": "The position where the action occurred.", + "allOf": [ + { + "$ref": "#/$defs/Position" + } + ] + }, + "timestampMs": { + "description": "Timestamp in milliseconds since epoch.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, "_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" - ] + ], + "additionalProperties": true + } + }, + "required": [ + "action", + "uri", + "position", + "timestampMs" + ] + }, + "NesOpenFile": { + "description": "An open file in the editor.", + "type": "object", + "properties": { + "uri": { + "description": "The URI of the file.", + "type": "string" }, - "exitCode": { - "description": "The process exit code (may be null if terminated by signal).", - "format": "uint32", - "minimum": 0, + "languageId": { + "description": "The language identifier.", + "type": "string" + }, + "visibleRange": { + "description": "The visible range in the editor, if any.", + "anyOf": [ + { + "$ref": "#/$defs/Range" + }, + { + "type": "null" + } + ], + "x-deserialize-default-on-error": true + }, + "lastFocusedMs": { + "description": "Timestamp in milliseconds since epoch of when the file was last focused.", "type": [ "integer", "null" - ] + ], + "format": "uint64", + "minimum": 0, + "x-deserialize-default-on-error": true }, - "signal": { - "description": "The signal that terminated the process (may be null if exited normally).", + "_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)", "type": [ - "string", + "object", "null" - ] + ], + "additionalProperties": true } }, - "type": "object" + "required": [ + "uri", + "languageId" + ] }, - "TerminalOutputRequest": { - "description": "Request to get the current output and status of a terminal.", + "NesDiagnostic": { + "description": "A diagnostic (error, warning, etc.).", + "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" + "uri": { + "description": "The URI of the file containing the diagnostic.", + "type": "string" + }, + "range": { + "description": "The range of the diagnostic.", + "allOf": [ + { + "$ref": "#/$defs/Range" + } ] }, - "sessionId": { + "severity": { + "description": "The severity of the diagnostic.", "allOf": [ { - "$ref": "#/$defs/SessionId" + "$ref": "#/$defs/NesDiagnosticSeverity" } - ], - "description": "The session ID for this request." + ] }, - "terminalId": { - "description": "The ID of the terminal to get output from.", + "message": { + "description": "The diagnostic message.", "type": "string" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "sessionId", - "terminalId" - ], - "type": "object", - "x-method": "terminal/output", - "x-side": "client" + "uri", + "range", + "severity", + "message" + ] }, - "TerminalOutputResponse": { - "description": "Response containing the terminal output and exit status.", + "NesDiagnosticSeverity": { + "description": "Severity of a diagnostic.", + "oneOf": [ + { + "description": "An error.", + "type": "string", + "const": "error" + }, + { + "description": "A warning.", + "type": "string", + "const": "warning" + }, + { + "description": "An informational message.", + "type": "string", + "const": "information" + }, + { + "description": "A hint.", + "type": "string", + "const": "hint" + } + ] + }, + "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.", + "type": "object", "properties": { + "sessionId": { + "description": "The ID of the NES session to close.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, "_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" + ], + "additionalProperties": true + } + }, + "required": [ + "sessionId" + ], + "x-side": "agent", + "x-method": "nes/close" + }, + "ClientResponse": { + "description": "A JSON-RPC response object.", + "anyOf": [ + { + "title": "Result", + "description": "A successful JSON-RPC response.", + "type": "object", + "properties": { + "id": { + "description": "The id of the request this response answers.", + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ] + }, + "result": { + "description": "Method-specific response data.", + "anyOf": [ + { + "title": "WriteTextFileResponse", + "description": "Successful result returned for a `fs/write_text_file` request.", + "allOf": [ + { + "$ref": "#/$defs/WriteTextFileResponse" + } + ] + }, + { + "title": "ReadTextFileResponse", + "description": "Successful result returned for a `fs/read_text_file` request.", + "allOf": [ + { + "$ref": "#/$defs/ReadTextFileResponse" + } + ] + }, + { + "title": "RequestPermissionResponse", + "description": "Successful result returned for a `session/request_permission` request.", + "allOf": [ + { + "$ref": "#/$defs/RequestPermissionResponse" + } + ] + }, + { + "title": "CreateTerminalResponse", + "description": "Successful result returned for a `terminal/create` request.", + "allOf": [ + { + "$ref": "#/$defs/CreateTerminalResponse" + } + ] + }, + { + "title": "TerminalOutputResponse", + "description": "Successful result returned for a `terminal/output` request.", + "allOf": [ + { + "$ref": "#/$defs/TerminalOutputResponse" + } + ] + }, + { + "title": "ReleaseTerminalResponse", + "description": "Successful result returned for a `terminal/release` request.", + "allOf": [ + { + "$ref": "#/$defs/ReleaseTerminalResponse" + } + ] + }, + { + "title": "WaitForTerminalExitResponse", + "description": "Successful result returned for a `terminal/wait_for_exit` request.", + "allOf": [ + { + "$ref": "#/$defs/WaitForTerminalExitResponse" + } + ] + }, + { + "title": "KillTerminalResponse", + "description": "Successful result returned for a `terminal/kill` request.", + "allOf": [ + { + "$ref": "#/$defs/KillTerminalResponse" + } + ] + }, + { + "title": "CreateElicitationResponse", + "description": "Successful result returned for a `elicitation/create` request.", + "allOf": [ + { + "$ref": "#/$defs/CreateElicitationResponse" + } + ] + }, + { + "title": "ConnectMcpResponse", + "description": "Successful result returned for a `mcp/connect` request.", + "allOf": [ + { + "$ref": "#/$defs/ConnectMcpResponse" + } + ] + }, + { + "title": "DisconnectMcpResponse", + "description": "Successful result returned for a `mcp/disconnect` request.", + "allOf": [ + { + "$ref": "#/$defs/DisconnectMcpResponse" + } + ] + }, + { + "title": "ExtMethodResponse", + "description": "Successful result returned by an extension method outside the core ACP method set.", + "allOf": [ + { + "$ref": "#/$defs/ExtResponse" + } + ] + }, + { + "title": "MessageMcpResponse", + "description": "Successful result returned by an MCP-over-ACP `mcp/message` request.", + "allOf": [ + { + "$ref": "#/$defs/MessageMcpResponse" + } + ] + } + ] + } + }, + "required": [ + "id", + "result" ] }, - "exitStatus": { - "anyOf": [ - { - "$ref": "#/$defs/TerminalExitStatus" + { + "title": "Error", + "description": "A failed JSON-RPC response.", + "type": "object", + "properties": { + "id": { + "description": "The id of the request this response answers.", + "allOf": [ + { + "$ref": "#/$defs/RequestId" + } + ] }, - { - "type": "null" + "error": { + "description": "Method-specific error data.", + "allOf": [ + { + "$ref": "#/$defs/Error" + } + ] } - ], - "description": "Exit status if the command has completed." - }, - "output": { - "description": "The terminal output captured so far.", - "type": "string" - }, - "truncated": { - "description": "Whether the output was truncated due to byte limits.", - "type": "boolean" + }, + "required": [ + "id", + "error" + ] } - }, - "required": [ - "output", - "truncated" ], - "type": "object", - "x-method": "terminal/output", - "x-side": "client" + "x-docs-ignore": true }, - "TextContent": { - "description": "Text provided to or from an LLM.", + "WriteTextFileResponse": { + "description": "Response to `fs/write_text_file`", + "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" - ] - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/$defs/Annotations" - }, - { - "type": "null" - } - ] - }, - "text": { + ], + "additionalProperties": true + } + }, + "x-side": "client", + "x-method": "fs/write_text_file" + }, + "ReadTextFileResponse": { + "description": "Response containing the contents of a text file.", + "type": "object", + "properties": { + "content": { + "description": "Content payload returned by this response.", "type": "string" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "text" + "content" ], - "type": "object" + "x-side": "client", + "x-method": "fs/read_text_file" }, - "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.", + "RequestPermissionResponse": { + "description": "Response to a permission request.", + "type": "object", "properties": { - "range": { - "anyOf": [ - { - "$ref": "#/$defs/Range" - }, + "outcome": { + "description": "The user's decision on the permission request.", + "allOf": [ { - "type": "null" + "$ref": "#/$defs/RequestPermissionOutcome" } - ], - "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" + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "text" + "outcome" ], - "type": "object" + "x-side": "client", + "x-method": "session/request_permission" }, - "TextDocumentSyncKind": { - "description": "How the agent wants document changes delivered.", + "RequestPermissionOutcome": { + "description": "The outcome of a permission request.", "oneOf": [ { - "const": "full", - "description": "Client sends the entire file content on each change.", - "type": "string" + "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)", + "type": "object", + "properties": { + "outcome": { + "type": "string", + "const": "cancelled" + } + }, + "required": [ + "outcome" + ] }, { - "const": "incremental", - "description": "Client sends only the changed ranges.", - "type": "string" + "description": "The user selected one of the provided options.", + "type": "object", + "properties": { + "outcome": { + "type": "string", + "const": "selected" + } + }, + "required": [ + "outcome" + ], + "allOf": [ + { + "$ref": "#/$defs/SelectedPermissionOutcome" + } + ] } - ] + ], + "discriminator": { + "propertyName": "outcome" + } }, - "TextResourceContents": { - "description": "Text-based resource contents.", + "SelectedPermissionOutcome": { + "description": "The user selected one of the provided options.", + "type": "object", "properties": { + "optionId": { + "description": "The ID of the option the user selected.", + "allOf": [ + { + "$ref": "#/$defs/PermissionOptionId" + } + ] + }, "_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" - ] - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "text": { - "type": "string" - }, - "uri": { - "type": "string" + ], + "additionalProperties": true } }, "required": [ - "text", - "uri" - ], - "type": "object" + "optionId" + ] }, - "TitledMultiSelectItems": { - "description": "Items definition for titled multi-select enum properties.", + "CreateTerminalResponse": { + "description": "Response containing the ID of the created terminal.", + "type": "object", "properties": { - "anyOf": { - "description": "Titled enum options.", - "items": { - "$ref": "#/$defs/EnumOption" - }, - "type": "array" + "terminalId": { + "description": "The unique identifier for the created terminal.", + "allOf": [ + { + "$ref": "#/$defs/TerminalId" + } + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "anyOf" + "terminalId" ], - "type": "object" + "x-side": "client", + "x-method": "terminal/create" }, - "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)", + "TerminalOutputResponse": { + "description": "Response containing the terminal output and exit status.", + "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" - ] + "output": { + "description": "The terminal output captured so far.", + "type": "string" }, - "content": { - "description": "Content produced by the tool call.", - "items": { - "$ref": "#/$defs/ToolCallContent" - }, - "type": "array" + "truncated": { + "description": "Whether the output was truncated due to byte limits.", + "type": "boolean" }, - "kind": { - "allOf": [ + "exitStatus": { + "description": "Exit status if the command has completed.", + "anyOf": [ { - "$ref": "#/$defs/ToolKind" - } - ], - "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." - }, - "locations": { - "description": "File locations affected by this tool call.\nEnables \"follow-along\" features in clients.", - "items": { - "$ref": "#/$defs/ToolCallLocation" - }, - "type": "array" - }, - "rawInput": { - "description": "Raw input parameters sent to the tool." - }, - "rawOutput": { - "description": "Raw output returned by the tool." - }, - "status": { - "allOf": [ + "$ref": "#/$defs/TerminalExitStatus" + }, { - "$ref": "#/$defs/ToolCallStatus" + "type": "null" } - ], - "description": "Current execution status of the tool call." - }, - "title": { - "description": "Human-readable title describing what the tool is doing.", - "type": "string" + ] }, - "toolCallId": { - "allOf": [ - { - "$ref": "#/$defs/ToolCallId" - } + "_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)", + "type": [ + "object", + "null" ], - "description": "Unique identifier for this tool call within the session." + "additionalProperties": true } }, "required": [ - "toolCallId", - "title" + "output", + "truncated" ], - "type": "object" + "x-side": "client", + "x-method": "terminal/output" }, - "ToolCallContent": { - "description": "Content produced by a tool call.\n\nTool calls can produce different types of content including\nstandard content blocks (text, images) or file diffs.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)", - "discriminator": { - "propertyName": "type" - }, - "oneOf": [ - { - "allOf": [ - { - "$ref": "#/$defs/Content" - } - ], - "description": "Standard content block (text, images, resources).", - "properties": { - "type": { - "const": "content", - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" - }, - { - "allOf": [ - { - "$ref": "#/$defs/Diff" - } - ], - "description": "File modification shown as a diff.", - "properties": { - "type": { - "const": "diff", - "type": "string" - } - }, - "required": [ - "type" + "TerminalExitStatus": { + "description": "Exit status of a terminal command.", + "type": "object", + "properties": { + "exitCode": { + "description": "The process exit code (may be null if terminated by signal).", + "type": [ + "integer", + "null" ], - "type": "object" + "format": "uint32", + "minimum": 0 }, - { - "allOf": [ - { - "$ref": "#/$defs/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": { - "type": { - "const": "terminal", - "type": "string" - } - }, - "required": [ - "type" + "signal": { + "description": "The signal that terminated the process (may be null if exited normally).", + "type": [ + "string", + "null" + ] + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "type": "object" + "additionalProperties": true } - ] + } }, - "ToolCallId": { - "description": "Unique identifier for a tool call within a session.", - "type": "string" - }, - "ToolCallLocation": { - "description": "A file location being accessed or modified by a tool.\n\nEnables clients to implement \"follow-along\" features that track\nwhich files the agent is working with in real-time.\n\nSee protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)", + "ReleaseTerminalResponse": { + "description": "Response to terminal/release method", + "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" - ] - }, - "line": { - "description": "Optional line number within the file.", - "format": "uint32", - "minimum": 0, + ], + "additionalProperties": true + } + }, + "x-side": "client", + "x-method": "terminal/release" + }, + "WaitForTerminalExitResponse": { + "description": "Response containing the exit status of a terminal command.", + "type": "object", + "properties": { + "exitCode": { + "description": "The process exit code (may be null if terminated by signal).", "type": [ "integer", "null" + ], + "format": "uint32", + "minimum": 0 + }, + "signal": { + "description": "The signal that terminated the process (may be null if exited normally).", + "type": [ + "string", + "null" ] }, - "path": { - "description": "The file path being accessed or modified.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, - "required": [ - "path" - ], - "type": "object" + "x-side": "client", + "x-method": "terminal/wait_for_exit" }, - "ToolCallStatus": { - "description": "Execution status of a tool call.\n\nTool calls progress through different statuses during their lifecycle.\n\nSee protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls#status)", - "oneOf": [ - { - "const": "pending", - "description": "The tool call hasn't started running yet because the input is either\nstreaming or we're awaiting approval.", - "type": "string" - }, - { - "const": "in_progress", - "description": "The tool call is currently running.", - "type": "string" - }, - { - "const": "completed", - "description": "The tool call completed successfully.", - "type": "string" - }, - { - "const": "failed", - "description": "The tool call failed with an error.", - "type": "string" + "KillTerminalResponse": { + "description": "Response to `terminal/kill` method", + "type": "object", + "properties": { + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } - ] + }, + "x-side": "client", + "x-method": "terminal/kill" }, - "ToolCallUpdate": { - "description": "An update to an existing tool call.\n\nUsed to report progress and results as tools execute. All fields except\nthe tool call ID are optional - only changed fields need to be included.\n\nSee protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)", + "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.", + "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" - ] - }, - "content": { - "description": "Replace the content collection.", - "items": { - "$ref": "#/$defs/ToolCallContent" + ], + "additionalProperties": true + } + }, + "oneOf": [ + { + "description": "The user accepted and provided content.", + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "accept" + } }, - "type": [ - "array", - "null" - ] - }, - "kind": { - "anyOf": [ - { - "$ref": "#/$defs/ToolKind" - }, + "required": [ + "action" + ], + "allOf": [ { - "type": "null" + "$ref": "#/$defs/ElicitationAcceptAction" } - ], - "description": "Update the tool kind." - }, - "locations": { - "description": "Replace the locations collection.", - "items": { - "$ref": "#/$defs/ToolCallLocation" - }, - "type": [ - "array", - "null" ] }, - "rawInput": { - "description": "Update the raw input." - }, - "rawOutput": { - "description": "Update the raw output." - }, - "status": { - "anyOf": [ - { - "$ref": "#/$defs/ToolCallStatus" - }, - { - "type": "null" + { + "description": "The user declined the elicitation.", + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "decline" } - ], - "description": "Update the execution status." - }, - "title": { - "description": "Update the human-readable title.", - "type": [ - "string", - "null" + }, + "required": [ + "action" ] }, - "toolCallId": { - "allOf": [ - { - "$ref": "#/$defs/ToolCallId" + { + "description": "The elicitation was cancelled.", + "type": "object", + "properties": { + "action": { + "type": "string", + "const": "cancel" } - ], - "description": "The ID of the tool call being updated." + }, + "required": [ + "action" + ] } - }, - "required": [ - "toolCallId" ], - "type": "object" + "discriminator": { + "propertyName": "action" + }, + "x-side": "client", + "x-method": "elicitation/create" }, - "ToolKind": { - "description": "Categories of tools that can be invoked.\n\nTool kinds help clients choose appropriate icons and optimize how they\ndisplay tool execution progress.\n\nSee protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)", - "oneOf": [ - { - "const": "read", - "description": "Reading files or data.", - "type": "string" - }, - { - "const": "edit", - "description": "Modifying files or content.", - "type": "string" - }, - { - "const": "delete", - "description": "Removing files or data.", - "type": "string" - }, - { - "const": "move", - "description": "Moving or renaming files.", - "type": "string" - }, - { - "const": "search", - "description": "Searching for information.", - "type": "string" - }, + "ElicitationContentValue": { + "description": "Allowed wire representations for [`ElicitationContentValue`].", + "anyOf": [ { - "const": "execute", - "description": "Running commands or code.", + "title": "String", + "description": "String value accepted in elicitation response content.", "type": "string" }, { - "const": "think", - "description": "Internal reasoning or planning.", - "type": "string" + "title": "Integer", + "description": "Integer value accepted in elicitation response content.", + "type": "integer", + "format": "int64" }, { - "const": "fetch", - "description": "Retrieving external data.", - "type": "string" + "title": "Number", + "description": "Number value accepted in elicitation response content.", + "type": "number", + "format": "double" }, { - "const": "switch_mode", - "description": "Switching the current session mode.", - "type": "string" + "title": "Boolean", + "description": "Boolean value accepted in elicitation response content.", + "type": "boolean" }, { - "const": "other", - "description": "Other tool types (default).", - "type": "string" - } - ] - }, - "UnstructuredCommandInput": { - "description": "All text that was typed after the command name is provided as input.", - "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" - ] - }, - "hint": { - "description": "A hint to display when the input hasn't been provided yet", - "type": "string" - } - }, - "required": [ - "hint" - ], - "type": "object" - }, - "UntitledMultiSelectItems": { - "description": "Items definition for untitled multi-select enum properties.", - "properties": { - "enum": { - "description": "Allowed enum values.", + "title": "StringArray", + "description": "String array value accepted in elicitation response content.", + "type": "array", "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.", + "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.", + "type": "object", "properties": { - "cachedReadTokens": { - "description": "Total cache read tokens.", - "format": "uint64", - "minimum": 0, - "type": [ - "integer", - "null" - ] - }, - "cachedWriteTokens": { - "description": "Total cache write tokens.", - "format": "uint64", - "minimum": 0, + "content": { + "description": "The user-provided content, if any, as an object matching the requested schema.", "type": [ - "integer", + "object", "null" + ], + "additionalProperties": { + "$ref": "#/$defs/ElicitationContentValue" + } + } + } + }, + "ConnectMcpResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `mcp/connect`.", + "type": "object", + "properties": { + "connectionId": { + "description": "The unique identifier for this MCP-over-ACP connection.", + "allOf": [ + { + "$ref": "#/$defs/McpConnectionId" + } ] }, - "inputTokens": { - "description": "Total input tokens across all turns.", - "format": "uint64", - "minimum": 0, - "type": "integer" - }, - "outputTokens": { - "description": "Total output tokens across all turns.", - "format": "uint64", - "minimum": 0, - "type": "integer" - }, - "thoughtTokens": { - "description": "Total thought/reasoning tokens", - "format": "uint64", - "minimum": 0, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", "type": [ - "integer", + "object", "null" - ] - }, - "totalTokens": { - "description": "Sum of all token types across session.", - "format": "uint64", - "minimum": 0, - "type": "integer" + ], + "additionalProperties": true } }, "required": [ - "totalTokens", - "inputTokens", - "outputTokens" + "connectionId" ], - "type": "object" + "x-side": "client", + "x-method": "mcp/connect" }, - "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 a session.", + "DisconnectMcpResponse": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `mcp/disconnect`.", + "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" - ] + ], + "additionalProperties": true + } + }, + "x-side": "client", + "x-method": "mcp/disconnect" + }, + "ClientNotification": { + "description": "A JSON-RPC notification object.", + "type": "object", + "properties": { + "method": { + "description": "The notification method name.", + "type": "string" }, - "cost": { + "params": { + "description": "Method-specific notification parameters.", "anyOf": [ { - "$ref": "#/$defs/Cost" + "description": "All possible notifications that a client can send to an agent.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly.\n\nNotifications do not expect a response.", + "anyOf": [ + { + "title": "CancelNotification", + "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)", + "allOf": [ + { + "$ref": "#/$defs/CancelNotification" + } + ] + }, + { + "title": "DidOpenDocumentNotification", + "description": "**UNSTABLE**\n\nNotification sent when a file is opened in the editor.", + "allOf": [ + { + "$ref": "#/$defs/DidOpenDocumentNotification" + } + ] + }, + { + "title": "DidChangeDocumentNotification", + "description": "**UNSTABLE**\n\nNotification sent when a file is edited.", + "allOf": [ + { + "$ref": "#/$defs/DidChangeDocumentNotification" + } + ] + }, + { + "title": "DidCloseDocumentNotification", + "description": "**UNSTABLE**\n\nNotification sent when a file is closed.", + "allOf": [ + { + "$ref": "#/$defs/DidCloseDocumentNotification" + } + ] + }, + { + "title": "DidSaveDocumentNotification", + "description": "**UNSTABLE**\n\nNotification sent when a file is saved.", + "allOf": [ + { + "$ref": "#/$defs/DidSaveDocumentNotification" + } + ] + }, + { + "title": "DidFocusDocumentNotification", + "description": "**UNSTABLE**\n\nNotification sent when a file becomes the active editor tab.", + "allOf": [ + { + "$ref": "#/$defs/DidFocusDocumentNotification" + } + ] + }, + { + "title": "AcceptNesNotification", + "description": "**UNSTABLE**\n\nNotification sent when a suggestion is accepted.", + "allOf": [ + { + "$ref": "#/$defs/AcceptNesNotification" + } + ] + }, + { + "title": "RejectNesNotification", + "description": "**UNSTABLE**\n\nNotification sent when a suggestion is rejected.", + "allOf": [ + { + "$ref": "#/$defs/RejectNesNotification" + } + ] + }, + { + "title": "MessageMcpNotification", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSends an MCP-over-ACP notification.", + "allOf": [ + { + "$ref": "#/$defs/MessageMcpNotification" + } + ] + }, + { + "title": "ExtNotification", + "description": "Handles extension notifications from the client.\n\nExtension notifications provide a way to send one-way messages for custom functionality\nwhile maintaining protocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "allOf": [ + { + "$ref": "#/$defs/ExtNotification" + } + ] + } + ] }, { "type": "null" } - ], - "description": "Cumulative session cost (optional)." - }, - "size": { - "description": "Total context window size in tokens.", - "format": "uint64", - "minimum": 0, - "type": "integer" - }, - "used": { - "description": "Tokens currently in context.", - "format": "uint64", - "minimum": 0, - "type": "integer" + ] } }, "required": [ - "used", - "size" + "method" ], - "type": "object" + "x-docs-ignore": true }, - "WaitForTerminalExitRequest": { - "description": "Request to wait for a terminal command to exit.", + "CancelNotification": { + "description": "Notification to cancel ongoing operations for a session.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)", + "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" - ] - }, "sessionId": { + "description": "The ID of the session to cancel operations for.", "allOf": [ { "$ref": "#/$defs/SessionId" } - ], - "description": "The session ID for this request." + ] }, - "terminalId": { - "description": "The ID of the terminal to wait for.", - "type": "string" + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "sessionId", - "terminalId" + "sessionId" ], - "type": "object", - "x-method": "terminal/wait_for_exit", - "x-side": "client" + "x-side": "agent", + "x-method": "session/cancel" }, - "WaitForTerminalExitResponse": { - "description": "Response containing the exit status of a terminal command.", + "DidOpenDocumentNotification": { + "description": "Notification sent when a file is opened in the editor.", + "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" + "sessionId": { + "description": "The session ID for this notification.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } ] }, - "exitCode": { - "description": "The process exit code (may be null if terminated by signal).", - "format": "uint32", - "minimum": 0, - "type": [ - "integer", - "null" - ] + "uri": { + "description": "The URI of the opened document.", + "type": "string" }, - "signal": { - "description": "The signal that terminated the process (may be null if exited normally).", + "languageId": { + "description": "The language identifier of the document (e.g., \"rust\", \"python\").", + "type": "string" + }, + "version": { + "description": "The version number of the document.", + "type": "integer", + "format": "int64" + }, + "text": { + "description": "The full text content of the document.", + "type": "string" + }, + "_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)", "type": [ - "string", + "object", "null" - ] + ], + "additionalProperties": true } }, - "type": "object", - "x-method": "terminal/wait_for_exit", - "x-side": "client" + "required": [ + "sessionId", + "uri", + "languageId", + "version", + "text" + ], + "x-side": "agent", + "x-method": "document/didOpen" }, - "WorkspaceFolder": { - "description": "A workspace folder.", + "DidChangeDocumentNotification": { + "description": "Notification sent when a file is edited.", + "type": "object", "properties": { - "name": { - "description": "The display name of the folder.", - "type": "string" + "sessionId": { + "description": "The session ID for this notification.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, "uri": { - "description": "The URI of the folder.", + "description": "The URI of the changed document.", "type": "string" + }, + "version": { + "description": "The new version number of the document.", + "type": "integer", + "format": "int64" + }, + "contentChanges": { + "description": "The content changes.", + "type": "array", + "items": { + "$ref": "#/$defs/TextDocumentContentChangeEvent" + } + }, + "_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)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ + "sessionId", "uri", - "name" + "version", + "contentChanges" ], - "type": "object" + "x-side": "agent", + "x-method": "document/didChange" }, - "WriteTextFileRequest": { - "description": "Request to write content to a text file.\n\nOnly available if the client supports the `fs.writeTextFile` capability.", + "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.", + "type": "object", "properties": { + "range": { + "description": "The range of the document that changed. If `None`, the entire content is replaced.", + "anyOf": [ + { + "$ref": "#/$defs/Range" + }, + { + "type": "null" + } + ] + }, + "text": { + "description": "The new text for the range, or the full document content if `range` is `None`.", + "type": "string" + }, "_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": "The text content to write to the file.", - "type": "string" - }, - "path": { - "description": "Absolute path to the file to write.", - "type": "string" - }, + ], + "additionalProperties": true + } + }, + "required": [ + "text" + ] + }, + "DidCloseDocumentNotification": { + "description": "Notification sent when a file is closed.", + "type": "object", + "properties": { "sessionId": { + "description": "The session ID for this notification.", "allOf": [ { "$ref": "#/$defs/SessionId" } + ] + }, + "uri": { + "description": "The URI of the closed document.", + "type": "string" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "description": "The session ID for this request." + "additionalProperties": true } }, "required": [ "sessionId", - "path", - "content" + "uri" ], - "type": "object", - "x-method": "fs/write_text_file", - "x-side": "client" + "x-side": "agent", + "x-method": "document/didClose" }, - "WriteTextFileResponse": { - "description": "Response to `fs/write_text_file`", + "DidSaveDocumentNotification": { + "description": "Notification sent when a file is saved.", + "type": "object", "properties": { + "sessionId": { + "description": "The session ID for this notification.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "uri": { + "description": "The URI of the saved document.", + "type": "string" + }, "_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" - ] + ], + "additionalProperties": true } }, + "required": [ + "sessionId", + "uri" + ], + "x-side": "agent", + "x-method": "document/didSave" + }, + "DidFocusDocumentNotification": { + "description": "Notification sent when a file becomes the active editor tab.", "type": "object", - "x-method": "fs/write_text_file", - "x-side": "client" - } - }, - "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ - { - "anyOf": [ - { + "properties": { + "sessionId": { + "description": "The session ID for this notification.", "allOf": [ { - "$ref": "#/$defs/AgentRequest" + "$ref": "#/$defs/SessionId" } - ], - "title": "Request" + ] }, - { + "uri": { + "description": "The URI of the focused document.", + "type": "string" + }, + "version": { + "description": "The version number of the document.", + "type": "integer", + "format": "int64" + }, + "position": { + "description": "The current cursor position.", "allOf": [ { - "$ref": "#/$defs/AgentResponse" + "$ref": "#/$defs/Position" } - ], - "title": "Response" + ] }, - { + "visibleRange": { + "description": "The portion of the file currently visible in the editor viewport.", "allOf": [ { - "$ref": "#/$defs/AgentNotification" + "$ref": "#/$defs/Range" } + ] + }, + "_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)", + "type": [ + "object", + "null" ], - "title": "Notification" + "additionalProperties": true } + }, + "required": [ + "sessionId", + "uri", + "version", + "position", + "visibleRange" ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", + "x-side": "agent", + "x-method": "document/didFocus" + }, + "AcceptNesNotification": { + "description": "Notification sent when a suggestion is accepted.", + "type": "object", "properties": { - "jsonrpc": { - "enum": [ - "2.0" - ], + "sessionId": { + "description": "The session ID for this notification.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "id": { + "description": "The ID of the accepted suggestion.", "type": "string" + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" + ], + "additionalProperties": true } }, "required": [ - "jsonrpc" + "sessionId", + "id" ], - "title": "Agent", - "type": "object" + "x-side": "agent", + "x-method": "nes/accept" }, - { - "anyOf": [ - { + "RejectNesNotification": { + "description": "Notification sent when a suggestion is rejected.", + "type": "object", + "properties": { + "sessionId": { + "description": "The session ID for this notification.", "allOf": [ { - "$ref": "#/$defs/ClientRequest" + "$ref": "#/$defs/SessionId" } - ], - "title": "Request" + ] }, - { - "allOf": [ - { - "$ref": "#/$defs/ClientResponse" - } - ], - "title": "Response" + "id": { + "description": "The ID of the rejected suggestion.", + "type": "string" }, - { - "allOf": [ + "reason": { + "description": "The reason for rejection.", + "anyOf": [ { - "$ref": "#/$defs/ClientNotification" + "$ref": "#/$defs/NesRejectReason" + }, + { + "type": "null" } ], - "title": "Notification" - } - ], - "description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility", - "properties": { - "jsonrpc": { - "enum": [ - "2.0" + "x-deserialize-default-on-error": true + }, + "_meta": { + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": [ + "object", + "null" ], - "type": "string" + "additionalProperties": true } }, "required": [ - "jsonrpc" + "sessionId", + "id" ], - "title": "Client", - "type": "object" + "x-side": "agent", + "x-method": "nes/reject" }, - { - "anyOf": [ + "NesRejectReason": { + "description": "The reason a suggestion was rejected.", + "oneOf": [ + { + "description": "The user explicitly dismissed the suggestion.", + "type": "string", + "const": "rejected" + }, + { + "description": "The suggestion was shown but the user continued editing without interacting.", + "type": "string", + "const": "ignored" + }, { + "description": "The suggestion was superseded by a newer suggestion.", + "type": "string", + "const": "replaced" + }, + { + "description": "The request was cancelled before the agent returned a response.", + "type": "string", + "const": "cancelled" + } + ] + }, + "CancelRequestNotification": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification to cancel an ongoing request.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)", + "type": "object", + "properties": { + "requestId": { + "description": "The ID of the request to cancel.", "allOf": [ { - "$ref": "#/$defs/CancelRequestNotification" + "$ref": "#/$defs/RequestId" } + ] + }, + "_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)", + "type": [ + "object", + "null" ], - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or\nchanged at any point.\n\nCancels an ongoing request.\n\nThis is a notification sent by the side that sent a request to cancel that request.\n\nUpon receiving this notification, the receiver:\n\n1. MUST cancel the corresponding request activity and all nested activities\n2. MAY send any pending notifications.\n3. MUST send one of these responses for the original request:\n - Valid response with appropriate data (partial results or cancellation marker)\n - Error response with code `-32800` (Cancelled)\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)", - "title": "CancelRequestNotification" + "additionalProperties": true } + }, + "required": [ + "requestId" ], - "description": "General protocol-level notifications that all sides are expected to\nimplement.\n\nNotifications whose methods start with '$/' are messages which\nare protocol implementation dependent and might not be implementable in all\nclients or agents. For example if the implementation uses a single threaded\nsynchronous programming language then there is little it can do to react to\na `$/cancel_request` notification. If an agent or client receives\nnotifications starting with '$/' it is free to ignore the notification.\n\nNotifications do not expect a response.", - "title": "ProtocolLevel" + "x-side": "protocol", + "x-method": "$/cancel_request" } - ], - "title": "Agent Client Protocol" + } } diff --git a/scripts/gen_all.py b/scripts/gen_all.py index 43c32a6..de1cb52 100644 --- a/scripts/gen_all.py +++ b/scripts/gen_all.py @@ -5,6 +5,7 @@ import json import os import re +import subprocess import sys import urllib.error import urllib.request @@ -22,6 +23,8 @@ VERSION_FILE = SCHEMA_DIR / "VERSION" DEFAULT_REPO = "agentclientprotocol/agent-client-protocol" +LEGACY_SCHEMA_PATHS = ("schema/schema.unstable.json", "schema/meta.unstable.json") +V1_SCHEMA_PATHS = ("schema/v1/schema.unstable.json", "schema/v1/meta.unstable.json") def parse_args() -> argparse.Namespace: @@ -45,6 +48,12 @@ def parse_args() -> argparse.Namespace: help="Skip downloading schema files even when a version is provided.", ) parser.set_defaults(format_output=True) + parser.add_argument( + "--no-format", + dest="format_output", + action="store_false", + help="Skip formatting generated Python files after regeneration.", + ) parser.add_argument( "--force", action="store_true", @@ -73,6 +82,8 @@ def main() -> None: gen_schema.generate_schema() gen_meta.generate_meta() gen_signature.gen_signature(ROOT / "src" / "acp") + if args.format_output: + format_generated_files() if ref: print(f"Generated schema using ref: {ref}") @@ -80,6 +91,18 @@ def main() -> None: print("Generated schema using local schema files") +def format_generated_files() -> None: + files = [ + ROOT / "src" / "acp" / "schema.py", + ROOT / "src" / "acp" / "meta.py", + ROOT / "src" / "acp" / "interfaces.py", + ROOT / "src" / "acp" / "agent" / "connection.py", + ROOT / "src" / "acp" / "client" / "connection.py", + ] + subprocess.check_call([sys.executable, "-m", "ruff", "check", "--fix", *(str(path) for path in files)]) # noqa: S603 + subprocess.check_call([sys.executable, "-m", "ruff", "format", *(str(path) for path in files)]) # noqa: S603 + + def _should_download(args: argparse.Namespace, version: str | None) -> bool: env_override = os.environ.get("ACP_SCHEMA_DOWNLOAD") if env_override is not None: @@ -101,6 +124,8 @@ def resolve_ref(version: str | None) -> str: return "refs/heads/main" if version.startswith("refs/"): return version + if re.fullmatch(r"schema-v\d+\.\d+\.\d+", version): + return f"refs/tags/{version}" if re.fullmatch(r"v?\d+\.\d+\.\d+", version): value = version if version.startswith("v") else f"v{version}" return f"refs/tags/{value}" @@ -109,11 +134,8 @@ def resolve_ref(version: str | None) -> str: def download_schema(repo: str, ref: str) -> None: SCHEMA_DIR.mkdir(parents=True, exist_ok=True) - schema_url = f"https://raw.githubusercontent.com/{repo}/{ref}/schema/schema.unstable.json" - meta_url = f"https://raw.githubusercontent.com/{repo}/{ref}/schema/meta.unstable.json" try: - schema_data = fetch_json(schema_url) - meta_data = fetch_json(meta_url) + schema_data, meta_data = fetch_schema_pair(repo, ref) except RuntimeError as exc: # pragma: no cover - network error path print(exc, file=sys.stderr) sys.exit(1) @@ -124,6 +146,26 @@ def download_schema(repo: str, ref: str) -> None: print(f"Fetched schema and meta from {repo}@{ref}") +def fetch_schema_pair(repo: str, ref: str) -> tuple[dict, dict]: + errors = [] + for schema_path, meta_path in schema_source_paths(ref): + schema_url = f"https://raw.githubusercontent.com/{repo}/{ref}/{schema_path}" + meta_url = f"https://raw.githubusercontent.com/{repo}/{ref}/{meta_path}" + try: + return fetch_json(schema_url), fetch_json(meta_url) + except RuntimeError as exc: + errors.append(str(exc)) + + attempted = "\n".join(f"- {error}" for error in errors) + raise RuntimeError(f"Failed to fetch schema and meta from {repo}@{ref}. Attempts:\n{attempted}") + + +def schema_source_paths(ref: str) -> tuple[tuple[str, str], ...]: + if re.fullmatch(r"refs/tags/schema-v\d+\.\d+\.\d+", ref): + return (V1_SCHEMA_PATHS, LEGACY_SCHEMA_PATHS) + return (LEGACY_SCHEMA_PATHS, V1_SCHEMA_PATHS) + + def fetch_json(url: str) -> dict: try: with urllib.request.urlopen(url) as response: # noqa: S310 - trusted source configured by repo diff --git a/scripts/gen_schema.py b/scripts/gen_schema.py index 9a78b26..571ad34 100644 --- a/scripts/gen_schema.py +++ b/scripts/gen_schema.py @@ -2,14 +2,17 @@ from __future__ import annotations import ast +import copy import json import re import subprocess import sys +import tempfile import textwrap from collections.abc import Callable from dataclasses import dataclass from pathlib import Path +from typing import Any ROOT = Path(__file__).resolve().parents[1] SCHEMA_DIR = ROOT / "schema" @@ -33,6 +36,7 @@ "AgentClientProtocol4", "AgentClientProtocol5", "AgentClientProtocol6", + "AgentClientProtocol7", ] # Map of numbered classes produced by datamodel-code-generator to descriptive names. @@ -49,6 +53,7 @@ "ContentBlock5": "EmbeddedResourceContentBlock", "McpServer1": "HttpMcpServer", "McpServer2": "SseMcpServer", + "McpServer3": "AcpMcpServer", "RequestPermissionOutcome1": "DeniedOutcome", "RequestPermissionOutcome2": "AllowedOutcome", "AuthMethod1": "EnvVarAuthMethod", @@ -63,16 +68,23 @@ "SessionUpdate4": "ToolCallStart", "SessionUpdate5": "ToolCallProgress", "SessionUpdate6": "AgentPlanUpdate", - "SessionUpdate7": "AvailableCommandsUpdate", - "SessionUpdate8": "CurrentModeUpdate", - "SessionUpdate9": "ConfigOptionUpdate", - "SessionUpdate10": "SessionInfoUpdate", - "SessionUpdate11": "UsageUpdate", + "SessionUpdate7": "AgentPlanContentUpdate", + "SessionUpdate8": "AgentPlanRemovedUpdate", + "SessionUpdate9": "AvailableCommandsUpdate", + "SessionUpdate10": "CurrentModeUpdate", + "SessionUpdate11": "ConfigOptionUpdate", + "SessionUpdate12": "SessionInfoUpdate", + "SessionUpdate13": "UsageUpdate", + "PlanUpdateContent1": "PlanUpdateItems", + "PlanUpdateContent2": "PlanUpdateFile", + "PlanUpdateContent3": "PlanUpdateMarkdown", "ToolCallContent1": "ContentToolCallContent", "ToolCallContent2": "FileEditToolCallContent", "ToolCallContent3": "TerminalToolCallContent", - "CreateElicitationRequest1": "CreateFormElicitationRequest", - "CreateElicitationRequest2": "CreateUrlElicitationRequest", + "CreateElicitationRequest1": "CreateFormSessionElicitationRequest", + "CreateElicitationRequest2": "CreateFormRequestElicitationRequest", + "CreateElicitationRequest3": "CreateUrlSessionElicitationRequest", + "CreateElicitationRequest4": "CreateUrlRequestElicitationRequest", "CreateElicitationResponse1": "AcceptElicitationResponse", "CreateElicitationResponse2": "DeclineElicitationResponse", "CreateElicitationResponse3": "CancelElicitationResponse", @@ -208,31 +220,197 @@ def generate_schema() -> None: ) sys.exit(1) - cmd = [ - sys.executable, - "-m", - "datamodel_code_generator", - "--input", - str(SCHEMA_JSON), - "--input-file-type", - "jsonschema", - "--output", - str(SCHEMA_OUT), - "--target-python-version", - "3.12", - "--collapse-root-models", - "--output-model-type", - "pydantic_v2.BaseModel", - "--use-annotated", - "--snake-case-field", - ] + with tempfile.TemporaryDirectory() as tmp_dir: + codegen_input = Path(tmp_dir) / "schema.codegen.json" + codegen_input.write_text(json.dumps(_preprocess_schema_for_codegen(_load_schema()), indent=2), encoding="utf-8") + + cmd = [ + sys.executable, + "-m", + "datamodel_code_generator", + "--input", + str(codegen_input), + "--input-file-type", + "jsonschema", + "--output", + str(SCHEMA_OUT), + "--target-python-version", + "3.12", + "--collapse-root-models", + "--output-model-type", + "pydantic_v2.BaseModel", + "--use-annotated", + "--snake-case-field", + ] - subprocess.check_call(cmd) # noqa: S603 + subprocess.check_call(cmd) # noqa: S603 warnings = postprocess_generated_schema(SCHEMA_OUT) for warning in warnings: print(f"Warning: {warning}", file=sys.stderr) +def _load_schema() -> dict[str, Any]: + return json.loads(SCHEMA_JSON.read_text(encoding="utf-8")) + + +COMBINATOR_KEYS = ("oneOf", "anyOf") + + +def _preprocess_schema_for_codegen(schema: dict[str, Any]) -> dict[str, Any]: + defs = schema.get("$defs", {}) + return _distribute_composed_object_schemas(schema, defs) + + +def _distribute_composed_object_schemas(node: Any, defs: dict[str, Any]) -> Any: + if isinstance(node, list): + return [_distribute_composed_object_schemas(item, defs) for item in node] + if not isinstance(node, dict): + return node + + transformed = {key: _distribute_composed_object_schemas(value, defs) for key, value in node.items()} + for combinator in COMBINATOR_KEYS: + if combinator not in transformed or "properties" not in transformed: + continue + result = {combinator: _expand_composed_object_variants(transformed, defs)} + for key in ("title", "description", "discriminator"): + if key in transformed: + result[key] = transformed[key] + return result + return transformed + + +def _expand_composed_object_variants(node: dict[str, Any], defs: dict[str, Any]) -> list[Any]: + for combinator in COMBINATOR_KEYS: + if combinator not in node or "properties" not in node: + continue + + common_schema = _without_combinators(node) + expanded: list[Any] = [] + for option in node[combinator]: + for variant in _expand_allof_union_refs(option, defs): + expanded.append(_merge_object_schema(common_schema, variant) if isinstance(variant, dict) else variant) + return expanded + + return _expand_allof_union_refs(node, defs) + + +def _expand_allof_union_refs(node: Any, defs: dict[str, Any]) -> list[Any]: + if not isinstance(node, dict): + return [node] + + variants = [{key: copy.deepcopy(value) for key, value in node.items() if key != "allOf"}] + for item in node.get("allOf", []): + ref_name = _local_def_ref_name(item.get("$ref")) if isinstance(item, dict) else None + ref_schema = defs.get(ref_name) if ref_name else None + if isinstance(ref_schema, dict) and any(key in ref_schema for key in COMBINATOR_KEYS): + ref_variants = _expand_composed_object_variants(ref_schema, defs) + else: + ref_variants = [item] + + variants = [ + _merge_object_schema(variant, ref_variant) if isinstance(ref_variant, dict) else variant + for variant in variants + for ref_variant in ref_variants + ] + return variants + + +def _without_combinators(node: dict[str, Any]) -> dict[str, Any]: + return { + key: copy.deepcopy(value) + for key, value in node.items() + if key not in COMBINATOR_KEYS and key != "discriminator" + } + + +def _local_def_ref_name(ref: Any) -> str | None: + if isinstance(ref, str) and ref.startswith("#/$defs/"): + return ref.rsplit("/", 1)[-1] + return None + + +def _pop_ref_as_allof(schema: dict[str, Any]) -> tuple[dict[str, Any], list[dict[str, Any]]]: + schema = copy.deepcopy(schema) + if "$ref" not in schema: + return schema, [] + return schema, [{"$ref": schema.pop("$ref")}] + + +def _merge_object_schema(left: dict[str, Any], right: dict[str, Any]) -> dict[str, Any]: + left, left_refs = _pop_ref_as_allof(left) + right, right_refs = _pop_ref_as_allof(right) + merged: dict[str, Any] = {} + + for key in set(left) | set(right): + if key in COMBINATOR_KEYS or key in {"allOf", "discriminator"}: + continue + if key == "properties": + merged[key] = {**left.get(key, {}), **right.get(key, {})} + elif key == "required": + required = [] + for item in left.get(key, []) + right.get(key, []): + if item not in required: + required.append(item) + if required: + merged[key] = required + elif key in right: + merged[key] = right[key] + else: + merged[key] = left[key] + + all_of = left_refs + left.get("allOf", []) + right_refs + right.get("allOf", []) + if all_of: + merged["allOf"] = all_of + return merged + + +def _required_nullable_fields(schema: dict[str, Any]) -> dict[str, list[str]]: + defs = schema.get("$defs", {}) + fields: dict[str, list[str]] = {} + for class_name, definition in defs.items(): + if not isinstance(definition, dict): + continue + + required = set(definition.get("required", [])) + if not required: + continue + + properties = definition.get("properties", {}) + nullable_fields = [ + _schema_field_name(property_name) + for property_name in sorted(required) + if _schema_allows_null(properties.get(property_name), defs) + ] + if nullable_fields: + fields[class_name] = nullable_fields + return fields + + +def _schema_allows_null(node: Any, defs: dict[str, Any]) -> bool: + if not isinstance(node, dict): + return False + + schema_type = node.get("type") + if schema_type == "null" or (isinstance(schema_type, list) and "null" in schema_type): + return True + + for combinator in COMBINATOR_KEYS: + if any(_schema_allows_null(option, defs) for option in node.get(combinator, [])): + return True + + ref_name = _local_def_ref_name(node.get("$ref")) + if ref_name is not None: + return _schema_allows_null(defs.get(ref_name), defs) + + return any(_schema_allows_null(option, defs) for option in node.get("allOf", [])) + + +def _schema_field_name(name: str) -> str: + if name.startswith("_"): + return "field" + name + return re.sub(r"(? list[str]: if not output_path.exists(): raise RuntimeError(f"Generated schema not found at {output_path}") @@ -247,9 +425,11 @@ def postprocess_generated_schema(output_path: Path) -> list[str]: processing_steps: tuple[_ProcessingStep, ...] = ( _ProcessingStep("apply field overrides", _apply_field_overrides), _ProcessingStep("apply default overrides", _apply_default_overrides), + _ProcessingStep("restore required nullable fields", _restore_required_nullable_fields), _ProcessingStep("attach description comments", _add_description_comments), _ProcessingStep("ensure custom BaseModel", _ensure_custom_base_model), _ProcessingStep("inject field validators", _inject_field_validators), + _ProcessingStep("inject schema aliases", _inject_schema_aliases), ) for step in processing_steps: @@ -447,6 +627,64 @@ def _append_validator( return content +def _inject_schema_aliases(content: str) -> str: + if "CreateElicitationRequest = Union[" in content: + return content + + aliases = textwrap.dedent("""\ + ElicitationMode = Union[ + ElicitationFormSessionMode, + ElicitationFormRequestMode, + ElicitationUrlSessionMode, + ElicitationUrlRequestMode, + ] + CreateFormElicitationRequest = Union[ + CreateFormSessionElicitationRequest, + CreateFormRequestElicitationRequest, + ] + CreateUrlElicitationRequest = Union[ + CreateUrlSessionElicitationRequest, + CreateUrlRequestElicitationRequest, + ] + CreateElicitationRequest = Union[ + CreateFormElicitationRequest, + CreateUrlElicitationRequest, + ] + CreateElicitationResponse = Union[ + AcceptElicitationResponse, + DeclineElicitationResponse, + CancelElicitationResponse, + ] + """) + pattern = re.compile( + r"^(class CreateFormRequestElicitationRequest\([\s\S]*?\):[\s\S]*?)(?=^class \w+\(|\Z)", + re.MULTILINE, + ) + content, count = pattern.subn(lambda match: match.group(1).rstrip() + "\n\n" + aliases + "\n", content, count=1) + if count == 0: + print("Warning: failed to insert schema aliases", file=sys.stderr) + return content + + +def _restore_required_nullable_fields(content: str, schema: dict[str, Any] | None = None) -> str: + schema = _load_schema() if schema is None else schema + for class_name, field_names in _required_nullable_fields(schema).items(): + class_pattern = re.compile( + rf"(class {re.escape(class_name)}\([^)]*\):)(.*?)(?=\nclass |\Z)", + re.DOTALL, + ) + + def restore_block(match: re.Match[str], _field_names: list[str] = field_names) -> str: + header, block = match.group(1), match.group(2) + for field_name in _field_names: + field_pattern = re.compile(rf"(\n\s+{re.escape(field_name)}:\s+Annotated\[[\s\S]*?\n\s+\]\s*)=\s*None") + block = field_pattern.sub(r"\1", block, count=1) + return header + block + + content = class_pattern.sub(restore_block, content, count=1) + return content + + def _apply_field_overrides(content: str) -> str: for class_name, field_name, new_type, optional in FIELD_TYPE_OVERRIDES: if optional: diff --git a/scripts/gen_signature.py b/scripts/gen_signature.py index b435e2c..412071b 100644 --- a/scripts/gen_signature.py +++ b/scripts/gen_signature.py @@ -1,5 +1,7 @@ import ast +import importlib.util import inspect +import sys import typing as t from pathlib import Path @@ -7,7 +9,21 @@ from pydantic.fields import FieldInfo from pydantic_core import PydanticUndefined -from acp import schema +ROOT = Path(__file__).resolve().parents[1] +SCHEMA_MODULE_PATH = ROOT / "src" / "acp" / "schema.py" + + +def _load_schema_module() -> t.Any: + spec = importlib.util.spec_from_file_location("acp_schema_for_signature", SCHEMA_MODULE_PATH) + if spec is None or spec.loader is None: + raise RuntimeError(f"Unable to load schema module from {SCHEMA_MODULE_PATH}") + module = importlib.util.module_from_spec(spec) + sys.modules[spec.name] = module + spec.loader.exec_module(module) + return module + + +schema = _load_schema_module() SIGNATURE_OPTIONAL_FIELDS: set[tuple[str, str]] = { ("LoadSessionRequest", "mcp_servers"), @@ -116,7 +132,9 @@ def _format_annotation(self, annotation: t.Any) -> ast.expr: self._add_schema_import(name) return ast.Name(id=name) elif ( - inspect.isclass(annotation) and issubclass(annotation, BaseModel) and annotation.__module__ == "acp.schema" + inspect.isclass(annotation) + and issubclass(annotation, BaseModel) + and annotation.__module__ == schema.__name__ ): self._add_schema_import(annotation.__name__) return ast.Name(id=annotation.__name__) @@ -144,9 +162,8 @@ def _format_annotation(self, annotation: t.Any) -> ast.expr: def gen_signature(source_dir: Path) -> None: - import importlib - - importlib.reload(schema) # Ensure schema is up to date + global schema + schema = _load_schema_module() for source_file in source_dir.rglob("*.py"): transformer = NodeTransformer() transformer.transform(source_file) diff --git a/src/acp/__init__.py b/src/acp/__init__.py index c49b187..d343529 100644 --- a/src/acp/__init__.py +++ b/src/acp/__init__.py @@ -38,11 +38,37 @@ PROTOCOL_VERSION, ) from .schema import ( + AcceptElicitationResponse, AuthenticateRequest, AuthenticateResponse, + CancelElicitationResponse, CancelNotification, + CompleteElicitationNotification, + CreateElicitationRequest, + CreateElicitationResponse, + CreateFormElicitationRequest, + CreateFormRequestElicitationRequest, + CreateFormSessionElicitationRequest, CreateTerminalRequest, CreateTerminalResponse, + CreateUrlElicitationRequest, + CreateUrlRequestElicitationRequest, + CreateUrlSessionElicitationRequest, + DeclineElicitationResponse, + ElicitationBooleanPropertySchema, + ElicitationCapabilities, + ElicitationFormCapabilities, + ElicitationFormRequestMode, + ElicitationFormSessionMode, + ElicitationIntegerPropertySchema, + ElicitationMode, + ElicitationMultiSelectPropertySchema, + ElicitationNumberPropertySchema, + ElicitationSchema, + ElicitationStringPropertySchema, + ElicitationUrlCapabilities, + ElicitationUrlRequestMode, + ElicitationUrlSessionMode, InitializeRequest, InitializeResponse, KillTerminalRequest, @@ -62,8 +88,6 @@ SessionNotification, SetSessionConfigOptionResponse, SetSessionConfigOptionSelectRequest, - SetSessionModelRequest, - SetSessionModelResponse, SetSessionModeRequest, SetSessionModeResponse, TerminalOutputRequest, @@ -115,10 +139,35 @@ "SessionNotification", "SetSessionModeRequest", "SetSessionModeResponse", - "SetSessionModelRequest", - "SetSessionModelResponse", "SetSessionConfigOptionSelectRequest", "SetSessionConfigOptionResponse", + # elicitation types + "ElicitationMode", + "ElicitationSchema", + "ElicitationCapabilities", + "ElicitationFormCapabilities", + "ElicitationUrlCapabilities", + "ElicitationFormSessionMode", + "ElicitationFormRequestMode", + "ElicitationUrlSessionMode", + "ElicitationUrlRequestMode", + "ElicitationStringPropertySchema", + "ElicitationNumberPropertySchema", + "ElicitationIntegerPropertySchema", + "ElicitationBooleanPropertySchema", + "ElicitationMultiSelectPropertySchema", + "CreateElicitationRequest", + "CreateElicitationResponse", + "CreateFormElicitationRequest", + "CreateFormSessionElicitationRequest", + "CreateFormRequestElicitationRequest", + "CreateUrlElicitationRequest", + "CreateUrlSessionElicitationRequest", + "CreateUrlRequestElicitationRequest", + "AcceptElicitationResponse", + "DeclineElicitationResponse", + "CancelElicitationResponse", + "CompleteElicitationNotification", # terminal types "CreateTerminalRequest", "CreateTerminalResponse", diff --git a/src/acp/agent/connection.py b/src/acp/agent/connection.py index 64c96d9..bd8c176 100644 --- a/src/acp/agent/connection.py +++ b/src/acp/agent/connection.py @@ -4,18 +4,38 @@ from collections.abc import Callable from typing import Any, cast, final +from pydantic import TypeAdapter + from ..connection import Connection from ..interfaces import Agent, Client from ..meta import CLIENT_METHODS from ..schema import ( + AcceptElicitationResponse, AgentMessageChunk, + AgentPlanContentUpdate, + AgentPlanRemovedUpdate, AgentPlanUpdate, AgentThoughtChunk, AvailableCommandsUpdate, + CancelElicitationResponse, + CompleteElicitationNotification, ConfigOptionUpdate, + CreateElicitationResponse, + CreateFormElicitationRequest, + CreateFormRequestElicitationRequest, + CreateFormSessionElicitationRequest, CreateTerminalRequest, CreateTerminalResponse, + CreateUrlElicitationRequest, + CreateUrlRequestElicitationRequest, + CreateUrlSessionElicitationRequest, CurrentModeUpdate, + DeclineElicitationResponse, + ElicitationFormRequestMode, + ElicitationFormSessionMode, + ElicitationMode, + ElicitationUrlRequestMode, + ElicitationUrlSessionMode, EnvVariable, KillTerminalRequest, KillTerminalResponse, @@ -40,11 +60,12 @@ WriteTextFileRequest, WriteTextFileResponse, ) -from ..utils import compatible_class, notify_model, param_model, request_model, request_optional_model +from ..utils import compatible_class, notify_model, param_model, request_model, request_optional_model, serialize_params from .router import build_agent_router __all__ = ["AgentSideConnection"] _AGENT_CONNECTION_ERROR = "AgentSideConnection requires asyncio StreamWriter/StreamReader" +_CREATE_ELICITATION_RESPONSE_ADAPTER = TypeAdapter(CreateElicitationResponse) @final @@ -86,6 +107,8 @@ async def session_update( | ToolCallStart | ToolCallProgress | AgentPlanUpdate + | AgentPlanContentUpdate + | AgentPlanRemovedUpdate | AvailableCommandsUpdate | CurrentModeUpdate | ConfigOptionUpdate @@ -101,7 +124,7 @@ async def session_update( @param_model(RequestPermissionRequest) async def request_permission( - self, options: list[PermissionOption], session_id: str, tool_call: ToolCallUpdate, **kwargs: Any + self, session_id: str, tool_call: ToolCallUpdate, options: list[PermissionOption], **kwargs: Any ) -> RequestPermissionResponse: return await request_model( self._conn, @@ -114,7 +137,7 @@ async def request_permission( @param_model(ReadTextFileRequest) async def read_text_file( - self, path: str, session_id: str, limit: int | None = None, line: int | None = None, **kwargs: Any + self, session_id: str, path: str, line: int | None = None, limit: int | None = None, **kwargs: Any ) -> ReadTextFileResponse: return await request_model( self._conn, @@ -125,7 +148,7 @@ async def read_text_file( @param_model(WriteTextFileRequest) async def write_text_file( - self, content: str, path: str, session_id: str, **kwargs: Any + self, session_id: str, path: str, content: str, **kwargs: Any ) -> WriteTextFileResponse | None: return await request_optional_model( self._conn, @@ -137,11 +160,11 @@ async def write_text_file( @param_model(CreateTerminalRequest) async def create_terminal( self, - command: str, session_id: str, + command: str, args: list[str] | None = None, - cwd: str | None = None, env: list[EnvVariable] | None = None, + cwd: str | None = None, output_byte_limit: int | None = None, **kwargs: Any, ) -> CreateTerminalResponse: @@ -200,6 +223,21 @@ async def kill_terminal(self, session_id: str, terminal_id: str, **kwargs: Any) KillTerminalResponse, ) + async def create_elicitation( + self, message: str, mode: ElicitationMode, **kwargs: Any + ) -> AcceptElicitationResponse | DeclineElicitationResponse | CancelElicitationResponse: + request = _create_elicitation_request(message, mode, kwargs or None) + response = await self._conn.send_request(CLIENT_METHODS["elicitation_create"], serialize_params(request)) + return _CREATE_ELICITATION_RESPONSE_ADAPTER.validate_python(response) + + @param_model(CompleteElicitationNotification) + async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None: + await notify_model( + self._conn, + CLIENT_METHODS["elicitation_complete"], + CompleteElicitationNotification(elicitation_id=elicitation_id, field_meta=kwargs or None), + ) + async def ext_method(self, method: str, params: dict[str, Any]) -> dict[str, Any]: return await self._conn.send_request(f"_{method}", params) @@ -217,3 +255,18 @@ async def __aexit__(self, exc_type, exc, tb) -> None: def on_connect(self, conn: Agent) -> None: pass + + +def _create_elicitation_request( + message: str, mode: ElicitationMode, field_meta: dict[str, Any] | None +) -> CreateFormElicitationRequest | CreateUrlElicitationRequest: + mode_fields = mode.model_dump(mode="json", exclude_none=True) + if isinstance(mode, ElicitationFormSessionMode): + return CreateFormSessionElicitationRequest(message=message, mode="form", field_meta=field_meta, **mode_fields) + if isinstance(mode, ElicitationFormRequestMode): + return CreateFormRequestElicitationRequest(message=message, mode="form", field_meta=field_meta, **mode_fields) + if isinstance(mode, ElicitationUrlSessionMode): + return CreateUrlSessionElicitationRequest(message=message, mode="url", field_meta=field_meta, **mode_fields) + if isinstance(mode, ElicitationUrlRequestMode): + return CreateUrlRequestElicitationRequest(message=message, mode="url", field_meta=field_meta, **mode_fields) + raise TypeError(f"Unsupported elicitation mode: {type(mode).__name__}") diff --git a/src/acp/agent/router.py b/src/acp/agent/router.py index 2a27bcd..7dd58a5 100644 --- a/src/acp/agent/router.py +++ b/src/acp/agent/router.py @@ -21,7 +21,6 @@ ResumeSessionRequest, SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionSelectRequest, - SetSessionModelRequest, SetSessionModeRequest, ) from ..utils import model_to_kwargs, normalize_result @@ -83,14 +82,6 @@ def build_agent_router(agent: Agent, use_unstable_protocol: bool = False) -> Mes adapt_result=normalize_result, ) router.route_request(AGENT_METHODS["session_prompt"], PromptRequest, agent, "prompt") - router.route_request( - AGENT_METHODS["session_set_model"], - SetSessionModelRequest, - agent, - "set_session_model", - adapt_result=normalize_result, - unstable=True, - ) router.add_route( Route( method=AGENT_METHODS["session_set_config_option"], diff --git a/src/acp/client/connection.py b/src/acp/client/connection.py index 024884a..0f3b1cf 100644 --- a/src/acp/client/connection.py +++ b/src/acp/client/connection.py @@ -8,6 +8,7 @@ from ..interfaces import Agent, Client from ..meta import AGENT_METHODS from ..schema import ( + AcpMcpServer, AudioContentBlock, AuthenticateRequest, AuthenticateResponse, @@ -38,8 +39,6 @@ SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionResponse, SetSessionConfigOptionSelectRequest, - SetSessionModelRequest, - SetSessionModelResponse, SetSessionModeRequest, SetSessionModeResponse, SseMcpServer, @@ -101,7 +100,7 @@ async def new_session( self, cwd: str, additional_directories: list[str] | None = None, - mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | AcpMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> NewSessionResponse: resolved_mcp_servers = mcp_servers or [] @@ -122,8 +121,8 @@ async def load_session( self, cwd: str, session_id: str, + mcp_servers: list[HttpMcpServer | SseMcpServer | AcpMcpServer | McpServerStdio] | None = None, additional_directories: list[str] | None = None, - mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> LoadSessionResponse: resolved_mcp_servers = mcp_servers or [] @@ -142,23 +141,17 @@ async def load_session( @param_model(ListSessionsRequest) async def list_sessions( - self, - additional_directories: list[str] | None = None, - cursor: str | None = None, - cwd: str | None = None, - **kwargs: Any, + self, cwd: str | None = None, cursor: str | None = None, **kwargs: Any ) -> ListSessionsResponse: return await request_model_from_dict( self._conn, AGENT_METHODS["session_list"], - ListSessionsRequest( - additional_directories=additional_directories, cursor=cursor, cwd=cwd, field_meta=kwargs or None - ), + ListSessionsRequest(cursor=cursor, cwd=cwd, field_meta=kwargs or None), ListSessionsResponse, ) @param_model(SetSessionModeRequest) - async def set_session_mode(self, mode_id: str, session_id: str, **kwargs: Any) -> SetSessionModeResponse: + async def set_session_mode(self, session_id: str, mode_id: str, **kwargs: Any) -> SetSessionModeResponse: return await request_model_from_dict( self._conn, AGENT_METHODS["session_set_mode"], @@ -166,15 +159,6 @@ async def set_session_mode(self, mode_id: str, session_id: str, **kwargs: Any) - SetSessionModeResponse, ) - @param_model(SetSessionModelRequest) - async def set_session_model(self, model_id: str, session_id: str, **kwargs: Any) -> SetSessionModelResponse: - return await request_model_from_dict( - self._conn, - AGENT_METHODS["session_set_model"], - SetSessionModelRequest(model_id=model_id, session_id=session_id, field_meta=kwargs or None), - SetSessionModelResponse, - ) - @param_models(SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionSelectRequest) async def set_config_option( self, config_id: str, session_id: str, value: str | bool, **kwargs: Any @@ -204,6 +188,7 @@ async def authenticate(self, method_id: str, **kwargs: Any) -> AuthenticateRespo @param_model(PromptRequest) async def prompt( self, + session_id: str, prompt: list[ TextContentBlock | ImageContentBlock @@ -211,24 +196,22 @@ async def prompt( | ResourceContentBlock | EmbeddedResourceContentBlock ], - session_id: str, - message_id: str | None = None, **kwargs: Any, ) -> PromptResponse: 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, field_meta=kwargs or None), PromptResponse, ) @param_model(ForkSessionRequest) async def fork_session( self, - cwd: str, session_id: str, + cwd: str, additional_directories: list[str] | None = None, - mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | AcpMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> ForkSessionResponse: return await request_model( @@ -247,10 +230,10 @@ async def fork_session( @param_model(ResumeSessionRequest) async def resume_session( self, - cwd: str, session_id: str, + cwd: str, additional_directories: list[str] | None = None, - mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | AcpMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> ResumeSessionResponse: return await request_model( diff --git a/src/acp/client/router.py b/src/acp/client/router.py index 5b9049b..c8b26bb 100644 --- a/src/acp/client/router.py +++ b/src/acp/client/router.py @@ -2,12 +2,26 @@ from typing import Any +from pydantic import TypeAdapter + from ..exceptions import RequestError from ..interfaces import Client from ..meta import CLIENT_METHODS -from ..router import MessageRouter +from ..router import MessageRouter, Route, _resolve_handler, _warn_legacy_handler from ..schema import ( + CompleteElicitationNotification, + CreateElicitationRequest, + CreateFormElicitationRequest, + CreateFormRequestElicitationRequest, + CreateFormSessionElicitationRequest, CreateTerminalRequest, + CreateUrlElicitationRequest, + CreateUrlRequestElicitationRequest, + CreateUrlSessionElicitationRequest, + ElicitationFormRequestMode, + ElicitationFormSessionMode, + ElicitationUrlRequestMode, + ElicitationUrlSessionMode, KillTerminalRequest, ReadTextFileRequest, ReleaseTerminalRequest, @@ -20,6 +34,61 @@ from ..utils import normalize_result __all__ = ["build_client_router"] +_CREATE_ELICITATION_REQUEST_ADAPTER = TypeAdapter(CreateElicitationRequest) + + +def _validate_create_elicitation_request(params: Any) -> CreateFormElicitationRequest | CreateUrlElicitationRequest: + return _CREATE_ELICITATION_REQUEST_ADAPTER.validate_python(params) + + +def _mode_from_create_elicitation_request( + request: CreateFormElicitationRequest | CreateUrlElicitationRequest, +) -> ElicitationFormSessionMode | ElicitationFormRequestMode | ElicitationUrlSessionMode | ElicitationUrlRequestMode: + if isinstance(request, CreateFormSessionElicitationRequest): + return ElicitationFormSessionMode( + session_id=request.session_id, + tool_call_id=request.tool_call_id, + requested_schema=request.requested_schema, + ) + if isinstance(request, CreateFormRequestElicitationRequest): + return ElicitationFormRequestMode( + request_id=request.request_id, + requested_schema=request.requested_schema, + ) + + if isinstance(request, CreateUrlSessionElicitationRequest): + return ElicitationUrlSessionMode( + session_id=request.session_id, + tool_call_id=request.tool_call_id, + elicitation_id=request.elicitation_id, + url=request.url, + ) + if isinstance(request, CreateUrlRequestElicitationRequest): + return ElicitationUrlRequestMode( + request_id=request.request_id, + elicitation_id=request.elicitation_id, + url=request.url, + ) + raise TypeError(f"Unsupported elicitation request: {type(request).__name__}") + + +def _make_create_elicitation_handler(client: Client) -> Any: + func, attr, legacy_api = _resolve_handler(client, "create_elicitation") + if func is None: + return None + + async def wrapper(params: Any) -> Any: + if legacy_api: + _warn_legacy_handler(client, attr) + request = _validate_create_elicitation_request(params) + if legacy_api: + return await func(request) + kwargs = {"message": request.message, "mode": _mode_from_create_elicitation_request(request)} + if request.field_meta: + kwargs.update(request.field_meta) + return await func(**kwargs) + + return wrapper def build_client_router(client: Client, use_unstable_protocol: bool = False) -> MessageRouter: @@ -76,6 +145,23 @@ def build_client_router(client: Client, use_unstable_protocol: bool = False) -> adapt_result=normalize_result, ) + router.add_route( + Route( + method=CLIENT_METHODS["elicitation_create"], + func=_make_create_elicitation_handler(client), + kind="request", + adapt_result=normalize_result, + warn_unstable=not use_unstable_protocol, + ) + ) + router.route_notification( + CLIENT_METHODS["elicitation_complete"], + CompleteElicitationNotification, + client, + "complete_elicitation", + unstable=True, + ) + router.route_notification(CLIENT_METHODS["session_update"], SessionNotification, client, "session_update") @router.handle_extension_request diff --git a/src/acp/connection.py b/src/acp/connection.py index ff1cb19..09e5a0e 100644 --- a/src/acp/connection.py +++ b/src/acp/connection.py @@ -153,7 +153,7 @@ async def send_notification(self, method: str, params: JsonValue | None = None) async def _receive_loop(self) -> None: try: while True: - line = await asyncio.wait_for(self._reader.readline(), timeout=self._receive_timeout) + line = await self._read_line() if not line: break line = line.strip() @@ -172,6 +172,24 @@ async def _receive_loop(self) -> None: raise RequestError.internal_error({"details": "Agent timeout"}) from None self._disconnect() + async def _read_line(self) -> bytes: + chunks: list[bytes] = [] + try: + while True: + try: + line = await self._wait_for_reader(self._reader.readuntil(b"\n")) + except asyncio.LimitOverrunError as exc: + chunks.append(await self._wait_for_reader(self._reader.readexactly(exc.consumed))) + else: + chunks.append(line) + return b"".join(chunks) + except asyncio.IncompleteReadError as exc: + chunks.append(exc.partial) + return b"".join(chunks) + + async def _wait_for_reader(self, awaitable: Awaitable[bytes]) -> bytes: + return await asyncio.wait_for(awaitable, timeout=self._receive_timeout) + async def _process_message(self, message: dict[str, Any]) -> None: method = message.get("method") has_id = "id" in message diff --git a/src/acp/core.py b/src/acp/core.py index 75ab987..2d280c6 100644 --- a/src/acp/core.py +++ b/src/acp/core.py @@ -7,6 +7,7 @@ from __future__ import annotations +import asyncio from typing import Any from .agent.connection import AgentSideConnection @@ -69,7 +70,10 @@ async def run_agent( use_unstable_protocol=use_unstable_protocol, **connection_kwargs, ) - await conn.listen() + try: + await conn.listen() + finally: + await asyncio.shield(conn.close()) def connect_to_agent( diff --git a/src/acp/interfaces.py b/src/acp/interfaces.py index 0568731..72e8545 100644 --- a/src/acp/interfaces.py +++ b/src/acp/interfaces.py @@ -3,7 +3,10 @@ from typing import Any, Protocol from .schema import ( + AcpMcpServer, AgentMessageChunk, + AgentPlanContentUpdate, + AgentPlanRemovedUpdate, AgentPlanUpdate, AgentThoughtChunk, AudioContentBlock, @@ -14,10 +17,13 @@ ClientCapabilities, CloseSessionRequest, CloseSessionResponse, + CompleteElicitationNotification, ConfigOptionUpdate, + CreateElicitationResponse, CreateTerminalRequest, CreateTerminalResponse, CurrentModeUpdate, + ElicitationMode, EmbeddedResourceContentBlock, EnvVariable, ForkSessionRequest, @@ -53,8 +59,6 @@ SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionResponse, SetSessionConfigOptionSelectRequest, - SetSessionModelRequest, - SetSessionModelResponse, SetSessionModeRequest, SetSessionModeResponse, SseMcpServer, @@ -79,7 +83,7 @@ class Client(Protocol): @param_model(RequestPermissionRequest) async def request_permission( - self, options: list[PermissionOption], session_id: str, tool_call: ToolCallUpdate, **kwargs: Any + self, session_id: str, tool_call: ToolCallUpdate, options: list[PermissionOption], **kwargs: Any ) -> RequestPermissionResponse: ... @param_model(SessionNotification) @@ -92,6 +96,8 @@ async def session_update( | ToolCallStart | ToolCallProgress | AgentPlanUpdate + | AgentPlanContentUpdate + | AgentPlanRemovedUpdate | AvailableCommandsUpdate | CurrentModeUpdate | ConfigOptionUpdate @@ -102,22 +108,22 @@ async def session_update( @param_model(WriteTextFileRequest) async def write_text_file( - self, content: str, path: str, session_id: str, **kwargs: Any + self, session_id: str, path: str, content: str, **kwargs: Any ) -> WriteTextFileResponse | None: ... @param_model(ReadTextFileRequest) async def read_text_file( - self, path: str, session_id: str, limit: int | None = None, line: int | None = None, **kwargs: Any + self, session_id: str, path: str, line: int | None = None, limit: int | None = None, **kwargs: Any ) -> ReadTextFileResponse: ... @param_model(CreateTerminalRequest) async def create_terminal( self, - command: str, session_id: str, + command: str, args: list[str] | None = None, - cwd: str | None = None, env: list[EnvVariable] | None = None, + cwd: str | None = None, output_byte_limit: int | None = None, **kwargs: Any, ) -> CreateTerminalResponse: ... @@ -138,6 +144,13 @@ async def wait_for_terminal_exit( @param_model(KillTerminalRequest) async def kill_terminal(self, session_id: str, terminal_id: str, **kwargs: Any) -> KillTerminalResponse | None: ... + async def create_elicitation( + self, message: str, mode: ElicitationMode, **kwargs: Any + ) -> CreateElicitationResponse: ... + + @param_model(CompleteElicitationNotification) + async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None: ... + async def ext_method(self, method: str, params: dict[str, Any]) -> dict[str, Any]: ... async def ext_notification(self, method: str, params: dict[str, Any]) -> None: ... @@ -160,7 +173,7 @@ async def new_session( self, cwd: str, additional_directories: list[str] | None = None, - mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | AcpMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> NewSessionResponse: ... @@ -169,27 +182,18 @@ async def load_session( self, cwd: str, session_id: str, + mcp_servers: list[HttpMcpServer | SseMcpServer | AcpMcpServer | McpServerStdio] | None = None, 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, - additional_directories: list[str] | None = None, - cursor: str | None = None, - cwd: str | None = None, - **kwargs: Any, + self, cwd: str | None = None, cursor: str | None = None, **kwargs: Any ) -> ListSessionsResponse: ... @param_model(SetSessionModeRequest) - async def set_session_mode(self, mode_id: str, session_id: str, **kwargs: Any) -> SetSessionModeResponse | None: ... - - @param_model(SetSessionModelRequest) - async def set_session_model( - self, model_id: str, session_id: str, **kwargs: Any - ) -> SetSessionModelResponse | None: ... + async def set_session_mode(self, session_id: str, mode_id: str, **kwargs: Any) -> SetSessionModeResponse | None: ... @param_models(SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionSelectRequest) async def set_config_option( @@ -202,6 +206,7 @@ async def authenticate(self, method_id: str, **kwargs: Any) -> AuthenticateRespo @param_model(PromptRequest) async def prompt( self, + session_id: str, prompt: list[ TextContentBlock | ImageContentBlock @@ -209,28 +214,26 @@ async def prompt( | ResourceContentBlock | EmbeddedResourceContentBlock ], - session_id: str, - message_id: str | None = None, **kwargs: Any, ) -> PromptResponse: ... @param_model(ForkSessionRequest) async def fork_session( self, - cwd: str, session_id: str, + cwd: str, additional_directories: list[str] | None = None, - mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | AcpMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> ForkSessionResponse: ... @param_model(ResumeSessionRequest) async def resume_session( self, - cwd: str, session_id: str, + cwd: str, additional_directories: list[str] | None = None, - mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + mcp_servers: list[HttpMcpServer | SseMcpServer | AcpMcpServer | McpServerStdio] | None = None, **kwargs: Any, ) -> ResumeSessionResponse: ... diff --git a/src/acp/meta.py b/src/acp/meta.py index ed9a25f..a7bd914 100644 --- a/src/acp/meta.py +++ b/src/acp/meta.py @@ -1,45 +1,49 @@ # Generated from schema/meta.json. Do not edit by hand. -# Schema ref: refs/tags/v0.12.2 +# Schema ref: refs/tags/schema-v1.16.0 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", + "authenticate": "authenticate", "providers_list": "providers/list", "providers_set": "providers/set", - "session_cancel": "session/cancel", - "session_close": "session/close", - "session_fork": "session/fork", - "session_list": "session/list", - "session_load": "session/load", + "providers_disable": "providers/disable", "session_new": "session/new", + "session_load": "session/load", + "session_set_mode": "session/set_mode", + "session_set_config_option": "session/set_config_option", "session_prompt": "session/prompt", + "session_cancel": "session/cancel", + "mcp_message": "mcp/message", + "session_list": "session/list", + "session_delete": "session/delete", + "session_fork": "session/fork", "session_resume": "session/resume", - "session_set_config_option": "session/set_config_option", - "session_set_mode": "session/set_mode", - "session_set_model": "session/set_model", + "session_close": "session/close", + "logout": "logout", + "nes_start": "nes/start", + "nes_suggest": "nes/suggest", + "nes_accept": "nes/accept", + "nes_reject": "nes/reject", + "nes_close": "nes/close", + "document_did_open": "document/didOpen", + "document_did_change": "document/didChange", + "document_did_close": "document/didClose", + "document_did_save": "document/didSave", + "document_did_focus": "document/didFocus", } 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", "session_update": "session/update", + "fs_write_text_file": "fs/write_text_file", + "fs_read_text_file": "fs/read_text_file", "terminal_create": "terminal/create", - "terminal_kill": "terminal/kill", "terminal_output": "terminal/output", "terminal_release": "terminal/release", "terminal_wait_for_exit": "terminal/wait_for_exit", + "terminal_kill": "terminal/kill", + "mcp_connect": "mcp/connect", + "mcp_message": "mcp/message", + "mcp_disconnect": "mcp/disconnect", + "elicitation_create": "elicitation/create", + "elicitation_complete": "elicitation/complete", } PROTOCOL_VERSION = 1 diff --git a/src/acp/schema.py b/src/acp/schema.py index 614c7ed..6b74f46 100644 --- a/src/acp/schema.py +++ b/src/acp/schema.py @@ -1,5 +1,5 @@ # Generated from schema/schema.json. Do not edit by hand. -# Schema ref: refs/tags/v0.12.2 +# Schema ref: refs/tags/schema-v1.16.0 from __future__ import annotations @@ -30,7 +30,18 @@ class Jsonrpc(Enum): field_2_0 = "2.0" -class AuthCapabilities(BaseModel): +class ReadTextFileRequest(BaseModel): + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # Absolute path to the file to read. + path: Annotated[str, Field(description="Absolute path to the file to read.")] + # Line number to start reading from (1-based). + line: Annotated[ + Optional[int], + Field(description="Line number to start reading from (1-based).", ge=0), + ] = None + # Maximum number of lines to read. + limit: Annotated[Optional[int], Field(description="Maximum number of lines to read.", ge=0)] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -43,18 +54,21 @@ class AuthCapabilities(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 client supports `terminal` authentication methods. - # - # When `true`, the agent may include `terminal` entries in its authentication methods. - terminal: Annotated[ - Optional[bool], - Field( - description="Whether the client supports `terminal` authentication methods.\n\nWhen `true`, the agent may include `terminal` entries in its authentication methods." - ), - ] = False -class AuthEnvVar(BaseModel): +class TextResourceContents(BaseModel): + # MIME type describing the encoded media payload. + mime_type: Annotated[ + Optional[str], + Field( + alias="mimeType", + description="MIME type describing the encoded media payload.", + ), + ] = None + # Text payload carried by this content block. + text: Annotated[str, Field(description="Text payload carried by this content block.")] + # URI associated with this resource or media payload. + uri: Annotated[str, Field(description="URI associated with this resource or media payload.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -67,36 +81,21 @@ class AuthEnvVar(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 label for this variable, displayed in client UI. - label: Annotated[ + + +class BlobResourceContents(BaseModel): + # Base64-encoded bytes for a binary resource payload. + blob: Annotated[str, Field(description="Base64-encoded bytes for a binary resource payload.")] + # MIME type describing the encoded media payload. + mime_type: Annotated[ Optional[str], - Field(description="Human-readable label for this variable, displayed in client UI."), - ] = None - # The environment variable name (e.g. `"OPENAI_API_KEY"`). - name: Annotated[ - str, - Field(description='The environment variable name (e.g. `"OPENAI_API_KEY"`).'), - ] - # Whether this variable is optional. - # - # Defaults to `false`. - optional: Annotated[ - Optional[bool], - Field(description="Whether this variable is optional.\n\nDefaults to `false`."), - ] = False - # Whether this value is a secret (e.g. API key, token). - # Clients should use a password-style input for secret vars. - # - # Defaults to `true`. - secret: Annotated[ - Optional[bool], Field( - description="Whether this value is a secret (e.g. API key, token).\nClients should use a password-style input for secret vars.\n\nDefaults to `true`." + alias="mimeType", + description="MIME type describing the encoded media payload.", ), - ] = True - - -class AuthMethodAgent(BaseModel): + ] = None + # URI associated with this resource or media payload. + uri: Annotated[str, Field(description="URI associated with this resource or media payload.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -109,18 +108,18 @@ class AuthMethodAgent(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 description providing more details about this authentication method. - description: Annotated[ - Optional[str], - Field(description="Optional description providing more details about this authentication method."), - ] = None - # Unique identifier for this authentication method. - id: Annotated[str, Field(description="Unique identifier for this authentication method.")] - # Human-readable name of the authentication method. - name: Annotated[str, Field(description="Human-readable name of the authentication method.")] -class AuthMethodEnvVar(BaseModel): +class Diff(BaseModel): + # The file path being modified. + path: Annotated[str, Field(description="The file path being modified.")] + # The original content (None for new files). + old_text: Annotated[ + Optional[str], + Field(alias="oldText", description="The original content (None for new files)."), + ] = None + # The new content after modification. + new_text: Annotated[str, Field(alias="newText", description="The new content after modification.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -133,28 +132,17 @@ class AuthMethodEnvVar(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 description providing more details about this authentication method. - description: Annotated[ - Optional[str], - Field(description="Optional description providing more details about this authentication method."), - ] = None - # Unique identifier for this authentication method. - id: Annotated[str, Field(description="Unique identifier for this authentication method.")] - # Optional link to a page where the user can obtain their credentials. - link: Annotated[ - Optional[str], - Field(description="Optional link to a page where the user can obtain their credentials."), - ] = None - # Human-readable name of the authentication method. - name: Annotated[str, Field(description="Human-readable name of the authentication method.")] - # The environment variables the client should set. - vars: Annotated[ - List[AuthEnvVar], - Field(description="The environment variables the client should set."), - ] -class AuthMethodTerminal(BaseModel): +class Terminal(BaseModel): + # Identifier of the terminal instance to embed in the content stream. + terminal_id: Annotated[ + str, + Field( + alias="terminalId", + description="Identifier of the terminal instance to embed in the content stream.", + ), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -167,28 +155,13 @@ class AuthMethodTerminal(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 - # Additional arguments to pass when running the agent binary for terminal auth. - args: Annotated[ - Optional[List[str]], - Field(description="Additional arguments to pass when running the agent binary for terminal auth."), - ] = None - # Optional description providing more details about this authentication method. - description: Annotated[ - Optional[str], - Field(description="Optional description providing more details about this authentication method."), - ] = None - # Additional environment variables to set when running the agent binary for terminal auth. - env: Annotated[ - Optional[Dict[str, str]], - Field(description="Additional environment variables to set when running the agent binary for terminal auth."), - ] = None - # Unique identifier for this authentication method. - id: Annotated[str, Field(description="Unique identifier for this authentication method.")] - # Human-readable name of the authentication method. - name: Annotated[str, Field(description="Human-readable name of the authentication method.")] -class AuthenticateRequest(BaseModel): +class ToolCallLocation(BaseModel): + # The file path being accessed or modified. + path: Annotated[str, Field(description="The file path being accessed or modified.")] + # Optional line number within the file. + line: Annotated[Optional[int], Field(description="Optional line number within the file.", ge=0)] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -201,18 +174,13 @@ class AuthenticateRequest(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 authentication method to use. - # Must be one of the methods advertised in the initialize response. - method_id: Annotated[ - str, - Field( - alias="methodId", - description="The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response.", - ), - ] -class AuthenticateResponse(BaseModel): +class EnvVariable(BaseModel): + # The name of the environment variable. + name: Annotated[str, Field(description="The name of the environment variable.")] + # The value to set for the environment variable. + value: Annotated[str, Field(description="The value to set for the environment variable.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -227,7 +195,14 @@ class AuthenticateResponse(BaseModel): ] = None -class BlobResourceContents(BaseModel): +class TerminalOutputRequest(BaseModel): + # 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."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -240,21 +215,13 @@ class BlobResourceContents(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 - blob: str - mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None - 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): +class ReleaseTerminalRequest(BaseModel): + # 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 release. + terminal_id: Annotated[str, Field(alias="terminalId", description="The ID of the terminal to release.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -269,7 +236,14 @@ class CloseNesResponse(BaseModel): ] = None -class CloseSessionResponse(BaseModel): +class WaitForTerminalExitRequest(BaseModel): + # 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."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -284,14 +258,11 @@ class CloseSessionResponse(BaseModel): ] = None -class Cost(BaseModel): - # Total cumulative cost for session. - amount: Annotated[float, Field(description="Total cumulative cost for session.")] - # ISO 4217 currency code (e.g., "USD", "EUR"). - currency: Annotated[str, Field(description='ISO 4217 currency code (e.g., "USD", "EUR").')] - - -class DeclineElicitationResponse(BaseModel): +class KillTerminalRequest(BaseModel): + # 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.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -304,10 +275,34 @@ class DeclineElicitationResponse(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 - action: Literal["decline"] -class CancelElicitationResponse(BaseModel): +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 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."), + ] + + +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.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -320,10 +315,42 @@ class CancelElicitationResponse(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 - action: Literal["cancel"] -class CreateTerminalResponse(BaseModel): +class StringPropertySchema(BaseModel): + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # Minimum string length. + min_length: Annotated[ + Optional[int], + Field(alias="minLength", description="Minimum string length.", ge=0), + ] = None + # Maximum string length. + max_length: Annotated[ + Optional[int], + Field(alias="maxLength", description="Maximum string length.", ge=0), + ] = None + # Pattern the string must match. + pattern: Annotated[Optional[str], Field(description="Pattern the string must match.")] = None + # String format. + format: Annotated[Optional[str], Field(description="String format.")] = None + # Default value. + default: Annotated[Optional[str], Field(description="Default value.")] = None + # Enum values for untitled single-select enums. + enum: Annotated[ + Optional[List[str]], + Field(description="Enum values for untitled single-select enums."), + ] = 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 # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -336,17 +363,19 @@ class CreateTerminalResponse(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 unique identifier for the created terminal. - terminal_id: Annotated[ - str, - Field( - alias="terminalId", - description="The unique identifier for the created terminal.", - ), - ] -class Diff(BaseModel): +class NumberPropertySchema(BaseModel): + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # Minimum value (inclusive). + minimum: Annotated[Optional[float], Field(description="Minimum value (inclusive).")] = None + # Maximum value (inclusive). + maximum: Annotated[Optional[float], Field(description="Maximum value (inclusive).")] = None + # Default value. + default: Annotated[Optional[float], Field(description="Default value.")] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -359,18 +388,19 @@ class Diff(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 new content after modification. - new_text: Annotated[str, Field(alias="newText", description="The new content after modification.")] - # The original content (None for new files). - old_text: Annotated[ - Optional[str], - Field(alias="oldText", description="The original content (None for new files)."), - ] = None - # The file path being modified. - path: Annotated[str, Field(description="The file path being modified.")] -class DisableProvidersRequest(BaseModel): +class IntegerPropertySchema(BaseModel): + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # Minimum value (inclusive). + minimum: Annotated[Optional[int], Field(description="Minimum value (inclusive).")] = None + # Maximum value (inclusive). + maximum: Annotated[Optional[int], Field(description="Maximum value (inclusive).")] = None + # Default value. + default: Annotated[Optional[int], Field(description="Default value.")] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -383,11 +413,15 @@ class DisableProvidersRequest(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 - # Provider id to disable. - id: Annotated[str, Field(description="Provider id to disable.")] -class DisableProvidersResponse(BaseModel): +class BooleanPropertySchema(BaseModel): + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = None + # Default value. + default: Annotated[Optional[bool], Field(description="Default value.")] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -402,19 +436,9 @@ class DisableProvidersResponse(BaseModel): ] = 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): +class TitledMultiSelectItems(BaseModel): + # Titled enum options. + any_of: Annotated[List[EnumOption], Field(alias="anyOf", description="Titled enum options.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -429,11 +453,52 @@ class ElicitationFormCapabilities(BaseModel): ] = None -class ElicitationBooleanPropertySchema(BooleanPropertySchema): - type: Literal["boolean"] +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 ElicitationUrlCapabilities(BaseModel): +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 DisconnectMcpRequest(BaseModel): + # The MCP-over-ACP connection to close. + connection_id: Annotated[ + str, + Field(alias="connectionId", description="The MCP-over-ACP connection to close."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -448,14 +513,22 @@ class ElicitationUrlCapabilities(BaseModel): ] = 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): +class PromptCapabilities(BaseModel): + # Agent supports [`ContentBlock::Image`]. + image: Annotated[Optional[bool], Field(description="Agent supports [`ContentBlock::Image`].")] = False + # 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 # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -468,13 +541,24 @@ class EnvVariable(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 name of the environment variable. - name: Annotated[str, Field(description="The name of the environment variable.")] - # The value to set for the environment variable. - value: Annotated[str, Field(description="The value to set for the environment variable.")] -class FileSystemCapabilities(BaseModel): +class McpCapabilities(BaseModel): + # Agent supports [`McpServer::Http`]. + http: Annotated[Optional[bool], Field(description="Agent supports [`McpServer::Http`].")] = False + # Agent supports [`McpServer::Sse`]. + sse: Annotated[Optional[bool], Field(description="Agent supports [`McpServer::Sse`].")] = False + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Agent supports [`McpServer::Acp`]. + acp: Annotated[ + Optional[bool], + Field( + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAgent supports [`McpServer::Acp`]." + ), + ] = False # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -487,25 +571,9 @@ class FileSystemCapabilities(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 Client supports `fs/read_text_file` requests. - read_text_file: Annotated[ - Optional[bool], - Field( - alias="readTextFile", - description="Whether the Client supports `fs/read_text_file` requests.", - ), - ] = False - # Whether the Client supports `fs/write_text_file` requests. - write_text_file: Annotated[ - Optional[bool], - Field( - alias="writeTextFile", - description="Whether the Client supports `fs/write_text_file` requests.", - ), - ] = False -class HttpHeader(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. @@ -518,13 +586,9 @@ class HttpHeader(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 name of the HTTP header. - name: Annotated[str, Field(description="The name of the HTTP header.")] - # The value to set for the HTTP header. - value: Annotated[str, Field(description="The value to set for the HTTP header.")] -class Implementation(BaseModel): +class SessionDeleteCapabilities(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. @@ -537,48 +601,9 @@ class Implementation(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 - # Intended for programmatic or logical use, but can be used as a display - # name fallback if title isn’t present. - name: Annotated[ - str, - Field( - description="Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present." - ), - ] - # Intended for UI and end-user contexts — optimized to be human-readable - # and easily understood. - # - # If not provided, the name should be used for display. - title: Annotated[ - Optional[str], - Field( - description="Intended for UI and end-user contexts — optimized to be human-readable\nand easily understood.\n\nIf not provided, the name should be used for display." - ), - ] = None - # Version of the implementation. Can be displayed to the user or used - # for debugging or metrics purposes. (e.g. "1.0.0"). - version: Annotated[ - str, - Field( - description='Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. "1.0.0").' - ), - ] - - -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): +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. @@ -593,7 +618,7 @@ class KillTerminalResponse(BaseModel): ] = None -class ListProvidersRequest(BaseModel): +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. @@ -608,7 +633,7 @@ class ListProvidersRequest(BaseModel): ] = None -class ListSessionsRequest(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. @@ -621,36 +646,9 @@ 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], - Field( - description="Opaque cursor token from a previous response's nextCursor field for cursor-based pagination" - ), - ] = None - # Filter sessions by working directory. Must be an absolute path. - cwd: Annotated[ - Optional[str], - Field(description="Filter sessions by working directory. Must be an absolute path."), - ] = None -class LogoutCapabilities(BaseModel): +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. @@ -665,7 +663,7 @@ class LogoutCapabilities(BaseModel): ] = None -class LogoutRequest(BaseModel): +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. @@ -680,7 +678,7 @@ class LogoutRequest(BaseModel): ] = None -class LogoutResponse(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. @@ -695,7 +693,7 @@ class LogoutResponse(BaseModel): ] = None -class McpCapabilities(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. @@ -708,13 +706,9 @@ class McpCapabilities(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 [`McpServer::Http`]. - http: Annotated[Optional[bool], Field(description="Agent supports [`McpServer::Http`].")] = False - # Agent supports [`McpServer::Sse`]. - sse: Annotated[Optional[bool], Field(description="Agent supports [`McpServer::Sse`].")] = False -class McpServerHttp(BaseModel): +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. @@ -727,18 +721,9 @@ class McpServerHttp(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 - # HTTP headers to set when making requests to the MCP server. - headers: Annotated[ - List[HttpHeader], - Field(description="HTTP headers to set when making requests to the MCP server."), - ] - # Human-readable name identifying this MCP server. - name: Annotated[str, Field(description="Human-readable name identifying this MCP server.")] - # URL to the MCP server. - url: Annotated[str, Field(description="URL to the MCP server.")] -class McpServerSse(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. @@ -751,18 +736,9 @@ class McpServerSse(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 - # HTTP headers to set when making requests to the MCP server. - headers: Annotated[ - List[HttpHeader], - Field(description="HTTP headers to set when making requests to the MCP server."), - ] - # Human-readable name identifying this MCP server. - name: Annotated[str, Field(description="Human-readable name identifying this MCP server.")] - # URL to the MCP server. - url: Annotated[str, Field(description="URL to the MCP server.")] -class McpServerStdio(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. @@ -775,23 +751,18 @@ class McpServerStdio(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 - # Command-line arguments to pass to the MCP server. - args: Annotated[ - List[str], - Field(description="Command-line arguments to pass to the MCP server."), - ] - # Path to the MCP server executable. - command: Annotated[str, Field(description="Path to the MCP server executable.")] - # Environment variables to set when launching the MCP server. - env: Annotated[ - List[EnvVariable], - Field(description="Environment variables to set when launching the MCP server."), - ] - # Human-readable name identifying this MCP server. - name: Annotated[str, Field(description="Human-readable name identifying this MCP server.")] -class ModelInfo(BaseModel): +class NesRecentFilesCapabilities(BaseModel): + # Maximum number of recent files the agent can use. + max_count: Annotated[ + Optional[int], + Field( + alias="maxCount", + description="Maximum number of recent files the agent can use.", + ge=0, + ), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -804,15 +775,9 @@ class ModelInfo(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 description of the model. - description: Annotated[Optional[str], Field(description="Optional description of the model.")] = None - # Unique identifier for the model. - model_id: Annotated[str, Field(alias="modelId", description="Unique identifier for the model.")] - # Human-readable name of the model. - name: Annotated[str, Field(description="Human-readable name of the model.")] -class NesDiagnosticsCapabilities(BaseModel): +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. @@ -827,7 +792,16 @@ class NesDiagnosticsCapabilities(BaseModel): ] = None -class NesDocumentDidCloseCapabilities(BaseModel): +class NesEditHistoryCapabilities(BaseModel): + # 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 # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -842,7 +816,16 @@ class NesDocumentDidCloseCapabilities(BaseModel): ] = None -class NesDocumentDidFocusCapabilities(BaseModel): +class NesUserActionsCapabilities(BaseModel): + # Maximum number of user actions the agent can use. + max_count: Annotated[ + Optional[int], + Field( + alias="maxCount", + description="Maximum number of user actions the agent can use.", + ge=0, + ), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -857,7 +840,7 @@ class NesDocumentDidFocusCapabilities(BaseModel): ] = None -class NesDocumentDidOpenCapabilities(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. @@ -872,7 +855,7 @@ class NesDocumentDidOpenCapabilities(BaseModel): ] = None -class NesDocumentDidSaveCapabilities(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. @@ -887,7 +870,34 @@ class NesDocumentDidSaveCapabilities(BaseModel): ] = None -class NesEditHistoryCapabilities(BaseModel): +class AuthEnvVar(BaseModel): + # The environment variable name (e.g. `"OPENAI_API_KEY"`). + name: Annotated[ + str, + Field(description='The environment variable name (e.g. `"OPENAI_API_KEY"`).'), + ] + # Human-readable label for this variable, displayed in client UI. + label: Annotated[ + Optional[str], + Field(description="Human-readable label for this variable, displayed in client UI."), + ] = None + # Whether this value is a secret (e.g. API key, token). + # Clients should use a password-style input for secret vars. + # + # Defaults to `true`. + secret: Annotated[ + Optional[bool], + Field( + description="Whether this value is a secret (e.g. API key, token).\nClients should use a password-style input for secret vars.\n\nDefaults to `true`." + ), + ] = True + # Whether this variable is optional. + # + # Defaults to `false`. + optional: Annotated[ + Optional[bool], + Field(description="Whether this variable is optional.\n\nDefaults to `false`."), + ] = False # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -900,48 +910,28 @@ class NesEditHistoryCapabilities(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 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, - ), +class AuthMethodEnvVar(BaseModel): + # Unique identifier for this authentication method. + id: Annotated[str, Field(description="Unique identifier for this authentication method.")] + # Human-readable name of the authentication method. + name: Annotated[str, Field(description="Human-readable name of the authentication method.")] + # Optional description providing more details about this authentication method. + description: Annotated[ + Optional[str], + Field(description="Optional description providing more details about this authentication method."), + ] = None + # The environment variables the client should set. + vars: Annotated[ + List[AuthEnvVar], + Field(description="The environment variables the client should set."), ] - # The text content of the excerpt. - text: Annotated[str, Field(description="The text content of the excerpt.")] - - -class NesJumpCapabilities(BaseModel): + # Optional link to a page where the user can obtain their credentials. + link: Annotated[ + Optional[str], + Field(description="Optional link to a page where the user can obtain their credentials."), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -956,7 +946,26 @@ class NesJumpCapabilities(BaseModel): ] = None -class NesOpenFilesCapabilities(BaseModel): +class AuthMethodTerminal(BaseModel): + # Unique identifier for this authentication method. + id: Annotated[str, Field(description="Unique identifier for this authentication method.")] + # Human-readable name of the authentication method. + name: Annotated[str, Field(description="Human-readable name of the authentication method.")] + # Optional description providing more details about this authentication method. + description: Annotated[ + Optional[str], + Field(description="Optional description providing more details about this authentication method."), + ] = None + # Additional arguments to pass when running the agent binary for terminal auth. + args: Annotated[ + Optional[List[str]], + Field(description="Additional arguments to pass when running the agent binary for terminal auth."), + ] = None + # Additional environment variables to set when running the agent binary for terminal auth. + env: Annotated[ + Optional[Dict[str, str]], + Field(description="Additional environment variables to set when running the agent binary for terminal auth."), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -971,16 +980,16 @@ class NesOpenFilesCapabilities(BaseModel): ] = None -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): +class AuthMethodAgent(BaseModel): + # Unique identifier for this authentication method. + id: Annotated[str, Field(description="Unique identifier for this authentication method.")] + # Human-readable name of the authentication method. + name: Annotated[str, Field(description="Human-readable name of the authentication method.")] + # Optional description providing more details about this authentication method. + description: Annotated[ + Optional[str], + Field(description="Optional description providing more details about this authentication method."), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -993,25 +1002,35 @@ class NesRecentFilesCapabilities(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 recent files the agent can use. - max_count: Annotated[ - Optional[int], + + +class Implementation(BaseModel): + # Intended for programmatic or logical use, but can be used as a display + # name fallback if title isn’t present. + name: Annotated[ + str, Field( - alias="maxCount", - description="Maximum number of recent files the agent can use.", - ge=0, + description="Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present." + ), + ] + # Intended for UI and end-user contexts — optimized to be human-readable + # and easily understood. + # + # If not provided, the name should be used for display. + title: Annotated[ + Optional[str], + Field( + description="Intended for UI and end-user contexts — optimized to be human-readable\nand easily understood.\n\nIf not provided, the name should be used for display." ), ] = None - - -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): + # Version of the implementation. Can be displayed to the user or used + # for debugging or metrics purposes. (e.g. "1.0.0"). + version: Annotated[ + str, + Field( + description='Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. "1.0.0").' + ), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1026,7 +1045,7 @@ class NesRelatedSnippetsCapabilities(BaseModel): ] = None -class NesRenameCapabilities(BaseModel): +class AuthenticateResponse(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. @@ -1041,130 +1060,6 @@ class NesRenameCapabilities(BaseModel): ] = None -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. - # - # 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 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 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. - # - # 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 - # Maximum number of user actions the agent can use. - max_count: Annotated[ - Optional[int], - Field( - 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), - ] - # Zero-based line number. - line: Annotated[int, Field(description="Zero-based line number.", ge=0)] - - -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. - # - # 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 - # 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[ @@ -1176,9 +1071,6 @@ class ProviderCurrentConfig(BaseModel): str, Field(alias="baseUrl", description="Base URL currently used by this provider."), ] - - -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. @@ -1191,27 +1083,9 @@ class ProviderInfo(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 - # 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 ProvidersCapabilities(BaseModel): +class SetProviderResponse(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. @@ -1226,14 +1100,7 @@ class ProvidersCapabilities(BaseModel): ] = None -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): +class DisableProviderResponse(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. @@ -1246,10 +1113,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 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. @@ -1264,36 +1130,19 @@ class ReleaseTerminalResponse(BaseModel): ] = None -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. - # - # 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 option the user selected. - option_id: Annotated[ +class SessionMode(BaseModel): + # Stable identifier used to refer to this protocol object in later messages. + id: Annotated[ str, - Field(alias="optionId", description="The ID of the option the user selected."), + Field(description="Stable identifier used to refer to this protocol object in later messages."), ] - - -class SessionAdditionalDirectoriesCapabilities(BaseModel): + # Human-readable name shown for this protocol object. + name: Annotated[str, Field(description="Human-readable name shown for this protocol object.")] + # Optional human-readable details shown with this protocol object. + description: Annotated[ + Optional[str], + Field(description="Optional human-readable details shown with this protocol object."), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1308,7 +1157,13 @@ class SessionAdditionalDirectoriesCapabilities(BaseModel): ] = None -class SessionCloseCapabilities(BaseModel): +class SessionConfigSelectOption(BaseModel): + # Unique identifier for this option value. + value: Annotated[str, Field(description="Unique identifier for this option value.")] + # Human-readable label for this option value. + name: Annotated[str, Field(description="Human-readable label for this option value.")] + # Optional description for this option value. + description: Annotated[Optional[str], Field(description="Optional description for this option value.")] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1331,55 +1186,26 @@ class SessionConfigBoolean(BaseModel): ] -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. - # - # 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 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. - # - # 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. - # - # Authoritative ordered additional workspace roots for this session. Each path must be absolute. + # Unique identifier for the session + session_id: Annotated[str, Field(alias="sessionId", description="Unique identifier for the session")] + # 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."), + ] + # Additional workspace roots reported for this session. Each path must be absolute. # - # When omitted or empty, there are no additional roots for the session. + # When present, this is the complete ordered additional-root list reported + # by the Agent. Omitted and empty values are equivalent: the response + # reports no additional roots. 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.", + description="Additional workspace roots reported for this session. Each path must be absolute.\n\nWhen present, this is the complete ordered additional-root list reported\nby the Agent. Omitted and empty values are equivalent: the response\nreports no additional roots.", ), ] = 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 @@ -1387,9 +1213,6 @@ class SessionInfo(BaseModel): Optional[str], Field(alias="updatedAt", description="ISO 8601 timestamp of last activity"), ] = None - - -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. @@ -1402,22 +1225,9 @@ 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], - Field( - alias="updatedAt", - description="ISO 8601 timestamp of last activity. Set to null to clear.", - ), - ] = None -class SessionListCapabilities(BaseModel): +class DeleteSessionResponse(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. @@ -1432,7 +1242,7 @@ class SessionListCapabilities(BaseModel): ] = None -class SessionModelState(BaseModel): +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 # these keys. @@ -1445,22 +1255,9 @@ 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 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. @@ -1475,11 +1272,49 @@ class SessionResumeCapabilities(BaseModel): ] = None -class SessionInfoUpdate(_SessionInfoUpdate): - session_update: Annotated[Literal["session_info_update"], Field(alias="sessionUpdate")] - - -class SetProvidersRequest(BaseModel): +class Usage(BaseModel): + # Sum of all token types across session. + total_tokens: Annotated[ + int, + Field( + alias="totalTokens", + description="Sum of all token types across session.", + ge=0, + ), + ] + # 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 + # 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 # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1492,29 +1327,17 @@ class SetProvidersRequest(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 - # 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[ + + +class StartNesResponse(BaseModel): + # The session ID for the newly started NES session. + session_id: Annotated[ str, Field( - alias="baseUrl", - description="Base URL for requests sent through this provider.", + alias="sessionId", + description="The session ID for the newly started NES session.", ), ] - # 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 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. @@ -1529,7 +1352,14 @@ class SetProvidersResponse(BaseModel): ] = None -class SetSessionConfigOptionBooleanRequest(BaseModel): +class Position(BaseModel): + # Zero-based line number. + line: Annotated[int, Field(description="Zero-based line number.", ge=0)] + # Zero-based character offset (encoding-dependent). + character: Annotated[ + int, + Field(description="Zero-based character offset (encoding-dependent).", ge=0), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1542,25 +1372,15 @@ 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, - 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 SetSessionConfigOptionSelectRequest(BaseModel): +class NesJumpSuggestion(BaseModel): + # Unique identifier for accept/reject tracking. + id: Annotated[str, Field(description="Unique identifier for accept/reject tracking.")] + # The file to navigate to. + uri: Annotated[str, Field(description="The file to navigate to.")] + # The target position within the file. + position: Annotated[Position, Field(description="The target position within the file.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1573,24 +1393,17 @@ 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[ - 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 SetSessionModeRequest(BaseModel): +class NesRenameSuggestion(BaseModel): + # Unique identifier for accept/reject tracking. + id: Annotated[str, Field(description="Unique identifier for accept/reject tracking.")] + # The file URI containing the symbol. + uri: Annotated[str, Field(description="The file URI containing the symbol.")] + # The position of the symbol to rename. + position: Annotated[Position, Field(description="The position of the symbol to rename.")] + # The new name for the symbol. + new_name: Annotated[str, Field(alias="newName", description="The new name for the symbol.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1603,16 +1416,25 @@ 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."), - ] -class SetSessionModeResponse(BaseModel): +class NesSearchAndReplaceSuggestion(BaseModel): + # Unique identifier for accept/reject tracking. + id: Annotated[str, Field(description="Unique identifier for accept/reject tracking.")] + # The file URI to search within. + uri: Annotated[str, Field(description="The file URI to search within.")] + # The text or pattern to find. + search: Annotated[str, Field(description="The text or pattern to find.")] + # The replacement text. + replace: Annotated[str, Field(description="The replacement text.")] + # 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 _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1627,7 +1449,7 @@ class SetSessionModeResponse(BaseModel): ] = None -class SetSessionModelRequest(BaseModel): +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. @@ -1640,16 +1462,13 @@ 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."), - ] -class SetSessionModelResponse(BaseModel): +class PlanFile(BaseModel): + # The plan ID to update. + id: Annotated[str, Field(description="The plan ID to update.")] + # The URI of the file containing the plan. + uri: Annotated[str, Field(description="The URI of the file containing the plan.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1664,7 +1483,11 @@ class SetSessionModelResponse(BaseModel): ] = None -class StartNesResponse(BaseModel): +class PlanMarkdown(BaseModel): + # The plan ID to update. + id: Annotated[str, Field(description="The plan ID to update.")] + # Markdown content for the plan. + content: Annotated[str, Field(description="Markdown content for the plan.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1677,53 +1500,31 @@ class StartNesResponse(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 the newly started NES session. - session_id: Annotated[ - str, - Field( - alias="sessionId", - description="The session ID for the newly started NES session.", - ), - ] -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]], +class PlanRemoved(BaseModel): + # The plan ID to remove. + id: Annotated[str, Field(description="The plan ID to remove.")] + # The _meta property is reserved 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="oneOf", - description="Titled enum options for titled single-select enums.", + 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 - # 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 Terminal(BaseModel): +class UnstructuredCommandInput(BaseModel): + # 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"), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1736,10 +1537,11 @@ 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")] -class TerminalExitStatus(BaseModel): +class _CurrentModeUpdate(BaseModel): + # The ID of the current mode + current_mode_id: Annotated[str, Field(alias="currentModeId", description="The ID of the current mode")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1752,23 +1554,22 @@ 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], - Field( - alias="exitCode", - description="The process exit code (may be null if terminated by signal).", - ge=0, - ), + + +class _SessionInfoUpdate(BaseModel): + # 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 - # The signal that terminated the process (may be null if exited normally). - signal: Annotated[ + # ISO 8601 timestamp of last activity. Set to null to clear. + updated_at: Annotated[ Optional[str], - Field(description="The signal that terminated the process (may be null if exited normally)."), + Field( + alias="updatedAt", + description="ISO 8601 timestamp of last activity. Set to null to clear.", + ), ] = 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. @@ -1781,16 +1582,13 @@ 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 Cost(BaseModel): + # Total cumulative cost for session. + amount: Annotated[float, Field(description="Total cumulative cost for session.")] + # ISO 4217 currency code (e.g., "USD", "EUR"). + currency: Annotated[str, Field(description='ISO 4217 currency code (e.g., "USD", "EUR").')] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1803,31 +1601,15 @@ 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."), - ] = 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): +class _UsageUpdate(BaseModel): + # Tokens currently in context. + used: Annotated[int, Field(description="Tokens currently in context.", ge=0)] + # Total context window size in tokens. + size: Annotated[int, Field(description="Total context window size in tokens.", ge=0)] + # Cumulative session cost (optional). + cost: Annotated[Optional[Cost], Field(description="Cumulative session cost (optional).")] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1840,25 +1622,17 @@ 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 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): +class CompleteElicitationNotification(BaseModel): + # The ID of the elicitation that completed. + elicitation_id: Annotated[ + str, + Field( + alias="elicitationId", + description="The ID of the elicitation that completed.", + ), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1871,13 +1645,28 @@ 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 MessageMcpNotification(BaseModel): + # The MCP-over-ACP connection this message is sent on. + connection_id: Annotated[ + str, + Field( + alias="connectionId", + description="The MCP-over-ACP connection this message is sent on.", + ), + ] + # The inner MCP method name. + method: Annotated[str, Field(description="The inner MCP method name.")] + # Optional inner MCP params. + # + # If omitted or set to `null`, the inner MCP message has no params. + params: Annotated[ + Optional[Dict[str, Any]], + Field( + description="Optional inner MCP params.\n\nIf omitted or set to `null`, the inner MCP message has no params." + ), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1890,66 +1679,25 @@ 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 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, +class FileSystemCapabilities(BaseModel): + # Whether the Client supports `fs/read_text_file` requests. + read_text_file: Annotated[ + Optional[bool], Field( - alias="outputTokens", - description="Total output tokens across all turns.", - ge=0, + alias="readTextFile", + description="Whether the Client supports `fs/read_text_file` requests.", ), - ] - # 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, + ] = False + # Whether the Client supports `fs/write_text_file` requests. + write_text_file: Annotated[ + Optional[bool], Field( - alias="totalTokens", - description="Sum of all token types across session.", - ge=0, + alias="writeTextFile", + description="Whether the Client supports `fs/write_text_file` requests.", ), - ] - - -class _UsageUpdate(BaseModel): + ] = False # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -1962,15 +1710,9 @@ 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 BooleanConfigOptionCapabilities(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. @@ -1983,16 +1725,9 @@ 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[ - str, - Field(alias="terminalId", description="The ID of the terminal to wait for."), - ] -class WaitForTerminalExitResponse(BaseModel): +class PlanCapabilities(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. @@ -2005,30 +1740,18 @@ 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 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): +class AuthCapabilities(BaseModel): + # Whether the client supports `terminal` authentication methods. + # + # When `true`, the agent may include `terminal` entries in its authentication methods. + terminal: Annotated[ + Optional[bool], + Field( + description="Whether the client supports `terminal` authentication methods.\n\nWhen `true`, the agent may include `terminal` entries in its authentication methods." + ), + ] = False # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2041,15 +1764,9 @@ 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.")] -class WriteTextFileResponse(BaseModel): +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. @@ -2064,7 +1781,7 @@ class WriteTextFileResponse(BaseModel): ] = None -class AcceptNesNotification(BaseModel): +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. @@ -2077,16 +1794,9 @@ class AcceptNesNotification(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 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): +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. @@ -2099,18 +1809,9 @@ class AgentAuthCapabilities(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 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): +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. @@ -2123,12 +1824,9 @@ 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 -class AudioContent(BaseModel): +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. @@ -2141,28 +1839,18 @@ 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 AuthenticateRequest(BaseModel): + # The ID of the authentication method to use. + # Must be one of the methods advertised in the initialize response. + method_id: Annotated[ + str, + Field( + alias="methodId", + description="The ID of the authentication method to use.\nMust be one of the methods advertised in the initialize response.", + ), ] - - -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. @@ -2175,17 +1863,9 @@ 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. - session_id: Annotated[ - str, - Field( - alias="sessionId", - description="The ID of the session to cancel operations for.", - ), - ] -class CancelRequestNotification(BaseModel): +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. @@ -2198,17 +1878,32 @@ 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 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. +class SetProviderRequest(BaseModel): + # Provider id to configure. + id: Annotated[str, Field(description="Provider id to configure.")] + # 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="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 + # The _meta property is reserved 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[ @@ -2218,27 +1913,11 @@ class ClientNesCapabilities(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 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): +class DisableProviderRequest(BaseModel): + # Provider id to disable. + id: Annotated[str, Field(description="Provider id to disable.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2251,11 +1930,9 @@ class CloseNesRequest(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 NES session to close. - session_id: Annotated[str, Field(alias="sessionId", description="The ID of the NES session to close.")] -class CloseSessionRequest(BaseModel): +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. @@ -2268,11 +1945,13 @@ 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 CompleteElicitationNotification(BaseModel): +class HttpHeader(BaseModel): + # The name of the HTTP header. + name: Annotated[str, Field(description="The name of the HTTP header.")] + # The value to set for the HTTP header. + value: Annotated[str, Field(description="The value to set for the HTTP header.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2285,21 +1964,18 @@ class CompleteElicitationNotification(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 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): +class McpServerHttp(BaseModel): + # Human-readable name identifying this MCP server. + name: Annotated[str, Field(description="Human-readable name identifying this MCP server.")] + # URL to the MCP server. + url: Annotated[str, Field(description="URL to the MCP server.")] + # HTTP headers to set when making requests to the MCP server. + headers: Annotated[ + List[HttpHeader], + Field(description="HTTP headers to set when making requests to the MCP server."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2312,10 +1988,18 @@ class AcceptElicitationResponse(ElicitationAcceptAction): description="The _meta property is reserved by ACP to allow clients and agents to attach 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): +class McpServerSse(BaseModel): + # Human-readable name identifying this MCP server. + name: Annotated[str, Field(description="Human-readable name identifying this MCP server.")] + # URL to the MCP server. + url: Annotated[str, Field(description="URL to the MCP server.")] + # HTTP headers to set when making requests to the MCP server. + headers: Annotated[ + List[HttpHeader], + Field(description="HTTP headers to set when making requests to the MCP server."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2328,41 +2012,21 @@ 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. + + +class McpServerAcp(BaseModel): + # Human-readable name identifying this MCP server. + name: Annotated[str, Field(description="Human-readable name identifying this MCP server.")] + # Unique identifier for this MCP server, generated by the component providing it. # - # 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], + # Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible + # on the same ACP connection. + id: Annotated[ + str, 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, + description="Unique identifier for this MCP server, generated by the component providing it.\n\nProviders MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible\non the same ACP connection." ), - ] = None - # 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. @@ -2375,11 +2039,23 @@ 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")] -class DidChangeDocumentNotification(BaseModel): +class McpServerStdio(BaseModel): + # Human-readable name identifying this MCP server. + name: Annotated[str, Field(description="Human-readable name identifying this MCP server.")] + # Path to the MCP server executable. + command: Annotated[str, Field(description="Path to the MCP server executable.")] + # Command-line arguments to pass to the MCP server. + args: Annotated[ + List[str], + Field(description="Command-line arguments to pass to the MCP server."), + ] + # Environment variables to set when launching the MCP server. + env: Annotated[ + List[EnvVariable], + Field(description="Environment variables to set when launching the MCP server."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2392,23 +2068,21 @@ class DidChangeDocumentNotification(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 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): +class ListSessionsRequest(BaseModel): + # Filter sessions by working directory. Must be an absolute path. + cwd: Annotated[ + Optional[str], + Field(description="Filter sessions by working directory. Must be an absolute path."), + ] = None + # Opaque cursor token from a previous response's nextCursor field for cursor-based pagination + cursor: Annotated[ + Optional[str], + Field( + description="Opaque cursor token from a previous response's nextCursor field for cursor-based pagination" + ), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2421,16 +2095,11 @@ class DidCloseDocumentNotification(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 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 DidFocusDocumentNotification(BaseModel): +class DeleteSessionRequest(BaseModel): + # The ID of the session to delete. + session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to delete.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2443,28 +2112,11 @@ class DidFocusDocumentNotification(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 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): +class CloseSessionRequest(BaseModel): + # The ID of the session to close. + session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to close.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2477,28 +2129,16 @@ class DidOpenDocumentNotification(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 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. + + +class SetSessionModeRequest(BaseModel): + # The ID of the session to set the mode for. session_id: Annotated[ str, - Field(alias="sessionId", description="The session ID for this notification."), + Field(alias="sessionId", description="The ID of the session to set the mode for."), ] - # 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 ID of the mode to set. + mode_id: Annotated[str, Field(alias="modeId", description="The ID of the mode to set.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2511,16 +2151,22 @@ class DidSaveDocumentNotification(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 notification. + + +class SetSessionConfigOptionBooleanRequest(BaseModel): + # The ID of the session to set the configuration option for. session_id: Annotated[ str, - Field(alias="sessionId", description="The session ID for this notification."), + Field( + alias="sessionId", + description="The ID of the session to set the configuration option for.", + ), + ] + # 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 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. @@ -2533,119 +2179,123 @@ class ElicitationCapabilities(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 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 + # The boolean value. + value: Annotated[bool, Field(description="The boolean value.")] + type: Literal["boolean"] -class ElicitationSessionScope(BaseModel): - # The session this elicitation is tied to. +class SetSessionConfigOptionSelectRequest(BaseModel): + # The ID of the session to set the configuration option for. session_id: Annotated[ str, - Field(alias="sessionId", description="The session this elicitation is tied to."), + Field( + alias="sessionId", + description="The ID of the session to set the configuration option for.", + ), ] - # Optional tool call within the session. - tool_call_id: Annotated[ - Optional[str], - Field(alias="toolCallId", description="Optional tool call within the session."), + # 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 _meta property is reserved 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 value ID. + value: Annotated[str, Field(description="The value ID.")] -class ElicitationUrlSessionMode(ElicitationSessionScope): - # The unique identifier for this elicitation. - elicitation_id: Annotated[ - str, +class WorkspaceFolder(BaseModel): + # The URI of the folder. + uri: Annotated[str, Field(description="The URI of the folder.")] + # The display name of the folder. + name: Annotated[str, Field(description="The display name of the folder.")] + # The _meta property is reserved 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="elicitationId", - description="The unique identifier for this elicitation.", + 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)", ), - ] - # The URL to direct the user to. - url: Annotated[AnyUrl, Field(description="The URL to direct the user to.")] + ] = None -class ElicitationUrlRequestMode(ElicitationRequestScope): - # The unique identifier for this elicitation. - elicitation_id: Annotated[ - str, +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.")] + # The _meta property is reserved 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="elicitationId", - description="The unique identifier for this elicitation.", + 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)", ), - ] - # The URL to direct the user to. - url: Annotated[AnyUrl, Field(description="The URL to direct the user to.")] + ] = None -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. +class NesRecentFile(BaseModel): + # The URI of the file. + uri: Annotated[str, Field(description="The URI of the file.")] + # 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 _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. # - # URL-based elicitation mode where the client directs the user to a URL. - root: Annotated[ - Union[ElicitationUrlSessionMode, ElicitationUrlRequestMode], + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], 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." + 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 Error(BaseModel): - # A number indicating the error type that occurred. - # This must be an integer as defined in the JSON-RPC specification. - code: Annotated[ +class NesExcerpt(BaseModel): + # The start line of the excerpt (zero-based). + start_line: Annotated[ int, Field( - description="A number indicating the error type that occurred.\nThis must be an integer as defined in the JSON-RPC specification." + alias="startLine", + description="The start line of the excerpt (zero-based).", + ge=0, ), ] - # Optional primitive or structured value that contains additional information about the error. - # This may include debugging information or context-specific details. - data: Annotated[ - Optional[Any], - Field( - description="Optional primitive or structured value that contains additional information about the error.\nThis may include debugging information or context-specific details." - ), - ] = None - # A string providing a short description of the error. - # The message should be limited to a concise single sentence. - message: Annotated[ - str, + # The end line of the excerpt (zero-based). + end_line: Annotated[ + int, Field( - description="A string providing a short description of the error.\nThe message should be limited to a concise single sentence." + alias="endLine", + description="The end line of the excerpt (zero-based).", + ge=0, ), ] - - -class ImageContent(BaseModel): + # The text content of the excerpt. + text: Annotated[str, Field(description="The text content of the excerpt.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2658,13 +2308,13 @@ class ImageContent(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")] - uri: Optional[str] = None -class KillTerminalRequest(BaseModel): +class NesEditHistoryEntry(BaseModel): + # The URI of the edited file. + uri: Annotated[str, Field(description="The URI of the edited file.")] + # A diff representing the edit. + diff: Annotated[str, Field(description="A diff representing the edit.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2677,13 +2327,27 @@ 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.")] -class ListProvidersResponse(BaseModel): +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 URI of the file where the action occurred. + uri: Annotated[str, Field(description="The URI of the file where the action occurred.")] + # 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 _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2696,14 +2360,11 @@ class ListProvidersResponse(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 - # 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): +class CloseNesRequest(BaseModel): + # The ID of the NES session to close. + session_id: Annotated[str, Field(alias="sessionId", description="The ID of the NES session to close.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2716,52 +2377,9 @@ 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], - 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.", - ), - ] = 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 NesContextCapabilities(BaseModel): +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. @@ -2774,62 +2392,35 @@ class NesContextCapabilities(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 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], + + +class ReadTextFileResponse(BaseModel): + # Content payload returned by this response. + content: Annotated[str, Field(description="Content payload returned by this response.")] + # The _meta property is reserved 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="userActions", - description="Whether the agent wants user actions context.", + 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 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 DeniedOutcome(BaseModel): + outcome: Literal["cancelled"] -class NesDocumentDidChangeCapabilities(BaseModel): +class SelectedPermissionOutcome(BaseModel): + # The ID of the option the user selected. + option_id: Annotated[ + str, + Field(alias="optionId", description="The ID of the option the user selected."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -2842,17 +2433,17 @@ class NesDocumentDidChangeCapabilities(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 sync kind the agent wants: `"full"` or `"incremental"`. - sync_kind: Annotated[ + + +class CreateTerminalResponse(BaseModel): + # The unique identifier for the created terminal. + terminal_id: Annotated[ str, Field( - alias="syncKind", - description='The sync kind the agent wants: `"full"` or `"incremental"`.', + alias="terminalId", + description="The unique identifier for the created terminal.", ), ] - - -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. @@ -2865,49 +2456,38 @@ class NesDocumentEventCapabilities(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 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], + + +class TerminalExitStatus(BaseModel): + # The process exit code (may be null if terminated by signal). + exit_code: Annotated[ + Optional[int], Field( - alias="didFocus", - description="Whether the agent wants `document/didFocus` events.", + alias="exitCode", + description="The process exit code (may be null if terminated by signal).", + ge=0, ), ] = None - # Whether the agent wants `document/didOpen` events. - did_open: Annotated[ - Optional[NesDocumentDidOpenCapabilities], - Field( - alias="didOpen", - description="Whether the agent wants `document/didOpen` events.", - ), + # 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 - # Whether the agent wants `document/didSave` events. - did_save: Annotated[ - Optional[NesDocumentDidSaveCapabilities], + # The _meta property is reserved 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="didSave", - description="Whether the agent wants `document/didSave` events.", + 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 NesEventCapabilities(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. @@ -2920,91 +2500,23 @@ class NesEventCapabilities(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 - # 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[ +class WaitForTerminalExitResponse(BaseModel): + # The process exit code (may be null if terminated by signal). + exit_code: Annotated[ Optional[int], Field( - alias="lastFocusedMs", - description="Timestamp in milliseconds since epoch of when the file was last focused.", + alias="exitCode", + description="The process exit code (may be null if terminated by signal).", ge=0, ), ] = None - # 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."), + # 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 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 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): # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3017,38 +2529,9 @@ 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, - Field(description="The working directory for this session. Must be an absolute path."), - ] - # List of MCP (Model Context Protocol) servers the agent should connect to. - mcp_servers: Annotated[ - List[Union[HttpMcpServer, SseMcpServer, McpServerStdio]], - Field( - alias="mcpServers", - description="List of MCP (Model Context Protocol) servers the agent should connect to.", - ), - ] -class PermissionOption(BaseModel): +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 # these keys. @@ -3061,21 +2544,25 @@ class PermissionOption(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 - # Hint about the nature of this permission option. - kind: Annotated[PermissionOptionKind, Field(description="Hint about the nature of this permission option.")] - # Human-readable label to display to the user. - name: Annotated[str, Field(description="Human-readable label to display to the user.")] - # Unique identifier for this permission option. - option_id: Annotated[ - str, + + +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="optionId", - description="Unique identifier for this permission option.", + 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 PlanEntry(BaseModel): +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. @@ -3088,24 +2575,49 @@ class PlanEntry(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 description of what this task aims to accomplish. + action: Literal["cancel"] + + +class ElicitationContentValue(RootModel[Union[str, int, float, bool, List[str]]]): + # Allowed wire representations for [`ElicitationContentValue`]. + root: Annotated[ + Union[str, int, float, bool, List[str]], + Field(description="Allowed wire representations for [`ElicitationContentValue`]."), + ] + + +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 ConnectMcpResponse(BaseModel): + # The unique identifier for this MCP-over-ACP connection. + connection_id: Annotated[ str, - Field(description="Human-readable description of what this task aims to accomplish."), - ] - # The relative importance of this task. - # Used to indicate which tasks are most critical to the overall goal. - priority: Annotated[ - PlanEntryPriority, Field( - description="The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal." + alias="connectionId", + description="The unique identifier for this MCP-over-ACP connection.", ), ] - # Current execution status of this task. - status: Annotated[PlanEntryStatus, Field(description="Current execution status of this task.")] + # The _meta property is reserved 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 PromptResponse(BaseModel): +class DisconnectMcpResponse(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. @@ -3118,44 +2630,51 @@ class PromptResponse(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 - # Indicates why the agent stopped processing the turn. - stop_reason: Annotated[ - StopReason, + + +class CancelNotification(BaseModel): + # The ID of the session to cancel operations for. + session_id: Annotated[ + str, Field( - alias="stopReason", - description="Indicates why the agent stopped processing the turn.", + alias="sessionId", + description="The ID of the session to cancel operations for.", ), ] - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. - # - # Token usage for this turn (optional). - usage: Annotated[ - Optional[Usage], - Field( - 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)." - ), - ] = None - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. - # - # The acknowledged user message ID. + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. # - # If the client provided a `messageId` in the [`PromptRequest`], the agent echoes it here - # to confirm it was recorded. If the client did not provide one, the agent MAY assign one - # and return it here. Absence of this field indicates the agent did not record a message ID. - user_message_id: Annotated[ - Optional[str], + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], Field( - alias="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.", + 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 ReadTextFileRequest(BaseModel): +class DidOpenDocumentNotification(BaseModel): + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + # The URI of the opened document. + uri: Annotated[str, Field(description="The URI of the opened document.")] + # 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 version number of the document. + version: Annotated[int, Field(description="The version number of the document.")] + # The full text content of the document. + text: Annotated[str, Field(description="The full text content of the document.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3168,20 +2687,16 @@ class ReadTextFileRequest(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 lines to read. - limit: Annotated[Optional[int], Field(description="Maximum number of lines to read.", ge=0)] = None - # Line number to start reading from (1-based). - line: Annotated[ - Optional[int], - Field(description="Line number to start reading from (1-based).", ge=0), - ] = None - # Absolute path to the file to read. - path: Annotated[str, Field(description="Absolute path to the file to read.")] - # The session ID for this request. - session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] -class RejectNesNotification(BaseModel): +class DidCloseDocumentNotification(BaseModel): + # 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.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3194,18 +2709,16 @@ class RejectNesNotification(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 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 + + +class DidSaveDocumentNotification(BaseModel): # The session ID for this notification. session_id: Annotated[ str, Field(alias="sessionId", description="The session ID for this notification."), ] - - -class ReleaseTerminalRequest(BaseModel): + # The URI of the saved document. + uri: Annotated[str, Field(description="The URI of the saved document.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3218,17 +2731,16 @@ class ReleaseTerminalRequest(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 release. - terminal_id: Annotated[str, Field(alias="terminalId", description="The ID of the terminal to release.")] - - -class AllowedOutcome(SelectedPermissionOutcome): - outcome: Literal["selected"] -class RequestPermissionResponse(BaseModel): +class AcceptNesNotification(BaseModel): + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + # The ID of the accepted suggestion. + id: Annotated[str, Field(description="The ID of the accepted suggestion.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3241,17 +2753,14 @@ class RequestPermissionResponse(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 user's decision on the permission request. - outcome: Annotated[ - Union[DeniedOutcome, AllowedOutcome], - Field( - description="The user's decision on the permission request.", - discriminator="outcome", - ), - ] -class ResourceLink(BaseModel): +class CancelRequestNotification(BaseModel): + # 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."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3264,16 +2773,15 @@ class ResourceLink(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 - description: Optional[str] = None - mime_type: Annotated[Optional[str], Field(alias="mimeType")] = None - name: str - size: Optional[int] = None - title: Optional[str] = None - uri: str -class ResumeSessionRequest(BaseModel): +class WriteTextFileRequest(BaseModel): + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # Absolute path to the file to write. + path: Annotated[str, Field(description="Absolute path to the file to write.")] + # The text content to write to the file. + content: Annotated[str, Field(description="The text content to write to the file.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3286,37 +2794,57 @@ 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[ + + +class FileEditToolCallContent(Diff): + type: Literal["diff"] + + +class TerminalToolCallContent(Terminal): + type: Literal["terminal"] + + +class Annotations(BaseModel): + # Intended recipients for this content, such as the user or assistant. + audience: Annotated[ Optional[List[str]], + Field(description="Intended recipients for this content, such as the user or assistant."), + ] = None + # Timestamp indicating when the underlying resource was last modified. + last_modified: Annotated[ + Optional[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.", + alias="lastModified", + description="Timestamp indicating when the underlying resource was last modified.", ), ] = 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. - mcp_servers: Annotated[ - Optional[List[Union[HttpMcpServer, SseMcpServer, McpServerStdio]]], + # Relative importance of this content when clients choose what to surface. + priority: Annotated[ + Optional[float], + Field(description="Relative importance of this content when clients choose what to surface."), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], Field( - alias="mcpServers", - description="List of MCP servers to connect to for this session.", + 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 resume. - session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to resume.")] -class SessionCapabilities(BaseModel): +class TextContent(BaseModel): + # Optional annotations that help clients decide how to display or route this content. + annotations: Annotated[ + Optional[Annotations], + Field(description="Optional annotations that help clients decide how to display or route this content."), + ] = None + # Text payload carried by this content block. + text: Annotated[str, Field(description="Text payload carried by this content block.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3329,47 +2857,59 @@ class SessionCapabilities(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. - # - # Whether the agent supports `additionalDirectories` on supported session lifecycle requests and `session/list`. - additional_directories: Annotated[ - Optional[SessionAdditionalDirectoriesCapabilities], + + +class ImageContent(BaseModel): + # Optional annotations that help clients decide how to display or route this content. + annotations: Annotated[ + Optional[Annotations], + Field(description="Optional annotations that help clients decide how to display or route this content."), + ] = None + # Base64-encoded media payload. + data: Annotated[str, Field(description="Base64-encoded media payload.")] + # MIME type describing the encoded media payload. + mime_type: Annotated[ + 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\nWhether the agent supports `additionalDirectories` on supported session lifecycle requests and `session/list`.", + alias="mimeType", + description="MIME type describing the encoded media payload.", ), + ] + # URI associated with this resource or media payload. + uri: Annotated[ + Optional[str], + Field(description="URI associated with this resource or media payload."), ] = None - # Whether the agent supports `session/close`. - close: Annotated[ - Optional[SessionCloseCapabilities], - Field(description="Whether the agent supports `session/close`."), - ] = None - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. # - # Whether the agent supports `session/fork`. - fork: Annotated[ - Optional[SessionForkCapabilities], + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], 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/fork`." + 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 `session/list`. - list: Annotated[ - Optional[SessionListCapabilities], - Field(description="Whether the agent supports `session/list`."), - ] = None - # Whether the agent supports `session/resume`. - resume: Annotated[ - Optional[SessionResumeCapabilities], - Field(description="Whether the agent supports `session/resume`."), - ] = None -class SessionConfigOptionBoolean(SessionConfigBoolean): +class AudioContent(BaseModel): + # Optional annotations that help clients decide how to display or route this content. + annotations: Annotated[ + Optional[Annotations], + Field(description="Optional annotations that help clients decide how to display or route this content."), + ] = None + # Base64-encoded media payload. + data: Annotated[str, Field(description="Base64-encoded media payload.")] + # MIME type describing the encoded media payload. + mime_type: Annotated[ + str, + Field( + alias="mimeType", + description="MIME type describing the encoded media payload.", + ), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3382,24 +2922,38 @@ class SessionConfigOptionBoolean(SessionConfigBoolean): description="The _meta property is reserved by ACP to allow clients and agents to attach 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 semantic category for this option (UX only). - category: Annotated[ - Optional[str], - Field(description="Optional semantic category for this option (UX only)."), + + +class ResourceLink(BaseModel): + # Optional annotations that help clients decide how to display or route this content. + annotations: Annotated[ + Optional[Annotations], + Field(description="Optional annotations that help clients decide how to display or route this content."), ] = None - # Optional description for the Client to display to the user. + # Optional human-readable details shown with this protocol object. description: Annotated[ Optional[str], - Field(description="Optional description for the Client to display to the user."), + Field(description="Optional human-readable details shown with this protocol object."), ] = None - # Unique identifier for the configuration option. - id: Annotated[str, Field(description="Unique identifier for the configuration option.")] - # Human-readable label for the option. - name: Annotated[str, Field(description="Human-readable label for the option.")] - type: Literal["boolean"] - - -class SessionConfigSelectOption(BaseModel): + # MIME type describing the encoded media payload. + mime_type: Annotated[ + Optional[str], + Field( + alias="mimeType", + description="MIME type describing the encoded media payload.", + ), + ] = None + # Human-readable name shown for this protocol object. + name: Annotated[str, Field(description="Human-readable name shown for this protocol object.")] + # Optional size of the linked resource in bytes, if known. + size: Annotated[ + Optional[int], + Field(description="Optional size of the linked resource in bytes, if known."), + ] = None + # Optional display title for end-user UI. + title: Annotated[Optional[str], Field(description="Optional display title for end-user UI.")] = None + # URI associated with this resource or media payload. + uri: Annotated[str, Field(description="URI associated with this resource or media payload.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3412,15 +2966,19 @@ class SessionConfigSelectOption(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 description for this option value. - description: Annotated[Optional[str], Field(description="Optional description for this option value.")] = None - # Human-readable label for this option value. - name: Annotated[str, Field(description="Human-readable label for this option value.")] - # Unique identifier for this option value. - value: Annotated[str, Field(description="Unique identifier for this option value.")] -class SessionMode(BaseModel): +class EmbeddedResource(BaseModel): + # Optional annotations that help clients decide how to display or route this content. + annotations: Annotated[ + Optional[Annotations], + Field(description="Optional annotations that help clients decide how to display or route this content."), + ] = None + # Embedded resource payload, either text or binary data. + resource: Annotated[ + Union[TextResourceContents, BlobResourceContents], + Field(description="Embedded resource payload, either text or binary data."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3433,13 +2991,21 @@ class SessionMode(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 - description: Optional[str] = None - # Unique identifier for a Session Mode. - id: Annotated[str, Field(description="Unique identifier for a Session Mode.")] - name: str -class SessionModeState(BaseModel): +class PermissionOption(BaseModel): + # Unique identifier for this permission option. + option_id: Annotated[ + str, + Field( + alias="optionId", + description="Unique identifier for this permission option.", + ), + ] + # Human-readable label to display to the user. + name: Annotated[str, Field(description="Human-readable label to display to the user.")] + # Hint about the nature of this permission option. + kind: Annotated[PermissionOptionKind, Field(description="Hint about the nature of this permission option.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3452,30 +3018,41 @@ class SessionModeState(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 modes that the Agent can operate in - available_modes: Annotated[ - List[SessionMode], - Field( - alias="availableModes", - description="The set of modes that the Agent can operate in", - ), - ] - # The current mode the Agent is in. - current_mode_id: Annotated[ - str, - Field(alias="currentModeId", description="The current mode the Agent is in."), - ] - - -class CurrentModeUpdate(_CurrentModeUpdate): - session_update: Annotated[Literal["current_mode_update"], Field(alias="sessionUpdate")] - - -class UsageUpdate(_UsageUpdate): - session_update: Annotated[Literal["usage_update"], Field(alias="sessionUpdate")] -class StartNesRequest(BaseModel): +class CreateTerminalRequest(BaseModel): + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # The command to execute. + command: Annotated[str, Field(description="The command to execute.")] + # Array of command arguments. + args: Annotated[Optional[List[str]], Field(description="Array of command arguments.")] = None + # Environment variables for the command. + env: Annotated[ + Optional[List[EnvVariable]], + Field(description="Environment variables for the command."), + ] = None + # Working directory for the command (absolute path). + cwd: Annotated[ + Optional[str], + Field(description="Working directory for the command (absolute path)."), + ] = 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 _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3488,24 +3065,14 @@ class StartNesRequest(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 - # 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 TextContent(BaseModel): +class CreateUrlSessionElicitationRequest(ElicitationSessionScope): + # A human-readable message describing what input is needed. + message: Annotated[ + str, + Field(description="A human-readable message describing what input is needed."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3518,30 +3085,25 @@ 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 - - -class AgentErrorMessage(BaseModel): - error: Error - # JSON RPC Request Id - # - # An 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] - # - # The 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. - # - # [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. - # - # [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - id: Annotated[ - Optional[Union[int, str]], + mode: Literal["url"] + # The unique identifier for this elicitation. + elicitation_id: Annotated[ + str, Field( - 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." + alias="elicitationId", + description="The unique identifier for this elicitation.", ), - ] = None + ] + # The URL to direct the user to. + url: Annotated[AnyUrl, Field(description="The URL to direct the user to.")] -class AvailableCommand(BaseModel): +class CreateUrlRequestElicitationRequest(ElicitationRequestScope): + # A human-readable message describing what input is needed. + message: Annotated[ + str, + Field(description="A human-readable message describing what input is needed."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3554,21 +3116,40 @@ class AvailableCommand(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 description of what the command does. - description: Annotated[str, Field(description="Human-readable description of what the command does.")] - # Input for the command if required - input: Annotated[ - Optional[AvailableCommandInput], - Field(description="Input for the command if required"), - ] = None - # Command name (e.g., `create_plan`, `research_codebase`). - name: Annotated[ + mode: Literal["url"] + # The unique identifier for this elicitation. + elicitation_id: Annotated[ str, - Field(description="Command name (e.g., `create_plan`, `research_codebase`)."), + 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 _AvailableCommandsUpdate(BaseModel): +class ElicitationStringPropertySchema(StringPropertySchema): + type: Literal["string"] + + +class ElicitationNumberPropertySchema(NumberPropertySchema): + type: Literal["number"] + + +class ElicitationIntegerPropertySchema(IntegerPropertySchema): + type: Literal["integer"] + + +class ElicitationBooleanPropertySchema(BooleanPropertySchema): + type: Literal["boolean"] + + +class UntitledMultiSelectItems(BaseModel): + # Item type discriminator. Must be `"string"`. + type: Annotated[str, Field(description='Item type discriminator. Must be `"string"`.')] + # Allowed enum values. + enum: Annotated[List[str], Field(description="Allowed enum values.")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3581,14 +3162,17 @@ class _AvailableCommandsUpdate(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 - # Commands the agent can execute - available_commands: Annotated[ - List[AvailableCommand], - Field(alias="availableCommands", description="Commands the agent can execute"), - ] -class ClientCapabilities(BaseModel): +class ConnectMcpRequest(BaseModel): + # The ACP MCP server ID that was provided by the component declaring the MCP server. + acp_id: Annotated[ + str, + Field( + alias="acpId", + description="The ACP MCP server ID that was provided by the component declaring the MCP server.", + ), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3601,167 +3185,91 @@ 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], + + +class MessageMcpRequest(BaseModel): + # The MCP-over-ACP connection this message is sent on. + connection_id: Annotated[ + str, 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`." + alias="connectionId", + description="The MCP-over-ACP connection this message is sent on.", ), - ] = {"terminal": False} - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. + ] + # The inner MCP method name. + method: Annotated[str, Field(description="The inner MCP method name.")] + # Optional inner MCP params. # - # Elicitation capabilities supported by the client. - # Determines which elicitation modes the agent may use. - elicitation: Annotated[ - Optional[ElicitationCapabilities], + # If omitted or set to `null`, the inner MCP message has no params. + params: Annotated[ + Optional[Dict[str, Any]], 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." + description="Optional inner MCP params.\n\nIf omitted or set to `null`, the inner MCP message has no params." ), ] = 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 _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. # - # The position encodings supported by the client, in order of preference. - position_encodings: Annotated[ - Optional[List[str]], + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], 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.", + 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 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, - ] +class SessionCapabilities(BaseModel): + # Whether the agent supports `session/list`. + list: Annotated[ + Optional[SessionListCapabilities], + Field(description="Whether the agent supports `session/list`."), ] = None - - -class ClientResponseMessage(BaseModel): - # JSON RPC Request Id - # - # An 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] + # Whether the agent supports `session/delete`. # - # The 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. - # - # [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. - # - # [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - id: Annotated[ - Optional[Union[int, str]], + # Optional. Omitted or `null` both mean the agent does not advertise support. + # Supplying `{}` means the agent supports deleting sessions from `session/list`. + delete: Annotated[ + Optional[SessionDeleteCapabilities], Field( - description="JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + description="Whether the agent supports `session/delete`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports deleting sessions from `session/list`." ), ] = None - # All possible responses that a client can send to an agent. + # Whether the agent supports `additionalDirectories` on supported session lifecycle requests. # - # This enum is used internally for routing RPC responses. You typically won't need - # to use this directly - the responses are handled automatically by the connection. - # - # These are responses to the corresponding `AgentRequest` variants. - result: Annotated[ - Union[ - WriteTextFileResponse, - ReadTextFileResponse, - RequestPermissionResponse, - CreateTerminalResponse, - TerminalOutputResponse, - ReleaseTerminalResponse, - WaitForTerminalExitResponse, - KillTerminalResponse, - Union[ - AcceptElicitationResponse, - DeclineElicitationResponse, - CancelElicitationResponse, - ], - Any, - ], + # Agents that also support `session/list` may return + # `SessionInfo.additionalDirectories` to report the complete ordered + # additional-root list associated with a listed session. + additional_directories: Annotated[ + Optional[SessionAdditionalDirectoriesCapabilities], Field( - description="All possible responses that a client can send to an agent.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `AgentRequest` variants." + alias="additionalDirectories", + description="Whether the agent supports `additionalDirectories` on supported session lifecycle requests.\n\nAgents that also support `session/list` may return\n`SessionInfo.additionalDirectories` to report the complete ordered\nadditional-root list associated with a listed session.", ), - ] - - -class ClientErrorMessage(BaseModel): - error: Error - # JSON RPC Request Id - # - # An 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] - # - # The 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. + ] = None + # **UNSTABLE** # - # [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. + # This capability is not part of the spec yet, and may be removed or changed at any point. # - # [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - id: Annotated[ - Optional[Union[int, str]], + # Whether the agent supports `session/fork`. + fork: Annotated[ + Optional[SessionForkCapabilities], Field( - description="JSON RPC Request Id\n\nAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]\n\nThe Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.\n\n[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.\n\n[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions." + description="**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`." ), ] = None - - -class ClientResponse(RootModel[Union[ClientResponseMessage, ClientErrorMessage]]): - root: Union[ClientResponseMessage, ClientErrorMessage] - - -class TextContentBlock(TextContent): - type: Literal["text"] - - -class ImageContentBlock(ImageContent): - type: Literal["image"] - - -class ResourceContentBlock(ResourceLink): - type: Literal["resource_link"] - - -class CreateUrlElicitationRequest(BaseModel): + # Whether the agent supports `session/resume`. + resume: Annotated[ + Optional[SessionResumeCapabilities], + Field(description="Whether the agent supports `session/resume`."), + ] = None + # Whether the agent supports `session/close`. + close: Annotated[ + Optional[SessionCloseCapabilities], + Field(description="Whether the agent supports `session/close`."), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3774,49 +3282,18 @@ class CreateUrlElicitationRequest(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 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."), +class AgentAuthCapabilities(BaseModel): + # 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 - # 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 # these keys. @@ -3829,15 +3306,17 @@ class EmbeddedResource(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 - # Resource content that can be embedded in a message. - resource: Annotated[ - Union[TextResourceContents, BlobResourceContents], - Field(description="Resource content that can be embedded in a message."), - ] -class ForkSessionRequest(BaseModel): +class NesDocumentDidChangeCapabilities(BaseModel): + # 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"`.', + ), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3850,37 +3329,51 @@ 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]], + + +class NesContextCapabilities(BaseModel): + # Whether the agent wants recent files context. + recent_files: Annotated[ + Optional[NesRecentFilesCapabilities], 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.", + alias="recentFiles", + description="Whether the agent wants recent files context.", ), ] = 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. - mcp_servers: Annotated[ - Optional[List[Union[HttpMcpServer, SseMcpServer, McpServerStdio]]], + # Whether the agent wants related snippets context. + related_snippets: Annotated[ + Optional[NesRelatedSnippetsCapabilities], Field( - alias="mcpServers", - description="List of MCP servers to connect to for this session.", + alias="relatedSnippets", + description="Whether the agent wants related snippets context.", ), ] = None - # The ID of the session to fork. - session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to fork.")] - - -class InitializeRequest(BaseModel): + # 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 user actions context. + user_actions: Annotated[ + Optional[NesUserActionsCapabilities], + Field( + alias="userActions", + description="Whether the agent wants user actions 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 diagnostics context. + diagnostics: Annotated[ + Optional[NesDiagnosticsCapabilities], + Field(description="Whether the agent wants diagnostics context."), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3893,51 +3386,35 @@ 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], - Field( - alias="clientCapabilities", - description="Capabilities supported by 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. - client_info: Annotated[ - Optional[Implementation], - 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.", - ), - ] = None - # The latest protocol version supported by the client. - protocol_version: Annotated[ - int, - Field( - alias="protocolVersion", - description="The latest protocol version supported by the client.", - ge=0, - le=65535, - ), - ] - @field_validator("protocol_version", mode="before") - @classmethod - def _coerce_protocol_version(cls, value: Any) -> int: - # Some clients (e.g. Zed) send a date string like "2024-11-05" instead - # of an integer. The Rust SDK treats legacy strings as version 0; this - # SDK maps unparsable values to 1 so the connection is not rejected. - # See: https://github.com/agentclientprotocol/rust-sdk/blob/main/crates/agent-client-protocol-schema/src/version.rs - if isinstance(value, int): - return value - try: - return int(value) - except (TypeError, ValueError): - return 1 +class EnvVarAuthMethod(AuthMethodEnvVar): + type: Literal["env_var"] -class LoadSessionRequest(BaseModel): + +class TerminalAuthMethod(AuthMethodTerminal): + type: Literal["terminal"] + + +class ProviderInfo(BaseModel): + # Provider identifier, for example "main" or "openai". + id: Annotated[str, Field(description='Provider identifier, for example "main" or "openai".')] + # Supported protocol types for this provider. + supported: Annotated[List[str], Field(description="Supported protocol types for this provider.")] + # 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." + ), + ] + # 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 # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -3950,37 +3427,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. - mcp_servers: Annotated[ - List[Union[HttpMcpServer, SseMcpServer, McpServerStdio]], + + +class SessionModeState(BaseModel): + # The current mode the Agent is in. + current_mode_id: Annotated[ + str, + Field(alias="currentModeId", description="The current mode the Agent is in."), + ] + # The set of modes that the Agent can operate in + available_modes: Annotated[ + List[SessionMode], Field( - alias="mcpServers", - description="List of MCP servers to connect to for this session.", + alias="availableModes", + description="The set of modes that the Agent can operate in", ), ] - # The ID of the session to load. - 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. @@ -3993,36 +3455,48 @@ class NesCapabilities(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 - # 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], +class SessionConfigOptionBoolean(SessionConfigBoolean): + # Unique identifier for the configuration option. + id: Annotated[str, Field(description="Unique identifier for the configuration option.")] + # Human-readable label for the option. + name: Annotated[str, Field(description="Human-readable label for the option.")] + # Optional description for the Client to display to the user. + description: Annotated[ + Optional[str], + Field(description="Optional description for the Client to display to the user."), + ] = None + # Optional semantic category for this option (UX only). + category: Annotated[ + Optional[str], + Field(description="Optional semantic category for this option (UX only)."), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], Field( - alias="cursorPosition", - description="Optional suggested cursor position after applying edits.", + 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 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.")] + type: Literal["boolean"] -class NesSuggestContext(BaseModel): +class SessionConfigSelectGroup(BaseModel): + # Unique identifier for this group. + group: Annotated[str, Field(description="Unique identifier for this group.")] + # Human-readable label for this group. + name: Annotated[str, Field(description="Human-readable label for this group.")] + # The set of option values in this group. + options: Annotated[ + List[SessionConfigSelectOption], + Field(description="The set of option values in this group."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4035,46 +3509,20 @@ class NesSuggestContext(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 - # 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]], + + +class ListSessionsResponse(BaseModel): + # Array of session information objects + sessions: Annotated[List[SessionInfo], Field(description="Array of session information objects")] + # 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="userActions", - description="Recent user actions (typing, navigation, etc.).", + 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 - - -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 # these keys. @@ -4087,19 +3535,28 @@ class Plan(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 list of tasks to be accomplished. - # - # When updating a plan, the agent must send a complete list of all entries - # with their current status. The client replaces the entire plan with each update. - entries: Annotated[ - List[PlanEntry], + + +class PromptResponse(BaseModel): + # Indicates why the agent stopped processing the turn. + stop_reason: Annotated[ + StopReason, Field( - 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." + alias="stopReason", + description="Indicates why the agent stopped processing the turn.", ), ] - - -class SessionConfigSelectGroup(BaseModel): + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Token usage for this turn (optional). + usage: Annotated[ + Optional[Usage], + Field( + 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)." + ), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4112,26 +3569,25 @@ class SessionConfigSelectGroup(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 - # Unique identifier for this group. - group: Annotated[str, Field(description="Unique identifier for this group.")] - # Human-readable label for this group. - name: Annotated[str, Field(description="Human-readable label for this group.")] - # The set of option values in this group. - options: Annotated[ - List[SessionConfigSelectOption], - Field(description="The set of option values in this group."), - ] -class AgentPlanUpdate(Plan): - session_update: Annotated[Literal["plan"], Field(alias="sessionUpdate")] +class NesJumpSuggestionVariant(NesJumpSuggestion): + kind: Literal["jump"] -class AvailableCommandsUpdate(_AvailableCommandsUpdate): - session_update: Annotated[Literal["available_commands_update"], Field(alias="sessionUpdate")] +class NesRenameSuggestionVariant(NesRenameSuggestion): + kind: Literal["rename"] -class SuggestNesRequest(BaseModel): +class NesSearchAndReplaceSuggestionVariant(NesSearchAndReplaceSuggestion): + kind: Literal["searchAndReplace"] + + +class Range(BaseModel): + # The start position (inclusive). + start: Annotated[Position, Field(description="The start position (inclusive).")] + # The end position (exclusive). + end: Annotated[Position, Field(description="The end position (exclusive).")] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4144,29 +3600,1406 @@ class SuggestNesRequest(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 - # Context for the suggestion, included based on agent capabilities. - context: Annotated[ - Optional[NesSuggestContext], - Field(description="Context for the suggestion, included based on agent capabilities."), + + +class Error(BaseModel): + # A number indicating the error type that occurred. + # This must be an integer as defined in the JSON-RPC specification. + code: Annotated[ + int, + Field( + description="A number indicating the error type that occurred.\nThis must be an integer as defined in the JSON-RPC specification." + ), + ] + # A string providing a short description of the error. + # The message should be limited to a concise single sentence. + message: Annotated[ + str, + Field( + description="A string providing a short description of the error.\nThe message should be limited to a concise single sentence." + ), + ] + # Optional primitive or structured value that contains additional information about the error. + # This may include debugging information or context-specific details. + data: Annotated[ + Optional[Any], + Field( + description="Optional primitive or structured value that contains additional information about the error.\nThis may include debugging information or context-specific details." + ), + ] = None + + +class AgentPlanRemovedUpdate(PlanRemoved): + session_update: Annotated[Literal["plan_removed"], Field(alias="sessionUpdate")] + + +class CurrentModeUpdate(_CurrentModeUpdate): + session_update: Annotated[Literal["current_mode_update"], Field(alias="sessionUpdate")] + + +class SessionInfoUpdate(_SessionInfoUpdate): + session_update: Annotated[Literal["session_info_update"], Field(alias="sessionUpdate")] + + +class UsageUpdate(_UsageUpdate): + session_update: Annotated[Literal["usage_update"], Field(alias="sessionUpdate")] + + +class PlanEntry(BaseModel): + # Human-readable description of what this task aims to accomplish. + content: Annotated[ + str, + Field(description="Human-readable description of what this task aims to accomplish."), + ] + # The relative importance of this task. + # Used to indicate which tasks are most critical to the overall goal. + priority: Annotated[ + PlanEntryPriority, + Field( + description="The relative importance of this task.\nUsed to indicate which tasks are most critical to the overall goal." + ), + ] + # Current execution status of this task. + status: Annotated[PlanEntryStatus, Field(description="Current execution status of this task.")] + # The _meta property is reserved 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 Plan(BaseModel): + # The list of tasks to be accomplished. + # + # When updating a plan, the agent must send a complete list of all entries + # with their current status. The client replaces the entire plan with each update. + entries: Annotated[ + List[PlanEntry], + Field( + 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." + ), + ] + # The _meta property is reserved 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 PlanUpdateFile(PlanFile): + type: Literal["file"] + + +class PlanUpdateMarkdown(PlanMarkdown): + type: Literal["markdown"] + + +class PlanItems(BaseModel): + # The plan ID to update. + id: Annotated[str, Field(description="The plan ID to update.")] + # The list of tasks to be accomplished. + # + # When updating an item-based plan, the agent must send a complete list of all entries + # with their current status. The client replaces that plan with each update. + entries: Annotated[ + List[PlanEntry], + Field( + description="The list of tasks to be accomplished.\n\nWhen updating an item-based plan, the agent must send a complete list of all entries\nwith their current status. The client replaces that plan with each update." + ), + ] + # The _meta property is reserved 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 AvailableCommandInput(RootModel[UnstructuredCommandInput]): + # The input specification for a command. + root: Annotated[ + UnstructuredCommandInput, + Field(description="The input specification for a command."), + ] + + +class SessionConfigOptionsCapabilities(BaseModel): + # Whether the client supports boolean session configuration options. + # + # Omitted or `null` means the client does not advertise support. + # Supplying `{}` means agents may include `type: "boolean"` entries in + # `configOptions`, and the client may send `session/set_config_option` + # requests with `type: "boolean"` and a boolean `value`. + boolean: Annotated[ + Optional[BooleanConfigOptionCapabilities], + Field( + description='Whether the client supports boolean session configuration options.\n\nOmitted or `null` means the client does not advertise support.\nSupplying `{}` means agents may include `type: "boolean"` entries in\n`configOptions`, and the client may send `session/set_config_option`\nrequests with `type: "boolean"` and a boolean `value`.' + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 ElicitationCapabilities(BaseModel): + # 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 + # The _meta property is reserved 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 ClientNesCapabilities(BaseModel): + # 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 + # The _meta property is reserved 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 HttpMcpServer(McpServerHttp): + type: Literal["http"] + + +class SseMcpServer(McpServerSse): + type: Literal["sse"] + + +class AcpMcpServer(McpServerAcp): + type: Literal["acp"] + + +class LoadSessionRequest(BaseModel): + # List of MCP servers to connect to for this session. + mcp_servers: Annotated[ + List[Union[HttpMcpServer, SseMcpServer, AcpMcpServer, McpServerStdio]], + Field( + alias="mcpServers", + description="List of MCP servers to connect to for this session.", + ), + ] + # The working directory for this session. + cwd: Annotated[str, Field(description="The working directory for this session.")] + # 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. It may differ from any previously used or reported list as long as + # the request `cwd` matches the session's `cwd`. + additional_directories: Annotated[ + Optional[List[str]], + Field( + alias="additionalDirectories", + description="Additional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the loaded\nsession. It may differ from any previously used or reported list as long as\nthe request `cwd` matches the session's `cwd`.", + ), + ] = None + # The ID of the session to load. + session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to load.")] + # The _meta property is reserved 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 ForkSessionRequest(BaseModel): + # The ID of the session to fork. + session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to fork.")] + # The working directory for this session. + cwd: Annotated[str, Field(description="The working directory for this session.")] + # 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="Additional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the forked\nsession.", + ), + ] = None + # List of MCP servers to connect to for this session. + mcp_servers: Annotated[ + Optional[List[Union[HttpMcpServer, SseMcpServer, AcpMcpServer, McpServerStdio]]], + Field( + alias="mcpServers", + description="List of MCP servers to connect to for this session.", + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 ResumeSessionRequest(BaseModel): + # The ID of the session to resume. + session_id: Annotated[str, Field(alias="sessionId", description="The ID of the session to resume.")] + # The working directory for this session. + cwd: Annotated[str, Field(description="The working directory for this session.")] + # Additional workspace roots to activate for this session. Each path must be absolute. + # + # When omitted or empty, no additional roots are activated. When non-empty, + # this is the complete resulting additional-root list for the resumed + # session. It may differ from any previously used or reported list as long as + # the request `cwd` matches the session's `cwd`. + additional_directories: Annotated[ + Optional[List[str]], + Field( + alias="additionalDirectories", + description="Additional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the resumed\nsession. It may differ from any previously used or reported list as long as\nthe request `cwd` matches the session's `cwd`.", + ), + ] = None + # List of MCP servers to connect to for this session. + mcp_servers: Annotated[ + Optional[List[Union[HttpMcpServer, SseMcpServer, AcpMcpServer, McpServerStdio]]], + Field( + alias="mcpServers", + description="List of MCP servers to connect to for this session.", + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 StartNesRequest(BaseModel): + # The root URI of the workspace. + workspace_uri: Annotated[ + Optional[str], + Field(alias="workspaceUri", description="The root URI of the workspace."), + ] = None + # The workspace folders. + workspace_folders: Annotated[ + Optional[List[WorkspaceFolder]], + Field(alias="workspaceFolders", description="The workspace folders."), + ] = None + # 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 _meta property is reserved 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 NesRelatedSnippet(BaseModel): + # The URI of the file containing the snippets. + uri: Annotated[str, Field(description="The URI of the file containing the snippets.")] + # The code excerpts. + excerpts: Annotated[List[NesExcerpt], Field(description="The code excerpts.")] + # The _meta property is reserved 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 NesOpenFile(BaseModel): + # The URI of the file. + uri: Annotated[str, Field(description="The URI of the file.")] + # The language identifier. + language_id: Annotated[str, Field(alias="languageId", description="The language identifier.")] + # 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 + # Timestamp in milliseconds since epoch of when the file was last focused. + last_focused_ms: Annotated[ + Optional[int], + Field( + alias="lastFocusedMs", + description="Timestamp in milliseconds since epoch of when the file was last focused.", + ge=0, + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # 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 NesDiagnostic(BaseModel): + # The URI of the file containing the diagnostic. + uri: Annotated[str, Field(description="The URI of the file containing the diagnostic.")] + # 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 diagnostic message. + message: Annotated[str, Field(description="The diagnostic message.")] + # The _meta property is reserved 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 ClientErrorMessage(BaseModel): + # The id of the request this response answers. + id: Annotated[ + Optional[Union[int, str]], + Field(description="The id of the request this response answers."), + ] = None + # Method-specific error data. + error: Annotated[Error, Field(description="Method-specific error data.")] + + +class AllowedOutcome(SelectedPermissionOutcome): + outcome: Literal["selected"] + + +class TerminalOutputResponse(BaseModel): + # 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.")] + # 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 _meta property is reserved 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 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 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`."), + ] + # The _meta property is reserved 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 DidFocusDocumentNotification(BaseModel): + # 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 current cursor position. + position: Annotated[Position, Field(description="The current cursor position.")] + # 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.", + ), + ] + # The _meta property is reserved 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 RejectNesNotification(BaseModel): + # The session ID for this notification. + session_id: Annotated[ + str, + Field(alias="sessionId", description="The session ID for this notification."), + ] + # 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 _meta property is reserved 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 TextContentBlock(TextContent): + type: Literal["text"] + + +class ImageContentBlock(ImageContent): + type: Literal["image"] + + +class AudioContentBlock(AudioContent): + type: Literal["audio"] + + +class ResourceContentBlock(ResourceLink): + type: Literal["resource_link"] + + +class EmbeddedResourceContentBlock(EmbeddedResource): + type: Literal["resource"] + + +class Content(BaseModel): + # The actual content block. + content: Annotated[ + Union[ + TextContentBlock, ImageContentBlock, AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock + ], + Field(description="The actual content block.", discriminator="type"), + ] + # The _meta property is reserved 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 MultiSelectPropertySchema(BaseModel): + # Optional title for the property. + title: Annotated[Optional[str], Field(description="Optional title for the property.")] = None + # Human-readable description. + description: Annotated[Optional[str], Field(description="Human-readable description.")] = 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 + # Maximum number of items to select. + max_items: Annotated[ + Optional[int], + Field(alias="maxItems", description="Maximum number of items to select.", ge=0), + ] = None + # The items definition describing allowed values. + items: Annotated[ + Union[UntitledMultiSelectItems, TitledMultiSelectItems], + Field(description="The items definition describing allowed values."), + ] + # Default selected values. + default: Annotated[Optional[List[str]], Field(description="Default selected values.")] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 AgentErrorMessage(BaseModel): + # The id of the request this response answers. + id: Annotated[ + Optional[Union[int, str]], + Field(description="The id of the request this response answers."), + ] = None + # Method-specific error data. + error: Annotated[Error, Field(description="Method-specific error data.")] + + +class NesDocumentEventCapabilities(BaseModel): + # 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/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/didSave` events. + did_save: Annotated[ + Optional[NesDocumentDidSaveCapabilities], + Field( + alias="didSave", + description="Whether the agent wants `document/didSave` 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 + # The _meta property is reserved 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 ListProvidersResponse(BaseModel): + # 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."), + ] + # The _meta property is reserved 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 SessionConfigSelect(BaseModel): + # The currently selected value. + current_value: Annotated[str, Field(alias="currentValue", description="The currently selected value.")] + # The set of selectable options. + options: Annotated[ + Union[List[SessionConfigSelectOption], List[SessionConfigSelectGroup]], + Field(description="The set of selectable options."), + ] + + +class NesTextEdit(BaseModel): + # The range to replace. + range: Annotated[Range, Field(description="The range to replace.")] + # The replacement text. + new_text: Annotated[str, Field(alias="newText", description="The replacement text.")] + # The _meta property is reserved 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 NesEditSuggestion(BaseModel): + # 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.")] + # The text edits to apply. + edits: Annotated[List[NesTextEdit], Field(description="The text edits to apply.")] + # 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 _meta property is reserved 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 AgentPlanUpdate(Plan): + session_update: Annotated[Literal["plan"], Field(alias="sessionUpdate")] + + +class ContentChunk(BaseModel): + # A single item of content + content: Annotated[ + Union[ + TextContentBlock, ImageContentBlock, AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock + ], + Field(description="A single item of content", discriminator="type"), + ] + # A unique identifier for the message this chunk belongs to. + # + # All chunks belonging to the same message share the same `messageId`. + # A change in `messageId` indicates a new message has started. + message_id: Annotated[ + Optional[str], + Field( + alias="messageId", + description="A unique identifier for the message this chunk belongs to.\n\nAll chunks belonging to the same message share the same `messageId`.\nA change in `messageId` indicates a new message has started.", + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 PlanUpdateItems(PlanItems): + type: Literal["items"] + + +class PlanUpdate(BaseModel): + # The updated plan content. + plan: Annotated[ + Union[PlanUpdateItems, PlanUpdateFile, PlanUpdateMarkdown], + Field(description="The updated plan content.", discriminator="type"), + ] + # The _meta property is reserved 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 AvailableCommand(BaseModel): + # Command name (e.g., `create_plan`, `research_codebase`). + name: Annotated[ + str, + Field(description="Command name (e.g., `create_plan`, `research_codebase`)."), + ] + # Human-readable description of what the command does. + description: Annotated[str, Field(description="Human-readable description of what the command does.")] + # Input for the command if required + input: Annotated[ + Optional[AvailableCommandInput], + Field(description="Input for the command if required"), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 _AvailableCommandsUpdate(BaseModel): + # Commands the agent can execute + available_commands: Annotated[ + List[AvailableCommand], + Field(alias="availableCommands", description="Commands the agent can execute"), + ] + # The _meta property is reserved 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 ClientSessionCapabilities(BaseModel): + # Config option capabilities supported by the client. + # + # Omitted or `null` means the client does not advertise support for any + # config option extensions. + config_options: Annotated[ + Optional[SessionConfigOptionsCapabilities], + Field( + alias="configOptions", + description="Config option capabilities supported by the client.\n\nOmitted or `null` means the client does not advertise support for any\nconfig option extensions.", + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 NewSessionRequest(BaseModel): + # 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."), + ] + # 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="Additional 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 + # List of MCP (Model Context Protocol) servers the agent should connect to. + mcp_servers: Annotated[ + List[Union[HttpMcpServer, SseMcpServer, AcpMcpServer, McpServerStdio]], + Field( + alias="mcpServers", + description="List of MCP (Model Context Protocol) servers the agent should connect to.", + ), + ] + # The _meta property is reserved 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 PromptRequest(BaseModel): + # The ID of the session to send this user message to + session_id: Annotated[ + str, + Field( + alias="sessionId", + description="The ID of the session to send this user message to", + ), + ] + # The blocks of content that compose the user's message. + # + # As a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`], + # while other variants are optionally enabled via [`PromptCapabilities`]. + # + # The Client MUST adapt its interface according to [`PromptCapabilities`]. + # + # The client MAY include referenced pieces of context as either + # [`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`]. + # + # When available, [`ContentBlock::Resource`] is preferred + # as it avoids extra round-trips and allows the message to include + # pieces of context from sources the agent may not have access to. + prompt: Annotated[ + List[ + Union[ + TextContentBlock, + ImageContentBlock, + AudioContentBlock, + ResourceContentBlock, + EmbeddedResourceContentBlock, + ] + ], + Field( + 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." + ), + ] + # The _meta property is reserved 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 NesSuggestContext(BaseModel): + # 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 edit history. + edit_history: Annotated[ + Optional[List[NesEditHistoryEntry]], + Field(alias="editHistory", description="Recent edit history."), + ] = None + # Recent user actions (typing, navigation, etc.). + user_actions: Annotated[ + Optional[List[NesUserAction]], + Field( + alias="userActions", + description="Recent user actions (typing, navigation, etc.).", + ), + ] = None + # Currently open files in the editor. + open_files: Annotated[ + Optional[List[NesOpenFile]], + Field(alias="openFiles", description="Currently open files in the editor."), + ] = None + # Current diagnostics (errors, warnings). + diagnostics: Annotated[ + Optional[List[NesDiagnostic]], + Field(description="Current diagnostics (errors, warnings)."), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 RequestPermissionResponse(BaseModel): + # The user's decision on the permission request. + outcome: Annotated[ + Union[DeniedOutcome, AllowedOutcome], + Field( + description="The user's decision on the permission request.", + discriminator="outcome", + ), + ] + # The _meta property is reserved 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 DidChangeDocumentNotification(BaseModel): + # 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.")] + # The content changes. + content_changes: Annotated[ + List[TextDocumentContentChangeEvent], + Field(alias="contentChanges", description="The content changes."), + ] + # The _meta property is reserved 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 ContentToolCallContent(Content): + type: Literal["content"] + + +class ElicitationMultiSelectPropertySchema(MultiSelectPropertySchema): + type: Literal["array"] + + +class NesEventCapabilities(BaseModel): + # Document event capabilities. + document: Annotated[ + Optional[NesDocumentEventCapabilities], + Field(description="Document event 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[ + # The _meta property is reserved 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 SessionConfigOptionSelect(SessionConfigSelect): + # Unique identifier for the configuration option. + id: Annotated[str, Field(description="Unique identifier for the configuration option.")] + # Human-readable label for the option. + name: Annotated[str, Field(description="Human-readable label for the option.")] + # Optional description for the Client to display to the user. + description: Annotated[ + Optional[str], + Field(description="Optional description for the Client to display to the user."), + ] = None + # Optional semantic category for this option (UX only). + category: Annotated[ + Optional[str], + Field(description="Optional semantic category for this option (UX only)."), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 + type: Literal["select"] + + +class LoadSessionResponse(BaseModel): + # Initial mode state if supported by the Agent + # + # See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) + modes: Annotated[ + Optional[SessionModeState], + Field( + description="Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + ), + ] = None + # Initial session configuration options if supported by the Agent. + config_options: Annotated[ + Optional[List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]]], + Field( + alias="configOptions", + description="Initial session configuration options if supported by the Agent.", + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 ForkSessionResponse(BaseModel): + # Unique identifier for the newly created forked session. + session_id: Annotated[ str, - Field(alias="triggerKind", description="What triggered this suggestion request."), + Field( + alias="sessionId", + description="Unique identifier for the newly created forked session.", + ), ] - # 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.")] + # Initial mode state if supported by the Agent + # + # See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) + modes: Annotated[ + Optional[SessionModeState], + Field( + description="Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + ), + ] = None + # Initial session configuration options if supported by the Agent. + config_options: Annotated[ + Optional[List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]]], + Field( + alias="configOptions", + description="Initial session configuration options if supported by the Agent.", + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 SuggestNesResponse(BaseModel): +class ResumeSessionResponse(BaseModel): + # Initial mode state if supported by the Agent + # + # See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) + modes: Annotated[ + Optional[SessionModeState], + Field( + description="Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + ), + ] = None + # Initial session configuration options if supported by the Agent. + config_options: Annotated[ + Optional[List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]]], + Field( + alias="configOptions", + description="Initial session configuration options if supported by the Agent.", + ), + ] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 SetSessionConfigOptionResponse(BaseModel): + # The full set of configuration options and their current values. + config_options: Annotated[ + List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]], + Field( + alias="configOptions", + description="The full set of configuration options and their current values.", + ), + ] + # The _meta property is reserved 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 NesEditSuggestionVariant(NesEditSuggestion): + kind: Literal["edit"] + + +class UserMessageChunk(ContentChunk): + session_update: Annotated[Literal["user_message_chunk"], Field(alias="sessionUpdate")] + + +class AgentMessageChunk(ContentChunk): + session_update: Annotated[Literal["agent_message_chunk"], Field(alias="sessionUpdate")] + + +class AgentThoughtChunk(ContentChunk): + session_update: Annotated[Literal["agent_thought_chunk"], Field(alias="sessionUpdate")] + + +class AgentPlanContentUpdate(PlanUpdate): + session_update: Annotated[Literal["plan_update"], Field(alias="sessionUpdate")] + + +class AvailableCommandsUpdate(_AvailableCommandsUpdate): + session_update: Annotated[Literal["available_commands_update"], Field(alias="sessionUpdate")] + + +class ToolCall(BaseModel): + # Unique identifier for this tool call within the session. + tool_call_id: Annotated[ + str, + Field( + alias="toolCallId", + description="Unique identifier for this tool call within the session.", + ), + ] + # Human-readable title describing what the tool is doing. + title: Annotated[ + str, + Field(description="Human-readable title describing what the tool is doing."), + ] + # The category of tool being invoked. + # Helps clients choose appropriate icons and UI treatment. + kind: Annotated[ + Optional[ToolKind], + Field( + description="The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." + ), + ] = None + # Current execution status of the tool call. + status: Annotated[Optional[ToolCallStatus], Field(description="Current execution status of the tool call.")] = None + # Content produced by the tool call. + content: Annotated[ + Optional[List[Union[ContentToolCallContent, FileEditToolCallContent, TerminalToolCallContent]]], + Field(description="Content produced by the tool call."), + ] = None + # File locations affected by this tool call. + # Enables "follow-along" features in clients. + locations: Annotated[ + Optional[List[ToolCallLocation]], + Field(description='File locations affected by this tool call.\nEnables "follow-along" features in clients.'), + ] = None + # Raw input parameters sent to the tool. + raw_input: Annotated[ + Optional[Any], + Field(alias="rawInput", description="Raw input parameters sent to the tool."), + ] = None + # Raw output returned by the tool. + raw_output: Annotated[ + Optional[Any], + Field(alias="rawOutput", description="Raw output returned by the tool."), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4179,21 +5012,17 @@ class SuggestNesResponse(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 list of suggestions. - suggestions: Annotated[ - List[ - Union[ - NesEditSuggestionVariant, - NesJumpSuggestionVariant, - NesRenameSuggestionVariant, - NesSearchAndReplaceSuggestionVariant, - ] - ], - Field(description="The list of suggestions."), - ] -class AgentCapabilities(BaseModel): +class _ConfigOptionUpdate(BaseModel): + # The full set of configuration options and their current values. + config_options: Annotated[ + List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]], + Field( + alias="configOptions", + description="The full set of configuration options and their current values.", + ), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4206,87 +5035,273 @@ 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 + + +class ClientCapabilities(BaseModel): + # 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() + # Whether the Client support all `terminal/*` methods. + terminal: Annotated[ + Optional[bool], + Field(description="Whether the Client support all `terminal/*` methods."), + ] = False # **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], + # Session-related capabilities supported by the client. + session: Annotated[ + Optional[ClientSessionCapabilities], 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." + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSession-related capabilities supported by the client." ), - ] = {} - # Whether the agent supports `session/load`. - load_session: Annotated[ - Optional[bool], + ] = None + # **UNSTABLE** + # + # This capability is not part of the spec yet, and may be removed or changed at any point. + # + # Whether the client supports `plan_update` and `plan_removed` session updates. + # + # Optional. Omitted means the client does not advertise support. + # Supplying `{}` means the client can receive both update types. + plan: Annotated[ + Optional[PlanCapabilities], Field( - alias="loadSession", - description="Whether the agent supports `session/load`.", + description="**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the client supports `plan_update` and `plan_removed` session updates.\n\nOptional. Omitted means the client does not advertise support.\nSupplying `{}` means the client can receive both update types." ), - ] = False - # MCP capabilities supported by the agent. - mcp_capabilities: Annotated[ - Optional[McpCapabilities], + ] = 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( - alias="mcpCapabilities", - description="MCP capabilities supported by the agent.", + 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`." ), - ] = McpCapabilities() + ] = {"terminal": False} # **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], + # 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\nNES (Next Edit Suggestions) capabilities supported by the agent." + 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 # **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], + # NES (Next Edit Suggestions) capabilities supported by the client. + nes: Annotated[ + Optional[ClientNesCapabilities], 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.", + 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 - # 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. + # 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 + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. # - # By supplying `{}` it means that the agent supports provider configuration methods. - providers: Annotated[ - Optional[ProvidersCapabilities], + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + field_meta: Annotated[ + Optional[Dict[str, Any]], 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." + 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 SuggestNesRequest(BaseModel): + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this 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.")] + # 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 + # What triggered this suggestion request. + trigger_kind: Annotated[ + str, + Field(alias="triggerKind", description="What triggered this suggestion request."), + ] + # 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 _meta property is reserved 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 ClientResponseMessage(BaseModel): + # The id of the request this response answers. + id: Annotated[ + Optional[Union[int, str]], + Field(description="The id of the request this response answers."), + ] = None + # Method-specific response data. + result: Annotated[ + Union[ + WriteTextFileResponse, + ReadTextFileResponse, + RequestPermissionResponse, + CreateTerminalResponse, + TerminalOutputResponse, + ReleaseTerminalResponse, + WaitForTerminalExitResponse, + KillTerminalResponse, + ConnectMcpResponse, + DisconnectMcpResponse, + Union[ + AcceptElicitationResponse, + DeclineElicitationResponse, + CancelElicitationResponse, + ], + Any, + ], + Field(description="Method-specific response data."), + ] + + +class ClientResponse(RootModel[Union[ClientResponseMessage, ClientErrorMessage]]): + # A JSON-RPC response object. + root: Annotated[ + Union[ClientResponseMessage, ClientErrorMessage], + Field(description="A JSON-RPC response object."), + ] + + +class ClientNotification(BaseModel): + # The notification method name. + method: Annotated[str, Field(description="The notification method name.")] + # Method-specific notification parameters. + params: Annotated[ + Optional[ + Union[ + CancelNotification, + DidOpenDocumentNotification, + DidChangeDocumentNotification, + DidCloseDocumentNotification, + DidSaveDocumentNotification, + DidFocusDocumentNotification, + AcceptNesNotification, + RejectNesNotification, + MessageMcpNotification, + Any, + ] + ], + Field(description="Method-specific notification parameters."), + ] = None + + +class ToolCallUpdate(BaseModel): + # The ID of the tool call being updated. + tool_call_id: Annotated[ + str, + Field(alias="toolCallId", description="The ID of the tool call being updated."), + ] + # Update the tool kind. + kind: Annotated[Optional[ToolKind], Field(description="Update the tool kind.")] = None + # Update the execution status. + status: Annotated[Optional[ToolCallStatus], Field(description="Update the execution status.")] = None + # Update the human-readable title. + title: Annotated[Optional[str], Field(description="Update the human-readable title.")] = None + # Replace the content collection. + content: Annotated[ + Optional[List[Union[ContentToolCallContent, FileEditToolCallContent, TerminalToolCallContent]]], + Field(description="Replace the content collection."), + ] = None + # Replace the locations collection. + locations: Annotated[ + Optional[List[ToolCallLocation]], + Field(description="Replace the locations collection."), + ] = None + # Update the raw input. + raw_input: Annotated[Optional[Any], Field(alias="rawInput", description="Update the raw input.")] = None + # Update the raw output. + raw_output: Annotated[Optional[Any], Field(alias="rawOutput", description="Update the raw output.")] = None + # The _meta property is reserved by ACP to allow clients and agents to attach additional + # metadata to their interactions. Implementations MUST NOT make assumptions about values at + # these keys. + # + # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/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 - session_capabilities: Annotated[Optional[SessionCapabilities], Field(alias="sessionCapabilities")] = ( - SessionCapabilities() - ) - - -class EmbeddedResourceContentBlock(EmbeddedResource): - type: Literal["resource"] - - -class ContentChunk(BaseModel): + + +class ElicitationSchema(BaseModel): + # Type discriminator. Always `"object"`. + type: Annotated[Optional[str], Field(description='Type discriminator. Always `"object"`.')] = "object" + # Optional title for the schema. + title: Annotated[Optional[str], Field(description="Optional title for the schema.")] = 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 description of what this schema represents. + description: Annotated[ + Optional[str], + Field(description="Optional description of what this schema represents."), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4299,29 +5314,6 @@ class ContentChunk(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 single item of content - content: Annotated[ - Union[ - TextContentBlock, ImageContentBlock, AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock - ], - Field(description="A single item of content", discriminator="type"), - ] - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. - # - # A unique identifier for the message this chunk belongs to. - # - # All chunks belonging to the same message share the same `messageId`. - # A change in `messageId` indicates a new message has started. - # Both clients and agents MUST use UUID format for message IDs. - message_id: Annotated[ - Optional[str], - Field( - alias="messageId", - 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 the message this chunk belongs to.\n\nAll chunks belonging to the same message share the same `messageId`.\nA change in `messageId` indicates a new message has started.\nBoth clients and agents MUST use UUID format for message IDs.", - ), - ] = None class ElicitationFormSessionMode(ElicitationSessionScope): @@ -4360,61 +5352,17 @@ class ElicitationFormMode(RootModel[Union[ElicitationFormSessionMode, Elicitatio ] -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)", - ), +class NesCapabilities(BaseModel): + # Events the agent wants to receive. + events: Annotated[ + Optional[NesEventCapabilities], + Field(description="Events the agent wants to receive."), ] = 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.", - ), + # 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 - # 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 # these keys. @@ -4427,168 +5375,36 @@ class PromptRequest(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. - # - # A client-generated unique identifier for this user message. - # - # If provided, the Agent SHOULD echo this value as `userMessageId` in the - # [`PromptResponse`] to confirm it was recorded. - # Both clients and agents MUST use UUID format for message IDs. - message_id: Annotated[ - Optional[str], - Field( - alias="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.", - ), - ] = None - # The blocks of content that compose the user's message. - # - # As a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`], - # while other variants are optionally enabled via [`PromptCapabilities`]. - # - # The Client MUST adapt its interface according to [`PromptCapabilities`]. - # - # The client MAY include referenced pieces of context as either - # [`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`]. + + +class NewSessionResponse(BaseModel): + # Unique identifier for the created session. # - # When available, [`ContentBlock::Resource`] is preferred - # as it avoids extra round-trips and allows the message to include - # pieces of context from sources the agent may not have access to. - prompt: Annotated[ - List[ - Union[ - TextContentBlock, - ImageContentBlock, - AudioContentBlock, - ResourceContentBlock, - EmbeddedResourceContentBlock, - ] - ], - Field( - 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." - ), - ] - # The ID of the session to send this user message to + # Used in all subsequent requests for this conversation. session_id: Annotated[ str, Field( alias="sessionId", - description="The ID of the session to send this user message to", + description="Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation.", ), ] - - -class SessionConfigSelect(BaseModel): - # The currently selected value. - current_value: Annotated[str, Field(alias="currentValue", description="The currently selected value.")] - # The set of selectable options. - options: Annotated[ - Union[List[SessionConfigSelectOption], List[SessionConfigSelectGroup]], - Field(description="The set of selectable options."), - ] - - -class UserMessageChunk(ContentChunk): - session_update: Annotated[Literal["user_message_chunk"], Field(alias="sessionUpdate")] - - -class AgentMessageChunk(ContentChunk): - session_update: Annotated[Literal["agent_message_chunk"], Field(alias="sessionUpdate")] - - -class AgentThoughtChunk(ContentChunk): - session_update: Annotated[Literal["agent_thought_chunk"], Field(alias="sessionUpdate")] - - -class ClientRequest(BaseModel): - # JSON RPC Request Id - # - # An 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] - # - # The 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. - # - # [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. - # - # [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - id: Annotated[ - Optional[Union[int, str]], - Field( - 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." - ), - ] = None - method: str - params: Optional[ - Union[ - InitializeRequest, - AuthenticateRequest, - ListProvidersRequest, - SetProvidersRequest, - DisableProvidersRequest, - LogoutRequest, - NewSessionRequest, - LoadSessionRequest, - ListSessionsRequest, - ForkSessionRequest, - ResumeSessionRequest, - CloseSessionRequest, - SetSessionModeRequest, - PromptRequest, - SetSessionModelRequest, - StartNesRequest, - SuggestNesRequest, - CloseNesRequest, - Union[SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionSelectRequest], - Any, - ] - ] = None - - -class Content(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. + # Initial mode state if supported by the Agent # - # See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) - field_meta: Annotated[ - Optional[Dict[str, Any]], + # See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) + modes: Annotated[ + Optional[SessionModeState], 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)", + description="Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" ), ] = None - # The actual content block. - content: Annotated[ - Union[ - TextContentBlock, ImageContentBlock, AudioContentBlock, ResourceContentBlock, EmbeddedResourceContentBlock - ], - Field(description="The actual content block.", discriminator="type"), - ] - - -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]], + # Initial session configuration options if supported by the Agent. + config_options: Annotated[ + Optional[List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]]], 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)", + alias="configOptions", + description="Initial session configuration options if supported by the Agent.", ), ] = 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 # these keys. @@ -4601,24 +5417,21 @@ class SessionConfigOptionSelect(SessionConfigSelect): description="The _meta property is reserved by ACP to allow clients and agents to attach 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 semantic category for this option (UX only). - category: Annotated[ - Optional[str], - Field(description="Optional semantic category for this option (UX only)."), - ] = None - # Optional description for the Client to display to the user. - description: Annotated[ - Optional[str], - Field(description="Optional description for the Client to display to the user."), - ] = None - # Unique identifier for the configuration option. - id: Annotated[str, Field(description="Unique identifier for the configuration option.")] - # Human-readable label for the option. - name: Annotated[str, Field(description="Human-readable label for the option.")] - type: Literal["select"] -class SetSessionConfigOptionResponse(BaseModel): +class SuggestNesResponse(BaseModel): + # The list of suggestions. + suggestions: Annotated[ + List[ + Union[ + NesEditSuggestionVariant, + NesJumpSuggestionVariant, + NesRenameSuggestionVariant, + NesSearchAndReplaceSuggestionVariant, + ] + ], + Field(description="The list of suggestions."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4631,21 +5444,49 @@ class SetSessionConfigOptionResponse(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 full set of configuration options and their current values. - config_options: Annotated[ - List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]], - Field( - alias="configOptions", - description="The full set of configuration options and their current values.", - ), - ] -class ContentToolCallContent(Content): - type: Literal["content"] +class ToolCallStart(ToolCall): + session_update: Annotated[Literal["tool_call"], Field(alias="sessionUpdate")] -class ToolCallUpdate(BaseModel): +class ToolCallProgress(ToolCallUpdate): + session_update: Annotated[Literal["tool_call_update"], Field(alias="sessionUpdate")] + + +class ConfigOptionUpdate(_ConfigOptionUpdate): + session_update: Annotated[Literal["config_option_update"], Field(alias="sessionUpdate")] + + +class InitializeRequest(BaseModel): + # The latest protocol version supported by the client. + protocol_version: Annotated[ + int, + Field( + alias="protocolVersion", + description="The latest protocol version supported by the client.", + ge=0, + le=65535, + ), + ] + # Capabilities supported by the client. + client_capabilities: Annotated[ + Optional[ClientCapabilities], + Field( + alias="clientCapabilities", + description="Capabilities supported by 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. + client_info: Annotated[ + Optional[Implementation], + 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.", + ), + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4658,34 +5499,38 @@ class ToolCallUpdate(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 - # Replace the content collection. - content: Annotated[ - Optional[List[Union[ContentToolCallContent, FileEditToolCallContent, TerminalToolCallContent]]], - Field(description="Replace the content collection."), - ] = None - # Update the tool kind. - kind: Annotated[Optional[ToolKind], Field(description="Update the tool kind.")] = None - # Replace the locations collection. - locations: Annotated[ - Optional[List[ToolCallLocation]], - Field(description="Replace the locations collection."), - ] = None - # Update the raw input. - raw_input: Annotated[Optional[Any], Field(alias="rawInput", description="Update the raw input.")] = None - # Update the raw output. - raw_output: Annotated[Optional[Any], Field(alias="rawOutput", description="Update the raw output.")] = None - # Update the execution status. - status: Annotated[Optional[ToolCallStatus], Field(description="Update the execution status.")] = None - # Update the human-readable title. - title: Annotated[Optional[str], Field(description="Update the human-readable title.")] = None - # The ID of the tool call being updated. - tool_call_id: Annotated[ - str, - Field(alias="toolCallId", description="The ID of the tool call being updated."), - ] + + @field_validator("protocol_version", mode="before") + @classmethod + def _coerce_protocol_version(cls, value: Any) -> int: + # Some clients (e.g. Zed) send a date string like "2024-11-05" instead + # of an integer. The Rust SDK treats legacy strings as version 0; this + # SDK maps unparsable values to 1 so the connection is not rejected. + # See: https://github.com/agentclientprotocol/rust-sdk/blob/main/crates/agent-client-protocol-schema/src/version.rs + if isinstance(value, int): + return value + try: + return int(value) + except (TypeError, ValueError): + return 1 -class _ConfigOptionUpdate(BaseModel): +class RequestPermissionRequest(BaseModel): + # The session ID for this request. + session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] + # Details about the tool call requiring permission. + tool_call: Annotated[ + ToolCallUpdate, + Field( + alias="toolCall", + description="Details about the tool call requiring permission.", + ), + ] + # Available permission options for the user to choose from. + options: Annotated[ + List[PermissionOption], + Field(description="Available permission options for the user to choose from."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4698,17 +5543,14 @@ class _ConfigOptionUpdate(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 full set of configuration options and their current values. - config_options: Annotated[ - List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]], - Field( - alias="configOptions", - description="The full set of configuration options and their current values.", - ), - ] -class ForkSessionResponse(BaseModel): +class CreateFormSessionElicitationRequest(ElicitationSessionScope): + # A human-readable message describing what input is needed. + message: Annotated[ + str, + Field(description="A human-readable message describing what input is needed."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4721,45 +5563,23 @@ class ForkSessionResponse(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 - # Initial session configuration options if supported by the Agent. - config_options: Annotated[ - Optional[List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]]], - Field( - alias="configOptions", - description="Initial session configuration options if supported by the Agent.", - ), - ] = None - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. - # - # Initial model state if supported by the Agent - models: Annotated[ - Optional[SessionModelState], - Field( - 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" - ), - ] = None - # Initial mode state if supported by the Agent - # - # See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) - modes: Annotated[ - Optional[SessionModeState], - Field( - description="Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" - ), - ] = None - # Unique identifier for the newly created forked session. - session_id: Annotated[ - str, + mode: Literal["form"] + # A JSON Schema describing the form fields to present to the user. + requested_schema: Annotated[ + ElicitationSchema, Field( - alias="sessionId", - description="Unique identifier for the newly created forked session.", + alias="requestedSchema", + description="A JSON Schema describing the form fields to present to the user.", ), ] -class LoadSessionResponse(BaseModel): +class CreateFormRequestElicitationRequest(ElicitationRequestScope): + # A human-readable message describing what input is needed. + message: Annotated[ + str, + Field(description="A human-readable message describing what input is needed."), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4772,90 +5592,116 @@ class LoadSessionResponse(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 - # Initial session configuration options if supported by the Agent. - config_options: Annotated[ - Optional[List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]]], + mode: Literal["form"] + # A JSON Schema describing the form fields to present to the user. + requested_schema: Annotated[ + ElicitationSchema, Field( - alias="configOptions", - description="Initial session configuration options if supported by the Agent.", + alias="requestedSchema", + description="A JSON Schema describing the form fields to present to the user.", ), - ] = None - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. - # - # Initial model state if supported by the Agent - models: Annotated[ - Optional[SessionModelState], + ] + + +ElicitationMode = Union[ + ElicitationFormSessionMode, + ElicitationFormRequestMode, + ElicitationUrlSessionMode, + ElicitationUrlRequestMode, +] +CreateFormElicitationRequest = Union[ + CreateFormSessionElicitationRequest, + CreateFormRequestElicitationRequest, +] +CreateUrlElicitationRequest = Union[ + CreateUrlSessionElicitationRequest, + CreateUrlRequestElicitationRequest, +] +CreateElicitationRequest = Union[ + CreateFormElicitationRequest, + CreateUrlElicitationRequest, +] +CreateElicitationResponse = Union[ + AcceptElicitationResponse, + DeclineElicitationResponse, + CancelElicitationResponse, +] + + +class AgentCapabilities(BaseModel): + # Whether the agent supports `session/load`. + load_session: Annotated[ + Optional[bool], Field( - 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" + alias="loadSession", + description="Whether the agent supports `session/load`.", ), - ] = None - # Initial mode state if supported by the Agent - # - # See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) - modes: Annotated[ - Optional[SessionModeState], + ] = False + # Prompt capabilities supported by the agent. + prompt_capabilities: Annotated[ + Optional[PromptCapabilities], Field( - description="Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + alias="promptCapabilities", + description="Prompt capabilities supported by the agent.", ), - ] = None - - -class NewSessionResponse(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]], + ] = PromptCapabilities() + # MCP capabilities supported by the agent. + mcp_capabilities: Annotated[ + Optional[McpCapabilities], 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)", + alias="mcpCapabilities", + description="MCP capabilities supported by the agent.", ), - ] = None - # Initial session configuration options if supported by the Agent. - config_options: Annotated[ - Optional[List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]]], + ] = McpCapabilities() + # Session lifecycle and prompt capabilities advertised by the agent. + session_capabilities: Annotated[ + Optional[SessionCapabilities], Field( - alias="configOptions", - description="Initial session configuration options if supported by the Agent.", + alias="sessionCapabilities", + description="Session lifecycle and prompt capabilities advertised by the agent.", ), - ] = None + ] = SessionCapabilities() + # Authentication-related capabilities supported by the agent. + auth: Annotated[ + Optional[AgentAuthCapabilities], + Field(description="Authentication-related capabilities supported by the agent."), + ] = {} # **UNSTABLE** # # This capability is not part of the spec yet, and may be removed or changed at any point. # - # Initial model state if supported by the Agent - models: Annotated[ - Optional[SessionModelState], + # 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\nInitial model state if supported by the Agent" + 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 - # Initial mode state if supported by the Agent + # **UNSTABLE** # - # See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) - modes: Annotated[ - Optional[SessionModeState], + # 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="Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + 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 - # Unique identifier for the created session. + # **UNSTABLE** # - # Used in all subsequent requests for this conversation. - session_id: Annotated[ - str, + # 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="sessionId", - description="Unique identifier for the created session.\n\nUsed in all subsequent requests for this conversation.", + 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.", ), - ] - - -class RequestPermissionRequest(BaseModel): + ] = None # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4868,24 +5714,36 @@ class RequestPermissionRequest(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 - # Available permission options for the user to choose from. - options: Annotated[ - List[PermissionOption], - Field(description="Available permission options for the user to choose from."), - ] - # The session ID for this request. - session_id: Annotated[str, Field(alias="sessionId", description="The session ID for this request.")] - # Details about the tool call requiring permission. - tool_call: Annotated[ - ToolCallUpdate, + + +class SessionNotification(BaseModel): + # The ID of the session this update pertains to. + session_id: Annotated[ + str, Field( - alias="toolCall", - description="Details about the tool call requiring permission.", + alias="sessionId", + description="The ID of the session this update pertains to.", ), ] - - -class ResumeSessionResponse(BaseModel): + # The actual update content. + update: Annotated[ + Union[ + UserMessageChunk, + AgentMessageChunk, + AgentThoughtChunk, + ToolCallStart, + ToolCallProgress, + AgentPlanUpdate, + AgentPlanContentUpdate, + AgentPlanRemovedUpdate, + AvailableCommandsUpdate, + CurrentModeUpdate, + ConfigOptionUpdate, + SessionInfoUpdate, + UsageUpdate, + ], + Field(description="The actual update content.", discriminator="session_update"), + ] # The _meta property is reserved by ACP to allow clients and agents to attach additional # metadata to their interactions. Implementations MUST NOT make assumptions about values at # these keys. @@ -4898,45 +5756,123 @@ class ResumeSessionResponse(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 - # Initial session configuration options if supported by the Agent. - config_options: Annotated[ - Optional[List[Union[SessionConfigOptionSelect, SessionConfigOptionBoolean]]], - Field( - alias="configOptions", - description="Initial session configuration options if supported by the Agent.", - ), + + +class ClientRequest(BaseModel): + # The request id used to correlate the matching response. + id: Annotated[ + Optional[Union[int, str]], + Field(description="The request id used to correlate the matching response."), + ] + # The method name to invoke. + method: Annotated[str, Field(description="The method name to invoke.")] + # Method-specific request parameters. + params: Annotated[ + Optional[ + Union[ + InitializeRequest, + AuthenticateRequest, + ListProvidersRequest, + SetProviderRequest, + DisableProviderRequest, + LogoutRequest, + NewSessionRequest, + LoadSessionRequest, + ListSessionsRequest, + DeleteSessionRequest, + ForkSessionRequest, + ResumeSessionRequest, + CloseSessionRequest, + SetSessionModeRequest, + PromptRequest, + StartNesRequest, + SuggestNesRequest, + CloseNesRequest, + MessageMcpRequest, + Union[SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionSelectRequest], + Any, + ] + ], + Field(description="Method-specific request parameters."), ] = None - # **UNSTABLE** - # - # This capability is not part of the spec yet, and may be removed or changed at any point. + + +class AgentRequest(BaseModel): + # The request id used to correlate the matching response. + id: Annotated[ + Optional[Union[int, str]], + Field(description="The request id used to correlate the matching response."), + ] + # The method name to invoke. + method: Annotated[str, Field(description="The method name to invoke.")] + # Method-specific request parameters. + params: Annotated[ + Optional[ + Union[ + WriteTextFileRequest, + ReadTextFileRequest, + RequestPermissionRequest, + CreateTerminalRequest, + TerminalOutputRequest, + ReleaseTerminalRequest, + WaitForTerminalExitRequest, + KillTerminalRequest, + ConnectMcpRequest, + MessageMcpRequest, + DisconnectMcpRequest, + Union[ + CreateFormSessionElicitationRequest, + CreateFormRequestElicitationRequest, + CreateUrlSessionElicitationRequest, + CreateUrlRequestElicitationRequest, + ], + Any, + ] + ], + Field(description="Method-specific request parameters."), + ] = None + + +class InitializeResponse(BaseModel): + # The protocol version the client specified if supported by the agent, + # or the latest protocol version supported by the agent. # - # Initial model state if supported by the Agent - models: Annotated[ - Optional[SessionModelState], + # 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, + ), + ] + # Capabilities supported by the agent. + agent_capabilities: Annotated[ + Optional[AgentCapabilities], Field( - 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" + alias="agentCapabilities", + description="Capabilities supported by the agent.", ), - ] = None - # Initial mode state if supported by the Agent + ] = AgentCapabilities() + # 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.", + ), + ] = [] + # Information about the Agent name and version sent to the Client. # - # See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) - modes: Annotated[ - Optional[SessionModeState], + # Note: in future versions of the protocol, this will be required. + agent_info: Annotated[ + Optional[Implementation], Field( - description="Initial mode state if supported by the Agent\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)" + 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 - - -class ToolCallProgress(ToolCallUpdate): - session_update: Annotated[Literal["tool_call_update"], Field(alias="sessionUpdate")] - - -class ConfigOptionUpdate(_ConfigOptionUpdate): - session_update: Annotated[Literal["config_option_update"], Field(alias="sessionUpdate")] - - -class ToolCall(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. @@ -4949,184 +5885,62 @@ class ToolCall(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 produced by the tool call. - content: Annotated[ - Optional[List[Union[ContentToolCallContent, FileEditToolCallContent, TerminalToolCallContent]]], - Field(description="Content produced by the tool call."), - ] = None - # The category of tool being invoked. - # Helps clients choose appropriate icons and UI treatment. - kind: Annotated[ - Optional[ToolKind], - Field( - description="The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment." - ), - ] = None - # File locations affected by this tool call. - # Enables "follow-along" features in clients. - locations: Annotated[ - Optional[List[ToolCallLocation]], - Field(description='File locations affected by this tool call.\nEnables "follow-along" features in clients.'), - ] = None - # Raw input parameters sent to the tool. - raw_input: Annotated[ - Optional[Any], - Field(alias="rawInput", description="Raw input parameters sent to the tool."), - ] = None - # Raw output returned by the tool. - raw_output: Annotated[ - Optional[Any], - Field(alias="rawOutput", description="Raw output returned by the tool."), - ] = None - # Current execution status of the tool call. - status: Annotated[Optional[ToolCallStatus], Field(description="Current execution status of the tool call.")] = None - # Human-readable title describing what the tool is doing. - title: Annotated[ - str, - Field(description="Human-readable title describing what the tool is doing."), - ] - # Unique identifier for this tool call within the session. - tool_call_id: Annotated[ - str, - Field( - alias="toolCallId", - description="Unique identifier for this tool call within the session.", - ), - ] -class AgentRequest(BaseModel): - # JSON RPC Request Id - # - # An 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] - # - # The 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. - # - # [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. - # - # [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. - id: Annotated[ - Optional[Union[int, str]], - Field( - 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." - ), - ] = None - method: str - params: Optional[ - Union[ - WriteTextFileRequest, - ReadTextFileRequest, - RequestPermissionRequest, - CreateTerminalRequest, - TerminalOutputRequest, - ReleaseTerminalRequest, - WaitForTerminalExitRequest, - KillTerminalRequest, - Union[CreateFormElicitationRequest, CreateUrlElicitationRequest], - Any, - ] +class AgentNotification(BaseModel): + # The notification method name. + method: Annotated[str, Field(description="The notification method name.")] + # Method-specific notification parameters. + params: Annotated[ + Optional[ + Union[ + SessionNotification, + CompleteElicitationNotification, + MessageMcpNotification, + Any, + ] + ], + Field(description="Method-specific notification parameters."), ] = None class AgentResponseMessage(BaseModel): - # JSON RPC Request Id - # - # An 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] - # - # The 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. - # - # [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. - # - # [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions. + # The id of the request this response answers. id: Annotated[ Optional[Union[int, str]], - Field( - 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." - ), + Field(description="The id of the request this response answers."), ] = None - # All possible responses that an agent can send to a client. - # - # This enum is used internally for routing RPC responses. You typically won't need - # to use this directly - the responses are handled automatically by the connection. - # - # These are responses to the corresponding `ClientRequest` variants. + # Method-specific response data. result: Annotated[ Union[ InitializeResponse, AuthenticateResponse, ListProvidersResponse, - SetProvidersResponse, - DisableProvidersResponse, + SetProviderResponse, + DisableProviderResponse, LogoutResponse, NewSessionResponse, LoadSessionResponse, ListSessionsResponse, + DeleteSessionResponse, ForkSessionResponse, ResumeSessionResponse, CloseSessionResponse, SetSessionModeResponse, SetSessionConfigOptionResponse, PromptResponse, - SetSessionModelResponse, StartNesResponse, SuggestNesResponse, CloseNesResponse, Any, ], - Field( - description="All possible responses that an agent can send to a client.\n\nThis enum is used internally for routing RPC responses. You typically won't need\nto use this directly - the responses are handled automatically by the connection.\n\nThese are responses to the corresponding `ClientRequest` variants." - ), + Field(description="Method-specific response data."), ] class AgentResponse(RootModel[Union[AgentResponseMessage, AgentErrorMessage]]): - root: Union[AgentResponseMessage, AgentErrorMessage] - - -class ToolCallStart(ToolCall): - session_update: Annotated[Literal["tool_call"], Field(alias="sessionUpdate")] - - -class SessionNotification(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 this update pertains to. - session_id: Annotated[ - str, - Field( - alias="sessionId", - description="The ID of the session this update pertains to.", - ), - ] - # The actual update content. - update: Annotated[ - Union[ - UserMessageChunk, - AgentMessageChunk, - AgentThoughtChunk, - ToolCallStart, - ToolCallProgress, - AgentPlanUpdate, - AvailableCommandsUpdate, - CurrentModeUpdate, - ConfigOptionUpdate, - SessionInfoUpdate, - UsageUpdate, - ], - Field(description="The actual update content.", discriminator="session_update"), + # A JSON-RPC response object. + root: Annotated[ + Union[AgentResponseMessage, AgentErrorMessage], + Field(description="A JSON-RPC response object."), ] - - -class AgentNotification(BaseModel): - method: str - params: Optional[Union[SessionNotification, CompleteElicitationNotification, Any]] = None diff --git a/src/acp/utils.py b/src/acp/utils.py index 3d62496..fc78af8 100644 --- a/src/acp/utils.py +++ b/src/acp/utils.py @@ -53,7 +53,7 @@ def model_to_kwargs(model_obj: BaseModel, models: MultiParamModelSpec) -> dict[s def serialize_params(params: BaseModel) -> dict[str, Any]: """Return a JSON-serializable representation used for RPC calls.""" - return params.model_dump(by_alias=True, exclude_none=True, exclude_defaults=True) + return params.model_dump(mode="json", by_alias=True, exclude_none=True, exclude_defaults=True) def normalize_result(payload: Any) -> dict[str, Any]: diff --git a/tests/conftest.py b/tests/conftest.py index f154167..2dc476b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,8 +7,12 @@ import pytest_asyncio from acp import ( + AcceptElicitationResponse, AuthenticateResponse, + CompleteElicitationNotification, + CreateElicitationResponse, CreateTerminalResponse, + ElicitationMode, InitializeResponse, KillTerminalResponse, LoadSessionResponse, @@ -131,6 +135,8 @@ def __init__(self) -> None: self.permission_outcomes: list[RequestPermissionResponse] = [] self.files: dict[str, str] = {} self.notifications: list[SessionNotification] = [] + self.elicitation_requests: list[tuple[str, ElicitationMode, dict[str, Any]]] = [] + self.completed_elicitations: list[CompleteElicitationNotification] = [] self.ext_calls: list[tuple[str, dict]] = [] self.ext_notes: list[tuple[str, dict]] = [] self._agent_conn = None @@ -147,20 +153,20 @@ def queue_permission_selected(self, option_id: str) -> None: ) async def request_permission( - self, options: list[PermissionOption], session_id: str, tool_call: ToolCallUpdate, **kwargs: Any + self, session_id: str, tool_call: ToolCallUpdate, options: list[PermissionOption], **kwargs: Any ) -> RequestPermissionResponse: if self.permission_outcomes: return self.permission_outcomes.pop() return RequestPermissionResponse(outcome=DeniedOutcome(outcome="cancelled")) async def write_text_file( - self, content: str, path: str, session_id: str, **kwargs: Any + self, session_id: str, path: str, content: str, **kwargs: Any ) -> WriteTextFileResponse | None: self.files[str(path)] = content return WriteTextFileResponse() async def read_text_file( - self, path: str, session_id: str, limit: int | None = None, line: int | None = None, **kwargs: Any + self, session_id: str, path: str, line: int | None = None, limit: int | None = None, **kwargs: Any ) -> ReadTextFileResponse: content = self.files.get(str(path), "default content") return ReadTextFileResponse(content=content) @@ -185,11 +191,11 @@ async def session_update( # Optional terminal methods (not implemented in this test client) async def create_terminal( self, - command: str, session_id: str, + command: str, args: list[str] | None = None, - cwd: str | None = None, env: list[EnvVariable] | None = None, + cwd: str | None = None, output_byte_limit: int | None = None, **kwargs: Any, ) -> CreateTerminalResponse: @@ -215,6 +221,20 @@ async def kill_terminal( ) -> KillTerminalResponse | None: raise NotImplementedError + async def create_elicitation( + self, + message: str, + mode: ElicitationMode, + **kwargs: Any, + ) -> CreateElicitationResponse: + self.elicitation_requests.append((message, mode, kwargs)) + return AcceptElicitationResponse(action="accept", content={}) + + async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None: + self.completed_elicitations.append( + CompleteElicitationNotification(elicitation_id=elicitation_id, field_meta=kwargs or None) + ) + async def ext_method(self, method: str, params: dict) -> dict: self.ext_calls.append((method, params)) if method == "example.com/ping": @@ -246,12 +266,21 @@ async def initialize( return InitializeResponse(protocol_version=protocol_version, agent_capabilities=None, auth_methods=[]) 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="test-session-123") async def load_session( - self, cwd: str, mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio], session_id: str, **kwargs: Any + self, + cwd: str, + session_id: str, + mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio] | None = None, + additional_directories: list[str] | None = None, + **kwargs: Any, ) -> LoadSessionResponse | None: return LoadSessionResponse() @@ -260,6 +289,7 @@ async def authenticate(self, method_id: str, **kwargs: Any) -> AuthenticateRespo async def prompt( self, + session_id: str, prompt: list[ TextContentBlock | ImageContentBlock @@ -267,15 +297,12 @@ async def prompt( | ResourceContentBlock | EmbeddedResourceContentBlock ], - session_id: str, - message_id: str | None = None, **kwargs: Any, ) -> PromptResponse: self.prompts.append( PromptRequest( prompt=prompt, session_id=session_id, - message_id=message_id, field_meta=kwargs or None, ) ) @@ -289,7 +316,7 @@ async def list_sessions( ) -> ListSessionsResponse: return ListSessionsResponse(sessions=[]) - async def set_session_mode(self, mode_id: str, session_id: str, **kwargs: Any) -> SetSessionModeResponse | None: + async def set_session_mode(self, session_id: str, mode_id: str, **kwargs: Any) -> SetSessionModeResponse | None: return SetSessionModeResponse() async def set_config_option( diff --git a/tests/real_user/test_permission_flow.py b/tests/real_user/test_permission_flow.py index 95b10ce..5d872dd 100644 --- a/tests/real_user/test_permission_flow.py +++ b/tests/real_user/test_permission_flow.py @@ -29,6 +29,7 @@ def __init__(self, conn: AgentSideConnection) -> None: async def prompt( self, + session_id: str, prompt: list[ TextContentBlock | ImageContentBlock @@ -36,7 +37,6 @@ async def prompt( | ResourceContentBlock | EmbeddedResourceContentBlock ], - session_id: str, **kwargs: Any, ) -> PromptResponse: permission = await self._conn.request_permission( @@ -48,7 +48,7 @@ async def prompt( tool_call=ToolCallUpdate(tool_call_id="call-1", title="Write File"), ) self.permission_responses.append(permission) - return await super().prompt(prompt, session_id, **kwargs) + return await super().prompt(session_id=session_id, prompt=prompt, **kwargs) @pytest.mark.asyncio diff --git a/tests/real_user/test_stdio_limits.py b/tests/real_user/test_stdio_limits.py index f972a8f..88c2095 100644 --- a/tests/real_user/test_stdio_limits.py +++ b/tests/real_user/test_stdio_limits.py @@ -48,46 +48,62 @@ async def test_spawn_stdio_transport_custom_limit_handles_large_line() -> None: async def test_run_agent_stdio_buffer_limit() -> None: """Test that run_agent with different buffer limits can handle appropriately sized messages.""" with tempfile.TemporaryDirectory() as tmpdir: - # Test 1: Small buffer (1KB) fails with large message (70KB) + # Test 1: Small buffer (1KB) reads a large message (70KB) in chunks small_agent = os.path.join(tmpdir, "small_agent.py") with open(small_agent, "w") as f: - f.write(""" -import asyncio -from acp.core import run_agent -from acp.interfaces import Agent - -class TestAgent(Agent): - async def list_capabilities(self): - return {"capabilities": {}} - -asyncio.run(run_agent(TestAgent(), stdio_buffer_limit_bytes=1024)) -""") - - # Send a 70KB message - should fail with 1KB buffer - large_msg = '{"jsonrpc":"2.0","method":"test","params":{"data":"' + "X" * LARGE_LINE_SIZE + '"}}\n' + f.write( + textwrap.dedent( + """ + import asyncio + from acp.core import run_agent + from acp.interfaces import Agent + from acp.schema import InitializeResponse + + class TestAgent(Agent): + async def initialize(self, protocol_version, client_capabilities=None, client_info=None, **kwargs): + return InitializeResponse(protocol_version=protocol_version) + + asyncio.run(run_agent(TestAgent(), stdio_buffer_limit_bytes=1024)) + """ + ).strip() + ) + + # Send a 70KB message - should be read in chunks despite the 1KB buffer + large_msg = ( + '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"_meta":{"data":"' + + "X" * LARGE_LINE_SIZE + + '"}}}\n' + ) result = subprocess.run( # noqa: S603 [sys.executable, small_agent], input=large_msg, capture_output=True, text=True, timeout=2 ) - # Should have errors in stderr about the buffer limit - assert "Error" in result.stderr or result.returncode != 0, ( - f"Expected error with small buffer, got: {result.stderr}" - ) + assert result.returncode == 0 + assert "LimitOverrunError" not in result.stderr + assert "Separator is found, but chunk is longer than limit" not in result.stderr + assert "oversized JSON-RPC frame" not in result.stderr + assert '"id":1' in result.stdout + assert '"protocolVersion":1' in result.stdout # Test 2: Large buffer (200KB) succeeds with large message (70KB) large_agent = os.path.join(tmpdir, "large_agent.py") with open(large_agent, "w") as f: - f.write(f""" -import asyncio -from acp.core import run_agent -from acp.interfaces import Agent - -class TestAgent(Agent): - async def list_capabilities(self): - return {{"capabilities": {{}}}} - -asyncio.run(run_agent(TestAgent(), stdio_buffer_limit_bytes={LARGE_LINE_SIZE * 3})) -""") + f.write( + textwrap.dedent( + f""" + import asyncio + from acp.core import run_agent + from acp.interfaces import Agent + from acp.schema import InitializeResponse + + class TestAgent(Agent): + async def initialize(self, protocol_version, client_capabilities=None, client_info=None, **kwargs): + return InitializeResponse(protocol_version=protocol_version) + + asyncio.run(run_agent(TestAgent(), stdio_buffer_limit_bytes={LARGE_LINE_SIZE * 3})) + """ + ).strip() + ) # Same message, but with a buffer 3x the size - should handle it result = subprocess.run( # noqa: S603 @@ -98,3 +114,5 @@ async def list_capabilities(self): # (it may have other errors from invalid JSON-RPC, but not buffer overrun) if "LimitOverrunError" in result.stderr or "buffer" in result.stderr.lower(): pytest.fail(f"Large buffer still hit limit error: {result.stderr}") + assert '"id":1' in result.stdout + assert '"protocolVersion":1' in result.stdout diff --git a/tests/test_compatibility.py b/tests/test_compatibility.py index cdca9ad..effc088 100644 --- a/tests/test_compatibility.py +++ b/tests/test_compatibility.py @@ -12,7 +12,6 @@ RequestPermissionResponse, SessionNotification, SetSessionConfigOptionResponse, - SetSessionModelResponse, SetSessionModeResponse, WriteTextFileResponse, ) @@ -28,7 +27,6 @@ RequestPermissionRequest, SetSessionConfigOptionBooleanRequest, SetSessionConfigOptionSelectRequest, - SetSessionModelRequest, SetSessionModeRequest, WriteTextFileRequest, ) @@ -67,9 +65,6 @@ async def cancel(self, params: CancelNotification) -> None: async def setSessionMode(self, params: SetSessionModeRequest) -> SetSessionModeResponse | None: return SetSessionModeResponse() - async def setSessionModel(self, params: SetSessionModelRequest) -> SetSessionModelResponse | None: - return SetSessionModelResponse() - async def setConfigOption( self, params: SetSessionConfigOptionBooleanRequest | SetSessionConfigOptionSelectRequest ) -> SetSessionConfigOptionResponse | None: diff --git a/tests/test_connection_recovery.py b/tests/test_connection_recovery.py new file mode 100644 index 0000000..95769f6 --- /dev/null +++ b/tests/test_connection_recovery.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +import asyncio +import json +from typing import Any +from unittest.mock import AsyncMock, MagicMock + +import pytest + +from acp.connection import Connection +from acp.exceptions import RequestError + + +async def _noop_handler(method: str, params: Any, is_notification: bool) -> Any: + return None + + +def _make_connection( + *, + limit: int = 128, + receive_timeout: float | None = None, +) -> tuple[Connection, asyncio.StreamReader]: + reader = asyncio.StreamReader(limit=limit) + transport = MagicMock() + transport.is_closing.return_value = False + protocol = AsyncMock() + writer = asyncio.StreamWriter(transport, protocol, reader, asyncio.get_running_loop()) + conn = Connection(_noop_handler, writer, reader, listening=False, receive_timeout=receive_timeout) + return conn, reader + + +@pytest.mark.asyncio +async def test_receive_loop_handles_oversized_frame(caplog: pytest.LogCaptureFixture) -> None: + conn, reader = _make_connection(limit=128) + processed: list[str] = [] + + async def tracking_process(message: dict[str, Any]) -> None: + processed.append(message["method"]) + + conn._process_message = tracking_process # type: ignore[method-assign] + oversized = {"jsonrpc": "2.0", "method": "too-large", "params": {"data": "X" * 256}} + survivor = {"jsonrpc": "2.0", "method": "survivor"} + reader.feed_data(json.dumps(oversized).encode() + b"\n" + json.dumps(survivor).encode() + b"\n") + reader.feed_eof() + + with caplog.at_level("WARNING"): + await conn._receive_loop() + await conn.close() + + assert processed == ["too-large", "survivor"] + assert "oversized JSON-RPC frame" not in caplog.text + + +@pytest.mark.asyncio +async def test_receive_loop_handles_consecutive_oversized_frames() -> None: + conn, reader = _make_connection(limit=128) + processed: list[str] = [] + + async def tracking_process(message: dict[str, Any]) -> None: + processed.append(message["method"]) + + conn._process_message = tracking_process # type: ignore[method-assign] + for index in range(2): + oversized = {"jsonrpc": "2.0", "method": f"too-large-{index}", "params": {"data": "Y" * 256}} + reader.feed_data(json.dumps(oversized).encode() + b"\n") + survivor = {"jsonrpc": "2.0", "method": "survivor"} + reader.feed_data(json.dumps(survivor).encode() + b"\n") + reader.feed_eof() + + await conn._receive_loop() + await conn.close() + + assert processed == ["too-large-0", "too-large-1", "survivor"] + + +@pytest.mark.asyncio +async def test_receive_loop_handles_eof_during_oversized_frame() -> None: + conn, reader = _make_connection(limit=64) + reader.feed_data(b"X" * 256) + reader.feed_eof() + + await conn._receive_loop() + await conn.close() + + assert conn._disconnected is True + + +@pytest.mark.asyncio +async def test_receive_loop_keeps_timeout_semantics() -> None: + conn, _reader = _make_connection(receive_timeout=0.01) + + with pytest.raises(RequestError) as exc_info: + await conn._receive_loop() + await conn.close() + + exc = exc_info.value + assert isinstance(exc, RequestError) + assert str(exc) == "Internal error" + assert exc.data == {"details": "Agent timeout"} + + +@pytest.mark.asyncio +async def test_receive_loop_keeps_timeout_semantics_while_reading_oversized_frame() -> None: + conn, reader = _make_connection(limit=64, receive_timeout=0.01) + reader.feed_data(b"X" * 256) + + with pytest.raises(RequestError) as exc_info: + await conn._receive_loop() + await conn.close() + + exc = exc_info.value + assert isinstance(exc, RequestError) + assert exc.data == {"details": "Agent timeout"} + + +@pytest.mark.asyncio +async def test_receive_loop_does_not_swallow_unrelated_reader_error() -> None: + conn, reader = _make_connection() + reader.set_exception(ValueError("reader failed")) + + with pytest.raises(ValueError, match="reader failed"): + await conn._receive_loop() + await conn.close() diff --git a/tests/test_core.py b/tests/test_core.py new file mode 100644 index 0000000..571dd7f --- /dev/null +++ b/tests/test_core.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +import asyncio +import contextlib +from typing import Any + +import pytest + +from acp.core import run_agent + + +@pytest.mark.asyncio +async def test_run_agent_closes_connection_when_cancelled(server, agent) -> None: + sender_created = asyncio.Event() + sender_closed = asyncio.Event() + dispatcher_started = asyncio.Event() + dispatcher_stopped = asyncio.Event() + + class TrackingSender: + def __init__(self, writer: asyncio.StreamWriter, supervisor: Any) -> None: + sender_created.set() + + async def send(self, payload: dict[str, Any]) -> None: + msg = "test does not send messages" + raise AssertionError(msg) + + async def close(self) -> None: + sender_closed.set() + + class TrackingDispatcher: + def start(self) -> None: + dispatcher_started.set() + + async def stop(self) -> None: + dispatcher_stopped.set() + + task = asyncio.create_task( + run_agent( + agent, + server.server_writer, + server.server_reader, + sender_factory=TrackingSender, + dispatcher_factory=lambda *args: TrackingDispatcher(), + ) + ) + + await asyncio.wait_for(sender_created.wait(), timeout=1) + await asyncio.wait_for(dispatcher_started.wait(), timeout=1) + + task.cancel() + with contextlib.suppress(asyncio.CancelledError): + await asyncio.wait_for(task, timeout=1) + + await asyncio.wait_for(dispatcher_stopped.wait(), timeout=1) + await asyncio.wait_for(sender_closed.wait(), timeout=1) diff --git a/tests/test_gen_all.py b/tests/test_gen_all.py new file mode 100644 index 0000000..2cc95b5 --- /dev/null +++ b/tests/test_gen_all.py @@ -0,0 +1,119 @@ +from scripts.gen_all import resolve_ref, schema_source_paths +from scripts.gen_schema import _preprocess_schema_for_codegen, _restore_required_nullable_fields + + +def test_resolve_ref_accepts_schema_release_tags() -> None: + assert resolve_ref("schema-v1.16.0") == "refs/tags/schema-v1.16.0" + + +def test_resolve_ref_keeps_legacy_version_tags() -> None: + assert resolve_ref("0.13.6") == "refs/tags/v0.13.6" + assert resolve_ref("v0.13.6") == "refs/tags/v0.13.6" + + +def test_schema_release_tags_prefer_v1_schema_layout() -> None: + assert schema_source_paths("refs/tags/schema-v1.16.0")[0] == ( + "schema/v1/schema.unstable.json", + "schema/v1/meta.unstable.json", + ) + + +def test_legacy_tags_keep_legacy_schema_layout_first() -> None: + assert schema_source_paths("refs/tags/v0.13.6")[0] == ( + "schema/schema.unstable.json", + "schema/meta.unstable.json", + ) + + +def test_parse_args_formats_output_by_default(monkeypatch) -> None: + from scripts import gen_all + + monkeypatch.setattr("sys.argv", ["gen_all.py"]) + assert gen_all.parse_args().format_output is True + + +def test_parse_args_can_skip_format(monkeypatch) -> None: + from scripts import gen_all + + monkeypatch.setattr("sys.argv", ["gen_all.py", "--no-format"]) + assert gen_all.parse_args().format_output is False + + +def test_codegen_preprocess_distributes_common_object_properties() -> None: + schema = { + "$defs": { + "ScopeA": { + "type": "object", + "properties": {"scopeA": {"type": "string"}}, + "required": ["scopeA"], + }, + "ScopeB": { + "type": "object", + "properties": {"scopeB": {"type": "string"}}, + "required": ["scopeB"], + }, + "Mode": { + "type": "object", + "properties": {"payload": {"type": "string"}}, + "required": ["payload"], + "anyOf": [ + {"allOf": [{"$ref": "#/$defs/ScopeA"}]}, + {"allOf": [{"$ref": "#/$defs/ScopeB"}]}, + ], + }, + "Request": { + "type": "object", + "properties": {"message": {"type": "string"}}, + "required": ["message"], + "oneOf": [ + { + "type": "object", + "properties": {"kind": {"type": "string", "const": "mode"}}, + "required": ["kind"], + "allOf": [{"$ref": "#/$defs/Mode"}], + } + ], + }, + }, + "$ref": "#/$defs/Request", + } + + request = _preprocess_schema_for_codegen(schema)["$defs"]["Request"] + + assert len(request["oneOf"]) == 2 + assert request["oneOf"][0]["required"] == ["message", "kind", "payload"] + assert request["oneOf"][0]["properties"].keys() >= {"message", "kind", "payload"} + assert request["oneOf"][0]["allOf"] == [{"$ref": "#/$defs/ScopeA"}] + assert request["oneOf"][1]["allOf"] == [{"$ref": "#/$defs/ScopeB"}] + + +def test_codegen_postprocess_preserves_required_nullable_fields() -> None: + schema = { + "$defs": { + "Example": { + "type": "object", + "properties": { + "requiredId": {"anyOf": [{"type": "null"}, {"type": "string"}]}, + "optionalId": {"anyOf": [{"type": "null"}, {"type": "string"}]}, + }, + "required": ["requiredId"], + } + } + } + content = """\ +class Example(BaseModel): + required_id: Annotated[ + Optional[str], + Field(alias="requiredId"), + ] = None + optional_id: Annotated[ + Optional[str], + Field(alias="optionalId"), + ] = None +""" + + processed = _restore_required_nullable_fields(content, schema) + + assert 'Field(alias="requiredId"),\n ] = None' not in processed + assert 'Field(alias="requiredId"),\n ]' in processed + assert 'Field(alias="optionalId"),\n ] = None' in processed diff --git a/tests/test_rpc.py b/tests/test_rpc.py index be5e06c..4bdc0a9 100644 --- a/tests/test_rpc.py +++ b/tests/test_rpc.py @@ -5,12 +5,18 @@ from typing import Any, cast import pytest +from pydantic import AnyUrl from acp import ( + AcceptElicitationResponse, Agent, AuthenticateResponse, Client, CreateTerminalResponse, + ElicitationFormSessionMode, + ElicitationSchema, + ElicitationStringPropertySchema, + ElicitationUrlRequestMode, InitializeResponse, LoadSessionResponse, NewSessionResponse, @@ -152,8 +158,8 @@ def on_connect(self, conn: Client) -> None: async def prompt( self, - prompt: list[TextContentBlock], session_id: str, + prompt: list[TextContentBlock], **kwargs: Any, ) -> PromptResponse: assert self._conn is not None @@ -166,11 +172,11 @@ class _TerminalClient(TestClient): async def create_terminal( self, - command: str, session_id: str, + command: str, args: list[str] | None = None, - cwd: str | None = None, env: list[EnvVariable] | None = None, + cwd: str | None = None, output_byte_limit: int | None = None, **kwargs: Any, ) -> CreateTerminalResponse: @@ -188,6 +194,68 @@ async def create_terminal( await agent_conn.close() +@pytest.mark.asyncio +async def test_create_form_elicitation_roundtrip(connect, client): + agent_conn, _ = connect(use_unstable_protocol=True) + requested_schema = ElicitationSchema( + properties={"target": ElicitationStringPropertySchema(type="string")}, + required=["target"], + ) + + response = await agent_conn.create_elicitation( + message="Need deployment target", + mode=ElicitationFormSessionMode( + session_id="sess", + tool_call_id="tool-1", + requested_schema=requested_schema, + ), + trace_id="trace-1", + ) + + assert isinstance(response, AcceptElicitationResponse) + assert len(client.elicitation_requests) == 1 + message, mode, metadata = client.elicitation_requests[0] + assert message == "Need deployment target" + assert isinstance(mode, ElicitationFormSessionMode) + assert mode.session_id == "sess" + assert mode.tool_call_id == "tool-1" + assert mode.requested_schema.required == ["target"] + assert metadata == {"trace_id": "trace-1"} + + +@pytest.mark.asyncio +async def test_create_url_elicitation_and_complete_roundtrip(connect, client): + agent_conn, _ = connect(use_unstable_protocol=True) + + response = await agent_conn.create_elicitation( + message="Open authorization page", + mode=ElicitationUrlRequestMode( + request_id="req-1", + elicitation_id="elicitation-1", + url=AnyUrl("https://example.com/auth"), + ), + ) + await agent_conn.complete_elicitation(elicitation_id="elicitation-1", source="browser") + + assert isinstance(response, AcceptElicitationResponse) + assert len(client.elicitation_requests) == 1 + message, mode, metadata = client.elicitation_requests[0] + assert message == "Open authorization page" + assert isinstance(mode, ElicitationUrlRequestMode) + assert mode.request_id == "req-1" + assert mode.elicitation_id == "elicitation-1" + assert str(mode.url) == "https://example.com/auth" + assert metadata == {} + + for _ in range(50): + if client.completed_elicitations: + break + await asyncio.sleep(0.01) + assert len(client.completed_elicitations) == 1 + assert client.completed_elicitations[0].elicitation_id == "elicitation-1" + assert client.completed_elicitations[0].field_meta == {"source": "browser"} + + @pytest.mark.asyncio async def test_concurrent_reads(connect, client): for i in range(5): @@ -323,19 +391,6 @@ async def test_set_config_option_boolean(connect, agent, client): assert agent.config_option_calls == [("brave_mode", "sess", True)] -@pytest.mark.asyncio -async def test_prompt_message_id_roundtrip(connect, agent, client): - _, agent_conn = connect() - - resp = await agent_conn.prompt( - session_id="sess", - prompt=[TextContentBlock(type="text", text="hello")], - message_id="123e4567-e89b-12d3-a456-426614174000", - ) - assert isinstance(resp, PromptResponse) - assert agent.prompts[-1].message_id == "123e4567-e89b-12d3-a456-426614174000" - - @pytest.mark.asyncio async def test_list_sessions_stable(connect, agent, client): _, agent_conn = connect() @@ -377,12 +432,11 @@ async def load_session( 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 + self.calls["list"] = None return ListSessionsResponse(sessions=[]) async def fork_session( @@ -425,14 +479,14 @@ async def resume_session( 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.list_sessions(cwd="/workspace") 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, + "list": None, "fork": directories, "resume": directories, } @@ -495,12 +549,17 @@ 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="sess_demo") async def prompt( self, + session_id: str, prompt: list[ TextContentBlock | ImageContentBlock @@ -508,7 +567,6 @@ async def prompt( | ResourceContentBlock | EmbeddedResourceContentBlock ], - session_id: str, **kwargs: Any, ) -> PromptResponse: assert self._conn is not None @@ -575,15 +633,15 @@ def __init__(self) -> None: async def request_permission( self, - options: list[PermissionOption] | RequestPermissionRequest, - session_id: str | None = None, + session_id: str | RequestPermissionRequest, tool_call: ToolCallUpdate | None = None, + options: list[PermissionOption] | None = None, **kwargs: Any, ) -> RequestPermissionResponse: - if isinstance(options, RequestPermissionRequest): - params = options + if isinstance(session_id, RequestPermissionRequest): + params = session_id else: - assert session_id is not None and tool_call is not None + assert tool_call is not None and options is not None params = RequestPermissionRequest( options=options, session_id=session_id, diff --git a/tests/test_unstable.py b/tests/test_unstable.py index 0a25e47..7f519fc 100644 --- a/tests/test_unstable.py +++ b/tests/test_unstable.py @@ -10,7 +10,6 @@ ListSessionsResponse, McpServerStdio, ResumeSessionResponse, - SetSessionModelResponse, SseMcpServer, ) from tests.conftest import TestAgent @@ -23,9 +22,6 @@ async def list_sessions(self, cursor: str | None = None, cwd: str | None = None, async def close_session(self, session_id: str, **kwargs) -> CloseSessionResponse | None: return CloseSessionResponse() - async def set_session_model(self, model_id: str, session_id: str, **kwargs: Any) -> SetSessionModelResponse | None: - return SetSessionModelResponse() - async def fork_session( self, cwd: str, @@ -53,9 +49,6 @@ async def test_call_unstable_protocol(connect): resp = await agent_conn.list_sessions() assert isinstance(resp, ListSessionsResponse) - resp = await agent_conn.set_session_model(session_id="sess", model_id="gpt-4o-mini") - assert isinstance(resp, SetSessionModelResponse) - resp = await agent_conn.fork_session(cwd="/workspace", session_id="sess") assert isinstance(resp, ForkSessionResponse) @@ -71,11 +64,6 @@ async def test_call_unstable_protocol(connect): async def test_call_unstable_protocol_warning(connect): _, agent_conn = connect(use_unstable_protocol=False) - with pytest.warns(UserWarning) as record: - with pytest.raises(RequestError): - await agent_conn.set_session_model(session_id="sess", model_id="gpt-4o-mini") - assert len(record) == 1 - with pytest.warns(UserWarning) as record: with pytest.raises(RequestError): await agent_conn.close_session(session_id="sess") diff --git a/uv.lock b/uv.lock index c5f8a66..4e813f0 100644 --- a/uv.lock +++ b/uv.lock @@ -4,7 +4,7 @@ requires-python = ">=3.10, <3.15" [[package]] name = "agent-client-protocol" -version = "0.10.1" +version = "0.11.0" source = { editable = "." } dependencies = [ { name = "pydantic" }, @@ -1512,28 +1512,28 @@ wheels = [ [[package]] name = "uv" -version = "0.11.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/dd/f3/8aceeab67ea69805293ab290e7ca8cc1b61a064d28b8a35c76d8eba063dd/uv-0.11.6.tar.gz", hash = "sha256:e3b21b7e80024c95ff339fcd147ac6fc3dd98d3613c9d45d3a1f4fd1057f127b", size = 4073298, upload-time = "2026-04-09T12:09:01.738Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1f/fe/4b61a3d5ad9d02e8a4405026ccd43593d7044598e0fa47d892d4dafe44c9/uv-0.11.6-py3-none-linux_armv6l.whl", hash = "sha256:ada04dcf89ddea5b69d27ac9cdc5ef575a82f90a209a1392e930de504b2321d6", size = 23780079, upload-time = "2026-04-09T12:08:56.609Z" }, - { url = "https://files.pythonhosted.org/packages/52/db/d27519a9e1a5ffee9d71af1a811ad0e19ce7ab9ae815453bef39dd479389/uv-0.11.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5be013888420f96879c6e0d3081e7bcf51b539b034a01777041934457dfbedf3", size = 23214721, upload-time = "2026-04-09T12:09:32.228Z" }, - { url = "https://files.pythonhosted.org/packages/a6/8f/4399fa8b882bd7e0efffc829f73ab24d117d490a93e6bc7104a50282b854/uv-0.11.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:ffa5dc1cbb52bdce3b8447e83d1601a57ad4da6b523d77d4b47366db8b1ceb18", size = 21750109, upload-time = "2026-04-09T12:09:24.357Z" }, - { url = "https://files.pythonhosted.org/packages/32/07/5a12944c31c3dda253632da7a363edddb869ed47839d4d92a2dc5f546c93/uv-0.11.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:bfb107b4dade1d2c9e572992b06992d51dd5f2136eb8ceee9e62dd124289e825", size = 23551146, upload-time = "2026-04-09T12:09:10.439Z" }, - { url = "https://files.pythonhosted.org/packages/79/5b/2ec8b0af80acd1016ed596baf205ddc77b19ece288473b01926c4a9cf6db/uv-0.11.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:9e2fe7ce12161d8016b7deb1eaad7905a76ff7afec13383333ca75e0c4b5425d", size = 23331192, upload-time = "2026-04-09T12:09:34.792Z" }, - { url = "https://files.pythonhosted.org/packages/62/7d/eea35935f2112b21c296a3e42645f3e4b1aa8bcd34dcf13345fbd55134b7/uv-0.11.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7ed9c6f70c25e8dfeedddf4eddaf14d353f5e6b0eb43da9a14d3a1033d51d915", size = 23337686, upload-time = "2026-04-09T12:09:18.522Z" }, - { url = "https://files.pythonhosted.org/packages/21/47/2584f5ab618f6ebe9bdefb2f765f2ca8540e9d739667606a916b35449eec/uv-0.11.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d68a013e609cebf82077cbeeb0809ed5e205257814273bfd31e02fc0353bbfc2", size = 25008139, upload-time = "2026-04-09T12:09:03.983Z" }, - { url = "https://files.pythonhosted.org/packages/95/81/497ae5c1d36355b56b97dc59f550c7e89d0291c163a3f203c6f341dff195/uv-0.11.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:93f736dddca03dae732c6fdea177328d3bc4bf137c75248f3d433c57416a4311", size = 25712458, upload-time = "2026-04-09T12:09:07.598Z" }, - { url = "https://files.pythonhosted.org/packages/3c/1c/74083238e4fab2672b63575b9008f1ea418b02a714bcfcf017f4f6a309b6/uv-0.11.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e96a66abe53fced0e3389008b8d2eff8278cfa8bb545d75631ae8ceb9c929aba", size = 24915507, upload-time = "2026-04-09T12:08:50.892Z" }, - { url = "https://files.pythonhosted.org/packages/5a/ee/e14fe10ba455a823ed18233f12de6699a601890905420b5c504abf115116/uv-0.11.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b096311b2743b228df911a19532b3f18fa420bf9530547aecd6a8e04bbfaccd", size = 24971011, upload-time = "2026-04-09T12:08:54.016Z" }, - { url = "https://files.pythonhosted.org/packages/3c/a1/7b9c83eaadf98e343317ff6384a7227a4855afd02cdaf9696bcc71ee6155/uv-0.11.6-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:904d537b4a6e798015b4a64ff5622023bd4601b43b6cd1e5f423d63471f5e948", size = 23640234, upload-time = "2026-04-09T12:09:15.735Z" }, - { url = "https://files.pythonhosted.org/packages/d6/51/75ccdd23e76ff1703b70eb82881cd5b4d2a954c9679f8ef7e0136ef2cfab/uv-0.11.6-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:4ed8150c26b5e319381d75ae2ce6aba1e9c65888f4850f4e3b3fa839953c90a5", size = 24452664, upload-time = "2026-04-09T12:09:26.875Z" }, - { url = "https://files.pythonhosted.org/packages/4d/86/ace80fe47d8d48b5e3b5aee0b6eb1a49deaacc2313782870250b3faa36f5/uv-0.11.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:1c9218c8d4ac35ca6e617fb0951cc0ab2d907c91a6aea2617de0a5494cf162c0", size = 24494599, upload-time = "2026-04-09T12:09:37.368Z" }, - { url = "https://files.pythonhosted.org/packages/05/2d/4b642669b56648194f026de79bc992cbfc3ac2318b0a8d435f3c284934e8/uv-0.11.6-py3-none-musllinux_1_1_i686.whl", hash = "sha256:9e211c83cc890c569b86a4183fcf5f8b6f0c7adc33a839b699a98d30f1310d3a", size = 24159150, upload-time = "2026-04-09T12:09:13.17Z" }, - { url = "https://files.pythonhosted.org/packages/ae/24/7eecd76fe983a74fed1fc700a14882e70c4e857f1d562a9f2303d4286c12/uv-0.11.6-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:d2a1d2089afdf117ad19a4c1dd36b8189c00ae1ad4135d3bfbfced82342595cf", size = 25164324, upload-time = "2026-04-09T12:08:59.56Z" }, - { url = "https://files.pythonhosted.org/packages/27/e0/bbd4ba7c2e5067bbba617d87d306ec146889edaeeaa2081d3e122178ca08/uv-0.11.6-py3-none-win32.whl", hash = "sha256:6e8344f38fa29f85dcfd3e62dc35a700d2448f8e90381077ef393438dcd5012e", size = 22865693, upload-time = "2026-04-09T12:09:21.415Z" }, - { url = "https://files.pythonhosted.org/packages/a5/33/1983ce113c538a856f2d620d16e39691962ecceef091a84086c5785e32e5/uv-0.11.6-py3-none-win_amd64.whl", hash = "sha256:a28bea69c1186303d1200f155c7a28c449f8a4431e458fcf89360cc7ef546e40", size = 25371258, upload-time = "2026-04-09T12:09:40.52Z" }, - { url = "https://files.pythonhosted.org/packages/35/01/be0873f44b9c9bc250fcbf263367fcfc1f59feab996355bcb6b52fff080d/uv-0.11.6-py3-none-win_arm64.whl", hash = "sha256:a78f6d64b9950e24061bc7ec7f15ff8089ad7f5a976e7b65fcadce58fe02f613", size = 23869585, upload-time = "2026-04-09T12:09:29.425Z" }, +version = "0.11.15" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/da/34/609d5d01ba21dc8f0974610ca7802fbb2c946a0c38665cfe5c5aeddbefb5/uv-0.11.15.tar.gz", hash = "sha256:755f959ec6a2fd8ccb6ee76ad90ab759d2eb1f4797444078645dd1ee4bca92d6", size = 4159545, upload-time = "2026-05-18T19:57:48.133Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a6/7c/dcc230c5911884d8848145dabcac8fb95a5ed6f9fe1c57fae8242618f28a/uv-0.11.15-py3-none-linux_armv6l.whl", hash = "sha256:83b04ab49514a0a761ffedb36a748ee81f87746671e72088e5f32c9585e5f1a9", size = 23110183, upload-time = "2026-05-18T19:57:23.051Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f3/efd4e044b60eb9c3c12ee386be098d56c335538ccec7caa49349cfba9344/uv-0.11.15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b6cae61f737be075b90be9e3f07d961072aed7019f4c9b8ed5c5d41c4d6cade3", size = 22637941, upload-time = "2026-05-18T19:57:26.752Z" }, + { url = "https://files.pythonhosted.org/packages/a6/b8/48627f895a1569e576822e0a8416aa4797eb4a4551de21a4ad97b9b5819d/uv-0.11.15-py3-none-macosx_11_0_arm64.whl", hash = "sha256:9accae33619a9166e5c48531deb455d672cfb89f9357a00975e669c76b0bd49f", size = 21258803, upload-time = "2026-05-18T19:57:05.473Z" }, + { url = "https://files.pythonhosted.org/packages/af/50/4bc8a148274feabee2d9c9f1fa15009e10c0228dfe57981ee3ea2ef1d481/uv-0.11.15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:c0cf52cd6d50bb9e05e2d968f45f80761107e4cbc8d4a26d9758f9d8274aaec1", size = 23066178, upload-time = "2026-05-18T19:57:33.058Z" }, + { url = "https://files.pythonhosted.org/packages/a9/56/139fc3bec9a8b0a25bfe2196123adb9f16124da437bf4fbcf0d21cfcafb2/uv-0.11.15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:49dc6ed70bff00937384f96cdc4b1a4742d18e5504ec2c4a1214dba2dee5687a", size = 22705332, upload-time = "2026-05-18T19:57:36.714Z" }, + { url = "https://files.pythonhosted.org/packages/ca/b0/b18b3dd204f8c213236a1ebd148e009861637129a8cce34df0e9aa22ed40/uv-0.11.15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:adb9a89352539fdd8f7cd5f9966cf9f94fc5b98e0ccdf5003a04123dc6423bec", size = 22707534, upload-time = "2026-05-18T19:58:04.117Z" }, + { url = "https://files.pythonhosted.org/packages/76/36/3ca09f95572df99d361b49c96b1297149e96e120d8d1ecf074095a4b6da4/uv-0.11.15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40ff67e3f8e8a7533781a2e892a534975a93acb83ea35460e64e7b2bf2111774", size = 24096607, upload-time = "2026-05-18T19:58:11.625Z" }, + { url = "https://files.pythonhosted.org/packages/64/be/3bdee21a296bbf5336a526e3613d0e7d4538dacc39c62d7fcba55d15f6b0/uv-0.11.15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c6463a299ed7e6b5a800ed6f108af8e1588352629424133ddef7572b0e1e1118", size = 25082562, upload-time = "2026-05-18T19:57:40.69Z" }, + { url = "https://files.pythonhosted.org/packages/cd/73/f371f3689ffe741066468d001d85f739fc4b5574de83b639ef19b5e8a7f4/uv-0.11.15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:68c1e62d4b78578b90b833553286b65d6a7e327537716441068583ba652ec4f5", size = 24253391, upload-time = "2026-05-18T19:57:18.47Z" }, + { url = "https://files.pythonhosted.org/packages/d3/16/fe392d618af6b00c064b3e718d585dcf791546a77c5123a5bec07ce53a0a/uv-0.11.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98edf1bdaf82447014852051d93e3ee95012509c567bf057fd117e6bdbd9a807", size = 24415871, upload-time = "2026-05-18T19:58:19.651Z" }, + { url = "https://files.pythonhosted.org/packages/6e/24/2e92a052fb6334fcd746d1c7cb57847c204b118c84f5da53c0f9e129f7b7/uv-0.11.15-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:be8f76d25bcf4c92bb384240ac1bf9aa7f51063d0bdeca4c9cf0ec3ed8b145e0", size = 23159007, upload-time = "2026-05-18T19:57:10.653Z" }, + { url = "https://files.pythonhosted.org/packages/3d/2e/6923d0658d164bb2c435ed1868aa2d49b3074594679917a001ff92dc95bb/uv-0.11.15-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:f9f4fbbf4fe485522054f3c7496c6e8e932d6436e4200ff3daf718db0b7c7bd5", size = 23769385, upload-time = "2026-05-18T19:58:15.856Z" }, + { url = "https://files.pythonhosted.org/packages/a4/99/7e34cd949e57360814e8064cc9fb7104df445d0f6a663504e5f7473480aa/uv-0.11.15-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:0ed920e896b2fd13a35031707e307e42fbb2681458b967440a17272d86d49137", size = 23860973, upload-time = "2026-05-18T19:57:55.575Z" }, + { url = "https://files.pythonhosted.org/packages/28/98/8fe1f5f9d816e94569a0298dd8e0936801097625fa1952162951f0d628b6/uv-0.11.15-py3-none-musllinux_1_1_i686.whl", hash = "sha256:41d907611f3e6a13262807fd7f0a17849f76285ca80f536f6b3943732bdc6656", size = 23431392, upload-time = "2026-05-18T19:57:59.814Z" }, + { url = "https://files.pythonhosted.org/packages/cc/6b/76a1ce2fa860026913a5941700cdc7d715fce9c3277a3fa3489cf2523ca0/uv-0.11.15-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:e3b68f8bf1a4568710f77e5bda9182ce7682811d89a8e7468c22460e032b234d", size = 24519478, upload-time = "2026-05-18T19:57:51.165Z" }, + { url = "https://files.pythonhosted.org/packages/43/60/1d58e8a05718cb50494763115710b73846cacb651fd735d285233fd72c59/uv-0.11.15-py3-none-win32.whl", hash = "sha256:8e2da3076761086a5b76869c3f38ef0509c836046ef41ddd19485dfd7271dca9", size = 22020178, upload-time = "2026-05-18T19:58:07.64Z" }, + { url = "https://files.pythonhosted.org/packages/55/53/40fcefcb348af660488597ed3c01363df7344e60611f8883750dc596f5c6/uv-0.11.15-py3-none-win_amd64.whl", hash = "sha256:cc3915ab291a1ecaf31de05f5d8bd70d09c66fe9911a53f70d9efa62ff0dbd8a", size = 24668779, upload-time = "2026-05-18T19:57:44.894Z" }, + { url = "https://files.pythonhosted.org/packages/e5/7d/fa3a9960c95af9bbe2a629048760d0b9b4fead8ccd4f2235af747ec7cdf0/uv-0.11.15-py3-none-win_arm64.whl", hash = "sha256:4f39426a13dee24897aed60c4b98058c66f18bd983885ac5f4a54a04b24fbddf", size = 23198178, upload-time = "2026-05-18T19:57:14.68Z" }, ] [[package]]