Skip to content

Commit 4194dd0

Browse files
committed
feat: update to unstable schema and metadata
Signed-off-by: Frost Ming <me@frostming.com>
1 parent 8556f0d commit 4194dd0

File tree

15 files changed

+1044
-791
lines changed

15 files changed

+1044
-791
lines changed

schema/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
refs/tags/v0.6.3
1+
refs/heads/main

schema/schema.json

Lines changed: 796 additions & 542 deletions
Large diffs are not rendered by default.

scripts/gen_all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def resolve_ref(version: str | None) -> str:
109109

110110
def download_schema(repo: str, ref: str) -> None:
111111
SCHEMA_DIR.mkdir(parents=True, exist_ok=True)
112-
schema_url = f"https://raw.githubusercontent.com/{repo}/{ref}/schema/schema.json"
113-
meta_url = f"https://raw.githubusercontent.com/{repo}/{ref}/schema/meta.json"
112+
schema_url = f"https://raw.githubusercontent.com/{repo}/{ref}/schema/schema.unstable.json"
113+
meta_url = f"https://raw.githubusercontent.com/{repo}/{ref}/schema/meta.unstable.json"
114114
try:
115115
schema_data = fetch_json(schema_url)
116116
meta_data = fetch_json(meta_url)

scripts/gen_schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
("ToolCallStart", "status", "ToolCallStatus", True),
9494
("ToolCall", "kind", "ToolKind", True),
9595
("ToolCall", "status", "ToolCallStatus", True),
96+
("ToolCallUpdate", "kind", "ToolKind", True),
97+
("ToolCallUpdate", "status", "ToolCallStatus", True),
9698
)
9799

98100
DEFAULT_VALUE_OVERRIDES: tuple[tuple[str, str, str], ...] = (

src/acp/agent/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
SessionNotification,
2929
TerminalOutputRequest,
3030
TerminalOutputResponse,
31-
ToolCall,
3231
ToolCallProgress,
3332
ToolCallStart,
33+
ToolCallUpdate,
3434
UserMessageChunk,
3535
WaitForTerminalExitRequest,
3636
WaitForTerminalExitResponse,
@@ -92,7 +92,7 @@ async def session_update(
9292

9393
@param_model(RequestPermissionRequest)
9494
async def request_permission(
95-
self, options: list[PermissionOption], session_id: str, tool_call: ToolCall, **kwargs: Any
95+
self, options: list[PermissionOption], session_id: str, tool_call: ToolCallUpdate, **kwargs: Any
9696
) -> RequestPermissionResponse:
9797
return await request_model(
9898
self._conn,

src/acp/agent/router.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def build_agent_router(agent: Agent) -> MessageRouter:
4747
agent,
4848
"set_session_model",
4949
adapt_result=normalize_result,
50+
unstable=True,
5051
)
5152
router.route_request(
5253
AGENT_METHODS["authenticate"],

src/acp/contrib/permissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Any
55

66
from ..helpers import text_block, tool_content
7-
from ..schema import PermissionOption, RequestPermissionRequest, RequestPermissionResponse, ToolCall
7+
from ..schema import PermissionOption, RequestPermissionRequest, RequestPermissionResponse, ToolCallUpdate
88
from .tool_calls import ToolCallTracker, _copy_model_list
99

1010

@@ -60,7 +60,7 @@ async def request_for(
6060
description: str | None = None,
6161
options: Sequence[PermissionOption] | None = None,
6262
content: Sequence[Any] | None = None,
63-
tool_call: ToolCall | None = None,
63+
tool_call: ToolCallUpdate | None = None,
6464
) -> RequestPermissionResponse:
6565
"""Request user approval for a tool call."""
6666
if tool_call is None:

src/acp/contrib/tool_calls.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77
from pydantic import BaseModel, ConfigDict
88

99
from ..helpers import text_block, tool_content
10-
from ..schema import ToolCall, ToolCallLocation, ToolCallProgress, ToolCallStart, ToolCallStatus, ToolKind
10+
from ..schema import (
11+
ToolCallLocation,
12+
ToolCallProgress,
13+
ToolCallStart,
14+
ToolCallStatus,
15+
ToolCallUpdate,
16+
ToolKind,
17+
)
1118

1219

1320
class _MissingToolCallTitleError(ValueError):
@@ -91,8 +98,8 @@ def to_view(self) -> TrackedToolCallView:
9198
raw_output=self.raw_output,
9299
)
93100

94-
def to_tool_call_model(self) -> ToolCall:
95-
return ToolCall(
101+
def to_tool_call_model(self) -> ToolCallUpdate:
102+
return ToolCallUpdate(
96103
tool_call_id=self.tool_call_id,
97104
title=self.title,
98105
kind=self.kind,
@@ -249,7 +256,7 @@ def view(self, external_id: str) -> TrackedToolCallView:
249256
state = self._require_call(external_id)
250257
return state.to_view()
251258

252-
def tool_call_model(self, external_id: str) -> ToolCall:
259+
def tool_call_model(self, external_id: str) -> ToolCallUpdate:
253260
"""Return a deep copy of the tool call suitable for permission requests."""
254261
state = self._require_call(external_id)
255262
return state.to_tool_call_model()

src/acp/interfaces.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
TerminalOutputRequest,
4949
TerminalOutputResponse,
5050
TextContentBlock,
51-
ToolCall,
5251
ToolCallProgress,
5352
ToolCallStart,
53+
ToolCallUpdate,
5454
UserMessageChunk,
5555
WaitForTerminalExitRequest,
5656
WaitForTerminalExitResponse,
@@ -65,7 +65,7 @@
6565
class Client(Protocol):
6666
@param_model(RequestPermissionRequest)
6767
async def request_permission(
68-
self, options: list[PermissionOption], session_id: str, tool_call: ToolCall, **kwargs: Any
68+
self, options: list[PermissionOption], session_id: str, tool_call: ToolCallUpdate, **kwargs: Any
6969
) -> RequestPermissionResponse: ...
7070

7171
@param_model(SessionNotification)

src/acp/meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Generated from schema/meta.json. Do not edit by hand.
2-
# Schema ref: refs/tags/v0.6.3
2+
# Schema ref: refs/heads/main
33
AGENT_METHODS = {
44
"authenticate": "authenticate",
55
"initialize": "initialize",

0 commit comments

Comments
 (0)