Skip to content

Commit 9f499d2

Browse files
author
Chojan Shang
committed
feat: add new helpers
Signed-off-by: Chojan Shang <chojan.shang@vesoft.com>
1 parent cc25c68 commit 9f499d2

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

scripts/gen_all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
META_JSON = SCHEMA_DIR / "meta.json"
2222
VERSION_FILE = SCHEMA_DIR / "VERSION"
2323

24-
DEFAULT_REPO = "zed-industries/agent-client-protocol"
24+
DEFAULT_REPO = "agentclientprotocol/agent-client-protocol"
2525

2626

2727
def parse_args() -> argparse.Namespace:
@@ -30,7 +30,7 @@ def parse_args() -> argparse.Namespace:
3030
"--version",
3131
"-v",
3232
help=(
33-
"Git ref (tag/branch) of zed-industries/agent-client-protocol to fetch the schema from. "
33+
"Git ref (tag/branch) of agentclientprotocol/agent-client-protocol to fetch the schema from. "
3434
"If omitted, uses the cached schema files or falls back to 'main' when missing."
3535
),
3636
)

src/acp/helpers.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
AgentPlanUpdate,
99
AgentThoughtChunk,
1010
AudioContentBlock,
11+
AvailableCommand,
12+
AvailableCommandsUpdate,
1113
BlobResourceContents,
1214
ContentToolCallContent,
15+
CurrentModeUpdate,
1316
EmbeddedResourceContentBlock,
1417
FileEditToolCallContent,
1518
ImageContentBlock,
@@ -34,7 +37,14 @@
3437
)
3538

3639
SessionUpdate = (
37-
AgentMessageChunk | AgentPlanUpdate | AgentThoughtChunk | UserMessageChunk | ToolCallStart | ToolCallProgress
40+
AgentMessageChunk
41+
| AgentPlanUpdate
42+
| AgentThoughtChunk
43+
| AvailableCommandsUpdate
44+
| CurrentModeUpdate
45+
| UserMessageChunk
46+
| ToolCallStart
47+
| ToolCallProgress
3848
)
3949

4050
ToolCallContentVariant = ContentToolCallContent | FileEditToolCallContent | TerminalToolCallContent
@@ -59,6 +69,8 @@
5969
"update_agent_message_text",
6070
"update_agent_thought",
6171
"update_agent_thought_text",
72+
"update_available_commands",
73+
"update_current_mode",
6274
"update_plan",
6375
"update_tool_call",
6476
"update_user_message",
@@ -161,6 +173,17 @@ def update_agent_thought_text(text: str) -> AgentThoughtChunk:
161173
return update_agent_thought(text_block(text))
162174

163175

176+
def update_available_commands(commands: Iterable[AvailableCommand]) -> AvailableCommandsUpdate:
177+
return AvailableCommandsUpdate(
178+
sessionUpdate="available_commands_update",
179+
availableCommands=list(commands),
180+
)
181+
182+
183+
def update_current_mode(current_mode_id: str) -> CurrentModeUpdate:
184+
return CurrentModeUpdate(sessionUpdate="current_mode_update", currentModeId=current_mode_id)
185+
186+
164187
def session_notification(session_id: str, update: SessionUpdate) -> SessionNotification:
165188
return SessionNotification(sessionId=session_id, update=update)
166189

0 commit comments

Comments
 (0)