Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions agent-client-protocol-schema/src/v1/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ impl AuthMethodTerminal {
/// Request parameters for creating a new session.
///
/// See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
#[serde_as]
#[skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
#[schemars(extend("x-side" = "agent", "x-method" = SESSION_NEW_METHOD_NAME))]
Expand All @@ -931,9 +932,13 @@ pub struct NewSessionRequest {
/// These expand the session's filesystem scope without changing `cwd`, which
/// remains the base for relative paths. When omitted or empty, no
/// additional roots are activated for the new session.
#[serde_as(deserialize_as = "DefaultOnError<VecSkipError<_, SkipListener>>")]
#[schemars(extend("x-deserialize-default-on-error" = true, "x-deserialize-skip-invalid-items" = true))]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub additional_directories: Vec<PathBuf>,
/// List of MCP (Model Context Protocol) servers the agent should connect to.
#[serde_as(deserialize_as = "DefaultOnError<VecSkipError<_, SkipListener>>")]
#[schemars(extend("x-deserialize-default-on-error" = true, "x-deserialize-skip-invalid-items" = true))]
pub mcp_servers: Vec<McpServer>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
Expand Down
8 changes: 6 additions & 2 deletions agent-client-protocol-schema/src/v2/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ impl AuthMethodTerminal {
/// Request parameters for creating a new session.
///
/// See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
#[serde_as]
#[skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
#[schemars(extend("x-side" = "agent", "x-method" = SESSION_NEW_METHOD_NAME))]
Expand All @@ -1007,9 +1008,14 @@ pub struct NewSessionRequest {
/// These expand the session's workspace scope without changing `cwd`, which
/// remains the base for relative paths. When omitted or empty, no
/// additional roots are activated for the new session.
#[serde_as(deserialize_as = "DefaultOnError<VecSkipError<_, SkipListener>>")]
#[schemars(extend("x-deserialize-default-on-error" = true, "x-deserialize-skip-invalid-items" = true))]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub additional_directories: Vec<PathBuf>,
/// List of MCP (Model Context Protocol) servers the agent should connect to.
#[serde_as(deserialize_as = "DefaultOnError<VecSkipError<_, SkipListener>>")]
#[schemars(extend("x-deserialize-default-on-error" = true, "x-deserialize-skip-invalid-items" = true))]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub mcp_servers: Vec<McpServer>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
Expand Down Expand Up @@ -5649,7 +5655,6 @@ mod test_serialization {
serde_json::to_value(NewSessionRequest::new("/home/user/project")).unwrap(),
json!({
"cwd": "/home/user/project",
"mcpServers": []
})
);
assert_eq!(
Expand All @@ -5666,7 +5671,6 @@ mod test_serialization {
"/home/user/shared-lib",
"/home/user/product-docs"
],
"mcpServers": []
})
);
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion docs/protocol/v2/draft/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ additional roots are activated for the new session.
<ResponseField name="cwd" type={"string"} required>
The working directory for this session. Must be an absolute path.
</ResponseField>
<ResponseField name="mcpServers" type={<a href="#mcpserver">McpServer[]</a>} required>
<ResponseField name="mcpServers" type={<a href="#mcpserver">McpServer[]</a>} >
List of MCP (Model Context Protocol) servers the agent should connect to.
</ResponseField>

Expand Down
2 changes: 1 addition & 1 deletion docs/protocol/v2/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ additional roots are activated for the new session.
<ResponseField name="cwd" type={"string"} required>
The working directory for this session. Must be an absolute path.
</ResponseField>
<ResponseField name="mcpServers" type={<a href="#mcpserver">McpServer[]</a>} required>
<ResponseField name="mcpServers" type={<a href="#mcpserver">McpServer[]</a>} >
List of MCP (Model Context Protocol) servers the agent should connect to.
</ResponseField>

Expand Down
8 changes: 6 additions & 2 deletions schema/v1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3456,14 +3456,18 @@
"type": "array",
"items": {
"type": "string"
}
},
"x-deserialize-default-on-error": true,
"x-deserialize-skip-invalid-items": true
},
"mcpServers": {
"description": "List of MCP (Model Context Protocol) servers the agent should connect to.",
"type": "array",
"items": {
"$ref": "#/$defs/McpServer"
}
},
"x-deserialize-default-on-error": true,
"x-deserialize-skip-invalid-items": true
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
Expand Down
8 changes: 6 additions & 2 deletions schema/v1/schema.unstable.json
Original file line number Diff line number Diff line change
Expand Up @@ -6289,14 +6289,18 @@
"type": "array",
"items": {
"type": "string"
}
},
"x-deserialize-default-on-error": true,
"x-deserialize-skip-invalid-items": true
},
"mcpServers": {
"description": "List of MCP (Model Context Protocol) servers the agent should connect to.",
"type": "array",
"items": {
"$ref": "#/$defs/McpServer"
}
},
"x-deserialize-default-on-error": true,
"x-deserialize-skip-invalid-items": true
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
Expand Down
10 changes: 7 additions & 3 deletions schema/v2/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4036,22 +4036,26 @@
"type": "array",
"items": {
"type": "string"
}
},
"x-deserialize-default-on-error": true,
"x-deserialize-skip-invalid-items": true
},
"mcpServers": {
"description": "List of MCP (Model Context Protocol) servers the agent should connect to.",
"type": "array",
"items": {
"$ref": "#/$defs/McpServer"
}
},
"x-deserialize-default-on-error": true,
"x-deserialize-skip-invalid-items": true
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
"type": ["object", "null"],
"additionalProperties": true
}
},
"required": ["cwd", "mcpServers"],
"required": ["cwd"],
"x-side": "agent",
"x-method": "session/new"
},
Expand Down
10 changes: 7 additions & 3 deletions schema/v2/schema.unstable.json
Original file line number Diff line number Diff line change
Expand Up @@ -6949,22 +6949,26 @@
"type": "array",
"items": {
"type": "string"
}
},
"x-deserialize-default-on-error": true,
"x-deserialize-skip-invalid-items": true
},
"mcpServers": {
"description": "List of MCP (Model Context Protocol) servers the agent should connect to.",
"type": "array",
"items": {
"$ref": "#/$defs/McpServer"
}
},
"x-deserialize-default-on-error": true,
"x-deserialize-skip-invalid-items": true
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
"type": ["object", "null"],
"additionalProperties": true
}
},
"required": ["cwd", "mcpServers"],
"required": ["cwd"],
"x-side": "agent",
"x-method": "session/new"
},
Expand Down