From 0a4a8e456518571c58487d8a15adf9207c578d0c Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Mon, 1 Jun 2026 16:11:53 +0200 Subject: [PATCH] release: v0.13.4 Bump the ACP schema from v0.13.0 to v0.13.4 and regenerate bindings. Protocol changes (upstream agent-client-protocol): - logout graduated unstable -> stable: the Agent interface now requires Logout(LogoutRequest); adds AgentAuthCapabilities / LogoutCapabilities and AgentCapabilities.Auth (#1273). - provider unstable types renamed plural -> singular: UnstableSetProvider, UnstableDisableProvider (JSON-RPC wire method strings unchanged) (#1272). - new unstable session/delete: UnstableDeleteSession, SessionDeleteCapabilities, SessionCapabilities.Delete (#1216). - unstable plan operations: ClientCapabilities.PlanCapabilities and plan_update / plan_removed SessionUpdate variants (#1299). - ListSessionsRequest.additionalDirectories removed (#1227). No wire protocol-version bump (ProtocolVersionNumber stays 1). Manual migrations to satisfy the regenerated interfaces: example/agent/main.go, example_agent_test.go, acp_test.go. Change-Id: I0be9f703f2b9673392a0d61c4bced265f90ba59b Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Thomas Kosiewski --- README.md | 2 +- acp_test.go | 46 ++- agent_gen.go | 41 +- client_gen.go | 16 +- constants_gen.go | 1 + example/agent/main.go | 23 +- example_agent_test.go | 5 + helpers_gen.go | 27 ++ schema/meta.json | 1 + schema/meta.unstable.json | 1 + schema/schema.json | 86 ++++ schema/schema.unstable.json | 356 +++++++++++++++-- schema/version | 2 +- types_gen.go | 765 +++++++++++++++++++++++++++++++----- version | 2 +- 15 files changed, 1189 insertions(+), 185 deletions(-) diff --git a/README.md b/README.md index c3c1ee8..fdb75eb 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.0 +go get github.com/coder/acp-go-sdk@v0.13.4 ``` ## Get Started diff --git a/acp_test.go b/acp_test.go index 739092e..0b63c23 100644 --- a/acp_test.go +++ b/acp_test.go @@ -121,21 +121,22 @@ type agentFuncs struct { ListSessionsFunc func(context.Context, ListSessionsRequest) (ListSessionsResponse, error) ResumeSessionFunc func(context.Context, ResumeSessionRequest) (ResumeSessionResponse, error) SetSessionConfigOptionFunc func(context.Context, SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error) + LogoutFunc func(context.Context, LogoutRequest) (LogoutResponse, error) // Unstable (schema/meta.unstable.json) UnstableDidChangeDocumentFunc func(context.Context, UnstableDidChangeDocumentNotification) error UnstableDidCloseDocumentFunc func(context.Context, UnstableDidCloseDocumentNotification) error UnstableDidFocusDocumentFunc func(context.Context, UnstableDidFocusDocumentNotification) error UnstableDidOpenDocumentFunc func(context.Context, UnstableDidOpenDocumentNotification) error UnstableDidSaveDocumentFunc func(context.Context, UnstableDidSaveDocumentNotification) error - UnstableLogoutFunc func(context.Context, UnstableLogoutRequest) (UnstableLogoutResponse, error) UnstableAcceptNesFunc func(context.Context, UnstableAcceptNesNotification) error UnstableCloseNesFunc func(context.Context, UnstableCloseNesRequest) (UnstableCloseNesResponse, error) UnstableRejectNesFunc func(context.Context, UnstableRejectNesNotification) error UnstableStartNesFunc func(context.Context, UnstableStartNesRequest) (UnstableStartNesResponse, error) UnstableSuggestNesFunc func(context.Context, UnstableSuggestNesRequest) (UnstableSuggestNesResponse, error) - UnstableDisableProvidersFunc func(context.Context, UnstableDisableProvidersRequest) (UnstableDisableProvidersResponse, error) + UnstableDisableProviderFunc func(context.Context, UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error) UnstableListProvidersFunc func(context.Context, UnstableListProvidersRequest) (UnstableListProvidersResponse, error) - UnstableSetProvidersFunc func(context.Context, UnstableSetProvidersRequest) (UnstableSetProvidersResponse, error) + UnstableSetProviderFunc func(context.Context, UnstableSetProviderRequest) (UnstableSetProviderResponse, error) + UnstableDeleteSessionFunc func(context.Context, UnstableDeleteSessionRequest) (UnstableDeleteSessionResponse, error) UnstableForkSessionFunc func(context.Context, UnstableForkSessionRequest) (UnstableForkSessionResponse, error) UnstableSetSessionModelFunc func(context.Context, UnstableSetSessionModelRequest) (UnstableSetSessionModelResponse, error) @@ -282,11 +283,11 @@ func (a agentFuncs) UnstableDidSaveDocument(ctx context.Context, params Unstable return nil } -func (a agentFuncs) UnstableLogout(ctx context.Context, params UnstableLogoutRequest) (UnstableLogoutResponse, error) { - if a.UnstableLogoutFunc != nil { - return a.UnstableLogoutFunc(ctx, params) +func (a agentFuncs) Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error) { + if a.LogoutFunc != nil { + return a.LogoutFunc(ctx, params) } - return UnstableLogoutResponse{}, nil + return LogoutResponse{}, nil } func (a agentFuncs) UnstableAcceptNes(ctx context.Context, params UnstableAcceptNesNotification) error { @@ -324,11 +325,11 @@ func (a agentFuncs) UnstableSuggestNes(ctx context.Context, params UnstableSugge return UnstableSuggestNesResponse{}, nil } -func (a agentFuncs) UnstableDisableProviders(ctx context.Context, params UnstableDisableProvidersRequest) (UnstableDisableProvidersResponse, error) { - if a.UnstableDisableProvidersFunc != nil { - return a.UnstableDisableProvidersFunc(ctx, params) +func (a agentFuncs) UnstableDisableProvider(ctx context.Context, params UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error) { + if a.UnstableDisableProviderFunc != nil { + return a.UnstableDisableProviderFunc(ctx, params) } - return UnstableDisableProvidersResponse{}, nil + return UnstableDisableProviderResponse{}, nil } func (a agentFuncs) UnstableListProviders(ctx context.Context, params UnstableListProvidersRequest) (UnstableListProvidersResponse, error) { @@ -338,11 +339,18 @@ func (a agentFuncs) UnstableListProviders(ctx context.Context, params UnstableLi return UnstableListProvidersResponse{}, nil } -func (a agentFuncs) UnstableSetProviders(ctx context.Context, params UnstableSetProvidersRequest) (UnstableSetProvidersResponse, error) { - if a.UnstableSetProvidersFunc != nil { - return a.UnstableSetProvidersFunc(ctx, params) +func (a agentFuncs) UnstableSetProvider(ctx context.Context, params UnstableSetProviderRequest) (UnstableSetProviderResponse, error) { + if a.UnstableSetProviderFunc != nil { + return a.UnstableSetProviderFunc(ctx, params) } - return UnstableSetProvidersResponse{}, nil + return UnstableSetProviderResponse{}, nil +} + +func (a agentFuncs) UnstableDeleteSession(ctx context.Context, params UnstableDeleteSessionRequest) (UnstableDeleteSessionResponse, error) { + if a.UnstableDeleteSessionFunc != nil { + return a.UnstableDeleteSessionFunc(ctx, params) + } + return UnstableDeleteSessionResponse{}, nil } func (a agentFuncs) HandleExtensionMethod(ctx context.Context, method string, params json.RawMessage) (any, error) { @@ -372,6 +380,10 @@ func (a *forkOnlyUnstableAgent) CloseSession(context.Context, CloseSessionReques return CloseSessionResponse{}, nil } +func (a *forkOnlyUnstableAgent) Logout(context.Context, LogoutRequest) (LogoutResponse, error) { + return LogoutResponse{}, nil +} + func (a *forkOnlyUnstableAgent) NewSession(context.Context, NewSessionRequest) (NewSessionResponse, error) { return NewSessionResponse{}, nil } @@ -1253,6 +1265,10 @@ func (agentNoExtensions) Initialize(ctx context.Context, params InitializeReques func (agentNoExtensions) Cancel(ctx context.Context, params CancelNotification) error { return nil } +func (agentNoExtensions) Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error) { + return LogoutResponse{}, nil +} + func (agentNoExtensions) CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error) { return CloseSessionResponse{}, nil } diff --git a/agent_gen.go b/agent_gen.go index 0c77020..a273b73 100644 --- a/agent_gen.go +++ b/agent_gen.go @@ -126,20 +126,14 @@ func (a *AgentSideConnection) handle(ctx context.Context, method string, params } return resp, nil case AgentMethodLogout: - var p UnstableLogoutRequest + var p LogoutRequest 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 { - UnstableLogout(context.Context, UnstableLogoutRequest) (UnstableLogoutResponse, error) - }) - if !ok { - return nil, NewMethodNotFound(method) - } - resp, err := exp.UnstableLogout(ctx, p) + resp, err := a.agent.Logout(ctx, p) if err != nil { return nil, toReqErr(err) } @@ -238,7 +232,7 @@ func (a *AgentSideConnection) handle(ctx context.Context, method string, params } return resp, nil case AgentMethodProvidersDisable: - var p UnstableDisableProvidersRequest + var p UnstableDisableProviderRequest if err := json.Unmarshal(params, &p); err != nil { return nil, NewInvalidParams(map[string]any{"error": err.Error()}) } @@ -246,12 +240,12 @@ func (a *AgentSideConnection) handle(ctx context.Context, method string, params return nil, NewInvalidParams(map[string]any{"error": err.Error()}) } exp, ok := a.agent.(interface { - UnstableDisableProviders(context.Context, UnstableDisableProvidersRequest) (UnstableDisableProvidersResponse, error) + UnstableDisableProvider(context.Context, UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error) }) if !ok { return nil, NewMethodNotFound(method) } - resp, err := exp.UnstableDisableProviders(ctx, p) + resp, err := exp.UnstableDisableProvider(ctx, p) if err != nil { return nil, toReqErr(err) } @@ -276,7 +270,7 @@ func (a *AgentSideConnection) handle(ctx context.Context, method string, params } return resp, nil case AgentMethodProvidersSet: - var p UnstableSetProvidersRequest + var p UnstableSetProviderRequest if err := json.Unmarshal(params, &p); err != nil { return nil, NewInvalidParams(map[string]any{"error": err.Error()}) } @@ -284,12 +278,12 @@ func (a *AgentSideConnection) handle(ctx context.Context, method string, params return nil, NewInvalidParams(map[string]any{"error": err.Error()}) } exp, ok := a.agent.(interface { - UnstableSetProviders(context.Context, UnstableSetProvidersRequest) (UnstableSetProvidersResponse, error) + UnstableSetProvider(context.Context, UnstableSetProviderRequest) (UnstableSetProviderResponse, error) }) if !ok { return nil, NewMethodNotFound(method) } - resp, err := exp.UnstableSetProviders(ctx, p) + resp, err := exp.UnstableSetProvider(ctx, p) if err != nil { return nil, toReqErr(err) } @@ -325,6 +319,25 @@ func (a *AgentSideConnection) handle(ctx context.Context, method string, params return nil, toReqErr(err) } return resp, nil + case AgentMethodSessionDelete: + var p UnstableDeleteSessionRequest + 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) + if err != nil { + return nil, toReqErr(err) + } + return resp, nil case AgentMethodSessionFork: var p UnstableForkSessionRequest if err := json.Unmarshal(params, &p); err != nil { diff --git a/client_gen.go b/client_gen.go index 8b4e9d2..93603c6 100644 --- a/client_gen.go +++ b/client_gen.go @@ -227,8 +227,8 @@ func (c *ClientSideConnection) Initialize(ctx context.Context, params Initialize resp, err := SendRequest[InitializeResponse](c.conn, ctx, AgentMethodInitialize, params) return resp, err } -func (c *ClientSideConnection) UnstableLogout(ctx context.Context, params UnstableLogoutRequest) (UnstableLogoutResponse, error) { - resp, err := SendRequest[UnstableLogoutResponse](c.conn, ctx, AgentMethodLogout, params) +func (c *ClientSideConnection) Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error) { + resp, err := SendRequest[LogoutResponse](c.conn, ctx, AgentMethodLogout, params) return resp, err } func (c *ClientSideConnection) UnstableAcceptNes(ctx context.Context, params UnstableAcceptNesNotification) error { @@ -249,16 +249,16 @@ func (c *ClientSideConnection) UnstableSuggestNes(ctx context.Context, params Un resp, err := SendRequest[UnstableSuggestNesResponse](c.conn, ctx, AgentMethodNesSuggest, params) return resp, err } -func (c *ClientSideConnection) UnstableDisableProviders(ctx context.Context, params UnstableDisableProvidersRequest) (UnstableDisableProvidersResponse, error) { - resp, err := SendRequest[UnstableDisableProvidersResponse](c.conn, ctx, AgentMethodProvidersDisable, params) +func (c *ClientSideConnection) UnstableDisableProvider(ctx context.Context, params UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error) { + resp, err := SendRequest[UnstableDisableProviderResponse](c.conn, ctx, AgentMethodProvidersDisable, params) return resp, err } func (c *ClientSideConnection) UnstableListProviders(ctx context.Context, params UnstableListProvidersRequest) (UnstableListProvidersResponse, error) { resp, err := SendRequest[UnstableListProvidersResponse](c.conn, ctx, AgentMethodProvidersList, params) return resp, err } -func (c *ClientSideConnection) UnstableSetProviders(ctx context.Context, params UnstableSetProvidersRequest) (UnstableSetProvidersResponse, error) { - resp, err := SendRequest[UnstableSetProvidersResponse](c.conn, ctx, AgentMethodProvidersSet, params) +func (c *ClientSideConnection) UnstableSetProvider(ctx context.Context, params UnstableSetProviderRequest) (UnstableSetProviderResponse, error) { + resp, err := SendRequest[UnstableSetProviderResponse](c.conn, ctx, AgentMethodProvidersSet, params) return resp, err } func (c *ClientSideConnection) Cancel(ctx context.Context, params CancelNotification) error { @@ -268,6 +268,10 @@ 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) + return resp, err +} func (c *ClientSideConnection) UnstableForkSession(ctx context.Context, params UnstableForkSessionRequest) (UnstableForkSessionResponse, error) { resp, err := SendRequest[UnstableForkSessionResponse](c.conn, ctx, AgentMethodSessionFork, params) return resp, err diff --git a/constants_gen.go b/constants_gen.go index 20fe6ff..b542e65 100644 --- a/constants_gen.go +++ b/constants_gen.go @@ -26,6 +26,7 @@ const ( AgentMethodProvidersSet = "providers/set" AgentMethodSessionCancel = "session/cancel" AgentMethodSessionClose = "session/close" + AgentMethodSessionDelete = "session/delete" AgentMethodSessionFork = "session/fork" AgentMethodSessionList = "session/list" AgentMethodSessionLoad = "session/load" diff --git a/example/agent/main.go b/example/agent/main.go index 3092d5f..bf6bd6b 100644 --- a/example/agent/main.go +++ b/example/agent/main.go @@ -91,9 +91,9 @@ func (a *exampleAgent) UnstableDidSaveDocument(ctx context.Context, params acp.U return nil } -// UnstableLogout implements acp.AgentExperimental. -func (a *exampleAgent) UnstableLogout(ctx context.Context, params acp.UnstableLogoutRequest) (acp.UnstableLogoutResponse, error) { - return acp.UnstableLogoutResponse{}, acp.NewMethodNotFound(acp.AgentMethodLogout) +// Logout implements acp.Agent. +func (a *exampleAgent) Logout(ctx context.Context, params acp.LogoutRequest) (acp.LogoutResponse, error) { + return acp.LogoutResponse{}, acp.NewMethodNotFound(acp.AgentMethodLogout) } // UnstableAcceptNes implements acp.AgentExperimental. @@ -121,9 +121,9 @@ func (a *exampleAgent) UnstableSuggestNes(ctx context.Context, params acp.Unstab return acp.UnstableSuggestNesResponse{}, acp.NewMethodNotFound(acp.AgentMethodNesSuggest) } -// UnstableDisableProviders implements acp.AgentExperimental. -func (a *exampleAgent) UnstableDisableProviders(ctx context.Context, params acp.UnstableDisableProvidersRequest) (acp.UnstableDisableProvidersResponse, error) { - return acp.UnstableDisableProvidersResponse{}, acp.NewMethodNotFound(acp.AgentMethodProvidersDisable) +// UnstableDisableProvider implements acp.AgentExperimental. +func (a *exampleAgent) UnstableDisableProvider(ctx context.Context, params acp.UnstableDisableProviderRequest) (acp.UnstableDisableProviderResponse, error) { + return acp.UnstableDisableProviderResponse{}, acp.NewMethodNotFound(acp.AgentMethodProvidersDisable) } // UnstableListProviders implements acp.AgentExperimental. @@ -131,9 +131,14 @@ func (a *exampleAgent) UnstableListProviders(ctx context.Context, params acp.Uns return acp.UnstableListProvidersResponse{}, acp.NewMethodNotFound(acp.AgentMethodProvidersList) } -// UnstableSetProviders implements acp.AgentExperimental. -func (a *exampleAgent) UnstableSetProviders(ctx context.Context, params acp.UnstableSetProvidersRequest) (acp.UnstableSetProvidersResponse, error) { - return acp.UnstableSetProvidersResponse{}, acp.NewMethodNotFound(acp.AgentMethodProvidersSet) +// UnstableSetProvider implements acp.AgentExperimental. +func (a *exampleAgent) UnstableSetProvider(ctx context.Context, params acp.UnstableSetProviderRequest) (acp.UnstableSetProviderResponse, error) { + 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) } // CloseSession implements acp.Agent. diff --git a/example_agent_test.go b/example_agent_test.go index 58c2baa..4b446ce 100644 --- a/example_agent_test.go +++ b/example_agent_test.go @@ -37,6 +37,11 @@ func (a *agentExample) SetSessionConfigOption(ctx context.Context, params SetSes return SetSessionConfigOptionResponse{}, nil } +// Logout implements Agent. +func (a *agentExample) Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error) { + return LogoutResponse{}, nil +} + func (a *agentExample) SetAgentConnection(c *AgentSideConnection) { a.conn = c } func (agentExample) Authenticate(ctx context.Context, _ AuthenticateRequest) (AuthenticateResponse, error) { diff --git a/helpers_gen.go b/helpers_gen.go index 64cccc1..d35398b 100644 --- a/helpers_gen.go +++ b/helpers_gen.go @@ -2,6 +2,33 @@ package acp +// NewPlanUpdateContentItems constructs a PlanUpdateContent using the 'items' variant. +func NewPlanUpdateContentItems(id PlanId, entries []PlanEntry) PlanUpdateContent { + return PlanUpdateContent{Items: &PlanUpdateContentItems{ + Entries: entries, + Id: id, + Type: "items", + }} +} + +// NewPlanUpdateContentFile constructs a PlanUpdateContent using the 'file' variant. +func NewPlanUpdateContentFile(id PlanId, uri string) PlanUpdateContent { + return PlanUpdateContent{File: &PlanUpdateContentFile{ + Id: id, + Type: "file", + Uri: uri, + }} +} + +// NewPlanUpdateContentMarkdown constructs a PlanUpdateContent using the 'markdown' variant. +func NewPlanUpdateContentMarkdown(id PlanId, content string) PlanUpdateContent { + return PlanUpdateContent{Markdown: &PlanUpdateContentMarkdown{ + Content: content, + Id: id, + Type: "markdown", + }} +} + // NewRequestPermissionOutcomeCancelled constructs a RequestPermissionOutcome using the 'cancelled' variant. func NewRequestPermissionOutcomeCancelled() RequestPermissionOutcome { return RequestPermissionOutcome{Cancelled: &RequestPermissionOutcomeCancelled{Outcome: "cancelled"}} diff --git a/schema/meta.json b/schema/meta.json index 8dc36e9..bc5135b 100644 --- a/schema/meta.json +++ b/schema/meta.json @@ -2,6 +2,7 @@ "agentMethods": { "authenticate": "authenticate", "initialize": "initialize", + "logout": "logout", "session_cancel": "session/cancel", "session_close": "session/close", "session_list": "session/list", diff --git a/schema/meta.unstable.json b/schema/meta.unstable.json index ba84548..5775e36 100644 --- a/schema/meta.unstable.json +++ b/schema/meta.unstable.json @@ -19,6 +19,7 @@ "providers_set": "providers/set", "session_cancel": "session/cancel", "session_close": "session/close", + "session_delete": "session/delete", "session_fork": "session/fork", "session_list": "session/list", "session_load": "session/load", diff --git a/schema/schema.json b/schema/schema.json index d6c327e..559f3f4 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1,5 +1,27 @@ { "$defs": { + "AgentAuthCapabilities": { + "description": "Authentication-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": "Authentication-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": [ { @@ -642,6 +681,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": "Logs 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": [ { @@ -1451,6 +1499,7 @@ } ], "default": { + "auth": {}, "loadSession": false, "mcpCapabilities": { "http": false, @@ -1647,6 +1696,43 @@ "x-method": "session/load", "x-side": "agent" }, + "LogoutCapabilities": { + "description": "Logout 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": "Request 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": "Response 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/schema/schema.unstable.json b/schema/schema.unstable.json index 3e326cc..de2fa91 100644 --- a/schema/schema.unstable.json +++ b/schema/schema.unstable.json @@ -27,7 +27,7 @@ "x-side": "agent" }, "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.", + "description": "Authentication-related capabilities supported by the agent.", "properties": { "_meta": { "additionalProperties": true, @@ -63,7 +63,7 @@ } ], "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." + "description": "Authentication-related capabilities supported by the agent." }, "loadSession": { "default": false, @@ -376,18 +376,18 @@ { "allOf": [ { - "$ref": "#/$defs/SetProvidersResponse" + "$ref": "#/$defs/SetProviderResponse" } ], - "title": "SetProvidersResponse" + "title": "SetProviderResponse" }, { "allOf": [ { - "$ref": "#/$defs/DisableProvidersResponse" + "$ref": "#/$defs/DisableProviderResponse" } ], - "title": "DisableProvidersResponse" + "title": "DisableProviderResponse" }, { "allOf": [ @@ -421,6 +421,14 @@ ], "title": "ListSessionsResponse" }, + { + "allOf": [ + { + "$ref": "#/$defs/DeleteSessionResponse" + } + ], + "title": "DeleteSessionResponse" + }, { "allOf": [ { @@ -1013,6 +1021,17 @@ ], "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." }, + "planCapabilities": { + "anyOf": [ + { + "$ref": "#/$defs/PlanCapabilities" + }, + { + "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 client supports `plan_update` and `plan_removed` session updates.\n\nOptional. Omitted means the client does not advertise support.\nSupplying `{}` means the client can receive both update types." + }, "positionEncodings": { "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nThe position encodings supported by the client, in order of preference.", "items": { @@ -1226,20 +1245,20 @@ { "allOf": [ { - "$ref": "#/$defs/SetProvidersRequest" + "$ref": "#/$defs/SetProviderRequest" } ], "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nReplaces the configuration for a provider.", - "title": "SetProvidersRequest" + "title": "SetProviderRequest" }, { "allOf": [ { - "$ref": "#/$defs/DisableProvidersRequest" + "$ref": "#/$defs/DisableProviderRequest" } ], "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nDisables a provider.", - "title": "DisableProvidersRequest" + "title": "DisableProviderRequest" }, { "allOf": [ @@ -1247,7 +1266,7 @@ "$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.", + "description": "Logs 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" }, { @@ -1277,6 +1296,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": "**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.", + "title": "DeleteSessionRequest" + }, { "allOf": [ { @@ -2037,6 +2065,41 @@ "required": ["currentModeId"], "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.", + "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": "**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.", + "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" + }, "DidChangeDocumentNotification": { "description": "Notification sent when a file is edited.", "properties": { @@ -2237,7 +2300,7 @@ "required": ["path", "newText"], "type": "object" }, - "DisableProvidersRequest": { + "DisableProviderRequest": { "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 `providers/disable`.", "properties": { "_meta": { @@ -2255,7 +2318,7 @@ "x-method": "providers/disable", "x-side": "agent" }, - "DisableProvidersResponse": { + "DisableProviderResponse": { "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `providers/disable`.", "properties": { "_meta": { @@ -3264,13 +3327,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"] }, - "additionalDirectories": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nFilter sessions by the exact ordered additional workspace roots. Each path must be absolute.\n\nThis filter applies only when the field is present and non-empty. When\nomitted or empty, no additional-root filter is applied.", - "items": { - "type": "string" - }, - "type": "array" - }, "cursor": { "description": "Opaque cursor token from a previous response's nextCursor field for cursor-based pagination", "type": ["string", "null"] @@ -3353,7 +3409,7 @@ "type": ["object", "null"] }, "additionalDirectories": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the loaded\nsession.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the loaded\nsession. It may differ from any previously used or reported list as long as\nthe request `cwd` matches the session's `cwd`.", "items": { "type": "string" }, @@ -3427,7 +3483,7 @@ "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.", + "description": "Logout capabilities supported by the agent.\n\nBy supplying `{}` it means that the agent supports the logout method.", "properties": { "_meta": { "additionalProperties": true, @@ -3438,7 +3494,7 @@ "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.", + "description": "Request parameters for the logout method.\n\nTerminates the current authenticated session.", "properties": { "_meta": { "additionalProperties": true, @@ -3451,7 +3507,7 @@ "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.", + "description": "Response to the `logout` method.", "properties": { "_meta": { "additionalProperties": true, @@ -4916,6 +4972,17 @@ "required": ["entries"], "type": "object" }, + "PlanCapabilities": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for receiving `plan_update` and `plan_removed` session updates.", + "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" + }, "PlanEntry": { "description": "A single entry in the execution plan.\n\nRepresents a task or goal that the assistant intends to accomplish\nas part of fulfilling the user's request.\nSee protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)", "properties": { @@ -4988,6 +5055,181 @@ } ] }, + "PlanFile": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented by a file URI.", + "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"] + }, + "id": { + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ], + "description": "The plan ID to update." + }, + "uri": { + "description": "The URI of the file containing the plan.", + "type": "string" + } + }, + "required": ["id", "uri"], + "type": "object" + }, + "PlanId": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUnique identifier for a plan within a session.", + "type": "string" + }, + "PlanItems": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented as structured entries.", + "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"] + }, + "entries": { + "description": "The list of tasks to be accomplished.\n\nWhen updating an item-based plan, the agent must send a complete list of all entries\nwith their current status. The client replaces that plan with each update.", + "items": { + "$ref": "#/$defs/PlanEntry" + }, + "type": "array" + }, + "id": { + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ], + "description": "The plan ID to update." + } + }, + "required": ["id", "entries"], + "type": "object" + }, + "PlanMarkdown": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA plan represented as raw markdown content.", + "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"] + }, + "content": { + "description": "Markdown content for the plan.", + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ], + "description": "The plan ID to update." + } + }, + "required": ["id", "content"], + "type": "object" + }, + "PlanRemoved": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRemoval notice for a plan identified by ID.", + "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"] + }, + "id": { + "allOf": [ + { + "$ref": "#/$defs/PlanId" + } + ], + "description": "The plan ID to remove." + } + }, + "required": ["id"], + "type": "object" + }, + "PlanUpdate": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA content update for a plan identified by ID.", + "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"] + }, + "plan": { + "allOf": [ + { + "$ref": "#/$defs/PlanUpdateContent" + } + ], + "description": "The updated plan content." + } + }, + "required": ["plan"], + "type": "object" + }, + "PlanUpdateContent": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUpdated content for a plan.", + "discriminator": { + "propertyName": "type" + }, + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/PlanItems" + } + ], + "description": "Structured plan entries.", + "properties": { + "type": { + "const": "items", + "type": "string" + } + }, + "required": ["type"], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/PlanFile" + } + ], + "description": "A URI pointing to a file containing the plan.", + "properties": { + "type": { + "const": "file", + "type": "string" + } + }, + "required": ["type"], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/PlanMarkdown" + } + ], + "description": "Raw markdown content for the plan.", + "properties": { + "type": { + "const": "markdown", + "type": "string" + } + }, + "required": ["type"], + "type": "object" + } + ] + }, "Position": { "description": "A zero-based position in a text document.\n\nThe meaning of `character` depends on the negotiated position encoding.", "properties": { @@ -5514,7 +5756,7 @@ "type": ["object", "null"] }, "additionalDirectories": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the resumed\nsession.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional workspace roots to activate for this session. Each path must be absolute.\n\nWhen omitted or empty, no additional roots are activated. When non-empty,\nthis is the complete resulting additional-root list for the resumed\nsession. It may differ from any previously used or reported list as long as\nthe request `cwd` matches the session's `cwd`.", "items": { "type": "string" }, @@ -5613,7 +5855,7 @@ "type": "object" }, "SessionAdditionalDirectoriesCapabilities": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for additional session directories support.\n\nBy supplying `{}` it means that the agent supports the `additionalDirectories` field on\nsupported session lifecycle requests and `session/list`.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCapabilities for additional session directories support.\n\nBy supplying `{}` it means that the agent supports the `additionalDirectories`\nfield on supported session lifecycle requests. Agents that also support\n`session/list` may return `SessionInfo.additionalDirectories` to report the\ncomplete ordered additional-root list associated with a listed session.", "properties": { "_meta": { "additionalProperties": true, @@ -5640,7 +5882,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 `additionalDirectories` on supported session lifecycle requests and `session/list`." + "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 `additionalDirectories` on supported session lifecycle requests.\n\nAgents that also support `session/list` may return\n`SessionInfo.additionalDirectories` to report the complete ordered\nadditional-root list associated with a listed session." }, "close": { "anyOf": [ @@ -5653,6 +5895,17 @@ ], "description": "Whether the agent supports `session/close`." }, + "delete": { + "anyOf": [ + { + "$ref": "#/$defs/SessionDeleteCapabilities" + }, + { + "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`." + }, "fork": { "anyOf": [ { @@ -5927,6 +6180,17 @@ "description": "Unique identifier for a session configuration option value.", "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`.", + "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" + }, "SessionForkCapabilities": { "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/fork` method.\n\nBy supplying `{}` it means that the agent supports forking of sessions.", "properties": { @@ -5951,7 +6215,7 @@ "type": ["object", "null"] }, "additionalDirectories": { - "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthoritative ordered additional workspace roots for this session. Each path must be absolute.\n\nWhen omitted or empty, there are no additional roots for the session.", + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAdditional workspace roots reported for this session. Each path must be absolute.\n\nWhen present, this is the complete ordered additional-root list reported\nby the Agent. Omitted and empty values are equivalent: the response\nreports no additional roots.", "items": { "type": "string" }, @@ -6233,6 +6497,38 @@ "required": ["sessionUpdate"], "type": "object" }, + { + "allOf": [ + { + "$ref": "#/$defs/PlanUpdate" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nA content update for a plan identified by ID.", + "properties": { + "sessionUpdate": { + "const": "plan_update", + "type": "string" + } + }, + "required": ["sessionUpdate"], + "type": "object" + }, + { + "allOf": [ + { + "$ref": "#/$defs/PlanRemoved" + } + ], + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRemoval notice for a plan identified by ID.", + "properties": { + "sessionUpdate": { + "const": "plan_removed", + "type": "string" + } + }, + "required": ["sessionUpdate"], + "type": "object" + }, { "allOf": [ { @@ -6315,7 +6611,7 @@ } ] }, - "SetProvidersRequest": { + "SetProviderRequest": { "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 `providers/set`.\n\nReplaces the full configuration for one provider id.", "properties": { "_meta": { @@ -6352,7 +6648,7 @@ "x-method": "providers/set", "x-side": "agent" }, - "SetProvidersResponse": { + "SetProviderResponse": { "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to `providers/set`.", "properties": { "_meta": { diff --git a/schema/version b/schema/version index 54d1a4f..dffa40e 100644 --- a/schema/version +++ b/schema/version @@ -1 +1 @@ -0.13.0 +0.13.4 diff --git a/types_gen.go b/types_gen.go index 97e149e..edd4944 100644 --- a/types_gen.go +++ b/types_gen.go @@ -9,10 +9,6 @@ import ( "fmt" ) -// **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 AgentAuthCapabilities struct { // The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -40,10 +36,6 @@ type AgentCapabilities 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. - // // Authentication-related capabilities supported by the agent. // // Defaults to {} if unset. @@ -902,6 +894,15 @@ type ClientCapabilities struct { // // This capability is not part of the spec yet, and may be removed or changed at any point. // + // Whether the client supports 'plan_update' and 'plan_removed' session updates. + // + // Optional. Omitted means the client does not advertise support. + // Supplying '{}' means the client can receive both update types. + PlanCapabilities *PlanCapabilities `json:"planCapabilities,omitempty"` + // **UNSTABLE** + // + // This capability is not part of the spec yet, and may be removed or changed at any point. + // // The position encodings supported by the client, in order of preference. PositionEncodings []PositionEncodingKind `json:"positionEncodings,omitempty"` // Whether the Client support all 'terminal/*' methods. @@ -2429,15 +2430,6 @@ type ListSessionsRequest 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. - // - // Filter sessions by the exact ordered additional workspace roots. Each path must be absolute. - // - // This filter applies only when the field is present and non-empty. When - // omitted or empty, no additional-root filter is applied. - AdditionalDirectories []string `json:"additionalDirectories,omitempty"` // Opaque cursor token from a previous response's nextCursor field for cursor-based pagination Cursor *string `json:"cursor,omitempty"` // Filter sessions by working directory. Must be an absolute path. @@ -2490,7 +2482,8 @@ type LoadSessionRequest struct { // // When omitted or empty, no additional roots are activated. When non-empty, // this is the complete resulting additional-root list for the loaded - // session. + // session. It may differ from any previously used or reported list as long as + // the request 'cwd' matches the session's 'cwd'. AdditionalDirectories []string `json:"additionalDirectories,omitempty"` // The working directory for this session. Cwd string `json:"cwd"` @@ -2536,10 +2529,6 @@ func (v *LoadSessionResponse) Validate() error { return nil } -// **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. @@ -2552,6 +2541,36 @@ type LogoutCapabilities struct { Meta map[string]any `json:"_meta,omitempty"` } +// Request parameters for the logout method. +// +// Terminates the current authenticated session. +type LogoutRequest 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 *LogoutRequest) Validate() error { + return nil +} + +// Response to the 'logout' method. +type LogoutResponse 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 *LogoutResponse) Validate() error { + return nil +} + // MCP capabilities supported by the agent type McpCapabilities struct { // The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -3368,6 +3387,20 @@ type Plan struct { Entries []PlanEntry `json:"entries"` } +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// Capabilities for receiving 'plan_update' and 'plan_removed' session updates. +type PlanCapabilities 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"` +} + // A single entry in the execution plan. // // Represents a task or goal that the assistant intends to accomplish @@ -3389,30 +3422,368 @@ type PlanEntry struct { Status PlanEntryStatus `json:"status"` } -// Priority levels for plan entries. -// -// Used to indicate the relative importance or urgency of different -// tasks in the execution plan. -// See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries) -type PlanEntryPriority string - -const ( - PlanEntryPriorityHigh PlanEntryPriority = "high" - PlanEntryPriorityMedium PlanEntryPriority = "medium" - PlanEntryPriorityLow PlanEntryPriority = "low" -) - -// Status of a plan entry in the execution flow. -// -// Tracks the lifecycle of each task from planning through completion. -// See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries) -type PlanEntryStatus string - -const ( - PlanEntryStatusPending PlanEntryStatus = "pending" - PlanEntryStatusInProgress PlanEntryStatus = "in_progress" - PlanEntryStatusCompleted PlanEntryStatus = "completed" -) +// Priority levels for plan entries. +// +// Used to indicate the relative importance or urgency of different +// tasks in the execution plan. +// See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries) +type PlanEntryPriority string + +const ( + PlanEntryPriorityHigh PlanEntryPriority = "high" + PlanEntryPriorityMedium PlanEntryPriority = "medium" + PlanEntryPriorityLow PlanEntryPriority = "low" +) + +// Status of a plan entry in the execution flow. +// +// Tracks the lifecycle of each task from planning through completion. +// See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries) +type PlanEntryStatus string + +const ( + PlanEntryStatusPending PlanEntryStatus = "pending" + PlanEntryStatusInProgress PlanEntryStatus = "in_progress" + PlanEntryStatusCompleted PlanEntryStatus = "completed" +) + +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// A plan represented by a file URI. +type PlanFile 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 plan ID to update. + Id PlanId `json:"id"` + // The URI of the file containing the plan. + Uri string `json:"uri"` +} + +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// Unique identifier for a plan within a session. +type PlanId string + +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// A plan represented as structured entries. +type PlanItems 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 list of tasks to be accomplished. + // + // When updating an item-based plan, the agent must send a complete list of all entries + // with their current status. The client replaces that plan with each update. + Entries []PlanEntry `json:"entries"` + // The plan ID to update. + Id PlanId `json:"id"` +} + +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// A plan represented as raw markdown content. +type PlanMarkdown 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"` + // Markdown content for the plan. + Content string `json:"content"` + // The plan ID to update. + Id PlanId `json:"id"` +} + +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// Removal notice for a plan identified by ID. +type PlanRemoved 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 plan ID to remove. + Id PlanId `json:"id"` +} + +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// A content update for a plan identified by ID. +type PlanUpdate 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 updated plan content. + Plan PlanUpdateContent `json:"plan"` +} + +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// Updated content for a plan. +// Structured plan entries. +type PlanUpdateContentItems 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 list of tasks to be accomplished. + // + // When updating an item-based plan, the agent must send a complete list of all entries + // with their current status. The client replaces that plan with each update. + Entries []PlanEntry `json:"entries"` + // The plan ID to update. + Id PlanId `json:"id"` + Type string `json:"type"` +} + +// A URI pointing to a file containing the plan. +type PlanUpdateContentFile 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 plan ID to update. + Id PlanId `json:"id"` + Type string `json:"type"` + // The URI of the file containing the plan. + Uri string `json:"uri"` +} + +// Raw markdown content for the plan. +type PlanUpdateContentMarkdown 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"` + // Markdown content for the plan. + Content string `json:"content"` + // The plan ID to update. + Id PlanId `json:"id"` + Type string `json:"type"` +} + +type PlanUpdateContent struct { + // Structured plan entries. + Items *PlanUpdateContentItems `json:"-"` + // A URI pointing to a file containing the plan. + File *PlanUpdateContentFile `json:"-"` + // Raw markdown content for the plan. + Markdown *PlanUpdateContentMarkdown `json:"-"` +} + +func (u *PlanUpdateContent) UnmarshalJSON(b []byte) error { + var m map[string]json.RawMessage + if err := json.Unmarshal(b, &m); err == nil { + { + var disc string + if v, ok := m["type"]; ok { + json.Unmarshal(v, &disc) + } + switch disc { + case "items": + var v PlanUpdateContentItems + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.Items = &v + return nil + case "file": + var v PlanUpdateContentFile + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.File = &v + return nil + case "markdown": + var v PlanUpdateContentMarkdown + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.Markdown = &v + return nil + } + } + { + var v PlanUpdateContentItems + var match bool = true + if _, ok := m["type"]; !ok { + match = false + } + if _, ok := m["id"]; !ok { + match = false + } + if _, ok := m["entries"]; !ok { + match = false + } + if match { + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.Items = &v + return nil + } + } + { + var v PlanUpdateContentFile + var match bool = true + if _, ok := m["type"]; !ok { + match = false + } + if _, ok := m["id"]; !ok { + match = false + } + if _, ok := m["uri"]; !ok { + match = false + } + if match { + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.File = &v + return nil + } + } + { + var v PlanUpdateContentMarkdown + var match bool = true + if _, ok := m["type"]; !ok { + match = false + } + if _, ok := m["id"]; !ok { + match = false + } + if _, ok := m["content"]; !ok { + match = false + } + if match { + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.Markdown = &v + return nil + } + } + } else { + if _, ok := err.(*json.UnmarshalTypeError); !ok { + return err + } + } + var arr []map[string]json.RawMessage + if json.Unmarshal(b, &arr) == nil { + } + { + var v PlanUpdateContentItems + if json.Unmarshal(b, &v) == nil { + u.Items = &v + return nil + } + } + { + var v PlanUpdateContentFile + if json.Unmarshal(b, &v) == nil { + u.File = &v + return nil + } + } + { + var v PlanUpdateContentMarkdown + if json.Unmarshal(b, &v) == nil { + u.Markdown = &v + return nil + } + } + return errors.New("no matching variant for union") +} +func (u PlanUpdateContent) MarshalJSON() ([]byte, error) { + if u.Items != nil { + _b, _e := json.Marshal(*u.Items) + if _e != nil { + return []byte{}, _e + } + var m map[string]any + if json.Unmarshal(_b, &m) != nil { + return []byte{}, errors.New("invalid variant payload") + } + m["type"] = "items" + return json.Marshal(m) + } + if u.File != nil { + _b, _e := json.Marshal(*u.File) + if _e != nil { + return []byte{}, _e + } + var m map[string]any + if json.Unmarshal(_b, &m) != nil { + return []byte{}, errors.New("invalid variant payload") + } + m["type"] = "file" + return json.Marshal(m) + } + if u.Markdown != nil { + _b, _e := json.Marshal(*u.Markdown) + if _e != nil { + return []byte{}, _e + } + var m map[string]any + if json.Unmarshal(_b, &m) != nil { + return []byte{}, errors.New("invalid variant payload") + } + m["type"] = "markdown" + return json.Marshal(m) + } + return []byte{}, nil +} + +func (u *PlanUpdateContent) Validate() error { + var count int + if u.Items != nil { + count++ + } + if u.File != nil { + count++ + } + if u.Markdown != nil { + count++ + } + if count != 1 { + return errors.New("PlanUpdateContent must have exactly one variant set") + } + return nil +} // The encoding used for character offsets in positions. // @@ -4015,7 +4386,8 @@ type ResumeSessionRequest struct { // // When omitted or empty, no additional roots are activated. When non-empty, // this is the complete resulting additional-root list for the resumed - // session. + // session. It may differ from any previously used or reported list as long as + // the request 'cwd' matches the session's 'cwd'. AdditionalDirectories []string `json:"additionalDirectories,omitempty"` // The working directory for this session. Cwd string `json:"cwd"` @@ -4084,8 +4456,10 @@ type SelectedPermissionOutcome struct { // // Capabilities for additional session directories support. // -// By supplying '{}' it means that the agent supports the 'additionalDirectories' field on -// supported session lifecycle requests and 'session/list'. +// By supplying '{}' it means that the agent supports the 'additionalDirectories' +// field on supported session lifecycle requests. Agents that also support +// 'session/list' may return 'SessionInfo.additionalDirectories' to report the +// complete ordered additional-root list associated with a listed session. type SessionAdditionalDirectoriesCapabilities 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 @@ -4115,7 +4489,11 @@ type SessionCapabilities struct { // // This capability is not part of the spec yet, and may be removed or changed at any point. // - // Whether the agent supports 'additionalDirectories' on supported session lifecycle requests and 'session/list'. + // Whether the agent supports 'additionalDirectories' on supported session lifecycle requests. + // + // Agents that also support 'session/list' may return + // 'SessionInfo.additionalDirectories' to report the complete ordered + // additional-root list associated with a listed session. AdditionalDirectories *SessionAdditionalDirectoriesCapabilities `json:"additionalDirectories,omitempty"` // Whether the agent supports 'session/close'. Close *SessionCloseCapabilities `json:"close,omitempty"` @@ -4123,6 +4501,15 @@ type SessionCapabilities struct { // // 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. + // Supplying '{}' means the agent supports deleting sessions from 'session/list'. + Delete *SessionDeleteCapabilities `json:"delete,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/fork'. Fork *SessionForkCapabilities `json:"fork,omitempty"` // Whether the agent supports 'session/list'. @@ -4517,6 +4904,22 @@ 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'. +type SessionDeleteCapabilities 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"` +} + // **UNSTABLE** // // This capability is not part of the spec yet, and may be removed or changed at any point. @@ -4553,9 +4956,11 @@ type SessionInfo struct { // // This capability is not part of the spec yet, and may be removed or changed at any point. // - // Authoritative ordered additional workspace roots for this session. Each path must be absolute. + // Additional workspace roots reported for this session. Each path must be absolute. // - // When omitted or empty, there are no additional roots for the session. + // When present, this is the complete ordered additional-root list reported + // by the Agent. Omitted and empty values are equivalent: the response + // reports no additional roots. AdditionalDirectories []string `json:"additionalDirectories,omitempty"` // The working directory for this session. Must be an absolute path. Cwd string `json:"cwd"` @@ -4827,6 +5232,40 @@ type SessionUpdatePlan struct { SessionUpdate string `json:"sessionUpdate"` } +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// A content update for a plan identified by ID. +type SessionPlanUpdate 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 updated plan content. + Plan PlanUpdateContent `json:"plan"` + SessionUpdate string `json:"sessionUpdate"` +} + +// **UNSTABLE** +// +// This capability is not part of the spec yet, and may be removed or changed at any point. +// +// Removal notice for a plan identified by ID. +type SessionUpdatePlanRemoved 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 plan ID to remove. + Id PlanId `json:"id"` + SessionUpdate string `json:"sessionUpdate"` +} + // Available commands are ready or have changed type SessionAvailableCommandsUpdate struct { // The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -4918,6 +5357,18 @@ type SessionUpdate struct { // The agent's execution plan for complex tasks. // See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan) Plan *SessionUpdatePlan `json:"-"` + // **UNSTABLE** + // + // This capability is not part of the spec yet, and may be removed or changed at any point. + // + // A content update for a plan identified by ID. + PlanUpdate *SessionPlanUpdate `json:"-"` + // **UNSTABLE** + // + // This capability is not part of the spec yet, and may be removed or changed at any point. + // + // Removal notice for a plan identified by ID. + PlanRemoved *SessionUpdatePlanRemoved `json:"-"` // Available commands are ready or have changed AvailableCommandsUpdate *SessionAvailableCommandsUpdate `json:"-"` // The current mode of the session has changed @@ -4987,6 +5438,20 @@ func (u *SessionUpdate) UnmarshalJSON(b []byte) error { } u.Plan = &v return nil + case "plan_update": + var v SessionPlanUpdate + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.PlanUpdate = &v + return nil + case "plan_removed": + var v SessionUpdatePlanRemoved + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.PlanRemoved = &v + return nil case "available_commands_update": var v SessionAvailableCommandsUpdate if json.Unmarshal(b, &v) != nil { @@ -5129,6 +5594,40 @@ func (u *SessionUpdate) UnmarshalJSON(b []byte) error { return nil } } + { + var v SessionPlanUpdate + var match bool = true + if _, ok := m["sessionUpdate"]; !ok { + match = false + } + if _, ok := m["plan"]; !ok { + match = false + } + if match { + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.PlanUpdate = &v + return nil + } + } + { + var v SessionUpdatePlanRemoved + var match bool = true + if _, ok := m["sessionUpdate"]; !ok { + match = false + } + if _, ok := m["id"]; !ok { + match = false + } + if match { + if json.Unmarshal(b, &v) != nil { + return errors.New("invalid variant payload") + } + u.PlanRemoved = &v + return nil + } + } { var v SessionAvailableCommandsUpdate var match bool = true @@ -5264,6 +5763,20 @@ func (u *SessionUpdate) UnmarshalJSON(b []byte) error { return nil } } + { + var v SessionPlanUpdate + if json.Unmarshal(b, &v) == nil { + u.PlanUpdate = &v + return nil + } + } + { + var v SessionUpdatePlanRemoved + if json.Unmarshal(b, &v) == nil { + u.PlanRemoved = &v + return nil + } + } { var v SessionAvailableCommandsUpdate if json.Unmarshal(b, &v) == nil { @@ -5374,6 +5887,30 @@ func (u SessionUpdate) MarshalJSON() ([]byte, error) { m["sessionUpdate"] = "plan" return json.Marshal(m) } + if u.PlanUpdate != nil { + _b, _e := json.Marshal(*u.PlanUpdate) + if _e != nil { + return []byte{}, _e + } + var m map[string]any + if json.Unmarshal(_b, &m) != nil { + return []byte{}, errors.New("invalid variant payload") + } + m["sessionUpdate"] = "plan_update" + return json.Marshal(m) + } + if u.PlanRemoved != nil { + _b, _e := json.Marshal(*u.PlanRemoved) + if _e != nil { + return []byte{}, _e + } + var m map[string]any + if json.Unmarshal(_b, &m) != nil { + return []byte{}, errors.New("invalid variant payload") + } + m["sessionUpdate"] = "plan_removed" + return json.Marshal(m) + } if u.AvailableCommandsUpdate != nil { _b, _e := json.Marshal(*u.AvailableCommandsUpdate) if _e != nil { @@ -5457,6 +5994,12 @@ func (u *SessionUpdate) Validate() error { if u.Plan != nil { count++ } + if u.PlanUpdate != nil { + count++ + } + if u.PlanRemoved != nil { + count++ + } if u.AvailableCommandsUpdate != nil { count++ } @@ -6691,6 +7234,46 @@ 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 @@ -6826,7 +7409,7 @@ func (v *UnstableDidSaveDocumentNotification) Validate() error { // This capability is not part of the spec yet, and may be removed or changed at any point. // // Request parameters for 'providers/disable'. -type UnstableDisableProvidersRequest struct { +type UnstableDisableProviderRequest 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. @@ -6837,7 +7420,7 @@ type UnstableDisableProvidersRequest struct { Id string `json:"id"` } -func (v *UnstableDisableProvidersRequest) Validate() error { +func (v *UnstableDisableProviderRequest) Validate() error { if v.Id == "" { return fmt.Errorf("id is required") } @@ -6849,7 +7432,7 @@ func (v *UnstableDisableProvidersRequest) Validate() error { // This capability is not part of the spec yet, and may be removed or changed at any point. // // Response to 'providers/disable'. -type UnstableDisableProvidersResponse struct { +type UnstableDisableProviderResponse 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. @@ -6858,7 +7441,7 @@ type UnstableDisableProvidersResponse struct { Meta map[string]any `json:"_meta,omitempty"` } -func (v *UnstableDisableProvidersResponse) Validate() error { +func (v *UnstableDisableProviderResponse) Validate() error { return nil } @@ -7331,44 +7914,6 @@ const ( UnstableLlmProtocolBedrock UnstableLlmProtocol = "bedrock" ) -// **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 UnstableLogoutRequest 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 *UnstableLogoutRequest) Validate() error { - return nil -} - -// **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 UnstableLogoutResponse 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 *UnstableLogoutResponse) Validate() error { - return nil -} - // **UNSTABLE** // // This capability is not part of the spec yet, and may be removed or changed at any point. @@ -8612,7 +9157,7 @@ type UnstableSessionModelState struct { // Request parameters for 'providers/set'. // // Replaces the full configuration for one provider id. -type UnstableSetProvidersRequest struct { +type UnstableSetProviderRequest 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. @@ -8630,7 +9175,7 @@ type UnstableSetProvidersRequest struct { Id string `json:"id"` } -func (v *UnstableSetProvidersRequest) Validate() error { +func (v *UnstableSetProviderRequest) Validate() error { if v.BaseUrl == "" { return fmt.Errorf("baseUrl is required") } @@ -8645,7 +9190,7 @@ func (v *UnstableSetProvidersRequest) Validate() error { // This capability is not part of the spec yet, and may be removed or changed at any point. // // Response to 'providers/set'. -type UnstableSetProvidersResponse struct { +type UnstableSetProviderResponse 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. @@ -8654,7 +9199,7 @@ type UnstableSetProvidersResponse struct { Meta map[string]any `json:"_meta,omitempty"` } -func (v *UnstableSetProvidersResponse) Validate() error { +func (v *UnstableSetProviderResponse) Validate() error { return nil } @@ -8947,6 +9492,10 @@ type Agent interface { // // See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization) Initialize(ctx context.Context, params InitializeRequest) (InitializeResponse, error) + // Request parameters for the logout method. + // + // Terminates the current authenticated session. + Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error) // Notification to cancel ongoing operations for a session. // // See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation) @@ -9008,14 +9557,6 @@ type AgentExperimental interface { UnstableDidOpenDocument(ctx context.Context, params UnstableDidOpenDocumentNotification) error // Notification sent when a file is saved. UnstableDidSaveDocument(ctx context.Context, params UnstableDidSaveDocumentNotification) error - // **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. - UnstableLogout(ctx context.Context, params UnstableLogoutRequest) (UnstableLogoutResponse, error) // Notification sent when a suggestion is accepted. UnstableAcceptNes(ctx context.Context, params UnstableAcceptNesNotification) error // Request to close an NES session. @@ -9034,7 +9575,7 @@ type AgentExperimental interface { // This capability is not part of the spec yet, and may be removed or changed at any point. // // Request parameters for 'providers/disable'. - UnstableDisableProviders(ctx context.Context, params UnstableDisableProvidersRequest) (UnstableDisableProvidersResponse, error) + UnstableDisableProvider(ctx context.Context, params UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error) // **UNSTABLE** // // This capability is not part of the spec yet, and may be removed or changed at any point. @@ -9048,7 +9589,15 @@ type AgentExperimental interface { // Request parameters for 'providers/set'. // // Replaces the full configuration for one provider id. - UnstableSetProviders(ctx context.Context, params UnstableSetProvidersRequest) (UnstableSetProvidersResponse, error) + UnstableSetProvider(ctx context.Context, params UnstableSetProviderRequest) (UnstableSetProviderResponse, error) + // **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. + 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. diff --git a/version b/version index 54d1a4f..dffa40e 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.13.0 +0.13.4