From ecd89b7539713e921e118537ad15361ecd2dae9e Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Tue, 21 Jul 2026 17:41:48 +0200 Subject: [PATCH] feat: Update to schema v1.20.0 and v2.0.0-alpha.2 --- schema/schema.json | 10 ++++++++++ schema/v2/schema.unstable.json | 15 +++++++++++++++ scripts/generate.js | 4 ++-- src/schema/types.gen.ts | 26 ++++++++++++++++++++++++++ src/schema/zod.gen.ts | 2 ++ src/v2/schema/types.gen.ts | 20 ++++++++++++++++++-- src/v2/schema/zod.gen.ts | 3 +++ 7 files changed, 76 insertions(+), 4 deletions(-) diff --git a/schema/schema.json b/schema/schema.json index f342755..a23ff3f 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -445,6 +445,11 @@ "type": ["string", "null"], "x-deserialize-default-on-error": true }, + "name": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nUpdate the programmatic name of the tool being invoked.\n\nThis field is optional. Omitting it or sending `null` both mean that\nthe existing name is left unchanged.", + "type": ["string", "null"], + "x-deserialize-default-on-error": true + }, "content": { "description": "Replace the content collection.", "type": ["array", "null"], @@ -5332,6 +5337,11 @@ "description": "Human-readable title describing what the tool is doing.", "type": "string" }, + "name": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProgrammatic name of the tool being invoked.\n\nThis field is optional. Omitting it or sending `null` both mean that no\ntool name is available.", + "type": ["string", "null"], + "x-deserialize-default-on-error": true + }, "kind": { "description": "The category of tool being invoked.\nHelps clients choose appropriate icons and UI treatment.", "x-deserialize-default-on-error": true, diff --git a/schema/v2/schema.unstable.json b/schema/v2/schema.unstable.json index 82ebe9d..09d2a0a 100644 --- a/schema/v2/schema.unstable.json +++ b/schema/v2/schema.unstable.json @@ -809,6 +809,11 @@ } ] }, + "name": { + "description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nProgrammatic name of the tool being invoked.\n\nThis field is optional and has patch semantics. Omission means no\nchange, `null` clears the name, and a string replaces it. For a tool\ncall ID the client has not seen before, omission or `null` means that no\ntool name is available.", + "type": ["string", "null"], + "x-deserialize-default-on-error": true + }, "title": { "description": "Human-readable title describing what the tool is doing.", "type": ["string", "null"], @@ -960,6 +965,11 @@ "type": "string", "const": "failed" }, + { + "description": "The tool call was cancelled before it completed.", + "type": "string", + "const": "cancelled" + }, { "title": "other", "description": "Custom or future tool call status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", @@ -6991,6 +7001,11 @@ "type": "string", "const": "completed" }, + { + "description": "The task was cancelled before it completed.", + "type": "string", + "const": "cancelled" + }, { "title": "other", "description": "Custom or future plan entry status.\n\nValues beginning with `_` are reserved for implementation-specific\nextensions. Unknown values that do not begin with `_` are reserved for\nfuture ACP variants.", diff --git a/scripts/generate.js b/scripts/generate.js index f2f9d54..20e529f 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -10,8 +10,8 @@ import * as fs from "fs/promises"; import { dirname } from "path"; import * as prettier from "prettier"; -const CURRENT_V1_SCHEMA_RELEASE = "schema-v1.19.1"; -const CURRENT_V2_SCHEMA_RELEASE = "schema-v2.0.0-alpha.1"; +const CURRENT_V1_SCHEMA_RELEASE = "schema-v1.20.0"; +const CURRENT_V2_SCHEMA_RELEASE = "schema-v2.0.0-alpha.2"; // ── Extensible-union pipeline ──────────────────────────────────────────────── // Several schemas model forward compatibility as an "extensible union": known diff --git a/src/schema/types.gen.ts b/src/schema/types.gen.ts index f26ea4a..ca1e9b2 100644 --- a/src/schema/types.gen.ts +++ b/src/schema/types.gen.ts @@ -181,6 +181,19 @@ export type ToolCallUpdate = { * Update the human-readable title. */ title?: string | null; + /** + * **UNSTABLE** + * + * This capability is not part of the spec yet, and may be removed or changed at any point. + * + * Update the programmatic name of the tool being invoked. + * + * This field is optional. Omitting it or sending `null` both mean that + * the existing name is left unchanged. + * + * @experimental + */ + name?: string | null; /** * Replace the content collection. */ @@ -3786,6 +3799,19 @@ export type ToolCall = { * Human-readable title describing what the tool is doing. */ title: string; + /** + * **UNSTABLE** + * + * This capability is not part of the spec yet, and may be removed or changed at any point. + * + * Programmatic name of the tool being invoked. + * + * This field is optional. Omitting it or sending `null` both mean that no + * tool name is available. + * + * @experimental + */ + name?: string | null; /** * The category of tool being invoked. * Helps clients choose appropriate icons and UI treatment. diff --git a/src/schema/zod.gen.ts b/src/schema/zod.gen.ts index 642f250..e962eed 100644 --- a/src/schema/zod.gen.ts +++ b/src/schema/zod.gen.ts @@ -398,6 +398,7 @@ export const zToolCallUpdate = z.object({ kind: defaultOnError(zToolKind.nullish(), () => undefined), status: defaultOnError(zToolCallStatus.nullish(), () => undefined), title: defaultOnError(z.string().nullish(), () => undefined), + name: defaultOnError(z.string().nullish(), () => undefined), content: defaultOnError( vecSkipError(zToolCallContent).nullish(), () => undefined, @@ -2493,6 +2494,7 @@ export const zContentChunk = z.object({ export const zToolCall = z.object({ toolCallId: zToolCallId, title: z.string(), + name: defaultOnError(z.string().nullish(), () => undefined), kind: defaultOnError(zToolKind.optional(), () => undefined), status: defaultOnError(zToolCallStatus.optional(), () => undefined), content: defaultOnError(vecSkipError(zToolCallContent).optional(), () => []), diff --git a/src/v2/schema/types.gen.ts b/src/v2/schema/types.gen.ts index 1210abc..8183a1e 100644 --- a/src/v2/schema/types.gen.ts +++ b/src/v2/schema/types.gen.ts @@ -145,6 +145,21 @@ export type ToolCallUpdate = { * Unique identifier for this tool call within the session. */ toolCallId: ToolCallId; + /** + * **UNSTABLE** + * + * This capability is not part of the spec yet, and may be removed or changed at any point. + * + * Programmatic name of the tool being invoked. + * + * This field is optional and has patch semantics. Omission means no + * change, `null` clears the name, and a string replaces it. For a tool + * call ID the client has not seen before, omission or `null` means that no + * tool name is available. + * + * @experimental + */ + name?: string | null; /** * Human-readable title describing what the tool is doing. */ @@ -221,7 +236,7 @@ export type ToolKind = * See protocol docs: [Status](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#status) */ export type ToolCallStatus = - "pending" | "in_progress" | "completed" | "failed" | string; + "pending" | "in_progress" | "completed" | "failed" | "cancelled" | string; /** * Content produced by a tool call. @@ -4284,7 +4299,8 @@ export type PlanEntryPriority = "high" | "medium" | "low" | string; * Tracks the lifecycle of each task from planning through completion. * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries) */ -export type PlanEntryStatus = "pending" | "in_progress" | "completed" | string; +export type PlanEntryStatus = + "pending" | "in_progress" | "completed" | "cancelled" | string; /** * A plan represented as structured entries. diff --git a/src/v2/schema/zod.gen.ts b/src/v2/schema/zod.gen.ts index 88d8f6e..00ae9db 100644 --- a/src/v2/schema/zod.gen.ts +++ b/src/v2/schema/zod.gen.ts @@ -71,6 +71,7 @@ export const zToolCallStatus = z.union([ z.literal("in_progress"), z.literal("completed"), z.literal("failed"), + z.literal("cancelled"), z.string(), ]); @@ -522,6 +523,7 @@ export const zToolCallLocation = z.object({ */ export const zToolCallUpdate = z.object({ toolCallId: zToolCallId, + name: defaultOnError(z.string().nullish(), () => undefined), title: defaultOnError(z.string().nullish(), () => undefined), kind: defaultOnError(zToolKind.nullish(), () => undefined), status: defaultOnError(zToolCallStatus.nullish(), () => undefined), @@ -2823,6 +2825,7 @@ export const zPlanEntryStatus = z.union([ z.literal("pending"), z.literal("in_progress"), z.literal("completed"), + z.literal("cancelled"), z.string(), ]);