From 57c3bf757a17d03de6c89a691947a0593bba05a2 Mon Sep 17 00:00:00 2001 From: Artem Tyurin Date: Mon, 8 Jun 2026 11:33:42 +0100 Subject: [PATCH] Update SDK to 0.13.6 --- README.md | 2 +- acp_test.go | 18 ++-- agent_gen.go | 10 +-- client_gen.go | 4 +- example/agent/main.go | 6 +- example_agent_test.go | 5 ++ schema/meta.json | 1 + schema/schema.json | 158 ++++++++++++++++++++++++++++++++++ schema/schema.unstable.json | 83 +++++++++++------- schema/version | 2 +- types_gen.go | 167 ++++++++++-------------------------- version | 2 +- 12 files changed, 288 insertions(+), 170 deletions(-) diff --git a/README.md b/README.md index cdcec5b..6bfe3dd 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Learn more about the protocol itself at . ```bash -go get github.com/coder/acp-go-sdk@v0.13.5 +go get github.com/coder/acp-go-sdk@v0.13.6 ``` ## Get Started diff --git a/acp_test.go b/acp_test.go index 22dc45c..bc9efd3 100644 --- a/acp_test.go +++ b/acp_test.go @@ -136,7 +136,7 @@ type agentFuncs struct { UnstableDisableProviderFunc func(context.Context, UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error) UnstableListProvidersFunc func(context.Context, UnstableListProvidersRequest) (UnstableListProvidersResponse, error) UnstableSetProviderFunc func(context.Context, UnstableSetProviderRequest) (UnstableSetProviderResponse, error) - UnstableDeleteSessionFunc func(context.Context, UnstableDeleteSessionRequest) (UnstableDeleteSessionResponse, error) + DeleteSessionFunc func(context.Context, DeleteSessionRequest) (DeleteSessionResponse, error) UnstableForkSessionFunc func(context.Context, UnstableForkSessionRequest) (UnstableForkSessionResponse, error) HandleExtensionMethodFunc func(context.Context, string, json.RawMessage) (any, error) @@ -337,11 +337,11 @@ func (a agentFuncs) UnstableSetProvider(ctx context.Context, params UnstableSetP return UnstableSetProviderResponse{}, nil } -func (a agentFuncs) UnstableDeleteSession(ctx context.Context, params UnstableDeleteSessionRequest) (UnstableDeleteSessionResponse, error) { - if a.UnstableDeleteSessionFunc != nil { - return a.UnstableDeleteSessionFunc(ctx, params) +func (a agentFuncs) DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error) { + if a.DeleteSessionFunc != nil { + return a.DeleteSessionFunc(ctx, params) } - return UnstableDeleteSessionResponse{}, nil + return DeleteSessionResponse{}, nil } func (a agentFuncs) HandleExtensionMethod(ctx context.Context, method string, params json.RawMessage) (any, error) { @@ -399,6 +399,10 @@ func (a *forkOnlyUnstableAgent) SetSessionConfigOption(context.Context, SetSessi return SetSessionConfigOptionResponse{}, nil } +func (a *forkOnlyUnstableAgent) DeleteSession(context.Context, DeleteSessionRequest) (DeleteSessionResponse, error) { + return DeleteSessionResponse{}, nil +} + func (a *forkOnlyUnstableAgent) UnstableForkSession(context.Context, UnstableForkSessionRequest) (UnstableForkSessionResponse, error) { a.called = true return UnstableForkSessionResponse{SessionId: "forked-session"}, nil @@ -1264,6 +1268,10 @@ func (agentNoExtensions) CloseSession(ctx context.Context, params CloseSessionRe return CloseSessionResponse{}, nil } +func (agentNoExtensions) DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error) { + return DeleteSessionResponse{}, nil +} + func (agentNoExtensions) NewSession(ctx context.Context, params NewSessionRequest) (NewSessionResponse, error) { return NewSessionResponse{}, nil } diff --git a/agent_gen.go b/agent_gen.go index c90cca4..a7c9181 100644 --- a/agent_gen.go +++ b/agent_gen.go @@ -320,20 +320,14 @@ func (a *AgentSideConnection) handle(ctx context.Context, method string, params } return resp, nil case AgentMethodSessionDelete: - var p UnstableDeleteSessionRequest + var p DeleteSessionRequest if err := json.Unmarshal(params, &p); err != nil { return nil, NewInvalidParams(map[string]any{"error": err.Error()}) } if err := p.Validate(); err != nil { return nil, NewInvalidParams(map[string]any{"error": err.Error()}) } - exp, ok := a.agent.(interface { - UnstableDeleteSession(context.Context, UnstableDeleteSessionRequest) (UnstableDeleteSessionResponse, error) - }) - if !ok { - return nil, NewMethodNotFound(method) - } - resp, err := exp.UnstableDeleteSession(ctx, p) + resp, err := a.agent.DeleteSession(ctx, p) if err != nil { return nil, toReqErr(err) } diff --git a/client_gen.go b/client_gen.go index b6ce47d..273f3a4 100644 --- a/client_gen.go +++ b/client_gen.go @@ -268,8 +268,8 @@ func (c *ClientSideConnection) CloseSession(ctx context.Context, params CloseSes resp, err := SendRequest[CloseSessionResponse](c.conn, ctx, AgentMethodSessionClose, params) return resp, err } -func (c *ClientSideConnection) UnstableDeleteSession(ctx context.Context, params UnstableDeleteSessionRequest) (UnstableDeleteSessionResponse, error) { - resp, err := SendRequest[UnstableDeleteSessionResponse](c.conn, ctx, AgentMethodSessionDelete, params) +func (c *ClientSideConnection) DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error) { + resp, err := SendRequest[DeleteSessionResponse](c.conn, ctx, AgentMethodSessionDelete, params) return resp, err } func (c *ClientSideConnection) UnstableForkSession(ctx context.Context, params UnstableForkSessionRequest) (UnstableForkSessionResponse, error) { diff --git a/example/agent/main.go b/example/agent/main.go index ac3dbfe..cdeb7e8 100644 --- a/example/agent/main.go +++ b/example/agent/main.go @@ -131,9 +131,9 @@ func (a *exampleAgent) UnstableSetProvider(ctx context.Context, params acp.Unsta return acp.UnstableSetProviderResponse{}, acp.NewMethodNotFound(acp.AgentMethodProvidersSet) } -// UnstableDeleteSession implements acp.AgentExperimental. -func (a *exampleAgent) UnstableDeleteSession(ctx context.Context, params acp.UnstableDeleteSessionRequest) (acp.UnstableDeleteSessionResponse, error) { - return acp.UnstableDeleteSessionResponse{}, acp.NewMethodNotFound(acp.AgentMethodSessionDelete) +// DeleteSession implements acp.Agent. +func (a *exampleAgent) DeleteSession(ctx context.Context, params acp.DeleteSessionRequest) (acp.DeleteSessionResponse, error) { + return acp.DeleteSessionResponse{}, acp.NewMethodNotFound(acp.AgentMethodSessionDelete) } // CloseSession implements acp.Agent. diff --git a/example_agent_test.go b/example_agent_test.go index 4b446ce..8eb86c3 100644 --- a/example_agent_test.go +++ b/example_agent_test.go @@ -32,6 +32,11 @@ func (a *agentExample) CloseSession(ctx context.Context, params CloseSessionRequ return CloseSessionResponse{}, nil } +// DeleteSession implements Agent. +func (a *agentExample) DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error) { + return DeleteSessionResponse{}, nil +} + // SetSessionConfigOption implements Agent. func (a *agentExample) SetSessionConfigOption(ctx context.Context, params SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error) { return SetSessionConfigOptionResponse{}, nil diff --git a/schema/meta.json b/schema/meta.json index bc5135b..809ccd9 100644 --- a/schema/meta.json +++ b/schema/meta.json @@ -5,6 +5,7 @@ "logout": "logout", "session_cancel": "session/cancel", "session_close": "session/close", + "session_delete": "session/delete", "session_list": "session/list", "session_load": "session/load", "session_new": "session/new", diff --git a/schema/schema.json b/schema/schema.json index 42251b5..f669304 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -284,6 +284,14 @@ ], "title": "ListSessionsResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/DeleteSessionResponse" + } + ], + "title": "DeleteSessionResponse" + }, { "allOf": [ { @@ -724,6 +732,15 @@ "description": "Lists existing sessions known to the agent.\n\nThis method is only available if the agent advertises the `sessionCapabilities.list` capability.\n\nThe agent should return metadata about sessions with optional filtering and pagination support.", "title": "ListSessionsRequest" }, + { + "allOf": [ + { + "$ref": "#/$defs/DeleteSessionRequest" + } + ], + "description": "Deletes an existing session from `session/list`.\n\nThis method is only available if the agent advertises the `sessionCapabilities.delete` capability.", + "title": "DeleteSessionRequest" + }, { "allOf": [ { @@ -1075,11 +1092,38 @@ } ], "description": "A single item of content" + }, + "messageId": { + "anyOf": [ + { + "$ref": "#/$defs/MessageId" + }, + { + "type": "null" + } + ], + "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." } }, "required": ["content"], "type": "object" }, + "Cost": { + "description": "Cost information for a session.", + "properties": { + "amount": { + "description": "Total cumulative cost for session.", + "format": "double", + "type": "number" + }, + "currency": { + "description": "ISO 4217 currency code (e.g., \"USD\", \"EUR\").", + "type": "string" + } + }, + "required": ["amount", "currency"], + "type": "object" + }, "CreateTerminalRequest": { "description": "Request to create a new terminal and execute a command.", "properties": { @@ -1168,6 +1212,41 @@ "required": ["currentModeId"], "type": "object" }, + "DeleteSessionRequest": { + "description": "Request parameters for deleting an existing session from `session/list`.\n\nOnly available if the Agent supports the `sessionCapabilities.delete` capability.", + "properties": { + "_meta": { + "additionalProperties": true, + "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)", + "type": ["object", "null"] + }, + "sessionId": { + "allOf": [ + { + "$ref": "#/$defs/SessionId" + } + ], + "description": "The ID of the session to delete." + } + }, + "required": ["sessionId"], + "type": "object", + "x-method": "session/delete", + "x-side": "agent" + }, + "DeleteSessionResponse": { + "description": "Response from deleting a 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": "session/delete", + "x-side": "agent" + }, "Diff": { "description": "A diff representing file modifications.\n\nShows changes to files in a format suitable for display in the client UI.\n\nSee protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)", "properties": { @@ -1915,6 +1994,10 @@ "required": ["name", "command", "args", "env"], "type": "object" }, + "MessageId": { + "description": "Unique identifier for a message within a session.", + "type": "string" + }, "NewSessionRequest": { "description": "Request parameters for creating a new session.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)", "properties": { @@ -2618,6 +2701,18 @@ "description": "Whether the agent supports `session/close`.", "x-deserialize-default-on-error": true }, + "delete": { + "anyOf": [ + { + "$ref": "#/$defs/SessionDeleteCapabilities" + }, + { + "type": "null" + } + ], + "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`.", + "x-deserialize-default-on-error": true + }, "list": { "anyOf": [ { @@ -2857,6 +2952,17 @@ "description": "Unique identifier for a session configuration option value.", "type": "string" }, + "SessionDeleteCapabilities": { + "description": "Capabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.", + "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" + }, "SessionId": { "description": "A unique identifier for a conversation session between a client and agent.\n\nSessions maintain their own context, conversation history, and state,\nallowing multiple independent interactions with the same agent.\n\nSee protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)", "type": "string" @@ -3192,6 +3298,22 @@ }, "required": ["sessionUpdate"], "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/UsageUpdate" + } + ], + "description": "Context window and cost update for the session.", + "properties": { + "sessionUpdate": { + "const": "usage_update", + "type": "string" + } + }, + "required": ["sessionUpdate"], + "type": "object" } ] }, @@ -3785,6 +3907,42 @@ "required": ["hint"], "type": "object" }, + "UsageUpdate": { + "description": "Context window and cost update for a 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"] + }, + "cost": { + "anyOf": [ + { + "$ref": "#/$defs/Cost" + }, + { + "type": "null" + } + ], + "description": "Cumulative session cost (optional).", + "x-deserialize-default-on-error": true + }, + "size": { + "description": "Total context window size in tokens.", + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "used": { + "description": "Tokens currently in context.", + "format": "uint64", + "minimum": 0, + "type": "integer" + } + }, + "required": ["used", "size"], + "type": "object" + }, "WaitForTerminalExitRequest": { "description": "Request to wait for a terminal command to exit.", "properties": { diff --git a/schema/schema.unstable.json b/schema/schema.unstable.json index 70afba0..13a8957 100644 --- a/schema/schema.unstable.json +++ b/schema/schema.unstable.json @@ -1025,7 +1025,7 @@ "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.", "x-deserialize-default-on-error": true }, - "planCapabilities": { + "plan": { "anyOf": [ { "$ref": "#/$defs/PlanCapabilities" @@ -1312,7 +1312,7 @@ "$ref": "#/$defs/DeleteSessionRequest" } ], - "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.", + "description": "Deletes an existing session from `session/list`.\n\nThis method is only available if the agent advertises the `sessionCapabilities.delete` capability.", "title": "DeleteSessionRequest" }, { @@ -1846,15 +1846,22 @@ "description": "A single item of content" }, "messageId": { - "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.", - "type": ["string", "null"] + "anyOf": [ + { + "$ref": "#/$defs/MessageId" + }, + { + "type": "null" + } + ], + "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." } }, "required": ["content"], "type": "object" }, "Cost": { - "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.", + "description": "Cost information for a session.", "properties": { "amount": { "description": "Total cumulative cost for session.", @@ -2069,7 +2076,7 @@ "type": "object" }, "DeleteSessionRequest": { - "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.", + "description": "Request parameters for deleting an existing session from `session/list`.\n\nOnly available if the Agent supports the `sessionCapabilities.delete` capability.", "properties": { "_meta": { "additionalProperties": true, @@ -2091,7 +2098,7 @@ "x-side": "agent" }, "DeleteSessionResponse": { - "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.", + "description": "Response from deleting a session.", "properties": { "_meta": { "additionalProperties": true, @@ -3726,6 +3733,10 @@ "required": ["name", "command", "args", "env"], "type": "object" }, + "MessageId": { + "description": "Unique identifier for a message within a session.", + "type": "string" + }, "MessageMcpNotification": { "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`.", "properties": { @@ -5295,10 +5306,6 @@ "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"] }, - "messageId": { - "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.", - "type": ["string", "null"] - }, "prompt": { "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.", "items": { @@ -5347,10 +5354,6 @@ ], "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).", "x-deserialize-default-on-error": true - }, - "userMessageId": { - "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.", - "type": ["string", "null"] } }, "required": ["stopReason"], @@ -5895,7 +5898,7 @@ "type": "null" } ], - "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`.", + "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`.", "x-deserialize-default-on-error": true }, "fork": { @@ -6177,7 +6180,7 @@ "type": "string" }, "SessionDeleteCapabilities": { - "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`.", + "description": "Capabilities for the `session/delete` method.\n\nSupplying `{}` means the agent supports deleting sessions from `session/list`.", "properties": { "_meta": { "additionalProperties": true, @@ -6572,7 +6575,7 @@ "$ref": "#/$defs/UsageUpdate" } ], - "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.", + "description": "Context window and cost update for the session.", "properties": { "sessionUpdate": { "const": "usage_update", @@ -7604,7 +7607,7 @@ "type": "object" }, "UsageUpdate": { - "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.", + "description": "Context window and cost update for a session.", "properties": { "_meta": { "additionalProperties": true, @@ -7826,19 +7829,41 @@ "type": "object" }, { - "anyOf": [ - { - "allOf": [ + "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", + "properties": { + "jsonrpc": { + "enum": ["2.0"], + "type": "string" + }, + "method": { + "type": "string" + }, + "params": { + "anyOf": [ { - "$ref": "#/$defs/CancelRequestNotification" + "anyOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/CancelRequestNotification" + } + ], + "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)", + "title": "CancelRequestNotification" + } + ], + "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." + }, + { + "type": "null" } - ], - "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)", - "title": "CancelRequestNotification" + ] } - ], - "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.", - "title": "ProtocolLevel" + }, + "required": ["jsonrpc", "method"], + "title": "ProtocolLevel", + "type": "object", + "x-docs-ignore": true } ], "title": "Agent Client Protocol" diff --git a/schema/version b/schema/version index c37136a..ebf55b3 100644 --- a/schema/version +++ b/schema/version @@ -1 +1 @@ -0.13.5 +0.13.6 diff --git a/types_gen.go b/types_gen.go index 5c83744..f742179 100644 --- a/types_gen.go +++ b/types_gen.go @@ -898,7 +898,7 @@ type ClientCapabilities struct { // // Optional. Omitted means the client does not advertise support. // Supplying '{}' means the client can receive both update types. - PlanCapabilities *PlanCapabilities `json:"planCapabilities,omitempty"` + Plan *PlanCapabilities `json:"plan,omitempty"` // **UNSTABLE** // // This capability is not part of the spec yet, and may be removed or changed at any point. @@ -1615,22 +1615,13 @@ type ContentChunk struct { Meta map[string]any `json:"_meta,omitempty"` // A single item of content Content ContentBlock `json:"content"` - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // // A unique identifier for the message this chunk belongs to. // // All chunks belonging to the same message share the same 'messageId'. // A change in 'messageId' indicates a new message has started. - // Both clients and agents MUST use UUID format for message IDs. - MessageId *string `json:"messageId,omitempty"` + MessageId *MessageId `json:"messageId,omitempty"` } -// **UNSTABLE** -// -// This capability is not part of the spec yet, and may be removed or changed at any point. -// // Cost information for a session. type Cost struct { // Total cumulative cost for session. @@ -1708,6 +1699,38 @@ type CurrentModeUpdate struct { CurrentModeId SessionModeId `json:"currentModeId"` } +// Request parameters for deleting an existing session from 'session/list'. +// +// Only available if the Agent supports the 'sessionCapabilities.delete' capability. +type DeleteSessionRequest struct { + // 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) + Meta map[string]any `json:"_meta,omitempty"` + // The ID of the session to delete. + SessionId SessionId `json:"sessionId"` +} + +func (v *DeleteSessionRequest) Validate() error { + return nil +} + +// Response from deleting a session. +type DeleteSessionResponse struct { + // 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) + Meta map[string]any `json:"_meta,omitempty"` +} + +func (v *DeleteSessionResponse) Validate() error { + return nil +} + // A diff representing file modifications. // // Shows changes to files in a format suitable for display in the client UI. @@ -3014,6 +3037,9 @@ type McpServerStdio struct { Name string `json:"name"` } +// Unique identifier for a message within a session. +type MessageId string + // NES capabilities advertised by the agent during initialization. type NesCapabilities struct { // The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -3836,16 +3862,6 @@ type PromptRequest struct { // // See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) Meta map[string]any `json:"_meta,omitempty"` - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // - // A client-generated unique identifier for this user message. - // - // If provided, the Agent SHOULD echo this value as 'userMessageId' in the - // ['PromptResponse'] to confirm it was recorded. - // Both clients and agents MUST use UUID format for message IDs. - MessageId *string `json:"messageId,omitempty"` // The blocks of content that compose the user's message. // // As a baseline, the Agent MUST support ['ContentBlock::Text'] and ['ContentBlock::ResourceLink'], @@ -3889,16 +3905,6 @@ type PromptResponse struct { // // Token usage for this turn (optional). Usage *Usage `json:"usage,omitempty"` - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // - // The acknowledged user message ID. - // - // If the client provided a 'messageId' in the ['PromptRequest'], the agent echoes it here - // to confirm it was recorded. If the client did not provide one, the agent MAY assign one - // and return it here. Absence of this field indicates the agent did not record a message ID. - UserMessageId *string `json:"userMessageId,omitempty"` } func (v *PromptResponse) Validate() error { @@ -4432,10 +4438,6 @@ type SessionCapabilities struct { AdditionalDirectories *SessionAdditionalDirectoriesCapabilities `json:"additionalDirectories,omitempty"` // Whether the agent supports 'session/close'. Close *SessionCloseCapabilities `json:"close,omitempty"` - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // // Whether the agent supports 'session/delete'. // // Optional. Omitted or 'null' both mean the agent does not advertise support. @@ -4839,10 +4841,6 @@ func (u SessionConfigSelectOptions) MarshalJSON() ([]byte, error) { // Unique identifier for a session configuration option value. type SessionConfigValueId string -// **UNSTABLE** -// -// This capability is not part of the spec yet, and may be removed or changed at any point. -// // Capabilities for the 'session/delete' method. // // Supplying '{}' means the agent supports deleting sessions from 'session/list'. @@ -5013,17 +5011,12 @@ type SessionUpdateUserMessageChunk struct { Meta map[string]any `json:"_meta,omitempty"` // A single item of content Content ContentBlock `json:"content"` - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // // A unique identifier for the message this chunk belongs to. // // All chunks belonging to the same message share the same 'messageId'. // A change in 'messageId' indicates a new message has started. - // Both clients and agents MUST use UUID format for message IDs. - MessageId *string `json:"messageId,omitempty"` - SessionUpdate string `json:"sessionUpdate"` + MessageId *MessageId `json:"messageId,omitempty"` + SessionUpdate string `json:"sessionUpdate"` } // A chunk of the agent's response being streamed. @@ -5036,17 +5029,12 @@ type SessionUpdateAgentMessageChunk struct { Meta map[string]any `json:"_meta,omitempty"` // A single item of content Content ContentBlock `json:"content"` - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // // A unique identifier for the message this chunk belongs to. // // All chunks belonging to the same message share the same 'messageId'. // A change in 'messageId' indicates a new message has started. - // Both clients and agents MUST use UUID format for message IDs. - MessageId *string `json:"messageId,omitempty"` - SessionUpdate string `json:"sessionUpdate"` + MessageId *MessageId `json:"messageId,omitempty"` + SessionUpdate string `json:"sessionUpdate"` } // A chunk of the agent's internal reasoning being streamed. @@ -5059,17 +5047,12 @@ type SessionUpdateAgentThoughtChunk struct { Meta map[string]any `json:"_meta,omitempty"` // A single item of content Content ContentBlock `json:"content"` - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // // A unique identifier for the message this chunk belongs to. // // All chunks belonging to the same message share the same 'messageId'. // A change in 'messageId' indicates a new message has started. - // Both clients and agents MUST use UUID format for message IDs. - MessageId *string `json:"messageId,omitempty"` - SessionUpdate string `json:"sessionUpdate"` + MessageId *MessageId `json:"messageId,omitempty"` + SessionUpdate string `json:"sessionUpdate"` } // Notification that a new tool call has been initiated. @@ -5235,10 +5218,6 @@ type SessionSessionInfoUpdate struct { UpdatedAt *string `json:"updatedAt,omitempty"` } -// **UNSTABLE** -// -// This capability is not part of the spec yet, and may be removed or changed at any point. -// // Context window and cost update for the session. type SessionUsageUpdate struct { // The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -5292,10 +5271,6 @@ type SessionUpdate struct { ConfigOptionUpdate *SessionConfigOptionUpdate `json:"-"` // Session metadata has been updated (title, timestamps, custom metadata) SessionInfoUpdate *SessionSessionInfoUpdate `json:"-"` - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // // Context window and cost update for the session. UsageUpdate *SessionUsageUpdate `json:"-"` } @@ -7147,46 +7122,6 @@ func (u *UnstableCreateElicitationResponse) Validate() error { return nil } -// **UNSTABLE** -// -// This capability is not part of the spec yet, and may be removed or changed at any point. -// -// Request parameters for deleting an existing session from 'session/list'. -// -// Only available if the Agent supports the 'sessionCapabilities.delete' capability. -type UnstableDeleteSessionRequest struct { - // 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) - Meta map[string]any `json:"_meta,omitempty"` - // The ID of the session to delete. - SessionId SessionId `json:"sessionId"` -} - -func (v *UnstableDeleteSessionRequest) Validate() error { - return nil -} - -// **UNSTABLE** -// -// This capability is not part of the spec yet, and may be removed or changed at any point. -// -// Response from deleting a session. -type UnstableDeleteSessionResponse struct { - // 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) - Meta map[string]any `json:"_meta,omitempty"` -} - -func (v *UnstableDeleteSessionResponse) Validate() error { - return nil -} - // Notification sent when a file is edited. type UnstableDidChangeDocumentNotification struct { // The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -9198,10 +9133,6 @@ type Usage struct { TotalTokens int `json:"totalTokens"` } -// **UNSTABLE** -// -// This capability is not part of the spec yet, and may be removed or changed at any point. -// // Context window and cost update for a session. type UsageUpdate struct { // The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -9326,6 +9257,10 @@ type Agent interface { // // Only available if the Agent supports the 'sessionCapabilities.close' capability. CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error) + // Request parameters for deleting an existing session from 'session/list'. + // + // Only available if the Agent supports the 'sessionCapabilities.delete' capability. + DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error) // Request parameters for listing existing sessions. // // Only available if the Agent supports the 'sessionCapabilities.list' capability. @@ -9412,14 +9347,6 @@ type AgentExperimental interface { // // This capability is not part of the spec yet, and may be removed or changed at any point. // - // Request parameters for deleting an existing session from 'session/list'. - // - // Only available if the Agent supports the 'sessionCapabilities.delete' capability. - UnstableDeleteSession(ctx context.Context, params UnstableDeleteSessionRequest) (UnstableDeleteSessionResponse, error) - // **UNSTABLE** - // - // This capability is not part of the spec yet, and may be removed or changed at any point. - // // Request parameters for forking an existing session. // // Creates a new session based on the context of an existing one, allowing diff --git a/version b/version index c37136a..ebf55b3 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.13.5 +0.13.6