diff --git a/agent-client-protocol-schema/src/v2/agent.rs b/agent-client-protocol-schema/src/v2/agent.rs index 1d27cb13e..a3f3684ce 100644 --- a/agent-client-protocol-schema/src/v2/agent.rs +++ b/agent-client-protocol-schema/src/v2/agent.rs @@ -57,13 +57,13 @@ use super::{ pub struct InitializeRequest { /// The latest protocol version supported by the client. pub protocol_version: ProtocolVersion, + /// Information about the implementation sending this initialize request. + pub info: Implementation, /// Capabilities supported by the client. #[serde_as(deserialize_as = "DefaultOnError")] #[schemars(extend("x-deserialize-default-on-error" = true))] #[serde(default)] pub capabilities: ClientCapabilities, - /// Information about the implementation sending this initialize request. - pub info: Implementation, /// 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 /// these keys. @@ -124,6 +124,8 @@ pub struct InitializeResponse { /// /// The client should disconnect, if it doesn't support this version. pub protocol_version: ProtocolVersion, + /// Information about the implementation sending this initialize response. + pub info: Implementation, /// Capabilities supported by the agent. #[serde_as(deserialize_as = "DefaultOnError")] #[schemars(extend("x-deserialize-default-on-error" = true))] @@ -134,8 +136,6 @@ pub struct InitializeResponse { #[schemars(extend("x-deserialize-default-on-error" = true, "x-deserialize-skip-invalid-items" = true))] #[serde(default)] pub auth_methods: Vec, - /// Information about the implementation sending this initialize response. - pub info: Implementation, /// 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 /// these keys. @@ -1231,10 +1231,8 @@ impl NewSessionResponse { #[serde(rename_all = "camelCase")] #[non_exhaustive] pub struct LoadSessionRequest { - /// List of MCP servers to connect to for this session. - #[serde_as(deserialize_as = "DefaultOnError>")] - #[schemars(extend("x-deserialize-default-on-error" = true, "x-deserialize-skip-invalid-items" = true))] - pub mcp_servers: Vec, + /// The ID of the session to load. + pub session_id: SessionId, /// The working directory for this session. pub cwd: PathBuf, /// Additional workspace roots to activate for this session. Each path must be absolute. @@ -1247,8 +1245,10 @@ pub struct LoadSessionRequest { #[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, - /// The ID of the session to load. - pub session_id: SessionId, + /// List of MCP servers to connect to for this session. + #[serde_as(deserialize_as = "DefaultOnError>")] + #[schemars(extend("x-deserialize-default-on-error" = true, "x-deserialize-skip-invalid-items" = true))] + pub mcp_servers: Vec, /// 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 /// these keys. @@ -3902,7 +3902,7 @@ pub struct AgentCapabilities { #[serde_as(deserialize_as = "DefaultOnError")] #[schemars(extend("x-deserialize-default-on-error" = true))] #[serde(default)] - pub auth: AgentAuthCapabilities, + pub auth: Option, /// **UNSTABLE** /// /// This capability is not part of the spec yet, and may be removed or changed at any point. @@ -3968,8 +3968,8 @@ impl AgentCapabilities { /// Authentication-related capabilities supported by the agent. #[must_use] - pub fn auth(mut self, auth: AgentAuthCapabilities) -> Self { - self.auth = auth; + pub fn auth(mut self, auth: impl IntoOption) -> Self { + self.auth = auth.into_option(); self } @@ -4804,10 +4804,10 @@ pub struct McpCapabilities { /// This capability is not part of the spec yet, and may be removed or changed at any point. /// /// Agent supports [`McpServer::Acp`]. - #[cfg(feature = "unstable_mcp_over_acp")] /// /// Optional. Omitted or `null` both mean the agent does not advertise support. /// Supplying `{}` means the agent supports ACP MCP server transports. + #[cfg(feature = "unstable_mcp_over_acp")] #[serde_as(deserialize_as = "DefaultOnError")] #[schemars(extend("x-deserialize-default-on-error" = true))] #[serde(default)] @@ -5001,6 +5001,52 @@ impl McpAcpCapabilities { } } +/// Notification to cancel ongoing operations for a session. +/// +/// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-lifecycle#cancellation) +#[serde_as] +#[skip_serializing_none] +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[schemars(extend("x-side" = "agent", "x-method" = SESSION_CANCEL_METHOD_NAME))] +#[serde(rename_all = "camelCase")] +#[non_exhaustive] +pub struct CancelSessionNotification { + /// The ID of the session to cancel operations for. + pub session_id: SessionId, + /// 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 + /// these keys. + /// + /// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + #[serde_as(deserialize_as = "DefaultOnError")] + #[schemars(extend("x-deserialize-default-on-error" = true))] + #[serde(default)] + #[serde(rename = "_meta")] + pub meta: Option, +} + +impl CancelSessionNotification { + /// Builds [`CancelSessionNotification`] with the required notification fields set; optional fields start unset or empty. + #[must_use] + pub fn new(session_id: impl Into) -> Self { + Self { + session_id: session_id.into(), + meta: None, + } + } + + /// 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 + /// these keys. + /// + /// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) + #[must_use] + pub fn meta(mut self, meta: impl IntoOption) -> Self { + self.meta = meta.into_option(); + self + } +} + // Method schema /// Names of all methods that agents handle. @@ -5458,7 +5504,7 @@ pub enum ClientNotification { /// cancellation succeeds /// /// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-lifecycle#cancellation) - CancelNotification(CancelNotification), + CancelSessionNotification(CancelSessionNotification), #[cfg(feature = "unstable_nes")] /// **UNSTABLE** /// @@ -5515,7 +5561,7 @@ impl ClientNotification { #[must_use] pub fn method(&self) -> &str { match self { - Self::CancelNotification(_) => AGENT_METHOD_NAMES.session_cancel, + Self::CancelSessionNotification(_) => AGENT_METHOD_NAMES.session_cancel, #[cfg(feature = "unstable_nes")] Self::DidOpenDocumentNotification(_) => AGENT_METHOD_NAMES.document_did_open, #[cfg(feature = "unstable_nes")] @@ -5537,52 +5583,6 @@ impl ClientNotification { } } -/// Notification to cancel ongoing operations for a session. -/// -/// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-lifecycle#cancellation) -#[serde_as] -#[skip_serializing_none] -#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] -#[schemars(extend("x-side" = "agent", "x-method" = SESSION_CANCEL_METHOD_NAME))] -#[serde(rename_all = "camelCase")] -#[non_exhaustive] -pub struct CancelNotification { - /// The ID of the session to cancel operations for. - pub session_id: SessionId, - /// 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 - /// these keys. - /// - /// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) - #[serde_as(deserialize_as = "DefaultOnError")] - #[schemars(extend("x-deserialize-default-on-error" = true))] - #[serde(default)] - #[serde(rename = "_meta")] - pub meta: Option, -} - -impl CancelNotification { - /// Builds [`CancelNotification`] with the required notification fields set; optional fields start unset or empty. - #[must_use] - pub fn new(session_id: impl Into) -> Self { - Self { - session_id: session_id.into(), - meta: None, - } - } - - /// 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 - /// these keys. - /// - /// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) - #[must_use] - pub fn meta(mut self, meta: impl IntoOption) -> Self { - self.meta = meta.into_option(); - self - } -} - #[cfg(test)] mod test_serialization { use super::*; @@ -5633,7 +5633,7 @@ mod test_serialization { .unwrap(); assert!(capabilities.session.is_none()); - assert_eq!(capabilities.auth, AgentAuthCapabilities::default()); + assert_eq!(capabilities.auth, None); } #[test] @@ -6923,7 +6923,6 @@ mod test_serialization { assert_eq!( serde_json::to_value(&caps).unwrap(), json!({ - "auth": {}, "session": { "prompt": { "image": {} diff --git a/agent-client-protocol-schema/src/v2/conversion.rs b/agent-client-protocol-schema/src/v2/conversion.rs index 283da4e4f..7c8d89544 100644 --- a/agent-client-protocol-schema/src/v2/conversion.rs +++ b/agent-client-protocol-schema/src/v2/conversion.rs @@ -4767,7 +4767,7 @@ impl IntoV1 for super::AgentCapabilities { prompt_capabilities, mcp_capabilities, session_capabilities, - auth: auth.into_v1()?, + auth: auth.map(IntoV1::into_v1).transpose()?.unwrap_or_default(), #[cfg(feature = "unstable_llm_providers")] providers: into_v1_default_on_error(providers), #[cfg(feature = "unstable_nes")] @@ -4806,7 +4806,7 @@ impl IntoV2 for crate::v1::AgentCapabilities { Ok(super::AgentCapabilities { session: Some(session), - auth: auth.into_v2()?, + auth: Some(auth.into_v2()?), #[cfg(feature = "unstable_llm_providers")] providers: into_v2_default_on_error(providers), #[cfg(feature = "unstable_nes")] @@ -5458,7 +5458,7 @@ impl IntoV1 for super::ClientNotification { fn into_v1(self) -> Result { Ok(match self { - Self::CancelNotification(value) => { + Self::CancelSessionNotification(value) => { crate::v1::ClientNotification::CancelNotification(value.into_v1()?) } #[cfg(feature = "unstable_nes")] @@ -5506,7 +5506,7 @@ impl IntoV2 for crate::v1::ClientNotification { fn into_v2(self) -> Result { Ok(match self { Self::CancelNotification(value) => { - super::ClientNotification::CancelNotification(value.into_v2()?) + super::ClientNotification::CancelSessionNotification(value.into_v2()?) } #[cfg(feature = "unstable_nes")] Self::DidOpenDocumentNotification(value) => { @@ -5547,7 +5547,7 @@ impl IntoV2 for crate::v1::ClientNotification { } } -impl IntoV1 for super::CancelNotification { +impl IntoV1 for super::CancelSessionNotification { type Output = crate::v1::CancelNotification; fn into_v1(self) -> Result { @@ -5560,11 +5560,11 @@ impl IntoV1 for super::CancelNotification { } impl IntoV2 for crate::v1::CancelNotification { - type Output = super::CancelNotification; + type Output = super::CancelSessionNotification; fn into_v2(self) -> Result { let Self { session_id, meta } = self; - Ok(super::CancelNotification { + Ok(super::CancelSessionNotification { session_id: session_id.into_v2()?, meta: meta.into_v2()?, }) diff --git a/docs/protocol/v2/draft/schema.mdx b/docs/protocol/v2/draft/schema.mdx index 6544c2cbd..21348c775 100644 --- a/docs/protocol/v2/draft/schema.mdx +++ b/docs/protocol/v2/draft/schema.mdx @@ -363,7 +363,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d AgentCapabilities} > Capabilities supported by the agent. - - Default: `{"auth":{}}` + - Default: `{}` Implementation} required> @@ -894,7 +894,7 @@ Upon receiving this notification, the Agent SHOULD: See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation) -#### CancelNotification +#### CancelSessionNotification Notification to cancel ongoing operations for a session. @@ -2130,11 +2130,8 @@ these keys. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility) -AgentAuthCapabilities} > +AgentAuthCapabilities | null} > Authentication-related capabilities supported by the agent. - - - Default: `{}` - NesCapabilities | null} > **UNSTABLE** diff --git a/docs/protocol/v2/schema.mdx b/docs/protocol/v2/schema.mdx index ea7b9cc59..d8446541b 100644 --- a/docs/protocol/v2/schema.mdx +++ b/docs/protocol/v2/schema.mdx @@ -189,7 +189,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/e AgentCapabilities} > Capabilities supported by the agent. - - Default: `{"auth":{}}` + - Default: `{}` Implementation} required> @@ -221,7 +221,7 @@ Upon receiving this notification, the Agent SHOULD: See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/prompt-lifecycle#cancellation) -#### CancelNotification +#### CancelSessionNotification Notification to cancel ongoing operations for a session. @@ -904,11 +904,8 @@ these keys. See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility) -AgentAuthCapabilities} > +AgentAuthCapabilities | null} > Authentication-related capabilities supported by the agent. - - - Default: `{}` - SessionCapabilities | null} > Session capabilities supported by the agent. diff --git a/schema-generator/src/main.rs b/schema-generator/src/main.rs index 57ce02d49..d0e24f95c 100644 --- a/schema-generator/src/main.rs +++ b/schema-generator/src/main.rs @@ -1885,7 +1885,11 @@ starting with '$/' it is free to ignore the notification." self.agent.get("SetSessionConfigOptionRequest").unwrap() } "session/prompt" => self.agent.get("PromptRequest").unwrap(), - "session/cancel" => self.agent.get("CancelNotification").unwrap(), + "session/cancel" => self + .agent + .get("CancelSessionNotification") + .or_else(|| self.agent.get("CancelNotification")) + .unwrap(), "session/close" => self.agent.get("CloseSessionRequest").unwrap(), "logout" => self.agent.get("LogoutRequest").unwrap(), "auth/logout" => self.agent.get("LogoutAuthRequest").unwrap(), diff --git a/schema/v2/schema.json b/schema/v2/schema.json index 457798b38..b54695397 100644 --- a/schema/v2/schema.json +++ b/schema/v2/schema.json @@ -1550,12 +1550,18 @@ } ] }, + "info": { + "description": "Information about the implementation sending this initialize response.", + "allOf": [ + { + "$ref": "#/$defs/Implementation" + } + ] + }, "capabilities": { "description": "Capabilities supported by the agent.", "x-deserialize-default-on-error": true, - "default": { - "auth": {} - }, + "default": {}, "allOf": [ { "$ref": "#/$defs/AgentCapabilities" @@ -1572,14 +1578,6 @@ "x-deserialize-default-on-error": true, "x-deserialize-skip-invalid-items": true }, - "info": { - "description": "Information about the implementation sending this initialize response.", - "allOf": [ - { - "$ref": "#/$defs/Implementation" - } - ] - }, "_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/v2/extensibility)", "type": ["object", "null"], @@ -1598,6 +1596,32 @@ "minimum": 0, "maximum": 65535 }, + "Implementation": { + "description": "Metadata about the implementation of the client or agent.\nDescribes the name and version of an ACP implementation, with an optional\ntitle for UI representation.", + "type": "object", + "properties": { + "name": { + "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present.", + "type": "string" + }, + "title": { + "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.", + "type": ["string", "null"], + "x-deserialize-default-on-error": true + }, + "version": { + "description": "Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. \"1.0.0\").", + "type": "string" + }, + "_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/v2/extensibility)", + "type": ["object", "null"], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": ["name", "version"] + }, "AgentCapabilities": { "description": "Capabilities supported by the agent.\n\nAdvertised during initialization to inform the client about\navailable features and content types.\n\nSee protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/v2/initialization#agent-capabilities)", "type": "object", @@ -1616,13 +1640,15 @@ }, "auth": { "description": "Authentication-related capabilities supported by the agent.", - "x-deserialize-default-on-error": true, - "default": {}, - "allOf": [ + "anyOf": [ { "$ref": "#/$defs/AgentAuthCapabilities" + }, + { + "type": "null" } - ] + ], + "x-deserialize-default-on-error": 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/v2/extensibility)", @@ -2073,32 +2099,6 @@ }, "required": ["id", "name"] }, - "Implementation": { - "description": "Metadata about the implementation of the client or agent.\nDescribes the name and version of an ACP implementation, with an optional\ntitle for UI representation.", - "type": "object", - "properties": { - "name": { - "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present.", - "type": "string" - }, - "title": { - "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.", - "type": ["string", "null"], - "x-deserialize-default-on-error": true - }, - "version": { - "description": "Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. \"1.0.0\").", - "type": "string" - }, - "_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/v2/extensibility)", - "type": ["object", "null"], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": ["name", "version"] - }, "LoginAuthResponse": { "description": "Response to the `auth/login` method.", "type": "object", @@ -4050,21 +4050,21 @@ } ] }, - "capabilities": { - "description": "Capabilities supported by the client.", - "x-deserialize-default-on-error": true, - "default": {}, + "info": { + "description": "Information about the implementation sending this initialize request.", "allOf": [ { - "$ref": "#/$defs/ClientCapabilities" + "$ref": "#/$defs/Implementation" } ] }, - "info": { - "description": "Information about the implementation sending this initialize request.", + "capabilities": { + "description": "Capabilities supported by the client.", + "x-deserialize-default-on-error": true, + "default": {}, "allOf": [ { - "$ref": "#/$defs/Implementation" + "$ref": "#/$defs/ClientCapabilities" } ] }, @@ -4357,14 +4357,13 @@ "description": "Request parameters for loading an existing session.\n\nOnly available if the Agent supports the `session.load` capability.\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/v2/session-setup#loading-sessions)", "type": "object", "properties": { - "mcpServers": { - "description": "List of MCP servers to connect to for this session.", - "type": "array", - "items": { - "$ref": "#/$defs/McpServer" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "sessionId": { + "description": "The ID of the session to load.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, "cwd": { "description": "The working directory for this session.", @@ -4379,13 +4378,14 @@ "x-deserialize-default-on-error": true, "x-deserialize-skip-invalid-items": true }, - "sessionId": { - "description": "The ID of the session to load.", - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ] + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "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/v2/extensibility)", @@ -4394,7 +4394,7 @@ "additionalProperties": true } }, - "required": ["mcpServers", "cwd", "sessionId"], + "required": ["sessionId", "cwd", "mcpServers"], "x-side": "agent", "x-method": "session/load" }, @@ -4747,11 +4747,11 @@ "description": "All possible notifications that a client can send to an agent.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly.\n\nNotifications do not expect a response.", "anyOf": [ { - "title": "CancelNotification", + "title": "CancelSessionNotification", "description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel active work in a\nsession.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Report an idle `state_update` with `StopReason::Cancelled` after\n cancellation succeeds\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/prompt-lifecycle#cancellation)", "allOf": [ { - "$ref": "#/$defs/CancelNotification" + "$ref": "#/$defs/CancelSessionNotification" } ] }, @@ -4775,7 +4775,7 @@ "required": ["method"], "x-docs-ignore": true }, - "CancelNotification": { + "CancelSessionNotification": { "description": "Notification to cancel ongoing operations for a session.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/prompt-lifecycle#cancellation)", "type": "object", "properties": { diff --git a/schema/v2/schema.unstable.json b/schema/v2/schema.unstable.json index 1e3e6320e..0a8273014 100644 --- a/schema/v2/schema.unstable.json +++ b/schema/v2/schema.unstable.json @@ -2606,12 +2606,18 @@ } ] }, + "info": { + "description": "Information about the implementation sending this initialize response.", + "allOf": [ + { + "$ref": "#/$defs/Implementation" + } + ] + }, "capabilities": { "description": "Capabilities supported by the agent.", "x-deserialize-default-on-error": true, - "default": { - "auth": {} - }, + "default": {}, "allOf": [ { "$ref": "#/$defs/AgentCapabilities" @@ -2628,14 +2634,6 @@ "x-deserialize-default-on-error": true, "x-deserialize-skip-invalid-items": true }, - "info": { - "description": "Information about the implementation sending this initialize response.", - "allOf": [ - { - "$ref": "#/$defs/Implementation" - } - ] - }, "_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/v2/draft/extensibility)", "type": ["object", "null"], @@ -2654,6 +2652,32 @@ "minimum": 0, "maximum": 65535 }, + "Implementation": { + "description": "Metadata about the implementation of the client or agent.\nDescribes the name and version of an ACP implementation, with an optional\ntitle for UI representation.", + "type": "object", + "properties": { + "name": { + "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present.", + "type": "string" + }, + "title": { + "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.", + "type": ["string", "null"], + "x-deserialize-default-on-error": true + }, + "version": { + "description": "Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. \"1.0.0\").", + "type": "string" + }, + "_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/v2/draft/extensibility)", + "type": ["object", "null"], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": ["name", "version"] + }, "AgentCapabilities": { "description": "Capabilities supported by the agent.\n\nAdvertised during initialization to inform the client about\navailable features and content types.\n\nSee protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#agent-capabilities)", "type": "object", @@ -2672,13 +2696,15 @@ }, "auth": { "description": "Authentication-related capabilities supported by the agent.", - "x-deserialize-default-on-error": true, - "default": {}, - "allOf": [ + "anyOf": [ { "$ref": "#/$defs/AgentAuthCapabilities" + }, + { + "type": "null" } - ] + ], + "x-deserialize-default-on-error": true }, "providers": { "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProvider configuration capabilities supported by the agent.\n\nBy supplying `{}` it means that the agent supports provider configuration methods.", @@ -3837,32 +3863,6 @@ }, "required": ["id", "name"] }, - "Implementation": { - "description": "Metadata about the implementation of the client or agent.\nDescribes the name and version of an ACP implementation, with an optional\ntitle for UI representation.", - "type": "object", - "properties": { - "name": { - "description": "Intended for programmatic or logical use, but can be used as a display\nname fallback if title isn’t present.", - "type": "string" - }, - "title": { - "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.", - "type": ["string", "null"], - "x-deserialize-default-on-error": true - }, - "version": { - "description": "Version of the implementation. Can be displayed to the user or used\nfor debugging or metrics purposes. (e.g. \"1.0.0\").", - "type": "string" - }, - "_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/v2/draft/extensibility)", - "type": ["object", "null"], - "x-deserialize-default-on-error": true, - "additionalProperties": true - } - }, - "required": ["name", "version"] - }, "LoginAuthResponse": { "description": "Response to the `auth/login` method.", "type": "object", @@ -6802,6 +6802,14 @@ } ] }, + "info": { + "description": "Information about the implementation sending this initialize request.", + "allOf": [ + { + "$ref": "#/$defs/Implementation" + } + ] + }, "capabilities": { "description": "Capabilities supported by the client.", "x-deserialize-default-on-error": true, @@ -6814,14 +6822,6 @@ } ] }, - "info": { - "description": "Information about the implementation sending this initialize request.", - "allOf": [ - { - "$ref": "#/$defs/Implementation" - } - ] - }, "_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/v2/draft/extensibility)", "type": ["object", "null"], @@ -7436,14 +7436,13 @@ "description": "Request parameters for loading an existing session.\n\nOnly available if the Agent supports the `session.load` capability.\n\nSee protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/v2/draft/session-setup#loading-sessions)", "type": "object", "properties": { - "mcpServers": { - "description": "List of MCP servers to connect to for this session.", - "type": "array", - "items": { - "$ref": "#/$defs/McpServer" - }, - "x-deserialize-default-on-error": true, - "x-deserialize-skip-invalid-items": true + "sessionId": { + "description": "The ID of the session to load.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] }, "cwd": { "description": "The working directory for this session.", @@ -7458,13 +7457,14 @@ "x-deserialize-default-on-error": true, "x-deserialize-skip-invalid-items": true }, - "sessionId": { - "description": "The ID of the session to load.", - "allOf": [ - { - "$ref": "#/$defs/SessionId" - } - ] + "mcpServers": { + "description": "List of MCP servers to connect to for this session.", + "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/v2/draft/extensibility)", @@ -7473,7 +7473,7 @@ "additionalProperties": true } }, - "required": ["mcpServers", "cwd", "sessionId"], + "required": ["sessionId", "cwd", "mcpServers"], "x-side": "agent", "x-method": "session/load" }, @@ -8590,11 +8590,11 @@ "description": "All possible notifications that a client can send to an agent.\n\nThis enum is used internally for routing RPC notifications. You typically won't need\nto use this directly.\n\nNotifications do not expect a response.", "anyOf": [ { - "title": "CancelNotification", + "title": "CancelSessionNotification", "description": "Cancels ongoing operations for a session.\n\nThis is a notification sent by the client to cancel active work in a\nsession.\n\nUpon receiving this notification, the Agent SHOULD:\n- Stop all language model requests as soon as possible\n- Abort all tool call invocations in progress\n- Send any pending `session/update` notifications\n- Report an idle `state_update` with `StopReason::Cancelled` after\n cancellation succeeds\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)", "allOf": [ { - "$ref": "#/$defs/CancelNotification" + "$ref": "#/$defs/CancelSessionNotification" } ] }, @@ -8690,7 +8690,7 @@ "required": ["method"], "x-docs-ignore": true }, - "CancelNotification": { + "CancelSessionNotification": { "description": "Notification to cancel ongoing operations for a session.\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)", "type": "object", "properties": {