Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions examples/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,20 @@ 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
| AudioContentBlock
| ResourceContentBlock
| EmbeddedResourceContentBlock
],
session_id: str,
**kwargs: Any,
) -> PromptResponse:
logging.info("Received prompt request for session %s", session_id)
Expand Down
20 changes: 15 additions & 5 deletions examples/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
AvailableCommandsUpdate,
ClientCapabilities,
ConfigOptionUpdate,
CreateElicitationResponse,
CreateTerminalResponse,
CurrentModeUpdate,
DeclineElicitationResponse,
ElicitationMode,
EmbeddedResourceContentBlock,
EnvVariable,
ImageContentBlock,
Expand All @@ -52,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:
Expand All @@ -94,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,
Expand Down
2 changes: 1 addition & 1 deletion examples/echo_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ async def new_session(

async def prompt(
self,
session_id: str,
prompt: list[
TextContentBlock
| ImageContentBlock
| AudioContentBlock
| ResourceContentBlock
| EmbeddedResourceContentBlock
],
session_id: str,
**kwargs: Any,
) -> PromptResponse:
for block in prompt:
Expand Down
20 changes: 15 additions & 5 deletions examples/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@
AvailableCommandsUpdate,
ClientCapabilities,
ConfigOptionUpdate,
CreateElicitationResponse,
CreateTerminalResponse,
CurrentModeUpdate,
DeclineElicitationResponse,
DeniedOutcome,
ElicitationMode,
EmbeddedResourceContentBlock,
EnvVariable,
FileEditToolCallContent,
Expand Down Expand Up @@ -64,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)
Expand Down Expand Up @@ -95,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():
Expand All @@ -106,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():
Expand Down Expand Up @@ -170,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)
Expand Down
2 changes: 1 addition & 1 deletion schema/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
refs/tags/v0.13.6
refs/tags/schema-v1.16.0
64 changes: 32 additions & 32 deletions schema/meta.json
Original file line number Diff line number Diff line change
@@ -1,52 +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",
"mcp_message": "mcp/message",
"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",
"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",
"session_close": "session/close",
"mcp_message": "mcp/message",
"session_list": "session/list",
"session_delete": "session/delete",
"session_fork": "session/fork",
"session_list": "session/list",
"session_load": "session/load",
"session_new": "session/new",
"session_prompt": "session/prompt",
"session_resume": "session/resume",
"session_set_config_option": "session/set_config_option",
"session_set_mode": "session/set_mode"
"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",
"mcp_connect": "mcp/connect",
"mcp_disconnect": "mcp/disconnect",
"mcp_message": "mcp/message",
"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
}
}
Loading
Loading