Skip to content

Commit 1dcd96a

Browse files
authored
Generate a separate schema for unstable features (#249)
1 parent 6432ee1 commit 1dcd96a

File tree

9 files changed

+5111
-254
lines changed

9 files changed

+5111
-254
lines changed

docs/protocol/schema.mdx

Lines changed: 0 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,6 @@ Response from loading an existing session.
244244

245245
<ResponseField name="_meta" type={"object"} >
246246
Extension point for implementations
247-
</ResponseField>
248-
<ResponseField name="models" type={<><span><a href="#sessionmodelstate">SessionModelState</a></span><span> | null</span></>} >
249-
**UNSTABLE**
250-
251-
This capability is not part of the spec yet, and may be removed or changed at any point.
252-
253-
Initial model state if supported by the Agent
254-
255247
</ResponseField>
256248
<ResponseField name="modes" type={<><span><a href="#sessionmodestate">SessionModeState</a></span><span> | null</span></>} >
257249
Initial mode state if supported by the Agent
@@ -320,14 +312,6 @@ See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol
320312

321313
<ResponseField name="_meta" type={"object"} >
322314
Extension point for implementations
323-
</ResponseField>
324-
<ResponseField name="models" type={<><span><a href="#sessionmodelstate">SessionModelState</a></span><span> | null</span></>} >
325-
**UNSTABLE**
326-
327-
This capability is not part of the spec yet, and may be removed or changed at any point.
328-
329-
Initial model state if supported by the Agent
330-
331315
</ResponseField>
332316
<ResponseField name="modes" type={<><span><a href="#sessionmodestate">SessionModeState</a></span><span> | null</span></>} >
333317
Initial mode state if supported by the Agent
@@ -467,57 +451,6 @@ Response to `session/set_mode` method.
467451

468452
<ResponseField name="_meta" type={"object"}></ResponseField>
469453

470-
<a id="session-set_model"></a>
471-
### <span class="font-mono">session/set_model</span>
472-
473-
**UNSTABLE**
474-
475-
This capability is not part of the spec yet, and may be removed or changed at any point.
476-
477-
Select a model for a given session.
478-
479-
#### <span class="font-mono">SetSessionModelRequest</span>
480-
481-
**UNSTABLE**
482-
483-
This capability is not part of the spec yet, and may be removed or changed at any point.
484-
485-
Request parameters for setting a session model.
486-
487-
**Type:** Object
488-
489-
**Properties:**
490-
491-
<ResponseField name="_meta" type={"object"}>
492-
Extension point for implementations
493-
</ResponseField>
494-
<ResponseField name="modelId" type={<a href="#modelid">ModelId</a>} required>
495-
The ID of the model to set.
496-
</ResponseField>
497-
<ResponseField
498-
name="sessionId"
499-
type={<a href="#sessionid">SessionId</a>}
500-
required
501-
>
502-
The ID of the session to set the model for.
503-
</ResponseField>
504-
505-
#### <span class="font-mono">SetSessionModelResponse</span>
506-
507-
**UNSTABLE**
508-
509-
This capability is not part of the spec yet, and may be removed or changed at any point.
510-
511-
Response to `session/set_model` method.
512-
513-
**Type:** Object
514-
515-
**Properties:**
516-
517-
<ResponseField name="_meta" type={"object"}>
518-
Extension point for implementations
519-
</ResponseField>
520-
521454
## Client
522455

523456
Defines the interface that ACP-compliant clients must implement.
@@ -1671,41 +1604,6 @@ All Agents MUST support this transport.
16711604
</Expandable>
16721605
</ResponseField>
16731606

1674-
## <span class="font-mono">ModelId</span>
1675-
1676-
**UNSTABLE**
1677-
1678-
This capability is not part of the spec yet, and may be removed or changed at any point.
1679-
1680-
A unique identifier for a model.
1681-
1682-
**Type:** `string`
1683-
1684-
## <span class="font-mono">ModelInfo</span>
1685-
1686-
**UNSTABLE**
1687-
1688-
This capability is not part of the spec yet, and may be removed or changed at any point.
1689-
1690-
Information about a selectable model.
1691-
1692-
**Type:** Object
1693-
1694-
**Properties:**
1695-
1696-
<ResponseField name="_meta" type={"object"}>
1697-
Extension point for implementations
1698-
</ResponseField>
1699-
<ResponseField name="description" type={"string | null"}>
1700-
Optional description of the model.
1701-
</ResponseField>
1702-
<ResponseField name="modelId" type={<a href="#modelid">ModelId</a>} required>
1703-
Unique identifier for the model.
1704-
</ResponseField>
1705-
<ResponseField name="name" type={"string"} required>
1706-
Human-readable name of the model.
1707-
</ResponseField>
1708-
17091607
## <span class="font-mono">PermissionOption</span>
17101608

17111609
An option presented to the user when requesting permission.
@@ -2028,43 +1926,6 @@ The set of modes and the one currently active.
20281926
The current mode the Agent is in.
20291927
</ResponseField>
20301928

2031-
## <span class="font-mono">SessionModelState</span>
2032-
2033-
**UNSTABLE**
2034-
2035-
This capability is not part of the spec yet, and may be removed or changed at any point.
2036-
2037-
The set of models and the one currently active.
2038-
2039-
**Type:** Object
2040-
2041-
**Properties:**
2042-
2043-
<ResponseField name="_meta" type={"object"}>
2044-
Extension point for implementations
2045-
</ResponseField>
2046-
<ResponseField
2047-
name="availableModels"
2048-
type={
2049-
<>
2050-
<span>
2051-
<a href="#modelinfo">ModelInfo</a>
2052-
</span>
2053-
<span>[]</span>
2054-
</>
2055-
}
2056-
required
2057-
>
2058-
The set of models that the Agent can use
2059-
</ResponseField>
2060-
<ResponseField
2061-
name="currentModelId"
2062-
type={<a href="#modelid">ModelId</a>}
2063-
required
2064-
>
2065-
The current model the Agent is in.
2066-
</ResponseField>
2067-
20681929
## <span class="font-mono">SessionUpdate</span>
20691930

20701931
Different types of updates that can be sent during session processing.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
],
2222
"type": "module",
2323
"scripts": {
24-
"generate:json-schema": "cd rust && cargo run --bin generate --features unstable",
25-
"generate": "npm run generate:json-schema && npm run format",
24+
"generate:json-schema": "cd rust && cargo run --bin generate",
25+
"generate:json-schema:unstable": "cd rust && cargo run --bin generate --features unstable ../unstable",
26+
"generate": "npm run generate:json-schema && npm run generate:json-schema:unstable && npm run format",
2627
"format": "prettier --write . && cargo fmt",
2728
"format:check": "prettier --check . && cargo fmt -- --check",
2829
"spellcheck": "./scripts/spellcheck.sh",

rust/bin/generate.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use agent_client_protocol_schema::{
33
OutgoingMessage, VERSION,
44
};
55
use schemars::{JsonSchema, generate::SchemaSettings};
6-
use std::{fs, path::Path};
6+
use std::{env, fs, path::Path};
77

88
use markdown_generator::MarkdownGenerator;
99

@@ -39,7 +39,8 @@ fn main() {
3939
// Convert to serde_json::Value for post-processing
4040
let schema_value = serde_json::to_value(&schema).unwrap();
4141

42-
let root = env!("CARGO_MANIFEST_DIR");
42+
let root_arg = env::args().nth(1);
43+
let root = root_arg.as_deref().unwrap_or(env!("CARGO_MANIFEST_DIR"));
4344
let schema_dir = Path::new(root).join("schema");
4445
let docs_protocol_dir = Path::new(root).join("docs").join("protocol");
4546

schema/meta.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"session_load": "session/load",
77
"session_new": "session/new",
88
"session_prompt": "session/prompt",
9-
"session_set_mode": "session/set_mode",
10-
"session_set_model": "session/set_model"
9+
"session_set_mode": "session/set_mode"
1110
},
1211
"clientMethods": {
1312
"fs_read_text_file": "fs/read_text_file",

schema/schema.json

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,6 @@
239239
"$ref": "#/$defs/PromptResponse",
240240
"title": "PromptResponse"
241241
},
242-
{
243-
"$ref": "#/$defs/SetSessionModelResponse",
244-
"title": "SetSessionModelResponse"
245-
},
246242
{
247243
"title": "ExtMethodResponse"
248244
}
@@ -592,11 +588,6 @@
592588
"description": "Processes a user prompt within a session.\n\nThis method handles the whole lifecycle of a prompt:\n- Receives user messages with optional context (files, images, etc.)\n- Processes the prompt using language models\n- Reports language model content and tool calls to the Clients\n- Requests permission to run tools\n- Executes any requested tool calls\n- Returns when the turn is complete with a stop reason\n\nSee protocol docs: [Prompt Turn](https://agentclientprotocol.com/protocol/prompt-turn)",
593589
"title": "PromptRequest"
594590
},
595-
{
596-
"$ref": "#/$defs/SetSessionModelRequest",
597-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nSelect a model for a given session.",
598-
"title": "SetSessionModelRequest"
599-
},
600591
{
601592
"description": "Handles extension method requests from the client.\n\nExtension methods provide a way to add custom functionality while maintaining\nprotocol compatibility.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
602593
"title": "ExtMethodRequest"
@@ -1133,17 +1124,6 @@
11331124
"_meta": {
11341125
"description": "Extension point for implementations"
11351126
},
1136-
"models": {
1137-
"anyOf": [
1138-
{
1139-
"$ref": "#/$defs/SessionModelState"
1140-
},
1141-
{
1142-
"type": "null"
1143-
}
1144-
],
1145-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent"
1146-
},
11471127
"modes": {
11481128
"anyOf": [
11491129
{
@@ -1269,32 +1249,6 @@
12691249
"propertyName": "type"
12701250
}
12711251
},
1272-
"ModelId": {
1273-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA unique identifier for a model.",
1274-
"type": "string"
1275-
},
1276-
"ModelInfo": {
1277-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInformation about a selectable model.",
1278-
"properties": {
1279-
"_meta": {
1280-
"description": "Extension point for implementations"
1281-
},
1282-
"description": {
1283-
"description": "Optional description of the model.",
1284-
"type": ["string", "null"]
1285-
},
1286-
"modelId": {
1287-
"$ref": "#/$defs/ModelId",
1288-
"description": "Unique identifier for the model."
1289-
},
1290-
"name": {
1291-
"description": "Human-readable name of the model.",
1292-
"type": "string"
1293-
}
1294-
},
1295-
"required": ["modelId", "name"],
1296-
"type": "object"
1297-
},
12981252
"NewSessionRequest": {
12991253
"description": "Request parameters for creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)",
13001254
"properties": {
@@ -1324,17 +1278,6 @@
13241278
"_meta": {
13251279
"description": "Extension point for implementations"
13261280
},
1327-
"models": {
1328-
"anyOf": [
1329-
{
1330-
"$ref": "#/$defs/SessionModelState"
1331-
},
1332-
{
1333-
"type": "null"
1334-
}
1335-
],
1336-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nInitial model state if supported by the Agent"
1337-
},
13381281
"modes": {
13391282
"anyOf": [
13401283
{
@@ -1803,27 +1746,6 @@
18031746
"required": ["currentModeId", "availableModes"],
18041747
"type": "object"
18051748
},
1806-
"SessionModelState": {
1807-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe set of models and the one currently active.",
1808-
"properties": {
1809-
"_meta": {
1810-
"description": "Extension point for implementations"
1811-
},
1812-
"availableModels": {
1813-
"description": "The set of models that the Agent can use",
1814-
"items": {
1815-
"$ref": "#/$defs/ModelInfo"
1816-
},
1817-
"type": "array"
1818-
},
1819-
"currentModelId": {
1820-
"$ref": "#/$defs/ModelId",
1821-
"description": "The current model the Agent is in."
1822-
}
1823-
},
1824-
"required": ["currentModelId", "availableModels"],
1825-
"type": "object"
1826-
},
18271749
"SessionNotification": {
18281750
"description": "Notification containing a session update from the agent.\n\nUsed to stream real-time progress and results during prompt processing.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)",
18291751
"properties": {
@@ -2109,37 +2031,6 @@
21092031
"x-method": "session/set_mode",
21102032
"x-side": "agent"
21112033
},
2112-
"SetSessionModelRequest": {
2113-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for setting a session model.",
2114-
"properties": {
2115-
"_meta": {
2116-
"description": "Extension point for implementations"
2117-
},
2118-
"modelId": {
2119-
"$ref": "#/$defs/ModelId",
2120-
"description": "The ID of the model to set."
2121-
},
2122-
"sessionId": {
2123-
"$ref": "#/$defs/SessionId",
2124-
"description": "The ID of the session to set the model for."
2125-
}
2126-
},
2127-
"required": ["sessionId", "modelId"],
2128-
"type": "object",
2129-
"x-method": "session/set_model",
2130-
"x-side": "agent"
2131-
},
2132-
"SetSessionModelResponse": {
2133-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `session/set_model` method.",
2134-
"properties": {
2135-
"_meta": {
2136-
"description": "Extension point for implementations"
2137-
}
2138-
},
2139-
"type": "object",
2140-
"x-method": "session/set_model",
2141-
"x-side": "agent"
2142-
},
21432034
"StopReason": {
21442035
"description": "Reasons why an agent stops processing a prompt turn.\n\nSee protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)",
21452036
"oneOf": [

unstable/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Unstable docs and schema
2+
3+
This is a place for reviewing in-progress protocol work and the generated documentation and schema changes.

0 commit comments

Comments
 (0)