Skip to content

Commit e81dbbe

Browse files
authored
feat(unstable): Draft implementation of session config options (#339)
* feat(unstable): Draft implementation of session config options * Make array types more consistently have links in schema docs
1 parent c534dc9 commit e81dbbe

9 files changed

Lines changed: 1310 additions & 73 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ include = ["/src/**/*.rs", "/README.md", "/LICENSE", "/Cargo.toml"]
1616
[features]
1717
unstable = [
1818
"unstable_cancel_request",
19+
"unstable_session_config_options",
1920
"unstable_session_fork",
2021
"unstable_session_info_update",
2122
"unstable_session_list",
2223
"unstable_session_model",
2324
"unstable_session_resume",
2425
]
2526
unstable_cancel_request = []
27+
unstable_session_config_options = []
2628
unstable_session_fork = []
2729
unstable_session_info_update = []
2830
unstable_session_list = []

docs/protocol/draft/schema.mdx

Lines changed: 344 additions & 30 deletions
Large diffs are not rendered by default.

docs/protocol/schema.mdx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
144144
Note: in future versions of the protocol, this will be required.
145145

146146
</ResponseField>
147-
<ResponseField name="authMethods" type={<><span><a href="#authmethod">AuthMethod</a></span><span>[]</span></>} >
147+
<ResponseField name="authMethods" type={<a href="#authmethod">AuthMethod[]</a>} >
148148
Authentication methods supported by the agent.
149149

150150
- Default: `[]`
@@ -234,7 +234,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
234234
<ResponseField name="cwd" type={"string"} required>
235235
The working directory for this session.
236236
</ResponseField>
237-
<ResponseField name="mcpServers" type={<><span><a href="#mcpserver">McpServer</a></span><span>[]</span></>} required>
237+
<ResponseField name="mcpServers" type={<a href="#mcpserver">McpServer[]</a>} required>
238238
List of MCP servers to connect to for this session.
239239
</ResponseField>
240240
<ResponseField name="sessionId" type={<a href="#sessionid">SessionId</a>} required>
@@ -302,7 +302,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
302302
<ResponseField name="cwd" type={"string"} required>
303303
The working directory for this session. Must be an absolute path.
304304
</ResponseField>
305-
<ResponseField name="mcpServers" type={<><span><a href="#mcpserver">McpServer</a></span><span>[]</span></>} required>
305+
<ResponseField name="mcpServers" type={<a href="#mcpserver">McpServer[]</a>} required>
306306
List of MCP (Model Context Protocol) servers the agent should connect to.
307307
</ResponseField>
308308

@@ -373,7 +373,7 @@ these keys.
373373
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
374374

375375
</ResponseField>
376-
<ResponseField name="prompt" type={<><span><a href="#contentblock">ContentBlock</a></span><span>[]</span></>} required>
376+
<ResponseField name="prompt" type={<a href="#contentblock">ContentBlock[]</a>} required>
377377
The blocks of content that compose the user's message.
378378

379379
As a baseline, the Agent MUST support `ContentBlock::Text` and `ContentBlock::ResourceLink`,
@@ -628,7 +628,7 @@ these keys.
628628
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
629629

630630
</ResponseField>
631-
<ResponseField name="options" type={<><span><a href="#permissionoption">PermissionOption</a></span><span>[]</span></>} required>
631+
<ResponseField name="options" type={<a href="#permissionoption">PermissionOption[]</a>} required>
632632
Available permission options for the user to choose from.
633633
</ResponseField>
634634
<ResponseField name="sessionId" type={<a href="#sessionid">SessionId</a>} required>
@@ -743,7 +743,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
743743
<ResponseField name="cwd" type={"string | null"} >
744744
Working directory for the command (absolute path).
745745
</ResponseField>
746-
<ResponseField name="env" type={<><span><a href="#envvariable">EnvVariable</a></span><span>[]</span></>} >
746+
<ResponseField name="env" type={<a href="#envvariable">EnvVariable[]</a>} >
747747
Environment variables for the command.
748748
</ResponseField>
749749
<ResponseField name="outputByteLimit" type={"integer | null"} >
@@ -1071,7 +1071,7 @@ these keys.
10711071
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
10721072

10731073
</ResponseField>
1074-
<ResponseField name="audience" type={"array | null"} >
1074+
<ResponseField name="audience" type={<><span><a href="#role">Role[]</a></span><span> | null</span></>} >
10751075
</ResponseField>
10761076
<ResponseField name="lastModified" type={"string | null"} >
10771077
</ResponseField>
@@ -1195,7 +1195,7 @@ these keys.
11951195
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
11961196

11971197
</ResponseField>
1198-
<ResponseField name="availableCommands" type={<><span><a href="#availablecommand">AvailableCommand</a></span><span>[]</span></>} required>
1198+
<ResponseField name="availableCommands" type={<a href="#availablecommand">AvailableCommand[]</a>} required>
11991199
Commands the agent can execute
12001200
</ResponseField>
12011201

@@ -1873,7 +1873,7 @@ these keys.
18731873
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
18741874

18751875
</ResponseField>
1876-
<ResponseField name="headers" type={<><span><a href="#httpheader">HttpHeader</a></span><span>[]</span></>} required>
1876+
<ResponseField name="headers" type={<a href="#httpheader">HttpHeader[]</a>} required>
18771877
HTTP headers to set when making requests to the MCP server.
18781878
</ResponseField>
18791879
<ResponseField name="name" type={"string"} required>
@@ -1903,7 +1903,7 @@ these keys.
19031903
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
19041904

19051905
</ResponseField>
1906-
<ResponseField name="headers" type={<><span><a href="#httpheader">HttpHeader</a></span><span>[]</span></>} required>
1906+
<ResponseField name="headers" type={<a href="#httpheader">HttpHeader[]</a>} required>
19071907
HTTP headers to set when making requests to the MCP server.
19081908
</ResponseField>
19091909
<ResponseField name="name" type={"string"} required>
@@ -1939,7 +1939,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
19391939
<ResponseField name="command" type={"string"} required>
19401940
Path to the MCP server executable.
19411941
</ResponseField>
1942-
<ResponseField name="env" type={<><span><a href="#envvariable">EnvVariable</a></span><span>[]</span></>} required>
1942+
<ResponseField name="env" type={<a href="#envvariable">EnvVariable[]</a>} required>
19431943
Environment variables to set when launching the MCP server.
19441944
</ResponseField>
19451945
<ResponseField name="name" type={"string"} required>
@@ -1965,7 +1965,7 @@ these keys.
19651965
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
19661966

19671967
</ResponseField>
1968-
<ResponseField name="headers" type={<><span><a href="#httpheader">HttpHeader</a></span><span>[]</span></>} required>
1968+
<ResponseField name="headers" type={<a href="#httpheader">HttpHeader[]</a>} required>
19691969
HTTP headers to set when making requests to the MCP server.
19701970
</ResponseField>
19711971
<ResponseField name="name" type={"string"} required>
@@ -1991,7 +1991,7 @@ these keys.
19911991
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
19921992

19931993
</ResponseField>
1994-
<ResponseField name="headers" type={<><span><a href="#httpheader">HttpHeader</a></span><span>[]</span></>} required>
1994+
<ResponseField name="headers" type={<a href="#httpheader">HttpHeader[]</a>} required>
19951995
HTTP headers to set when making requests to the MCP server.
19961996
</ResponseField>
19971997
<ResponseField name="name" type={"string"} required>
@@ -2023,7 +2023,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
20232023
<ResponseField name="command" type={"string"} required>
20242024
Path to the MCP server executable.
20252025
</ResponseField>
2026-
<ResponseField name="env" type={<><span><a href="#envvariable">EnvVariable</a></span><span>[]</span></>} required>
2026+
<ResponseField name="env" type={<a href="#envvariable">EnvVariable[]</a>} required>
20272027
Environment variables to set when launching the MCP server.
20282028
</ResponseField>
20292029
<ResponseField name="name" type={"string"} required>
@@ -2108,7 +2108,7 @@ these keys.
21082108
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
21092109

21102110
</ResponseField>
2111-
<ResponseField name="entries" type={<><span><a href="#planentry">PlanEntry</a></span><span>[]</span></>} required>
2111+
<ResponseField name="entries" type={<a href="#planentry">PlanEntry[]</a>} required>
21122112
The list of tasks to be accomplished.
21132113

21142114
When updating a plan, the agent must send a complete list of all entries
@@ -2468,7 +2468,7 @@ these keys.
24682468
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
24692469

24702470
</ResponseField>
2471-
<ResponseField name="availableModes" type={<><span><a href="#sessionmode">SessionMode</a></span><span>[]</span></>} required>
2471+
<ResponseField name="availableModes" type={<a href="#sessionmode">SessionMode[]</a>} required>
24722472
The set of modes that the Agent can operate in
24732473
</ResponseField>
24742474
<ResponseField name="currentModeId" type={<a href="#sessionmodeid">SessionModeId</a>} required>
@@ -2564,14 +2564,14 @@ these keys.
25642564
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
25652565

25662566
</ResponseField>
2567-
<ResponseField name="content" type={<><span><a href="#toolcallcontent">ToolCallContent</a></span><span>[]</span></>} >
2567+
<ResponseField name="content" type={<a href="#toolcallcontent">ToolCallContent[]</a>} >
25682568
Content produced by the tool call.
25692569
</ResponseField>
25702570
<ResponseField name="kind" type={<a href="#toolkind">ToolKind</a>} >
25712571
The category of tool being invoked.
25722572
Helps clients choose appropriate icons and UI treatment.
25732573
</ResponseField>
2574-
<ResponseField name="locations" type={<><span><a href="#toolcalllocation">ToolCallLocation</a></span><span>[]</span></>} >
2574+
<ResponseField name="locations" type={<a href="#toolcalllocation">ToolCallLocation[]</a>} >
25752575
File locations affected by this tool call.
25762576
Enables "follow-along" features in clients.
25772577
</ResponseField>
@@ -2609,13 +2609,13 @@ these keys.
26092609
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
26102610

26112611
</ResponseField>
2612-
<ResponseField name="content" type={"array | null"} >
2612+
<ResponseField name="content" type={<><span><a href="#toolcallcontent">ToolCallContent[]</a></span><span> | null</span></>} >
26132613
Replace the content collection.
26142614
</ResponseField>
26152615
<ResponseField name="kind" type={<><span><a href="#toolkind">ToolKind</a></span><span> | null</span></>} >
26162616
Update the tool kind.
26172617
</ResponseField>
2618-
<ResponseField name="locations" type={"array | null"} >
2618+
<ResponseField name="locations" type={<><span><a href="#toolcalllocation">ToolCallLocation[]</a></span><span> | null</span></>} >
26192619
Replace the locations collection.
26202620
</ResponseField>
26212621
<ResponseField name="rawInput" type={"object"} >
@@ -2653,7 +2653,7 @@ these keys.
26532653
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
26542654

26552655
</ResponseField>
2656-
<ResponseField name="entries" type={<><span><a href="#planentry">PlanEntry</a></span><span>[]</span></>} required>
2656+
<ResponseField name="entries" type={<a href="#planentry">PlanEntry[]</a>} required>
26572657
The list of tasks to be accomplished.
26582658

26592659
When updating a plan, the agent must send a complete list of all entries
@@ -2679,7 +2679,7 @@ these keys.
26792679
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
26802680

26812681
</ResponseField>
2682-
<ResponseField name="availableCommands" type={<><span><a href="#availablecommand">AvailableCommand</a></span><span>[]</span></>} required>
2682+
<ResponseField name="availableCommands" type={<a href="#availablecommand">AvailableCommand[]</a>} required>
26832683
Commands the agent can execute
26842684
</ResponseField>
26852685
<ResponseField name="sessionUpdate" type={"string"} required>
@@ -2863,14 +2863,14 @@ these keys.
28632863
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
28642864

28652865
</ResponseField>
2866-
<ResponseField name="content" type={<><span><a href="#toolcallcontent">ToolCallContent</a></span><span>[]</span></>} >
2866+
<ResponseField name="content" type={<a href="#toolcallcontent">ToolCallContent[]</a>} >
28672867
Content produced by the tool call.
28682868
</ResponseField>
28692869
<ResponseField name="kind" type={<a href="#toolkind">ToolKind</a>} >
28702870
The category of tool being invoked.
28712871
Helps clients choose appropriate icons and UI treatment.
28722872
</ResponseField>
2873-
<ResponseField name="locations" type={<><span><a href="#toolcalllocation">ToolCallLocation</a></span><span>[]</span></>} >
2873+
<ResponseField name="locations" type={<a href="#toolcalllocation">ToolCallLocation[]</a>} >
28742874
File locations affected by this tool call.
28752875
Enables "follow-along" features in clients.
28762876
</ResponseField>
@@ -3061,13 +3061,13 @@ these keys.
30613061
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
30623062

30633063
</ResponseField>
3064-
<ResponseField name="content" type={"array | null"} >
3064+
<ResponseField name="content" type={<><span><a href="#toolcallcontent">ToolCallContent[]</a></span><span> | null</span></>} >
30653065
Replace the content collection.
30663066
</ResponseField>
30673067
<ResponseField name="kind" type={<><span><a href="#toolkind">ToolKind</a></span><span> | null</span></>} >
30683068
Update the tool kind.
30693069
</ResponseField>
3070-
<ResponseField name="locations" type={"array | null"} >
3070+
<ResponseField name="locations" type={<><span><a href="#toolcalllocation">ToolCallLocation[]</a></span><span> | null</span></>} >
30713071
Replace the locations collection.
30723072
</ResponseField>
30733073
<ResponseField name="rawInput" type={"object"} >

schema/meta.unstable.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"session_new": "session/new",
1010
"session_prompt": "session/prompt",
1111
"session_resume": "session/resume",
12+
"session_set_config_option": "session/set_config_option",
1213
"session_set_mode": "session/set_mode",
1314
"session_set_model": "session/set_model"
1415
},

0 commit comments

Comments
 (0)