From 064ee1ffe194cdb14e1d45d66875ce74a14933c3 Mon Sep 17 00:00:00 2001 From: Daniel Stojanovic Date: Wed, 13 May 2026 00:38:29 +0200 Subject: [PATCH] Add session/setTitle method for client-driven session renaming --- agent-client-protocol-schema/Cargo.toml | 2 + agent-client-protocol-schema/src/v1/agent.rs | 189 ++++++++++++++++++ agent-client-protocol-schema/src/v2/agent.rs | 189 ++++++++++++++++++ .../src/v2/conversion.rs | 93 +++++++++ docs/protocol/v1/draft/schema.mdx | 72 +++++++ docs/protocol/v1/schema.mdx | 72 +++++++ docs/protocol/v2/draft/schema.mdx | 72 +++++++ docs/protocol/v2/schema.mdx | 72 +++++++ schema-generator/src/main.rs | 1 + schema/v1/meta.json | 1 + schema/v1/meta.unstable.json | 1 + schema/v1/schema.json | 83 ++++++++ schema/v1/schema.unstable.json | 83 ++++++++ schema/v2/meta.json | 1 + schema/v2/meta.unstable.json | 1 + schema/v2/schema.json | 92 +++++++++ schema/v2/schema.unstable.json | 92 +++++++++ 17 files changed, 1116 insertions(+) diff --git a/agent-client-protocol-schema/Cargo.toml b/agent-client-protocol-schema/Cargo.toml index a9b6e78e6..525610f55 100644 --- a/agent-client-protocol-schema/Cargo.toml +++ b/agent-client-protocol-schema/Cargo.toml @@ -24,6 +24,7 @@ workspace = true [features] unstable = [ "unstable_auth_methods", + "unstable_cancel_request", "unstable_elicitation", "unstable_llm_providers", "unstable_mcp_over_acp", @@ -38,6 +39,7 @@ unstable = [ # version, so it must be opted into explicitly. unstable_protocol_v2 = [] unstable_auth_methods = [] +unstable_cancel_request = [] unstable_elicitation = [] unstable_llm_providers = [] unstable_mcp_over_acp = [] diff --git a/agent-client-protocol-schema/src/v1/agent.rs b/agent-client-protocol-schema/src/v1/agent.rs index fa7e1aabf..f57c11f90 100644 --- a/agent-client-protocol-schema/src/v1/agent.rs +++ b/agent-client-protocol-schema/src/v1/agent.rs @@ -2242,6 +2242,92 @@ impl SetSessionModeResponse { } } +/// Request parameters for setting a session title. +#[serde_as] +#[skip_serializing_none] +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[schemars(extend("x-side" = "agent", "x-method" = SESSION_SET_TITLE_METHOD_NAME))] +#[serde(rename_all = "camelCase")] +#[non_exhaustive] +pub struct SetSessionTitleRequest { + /// The ID of the session to set the title for. + pub session_id: SessionId, + /// The new title for the session. + pub title: String, + /// 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 SetSessionTitleRequest { + /// Builds [`SetSessionTitleRequest`] with the required request fields set; optional fields start unset or empty. + #[must_use] + pub fn new(session_id: impl Into, title: impl Into) -> Self { + Self { + session_id: session_id.into(), + title: title.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 + } +} + +/// Response to `session/setTitle` method. +#[serde_as] +#[skip_serializing_none] +#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[schemars(extend("x-side" = "agent", "x-method" = SESSION_SET_TITLE_METHOD_NAME))] +#[serde(rename_all = "camelCase")] +#[non_exhaustive] +pub struct SetSessionTitleResponse { + /// 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 SetSessionTitleResponse { + /// Builds [`SetSessionTitleResponse`] with the required response fields set; optional fields start unset or empty. + #[must_use] + pub fn new() -> Self { + Self::default() + } + + /// 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 + } +} + // Session config options /// Unique identifier for a session configuration option. @@ -4293,6 +4379,11 @@ pub struct SessionCapabilities { #[schemars(extend("x-deserialize-default-on-error" = true))] #[serde(default)] pub close: Option, + /// Whether the agent supports `session/setTitle`. + #[serde_as(deserialize_as = "DefaultOnError")] + #[schemars(extend("x-deserialize-default-on-error" = true))] + #[serde(default)] + pub set_title: Option, /// 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. @@ -4381,6 +4472,13 @@ impl SessionCapabilities { self } + /// Whether the agent supports `session/setTitle`. + #[must_use] + pub fn set_title(mut self, set_title: impl IntoOption) -> Self { + self.set_title = set_title.into_option(); + self + } + /// 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. @@ -4636,6 +4734,45 @@ impl SessionCloseCapabilities { } } +/// Capabilities for the `session/setTitle` method. +/// +/// By supplying `{}` it means that the agent supports setting session titles. +#[serde_as] +#[skip_serializing_none] +#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[non_exhaustive] +pub struct SessionSetTitleCapabilities { + /// 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 SessionSetTitleCapabilities { + /// Builds an empty [`SessionSetTitleCapabilities`]; use builder methods to advertise supported sub-capabilities. + #[must_use] + pub fn new() -> Self { + Self::default() + } + + /// 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 + } +} + /// Prompt capabilities supported by the agent in `session/prompt` requests. /// /// Baseline agent functionality requires support for [`ContentBlock::Text`] @@ -4838,6 +4975,8 @@ pub struct AgentMethodNames { pub session_load: &'static str, /// Method for setting the mode for a session. pub session_set_mode: &'static str, + /// Method for setting the title for a session. + pub session_set_title: &'static str, /// Method for setting a configuration option for a session. pub session_set_config_option: &'static str, /// Method for sending a prompt to the agent. @@ -4905,6 +5044,7 @@ pub const AGENT_METHOD_NAMES: AgentMethodNames = AgentMethodNames { session_new: SESSION_NEW_METHOD_NAME, session_load: SESSION_LOAD_METHOD_NAME, session_set_mode: SESSION_SET_MODE_METHOD_NAME, + session_set_title: SESSION_SET_TITLE_METHOD_NAME, session_set_config_option: SESSION_SET_CONFIG_OPTION_METHOD_NAME, session_prompt: SESSION_PROMPT_METHOD_NAME, session_cancel: SESSION_CANCEL_METHOD_NAME, @@ -4958,6 +5098,8 @@ pub(crate) const SESSION_NEW_METHOD_NAME: &str = "session/new"; pub(crate) const SESSION_LOAD_METHOD_NAME: &str = "session/load"; /// Method name for setting the mode for a session. pub(crate) const SESSION_SET_MODE_METHOD_NAME: &str = "session/set_mode"; +/// Method name for setting the title for a session. +pub(crate) const SESSION_SET_TITLE_METHOD_NAME: &str = "session/setTitle"; /// Method name for setting a configuration option for a session. pub(crate) const SESSION_SET_CONFIG_OPTION_METHOD_NAME: &str = "session/set_config_option"; /// Method name for sending a prompt. @@ -5112,6 +5254,13 @@ pub enum ClientRequest { /// /// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes) SetSessionModeRequest(SetSessionModeRequest), + /// Sets the title for a session. + /// + /// Empty titles are valid and request that the agent clear the session title. + /// + /// This method can be called at any time during a session, whether the Agent is + /// idle or actively generating a response. + SetSessionTitleRequest(SetSessionTitleRequest), /// Sets the current value for a session configuration option. SetSessionConfigOptionRequest(SetSessionConfigOptionRequest), /// Processes a user prompt within a session. @@ -5189,6 +5338,7 @@ impl ClientRequest { Self::ResumeSessionRequest(_) => AGENT_METHOD_NAMES.session_resume, Self::CloseSessionRequest(_) => AGENT_METHOD_NAMES.session_close, Self::SetSessionModeRequest(_) => AGENT_METHOD_NAMES.session_set_mode, + Self::SetSessionTitleRequest(_) => AGENT_METHOD_NAMES.session_set_title, Self::SetSessionConfigOptionRequest(_) => AGENT_METHOD_NAMES.session_set_config_option, Self::PromptRequest(_) => AGENT_METHOD_NAMES.session_prompt, #[cfg(feature = "unstable_nes")] @@ -5248,6 +5398,8 @@ pub enum AgentResponse { CloseSessionResponse(#[serde(default)] CloseSessionResponse), /// Successful result returned for a `session/set_mode` request. SetSessionModeResponse(#[serde(default)] SetSessionModeResponse), + /// Successful result returned for a `session/setTitle` request. + SetSessionTitleResponse(#[serde(default)] SetSessionTitleResponse), /// Successful result returned for a `session/set_config_option` request. SetSessionConfigOptionResponse(SetSessionConfigOptionResponse), /// Successful result returned for a `session/prompt` request. @@ -6136,6 +6288,43 @@ mod test_serialization { } } + #[test] + fn test_set_session_title_request_roundtrip() { + let original = SetSessionTitleRequest::new("sess_1", "A clearer thread title"); + let json = serde_json::to_value(&original).unwrap(); + assert_eq!( + json, + json!({ + "sessionId": "sess_1", + "title": "A clearer thread title" + }) + ); + let roundtripped: SetSessionTitleRequest = serde_json::from_value(json).unwrap(); + assert_eq!(original, roundtripped); + } + + #[test] + fn test_set_session_title_response_roundtrip() { + let original = SetSessionTitleResponse::new(); + let json = serde_json::to_value(&original).unwrap(); + assert_eq!(json, json!({})); + let roundtripped: SetSessionTitleResponse = serde_json::from_value(json).unwrap(); + assert_eq!(original, roundtripped); + } + + #[test] + fn test_set_session_title_capabilities_serialization() { + assert_eq!( + serde_json::to_value( + SessionCapabilities::new().set_title(SessionSetTitleCapabilities::new()) + ) + .unwrap(), + json!({ + "setTitle": {} + }) + ); + } + #[cfg(feature = "unstable_boolean_config")] #[test] fn test_session_config_option_value_id_serialize() { diff --git a/agent-client-protocol-schema/src/v2/agent.rs b/agent-client-protocol-schema/src/v2/agent.rs index 08efb0e15..ac4d0999a 100644 --- a/agent-client-protocol-schema/src/v2/agent.rs +++ b/agent-client-protocol-schema/src/v2/agent.rs @@ -2026,6 +2026,92 @@ impl SessionInfo { } } +/// Request parameters for setting a session title. +#[serde_as] +#[skip_serializing_none] +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[schemars(extend("x-side" = "agent", "x-method" = SESSION_SET_TITLE_METHOD_NAME))] +#[serde(rename_all = "camelCase")] +#[non_exhaustive] +pub struct SetSessionTitleRequest { + /// The ID of the session to set the title for. + pub session_id: SessionId, + /// The new title for the session. + pub title: String, + /// 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 SetSessionTitleRequest { + /// Builds [`SetSessionTitleRequest`] with the required request fields set; optional fields start unset or empty. + #[must_use] + pub fn new(session_id: impl Into, title: impl Into) -> Self { + Self { + session_id: session_id.into(), + title: title.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 + } +} + +/// Response to `session/setTitle` method. +#[serde_as] +#[skip_serializing_none] +#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[schemars(extend("x-side" = "agent", "x-method" = SESSION_SET_TITLE_METHOD_NAME))] +#[serde(rename_all = "camelCase")] +#[non_exhaustive] +pub struct SetSessionTitleResponse { + /// 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 SetSessionTitleResponse { + /// Builds [`SetSessionTitleResponse`] with the required response fields set; optional fields start unset or empty. + #[must_use] + pub fn new() -> Self { + Self::default() + } + + /// 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 + } +} + // Session config options /// Unique identifier for a session configuration option. @@ -4281,6 +4367,11 @@ pub struct SessionCapabilities { #[schemars(extend("x-deserialize-default-on-error" = true))] #[serde(default)] pub fork: Option, + /// Whether the agent supports `session/setTitle`. + #[serde_as(deserialize_as = "DefaultOnError")] + #[schemars(extend("x-deserialize-default-on-error" = true))] + #[serde(default)] + pub set_title: Option, /// 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. @@ -4359,6 +4450,13 @@ impl SessionCapabilities { self } + /// Whether the agent supports `session/setTitle`. + #[must_use] + pub fn set_title(mut self, set_title: impl IntoOption) -> Self { + self.set_title = set_title.into_option(); + self + } + /// 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. @@ -4497,6 +4595,45 @@ impl SessionForkCapabilities { } } +/// Capabilities for the `session/setTitle` method. +/// +/// By supplying `{}` it means that the agent supports setting session titles. +#[serde_as] +#[skip_serializing_none] +#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] +#[non_exhaustive] +pub struct SessionSetTitleCapabilities { + /// 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 SessionSetTitleCapabilities { + /// Builds an empty [`SessionSetTitleCapabilities`]; use builder methods to advertise supported sub-capabilities. + #[must_use] + pub fn new() -> Self { + Self::default() + } + + /// 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 + } +} + /// Prompt capabilities supported by the agent in `session/prompt` requests. /// /// Baseline agent functionality requires support for [`ContentBlock::Text`] @@ -5022,6 +5159,8 @@ pub struct AgentMethodNames { pub session_new: &'static str, /// Method for loading an existing session. pub session_load: &'static str, + /// Method for setting the title for a session. + pub session_set_title: &'static str, /// Method for setting a configuration option for a session. pub session_set_config_option: &'static str, /// Method for sending a prompt to the agent. @@ -5088,6 +5227,7 @@ pub const AGENT_METHOD_NAMES: AgentMethodNames = AgentMethodNames { providers_disable: PROVIDERS_DISABLE_METHOD_NAME, session_new: SESSION_NEW_METHOD_NAME, session_load: SESSION_LOAD_METHOD_NAME, + session_set_title: SESSION_SET_TITLE_METHOD_NAME, session_set_config_option: SESSION_SET_CONFIG_OPTION_METHOD_NAME, session_prompt: SESSION_PROMPT_METHOD_NAME, session_cancel: SESSION_CANCEL_METHOD_NAME, @@ -5139,6 +5279,8 @@ pub(crate) const PROVIDERS_DISABLE_METHOD_NAME: &str = "providers/disable"; pub(crate) const SESSION_NEW_METHOD_NAME: &str = "session/new"; /// Method name for loading an existing session. pub(crate) const SESSION_LOAD_METHOD_NAME: &str = "session/load"; +/// Method name for setting the title for a session. +pub(crate) const SESSION_SET_TITLE_METHOD_NAME: &str = "session/setTitle"; /// Method name for setting a configuration option for a session. pub(crate) const SESSION_SET_CONFIG_OPTION_METHOD_NAME: &str = "session/set_config_option"; /// Method name for sending a prompt. @@ -5270,6 +5412,13 @@ pub enum ClientRequest { /// The agent must cancel any ongoing work (as if `session/cancel` was called) /// and then free up any resources associated with the session. CloseSessionRequest(Box), + /// Sets the title for a session. + /// + /// Empty titles are valid and request that the agent clear the session title. + /// + /// This method can be called at any time during a session, whether the Agent is + /// idle or actively generating a response. + SetSessionTitleRequest(Box), /// Sets the current value for a session configuration option. SetSessionConfigOptionRequest(Box), /// Processes a user prompt within a session. @@ -5346,6 +5495,7 @@ impl ClientRequest { Self::ForkSessionRequest(_) => AGENT_METHOD_NAMES.session_fork, Self::ResumeSessionRequest(_) => AGENT_METHOD_NAMES.session_resume, Self::CloseSessionRequest(_) => AGENT_METHOD_NAMES.session_close, + Self::SetSessionTitleRequest(_) => AGENT_METHOD_NAMES.session_set_title, Self::SetSessionConfigOptionRequest(_) => AGENT_METHOD_NAMES.session_set_config_option, Self::PromptRequest(_) => AGENT_METHOD_NAMES.session_prompt, #[cfg(feature = "unstable_nes")] @@ -5402,6 +5552,8 @@ pub enum AgentResponse { ResumeSessionResponse(#[serde(default)] Box), /// Successful result returned for a `session/close` request. CloseSessionResponse(#[serde(default)] Box), + /// Successful result returned for a `session/setTitle` request. + SetSessionTitleResponse(#[serde(default)] Box), /// Successful result returned for a `session/set_config_option` request. SetSessionConfigOptionResponse(Box), /// Successful result returned for a `session/prompt` request. @@ -6408,6 +6560,43 @@ mod test_serialization { } } + #[test] + fn test_set_session_title_request_roundtrip() { + let original = SetSessionTitleRequest::new("sess_1", "A clearer thread title"); + let json = serde_json::to_value(&original).unwrap(); + assert_eq!( + json, + json!({ + "sessionId": "sess_1", + "title": "A clearer thread title" + }) + ); + let roundtripped: SetSessionTitleRequest = serde_json::from_value(json).unwrap(); + assert_eq!(original, roundtripped); + } + + #[test] + fn test_set_session_title_response_roundtrip() { + let original = SetSessionTitleResponse::new(); + let json = serde_json::to_value(&original).unwrap(); + assert_eq!(json, json!({})); + let roundtripped: SetSessionTitleResponse = serde_json::from_value(json).unwrap(); + assert_eq!(original, roundtripped); + } + + #[test] + fn test_set_session_title_capabilities_serialization() { + assert_eq!( + serde_json::to_value( + SessionCapabilities::new().set_title(SessionSetTitleCapabilities::new()) + ) + .unwrap(), + json!({ + "setTitle": {} + }) + ); + } + #[cfg(feature = "unstable_boolean_config")] #[test] fn test_session_config_option_id_serialize() { diff --git a/agent-client-protocol-schema/src/v2/conversion.rs b/agent-client-protocol-schema/src/v2/conversion.rs index 58832dc51..6a12c18b0 100644 --- a/agent-client-protocol-schema/src/v2/conversion.rs +++ b/agent-client-protocol-schema/src/v2/conversion.rs @@ -3752,6 +3752,61 @@ impl IntoV2 for crate::v1::SessionInfo { } } +impl IntoV1 for super::SetSessionTitleRequest { + type Output = crate::v1::SetSessionTitleRequest; + + fn into_v1(self) -> Result { + let Self { + session_id, + title, + meta, + } = self; + Ok(crate::v1::SetSessionTitleRequest { + session_id: session_id.into_v1()?, + title, + meta: meta.into_v1()?, + }) + } +} + +impl IntoV2 for crate::v1::SetSessionTitleRequest { + type Output = super::SetSessionTitleRequest; + + fn into_v2(self) -> Result { + let Self { + session_id, + title, + meta, + } = self; + Ok(super::SetSessionTitleRequest { + session_id: session_id.into_v2()?, + title, + meta: meta.into_v2()?, + }) + } +} + +impl IntoV1 for super::SetSessionTitleResponse { + type Output = crate::v1::SetSessionTitleResponse; + + fn into_v1(self) -> Result { + let Self { meta } = self; + Ok(crate::v1::SetSessionTitleResponse { + meta: meta.into_v1()?, + }) + } +} + +impl IntoV2 for crate::v1::SetSessionTitleResponse { + type Output = super::SetSessionTitleResponse; + + fn into_v2(self) -> Result { + let Self { meta } = self; + Ok(super::SetSessionTitleResponse { + meta: meta.into_v2()?, + }) + } +} impl IntoV1 for super::SessionConfigId { type Output = crate::v1::SessionConfigId; @@ -4967,6 +5022,7 @@ impl super::SessionCapabilities { additional_directories, #[cfg(feature = "unstable_session_fork")] fork, + set_title, meta, } = self; @@ -4979,6 +5035,7 @@ impl super::SessionCapabilities { fork: into_v1_default_on_error(fork), resume: Some(crate::v1::SessionResumeCapabilities::new()), close: Some(crate::v1::SessionCloseCapabilities::new()), + set_title: into_v1_default_on_error(set_title), meta: meta.into_v1()?, }, prompt_capabilities: prompt.unwrap_or_default().into_v1()?, @@ -5008,6 +5065,7 @@ impl super::SessionCapabilities { fork, resume: _, close: _, + set_title, meta, } = session_capabilities; @@ -5018,6 +5076,7 @@ impl super::SessionCapabilities { additional_directories: into_v2_default_on_error(additional_directories), #[cfg(feature = "unstable_session_fork")] fork: into_v2_default_on_error(fork), + set_title: into_v2_default_on_error(set_title), meta: meta.into_v2()?, }) } @@ -5090,6 +5149,28 @@ impl IntoV2 for crate::v1::SessionForkCapabilities { } } +impl IntoV1 for super::SessionSetTitleCapabilities { + type Output = crate::v1::SessionSetTitleCapabilities; + + fn into_v1(self) -> Result { + let Self { meta } = self; + Ok(crate::v1::SessionSetTitleCapabilities { + meta: meta.into_v1()?, + }) + } +} + +impl IntoV2 for crate::v1::SessionSetTitleCapabilities { + type Output = super::SessionSetTitleCapabilities; + + fn into_v2(self) -> Result { + let Self { meta } = self; + Ok(super::SessionSetTitleCapabilities { + meta: meta.into_v2()?, + }) + } +} + impl IntoV1 for super::PromptCapabilities { type Output = crate::v1::PromptCapabilities; @@ -5218,6 +5299,9 @@ impl IntoV1 for super::ClientRequest { Self::CloseSessionRequest(value) => { crate::v1::ClientRequest::CloseSessionRequest(value.into_v1()?) } + Self::SetSessionTitleRequest(value) => { + crate::v1::ClientRequest::SetSessionTitleRequest(value.into_v1()?) + } Self::SetSessionConfigOptionRequest(value) => { crate::v1::ClientRequest::SetSessionConfigOptionRequest(value.into_v1()?) } @@ -5296,6 +5380,9 @@ impl IntoV2 for crate::v1::ClientRequest { Self::SetSessionModeRequest(_) => { return Err(removed_v1_enum_variant("ClientRequest", "session/set_mode")); } + Self::SetSessionTitleRequest(value) => { + super::ClientRequest::SetSessionTitleRequest(Box::new(value.into_v2()?)) + } Self::SetSessionConfigOptionRequest(value) => { super::ClientRequest::SetSessionConfigOptionRequest(Box::new(value.into_v2()?)) } @@ -5373,6 +5460,9 @@ impl IntoV1 for super::AgentResponse { Self::CloseSessionResponse(value) => { crate::v1::AgentResponse::CloseSessionResponse(value.into_v1()?) } + Self::SetSessionTitleResponse(value) => { + crate::v1::AgentResponse::SetSessionTitleResponse(value.into_v1()?) + } Self::SetSessionConfigOptionResponse(value) => { crate::v1::AgentResponse::SetSessionConfigOptionResponse(value.into_v1()?) } @@ -5453,6 +5543,9 @@ impl IntoV2 for crate::v1::AgentResponse { Self::SetSessionModeResponse(_) => { return Err(removed_v1_enum_variant("AgentResponse", "session/set_mode")); } + Self::SetSessionTitleResponse(value) => { + super::AgentResponse::SetSessionTitleResponse(Box::new(value.into_v2()?)) + } Self::SetSessionConfigOptionResponse(value) => { super::AgentResponse::SetSessionConfigOptionResponse(Box::new(value.into_v2()?)) } diff --git a/docs/protocol/v1/draft/schema.mdx b/docs/protocol/v1/draft/schema.mdx index bb8ccec3c..b769a2224 100644 --- a/docs/protocol/v1/draft/schema.mdx +++ b/docs/protocol/v1/draft/schema.mdx @@ -1491,6 +1491,56 @@ See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/d + +### session/setTitle + +Sets the title for a session. + +Empty titles are valid and request that the agent clear the session title. + +This method can be called at any time during a session, whether the Agent is +idle or actively generating a response. + +#### SetSessionTitleRequest + +Request parameters for setting a session title. + +**Type:** Object + +**Properties:** + + + 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/v1/draft/extensibility) + + +SessionId} required> + The ID of the session to set the title for. + + + The new title for the session. + + +#### SetSessionTitleResponse + +Response to `session/setTitle` method. + +**Type:** Object + +**Properties:** + + + 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/v1/draft/extensibility) + + + ### session/set_config_option @@ -7109,6 +7159,9 @@ Optional. Omitted or `null` both mean the agent does not advertise support. Supplying `\{\}` means the agent supports resuming sessions. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -7603,6 +7656,25 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/d +## SessionSetTitleCapabilities + +Capabilities for the `session/setTitle` method. + +By supplying `\{\}` it means that the agent supports setting session titles. + +**Type:** Object + +**Properties:** + + + 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/v1/draft/extensibility) + + + ## SessionUpdate Different types of updates that can be sent during session processing. diff --git a/docs/protocol/v1/schema.mdx b/docs/protocol/v1/schema.mdx index 2bf3d5b3a..7d4fb6274 100644 --- a/docs/protocol/v1/schema.mdx +++ b/docs/protocol/v1/schema.mdx @@ -719,6 +719,56 @@ See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/s + +### session/setTitle + +Sets the title for a session. + +Empty titles are valid and request that the agent clear the session title. + +This method can be called at any time during a session, whether the Agent is +idle or actively generating a response. + +#### SetSessionTitleRequest + +Request parameters for setting a session title. + +**Type:** Object + +**Properties:** + + + 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/v1/extensibility) + + +SessionId} required> + The ID of the session to set the title for. + + + The new title for the session. + + +#### SetSessionTitleResponse + +Response to `session/setTitle` method. + +**Type:** Object + +**Properties:** + + + 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/v1/extensibility) + + + ### session/set_config_option @@ -3092,6 +3142,9 @@ Optional. Omitted or `null` both mean the agent does not advertise support. Supplying `\{\}` means the agent supports resuming sessions. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -3469,6 +3522,25 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/e +## SessionSetTitleCapabilities + +Capabilities for the `session/setTitle` method. + +By supplying `\{\}` it means that the agent supports setting session titles. + +**Type:** Object + +**Properties:** + + + 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/v1/extensibility) + + + ## SessionUpdate Different types of updates that can be sent during session processing. diff --git a/docs/protocol/v2/draft/schema.mdx b/docs/protocol/v2/draft/schema.mdx index c07113cc5..57fe863de 100644 --- a/docs/protocol/v2/draft/schema.mdx +++ b/docs/protocol/v2/draft/schema.mdx @@ -1440,6 +1440,56 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d Initial session configuration options. + +### session/setTitle + +Sets the title for a session. + +Empty titles are valid and request that the agent clear the session title. + +This method can be called at any time during a session, whether the Agent is +idle or actively generating a response. + +#### SetSessionTitleRequest + +Request parameters for setting a session title. + +**Type:** Object + +**Properties:** + + + 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/v2/draft/extensibility) + + +SessionId} required> + The ID of the session to set the title for. + + + The new title for the session. + + +#### SetSessionTitleResponse + +Response to `session/setTitle` method. + +**Type:** Object + +**Properties:** + + + 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/v2/draft/extensibility) + + + ### session/set_config_option @@ -6993,6 +7043,9 @@ prompt extensions beyond the baseline text and resource-link content required by `session/prompt`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionConfigBoolean @@ -7376,6 +7429,25 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d ISO 8601 timestamp of last activity. Set to null to clear. +## SessionSetTitleCapabilities + +Capabilities for the `session/setTitle` method. + +By supplying `\{\}` it means that the agent supports setting session titles. + +**Type:** Object + +**Properties:** + + + 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/v2/draft/extensibility) + + + ## SessionUpdate Different types of updates that can be sent during session processing. diff --git a/docs/protocol/v2/schema.mdx b/docs/protocol/v2/schema.mdx index ed546af5b..c6aefc55d 100644 --- a/docs/protocol/v2/schema.mdx +++ b/docs/protocol/v2/schema.mdx @@ -682,6 +682,56 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/e Initial session configuration options. + +### session/setTitle + +Sets the title for a session. + +Empty titles are valid and request that the agent clear the session title. + +This method can be called at any time during a session, whether the Agent is +idle or actively generating a response. + +#### SetSessionTitleRequest + +Request parameters for setting a session title. + +**Type:** Object + +**Properties:** + + + 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/v2/extensibility) + + +SessionId} required> + The ID of the session to set the title for. + + + The new title for the session. + + +#### SetSessionTitleResponse + +Response to `session/setTitle` method. + +**Type:** Object + +**Properties:** + + + 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/v2/extensibility) + + + ### session/set_config_option @@ -3060,6 +3110,9 @@ prompt extensions beyond the baseline text and resource-link content required by `session/prompt`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionConfigGroupId @@ -3385,6 +3438,25 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/e ISO 8601 timestamp of last activity. Set to null to clear. +## SessionSetTitleCapabilities + +Capabilities for the `session/setTitle` method. + +By supplying `\{\}` it means that the agent supports setting session titles. + +**Type:** Object + +**Properties:** + + + 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/v2/extensibility) + + + ## SessionUpdate Different types of updates that can be sent during session processing. diff --git a/schema-generator/src/main.rs b/schema-generator/src/main.rs index 2ac58dc34..b6771203e 100644 --- a/schema-generator/src/main.rs +++ b/schema-generator/src/main.rs @@ -1861,6 +1861,7 @@ starting with '$/' it is free to ignore the notification." "session/fork" => self.agent.get("ForkSessionRequest").unwrap(), "session/resume" => self.agent.get("ResumeSessionRequest").unwrap(), "session/set_mode" => self.agent.get("SetSessionModeRequest").unwrap(), + "session/setTitle" => self.agent.get("SetSessionTitleRequest").unwrap(), "session/set_config_option" => { self.agent.get("SetSessionConfigOptionRequest").unwrap() } diff --git a/schema/v1/meta.json b/schema/v1/meta.json index 670d27876..2c331f338 100644 --- a/schema/v1/meta.json +++ b/schema/v1/meta.json @@ -6,6 +6,7 @@ "session_new": "session/new", "session_load": "session/load", "session_set_mode": "session/set_mode", + "session_set_title": "session/setTitle", "session_set_config_option": "session/set_config_option", "session_prompt": "session/prompt", "session_cancel": "session/cancel", diff --git a/schema/v1/meta.unstable.json b/schema/v1/meta.unstable.json index d8937f384..0488162e3 100644 --- a/schema/v1/meta.unstable.json +++ b/schema/v1/meta.unstable.json @@ -9,6 +9,7 @@ "session_new": "session/new", "session_load": "session/load", "session_set_mode": "session/set_mode", + "session_set_title": "session/setTitle", "session_set_config_option": "session/set_config_option", "session_prompt": "session/prompt", "session_cancel": "session/cancel", diff --git a/schema/v1/schema.json b/schema/v1/schema.json index 74679dc77..d6338b8e7 100644 --- a/schema/v1/schema.json +++ b/schema/v1/schema.json @@ -1455,6 +1455,15 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "description": "Successful result returned for a `session/setTitle` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "description": "Successful result returned for a `session/set_config_option` request.", @@ -1772,6 +1781,18 @@ ], "x-deserialize-default-on-error": true }, + "setTitle": { + "description": "Whether the agent supports `session/setTitle`.", + "anyOf": [ + { + "$ref": "#/$defs/SessionSetTitleCapabilities" + }, + { + "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/extensibility)", "type": ["object", "null"], @@ -1840,6 +1861,18 @@ } } }, + "SessionSetTitleCapabilities": { + "description": "Capabilities for the `session/setTitle` method.\n\nBy supplying `{}` it means that the agent supports setting session titles.", + "type": "object", + "properties": { + "_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"], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, "AgentAuthCapabilities": { "description": "Authentication-related capabilities supported by the agent.", "type": "object", @@ -2484,6 +2517,20 @@ "x-side": "agent", "x-method": "session/set_mode" }, + "SetSessionTitleResponse": { + "description": "Response to `session/setTitle` method.", + "type": "object", + "properties": { + "_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"], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionResponse": { "description": "Response to `session/set_config_option` method.", "type": "object", @@ -3438,6 +3485,15 @@ } ] }, + { + "title": "SetSessionTitleRequest", + "description": "Sets the title for a session.\n\nEmpty titles are valid and request that the agent clear the session title.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleRequest" + } + ] + }, { "title": "SetSessionConfigOptionRequest", "description": "Sets the current value for a session configuration option.", @@ -4013,6 +4069,33 @@ "x-side": "agent", "x-method": "session/set_mode" }, + "SetSessionTitleRequest": { + "description": "Request parameters for setting a session title.", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session to set the title for.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "title": { + "description": "The new title for the session.", + "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/extensibility)", + "type": ["object", "null"], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": ["sessionId", "title"], + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionRequest": { "description": "Request parameters for setting a session configuration option.", "type": "object", diff --git a/schema/v1/schema.unstable.json b/schema/v1/schema.unstable.json index 8f55e7747..6f5fc1f2e 100644 --- a/schema/v1/schema.unstable.json +++ b/schema/v1/schema.unstable.json @@ -2450,6 +2450,15 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "description": "Successful result returned for a `session/setTitle` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "description": "Successful result returned for a `session/set_config_option` request.", @@ -2859,6 +2868,18 @@ ], "x-deserialize-default-on-error": true }, + "setTitle": { + "description": "Whether the agent supports `session/setTitle`.", + "anyOf": [ + { + "$ref": "#/$defs/SessionSetTitleCapabilities" + }, + { + "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/extensibility)", "type": ["object", "null"], @@ -2939,6 +2960,18 @@ } } }, + "SessionSetTitleCapabilities": { + "description": "Capabilities for the `session/setTitle` method.\n\nBy supplying `{}` it means that the agent supports setting session titles.", + "type": "object", + "properties": { + "_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"], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + } + }, "AgentAuthCapabilities": { "description": "Authentication-related capabilities supported by the agent.", "type": "object", @@ -4398,6 +4431,20 @@ "x-side": "agent", "x-method": "session/set_mode" }, + "SetSessionTitleResponse": { + "description": "Response to `session/setTitle` method.", + "type": "object", + "properties": { + "_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"], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionResponse": { "description": "Response to `session/set_config_option` method.", "type": "object", @@ -6115,6 +6162,15 @@ } ] }, + { + "title": "SetSessionTitleRequest", + "description": "Sets the title for a session.\n\nEmpty titles are valid and request that the agent clear the session title.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleRequest" + } + ] + }, { "title": "SetSessionConfigOptionRequest", "description": "Sets the current value for a session configuration option.", @@ -7198,6 +7254,33 @@ "x-side": "agent", "x-method": "session/set_mode" }, + "SetSessionTitleRequest": { + "description": "Request parameters for setting a session title.", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session to set the title for.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "title": { + "description": "The new title for the session.", + "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/extensibility)", + "type": ["object", "null"], + "x-deserialize-default-on-error": true, + "additionalProperties": true + } + }, + "required": ["sessionId", "title"], + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionRequest": { "description": "Request parameters for setting a session configuration option.", "type": "object", diff --git a/schema/v2/meta.json b/schema/v2/meta.json index 1b42e980e..aa02b1032 100644 --- a/schema/v2/meta.json +++ b/schema/v2/meta.json @@ -5,6 +5,7 @@ "auth_login": "auth/login", "session_new": "session/new", "session_load": "session/load", + "session_set_title": "session/setTitle", "session_set_config_option": "session/set_config_option", "session_prompt": "session/prompt", "session_cancel": "session/cancel", diff --git a/schema/v2/meta.unstable.json b/schema/v2/meta.unstable.json index 211abc081..478f57891 100644 --- a/schema/v2/meta.unstable.json +++ b/schema/v2/meta.unstable.json @@ -8,6 +8,7 @@ "providers_disable": "providers/disable", "session_new": "session/new", "session_load": "session/load", + "session_set_title": "session/setTitle", "session_set_config_option": "session/set_config_option", "session_prompt": "session/prompt", "session_cancel": "session/cancel", diff --git a/schema/v2/schema.json b/schema/v2/schema.json index 74a61c8c3..73d2a1dc3 100644 --- a/schema/v2/schema.json +++ b/schema/v2/schema.json @@ -233,6 +233,15 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "description": "Successful result returned for a `session/setTitle` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "description": "Successful result returned for a `session/set_config_option` request.", @@ -1689,6 +1698,15 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "description": "Successful result returned for a `session/setTitle` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "description": "Successful result returned for a `session/set_config_option` request.", @@ -1919,6 +1937,18 @@ ], "x-deserialize-default-on-error": true }, + "setTitle": { + "description": "Whether the agent supports `session/setTitle`.", + "anyOf": [ + { + "$ref": "#/$defs/SessionSetTitleCapabilities" + }, + { + "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)", "type": ["object", "null"], @@ -2095,6 +2125,18 @@ } } }, + "SessionSetTitleCapabilities": { + "description": "Capabilities for the `session/setTitle` method.\n\nBy supplying `{}` it means that the agent supports setting session titles.", + "type": "object", + "properties": { + "_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 + } + } + }, "AgentAuthCapabilities": { "description": "Authentication-related capabilities supported by the agent.", "type": "object", @@ -2659,6 +2701,20 @@ "x-side": "agent", "x-method": "session/close" }, + "SetSessionTitleResponse": { + "description": "Response to `session/setTitle` method.", + "type": "object", + "properties": { + "_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 + } + }, + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionResponse": { "description": "Response to `session/set_config_option` method.", "type": "object", @@ -4140,6 +4196,15 @@ } ] }, + { + "title": "SetSessionTitleRequest", + "description": "Sets the title for a session.\n\nEmpty titles are valid and request that the agent clear the session title.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleRequest" + } + ] + }, { "title": "SetSessionConfigOptionRequest", "description": "Sets the current value for a session configuration option.", @@ -4654,6 +4719,33 @@ "x-side": "agent", "x-method": "session/close" }, + "SetSessionTitleRequest": { + "description": "Request parameters for setting a session title.", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session to set the title for.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "title": { + "description": "The new title for the session.", + "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": ["sessionId", "title"], + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionRequest": { "description": "Request parameters for setting a session configuration option.", "type": "object", diff --git a/schema/v2/schema.unstable.json b/schema/v2/schema.unstable.json index 2ba4f2832..71fc490a6 100644 --- a/schema/v2/schema.unstable.json +++ b/schema/v2/schema.unstable.json @@ -269,6 +269,15 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "description": "Successful result returned for a `session/setTitle` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "description": "Successful result returned for a `session/set_config_option` request.", @@ -2797,6 +2806,15 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "description": "Successful result returned for a `session/setTitle` request.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "description": "Successful result returned for a `session/set_config_option` request.", @@ -3111,6 +3129,18 @@ ], "x-deserialize-default-on-error": true }, + "setTitle": { + "description": "Whether the agent supports `session/setTitle`.", + "anyOf": [ + { + "$ref": "#/$defs/SessionSetTitleCapabilities" + }, + { + "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/draft/extensibility)", "type": ["object", "null"], @@ -3323,6 +3353,18 @@ } } }, + "SessionSetTitleCapabilities": { + "description": "Capabilities for the `session/setTitle` method.\n\nBy supplying `{}` it means that the agent supports setting session titles.", + "type": "object", + "properties": { + "_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 + } + } + }, "AgentAuthCapabilities": { "description": "Authentication-related capabilities supported by the agent.", "type": "object", @@ -4742,6 +4784,20 @@ "x-side": "agent", "x-method": "session/close" }, + "SetSessionTitleResponse": { + "description": "Response to `session/setTitle` method.", + "type": "object", + "properties": { + "_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 + } + }, + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionResponse": { "description": "Response to `session/set_config_option` method.", "type": "object", @@ -6966,6 +7022,15 @@ } ] }, + { + "title": "SetSessionTitleRequest", + "description": "Sets the title for a session.\n\nEmpty titles are valid and request that the agent clear the session title.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleRequest" + } + ] + }, { "title": "SetSessionConfigOptionRequest", "description": "Sets the current value for a session configuration option.", @@ -7896,6 +7961,33 @@ "x-side": "agent", "x-method": "session/close" }, + "SetSessionTitleRequest": { + "description": "Request parameters for setting a session title.", + "type": "object", + "properties": { + "sessionId": { + "description": "The ID of the session to set the title for.", + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ] + }, + "title": { + "description": "The new title for the session.", + "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": ["sessionId", "title"], + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionRequest": { "description": "Request parameters for setting a session configuration option.", "type": "object",