diff --git a/schema/schema.json b/schema/schema.json index ae15000a..de2fa91c 100644 --- a/schema/schema.json +++ b/schema/schema.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": [ @@ -1021,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": { @@ -1234,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": [ @@ -1255,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" }, { @@ -2289,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": { @@ -2307,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": { @@ -3472,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, @@ -3483,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, @@ -3496,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, @@ -4961,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": { @@ -5033,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": { @@ -5658,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`\nfield on supported session lifecycle requests. Agents that also support\n`session/list` may return `SessionInfo.additionalDirectories` when they track\nthat state.", + "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, @@ -5685,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.\n\nAgents that also support `session/list` may return\n`SessionInfo.additionalDirectories` when they track that state." + "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": [ @@ -6018,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\nAdditional workspace roots for this session, if the Agent reports them. Each path must be absolute.\n\nAgents may omit this field when they do not track or surface additional-root\nstate. When present, this is the complete additional-root list known to\nthe Agent 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" }, @@ -6300,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": [ { @@ -6382,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": { @@ -6419,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/scripts/generate.js b/scripts/generate.js index 972e8253..647b762f 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -5,7 +5,7 @@ import * as fs from "fs/promises"; import { dirname } from "path"; import * as prettier from "prettier"; -const CURRENT_SCHEMA_RELEASE = "v0.13.2"; +const CURRENT_SCHEMA_RELEASE = "v0.13.4"; await main(); diff --git a/src/acp.test.ts b/src/acp.test.ts index d5039d9d..cc0632a7 100644 --- a/src/acp.test.ts +++ b/src/acp.test.ts @@ -49,9 +49,9 @@ import { ListSessionsResponse, ResumeSessionRequest, ResumeSessionResponse, - SetProvidersRequest, - DisableProvidersRequest, - DisableProvidersResponse, + SetProviderRequest, + DisableProviderRequest, + DisableProviderResponse, CreateElicitationRequest, CreateElicitationResponse, CompleteElicitationNotification, @@ -1867,8 +1867,8 @@ describe("Connection", () => { }); it("handles providers request lifecycle", async () => { - let receivedSetRequest: SetProvidersRequest | undefined; - let receivedDisableRequest: DisableProvidersRequest | undefined; + let receivedSetRequest: SetProviderRequest | undefined; + let receivedDisableRequest: DisableProviderRequest | undefined; class TestClient implements Client { async writeTextFile( @@ -1935,13 +1935,13 @@ describe("Connection", () => { }; } - async unstable_setProvider(params: SetProvidersRequest): Promise { + async unstable_setProvider(params: SetProviderRequest): Promise { receivedSetRequest = params; } async unstable_disableProvider( - params: DisableProvidersRequest, - ): Promise { + params: DisableProviderRequest, + ): Promise { receivedDisableRequest = params; return {}; } diff --git a/src/acp.ts b/src/acp.ts index 9f361cd5..18550547 100644 --- a/src/acp.ts +++ b/src/acp.ts @@ -139,7 +139,7 @@ export class AgentSideConnection { if (!agent.unstable_setProvider) { throw RequestError.methodNotFound(method); } - const validatedParams = validate.zSetProvidersRequest.parse(params); + const validatedParams = validate.zSetProviderRequest.parse(params); const result = await agent.unstable_setProvider(validatedParams); return result ?? {}; } @@ -148,16 +148,16 @@ export class AgentSideConnection { throw RequestError.methodNotFound(method); } const validatedParams = - validate.zDisableProvidersRequest.parse(params); + validate.zDisableProviderRequest.parse(params); const result = await agent.unstable_disableProvider(validatedParams); return result ?? {}; } case schema.AGENT_METHODS.logout: { - if (!agent.unstable_logout) { + if (!agent.logout) { throw RequestError.methodNotFound(method); } const validatedParams = validate.zLogoutRequest.parse(params); - const result = await agent.unstable_logout(validatedParams); + const result = await agent.logout(validatedParams); return result ?? {}; } case schema.AGENT_METHODS.session_prompt: { @@ -1001,11 +1001,11 @@ export class ClientSideConnection implements Agent { * @experimental */ unstable_setProvider( - params: schema.SetProvidersRequest, - ): Promise { + params: schema.SetProviderRequest, + ): Promise { return this.connection.sendRequest< - schema.SetProvidersRequest, - schema.SetProvidersResponse + schema.SetProviderRequest, + schema.SetProviderResponse >(schema.AGENT_METHODS.providers_set, params, emptyObjectResponse); } @@ -1021,11 +1021,11 @@ export class ClientSideConnection implements Agent { * @experimental */ unstable_disableProvider( - params: schema.DisableProvidersRequest, - ): Promise { + params: schema.DisableProviderRequest, + ): Promise { return this.connection.sendRequest< - schema.DisableProvidersRequest, - schema.DisableProvidersResponse + schema.DisableProviderRequest, + schema.DisableProviderResponse >(schema.AGENT_METHODS.providers_disable, params, emptyObjectResponse); } @@ -1036,9 +1036,7 @@ export class ClientSideConnection implements Agent { * * @experimental */ - unstable_logout( - params: schema.LogoutRequest, - ): Promise { + logout(params: schema.LogoutRequest): Promise { return this.connection.sendRequest< schema.LogoutRequest, schema.LogoutResponse @@ -2144,8 +2142,8 @@ export interface Agent { * @experimental */ unstable_setProvider?( - params: schema.SetProvidersRequest, - ): Promise; + params: schema.SetProviderRequest, + ): Promise; /** * **UNSTABLE** * @@ -2158,8 +2156,8 @@ export interface Agent { * @experimental */ unstable_disableProvider?( - params: schema.DisableProvidersRequest, - ): Promise; + params: schema.DisableProviderRequest, + ): Promise; /** * Terminates the current authenticated session. * @@ -2168,9 +2166,7 @@ export interface Agent { * @experimental */ - unstable_logout?( - params: schema.LogoutRequest, - ): Promise; + logout?(params: schema.LogoutRequest): Promise; /** * Processes a user prompt within a session. * diff --git a/src/schema/index.ts b/src/schema/index.ts index 0393c9db..73f999c8 100644 --- a/src/schema/index.ts +++ b/src/schema/index.ts @@ -54,8 +54,8 @@ export type { DidOpenDocumentNotification, DidSaveDocumentNotification, Diff, - DisableProvidersRequest, - DisableProvidersResponse, + DisableProviderRequest, + DisableProviderResponse, DisconnectMcpRequest, DisconnectMcpResponse, ElicitationAcceptAction, @@ -160,9 +160,17 @@ export type { PermissionOptionId, PermissionOptionKind, Plan, + PlanCapabilities, PlanEntry, PlanEntryPriority, PlanEntryStatus, + PlanFile, + PlanId, + PlanItems, + PlanMarkdown, + PlanRemoved, + PlanUpdate, + PlanUpdateContent, Position, PositionEncodingKind, PromptCapabilities, @@ -213,8 +221,8 @@ export type { SessionNotification, SessionResumeCapabilities, SessionUpdate, - SetProvidersRequest, - SetProvidersResponse, + SetProviderRequest, + SetProviderResponse, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, SetSessionModelRequest, diff --git a/src/schema/types.gen.ts b/src/schema/types.gen.ts index 25ca35ec..1cb04b73 100644 --- a/src/schema/types.gen.ts +++ b/src/schema/types.gen.ts @@ -30,13 +30,7 @@ export type AcceptNesNotification = { }; /** - * **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. - * - * @experimental */ export type AgentAuthCapabilities = { /** @@ -77,13 +71,7 @@ export type AgentCapabilities = { [key: string]: unknown; } | null; /** - * **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. - * - * @experimental */ auth?: AgentAuthCapabilities; /** @@ -178,8 +166,8 @@ export type AgentResponse = | InitializeResponse | AuthenticateResponse | ListProvidersResponse - | SetProvidersResponse - | DisableProvidersResponse + | SetProviderResponse + | DisableProviderResponse | LogoutResponse | NewSessionResponse | LoadSessionResponse @@ -689,6 +677,19 @@ export type ClientCapabilities = { * @experimental */ nes?: ClientNesCapabilities | null; + /** + * **UNSTABLE** + * + * 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. + * + * @experimental + */ + planCapabilities?: PlanCapabilities | null; /** * **UNSTABLE** * @@ -756,8 +757,8 @@ export type ClientRequest = { | InitializeRequest | AuthenticateRequest | ListProvidersRequest - | SetProvidersRequest - | DisableProvidersRequest + | SetProviderRequest + | DisableProviderRequest | LogoutRequest | NewSessionRequest | LoadSessionRequest @@ -1496,7 +1497,7 @@ export type Diff = { * * @experimental */ -export type DisableProvidersRequest = { +export type DisableProviderRequest = { /** * 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 @@ -1522,7 +1523,7 @@ export type DisableProvidersRequest = { * * @experimental */ -export type DisableProvidersResponse = { +export type DisableProviderResponse = { /** * 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 @@ -2525,15 +2526,9 @@ export type LoadSessionResponse = { }; /** - * **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. - * - * @experimental */ export type LogoutCapabilities = { /** @@ -2549,15 +2544,9 @@ export type LogoutCapabilities = { }; /** - * **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. - * - * @experimental */ export type LogoutRequest = { /** @@ -2573,13 +2562,7 @@ export type LogoutRequest = { }; /** - * **UNSTABLE** - * - * This capability is not part of the spec yet, and may be removed or changed at any point. - * * Response to the `logout` method. - * - * @experimental */ export type LogoutResponse = { /** @@ -3841,6 +3824,28 @@ export type Plan = { entries: Array; }; +/** + * **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. + * + * @experimental + */ +export type PlanCapabilities = { + /** + * 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?: { + [key: string]: unknown; + } | null; +}; + /** * A single entry in the execution plan. * @@ -3891,6 +3896,182 @@ export type PlanEntryPriority = "high" | "medium" | "low"; */ export type PlanEntryStatus = "pending" | "in_progress" | "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. + * + * @experimental + */ +export type PlanFile = { + /** + * 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?: { + [key: string]: unknown; + } | null; + /** + * The plan ID to update. + */ + id: PlanId; + /** + * The URI of the file containing the plan. + */ + uri: string; +}; + +/** + * **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. + * + * @experimental + */ +export 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. + * + * @experimental + */ +export type PlanItems = { + /** + * 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?: { + [key: string]: unknown; + } | null; + /** + * 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: Array; + /** + * The plan ID to update. + */ + id: PlanId; +}; + +/** + * **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. + * + * @experimental + */ +export type PlanMarkdown = { + /** + * 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?: { + [key: string]: unknown; + } | null; + /** + * Markdown content for the plan. + */ + content: string; + /** + * The plan ID to update. + */ + id: PlanId; +}; + +/** + * **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. + * + * @experimental + */ +export type PlanRemoved = { + /** + * 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?: { + [key: string]: unknown; + } | null; + /** + * The plan ID to remove. + */ + id: PlanId; +}; + +/** + * **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. + * + * @experimental + */ +export type PlanUpdate = { + /** + * 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?: { + [key: string]: unknown; + } | null; + /** + * The updated plan content. + */ + plan: PlanUpdateContent; +}; + +/** + * **UNSTABLE** + * + * This capability is not part of the spec yet, and may be removed or changed at any point. + * + * Updated content for a plan. + * + * @experimental + */ +export type PlanUpdateContent = + | (PlanItems & { + type: "items"; + }) + | (PlanFile & { + type: "file"; + }) + | (PlanMarkdown & { + type: "markdown"; + }); + /** * A zero-based position in a text document. * @@ -4498,8 +4679,8 @@ export type SelectedPermissionOutcome = { * * 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` when they track - * that state. + * `session/list` may return `SessionInfo.additionalDirectories` to report the + * complete ordered additional-root list associated with a listed session. * * @experimental */ @@ -4546,7 +4727,8 @@ export type SessionCapabilities = { * Whether the agent supports `additionalDirectories` on supported session lifecycle requests. * * Agents that also support `session/list` may return - * `SessionInfo.additionalDirectories` when they track that state. + * `SessionInfo.additionalDirectories` to report the complete ordered + * additional-root list associated with a listed session. * * @experimental */ @@ -4847,11 +5029,11 @@ export type SessionInfo = { * * This capability is not part of the spec yet, and may be removed or changed at any point. * - * Additional workspace roots for this session, if the Agent reports them. Each path must be absolute. + * Additional workspace roots reported for this session. Each path must be absolute. * - * Agents may omit this field when they do not track or surface additional-root - * state. When present, this is the complete additional-root list known to - * the Agent 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. * * @experimental */ @@ -5071,6 +5253,12 @@ export type SessionUpdate = | (Plan & { sessionUpdate: "plan"; }) + | (PlanUpdate & { + sessionUpdate: "plan_update"; + }) + | (PlanRemoved & { + sessionUpdate: "plan_removed"; + }) | (AvailableCommandsUpdate & { sessionUpdate: "available_commands_update"; }) @@ -5098,7 +5286,7 @@ export type SessionUpdate = * * @experimental */ -export type SetProvidersRequest = { +export type SetProviderRequest = { /** * 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 @@ -5139,7 +5327,7 @@ export type SetProvidersRequest = { * * @experimental */ -export type SetProvidersResponse = { +export type SetProviderResponse = { /** * 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 diff --git a/src/schema/zod.gen.ts b/src/schema/zod.gen.ts index 60f4250e..ec7accb5 100644 --- a/src/schema/zod.gen.ts +++ b/src/schema/zod.gen.ts @@ -217,7 +217,7 @@ export const zDiff = z.object({ * * @experimental */ -export const zDisableProvidersRequest = z.object({ +export const zDisableProviderRequest = z.object({ _meta: z.record(z.string(), z.unknown()).nullish(), id: z.string(), }); @@ -231,7 +231,7 @@ export const zDisableProvidersRequest = z.object({ * * @experimental */ -export const zDisableProvidersResponse = z.object({ +export const zDisableProviderResponse = z.object({ _meta: z.record(z.string(), z.unknown()).nullish(), }); @@ -556,28 +556,16 @@ export const zLlmProtocol = z.union([ ]); /** - * **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. - * - * @experimental */ export const zLogoutCapabilities = z.object({ _meta: z.record(z.string(), z.unknown()).nullish(), }); /** - * **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. - * - * @experimental */ export const zAgentAuthCapabilities = z.object({ _meta: z.record(z.string(), z.unknown()).nullish(), @@ -585,28 +573,16 @@ export const zAgentAuthCapabilities = z.object({ }); /** - * **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. - * - * @experimental */ export const zLogoutRequest = z.object({ _meta: z.record(z.string(), z.unknown()).nullish(), }); /** - * **UNSTABLE** - * - * This capability is not part of the spec yet, and may be removed or changed at any point. - * * Response to the `logout` method. - * - * @experimental */ export const zLogoutResponse = z.object({ _meta: z.record(z.string(), z.unknown()).nullish(), @@ -1116,6 +1092,19 @@ export const zPermissionOption = z.object({ optionId: zPermissionOptionId, }); +/** + * **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. + * + * @experimental + */ +export const zPlanCapabilities = z.object({ + _meta: z.record(z.string(), z.unknown()).nullish(), +}); + /** * Priority levels for plan entries. * @@ -1169,6 +1158,117 @@ export const zPlan = z.object({ entries: z.array(zPlanEntry), }); +/** + * **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. + * + * @experimental + */ +export const zPlanId = z.string(); + +/** + * **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. + * + * @experimental + */ +export const zPlanFile = z.object({ + _meta: z.record(z.string(), z.unknown()).nullish(), + id: zPlanId, + uri: z.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. + * + * @experimental + */ +export const zPlanItems = z.object({ + _meta: z.record(z.string(), z.unknown()).nullish(), + entries: z.array(zPlanEntry), + id: zPlanId, +}); + +/** + * **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. + * + * @experimental + */ +export const zPlanMarkdown = z.object({ + _meta: z.record(z.string(), z.unknown()).nullish(), + content: z.string(), + id: zPlanId, +}); + +/** + * **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. + * + * @experimental + */ +export const zPlanRemoved = z.object({ + _meta: z.record(z.string(), z.unknown()).nullish(), + id: zPlanId, +}); + +/** + * **UNSTABLE** + * + * This capability is not part of the spec yet, and may be removed or changed at any point. + * + * Updated content for a plan. + * + * @experimental + */ +export const zPlanUpdateContent = z.union([ + zPlanItems.and( + z.object({ + type: z.literal("items"), + }), + ), + zPlanFile.and( + z.object({ + type: z.literal("file"), + }), + ), + zPlanMarkdown.and( + z.object({ + type: z.literal("markdown"), + }), + ), +]); + +/** + * **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. + * + * @experimental + */ +export const zPlanUpdate = z.object({ + _meta: z.record(z.string(), z.unknown()).nullish(), + plan: zPlanUpdateContent, +}); + /** * A zero-based position in a text document. * @@ -1239,6 +1339,7 @@ export const zClientCapabilities = z.object({ .optional() .default({ readTextFile: false, writeTextFile: false }), nes: zClientNesCapabilities.nullish(), + planCapabilities: zPlanCapabilities.nullish(), positionEncodings: z.array(zPositionEncodingKind).optional(), terminal: z.boolean().optional().default(false), }); @@ -1582,8 +1683,8 @@ export const zRequestPermissionResponse = z.object({ * * 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` when they track - * that state. + * `session/list` may return `SessionInfo.additionalDirectories` to report the + * complete ordered additional-root list associated with a listed session. * * @experimental */ @@ -2162,7 +2263,7 @@ export const zSessionCapabilities = z.object({ * * @experimental */ -export const zSetProvidersRequest = z.object({ +export const zSetProviderRequest = z.object({ _meta: z.record(z.string(), z.unknown()).nullish(), apiType: zLlmProtocol, baseUrl: z.string(), @@ -2179,7 +2280,7 @@ export const zSetProvidersRequest = z.object({ * * @experimental */ -export const zSetProvidersResponse = z.object({ +export const zSetProviderResponse = z.object({ _meta: z.record(z.string(), z.unknown()).nullish(), }); @@ -3021,8 +3122,8 @@ export const zAgentResponse = z.union([ zInitializeResponse, zAuthenticateResponse, zListProvidersResponse, - zSetProvidersResponse, - zDisableProvidersResponse, + zSetProviderResponse, + zDisableProviderResponse, zLogoutResponse, zNewSessionResponse, zLoadSessionResponse, @@ -3102,6 +3203,16 @@ export const zSessionUpdate = z.union([ sessionUpdate: z.literal("plan"), }), ), + zPlanUpdate.and( + z.object({ + sessionUpdate: z.literal("plan_update"), + }), + ), + zPlanRemoved.and( + z.object({ + sessionUpdate: z.literal("plan_removed"), + }), + ), zAvailableCommandsUpdate.and( z.object({ sessionUpdate: z.literal("available_commands_update"), @@ -3205,8 +3316,8 @@ export const zClientRequest = z.object({ zInitializeRequest, zAuthenticateRequest, zListProvidersRequest, - zSetProvidersRequest, - zDisableProvidersRequest, + zSetProviderRequest, + zDisableProviderRequest, zLogoutRequest, zNewSessionRequest, zLoadSessionRequest,