From b3bc550d96eae265412e19f3f1a653d700102c3b 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/src/v1/agent.rs | 177 ++++++++++++++++++ agent-client-protocol-schema/src/v2/agent.rs | 177 ++++++++++++++++++ .../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 | 80 ++++++++ schema/v1/schema.unstable.json | 80 ++++++++ schema/v2/meta.json | 1 + schema/v2/meta.unstable.json | 1 + schema/v2/schema.json | 89 +++++++++ schema/v2/schema.unstable.json | 89 +++++++++ 16 files changed, 1078 insertions(+) diff --git a/agent-client-protocol-schema/src/v1/agent.rs b/agent-client-protocol-schema/src/v1/agent.rs index eb05b7db3..e041d9864 100644 --- a/agent-client-protocol-schema/src/v1/agent.rs +++ b/agent-client-protocol-schema/src/v1/agent.rs @@ -2060,6 +2060,84 @@ impl SetSessionModeResponse { } } +/// Request parameters for setting a session title. +#[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(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. +#[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(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. @@ -3941,6 +4019,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. @@ -4010,6 +4093,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. @@ -4241,6 +4331,41 @@ impl SessionCloseCapabilities { } } +/// Capabilities for the `session/setTitle` method. +/// +/// By supplying `{}` it means that the agent supports setting session titles. +#[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(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`] @@ -4423,6 +4548,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. @@ -4490,6 +4617,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, @@ -4543,6 +4671,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. @@ -4697,6 +4827,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. @@ -4774,6 +4911,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")] @@ -4833,6 +4971,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. @@ -5678,6 +5818,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 3461e8b11..6d41ce77e 100644 --- a/agent-client-protocol-schema/src/v2/agent.rs +++ b/agent-client-protocol-schema/src/v2/agent.rs @@ -1949,6 +1949,84 @@ impl SessionInfo { } } +/// Request parameters for setting a session title. +#[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(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. +#[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(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. @@ -3943,6 +4021,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. @@ -4043,6 +4126,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. @@ -4309,6 +4399,41 @@ impl SessionCloseCapabilities { } } +/// Capabilities for the `session/setTitle` method. +/// +/// By supplying `{}` it means that the agent supports setting session titles. +#[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(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`] @@ -4758,6 +4883,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. @@ -4824,6 +4951,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, @@ -4875,6 +5003,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. @@ -5014,6 +5144,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(CloseSessionRequest), + /// 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. @@ -5090,6 +5227,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")] @@ -5146,6 +5284,8 @@ pub enum AgentResponse { ResumeSessionResponse(#[serde(default)] ResumeSessionResponse), /// Successful result returned for a `session/close` request. CloseSessionResponse(#[serde(default)] CloseSessionResponse), + /// 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. @@ -6004,6 +6144,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/conversion.rs b/agent-client-protocol-schema/src/v2/conversion.rs index 23bcb0159..500e1dddf 100644 --- a/agent-client-protocol-schema/src/v2/conversion.rs +++ b/agent-client-protocol-schema/src/v2/conversion.rs @@ -3662,6 +3662,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; @@ -4851,6 +4906,7 @@ impl super::SessionCapabilities { fork, resume, close, + set_title, meta, } = self; @@ -4863,6 +4919,7 @@ impl super::SessionCapabilities { fork: into_v1_default_on_error(fork), resume: into_v1_default_on_error(resume), close: into_v1_default_on_error(close), + set_title: into_v1_default_on_error(set_title), meta: meta.into_v1()?, }, prompt_capabilities: prompt.unwrap_or_default().into_v1()?, @@ -4892,6 +4949,7 @@ impl super::SessionCapabilities { fork, resume, close, + set_title, meta, } = session_capabilities; @@ -4906,6 +4964,7 @@ impl super::SessionCapabilities { fork: into_v2_default_on_error(fork), resume: into_v2_default_on_error(resume), close: into_v2_default_on_error(close), + set_title: into_v2_default_on_error(set_title), meta: meta.into_v2()?, }) } @@ -5044,6 +5103,28 @@ impl IntoV2 for crate::v1::SessionCloseCapabilities { } } +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; @@ -5170,6 +5251,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()?) } @@ -5246,6 +5330,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(value.into_v2()?) + } Self::SetSessionConfigOptionRequest(value) => { super::ClientRequest::SetSessionConfigOptionRequest(value.into_v2()?) } @@ -5319,6 +5406,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()?) } @@ -5397,6 +5487,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(value.into_v2()?) + } Self::SetSessionConfigOptionResponse(value) => { super::AgentResponse::SetSessionConfigOptionResponse(value.into_v2()?) } diff --git a/docs/protocol/v1/draft/schema.mdx b/docs/protocol/v1/draft/schema.mdx index bfac724a7..06fec0ed4 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 @@ -6929,6 +6979,9 @@ Whether the agent supports `session/fork`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -7398,6 +7451,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 f1c5907f7..3557c4e56 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 @@ -3018,6 +3068,9 @@ Supplying `\{\}` means the agent supports deleting sessions from `session/list`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -3391,6 +3444,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 83ee14b42..c9c5aee18 100644 --- a/docs/protocol/v2/draft/schema.mdx +++ b/docs/protocol/v2/draft/schema.mdx @@ -1462,6 +1462,56 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d Initial session configuration options if supported by the Agent. + +### 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 @@ -6741,6 +6791,9 @@ required by `session/prompt`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -7202,6 +7255,25 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/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/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 d7ac50514..9c6823b8a 100644 --- a/docs/protocol/v2/schema.mdx +++ b/docs/protocol/v2/schema.mdx @@ -704,6 +704,56 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/e Initial session configuration options if supported by the Agent. + +### 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 @@ -2883,6 +2933,9 @@ required by `session/prompt`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -3277,6 +3330,25 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/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/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 4a05f70c9..fca5736ef 100644 --- a/schema-generator/src/main.rs +++ b/schema-generator/src/main.rs @@ -1563,6 +1563,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 9281f19f3..52dd4e89b 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 f34d88125..04eefa4d6 100644 --- a/schema/v1/schema.json +++ b/schema/v1/schema.json @@ -1369,6 +1369,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.", @@ -1671,6 +1680,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"], @@ -1733,6 +1754,17 @@ } } }, + "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"], + "additionalProperties": true + } + } + }, "AgentAuthCapabilities": { "description": "Authentication-related capabilities supported by the agent.", "type": "object", @@ -2343,6 +2375,19 @@ "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"], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionResponse": { "description": "Response to `session/set_config_option` method.", "type": "object", @@ -3267,6 +3312,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.", @@ -3799,6 +3853,32 @@ "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"], + "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 d4cc569ff..2f0a35d5b 100644 --- a/schema/v1/schema.unstable.json +++ b/schema/v1/schema.unstable.json @@ -2205,6 +2205,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.", @@ -2598,6 +2607,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"], @@ -2671,6 +2692,17 @@ } } }, + "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"], + "additionalProperties": true + } + } + }, "AgentAuthCapabilities": { "description": "Authentication-related capabilities supported by the agent.", "type": "object", @@ -4053,6 +4085,19 @@ "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"], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionResponse": { "description": "Response to `session/set_config_option` method.", "type": "object", @@ -5709,6 +5754,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.", @@ -6648,6 +6702,32 @@ "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"], + "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 f4ebd82c3..78e690017 100644 --- a/schema/v2/meta.json +++ b/schema/v2/meta.json @@ -5,6 +5,7 @@ "authenticate": "authenticate", "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 06435b00a..20520ac43 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 fb3a5e322..007aec2d5 100644 --- a/schema/v2/schema.json +++ b/schema/v2/schema.json @@ -225,6 +225,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.", @@ -1447,6 +1456,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.", @@ -1700,6 +1718,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"], @@ -1910,6 +1940,17 @@ } } }, + "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"], + "additionalProperties": true + } + } + }, "AgentAuthCapabilities": { "description": "Authentication-related capabilities supported by the agent.", "type": "object", @@ -2492,6 +2533,19 @@ "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/extensibility)", + "type": ["object", "null"], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionResponse": { "description": "Response to `session/set_config_option` method.", "type": "object", @@ -3922,6 +3976,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.", @@ -4404,6 +4467,32 @@ "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/extensibility)", + "type": ["object", "null"], + "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 0badad84e..aa2fbd526 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.", @@ -2412,6 +2421,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.", @@ -2749,6 +2767,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"], @@ -2993,6 +3023,17 @@ } } }, + "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"], + "additionalProperties": true + } + } + }, "AgentAuthCapabilities": { "description": "Authentication-related capabilities supported by the agent.", "type": "object", @@ -4365,6 +4406,19 @@ "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/extensibility)", + "type": ["object", "null"], + "additionalProperties": true + } + }, + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionResponse": { "description": "Response to `session/set_config_option` method.", "type": "object", @@ -6501,6 +6555,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.", @@ -7392,6 +7455,32 @@ "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/extensibility)", + "type": ["object", "null"], + "additionalProperties": true + } + }, + "required": ["sessionId", "title"], + "x-side": "agent", + "x-method": "session/setTitle" + }, "SetSessionConfigOptionRequest": { "description": "Request parameters for setting a session configuration option.", "type": "object",