diff --git a/docs/protocol/v1/draft/schema.mdx b/docs/protocol/v1/draft/schema.mdx index f7a5b529..b0e0e3c0 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 @@ -6655,6 +6705,9 @@ Whether the agent supports `session/fork`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -7112,6 +7165,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 43d0a28d..192db716 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 @@ -2953,6 +3003,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 @@ -3323,6 +3376,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 db8cc0af..170b8c07 100644 --- a/docs/protocol/v2/draft/schema.mdx +++ b/docs/protocol/v2/draft/schema.mdx @@ -1469,6 +1469,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 @@ -6332,6 +6382,9 @@ required by `session/prompt`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -6784,6 +6837,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 e7b83312..29b54cce 100644 --- a/docs/protocol/v2/schema.mdx +++ b/docs/protocol/v2/schema.mdx @@ -703,6 +703,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 @@ -2686,6 +2736,9 @@ required by `session/prompt`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -3080,6 +3133,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/v1/meta.json b/schema/v1/meta.json index 809ccd99..8bbbfb3a 100644 --- a/schema/v1/meta.json +++ b/schema/v1/meta.json @@ -12,7 +12,8 @@ "session_prompt": "session/prompt", "session_resume": "session/resume", "session_set_config_option": "session/set_config_option", - "session_set_mode": "session/set_mode" + "session_set_mode": "session/set_mode", + "session_set_title": "session/setTitle" }, "clientMethods": { "fs_read_text_file": "fs/read_text_file", diff --git a/schema/v1/meta.unstable.json b/schema/v1/meta.unstable.json index 071a291d..93e67c03 100644 --- a/schema/v1/meta.unstable.json +++ b/schema/v1/meta.unstable.json @@ -27,7 +27,8 @@ "session_prompt": "session/prompt", "session_resume": "session/resume", "session_set_config_option": "session/set_config_option", - "session_set_mode": "session/set_mode" + "session_set_mode": "session/set_mode", + "session_set_title": "session/setTitle" }, "clientMethods": { "elicitation_complete": "elicitation/complete", diff --git a/schema/v1/schema.json b/schema/v1/schema.json index f6693045..27673175 100644 --- a/schema/v1/schema.json +++ b/schema/v1/schema.json @@ -316,6 +316,14 @@ ], "title": "SetSessionModeResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ], + "title": "SetSessionTitleResponse" + }, { "allOf": [ { @@ -768,6 +776,15 @@ "description": "Sets the current mode for a session.\n\nAllows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\nthat affect system prompts, tool availability, and permission behaviors.\n\nThe mode must be one of the modes advertised in `availableModes` during session\ncreation or loading. Agents may also change modes autonomously and notify the\nclient via `current_mode_update` notifications.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", "title": "SetSessionModeRequest" }, + { + "allOf": [ + { + "$ref": "#/$defs/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.", + "title": "SetSessionTitleRequest" + }, { "allOf": [ { @@ -2736,6 +2753,18 @@ ], "description": "Whether the agent supports `session/resume`.", "x-deserialize-default-on-error": true + }, + "setTitle": { + "anyOf": [ + { + "$ref": "#/$defs/SessionSetTitleCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent supports `session/setTitle`.", + "x-deserialize-default-on-error": true } }, "type": "object" @@ -3133,6 +3162,17 @@ }, "type": "object" }, + "SessionSetTitleCapabilities": { + "description": "Capabilities for the `session/setTitle` method.\n\nBy supplying `{}` it means that the agent supports setting session titles.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + } + }, + "type": "object" + }, "SessionUpdate": { "description": "Different types of updates that can be sent during session processing.\n\nThese updates provide real-time feedback about the agent's progress.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", "discriminator": { @@ -3421,6 +3461,45 @@ "x-method": "session/set_mode", "x-side": "agent" }, + "SetSessionTitleRequest": { + "description": "Request parameters for setting a session title.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to set the title for." + }, + "title": { + "description": "The new title for the session.", + "type": "string" + } + }, + "required": ["sessionId", "title"], + "type": "object", + "x-method": "session/setTitle", + "x-side": "agent" + }, + "SetSessionTitleResponse": { + "description": "Response to `session/setTitle` method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + } + }, + "type": "object", + "x-method": "session/setTitle", + "x-side": "agent" + }, "StopReason": { "description": "Reasons why an agent stops processing a prompt turn.\n\nSee protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)", "oneOf": [ diff --git a/schema/v1/schema.unstable.json b/schema/v1/schema.unstable.json index 13a89579..fdc5c532 100644 --- a/schema/v1/schema.unstable.json +++ b/schema/v1/schema.unstable.json @@ -465,6 +465,14 @@ ], "title": "SetSessionModeResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ], + "title": "SetSessionTitleResponse" + }, { "allOf": [ { @@ -1351,6 +1359,15 @@ "description": "Sets the current mode for a session.\n\nAllows switching between different agent modes (e.g., \"ask\", \"architect\", \"code\")\nthat affect system prompts, tool availability, and permission behaviors.\n\nThe mode must be one of the modes advertised in `availableModes` during session\ncreation or loading. Agents may also change modes autonomously and notify the\nclient via `current_mode_update` notifications.\n\nThis method can be called at any time during a session, whether the Agent is\nidle or actively generating a response.\n\nSee protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)", "title": "SetSessionModeRequest" }, + { + "allOf": [ + { + "$ref": "#/$defs/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.", + "title": "SetSessionTitleRequest" + }, { "allOf": [ { @@ -5936,6 +5953,18 @@ ], "description": "Whether the agent supports `session/resume`.", "x-deserialize-default-on-error": true + }, + "setTitle": { + "anyOf": [ + { + "$ref": "#/$defs/SessionSetTitleCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent supports `session/setTitle`.", + "x-deserialize-default-on-error": true } }, "type": "object" @@ -6371,6 +6400,17 @@ }, "type": "object" }, + "SessionSetTitleCapabilities": { + "description": "Capabilities for the `session/setTitle` method.\n\nBy supplying `{}` it means that the agent supports setting session titles.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + } + }, + "type": "object" + }, "SessionUpdate": { "description": "Different types of updates that can be sent during session processing.\n\nThese updates provide real-time feedback about the agent's progress.\n\nSee protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)", "discriminator": { @@ -6766,6 +6806,45 @@ "x-method": "session/set_mode", "x-side": "agent" }, + "SetSessionTitleRequest": { + "description": "Request parameters for setting a session title.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to set the title for." + }, + "title": { + "description": "The new title for the session.", + "type": "string" + } + }, + "required": ["sessionId", "title"], + "type": "object", + "x-method": "session/setTitle", + "x-side": "agent" + }, + "SetSessionTitleResponse": { + "description": "Response to `session/setTitle` method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + } + }, + "type": "object", + "x-method": "session/setTitle", + "x-side": "agent" + }, "StartNesRequest": { "description": "Request to start an NES session.", "properties": { diff --git a/schema/v2/meta.json b/schema/v2/meta.json index 7923f6a5..72178f12 100644 --- a/schema/v2/meta.json +++ b/schema/v2/meta.json @@ -11,7 +11,8 @@ "session_new": "session/new", "session_prompt": "session/prompt", "session_resume": "session/resume", - "session_set_config_option": "session/set_config_option" + "session_set_config_option": "session/set_config_option", + "session_set_title": "session/setTitle" }, "clientMethods": { "session_request_permission": "session/request_permission", diff --git a/schema/v2/meta.unstable.json b/schema/v2/meta.unstable.json index 033ef29a..288a456e 100644 --- a/schema/v2/meta.unstable.json +++ b/schema/v2/meta.unstable.json @@ -26,7 +26,8 @@ "session_new": "session/new", "session_prompt": "session/prompt", "session_resume": "session/resume", - "session_set_config_option": "session/set_config_option" + "session_set_config_option": "session/set_config_option", + "session_set_title": "session/setTitle" }, "clientMethods": { "elicitation_complete": "elicitation/complete", diff --git a/schema/v2/schema.json b/schema/v2/schema.json index 397f8f1a..aaeaf4d7 100644 --- a/schema/v2/schema.json +++ b/schema/v2/schema.json @@ -219,6 +219,14 @@ ], "title": "CloseSessionResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ], + "title": "SetSessionTitleResponse" + }, { "allOf": [ { @@ -713,6 +721,15 @@ "description": "Closes an active session and frees up any resources associated with it.\n\nThis method is only available if the agent advertises the `session.close` capability.\n\nThe agent must cancel any ongoing work (as if `session/cancel` was called)\nand then free up any resources associated with the session.", "title": "CloseSessionRequest" }, + { + "allOf": [ + { + "$ref": "#/$defs/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.", + "title": "SetSessionTitleRequest" + }, { "allOf": [ { @@ -2659,6 +2676,18 @@ ], "description": "Whether the agent supports `session/resume`.", "x-deserialize-default-on-error": true + }, + "setTitle": { + "anyOf": [ + { + "$ref": "#/$defs/SessionSetTitleCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent supports `session/setTitle`.", + "x-deserialize-default-on-error": true } }, "type": "object" @@ -3040,6 +3069,17 @@ }, "type": "object" }, + "SessionSetTitleCapabilities": { + "description": "Capabilities for the `session/setTitle` method.\n\nBy supplying `{}` it means that the agent supports setting session titles.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + } + }, + "type": "object" + }, "SessionUpdate": { "anyOf": [ { @@ -3386,6 +3426,45 @@ "x-method": "session/set_config_option", "x-side": "agent" }, + "SetSessionTitleRequest": { + "description": "Request parameters for setting a session title.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to set the title for." + }, + "title": { + "description": "The new title for the session.", + "type": "string" + } + }, + "required": ["sessionId", "title"], + "type": "object", + "x-method": "session/setTitle", + "x-side": "agent" + }, + "SetSessionTitleResponse": { + "description": "Response to `session/setTitle` method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + } + }, + "type": "object", + "x-method": "session/setTitle", + "x-side": "agent" + }, "StopReason": { "anyOf": [ { @@ -4050,6 +4129,14 @@ ], "title": "CloseSessionResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ], + "title": "SetSessionTitleResponse" + }, { "allOf": [ { diff --git a/schema/v2/schema.unstable.json b/schema/v2/schema.unstable.json index 8a51164d..2c28eb4a 100644 --- a/schema/v2/schema.unstable.json +++ b/schema/v2/schema.unstable.json @@ -367,6 +367,14 @@ ], "title": "CloseSessionResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ], + "title": "SetSessionTitleResponse" + }, { "allOf": [ { @@ -1308,6 +1316,15 @@ "description": "Closes an active session and frees up any resources associated with it.\n\nThis method is only available if the agent advertises the `session.close` capability.\n\nThe agent must cancel any ongoing work (as if `session/cancel` was called)\nand then free up any resources associated with the session.", "title": "CloseSessionRequest" }, + { + "allOf": [ + { + "$ref": "#/$defs/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.", + "title": "SetSessionTitleRequest" + }, { "allOf": [ { @@ -5900,6 +5917,18 @@ ], "description": "Whether the agent supports `session/resume`.", "x-deserialize-default-on-error": true + }, + "setTitle": { + "anyOf": [ + { + "$ref": "#/$defs/SessionSetTitleCapabilities" + }, + { + "type": "null" + } + ], + "description": "Whether the agent supports `session/setTitle`.", + "x-deserialize-default-on-error": true } }, "type": "object" @@ -6329,6 +6358,17 @@ }, "type": "object" }, + "SessionSetTitleCapabilities": { + "description": "Capabilities for the `session/setTitle` method.\n\nBy supplying `{}` it means that the agent supports setting session titles.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + } + }, + "type": "object" + }, "SessionUpdate": { "anyOf": [ { @@ -6776,6 +6816,45 @@ "x-method": "session/set_config_option", "x-side": "agent" }, + "SetSessionTitleRequest": { + "description": "Request parameters for setting a session title.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to set the title for." + }, + "title": { + "description": "The new title for the session.", + "type": "string" + } + }, + "required": ["sessionId", "title"], + "type": "object", + "x-method": "session/setTitle", + "x-side": "agent" + }, + "SetSessionTitleResponse": { + "description": "Response to `session/setTitle` method.", + "properties": { + "_meta": { + "additionalProperties": true, + "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"] + } + }, + "type": "object", + "x-method": "session/setTitle", + "x-side": "agent" + }, "StartNesRequest": { "description": "Request to start an NES session.", "properties": { @@ -7865,6 +7944,14 @@ ], "title": "CloseSessionResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ], + "title": "SetSessionTitleResponse" + }, { "allOf": [ { diff --git a/src/bin/generate.rs b/src/bin/generate.rs index 0ede517d..cbe88ae2 100644 --- a/src/bin/generate.rs +++ b/src/bin/generate.rs @@ -1493,6 +1493,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/src/v1/agent.rs b/src/v1/agent.rs index e5d92755..afc9ac01 100644 --- a/src/v1/agent.rs +++ b/src/v1/agent.rs @@ -2019,6 +2019,77 @@ 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 { + #[must_use] + pub fn new(session_id: impl Into, title: impl Into) -> Self { + Self { + session_id: session_id.into(), + title: title.into(), + meta: None, + } + } + + #[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 { + #[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. @@ -3815,6 +3886,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. @@ -3883,6 +3959,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. @@ -4108,6 +4191,40 @@ 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 { + #[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`] @@ -4288,6 +4405,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. @@ -4355,6 +4474,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, @@ -4408,6 +4528,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. @@ -4562,6 +4684,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. @@ -4639,6 +4768,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")] @@ -4684,6 +4814,7 @@ pub enum AgentResponse { ResumeSessionResponse(#[serde(default)] ResumeSessionResponse), CloseSessionResponse(#[serde(default)] CloseSessionResponse), SetSessionModeResponse(#[serde(default)] SetSessionModeResponse), + SetSessionTitleResponse(#[serde(default)] SetSessionTitleResponse), SetSessionConfigOptionResponse(SetSessionConfigOptionResponse), PromptResponse(PromptResponse), #[cfg(feature = "unstable_nes")] @@ -5486,6 +5617,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/src/v2/agent.rs b/src/v2/agent.rs index 01a86c0d..a9a2d767 100644 --- a/src/v2/agent.rs +++ b/src/v2/agent.rs @@ -1967,6 +1967,77 @@ 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 { + #[must_use] + pub fn new(session_id: impl Into, title: impl Into) -> Self { + Self { + session_id: session_id.into(), + title: title.into(), + meta: None, + } + } + + #[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 { + #[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. @@ -3903,6 +3974,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. @@ -4002,6 +4078,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. @@ -4261,6 +4344,40 @@ 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 { + #[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`] @@ -4702,6 +4819,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. @@ -4768,6 +4887,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, @@ -4819,6 +4939,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. @@ -4959,6 +5081,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. @@ -5035,6 +5164,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")] @@ -5079,6 +5209,7 @@ pub enum AgentResponse { ForkSessionResponse(ForkSessionResponse), ResumeSessionResponse(#[serde(default)] ResumeSessionResponse), CloseSessionResponse(#[serde(default)] CloseSessionResponse), + SetSessionTitleResponse(#[serde(default)] SetSessionTitleResponse), SetSessionConfigOptionResponse(SetSessionConfigOptionResponse), PromptResponse(PromptResponse), #[cfg(feature = "unstable_nes")] @@ -5875,6 +6006,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/src/v2/conversion.rs b/src/v2/conversion.rs index bfa5a8de..7498b58f 100644 --- a/src/v2/conversion.rs +++ b/src/v2/conversion.rs @@ -3381,6 +3381,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; @@ -4570,6 +4625,7 @@ impl super::SessionCapabilities { fork, resume, close, + set_title, meta, } = self; @@ -4582,6 +4638,7 @@ impl super::SessionCapabilities { fork: fork.into_v1()?, resume: resume.into_v1()?, close: close.into_v1()?, + set_title: set_title.into_v1()?, meta: meta.into_v1()?, }, prompt_capabilities: prompt.unwrap_or_default().into_v1()?, @@ -4611,6 +4668,7 @@ impl super::SessionCapabilities { fork, resume, close, + set_title, meta, } = session_capabilities; @@ -4625,6 +4683,7 @@ impl super::SessionCapabilities { fork: fork.into_v2()?, resume: resume.into_v2()?, close: close.into_v2()?, + set_title: set_title.into_v2()?, meta: meta.into_v2()?, }) } @@ -4763,6 +4822,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; @@ -4889,6 +4970,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()?) } @@ -4965,6 +5049,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()?) } @@ -5036,6 +5123,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()?) } @@ -5114,6 +5204,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()?) }