Skip to content

Commit a9a33f3

Browse files
author
Chojan Shang
committed
feat: follow protocol 0.6.2
Signed-off-by: Chojan Shang <chojan.shang@vesoft.com>
1 parent fa891d2 commit a9a33f3

File tree

4 files changed

+99
-5
lines changed

4 files changed

+99
-5
lines changed

schema/VERSION

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

schema/schema.json

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,31 @@
10711071
],
10721072
"type": "object"
10731073
},
1074+
"Implementation": {
1075+
"description": "Describes the name and version of an MCP implementation, with an optional\ntitle for UI representation.",
1076+
"properties": {
1077+
"name": {
1078+
"description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn\u2019t present.",
1079+
"type": "string"
1080+
},
1081+
"title": {
1082+
"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.",
1083+
"type": [
1084+
"string",
1085+
"null"
1086+
]
1087+
},
1088+
"version": {
1089+
"description": "Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes.",
1090+
"type": "string"
1091+
}
1092+
},
1093+
"required": [
1094+
"name",
1095+
"version"
1096+
],
1097+
"type": "object"
1098+
},
10741099
"InitializeRequest": {
10751100
"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)",
10761101
"properties": {
@@ -1088,6 +1113,17 @@
10881113
},
10891114
"description": "Capabilities supported by the client."
10901115
},
1116+
"clientInfo": {
1117+
"anyOf": [
1118+
{
1119+
"$ref": "#/$defs/Implementation"
1120+
},
1121+
{
1122+
"type": "null"
1123+
}
1124+
],
1125+
"description": "Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required."
1126+
},
10911127
"protocolVersion": {
10921128
"$ref": "#/$defs/ProtocolVersion",
10931129
"description": "The latest protocol version supported by the client."
@@ -1122,6 +1158,17 @@
11221158
},
11231159
"description": "Capabilities supported by the agent."
11241160
},
1161+
"agentInfo": {
1162+
"anyOf": [
1163+
{
1164+
"$ref": "#/$defs/Implementation"
1165+
},
1166+
{
1167+
"type": "null"
1168+
}
1169+
],
1170+
"description": "Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required."
1171+
},
11251172
"authMethods": {
11261173
"default": [],
11271174
"description": "Authentication methods supported by the agent.",
@@ -2304,7 +2351,7 @@
23042351
"SetSessionModeResponse": {
23052352
"description": "Response to `session/set_mode` method.",
23062353
"properties": {
2307-
"meta": true
2354+
"_meta": true
23082355
},
23092356
"type": "object",
23102357
"x-method": "session/set_mode",

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.5.0
2+
# Schema ref: refs/tags/v0.6.2
33
AGENT_METHODS = {'authenticate': 'authenticate', 'initialize': 'initialize', 'session_cancel': 'session/cancel', 'session_load': 'session/load', 'session_new': 'session/new', 'session_prompt': 'session/prompt', 'session_set_mode': 'session/set_mode', 'session_set_model': 'session/set_model'}
44
CLIENT_METHODS = {'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', 'terminal_create': 'terminal/create', 'terminal_kill': 'terminal/kill', 'terminal_output': 'terminal/output', 'terminal_release': 'terminal/release', 'terminal_wait_for_exit': 'terminal/wait_for_exit'}
55
PROTOCOL_VERSION = 1

src/acp/schema.py

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Generated from schema/schema.json. Do not edit by hand.
2-
# Schema ref: refs/tags/v0.5.0
2+
# Schema ref: refs/tags/v0.6.2
33

44
from __future__ import annotations
55

@@ -151,6 +151,35 @@ class HttpHeader(BaseModel):
151151
value: Annotated[str, Field(description="The value to set for the HTTP header.")]
152152

153153

154+
class Implementation(BaseModel):
155+
# Intended for programmatic or logical use, but can be used as a display
156+
# name fallback if title isn’t present.
157+
name: Annotated[
158+
str,
159+
Field(
160+
description="Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present."
161+
),
162+
]
163+
# Intended for UI and end-user contexts — optimized to be human-readable
164+
# and easily understood.
165+
#
166+
# If not provided, the name should be used for display.
167+
title: Annotated[
168+
Optional[str],
169+
Field(
170+
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."
171+
),
172+
] = None
173+
# Version of the implementation. Can be displayed to the user or used
174+
# for debugging or metrics purposes.
175+
version: Annotated[
176+
str,
177+
Field(
178+
description="Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes."
179+
),
180+
]
181+
182+
154183
class KillTerminalCommandResponse(BaseModel):
155184
# Extension point for implementations
156185
field_meta: Annotated[
@@ -349,7 +378,7 @@ class SetSessionModeRequest(BaseModel):
349378

350379

351380
class SetSessionModeResponse(BaseModel):
352-
meta: Optional[Any] = None
381+
field_meta: Annotated[Optional[Any], Field(alias="_meta")] = None
353382

354383

355384
class SetSessionModelRequest(BaseModel):
@@ -767,6 +796,15 @@ class InitializeRequest(BaseModel):
767796
Optional[ClientCapabilities],
768797
Field(description="Capabilities supported by the client."),
769798
] = ClientCapabilities(fs=FileSystemCapability(readTextFile=False, writeTextFile=False), terminal=False)
799+
# Information about the Client name and version sent to the Agent.
800+
#
801+
# Note: in future versions of the protocol, this will be required.
802+
clientInfo: Annotated[
803+
Optional[Implementation],
804+
Field(
805+
description="Information about the Client name and version sent to the Agent.\n\nNote: in future versions of the protocol, this will be required."
806+
),
807+
] = None
770808
# The latest protocol version supported by the client.
771809
protocolVersion: Annotated[
772810
int,
@@ -793,6 +831,15 @@ class InitializeResponse(BaseModel):
793831
mcpCapabilities=McpCapabilities(http=False, sse=False),
794832
promptCapabilities=PromptCapabilities(audio=False, embeddedContext=False, image=False),
795833
)
834+
# Information about the Agent name and version sent to the Client.
835+
#
836+
# Note: in future versions of the protocol, this will be required.
837+
agentInfo: Annotated[
838+
Optional[Implementation],
839+
Field(
840+
description="Information about the Agent name and version sent to the Client.\n\nNote: in future versions of the protocol, this will be required."
841+
),
842+
] = None
796843
# Authentication methods supported by the agent.
797844
authMethods: Annotated[
798845
Optional[List[AuthMethod]],

0 commit comments

Comments
 (0)