Skip to content

Commit 2cc77af

Browse files
authored
feat(schema): stabilize deleteSession (#168)
* Update OpenAPI TypeScript generator dependencies * feat(schema): stabilize deleteSession Update schema for v0.13.6 protocol changes * Stabilize session delete and logout docs
1 parent 8966c11 commit 2cc77af

8 files changed

Lines changed: 372 additions & 430 deletions

File tree

package-lock.json

Lines changed: 295 additions & 262 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"devDependencies": {
5050
"@eslint/js": "^10.0.1",
51-
"@hey-api/openapi-ts": "^0.97.0",
51+
"@hey-api/openapi-ts": "^0.98.0",
5252
"@types/node": "^25.5.0",
5353
"@typescript-eslint/eslint-plugin": "^8.57.1",
5454
"@typescript-eslint/parser": "^8.57.1",

schema/schema.json

Lines changed: 54 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@
10251025
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNES (Next Edit Suggestions) capabilities supported by the client.",
10261026
"x-deserialize-default-on-error": true
10271027
},
1028-
"planCapabilities": {
1028+
"plan": {
10291029
"anyOf": [
10301030
{
10311031
"$ref": "#/$defs/PlanCapabilities"
@@ -1312,7 +1312,7 @@
13121312
"$ref": "#/$defs/DeleteSessionRequest"
13131313
}
13141314
],
1315-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nDeletes an existing session from `session/list`.\n\nThis method is only available if the agent advertises the `sessionCapabilities.delete` capability.",
1315+
"description": "Deletes an existing session from `session/list`.\n\nThis method is only available if the agent advertises the `sessionCapabilities.delete` capability.",
13161316
"title": "DeleteSessionRequest"
13171317
},
13181318
{
@@ -1846,15 +1846,22 @@
18461846
"description": "A single item of content"
18471847
},
18481848
"messageId": {
1849-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA unique identifier for the message this chunk belongs to.\n\nAll chunks belonging to the same message share the same `messageId`.\nA change in `messageId` indicates a new message has started.\nBoth clients and agents MUST use UUID format for message IDs.",
1850-
"type": ["string", "null"]
1849+
"anyOf": [
1850+
{
1851+
"$ref": "#/$defs/MessageId"
1852+
},
1853+
{
1854+
"type": "null"
1855+
}
1856+
],
1857+
"description": "A unique identifier for the message this chunk belongs to.\n\nAll chunks belonging to the same message share the same `messageId`.\nA change in `messageId` indicates a new message has started."
18511858
}
18521859
},
18531860
"required": ["content"],
18541861
"type": "object"
18551862
},
18561863
"Cost": {
1857-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCost information for a session.",
1864+
"description": "Cost information for a session.",
18581865
"properties": {
18591866
"amount": {
18601867
"description": "Total cumulative cost for session.",
@@ -2069,7 +2076,7 @@
20692076
"type": "object"
20702077
},
20712078
"DeleteSessionRequest": {
2072-
"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 deleting an existing session from `session/list`.\n\nOnly available if the Agent supports the `sessionCapabilities.delete` capability.",
2079+
"description": "Request parameters for deleting an existing session from `session/list`.\n\nOnly available if the Agent supports the `sessionCapabilities.delete` capability.",
20732080
"properties": {
20742081
"_meta": {
20752082
"additionalProperties": true,
@@ -2091,7 +2098,7 @@
20912098
"x-side": "agent"
20922099
},
20932100
"DeleteSessionResponse": {
2094-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse from deleting a session.",
2101+
"description": "Response from deleting a session.",
20952102
"properties": {
20962103
"_meta": {
20972104
"additionalProperties": true,
@@ -3726,6 +3733,10 @@
37263733
"required": ["name", "command", "args", "env"],
37273734
"type": "object"
37283735
},
3736+
"MessageId": {
3737+
"description": "Unique identifier for a message within a session.",
3738+
"type": "string"
3739+
},
37293740
"MessageMcpNotification": {
37303741
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nNotification parameters for `mcp/message`.\n\nThis is used when the wrapped MCP message is a notification and the outer JSON-RPC\nenvelope has no `id`.",
37313742
"properties": {
@@ -5295,10 +5306,6 @@
52955306
"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)",
52965307
"type": ["object", "null"]
52975308
},
5298-
"messageId": {
5299-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA client-generated unique identifier for this user message.\n\nIf provided, the Agent SHOULD echo this value as `userMessageId` in the\n[`PromptResponse`] to confirm it was recorded.\nBoth clients and agents MUST use UUID format for message IDs.",
5300-
"type": ["string", "null"]
5301-
},
53025309
"prompt": {
53035310
"description": "The blocks of content that compose the user's message.\n\nAs a baseline, the Agent MUST support [`ContentBlock::Text`] and [`ContentBlock::ResourceLink`],\nwhile other variants are optionally enabled via [`PromptCapabilities`].\n\nThe Client MUST adapt its interface according to [`PromptCapabilities`].\n\nThe client MAY include referenced pieces of context as either\n[`ContentBlock::Resource`] or [`ContentBlock::ResourceLink`].\n\nWhen available, [`ContentBlock::Resource`] is preferred\nas it avoids extra round-trips and allows the message to include\npieces of context from sources the agent may not have access to.",
53045311
"items": {
@@ -5347,10 +5354,6 @@
53475354
],
53485355
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nToken usage for this turn (optional).",
53495356
"x-deserialize-default-on-error": true
5350-
},
5351-
"userMessageId": {
5352-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe acknowledged user message ID.\n\nIf the client provided a `messageId` in the [`PromptRequest`], the agent echoes it here\nto confirm it was recorded. If the client did not provide one, the agent MAY assign one\nand return it here. Absence of this field indicates the agent did not record a message ID.",
5353-
"type": ["string", "null"]
53545357
}
53555358
},
53565359
"required": ["stopReason"],
@@ -5895,7 +5898,7 @@
58955898
"type": "null"
58965899
}
58975900
],
5898-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nWhether the agent supports `session/delete`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports deleting sessions from `session/list`.",
5901+
"description": "Whether the agent supports `session/delete`.\n\nOptional. Omitted or `null` both mean the agent does not advertise support.\nSupplying `{}` means the agent supports deleting sessions from `session/list`.",
58995902
"x-deserialize-default-on-error": true
59005903
},
59015904
"fork": {
@@ -6177,7 +6180,7 @@
61776180
"type": "string"
61786181
},
61796182
"SessionDeleteCapabilities": {
6180-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.",
6183+
"description": "Capabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.",
61816184
"properties": {
61826185
"_meta": {
61836186
"additionalProperties": true,
@@ -6572,7 +6575,7 @@
65726575
"$ref": "#/$defs/UsageUpdate"
65736576
}
65746577
],
6575-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nContext window and cost update for the session.",
6578+
"description": "Context window and cost update for the session.",
65766579
"properties": {
65776580
"sessionUpdate": {
65786581
"const": "usage_update",
@@ -7604,7 +7607,7 @@
76047607
"type": "object"
76057608
},
76067609
"UsageUpdate": {
7607-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nContext window and cost update for a session.",
7610+
"description": "Context window and cost update for a session.",
76087611
"properties": {
76097612
"_meta": {
76107613
"additionalProperties": true,
@@ -7826,19 +7829,41 @@
78267829
"type": "object"
78277830
},
78287831
{
7829-
"anyOf": [
7830-
{
7831-
"allOf": [
7832+
"description": "A message (request, response, or notification) with `\"jsonrpc\": \"2.0\"` specified as\n[required by JSON-RPC 2.0 Specification][1].\n\n[1]: https://www.jsonrpc.org/specification#compatibility",
7833+
"properties": {
7834+
"jsonrpc": {
7835+
"enum": ["2.0"],
7836+
"type": "string"
7837+
},
7838+
"method": {
7839+
"type": "string"
7840+
},
7841+
"params": {
7842+
"anyOf": [
78327843
{
7833-
"$ref": "#/$defs/CancelRequestNotification"
7844+
"anyOf": [
7845+
{
7846+
"allOf": [
7847+
{
7848+
"$ref": "#/$defs/CancelRequestNotification"
7849+
}
7850+
],
7851+
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or\nchanged at any point.\n\nCancels an ongoing request.\n\nThis is a notification sent by the side that sent a request to cancel that request.\n\nUpon receiving this notification, the receiver:\n\n1. MUST cancel the corresponding request activity and all nested activities\n2. MAY send any pending notifications.\n3. MUST send one of these responses for the original request:\n - Valid response with appropriate data (partial results or cancellation marker)\n - Error response with code `-32800` (Cancelled)\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)",
7852+
"title": "CancelRequestNotification"
7853+
}
7854+
],
7855+
"description": "General protocol-level notifications that all sides are expected to\nimplement.\n\nNotifications whose methods start with '$/' are messages which\nare protocol implementation dependent and might not be implementable in all\nclients or agents. For example if the implementation uses a single threaded\nsynchronous programming language then there is little it can do to react to\na `$/cancel_request` notification. If an agent or client receives\nnotifications starting with '$/' it is free to ignore the notification.\n\nNotifications do not expect a response."
7856+
},
7857+
{
7858+
"type": "null"
78347859
}
7835-
],
7836-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or\nchanged at any point.\n\nCancels an ongoing request.\n\nThis is a notification sent by the side that sent a request to cancel that request.\n\nUpon receiving this notification, the receiver:\n\n1. MUST cancel the corresponding request activity and all nested activities\n2. MAY send any pending notifications.\n3. MUST send one of these responses for the original request:\n - Valid response with appropriate data (partial results or cancellation marker)\n - Error response with code `-32800` (Cancelled)\n\nSee protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)",
7837-
"title": "CancelRequestNotification"
7860+
]
78387861
}
7839-
],
7840-
"description": "General protocol-level notifications that all sides are expected to\nimplement.\n\nNotifications whose methods start with '$/' are messages which\nare protocol implementation dependent and might not be implementable in all\nclients or agents. For example if the implementation uses a single threaded\nsynchronous programming language then there is little it can do to react to\na `$/cancel_request` notification. If an agent or client receives\nnotifications starting with '$/' it is free to ignore the notification.\n\nNotifications do not expect a response.",
7841-
"title": "ProtocolLevel"
7862+
},
7863+
"required": ["jsonrpc", "method"],
7864+
"title": "ProtocolLevel",
7865+
"type": "object",
7866+
"x-docs-ignore": true
78427867
}
78437868
],
78447869
"title": "Agent Client Protocol"

scripts/generate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as fs from "fs/promises";
55
import { dirname } from "path";
66
import * as prettier from "prettier";
77

8-
const CURRENT_SCHEMA_RELEASE = "v0.13.5";
8+
const CURRENT_SCHEMA_RELEASE = "v0.13.6";
99

1010
await main();
1111

src/acp.ts

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ export class AgentSideConnection {
8686
return agent.listSessions(validatedParams);
8787
}
8888
case schema.AGENT_METHODS.session_delete: {
89-
if (!agent.unstable_deleteSession) {
89+
if (!agent.deleteSession) {
9090
throw RequestError.methodNotFound(method);
9191
}
9292
const validatedParams = validate.zDeleteSessionRequest.parse(params);
93-
const result = await agent.unstable_deleteSession(validatedParams);
93+
const result = await agent.deleteSession(validatedParams);
9494
return result ?? {};
9595
}
9696
case schema.AGENT_METHODS.session_fork: {
@@ -827,17 +827,11 @@ export class ClientSideConnection implements Agent {
827827
}
828828

829829
/**
830-
* **UNSTABLE**
831-
*
832-
* This capability is not part of the spec yet, and may be removed or changed at any point.
833-
*
834830
* Deletes an existing session returned by `session/list`.
835831
*
836832
* This method is only available if the agent advertises the `sessionCapabilities.delete` capability.
837-
*
838-
* @experimental
839833
*/
840-
unstable_deleteSession(
834+
deleteSession(
841835
params: schema.DeleteSessionRequest,
842836
): Promise<schema.DeleteSessionResponse> {
843837
return this.connection.sendRequest<
@@ -1003,11 +997,7 @@ export class ClientSideConnection implements Agent {
1003997
}
1004998

1005999
/**
1006-
* Terminates the current authenticated session.
1007-
*
1008-
* **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.
1009-
*
1010-
* @experimental
1000+
* Logout of the current authentication method.
10111001
*/
10121002
logout(params: schema.LogoutRequest): Promise<schema.LogoutResponse> {
10131003
return this.connection.sendRequest<
@@ -1998,17 +1988,11 @@ export interface Agent {
19981988
params: schema.ListSessionsRequest,
19991989
): Promise<schema.ListSessionsResponse>;
20001990
/**
2001-
* **UNSTABLE**
2002-
*
2003-
* This capability is not part of the spec yet, and may be removed or changed at any point.
2004-
*
20051991
* Deletes an existing session returned by `session/list`.
20061992
*
20071993
* This method is only available if the agent advertises the `sessionCapabilities.delete` capability.
2008-
*
2009-
* @experimental
20101994
*/
2011-
unstable_deleteSession?(
1995+
deleteSession?(
20121996
params: schema.DeleteSessionRequest,
20131997
): Promise<schema.DeleteSessionResponse | void>;
20141998
/**
@@ -2120,13 +2104,8 @@ export interface Agent {
21202104
params: schema.DisableProviderRequest,
21212105
): Promise<schema.DisableProviderResponse | void>;
21222106
/**
2123-
* Terminates the current authenticated session.
2124-
*
2125-
* **UNSTABLE**: This capability is not part of the spec yet, and may be removed or changed at any point.
2126-
*
2127-
* @experimental
2107+
* Logout of the current authentication method.
21282108
*/
2129-
21302109
logout?(params: schema.LogoutRequest): Promise<schema.LogoutResponse | void>;
21312110
/**
21322111
* Processes a user prompt within a session.

src/schema/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export type {
110110
McpServerHttp,
111111
McpServerSse,
112112
McpServerStdio,
113+
MessageId,
113114
MessageMcpNotification,
114115
MessageMcpRequest,
115116
MessageMcpResponse,

0 commit comments

Comments
 (0)