From f733ac6f2e014c76bcd39046bef2e8df307ac3c8 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 --- 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/v1/meta.json | 1 + schema/v1/meta.unstable.json | 1 + schema/v1/schema.json | 79 ++++++++++++++ schema/v1/schema.unstable.json | 79 ++++++++++++++ schema/v2/meta.json | 1 + schema/v2/meta.unstable.json | 1 + schema/v2/schema.json | 87 ++++++++++++++++ schema/v2/schema.unstable.json | 87 ++++++++++++++++ src/bin/generate.rs | 1 + src/v1/agent.rs | 168 ++++++++++++++++++++++++++++++ src/v2/agent.rs | 168 ++++++++++++++++++++++++++++++ src/v2/conversion.rs | 93 +++++++++++++++++ 16 files changed, 1054 insertions(+) diff --git a/docs/protocol/v1/draft/schema.mdx b/docs/protocol/v1/draft/schema.mdx index eb4d43dd..a636a18c 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 516732c5..6dc50d7c 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 3f2db2fd..45e70c65 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 @@ -6405,6 +6455,9 @@ required by `session/prompt`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -6857,6 +6910,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 f940ef11..a1a1b4be 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 @@ -2759,6 +2809,9 @@ required by `session/prompt`. SessionResumeCapabilities | null} > Whether the agent supports `session/resume`. +SessionSetTitleCapabilities | null} > + Whether the agent supports `session/setTitle`. + ## SessionCloseCapabilities @@ -3153,6 +3206,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 9281f19f..52dd4e89 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 d8937f38..0488162e 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 e754978a..53772553 100644 --- a/schema/v1/schema.json +++ b/schema/v1/schema.json @@ -1273,6 +1273,14 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "allOf": [ @@ -1560,6 +1568,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"], @@ -1622,6 +1642,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", @@ -2217,6 +2248,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", @@ -3125,6 +3169,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.", @@ -3653,6 +3706,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 8a748875..5e5cccf7 100644 --- a/schema/v1/schema.unstable.json +++ b/schema/v1/schema.unstable.json @@ -2058,6 +2058,14 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "allOf": [ @@ -2432,6 +2440,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"], @@ -2505,6 +2525,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", @@ -3854,6 +3885,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", @@ -5454,6 +5498,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.", @@ -6389,6 +6442,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 f4ebd82c..78e69001 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 06435b00..20520ac4 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 0ef999f1..fd9d2a94 100644 --- a/schema/v2/schema.json +++ b/schema/v2/schema.json @@ -210,6 +210,14 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "allOf": [ @@ -1333,6 +1341,14 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "allOf": [ @@ -1572,6 +1588,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"], @@ -1782,6 +1810,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", @@ -2352,6 +2391,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", @@ -3547,6 +3599,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.", @@ -4025,6 +4086,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 a153590b..83a54cf9 100644 --- a/schema/v2/schema.unstable.json +++ b/schema/v2/schema.unstable.json @@ -250,6 +250,14 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "allOf": [ @@ -2235,6 +2243,14 @@ } ] }, + { + "title": "SetSessionTitleResponse", + "allOf": [ + { + "$ref": "#/$defs/SetSessionTitleResponse" + } + ] + }, { "title": "SetSessionConfigOptionResponse", "allOf": [ @@ -2554,6 +2570,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"], @@ -2798,6 +2826,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", @@ -4140,6 +4179,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", @@ -6001,6 +6053,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.", @@ -6888,6 +6949,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/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 5f47a597..4dd9a0f4 100644 --- a/src/v2/agent.rs +++ b/src/v2/agent.rs @@ -1918,6 +1918,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. @@ -3854,6 +3925,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. @@ -3953,6 +4029,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. @@ -4212,6 +4295,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`] @@ -4653,6 +4770,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. @@ -4719,6 +4838,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, @@ -4770,6 +4890,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. @@ -4909,6 +5031,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. @@ -4985,6 +5114,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")] @@ -5028,6 +5158,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")] @@ -5844,6 +5975,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 f72a8792..de19507d 100644 --- a/src/v2/conversion.rs +++ b/src/v2/conversion.rs @@ -3577,6 +3577,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; @@ -4766,6 +4821,7 @@ impl super::SessionCapabilities { fork, resume, close, + set_title, meta, } = self; @@ -4778,6 +4834,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()?, @@ -4807,6 +4864,7 @@ impl super::SessionCapabilities { fork, resume, close, + set_title, meta, } = session_capabilities; @@ -4821,6 +4879,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()?, }) } @@ -4959,6 +5018,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; @@ -5085,6 +5166,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()?) } @@ -5161,6 +5245,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()?) } @@ -5232,6 +5319,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()?) } @@ -5310,6 +5400,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()?) }