diff --git a/Cargo.toml b/Cargo.toml
index cd6e77cd..cce19d79 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,6 +17,7 @@ include = ["/src/**/*.rs", "/README.md", "/LICENSE", "/Cargo.toml"]
unstable = [
"unstable_auth_methods",
"unstable_cancel_request",
+ "unstable_logout",
"unstable_session_fork",
"unstable_session_model",
"unstable_session_resume",
@@ -27,6 +28,7 @@ unstable = [
]
unstable_auth_methods = []
unstable_cancel_request = []
+unstable_logout = []
unstable_session_fork = []
unstable_session_model = []
unstable_session_resume = []
diff --git a/docs/protocol/draft/schema.mdx b/docs/protocol/draft/schema.mdx
index 17a487a6..06b879e7 100644
--- a/docs/protocol/draft/schema.mdx
+++ b/docs/protocol/draft/schema.mdx
@@ -135,7 +135,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
AgentCapabilities} >
Capabilities supported by the agent.
- - Default: `{"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false},"sessionCapabilities":{}}`
+ - Default: `{"auth":{},"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false},"sessionCapabilities":{}}`
Implementation | null>} >
@@ -158,6 +158,61 @@ The client should disconnect, if it doesn't support this version.
+### logout
+
+**UNSTABLE**
+
+This capability is not part of the spec yet, and may be removed or changed at any point.
+
+Logs out of the current authenticated state.
+
+After a successful logout, all new sessions will require authentication.
+There is no guarantee about the behavior of already running sessions.
+
+#### LogoutRequest
+
+**UNSTABLE**
+
+This capability is not part of the spec yet, and may be removed or changed at any point.
+
+Request parameters for the logout method.
+
+Terminates the current authenticated session.
+
+**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/extensibility)
+
+
+
+#### LogoutResponse
+
+**UNSTABLE**
+
+This capability is not part of the spec yet, and may be removed or changed at any point.
+
+Response to the `logout` 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/extensibility)
+
+
+
### session/cancel
@@ -1555,6 +1610,33 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
The ID of the request to cancel.
+## AgentAuthCapabilities
+
+**UNSTABLE**
+
+This capability is not part of the spec yet, and may be removed or changed at any point.
+
+Authentication-related capabilities supported by the agent.
+
+**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/extensibility)
+
+
+LogoutCapabilities | null>} >
+ Whether the agent supports the logout method.
+
+By supplying `\{\}` it means that the agent supports the logout method.
+
+
+
## AgentCapabilities
Capabilities supported by the agent.
@@ -1575,6 +1657,16 @@ these keys.
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
+
+AgentAuthCapabilities} >
+ **UNSTABLE**
+
+This capability is not part of the spec yet, and may be removed or changed at any point.
+
+Authentication-related capabilities supported by the agent.
+
+ - Default: `{}`
+
Whether the agent supports `session/load`.
@@ -2706,6 +2798,29 @@ If not provided, the name should be used for display.
for debugging or metrics purposes. (e.g. "1.0.0").
+## LogoutCapabilities
+
+**UNSTABLE**
+
+This capability is not part of the spec yet, and may be removed or changed at any point.
+
+Logout capabilities supported by the agent.
+
+By supplying `\{\}` it means that the agent supports the logout 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/extensibility)
+
+
+
## McpCapabilities
MCP capabilities supported by the agent
diff --git a/docs/rfds/logout-method.mdx b/docs/rfds/logout-method.mdx
index bf3ccdd3..932205da 100644
--- a/docs/rfds/logout-method.mdx
+++ b/docs/rfds/logout-method.mdx
@@ -66,22 +66,27 @@ interface LogoutResponse {
### Capability Advertisement
-The `logout` capability should be advertised within a new `authCapabilities` object in `AgentCapabilities`:
+The `logout` capability should be advertised within a new `auth` object in `AgentCapabilities`:
```typescript
interface AgentCapabilities {
// ... existing fields ...
/** Authentication-related capabilities */
- authCapabilities?: AuthCapabilities;
+ auth?: AgentAuthCapabilities;
}
-interface AuthCapabilities {
+interface AgentAuthCapabilities {
/** Extension metadata */
_meta?: Record;
- /** Agent supports the logout method */
- logout?: boolean;
+ /** Agent supports the logout method. Supply `{}` to indicate support. */
+ logout?: LogoutCapabilities;
+}
+
+interface LogoutCapabilities {
+ /** Extension metadata */
+ _meta?: Record;
}
```
@@ -90,7 +95,7 @@ interface AuthCapabilities {
```json
{
"$defs": {
- "AuthCapabilities": {
+ "AgentAuthCapabilities": {
"description": "Authentication-related capabilities supported by the agent.",
"properties": {
"_meta": {
@@ -98,9 +103,22 @@ interface AuthCapabilities {
"type": ["object", "null"]
},
"logout": {
- "type": "boolean",
- "default": false,
- "description": "Whether the agent supports the logout method."
+ "allOf": [
+ {
+ "$ref": "#/$defs/LogoutCapabilities"
+ }
+ ],
+ "description": "Whether the agent supports the logout method. Supply `{}` to indicate support."
+ }
+ },
+ "type": "object"
+ },
+ "LogoutCapabilities": {
+ "description": "Logout capabilities supported by the agent. Supply `{}` to indicate support.",
+ "properties": {
+ "_meta": {
+ "additionalProperties": true,
+ "type": ["object", "null"]
}
},
"type": "object"
@@ -159,7 +177,7 @@ interface AuthCapabilities {
### Behavior
1. **Pre-condition**: The client should only call `logout` if:
- - The agent advertises `authCapabilities.logout: true`
+ - The agent advertises `auth.logout: {}`
2. **Agent responsibilities**:
- Invalidate any stored tokens or credentials as appropriate
diff --git a/schema/meta.unstable.json b/schema/meta.unstable.json
index bfa84484..ae8e1b86 100644
--- a/schema/meta.unstable.json
+++ b/schema/meta.unstable.json
@@ -2,6 +2,7 @@
"agentMethods": {
"authenticate": "authenticate",
"initialize": "initialize",
+ "logout": "logout",
"session_cancel": "session/cancel",
"session_close": "session/close",
"session_fork": "session/fork",
diff --git a/schema/schema.unstable.json b/schema/schema.unstable.json
index e179a607..5af0bca6 100644
--- a/schema/schema.unstable.json
+++ b/schema/schema.unstable.json
@@ -1,5 +1,27 @@
{
"$defs": {
+ "AgentAuthCapabilities": {
+ "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication-related capabilities supported by the agent.",
+ "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"]
+ },
+ "logout": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/LogoutCapabilities"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Whether the agent supports the logout method.\n\nBy supplying `{}` it means that the agent supports the logout method."
+ }
+ },
+ "type": "object"
+ },
"AgentCapabilities": {
"description": "Capabilities supported by the agent.\n\nAdvertised during initialization to inform the client about\navailable features and content types.\n\nSee protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)",
"properties": {
@@ -8,6 +30,15 @@
"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"]
},
+ "auth": {
+ "allOf": [
+ {
+ "$ref": "#/$defs/AgentAuthCapabilities"
+ }
+ ],
+ "default": {},
+ "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication-related capabilities supported by the agent."
+ },
"loadSession": {
"default": false,
"description": "Whether the agent supports `session/load`.",
@@ -220,6 +251,14 @@
],
"title": "AuthenticateResponse"
},
+ {
+ "allOf": [
+ {
+ "$ref": "#/$defs/LogoutResponse"
+ }
+ ],
+ "title": "LogoutResponse"
+ },
{
"allOf": [
{
@@ -842,6 +881,15 @@
"description": "Authenticates the client using the specified authentication method.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)",
"title": "AuthenticateRequest"
},
+ {
+ "allOf": [
+ {
+ "$ref": "#/$defs/LogoutRequest"
+ }
+ ],
+ "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLogs out of the current authenticated state.\n\nAfter a successful logout, all new sessions will require authentication.\nThere is no guarantee about the behavior of already running sessions.",
+ "title": "LogoutRequest"
+ },
{
"allOf": [
{
@@ -1783,6 +1831,7 @@
}
],
"default": {
+ "auth": {},
"loadSession": false,
"mcpCapabilities": {
"http": false,
@@ -1990,6 +2039,43 @@
"x-method": "session/load",
"x-side": "agent"
},
+ "LogoutCapabilities": {
+ "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLogout capabilities supported by the agent.\n\nBy supplying `{}` it means that the agent supports the logout 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"
+ },
+ "LogoutRequest": {
+ "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for the logout method.\n\nTerminates the current authenticated session.",
+ "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": "logout",
+ "x-side": "agent"
+ },
+ "LogoutResponse": {
+ "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to the `logout` 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": "logout",
+ "x-side": "agent"
+ },
"McpCapabilities": {
"description": "MCP capabilities supported by the agent",
"properties": {
diff --git a/src/agent.rs b/src/agent.rs
index b982085f..70e7b040 100644
--- a/src/agent.rs
+++ b/src/agent.rs
@@ -301,6 +301,177 @@ impl AuthenticateResponse {
}
}
+// Logout
+
+/// **UNSTABLE**
+///
+/// This capability is not part of the spec yet, and may be removed or changed at any point.
+///
+/// Request parameters for the logout method.
+///
+/// Terminates the current authenticated session.
+#[cfg(feature = "unstable_logout")]
+#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
+#[schemars(extend("x-side" = "agent", "x-method" = LOGOUT_METHOD_NAME))]
+#[serde(rename_all = "camelCase")]
+#[non_exhaustive]
+pub struct LogoutRequest {
+ /// 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(skip_serializing_if = "Option::is_none", rename = "_meta")]
+ pub meta: Option,
+}
+
+#[cfg(feature = "unstable_logout")]
+impl LogoutRequest {
+ #[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
+ }
+}
+
+/// **UNSTABLE**
+///
+/// This capability is not part of the spec yet, and may be removed or changed at any point.
+///
+/// Response to the `logout` method.
+#[cfg(feature = "unstable_logout")]
+#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
+#[schemars(extend("x-side" = "agent", "x-method" = LOGOUT_METHOD_NAME))]
+#[serde(rename_all = "camelCase")]
+#[non_exhaustive]
+pub struct LogoutResponse {
+ /// 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(skip_serializing_if = "Option::is_none", rename = "_meta")]
+ pub meta: Option,
+}
+
+#[cfg(feature = "unstable_logout")]
+impl LogoutResponse {
+ #[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
+ }
+}
+
+/// **UNSTABLE**
+///
+/// This capability is not part of the spec yet, and may be removed or changed at any point.
+///
+/// Authentication-related capabilities supported by the agent.
+#[cfg(feature = "unstable_logout")]
+#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
+#[serde(rename_all = "camelCase")]
+#[non_exhaustive]
+pub struct AgentAuthCapabilities {
+ /// Whether the agent supports the logout method.
+ ///
+ /// By supplying `{}` it means that the agent supports the logout method.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub logout: 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.
+ ///
+ /// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
+ #[serde(skip_serializing_if = "Option::is_none", rename = "_meta")]
+ pub meta: Option,
+}
+
+#[cfg(feature = "unstable_logout")]
+impl AgentAuthCapabilities {
+ #[must_use]
+ pub fn new() -> Self {
+ Self::default()
+ }
+
+ /// Whether the agent supports the logout method.
+ #[must_use]
+ pub fn logout(mut self, logout: impl IntoOption) -> Self {
+ self.logout = logout.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.
+ ///
+ /// 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
+ }
+}
+
+/// **UNSTABLE**
+///
+/// This capability is not part of the spec yet, and may be removed or changed at any point.
+///
+/// Logout capabilities supported by the agent.
+///
+/// By supplying `{}` it means that the agent supports the logout method.
+#[cfg(feature = "unstable_logout")]
+#[derive(Default, Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
+#[non_exhaustive]
+pub struct LogoutCapabilities {
+ /// 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(skip_serializing_if = "Option::is_none", rename = "_meta")]
+ pub meta: Option,
+}
+
+#[cfg(feature = "unstable_logout")]
+impl LogoutCapabilities {
+ #[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
+ }
+}
+
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq, Hash, Display, From)]
#[serde(transparent)]
#[from(Arc, String, &'static str)]
@@ -3064,6 +3235,14 @@ pub struct AgentCapabilities {
pub mcp_capabilities: McpCapabilities,
#[serde(default)]
pub session_capabilities: SessionCapabilities,
+ /// **UNSTABLE**
+ ///
+ /// This capability is not part of the spec yet, and may be removed or changed at any point.
+ ///
+ /// Authentication-related capabilities supported by the agent.
+ #[cfg(feature = "unstable_logout")]
+ #[serde(default)]
+ pub auth: AgentAuthCapabilities,
/// 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.
@@ -3107,6 +3286,18 @@ impl AgentCapabilities {
self
}
+ /// **UNSTABLE**
+ ///
+ /// This capability is not part of the spec yet, and may be removed or changed at any point.
+ ///
+ /// Authentication-related capabilities supported by the agent.
+ #[cfg(feature = "unstable_logout")]
+ #[must_use]
+ pub fn auth(mut self, auth: AgentAuthCapabilities) -> Self {
+ self.auth = auth;
+ 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.
@@ -3534,6 +3725,9 @@ pub struct AgentMethodNames {
/// Method for closing an active session.
#[cfg(feature = "unstable_session_close")]
pub session_close: &'static str,
+ /// Method for logging out of an authenticated session.
+ #[cfg(feature = "unstable_logout")]
+ pub logout: &'static str,
}
/// Constant containing all agent method names.
@@ -3555,6 +3749,8 @@ pub const AGENT_METHOD_NAMES: AgentMethodNames = AgentMethodNames {
session_resume: SESSION_RESUME_METHOD_NAME,
#[cfg(feature = "unstable_session_close")]
session_close: SESSION_CLOSE_METHOD_NAME,
+ #[cfg(feature = "unstable_logout")]
+ logout: LOGOUT_METHOD_NAME,
};
/// Method name for the initialize request.
@@ -3587,6 +3783,9 @@ pub(crate) const SESSION_RESUME_METHOD_NAME: &str = "session/resume";
/// Method name for closing an active session.
#[cfg(feature = "unstable_session_close")]
pub(crate) const SESSION_CLOSE_METHOD_NAME: &str = "session/close";
+/// Method name for logging out of an authenticated session.
+#[cfg(feature = "unstable_logout")]
+pub(crate) const LOGOUT_METHOD_NAME: &str = "logout";
/// All possible requests that a client can send to an agent.
///
@@ -3620,6 +3819,16 @@ pub enum ClientRequest {
///
/// See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
AuthenticateRequest(AuthenticateRequest),
+ /// **UNSTABLE**
+ ///
+ /// This capability is not part of the spec yet, and may be removed or changed at any point.
+ ///
+ /// Logs out of the current authenticated state.
+ ///
+ /// After a successful logout, all new sessions will require authentication.
+ /// There is no guarantee about the behavior of already running sessions.
+ #[cfg(feature = "unstable_logout")]
+ LogoutRequest(LogoutRequest),
/// Creates a new conversation session with the agent.
///
/// Sessions represent independent conversation contexts with their own history and state.
@@ -3738,6 +3947,8 @@ impl ClientRequest {
match self {
Self::InitializeRequest(_) => AGENT_METHOD_NAMES.initialize,
Self::AuthenticateRequest(_) => AGENT_METHOD_NAMES.authenticate,
+ #[cfg(feature = "unstable_logout")]
+ Self::LogoutRequest(_) => AGENT_METHOD_NAMES.logout,
Self::NewSessionRequest(_) => AGENT_METHOD_NAMES.session_new,
Self::LoadSessionRequest(_) => AGENT_METHOD_NAMES.session_load,
Self::ListSessionsRequest(_) => AGENT_METHOD_NAMES.session_list,
@@ -3771,6 +3982,8 @@ impl ClientRequest {
pub enum AgentResponse {
InitializeResponse(InitializeResponse),
AuthenticateResponse(#[serde(default)] AuthenticateResponse),
+ #[cfg(feature = "unstable_logout")]
+ LogoutResponse(#[serde(default)] LogoutResponse),
NewSessionResponse(NewSessionResponse),
LoadSessionResponse(#[serde(default)] LoadSessionResponse),
ListSessionsResponse(ListSessionsResponse),
diff --git a/src/bin/generate.rs b/src/bin/generate.rs
index 13d219c6..ccf6fb76 100644
--- a/src/bin/generate.rs
+++ b/src/bin/generate.rs
@@ -944,6 +944,7 @@ starting with '$/' it is free to ignore the notification."
"session/cancel" => self.agent.get("CancelNotification").unwrap(),
"session/set_model" => self.agent.get("SetSessionModelRequest").unwrap(),
"session/close" => self.agent.get("CloseSessionRequest").unwrap(),
+ "logout" => self.agent.get("LogoutRequest").unwrap(),
_ => panic!("Introduced a method? Add it here :)"),
}
}
diff --git a/src/rpc.rs b/src/rpc.rs
index 9c1a92e8..865e5519 100644
--- a/src/rpc.rs
+++ b/src/rpc.rs
@@ -274,6 +274,10 @@ impl Side for AgentSide {
m if m == AGENT_METHOD_NAMES.authenticate => serde_json::from_str(params.get())
.map(ClientRequest::AuthenticateRequest)
.map_err(Into::into),
+ #[cfg(feature = "unstable_logout")]
+ m if m == AGENT_METHOD_NAMES.logout => serde_json::from_str(params.get())
+ .map(ClientRequest::LogoutRequest)
+ .map_err(Into::into),
m if m == AGENT_METHOD_NAMES.session_new => serde_json::from_str(params.get())
.map(ClientRequest::NewSessionRequest)
.map_err(Into::into),