diff --git a/apps/mobile/src/connection/environment-cache-store.ts b/apps/mobile/src/connection/environment-cache-store.ts index ad5ef13b62d5..87a4cc143744 100644 --- a/apps/mobile/src/connection/environment-cache-store.ts +++ b/apps/mobile/src/connection/environment-cache-store.ts @@ -1,6 +1,7 @@ import { ConnectionPersistenceError, EnvironmentCacheStore, + encodeShellSnapshotForCache, } from "@t3tools/client-runtime/platform"; import { type EnvironmentId, @@ -50,7 +51,6 @@ const StoredVcsRefs = Schema.Struct({ const decodeStoredShellSnapshot = Schema.decodeUnknownEffect( Schema.fromJsonString(StoredShellSnapshot), ); -const encodeStoredShellSnapshot = Schema.encodeEffect(Schema.fromJsonString(StoredShellSnapshot)); const decodeStoredThreadSnapshot = Schema.decodeUnknownEffect( Schema.fromJsonString(StoredThreadSnapshot), ); @@ -129,11 +129,18 @@ export const make = Effect.fn("MobileEnvironmentCacheStore.make")(function* () { }), ), saveShell: Effect.fn("MobileEnvironmentCache.saveShell")(function* (environmentId, snapshot) { - const payload = yield* encodeStoredShellSnapshot({ - schemaVersion: SHELL_SNAPSHOT_CACHE_SCHEMA_VERSION, - environmentId, - snapshot, - }).pipe(Effect.mapError((cause) => persistenceError("save-shell", cause))); + const encodedSnapshot = yield* encodeShellSnapshotForCache(snapshot).pipe( + Effect.mapError((cause) => persistenceError("save-shell", cause)), + ); + const payload = yield* Effect.try({ + try: () => + JSON.stringify({ + schemaVersion: SHELL_SNAPSHOT_CACHE_SCHEMA_VERSION, + environmentId, + snapshot: encodedSnapshot, + } satisfies typeof StoredShellSnapshot.Encoded), + catch: (cause) => persistenceError("save-shell", cause), + }); yield* database .saveCache(environmentId, "shell", "snapshot", SHELL_SNAPSHOT_CACHE_SCHEMA_VERSION, payload) .pipe(Effect.mapError(mapDatabaseError("save-shell"))); diff --git a/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx b/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx index e1cc7405bde2..51eb3e4b06fa 100644 --- a/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx +++ b/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx @@ -1131,7 +1131,7 @@ export function NewTaskDraftScreen(props: { in { it("applies the remaining attachment slots to photos and videos together", async () => { mocks.pickMedia.mockResolvedValue({ canceled: false, assets: [image, video] }); - const result = await pickComposerMedia({ existingCount: 7, maxVideoBytes: 50 * 1024 * 1024 }); + const result = await pickComposerMedia({ + existingCount: 99, + maxVideoBytes: 50 * 1024 * 1024, + }); expect(result.attachments).toEqual([expect.objectContaining({ type: "image" })]); - expect(result.error).toBe("You can attach up to 8 attachments per message."); + expect(result.error).toBe("You can attach up to 100 attachments per message."); expect(mocks.pickMedia).toHaveBeenCalledWith(expect.objectContaining({ selectionLimit: 1 })); expect(mocks.copy).not.toHaveBeenCalled(); }); @@ -512,9 +515,9 @@ describe("composer file attachments", () => { }); it("does not open the picker when the draft has no remaining attachment slots", async () => { - await expect(pickComposerFiles({ existingCount: 8 })).resolves.toEqual({ + await expect(pickComposerFiles({ existingCount: 100 })).resolves.toEqual({ files: [], - error: "You can attach up to 8 files per message.", + error: "You can attach up to 100 files per message.", }); expect(mocks.pickFile).not.toHaveBeenCalled(); @@ -725,7 +728,7 @@ describe("composer file attachments", () => { ], }); - const result = await pickComposerFiles({ existingCount: 7, maxBytes: 1024 * 1024 }); + const result = await pickComposerFiles({ existingCount: 99, maxBytes: 1024 * 1024 }); expect(result.files.map((file) => file.name)).toEqual(["report.pdf"]); }); diff --git a/apps/mobile/src/state/use-composer-drafts.test.ts b/apps/mobile/src/state/use-composer-drafts.test.ts index 68d901546fef..98d736253682 100644 --- a/apps/mobile/src/state/use-composer-drafts.test.ts +++ b/apps/mobile/src/state/use-composer-drafts.test.ts @@ -279,7 +279,7 @@ describe("mobile composer drafts", () => { fileUri: `file:///documents/t3-composer-attachments/${id}.mov`, }); const draftKey = "new-task:environment-1:project-cap"; - const existing = Array.from({ length: 7 }, (_, index) => makeAttachment(`held-${index}`)); + const existing = Array.from({ length: 99 }, (_, index) => makeAttachment(`held-${index}`)); appAtomRegistry.set(composerDraftsAtom, { [draftKey]: { text: "send this", attachments: existing }, }); @@ -291,7 +291,7 @@ describe("mobile composer drafts", () => { expect(rejected).toBe(1); const draft = appAtomRegistry.get(composerDraftsAtom)[draftKey]; - expect(draft?.attachments).toHaveLength(8); + expect(draft?.attachments).toHaveLength(100); expect(draft?.attachments.at(-1)?.id).toBe("incoming-1"); await cleanup.promise; expect(composerAttachmentCleanupMocks.remove).toHaveBeenCalledExactlyOnceWith( @@ -305,7 +305,7 @@ describe("mobile composer drafts", () => { { allowOverflow: true }, ); expect(overflowRejected).toBe(0); - expect(appAtomRegistry.get(composerDraftsAtom)[draftKey]?.attachments).toHaveLength(9); + expect(appAtomRegistry.get(composerDraftsAtom)[draftKey]?.attachments).toHaveLength(101); }); it("keeps shared attachment files until every draft releases them", async () => { @@ -1481,7 +1481,7 @@ describe("mobile composer drafts", () => { previewUri: "data:image/png;base64,YWJj", }); const existingImage = image("existing"); - const sharedImages = Array.from({ length: 8 }, (_, index) => image(`shared-${index}`)); + const sharedImages = Array.from({ length: 100 }, (_, index) => image(`shared-${index}`)); const merged = mergeComposerDraftContentState( { [draftKey]: { text: "", attachments: [existingImage] } }, @@ -1489,9 +1489,9 @@ describe("mobile composer drafts", () => { { text: "", attachments: sharedImages }, ); - expect(merged[draftKey]?.attachments).toHaveLength(8); + expect(merged[draftKey]?.attachments).toHaveLength(100); expect(merged[draftKey]?.attachments[0]).toEqual(existingImage); - expect(merged[draftKey]?.attachments.at(-1)?.id).toBe("shared-6"); + expect(merged[draftKey]?.attachments.at(-1)?.id).toBe("shared-98"); }); it("restores the exact draft captured before an interrupted share import", () => { diff --git a/apps/server/package.json b/apps/server/package.json index b575503f29c7..604299790bce 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -1,6 +1,6 @@ { "name": "t3", - "version": "0.0.40-skofo.20260919.curated9", + "version": "0.0.40-skofo.20260921.curated13", "license": "MIT", "repository": { "type": "git", diff --git a/apps/server/src/git/GitManager.test.ts b/apps/server/src/git/GitManager.test.ts index 643e1e7a0d5b..b983e6a9d0ee 100644 --- a/apps/server/src/git/GitManager.test.ts +++ b/apps/server/src/git/GitManager.test.ts @@ -3770,7 +3770,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { }), ); - it.effect("generates PR content against the remote base when the local base is stale", () => + it.effect("generates PR content from branch changes when the remote base advances", () => Effect.gen(function* () { const repoDir = yield* makeTempDir("t3code-git-manager-"); yield* initRepo(repoDir); @@ -3802,7 +3802,15 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { yield* runGit(repoDir, ["push", "-u", "origin", "feature/remote-base"]); yield* runGit(repoDir, ["config", "branch.feature/remote-base.gh-merge-base", "main"]); + NodeFS.writeFileSync(NodePath.join(peerDir, "later-main.txt"), "unrelated\n"); + yield* runGit(peerDir, ["add", "later-main.txt"]); + yield* runGit(peerDir, ["commit", "-m", "Later main commit"]); + yield* runGit(peerDir, ["push", "origin", "main"]); + yield* runGit(repoDir, ["fetch", "origin"]); + let generatedCommitSummary = ""; + let generatedDiffSummary = ""; + let generatedDiffPatch = ""; const { manager } = yield* makeManager({ ghScenario: { prListSequence: ["[]", "[]"], @@ -3810,6 +3818,8 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { textGeneration: { generatePrContent: (input) => { generatedCommitSummary = input.commitSummary; + generatedDiffSummary = input.diffSummary; + generatedDiffPatch = input.diffPatch; return Effect.succeed({ title: "Feature PR", body: "Feature body" }); }, }, @@ -3823,6 +3833,11 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { expect(result.pr.status).toBe("created"); expect(generatedCommitSummary).toContain("Feature commit"); expect(generatedCommitSummary).not.toContain("Remote base commit"); + expect(generatedCommitSummary).not.toContain("Later main commit"); + expect(generatedDiffSummary).toContain("feature.txt"); + expect(generatedDiffSummary).not.toContain("later-main.txt"); + expect(generatedDiffPatch).toContain("feature.txt"); + expect(generatedDiffPatch).not.toContain("later-main.txt"); }), ); diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts index b8e457e34ebb..75d7b27e6038 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts @@ -32,6 +32,7 @@ import { makeDrainableWorker } from "@t3tools/shared/DrainableWorker"; import { resolveThreadWorkspaceCwd } from "../../checkpointing/Utils.ts"; import { increment, orchestrationEventsProcessedTotal } from "../../observability/Metrics.ts"; import { + ProviderAdapterProcessError, ProviderAdapterRequestError, ProviderAdapterValidationError, ProviderWorkspaceMissingError, @@ -55,6 +56,7 @@ import { } from "../../serverSettings.ts"; import { VcsStatusBroadcaster } from "../../vcs/VcsStatusBroadcaster.ts"; import { GitWorkflowService } from "../../git/GitWorkflowService.ts"; +const isProviderAdapterProcessError = Schema.is(ProviderAdapterProcessError); const isProviderAdapterRequestError = Schema.is(ProviderAdapterRequestError); const isProviderAdapterValidationError = Schema.is(ProviderAdapterValidationError); const isProviderWorkspaceMissingError = Schema.is(ProviderWorkspaceMissingError); @@ -393,6 +395,9 @@ const make = Effect.gen(function* () { if (isProviderAdapterRequestError(failReason?.error)) { return failReason.error.detail; } + if (isProviderAdapterProcessError(failReason?.error)) { + return failReason.error.detail; + } if (isProviderAdapterValidationError(failReason?.error)) { return failReason.error.issue; } diff --git a/apps/server/src/orchestration/Normalizer.attachments.test.ts b/apps/server/src/orchestration/Normalizer.attachments.test.ts index 7385b65315cb..452fada49c90 100644 --- a/apps/server/src/orchestration/Normalizer.attachments.test.ts +++ b/apps/server/src/orchestration/Normalizer.attachments.test.ts @@ -11,6 +11,7 @@ import { ThreadId, } from "@t3tools/contracts"; import * as Effect from "effect/Effect"; +import * as FileSystem from "effect/FileSystem"; import * as Layer from "effect/Layer"; import * as ServerConfig from "../config.ts"; @@ -53,6 +54,53 @@ function turnStartCommand(input: { } describe("normalizeDispatchCommand attachments", () => { + it.effect("accepts 100 inline images and rejects 101 before writing files", () => + Effect.gen(function* () { + const config = yield* ServerConfig.ServerConfig; + const attachments = Array.from({ length: 100 }, () => ({ + dataUrl: "data:image/png;base64,cGl4ZWxz", + sizeBytes: 6, + })); + const rejected = yield* normalizeDispatchCommand( + turnStartCommand({ attachments: [...attachments, attachments[0]!] }), + ).pipe(Effect.flip); + expect(rejected.message).toContain("up to 100"); + expect(NodeFS.readdirSync(config.attachmentsDir)).toEqual([]); + const accepted = yield* normalizeDispatchCommand(turnStartCommand({ attachments })); + if (accepted.type !== "thread.turn.start") throw new Error("Wrong command"); + expect(accepted.message.attachments).toHaveLength(100); + expect(NodeFS.readdirSync(config.attachmentsDir)).toHaveLength(100); + }).pipe(Effect.provide(testLayer)), + ); + + it.effect("rejects decoded image overflow before writing it and removes earlier files", () => + Effect.gen(function* () { + const config = yield* ServerConfig.ServerConfig; + const fileSystem = yield* FileSystem.FileSystem; + let writtenBytes = 0; + const dataUrl = `data:image/png;base64,${Buffer.alloc(10 * 1024 * 1024).toString("base64")}`; + const command = turnStartCommand({ + attachments: [ + ...Array.from({ length: 8 }, () => ({ dataUrl, sizeBytes: 1 })), + { dataUrl: "data:image/png;base64,YQ==", sizeBytes: 0 }, + ], + }); + const error = yield* normalizeDispatchCommand(command).pipe( + Effect.provideService(FileSystem.FileSystem, { + ...fileSystem, + writeFile: (path, data, options) => { + writtenBytes += data.byteLength; + return fileSystem.writeFile(path, data, options); + }, + }), + Effect.flip, + ); + expect(error.message).toContain("80 MiB"); + expect(writtenBytes).toBe(80 * 1024 * 1024); + expect(NodeFS.readdirSync(config.attachmentsDir)).toEqual([]); + }).pipe(Effect.provide(testLayer)), + ); + it.effect("preserves inline image attachments from existing mobile clients", () => Effect.gen(function* () { const config = yield* ServerConfig.ServerConfig; diff --git a/apps/server/src/orchestration/Normalizer.ts b/apps/server/src/orchestration/Normalizer.ts index 1226a6cd25d5..55996b26b1cd 100644 --- a/apps/server/src/orchestration/Normalizer.ts +++ b/apps/server/src/orchestration/Normalizer.ts @@ -4,6 +4,7 @@ import * as FileSystem from "effect/FileSystem"; import * as Path from "effect/Path"; import { type ClientOrchestrationCommand, + getProviderAttachmentLimitError, type IsoDateTime, type OrchestrationCommand, OrchestrationDispatchCommandError, @@ -133,10 +134,17 @@ export const normalizeDispatchCommand = (command: ClientOrchestrationCommand) => return canonicalCommand as OrchestrationCommand; } + const attachmentLimitError = getProviderAttachmentLimitError( + canonicalCommand.message.attachments, + ); + if (attachmentLimitError) { + return yield* new OrchestrationDispatchCommandError({ message: attachmentLimitError }); + } const claimedAttachmentPaths: string[] = []; + const attachmentsWithDecodedSizes = [...canonicalCommand.message.attachments]; const normalizedAttachments = yield* Effect.forEach( canonicalCommand.message.attachments, - (attachment) => + (attachment, index) => Effect.gen(function* () { if (!("dataUrl" in attachment)) { const claim = planAttachmentClaim({ @@ -226,6 +234,11 @@ export const normalizeDispatchCommand = (command: ClientOrchestrationCommand) => mimeType: parsed.mimeType.toLowerCase(), sizeBytes: bytes.byteLength, }; + attachmentsWithDecodedSizes[index] = persistedAttachment; + const decodedLimitError = getProviderAttachmentLimitError(attachmentsWithDecodedSizes); + if (decodedLimitError) { + return yield* new OrchestrationDispatchCommandError({ message: decodedLimitError }); + } const attachmentPath = resolveAttachmentPath({ attachmentsDir: serverConfig.attachmentsDir, @@ -253,6 +266,7 @@ export const normalizeDispatchCommand = (command: ClientOrchestrationCommand) => }), ), ); + claimedAttachmentPaths.push(attachmentPath); return persistedAttachment; }), diff --git a/apps/server/src/persistence/Layers/Sqlite.test.ts b/apps/server/src/persistence/Layers/Sqlite.test.ts index 0b64e4f7fdcb..5bcbd35e918c 100644 --- a/apps/server/src/persistence/Layers/Sqlite.test.ts +++ b/apps/server/src/persistence/Layers/Sqlite.test.ts @@ -10,7 +10,11 @@ import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as SqlClient from "effect/unstable/sql/SqlClient"; -import { SqlitePersistenceMemory, makeSqlitePersistenceLive } from "./Sqlite.ts"; +import { + SqlitePersistenceMemory, + WAL_SIZE_LIMIT_BYTES, + makeSqlitePersistenceLive, +} from "./Sqlite.ts"; const lockHolderSource = ` const { DatabaseSync } = require("node:sqlite"); @@ -57,6 +61,32 @@ it.effect("waits out a concurrent writer instead of failing with SQLITE_BUSY", ( ); }); +it.effect("shrinks the WAL file back to the size limit after a large write", () => { + const tempDir = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-sqlite-wal-")); + const dbPath = NodePath.join(tempDir, "state.sqlite"); + const walFileSize = () => NodeFS.statSync(`${dbPath}-wal`).size; + // About 25% more 4 KB rows than the limit holds, in one transaction. + const rowCount = Math.ceil((WAL_SIZE_LIMIT_BYTES * 1.25) / 4000); + + return Effect.gen(function* () { + const sql = yield* SqlClient.SqlClient; + yield* sql`CREATE TABLE wal_probe(payload BLOB)`; + yield* sql` + WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < ${rowCount}) + INSERT INTO wal_probe(payload) SELECT randomblob(4000) FROM n + `; + assert.isAbove(walFileSize(), WAL_SIZE_LIMIT_BYTES); + + // The auto-checkpoint after the large commit copied every frame into the + // database, so the next commit restarts the WAL and cuts the file back. + yield* sql`INSERT INTO wal_probe(payload) VALUES (x'00')`; + assert.isAtMost(walFileSize(), WAL_SIZE_LIMIT_BYTES); + }).pipe( + Effect.provide(makeSqlitePersistenceLive(dbPath).pipe(Layer.provide(NodeServices.layer))), + Effect.ensuring(Effect.sync(() => NodeFS.rmSync(tempDir, { recursive: true, force: true }))), + ); +}); + it.effect("applies busy_timeout in the shared persistence setup", () => Effect.gen(function* () { const sql = yield* SqlClient.SqlClient; diff --git a/apps/server/src/persistence/Layers/Sqlite.ts b/apps/server/src/persistence/Layers/Sqlite.ts index 41d8f5baf3fd..0d3e621fbc12 100644 --- a/apps/server/src/persistence/Layers/Sqlite.ts +++ b/apps/server/src/persistence/Layers/Sqlite.ts @@ -8,6 +8,9 @@ import type { SqlError } from "effect/unstable/sql/SqlError"; import { runMigrations } from "../Migrations.ts"; import { ServerConfig } from "../../config.ts"; +// Size the -wal file is cut back to on the first commit after a WAL reset. +export const WAL_SIZE_LIMIT_BYTES = 32 * 1024 * 1024; + type RuntimeSqliteLayerConfig = { readonly filename: string; readonly spanAttributes?: Record; @@ -37,6 +40,9 @@ const setup = Layer.effectDiscard( yield* sql`PRAGMA busy_timeout = 5000;`; yield* sql`PRAGMA foreign_keys = ON;`; yield* sql`PRAGMA journal_mode = WAL;`; + // PASSIVE checkpoints never shrink the -wal file, so it otherwise keeps its + // largest size until the last connection closes. + yield* sql.unsafe(`PRAGMA journal_size_limit = ${WAL_SIZE_LIMIT_BYTES};`); yield* runMigrations(); }), ); diff --git a/apps/server/src/provider/CodexDeveloperInstructions.ts b/apps/server/src/provider/CodexDeveloperInstructions.ts index 2bb9647bd414..4644547cde7e 100644 --- a/apps/server/src/provider/CodexDeveloperInstructions.ts +++ b/apps/server/src/provider/CodexDeveloperInstructions.ts @@ -1,16 +1,14 @@ import type { ProviderInteractionMode } from "@t3tools/contracts"; +import type { V2TurnStartParams__AdditionalContextEntry } from "effect-codex-app-server/schema"; import { buildRuntimeInstructions } from "./RuntimeInstructions.ts"; -const T3_CODE_BROWSER_TOOL_INSTRUCTIONS = ` - -## T3 Code collaborative browser +const T3_CODE_BROWSER_TOOL_INSTRUCTIONS = `## T3 Code collaborative browser You are running inside T3 Code. The \`t3-code\` MCP server is the product-native collaborative browser shared with the user. When it exposes \`preview_*\` tools, prefer those tools for browser navigation, inspection, interaction, screenshots, and recordings. For browser work, first call \`preview_status\`. If no automation-capable preview is attached, call \`preview_open\` before concluding that the browser is unavailable. Then use \`preview_navigate\`, \`preview_snapshot\`, and the focused interaction tools. Prefer snapshot-provided locators over coordinates. -Do not switch to global browser skills, Chrome, Node REPL browser automation, standalone Playwright, or agent-browser merely because the preview is initially closed or a first call fails. Use an alternative browser system only when the T3 preview tools are absent, the user explicitly requests another browser, or \`preview_open\` returns an explicit unsupported/unavailable error. A failed T3 preview tool call should be inspected and retried with corrected arguments when the error is actionable. -`; +Do not switch to global browser skills, Chrome, Node REPL browser automation, standalone Playwright, or agent-browser merely because the preview is initially closed or a first call fails. Use an alternative browser system only when the T3 preview tools are absent, the user explicitly requests another browser, or \`preview_open\` returns an explicit unsupported/unavailable error. A failed T3 preview tool call should be inspected and retried with corrected arguments when the error is actionable.`; /** * The browser block is omitted entirely when the preview tools aren't attached. @@ -19,12 +17,10 @@ Do not switch to global browser skills, Chrome, Node REPL browser automation, st * from Playwright and agent-browser, so leaving them in would talk it out of * the only browser automation it still has. */ -const browserToolInstructions = (browserToolsAvailable: boolean): string => +const toolInstructions = (browserToolsAvailable: boolean): string => browserToolsAvailable ? T3_CODE_BROWSER_TOOL_INSTRUCTIONS : ""; -export const codexPlanModeDeveloperInstructions = ( - browserToolsAvailable: boolean, -): string => `# Plan Mode (Conversational) +const CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS = `# Plan Mode (Conversational) You work in 3 phases, and you should *chat your way* to a great plan before finalizing it. A great plan is very detailed-intent- and implementation-wise-so that it can be handed to another engineer or agent to be implemented right away. It must be **decision complete**, where the implementer does not need to make any decisions. @@ -152,12 +148,9 @@ Do not ask "should I proceed?" in the final output. The user can easily switch o Only produce at most one \`\` block per turn, and only when you are presenting a complete spec. If the user stays in Plan mode and asks for revisions after a prior \`\`, any new \`\` must be a complete replacement. If the user indicates that the prior plan is not acceptable but does not provide enough information to produce a complete replacement, address the concern and continue planning without producing a \`\` block. If the follow-up neither requires changes nor calls the plan into question (e.g. clarifying question), answer it before the block, then reproduce the prior \`\` unchanged. -${browserToolInstructions(browserToolsAvailable)} `; -export const codexDefaultModeDeveloperInstructions = ( - browserToolsAvailable: boolean, -): string => `# Collaboration Mode: Default +const CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS = `# Collaboration Mode: Default You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. @@ -168,29 +161,46 @@ Your active mode changes only when new developer instructions with a different \ Use the \`request_user_input\` tool only when it is listed in the available tools for this turn. In Default mode, strongly prefer making reasonable assumptions and executing the user's request rather than stopping to ask questions. If you absolutely must ask a question because the answer cannot be discovered from local context and a reasonable assumption would be risky, ask the user directly with a concise plain-text question. Never write a multiple choice question as a textual assistant message. -${browserToolInstructions(browserToolsAvailable)} `; export interface CodexRuntimeInfo { readonly model: string; + readonly modelName?: string | undefined; readonly reasoningEffort: string; } -export function buildCodexDeveloperInstructions( - interactionMode: ProviderInteractionMode, +/** Mode prompt for `turn/start.collaborationMode.settings.developer_instructions`. */ +export function buildCodexDeveloperInstructions(interactionMode: ProviderInteractionMode): string { + return interactionMode === "plan" + ? CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS + : CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS; +} + +/** + * T3 Code context for `turn/start.additionalContext`. Codex renders each entry + * as a `value` developer message and resends it only when the value + * changes. + * + * This must stay out of the collaboration mode: when the model catalog ships + * its own text for a mode, as newer models do, Codex uses that text and drops + * the client's `developer_instructions` entirely. + */ +export function buildCodexAdditionalContext( runtime: CodexRuntimeInfo, /** * Whether the `t3-code` MCP server is attached to this turn. Callers derive * it from the session's actual MCP configuration rather than re-reading the * setting, so the prompt cannot claim tools the turn doesn't have. */ - browserToolsAvailable = true, -): string { - const base = - interactionMode === "plan" - ? codexPlanModeDeveloperInstructions(browserToolsAvailable) - : codexDefaultModeDeveloperInstructions(browserToolsAvailable); - return `${base} - -${buildRuntimeInstructions({ harness: "Codex", ...runtime })}`; + toolsAvailable = true, +): Record { + const tools = toolInstructions(toolsAvailable); + // Separate keys keep each value under Codex's per-entry token cap. + return { + t3_code_runtime: { + kind: "application", + value: buildRuntimeInstructions({ harness: "Codex", ...runtime }), + }, + ...(tools ? { t3_code_tools: { kind: "application", value: tools } } : {}), + }; } diff --git a/apps/server/src/provider/Drivers/ClaudeDriver.ts b/apps/server/src/provider/Drivers/ClaudeDriver.ts index efcf19e9d6b1..0d1f1cc62f4a 100644 --- a/apps/server/src/provider/Drivers/ClaudeDriver.ts +++ b/apps/server/src/provider/Drivers/ClaudeDriver.ts @@ -126,7 +126,10 @@ export const ClaudeDriver: ProviderDriver = { binaryPath: effectiveConfig.binaryPath, env: processEnv, }); - const continuationGroupKey = yield* makeClaudeContinuationGroupKey(effectiveConfig); + const continuationGroupKey = yield* makeClaudeContinuationGroupKey( + effectiveConfig, + processEnv, + ); const stampIdentity = withInstanceIdentity({ instanceId, driverKind: DRIVER_KIND, @@ -162,7 +165,11 @@ export const ClaudeDriver: ProviderDriver = { Effect.provideService(Path.Path, path), ), }); - const capabilitiesCacheKey = yield* makeClaudeCapabilitiesCacheKey(effectiveConfig, cwd); + const capabilitiesCacheKey = yield* makeClaudeCapabilitiesCacheKey( + effectiveConfig, + cwd, + processEnv, + ); // Start the TTL-gated refresh without delaying provider readiness. The // next check observes a remote manifest after the background fetch lands. diff --git a/apps/server/src/provider/Drivers/ClaudeHome.test.ts b/apps/server/src/provider/Drivers/ClaudeHome.test.ts index a7ff41fc89ea..00ef8cc17bf7 100644 --- a/apps/server/src/provider/Drivers/ClaudeHome.test.ts +++ b/apps/server/src/provider/Drivers/ClaudeHome.test.ts @@ -14,13 +14,20 @@ import { it.layer(NodeServices.layer)("ClaudeHome", (it) => { describe("Claude home resolution", () => { - it.effect("uses the process home when no Claude home override is configured", () => + it.effect("treats empty, ~/.claude, and the expanded default as the same Claude home", () => Effect.gen(function* () { const path = yield* Path.Path; - const resolved = path.resolve(NodeOS.homedir()); + const resolved = path.resolve(path.join(NodeOS.homedir(), ".claude")); expect(yield* resolveClaudeHomePath({ homePath: "" })).toBe(resolved); + expect(yield* resolveClaudeHomePath({ homePath: "~/.claude" })).toBe(resolved); + expect(yield* resolveClaudeHomePath({ homePath: resolved })).toBe(resolved); expect(yield* makeClaudeEnvironment({ homePath: "" })).toBe(process.env); + + const key = `claude:home:${resolved}`; + expect(yield* makeClaudeContinuationGroupKey({ homePath: "" })).toBe(key); + expect(yield* makeClaudeContinuationGroupKey({ homePath: "~/.claude" })).toBe(key); + expect(yield* makeClaudeContinuationGroupKey({ homePath: resolved })).toBe(key); }), ); @@ -39,6 +46,23 @@ it.layer(NodeServices.layer)("ClaudeHome", (it) => { }), ); + it.effect("uses inherited CLAUDE_CONFIG_DIR when homePath is empty", () => + Effect.gen(function* () { + const path = yield* Path.Path; + const inherited = path.resolve("/tmp/claude-inherited"); + const environment = { CLAUDE_CONFIG_DIR: inherited }; + + expect(yield* resolveClaudeHomePath({ homePath: "" }, environment)).toBe(inherited); + expect(yield* makeClaudeContinuationGroupKey({ homePath: "" }, environment)).toBe( + `claude:home:${inherited}`, + ); + + const explicit = path.resolve(NodeOS.homedir(), ".claude-work"); + expect(yield* resolveClaudeHomePath({ homePath: "~/.claude-work" }, environment)).toBe( + explicit, + ); + }), + ); it.effect("separates capability probes by cwd", () => Effect.gen(function* () { const config = { binaryPath: "claude", homePath: "" }; @@ -47,16 +71,5 @@ it.layer(NodeServices.layer)("ClaudeHome", (it) => { expect(first).not.toBe(second); }), ); - - it.effect("keeps continuation compatible across instances with the same Claude HOME", () => - Effect.gen(function* () { - const path = yield* Path.Path; - const resolved = path.resolve(NodeOS.homedir()); - - expect(yield* makeClaudeContinuationGroupKey({ homePath: "" })).toBe( - `claude:home:${resolved}`, - ); - }), - ); }); }); diff --git a/apps/server/src/provider/Drivers/ClaudeHome.ts b/apps/server/src/provider/Drivers/ClaudeHome.ts index b3ef22b640cf..29be3ad2a8b4 100644 --- a/apps/server/src/provider/Drivers/ClaudeHome.ts +++ b/apps/server/src/provider/Drivers/ClaudeHome.ts @@ -6,12 +6,28 @@ import * as Path from "effect/Path"; import { expandHomePath } from "../../pathExpansion.ts"; +/** + * Resolve the Claude config directory the CLI would use: the instance's + * `homePath` (exported as `CLAUDE_CONFIG_DIR`), then an inherited + * `CLAUDE_CONFIG_DIR`, then Claude's default `~/.claude`. Empty must not + * fall back to bare `$HOME` — that leftover from the old HOME override + * produced a different continuation group than an explicit `~/.claude`. + */ export const resolveClaudeHomePath = Effect.fn("resolveClaudeHomePath")(function* ( config: Pick, + environment?: NodeJS.ProcessEnv, ): Effect.fn.Return { const path = yield* Path.Path; const homePath = config.homePath.trim(); - return path.resolve(homePath.length > 0 ? expandHomePath(homePath) : NodeOS.homedir()); + if (homePath.length > 0) { + return path.resolve(expandHomePath(homePath)); + } + // Inherited env vars are not shell-expanded, so a literal `~` stays literal. + const inherited = environment?.CLAUDE_CONFIG_DIR?.trim() ?? ""; + if (inherited.length > 0) { + return path.resolve(inherited); + } + return path.resolve(path.join(NodeOS.homedir(), ".claude")); }); export const makeClaudeEnvironment = Effect.fn("makeClaudeEnvironment")(function* ( @@ -35,8 +51,11 @@ export const makeClaudeEnvironment = Effect.fn("makeClaudeEnvironment")(function }); export const makeClaudeContinuationGroupKey = Effect.fn("makeClaudeContinuationGroupKey")( - function* (config: Pick): Effect.fn.Return { - const resolvedHomePath = yield* resolveClaudeHomePath(config); + function* ( + config: Pick, + environment?: NodeJS.ProcessEnv, + ): Effect.fn.Return { + const resolvedHomePath = yield* resolveClaudeHomePath(config, environment); return `claude:home:${resolvedHomePath}`; }, ); @@ -45,8 +64,9 @@ export const makeClaudeCapabilitiesCacheKey = Effect.fn("makeClaudeCapabilitiesC function* ( config: Pick, cwd?: string, + environment?: NodeJS.ProcessEnv, ): Effect.fn.Return { - const resolvedHomePath = yield* resolveClaudeHomePath(config); + const resolvedHomePath = yield* resolveClaudeHomePath(config, environment); return `${config.binaryPath}\0${resolvedHomePath}\0${cwd ?? ""}`; }, ); diff --git a/apps/server/src/provider/Drivers/CodexDriver.ts b/apps/server/src/provider/Drivers/CodexDriver.ts index 4581ff9a22ee..64b0d80e0690 100644 --- a/apps/server/src/provider/Drivers/CodexDriver.ts +++ b/apps/server/src/provider/Drivers/CodexDriver.ts @@ -143,18 +143,6 @@ export const CodexDriver: ProviderDriver = { env: processEnv, }); - // `makeCodexAdapter` and `makeCodexTextGeneration` have `never` error - // channels at construction time — their failure modes are all on the - // per-operation closures they return. No `mapError` wrapper is needed - // here; the registry only has to worry about snapshot-build and - // spawner-availability failures surfaced from `checkCodexProviderStatus` - // below. - const adapter = yield* makeCodexAdapter(effectiveConfig, { - instanceId, - environment: processEnv, - ...(eventLoggers.native ? { nativeEventLogger: eventLoggers.native } : {}), - }); - // Build a managed snapshot whose settings never change — mutations come // in as instance rebuilds from the registry rather than in-place // updates. Pre-provide `ChildProcessSpawner` so the check fits @@ -206,11 +194,20 @@ export const CodexDriver: ProviderDriver = { }), ), ); - const textGeneration = yield* makeCodexTextGeneration( - effectiveConfig, - processEnv, - snapshot.getSnapshot.pipe(Effect.map((value) => value.models)), - ); + const models = snapshot.getSnapshot.pipe(Effect.map((value) => value.models)); + // `makeCodexAdapter` and `makeCodexTextGeneration` have `never` error + // channels at construction time — their failure modes are all on the + // per-operation closures they return. No `mapError` wrapper is needed + // here; the registry only has to worry about snapshot-build and + // spawner-availability failures surfaced from `checkCodexProviderStatus` + // above. + const adapter = yield* makeCodexAdapter(effectiveConfig, { + instanceId, + environment: processEnv, + models, + ...(eventLoggers.native ? { nativeEventLogger: eventLoggers.native } : {}), + }); + const textGeneration = yield* makeCodexTextGeneration(effectiveConfig, processEnv, models); const snapshotForCwd = (cwd: string) => !effectiveConfig.enabled ? snapshot.getSnapshot diff --git a/apps/server/src/provider/Layers/CodexAdapter.test.ts b/apps/server/src/provider/Layers/CodexAdapter.test.ts index edb45b59586b..5b4dd10e1191 100644 --- a/apps/server/src/provider/Layers/CodexAdapter.test.ts +++ b/apps/server/src/provider/Layers/CodexAdapter.test.ts @@ -2381,6 +2381,7 @@ lifecycleLayer("CodexAdapterLive lifecycle", (it) => { method: "item/tool/requestUserInput", requestId: ApprovalRequestId.make("req-user-input-1"), payload: { + isBlocking: true, itemId: "item-user-input-1", threadId: "thread-1", turnId: "turn-1", diff --git a/apps/server/src/provider/Layers/CodexAdapter.ts b/apps/server/src/provider/Layers/CodexAdapter.ts index ef5394a6ae46..8139958cf3ad 100644 --- a/apps/server/src/provider/Layers/CodexAdapter.ts +++ b/apps/server/src/provider/Layers/CodexAdapter.ts @@ -22,6 +22,7 @@ import { type ToolActivityNativeAppReference, type ToolActivitySource, type ProviderUserInputAnswers, + type ServerProviderModel, RuntimeItemId, RuntimeRequestId, RuntimeTaskId, @@ -89,6 +90,8 @@ const PROVIDER = ProviderDriverKind.make("codex"); export interface CodexAdapterLiveOptions { readonly instanceId?: ProviderInstanceId; readonly environment?: NodeJS.ProcessEnv; + /** The provider's model list; supplies model display names for runtime info. */ + readonly models?: Effect.Effect>; readonly makeRuntime?: ( options: CodexSessionRuntimeOptions, ) => Effect.Effect< @@ -2277,6 +2280,7 @@ export const makeCodexAdapter = Effect.fn("makeCodexAdapter")(function* ( providerInstanceId: boundInstanceId, cwd: input.cwd ?? process.cwd(), binaryPath: codexConfig.binaryPath, + ...(options?.models ? { models: options.models } : {}), launchArgs: resolveCodexLaunchArgs(codexConfig.launchArgs, options?.environment), ...(options?.environment ? { environment: options.environment } : {}), ...(codexConfig.homePath ? { homePath: codexConfig.homePath } : {}), diff --git a/apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts b/apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts index acf13a2690f4..e9bf686469b4 100644 --- a/apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts +++ b/apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts @@ -9,6 +9,7 @@ */ // @effect-diagnostics nodeBuiltinImport:off import * as NodeFS from "node:fs"; +import * as NodeOS from "node:os"; import * as NodePath from "node:path"; import * as NodeServices from "@effect/platform-node/NodeServices"; @@ -862,3 +863,76 @@ describe("CodexSessionRuntime collab integration", () => { ); } }); + +describe("CodexSessionRuntime compaction", () => { + it.effect("restores T3 context after the root thread compacts", () => + Effect.gen(function* () { + const compacted = (threadId: string) => ({ + method: "item/completed", + params: { + threadId, + turnId: `${threadId}-turn`, + completedAtMs: 0, + item: { type: "contextCompaction", id: `compaction-${threadId}` }, + }, + }); + const script = { + rootThreadId: ROOT, + recordRequests: true, + // A child's compaction must not inject into the root thread. + notifications: [compacted(CHILD_A), compacted(ROOT)], + }; + // @effect-diagnostics-next-line preferSchemaOverJson:off + NodeFS.writeFileSync(scriptPath, JSON.stringify(script), "utf8"); + NodeFS.rmSync(`${scriptPath}.requests`, { force: true }); + yield* Effect.addFinalizer(() => + Effect.sync(() => { + NodeFS.rmSync(scriptPath, { force: true }); + NodeFS.rmSync(`${scriptPath}.requests`, { force: true }); + }), + ); + + const runtime = yield* makeCodexSessionRuntime({ + threadId: ThreadId.make("thread-compaction-context"), + binaryPath: peerPath, + cwd: NodeOS.tmpdir(), + runtimeMode: "full-access", + environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath }, + models: Effect.succeed([ + { slug: "gpt-5.6-sol", name: "GPT-5.6 Sol", isCustom: false, capabilities: null }, + ]), + }); + const completedFiber = yield* runtime.events.pipe( + Stream.filter((event) => event.method === "turn/completed"), + Stream.take(1), + Stream.runCollect, + Effect.forkScoped, + ); + + yield* runtime.start(); + yield* runtime.sendTurn({ input: "keep going", interactionMode: "default" }); + yield* Fiber.join(completedFiber); + + // The restore is awaited before later notifications, so it has landed. + const requests = readRecordedRequests(); + assert.lengthOf(requests, 1); + const [inject] = requests; + assert.isDefined(inject); + assert.equal(inject.method, "thread/inject_items"); + assert.equal(inject.params.threadId, ROOT); + const texts = ( + inject.params.items as ReadonlyArray<{ role: string; content: [{ text: string }] }> + ).map((item) => { + assert.equal(item.role, "developer"); + return item.content[0].text; + }); + assert.lengthOf(texts, 1); + assert.match( + texts[0] ?? "", + /^.*as GPT-5\.6 Sol \(model slug: gpt-5\.6-sol\).*<\/t3_code_runtime>$/s, + ); + + yield* runtime.close; + }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)), + ); +}); diff --git a/apps/server/src/provider/Layers/CodexProvider.test.ts b/apps/server/src/provider/Layers/CodexProvider.test.ts index 4287c94ecb08..9c5deda222d0 100644 --- a/apps/server/src/provider/Layers/CodexProvider.test.ts +++ b/apps/server/src/provider/Layers/CodexProvider.test.ts @@ -81,6 +81,11 @@ it("uses standard routing when the catalog has no default service tier", () => { name: "Fast", description: "1.5x speed, increased usage", }, + { + id: "ultrafast", + name: "Ultrafast", + description: "The fastest available responses for latency-sensitive work.", + }, ], supportedReasoningEfforts: [], }); @@ -97,6 +102,11 @@ it("uses standard routing when the catalog has no default service tier", () => { label: "Fast", description: "1.5x speed, increased usage", }, + { + id: "ultrafast", + label: "Ultrafast", + description: "Even faster, more expensive", + }, ], currentValue: "default", }, diff --git a/apps/server/src/provider/Layers/CodexProvider.ts b/apps/server/src/provider/Layers/CodexProvider.ts index 757284d07b6a..748163938eb1 100644 --- a/apps/server/src/provider/Layers/CodexProvider.ts +++ b/apps/server/src/provider/Layers/CodexProvider.ts @@ -89,6 +89,11 @@ const REASONING_EFFORT_LABELS: Readonly> = { const DEFAULT_SERVICE_TIER_ID = "default"; +/** Shorter copy for tiers whose catalog description wraps in the traits menu. */ +const SERVICE_TIER_DESCRIPTIONS: Readonly> = { + ultrafast: "Even faster, more expensive", +}; + function reasoningEffortLabel(reasoningEffort: string): string { return REASONING_EFFORT_LABELS[reasoningEffort] ?? reasoningEffort; } @@ -114,6 +119,8 @@ export function codexPlanLabel(planType: string | null | undefined): string | un return "ChatGPT Pro 20x Subscription"; case "prolite": return "ChatGPT Pro 5x Subscription"; + case "promax": + return "ChatGPT Pro Max Subscription"; case "team": return "ChatGPT Team Subscription"; case "self_serve_business_prolite": @@ -194,12 +201,15 @@ export function mapCodexModelCapabilities( label: "Standard", ...(defaultServiceTier === DEFAULT_SERVICE_TIER_ID ? { isDefault: true } : {}), }, - ...serviceTiers.map((tier) => ({ - id: tier.id, - label: tier.name, - ...(tier.description ? { description: tier.description } : {}), - ...(defaultServiceTier === tier.id ? { isDefault: true } : {}), - })), + ...serviceTiers.map((tier) => { + const description = SERVICE_TIER_DESCRIPTIONS[tier.id] ?? tier.description; + return { + id: tier.id, + label: tier.name, + ...(description ? { description } : {}), + ...(defaultServiceTier === tier.id ? { isDefault: true } : {}), + }; + }), ], currentValue: defaultServiceTier, }); @@ -440,7 +450,7 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun requestAllCodexModels(client), // Usage is an enrichment: a failure or a slow answer degrades to "no // usage this probe" rather than costing the account and models. - client.request("account/rateLimits/read", undefined).pipe( + client.request("account/rateLimits/read", null).pipe( Effect.map((response): CodexRateLimitsProbe => ({ snapshot: response.rateLimits, rateLimitsByLimitId: response.rateLimitsByLimitId, diff --git a/apps/server/src/provider/Layers/CodexSessionRuntime.test.ts b/apps/server/src/provider/Layers/CodexSessionRuntime.test.ts index 929db9814acc..93ec40c38222 100644 --- a/apps/server/src/provider/Layers/CodexSessionRuntime.test.ts +++ b/apps/server/src/provider/Layers/CodexSessionRuntime.test.ts @@ -9,7 +9,10 @@ import * as CodexErrors from "effect-codex-app-server/errors"; import * as CodexRpc from "effect-codex-app-server/rpc"; import * as EffectCodexSchema from "effect-codex-app-server/schema"; -import { buildCodexDeveloperInstructions } from "../CodexDeveloperInstructions.ts"; +import { + buildCodexAdditionalContext, + buildCodexDeveloperInstructions, +} from "../CodexDeveloperInstructions.ts"; import { codexSessionAppServerArgs } from "./codexLaunchArgs.ts"; import { buildTurnStartParams, @@ -18,10 +21,104 @@ import { isRecoverableThreadResumeError, makeMemoryConsolidationNotificationFilter, openCodexThread, + readCodexThread, + rollbackCodexThread, toMcpElicitationResponse, } from "./CodexSessionRuntime.ts"; const isCodexAppServerRequestError = Schema.is(CodexErrors.CodexAppServerRequestError); +describe("Codex thread history", () => { + for (const numTurns of [1, 2, 3, 5]) { + it.effect(`reverts ${numTurns} paginated turns at the durable boundary`, () => + Effect.gen(function* () { + let retained = ["turn-1", "turn-2", "turn-3"]; + const client: Parameters[0] = { + request: () => Effect.die("Legacy history API must not be used for paginated threads"), + raw: { + request: (method, params) => + Effect.sync(() => { + if (method === "thread/read") return { thread: { historyMode: "paginated" } }; + if (method === "thread/turns/list") { + const { cursor } = params as { cursor: string | null }; + const start = cursor === null ? 0 : Number(cursor); + const ids = retained.slice(start, start + 2); + return { + data: ids.map((id) => ({ id, items: [], status: "completed" })), + nextCursor: start + 2 < retained.length ? String(start + 2) : null, + }; + } + NodeAssert.equal(method, "thread/revert"); + const { beforeTurnId } = params as { beforeTurnId: string }; + retained = retained.slice(0, retained.indexOf(beforeTurnId)); + return { thread: { id: "thread-1", turns: [] } }; + }), + }, + }; + const result = yield* rollbackCodexThread(client, "thread-1", numTurns); + const expected = ["turn-1", "turn-2", "turn-3"].slice(0, Math.max(0, 3 - numTurns)); + NodeAssert.deepEqual( + result.turns.map((turn) => turn.id), + expected, + ); + NodeAssert.deepEqual( + (yield* readCodexThread(client, "thread-1")).turns.map((turn) => turn.id), + expected, + ); + }), + ); + } + + for (const cursors of [ + ["next", "next"], + ["first", "second", "first"], + ]) { + it.effect(`rejects a pagination cursor cycle: ${cursors.join(", ")}`, () => + Effect.gen(function* () { + let pageCount = 0; + const client: Parameters[0] = { + request: () => Effect.die("Unexpected legacy request"), + raw: { + request: (method) => + Effect.sync(() => { + if (method === "thread/read") return { thread: { historyMode: "paginated" } }; + NodeAssert.ok(pageCount < cursors.length, "Repeated cursor was requested"); + return { data: [], nextCursor: cursors[pageCount++] }; + }), + }, + }; + const error = yield* Effect.flip(readCodexThread(client, "thread-1")); + NodeAssert.ok(isCodexAppServerRequestError(error)); + NodeAssert.equal(pageCount, cursors.length); + }), + ); + } + + it.effect("surfaces Codex rejecting a revert of a legacy thread", () => + Effect.gen(function* () { + const rejection = CodexErrors.CodexAppServerRequestError.invalidRequest( + "thread/revert only supports paginated threads", + ); + const client: Parameters[0] = { + raw: { + request: (method) => { + if (method === "thread/read") return Effect.succeed({ thread: {} }); + if (method === "thread/revert") return Effect.fail(rejection); + return Effect.die(`Unexpected raw request: ${method}`); + }, + }, + request: (method: M) => { + NodeAssert.equal(method, "thread/read"); + return Effect.succeed({ + thread: { id: "legacy-thread", turns: [{ id: "turn-1", items: [] }] }, + } as unknown as CodexRpc.ClientRequestResponsesByMethod[M]); + }, + }; + const error = yield* Effect.flip(rollbackCodexThread(client, "legacy-thread", 1)); + NodeAssert.strictEqual(error, rejection); + }), + ); +}); + describe("CodexSessionRuntimeIdentifierGenerationError", () => { it("retains identifier purpose and the random source failure", () => { const cause = new Error("random source unavailable"); @@ -121,12 +218,13 @@ describe("buildTurnStartParams", () => { settings: { model: "gpt-5.3-codex", reasoning_effort: "medium", - developer_instructions: buildCodexDeveloperInstructions("plan", { - model: "gpt-5.3-codex", - reasoningEffort: "medium", - }), + developer_instructions: buildCodexDeveloperInstructions("plan"), }, }, + additionalContext: buildCodexAdditionalContext({ + model: "gpt-5.3-codex", + reasoningEffort: "medium", + }), }); }); @@ -170,12 +268,13 @@ describe("buildTurnStartParams", () => { settings: { model: "gpt-5.3-codex", reasoning_effort: "medium", - developer_instructions: buildCodexDeveloperInstructions("default", { - model: "gpt-5.3-codex", - reasoningEffort: "medium", - }), + developer_instructions: buildCodexDeveloperInstructions("default"), }, }, + additionalContext: buildCodexAdditionalContext({ + model: "gpt-5.3-codex", + reasoningEffort: "medium", + }), }); }); @@ -192,9 +291,29 @@ describe("buildTurnStartParams", () => { const settings = params.collaborationMode?.settings; NodeAssert.equal(settings?.model, DEFAULT_MODEL); NodeAssert.equal(settings?.reasoning_effort, "medium"); - NodeAssert.ok(settings?.developer_instructions?.includes(`as ${DEFAULT_MODEL} with medium`)); + NodeAssert.ok( + params.additionalContext?.t3_code_runtime?.value.includes(`as ${DEFAULT_MODEL} with medium`), + ); }); + it.effect("names the model by display name and slug in the runtime context", () => + Effect.gen(function* () { + const params = yield* buildTurnStartParams({ + threadId: "provider-thread-1", + runtimeMode: "full-access", + model: "gpt-5.3-codex", + modelName: "GPT-5.3-Codex", + effort: "high", + interactionMode: "plan", + }); + + NodeAssert.match( + params.additionalContext?.t3_code_runtime?.value ?? "", + /as GPT-5\.3-Codex \(model slug: gpt-5\.3-codex\) with high reasoning effort/, + ); + }), + ); + it.effect("routes approvals to the auto reviewer in auto mode", () => Effect.gen(function* () { const params = yield* buildTurnStartParams({ @@ -449,99 +568,74 @@ describe("Codex MCP elicitation approvals", () => { }); describe("buildCodexDeveloperInstructions", () => { - it("appends runtime info after the mode instructions", () => { - const instructions = buildCodexDeveloperInstructions("default", { - model: "gpt-5.3-codex", - reasoningEffort: "high", - }); - - NodeAssert.match(instructions, /^# Collaboration Mode: Default/); - NodeAssert.match(instructions, /T3 Code/); - NodeAssert.match(instructions, /Codex harness/); - NodeAssert.match(instructions, /as gpt-5\.3-codex with high reasoning effort/); - }); - - it("describes Markdown media support in the runtime context in both modes", () => { + it("keeps T3 context out of the mode prompt, which the model catalog can replace", () => { for (const mode of ["default", "plan"] as const) { - const instructions = buildCodexDeveloperInstructions(mode, { - model: "gpt-5.3-codex", - reasoningEffort: "high", - }); - NodeAssert.match( - instructions, - /.*embed images and videos.*Markdown.*<\/runtime_info>/, - ); + const instructions = buildCodexDeveloperInstructions(mode); + NodeAssert.match(instructions, /^[\s\S]*<\/collaboration_mode>$/); + NodeAssert.doesNotMatch(instructions, /runtime_info|pull_request_linking|preview_|device_/); } }); +}); - it("includes runtime info alongside plan mode instructions", () => { - const instructions = buildCodexDeveloperInstructions("plan", { - model: "gpt-5.3-codex", - reasoningEffort: "medium", - }); +describe("buildCodexAdditionalContext", () => { + const runtime = { model: "gpt-5.3-codex", reasoningEffort: "high" }; + const runtimeValue = (context: ReturnType) => + context.t3_code_runtime?.value ?? ""; + + it("describes the harness, model, effort, and Markdown media support", () => { + const context = buildCodexAdditionalContext(runtime); - NodeAssert.match(instructions, /^# Plan Mode/); - NodeAssert.match(instructions, /as gpt-5\.3-codex with medium reasoning effort/); + NodeAssert.equal(context.t3_code_runtime?.kind, "application"); + NodeAssert.match( + runtimeValue(context), + /.*Codex harness, as gpt-5\.3-codex with high reasoning effort.*embed images and videos.*Markdown.*<\/runtime_info>/, + ); }); it("varies with the model and effort of each turn", () => { - const first = buildCodexDeveloperInstructions("default", { - model: "gpt-5.3-codex", - reasoningEffort: "medium", - }); - const second = buildCodexDeveloperInstructions("default", { - model: "gpt-5.4", - reasoningEffort: "high", - }); - - NodeAssert.notEqual(first, second); + NodeAssert.notEqual( + runtimeValue( + buildCodexAdditionalContext({ model: "gpt-5.3-codex", reasoningEffort: "medium" }), + ), + runtimeValue(buildCodexAdditionalContext({ model: "gpt-5.4", reasoningEffort: "high" })), + ); }); it("flattens multiline metadata into single-line runtime info", () => { - const instructions = buildCodexDeveloperInstructions("default", { - model: "gpt\n5.3\ncodex", - reasoningEffort: " high\neffort ", - }); + const value = runtimeValue( + buildCodexAdditionalContext({ model: "gpt\n5.3\ncodex", reasoningEffort: " high\neffort " }), + ); - NodeAssert.match(instructions, /as gpt 5\.3 codex with high effort reasoning effort/); - NodeAssert.doesNotMatch(instructions, /[^<]*\n/); + NodeAssert.match(value, /as gpt 5\.3 codex with high effort reasoning effort/); + NodeAssert.doesNotMatch(value, /[^<]*\n/); }); -}); -describe("T3 browser developer instructions", () => { - const runtime = { model: "gpt-5.3-codex", reasoningEffort: "high" }; - - it("prefers the product-native preview tools in both collaboration modes", () => { - for (const mode of ["default", "plan"] as const) { - const instructions = buildCodexDeveloperInstructions(mode, runtime, true); - NodeAssert.match(instructions, /t3-code/); - NodeAssert.match(instructions, /preview_status/); - NodeAssert.match(instructions, /preview_open/); - NodeAssert.match(instructions, /Do not switch to global browser skills/); + it("keeps every entry under Codex's 1,000 token cap per entry", () => { + const context = buildCodexAdditionalContext(runtime, true); + for (const entry of Object.values(context)) { + // Codex estimates 4 bytes per token and truncates the middle of longer values. + NodeAssert.ok(Buffer.byteLength(entry.value) < 4_000); } }); +}); - it("omits the browser block entirely when the preview tools are not attached", () => { - for (const mode of ["default", "plan"] as const) { - const instructions = buildCodexDeveloperInstructions(mode, runtime, false); - NodeAssert.doesNotMatch(instructions, /preview_status/); - NodeAssert.doesNotMatch(instructions, /preview_open/); - NodeAssert.doesNotMatch(instructions, /T3 Code collaborative browser/); - // Steering away from other browser automation must go with the tools; - // keeping it would leave the model talked out of its only option. - NodeAssert.doesNotMatch(instructions, /Do not switch to global browser skills/); - // The rest of the collaboration mode is untouched. - NodeAssert.match(instructions, //); - NodeAssert.match(instructions, /<\/collaboration_mode>/); - } +describe("T3 tool instructions", () => { + const runtime = { model: "gpt-5.3-codex", reasoningEffort: "high" }; + + it("prefers the product-native preview tools when they are attached", () => { + const tools = buildCodexAdditionalContext(runtime, true).t3_code_tools?.value ?? ""; + NodeAssert.match(tools, /t3-code/); + NodeAssert.match(tools, /preview_status/); + NodeAssert.match(tools, /preview_open/); + NodeAssert.match(tools, /Do not switch to global browser skills/); + NodeAssert.doesNotMatch(tools, /device_open/); }); - it("tracks the turn's MCP configuration rather than defaulting to on", () => { - NodeAssert.match(buildCodexDeveloperInstructions("default", runtime, true), /preview_open/); - NodeAssert.doesNotMatch( - buildCodexDeveloperInstructions("default", runtime, false), - /preview_open/, - ); + it("omits the tool entry entirely when no tools are attached", () => { + // Steering away from other browser automation must go with the tools; + // keeping it would leave the model talked out of its only option. + const context = buildCodexAdditionalContext(runtime, false); + NodeAssert.deepStrictEqual(Object.keys(context), ["t3_code_runtime"]); }); }); @@ -572,6 +666,7 @@ function makeThreadStartedNotification( id: threadId, modelProvider: "openai", preview: "", + projectId: null, sessionId: threadId, source, status: { type: "idle" as const }, diff --git a/apps/server/src/provider/Layers/CodexSessionRuntime.ts b/apps/server/src/provider/Layers/CodexSessionRuntime.ts index 17f0f2976615..c9e70eda84e9 100644 --- a/apps/server/src/provider/Layers/CodexSessionRuntime.ts +++ b/apps/server/src/provider/Layers/CodexSessionRuntime.ts @@ -14,6 +14,7 @@ import { type ProviderTurnStartResult, type ProviderUserInputAnswers, RuntimeMode, + type ServerProviderModel, ThreadId, TurnId, } from "@t3tools/contracts"; @@ -39,7 +40,10 @@ import * as EffectCodexSchema from "effect-codex-app-server/schema"; import { buildCodexInitializeParams } from "./CodexProvider.ts"; import { codexSessionAppServerArgs } from "./codexLaunchArgs.ts"; import { expandHomePath } from "../../pathExpansion.ts"; -import { buildCodexDeveloperInstructions } from "../CodexDeveloperInstructions.ts"; +import { + buildCodexAdditionalContext, + buildCodexDeveloperInstructions, +} from "../CodexDeveloperInstructions.ts"; const decodeV2TurnStartResponse = Schema.decodeUnknownEffect(EffectCodexSchema.V2TurnStartResponse); const PROVIDER = ProviderDriverKind.make("codex"); @@ -106,7 +110,7 @@ const McpElicitationFormField = Schema.Struct({ type: Schema.optionalKey(NullableMcpElicitationString), title: Schema.optionalKey(NullableMcpElicitationString), description: Schema.optionalKey(NullableMcpElicitationString), - default: Schema.optionalKey(Schema.Unknown), + default: Schema.optionalKey(Schema.Json), enum: Schema.optionalKey(Schema.NullOr(Schema.Array(Schema.String))), enumNames: Schema.optionalKey(Schema.NullOr(Schema.Array(Schema.String))), oneOf: Schema.optionalKey( @@ -128,10 +132,13 @@ const isMcpElicitationMetadata = Schema.is(McpElicitationMetadata); const isMcpElicitationForm = Schema.is(McpElicitationForm); // TODO: Verify `packages/effect-codex-app-server/scripts/generate.ts` so the generated -// `V2TurnStartParams` schema includes `collaborationMode` directly. +// `V2TurnStartParams` schema includes its experimental fields directly. const CodexTurnStartParamsWithCollaborationMode = EffectCodexSchema.V2TurnStartParams.pipe( Schema.fieldsAssign({ collaborationMode: Schema.optionalKey(EffectCodexSchema.V2TurnStartParams__CollaborationMode), + additionalContext: Schema.optionalKey( + Schema.Record(Schema.String, EffectCodexSchema.V2TurnStartParams__AdditionalContextEntry), + ), }), ); const decodeCodexTurnStartParamsWithCollaborationMode = Schema.decodeUnknownEffect( @@ -150,8 +157,7 @@ export type CodexTurnStartParamsWithCollaborationMode = export type CodexResumeCursor = typeof CodexResumeCursorSchema.Type; type CodexServiceTier = NonNullable; type CodexThreadItem = - | EffectCodexSchema.V2ThreadReadResponse["thread"]["turns"][number]["items"][number] - | EffectCodexSchema.V2ThreadRollbackResponse["thread"]["turns"][number]["items"][number]; + EffectCodexSchema.V2ThreadReadResponse["thread"]["turns"][number]["items"][number]; export interface CodexSessionRuntimeOptions { readonly threadId: ThreadId; @@ -166,6 +172,8 @@ export interface CodexSessionRuntimeOptions { readonly serviceTier?: CodexServiceTier | undefined; readonly resumeCursor?: CodexResumeCursor; readonly appServerArgs?: ReadonlyArray; + /** The provider's model list; supplies the display name for runtime info. */ + readonly models?: Effect.Effect>; } export interface CodexSessionRuntimeSendTurnInput { @@ -427,7 +435,7 @@ export function toMcpElicitationResponse( ? "always" : undefined; const form = mcpElicitationFormFields(payload); - const content: Record = {}; + const content: Record = {}; for (const [key, field] of Object.entries(form?.properties ?? {})) { const options = mcpElicitationFieldOptions(field); @@ -565,28 +573,31 @@ function runtimeModeToTurnSandboxPolicy( } } -function buildCodexCollaborationMode(input: { +function buildCodexTurnInstructions(input: { readonly interactionMode?: ProviderInteractionMode; readonly model?: string; + readonly modelName?: string; readonly effort?: EffectCodexSchema.V2TurnStartParams__ReasoningEffort; readonly browserToolsAvailable?: boolean; -}): EffectCodexSchema.V2TurnStartParams__CollaborationMode | undefined { +}): Pick { if (input.interactionMode === undefined) { - return undefined; + return {}; } const model = normalizeCodexModelSlug(input.model) ?? DEFAULT_MODEL; const reasoningEffort = input.effort ?? "medium"; return { - mode: input.interactionMode, - settings: { - model, - reasoning_effort: reasoningEffort, - developer_instructions: buildCodexDeveloperInstructions( - input.interactionMode, - { model, reasoningEffort }, - input.browserToolsAvailable ?? true, - ), + collaborationMode: { + mode: input.interactionMode, + settings: { + model, + reasoning_effort: reasoningEffort, + developer_instructions: buildCodexDeveloperInstructions(input.interactionMode), + }, }, + additionalContext: buildCodexAdditionalContext( + { model, modelName: input.modelName, reasoningEffort }, + input.browserToolsAvailable ?? true, + ), }; } @@ -599,6 +610,8 @@ export function buildTurnStartParams(input: { readonly path: string; }>; readonly model?: string; + /** Display name of `model`, for runtime info. */ + readonly modelName?: string; readonly serviceTier?: CodexServiceTier; readonly effort?: EffectCodexSchema.V2TurnStartParams__ReasoningEffort; readonly interactionMode?: ProviderInteractionMode; @@ -620,9 +633,10 @@ export function buildTurnStartParams(input: { } const config = runtimeModeToThreadConfig(input.runtimeMode); - const collaborationMode = buildCodexCollaborationMode({ + const turnInstructions = buildCodexTurnInstructions({ ...(input.interactionMode ? { interactionMode: input.interactionMode } : {}), ...(input.model ? { model: input.model } : {}), + ...(input.modelName ? { modelName: input.modelName } : {}), ...(input.effort ? { effort: input.effort } : {}), browserToolsAvailable: input.browserToolsAvailable ?? true, }); @@ -636,7 +650,7 @@ export function buildTurnStartParams(input: { ...(input.model ? { model: input.model } : {}), ...(input.serviceTier ? { serviceTier: input.serviceTier } : {}), ...(input.effort ? { effort: input.effort } : {}), - ...(collaborationMode ? { collaborationMode } : {}), + ...turnInstructions, }).pipe( Effect.mapError((cause) => CodexErrors.CodexAppServerProtocolParseError.fromSchemaError( @@ -1166,7 +1180,7 @@ function updateSession( } function parseThreadSnapshot( - response: EffectCodexSchema.V2ThreadReadResponse | EffectCodexSchema.V2ThreadRollbackResponse, + response: EffectCodexSchema.V2ThreadReadResponse, ): CodexThreadSnapshot { return { threadId: response.thread.id, @@ -1177,6 +1191,94 @@ function parseThreadSnapshot( }; } +const CodexThreadHistoryMetadata = Schema.Struct({ + thread: Schema.Struct({ + historyMode: Schema.optionalKey(Schema.Literals(["legacy", "paginated"])), + }), +}); +const CodexTurnsPage = Schema.Struct({ + data: Schema.Array(EffectCodexSchema.V2ThreadReadResponse__Turn), + nextCursor: Schema.NullOr(Schema.String), +}); +const decodeCodexHistoryMetadata = Schema.decodeUnknownEffect(CodexThreadHistoryMetadata); +const decodeCodexTurnsPage = Schema.decodeUnknownEffect(CodexTurnsPage); +type CodexHistoryClient = { + readonly raw: Pick; + readonly request: CodexClient.CodexAppServerClient["Service"]["request"]; +}; + +const readCodexHistoryMode = Effect.fn("readCodexHistoryMode")(function* ( + client: CodexHistoryClient, + threadId: string, +) { + const response = yield* client.raw.request("thread/read", { threadId, includeTurns: false }); + const metadata = yield* decodeCodexHistoryMetadata(response).pipe( + Effect.mapError((error) => + CodexErrors.CodexAppServerRequestError.invalidPayload("thread/read", "decode-payload", error), + ), + ); + return metadata.thread.historyMode; +}); + +export const readCodexThread = Effect.fn("readCodexThread")(function* ( + client: CodexHistoryClient, + threadId: string, +): Effect.fn.Return { + if ((yield* readCodexHistoryMode(client, threadId)) !== "paginated") { + return parseThreadSnapshot( + yield* client.request("thread/read", { threadId, includeTurns: true }), + ); + } + const turns: Array = []; + const requestedCursors = new Set(); + let cursor: string | null = null; + do { + if (requestedCursors.has(cursor)) { + return yield* CodexErrors.CodexAppServerRequestError.internalError( + "Thread history pagination repeated a cursor.", + undefined, + { method: "thread/turns/list", operation: "decode-payload" }, + ); + } + requestedCursors.add(cursor); + const response: unknown = yield* client.raw.request("thread/turns/list", { + threadId, + cursor, + limit: 100, + sortDirection: "asc", + itemsView: "full", + }); + const page = yield* decodeCodexTurnsPage(response).pipe( + Effect.mapError((error) => + CodexErrors.CodexAppServerRequestError.invalidPayload( + "thread/turns/list", + "decode-payload", + error, + ), + ), + ); + turns.push(...page.data.map((turn) => ({ id: TurnId.make(turn.id), items: turn.items }))); + cursor = page.nextCursor; + } while (cursor !== null); + return { threadId, turns }; +}); + +export const rollbackCodexThread = Effect.fn("rollbackCodexThread")(function* ( + client: CodexHistoryClient, + threadId: string, + numTurns: number, +): Effect.fn.Return { + // Codex replaces history at a turn boundary. It rejects threads that still + // use legacy history, which have no rollback API since Codex 0.156. + const snapshot = yield* readCodexThread(client, threadId); + const retainedCount = Math.max(0, snapshot.turns.length - numTurns); + const firstRemoved = snapshot.turns[retainedCount]; + if (firstRemoved) { + yield* client.raw.request("thread/revert", { threadId, beforeTurnId: firstRemoved.id }); + } + return { threadId, turns: snapshot.turns.slice(0, retainedCount) }; +}); + export const makeCodexSessionRuntime = ( options: CodexSessionRuntimeOptions, ): Effect.Effect< @@ -1199,6 +1301,9 @@ export const makeCodexSessionRuntime = ( const collabChildLiveTurnsRef = yield* Ref.make(new Map()); const suppressMemoryConsolidationNotification = makeMemoryConsolidationNotificationFilter(); const closedRef = yield* Ref.make(false); + /** The `additionalContext` of the latest `turn/start`, restored after compaction. */ + const lastAdditionalContextRef = + yield* Ref.make(undefined); // `~` is not shell-expanded when env vars are set via // `child_process.spawn`; `expandHomePath` lets a configured @@ -1750,6 +1855,35 @@ export const makeCodexSessionRuntime = ( } }); + /** + * Compaction rebuilds history from user messages and Codex's own context, + * which drops our `additionalContext` messages. Codex only resends an + * entry when its value changes, so without this the T3 context would stay + * lost until the model or effort changed. Awaited so the context is back + * before later notifications from the same turn are handled. Drop this if + * Codex enables its `retain_client_developer_messages` feature by default. + */ + const restoreAdditionalContext = (threadId: string) => + Effect.gen(function* () { + const context = yield* Ref.get(lastAdditionalContextRef); + if (!context) return; + yield* client.request("thread/inject_items", { + threadId, + items: Object.entries(context).map(([key, entry]) => ({ + type: "message", + role: "developer", + content: [{ type: "input_text", text: `<${key}>${entry.value}` }], + })), + }); + }).pipe( + Effect.timeout("10 seconds"), + Effect.catch((cause) => + Effect.logWarning("Failed to restore Codex additional context after compaction.", { + cause, + }), + ), + ); + const handleRawNotification = (notification: CodexServerNotification) => Effect.gen(function* () { const isMemoryConsolidationNotification = @@ -1836,6 +1970,14 @@ export const makeCodexSessionRuntime = ( return; } + if ( + notification.method === "item/completed" && + notification.params.item.type === "contextCompaction" && + notification.params.threadId === suppressRootId + ) { + yield* restoreAdditionalContext(notification.params.threadId); + } + let requestId: ApprovalRequestId | undefined; let requestKind: ProviderRequestKind | undefined; let turnId = childParentTurnId ?? route.turnId; @@ -2403,12 +2545,15 @@ export const makeCodexSessionRuntime = ( const normalizedModel = normalizeCodexModelSlug( input.model ?? (yield* Ref.get(sessionRef)).model, ); + const models = options.models ? yield* options.models : []; + const modelName = models.find((model) => model.slug === normalizedModel)?.name; const params = yield* buildTurnStartParams({ threadId: providerThreadId, runtimeMode: options.runtimeMode, ...(input.input ? { prompt: input.input } : {}), ...(input.attachments ? { attachments: input.attachments } : {}), ...(normalizedModel ? { model: normalizedModel } : {}), + ...(modelName ? { modelName } : {}), ...(input.serviceTier ? { serviceTier: input.serviceTier } : {}), ...(input.effort ? { effort: input.effort } : {}), ...(input.interactionMode ? { interactionMode: input.interactionMode } : {}), @@ -2417,6 +2562,7 @@ export const makeCodexSessionRuntime = ( // has even if the setting changed after the session started. browserToolsAvailable: hasConfiguredMcpServer(options.appServerArgs), }); + yield* Ref.set(lastAdditionalContextRef, params.additionalContext); const rawResponse = yield* client.raw.request("turn/start", params); const response = yield* decodeV2TurnStartResponse(rawResponse).pipe( Effect.mapError((error) => @@ -2490,24 +2636,17 @@ export const makeCodexSessionRuntime = ( }), readThread: Effect.gen(function* () { const providerThreadId = yield* readProviderThreadId; - const response = yield* client.request("thread/read", { - threadId: providerThreadId, - includeTurns: true, - }); - return parseThreadSnapshot(response); + return yield* readCodexThread(client, providerThreadId); }), rollbackThread: (numTurns) => Effect.gen(function* () { const providerThreadId = yield* readProviderThreadId; - const response = yield* client.request("thread/rollback", { - threadId: providerThreadId, - numTurns, - }); + const snapshot = yield* rollbackCodexThread(client, providerThreadId, numTurns); yield* updateSession(sessionRef, { status: "ready", activeTurnId: undefined, }); - return parseThreadSnapshot(response); + return snapshot; }), uploadFeedback: (reason) => Effect.gen(function* () { diff --git a/apps/server/src/provider/Layers/CursorAdapter.test.ts b/apps/server/src/provider/Layers/CursorAdapter.test.ts index 9955e6512425..7c6a75031cf7 100644 --- a/apps/server/src/provider/Layers/CursorAdapter.test.ts +++ b/apps/server/src/provider/Layers/CursorAdapter.test.ts @@ -26,6 +26,7 @@ import { } from "@t3tools/contracts"; import { ServerConfig } from "../../config.ts"; +import { writeFakeCli } from "../../testUtils/fakeCli.ts"; import { buildRuntimeInstructions } from "../RuntimeInstructions.ts"; import { ServerSettingsService } from "../../serverSettings.ts"; import type { CursorAdapterShape } from "../Services/CursorAdapter.ts"; @@ -526,6 +527,49 @@ cursorAdapterTestLayer("CursorAdapterLive", (it) => { }), ); + it.effect("surfaces cursor-agent cli.json schema stderr instead of a closed-session error", () => + Effect.gen(function* () { + const adapter = yield* CursorAdapter; + const settings = yield* ServerSettingsService; + const workspace = yield* Effect.promise(() => + NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "cursor-cli-json-")), + ); + const wrapperPath = writeFakeCli({ + directory: workspace, + name: "fake-cursor-agent", + source: [ + "process.stderr.write(`Invalid project config at ${process.cwd()}/.cursor/cli.json: schema validation failed. [`", + " + JSON.stringify({", + ' code: "unrecognized_keys",', + ' keys: ["approvalMode", "sandbox"],', + " path: [],", + " message: \"Unrecognized key(s) in object: 'approvalMode', 'sandbox'\",", + ' }) + "]\\n");', + "process.exit(1);", + ].join("\n"), + }); + yield* settings.updateSettings({ providers: { cursor: { binaryPath: wrapperPath } } }); + + const error = yield* adapter + .startSession({ + threadId: ThreadId.make("cursor-cli-json-schema"), + provider: ProviderDriverKind.make("cursor"), + cwd: workspace, + runtimeMode: "full-access", + }) + .pipe(Effect.flip); + + assert.equal(error._tag, "ProviderAdapterProcessError"); + assert.include(error.message, "cli.json"); + assert.include(error.message, "Unrecognized key"); + assert.notInclude(error.message, "adapter thread is closed"); + if (error._tag === "ProviderAdapterProcessError") { + assert.include(error.detail, "approvalMode"); + assert.include(error.detail, "sandbox"); + } + }), + ); + it.effect("maps app plan mode onto the ACP plan session mode", () => Effect.gen(function* () { const adapter = yield* CursorAdapter; diff --git a/apps/server/src/provider/RuntimeInstructions.test.ts b/apps/server/src/provider/RuntimeInstructions.test.ts index 350d8c73c150..cea3427051a1 100644 --- a/apps/server/src/provider/RuntimeInstructions.test.ts +++ b/apps/server/src/provider/RuntimeInstructions.test.ts @@ -23,6 +23,15 @@ describe("buildRuntimeInstructions", () => { ).toContain("through the Codex harness, as custom model with high reasoning effort."); }); + it("names the model by display name and slug when they differ", () => { + expect( + buildRuntimeInstructions({ harness: "Codex", model: "gpt-5.4", modelName: "GPT-5.4" }), + ).toContain("through the Codex harness, as GPT-5.4 (model slug: gpt-5.4)."); + expect( + buildRuntimeInstructions({ harness: "Codex", model: "my-model", modelName: "my-model" }), + ).toContain("through the Codex harness, as my-model."); + }); + it.each([undefined, "", "auto", "default"])("omits unresolved model %s", (model) => { const instructions = buildRuntimeInstructions({ harness: "Cursor", model }); expect(instructions).toContain("through the Cursor harness."); diff --git a/apps/server/src/provider/RuntimeInstructions.ts b/apps/server/src/provider/RuntimeInstructions.ts index 102c49c78a9e..1ce4f8168773 100644 --- a/apps/server/src/provider/RuntimeInstructions.ts +++ b/apps/server/src/provider/RuntimeInstructions.ts @@ -1,13 +1,20 @@ -/** Shared runtime context; omit model and effort when the harness manages them dynamically. */ +/** + * Shared runtime context; omit model and effort when the harness manages them dynamically. + * `modelName` is the display name users see in the model picker; `model` is the slug. + */ export function buildRuntimeInstructions(runtime: { readonly harness: string; readonly model?: string | undefined; + readonly modelName?: string | undefined; readonly reasoningEffort?: string | undefined; }): string { const harness = toSingleLine(runtime.harness); const model = toSingleLine(runtime.model ?? ""); + const modelName = toSingleLine(runtime.modelName ?? ""); const effort = toSingleLine(runtime.reasoningEffort ?? ""); - const modelInfo = model && model !== "auto" && model !== "default" ? `, as ${model}` : ""; + const modelLabel = + modelName && modelName !== model ? `${modelName} (model slug: ${model})` : model; + const modelInfo = model && model !== "auto" && model !== "default" ? `, as ${modelLabel}` : ""; const effortInfo = effort ? ` with ${effort} reasoning effort` : ""; return `In case you're asked: you are running in T3 Code through the ${harness} harness${modelInfo}${effortInfo}. No need to mention this otherwise. You can embed images and videos in your response using Markdown with absolute file paths.`; } diff --git a/apps/server/src/provider/acp/AcpAdapterSupport.test.ts b/apps/server/src/provider/acp/AcpAdapterSupport.test.ts index 0aebe0ca6d82..60f971edb499 100644 --- a/apps/server/src/provider/acp/AcpAdapterSupport.test.ts +++ b/apps/server/src/provider/acp/AcpAdapterSupport.test.ts @@ -25,4 +25,40 @@ describe("AcpAdapterSupport", () => { expect(error._tag).toBe("ProviderAdapterRequestError"); expect(error.message).toContain("Invalid params"); }); + + it("maps ACP process exits without stderr to a process error instead of a closed session", () => { + const error = mapAcpToAdapterError( + ProviderDriverKind.make("cursor"), + "thread-1" as never, + "session/start", + new EffectAcpErrors.AcpProcessExitedError({ code: 1 }), + ); + + expect(error._tag).toBe("ProviderAdapterProcessError"); + expect(error.message).not.toContain("adapter thread is closed"); + if (error._tag === "ProviderAdapterProcessError") { + expect(error.detail).toBe("ACP process exited with code 1"); + } + }); + + it("maps ACP process exits to a process error whose detail includes stderr", () => { + const error = mapAcpToAdapterError( + ProviderDriverKind.make("cursor"), + "thread-1" as never, + "session/start", + new EffectAcpErrors.AcpProcessExitedError({ + code: 1, + stderr: + "Invalid project config at ~/.cursor/cli.json: schema validation failed. Unrecognized key(s): 'approvalMode', 'sandbox'", + }), + ); + + expect(error._tag).toBe("ProviderAdapterProcessError"); + expect(error.message).toContain("cli.json"); + expect(error.message).toContain("Unrecognized key"); + expect(error.message).not.toContain("adapter thread is closed"); + if (error._tag === "ProviderAdapterProcessError") { + expect(error.detail).toContain("Unrecognized key(s): 'approvalMode', 'sandbox'"); + } + }); }); diff --git a/apps/server/src/provider/acp/AcpAdapterSupport.ts b/apps/server/src/provider/acp/AcpAdapterSupport.ts index cde110e6dd99..b90ce88e83dc 100644 --- a/apps/server/src/provider/acp/AcpAdapterSupport.ts +++ b/apps/server/src/provider/acp/AcpAdapterSupport.ts @@ -7,8 +7,8 @@ import * as Schema from "effect/Schema"; import * as EffectAcpErrors from "effect-acp/errors"; import { + ProviderAdapterProcessError, ProviderAdapterRequestError, - ProviderAdapterSessionClosedError, type ProviderAdapterError, } from "../Errors.ts"; const isAcpProcessExitedError = Schema.is(EffectAcpErrors.AcpProcessExitedError); @@ -21,9 +21,10 @@ export function mapAcpToAdapterError( error: EffectAcpErrors.AcpError, ): ProviderAdapterError { if (isAcpProcessExitedError(error)) { - return new ProviderAdapterSessionClosedError({ + return new ProviderAdapterProcessError({ provider, threadId, + detail: error.message, cause: error, }); } diff --git a/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts b/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts index 57323e2675e0..45a5cadb9a31 100644 --- a/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts +++ b/apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts @@ -368,6 +368,26 @@ describe("AcpSessionRuntime", () => { }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)), ); + it.effect("attaches child stderr when the ACP process exits before initialize", () => + Effect.gen(function* () { + const runtime = yield* AcpSessionRuntime.make({ + ...mockRuntimeOptions, + spawn: { + command: process.execPath, + args: [ + "-e", + "process.stderr.write(\"Invalid project config at /tmp/project/.cursor/cli.json: schema validation failed. Unrecognized key(s): 'approvalMode', 'sandbox'\\n\"); process.exit(1);", + ], + }, + }); + const error = yield* runtime.start().pipe(Effect.flip); + expect(error._tag).toBe("AcpProcessExitedError"); + expect(error.message).toContain("cli.json"); + expect(error.message).toContain("Unrecognized key"); + expect(error.message).not.toContain("ACP process exited with code 1\nACP process exited"); + }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)), + ); + it.effect("drains large stderr output and keeps auth-sized logging chunks", () => Effect.gen(function* () { const lengths: Array = []; diff --git a/apps/server/src/provider/acp/AcpSessionRuntime.ts b/apps/server/src/provider/acp/AcpSessionRuntime.ts index b5894192eed9..942b3606e0d5 100644 --- a/apps/server/src/provider/acp/AcpSessionRuntime.ts +++ b/apps/server/src/provider/acp/AcpSessionRuntime.ts @@ -22,6 +22,7 @@ import type * as EffectAcpSchema from "effect-acp/schema"; import type * as EffectAcpProtocol from "effect-acp/protocol"; import { resolveSpawnCommand } from "@t3tools/shared/shell"; +import { appendAcpStderrTail, sanitizeAcpStderrExcerpt } from "./AcpStderr.ts"; import { collectSessionConfigOptionValues, decideToolCallUpdateEmission, @@ -354,6 +355,8 @@ export const make = ( ); const stoppingRef = yield* Ref.make(false); const stderrFailure = yield* Deferred.make(); + const stderrTailRef = yield* Ref.make(""); + const stderrDrained = yield* Deferred.make(); const runtimeClosed = yield* Deferred.make(); const promptSerializationSemaphore = yield* Semaphore.make(1); const promptDispatchSemaphore = yield* Semaphore.make(1); @@ -373,22 +376,45 @@ export const make = ( } }); + const enrichProcessExitWithStderr = ( + error: EffectAcpErrors.AcpError, + ): Effect.Effect => + error._tag !== "AcpProcessExitedError" || (error.stderr?.trim().length ?? 0) > 0 + ? Effect.succeed(error) + : Deferred.await(stderrDrained).pipe( + Effect.timeout("250 millis"), + Effect.ignore, + Effect.andThen(Ref.get(stderrTailRef)), + Effect.map((tail) => { + const stderr = sanitizeAcpStderrExcerpt(tail); + return stderr.length === 0 + ? error + : new EffectAcpErrors.AcpProcessExitedError({ + ...(error.code !== undefined ? { code: error.code } : {}), + ...(error.pid !== undefined ? { pid: error.pid } : {}), + stderr, + ...(error.cause !== undefined ? { cause: error.cause } : {}), + }); + }), + ); + const recordTermination = Effect.fn("AcpSessionRuntime.recordTermination")(function* ( error: EffectAcpErrors.AcpError, ) { if (yield* Ref.get(stoppingRef)) { return; } + const enriched = yield* enrichProcessExitWithStderr(error); const firstTermination = yield* Ref.modify(terminationErrorRef, (current) => Option.isSome(current) ? ([false, current] as const) - : ([true, Option.some(error)] as const), + : ([true, Option.some(enriched)] as const), ); if (!firstTermination) { return; } yield* closeActiveAssistantSegment({ queue: eventQueue, assistantSegmentRef }); - yield* Queue.offer(eventQueue, { _tag: "ConnectionTerminated", error }); + yield* Queue.offer(eventQueue, { _tag: "ConnectionTerminated", error: enriched }); }); const logRequest = (event: AcpSessionRequestLogEvent) => @@ -405,6 +431,9 @@ export const make = ( ? Effect.raceFirst(effect, Deferred.await(stderrFailure)) : effect ).pipe( + Effect.catch((error) => + enrichProcessExitWithStderr(error).pipe(Effect.flatMap(Effect.fail)), + ), Effect.tap((result) => logRequest({ method, @@ -452,10 +481,10 @@ export const make = ( yield* child.stderr.pipe( Stream.decodeText(), Stream.runForEach((chunk) => - (options.onStderr - ? options.onStderr(chunk.slice(-maxStderrChunkLength)) - : Effect.void - ).pipe( + Ref.update(stderrTailRef, (current) => appendAcpStderrTail(current, chunk)).pipe( + Effect.andThen( + options.onStderr ? options.onStderr(chunk.slice(-maxStderrChunkLength)) : Effect.void, + ), Effect.catch((error) => Effect.gen(function* () { yield* Deferred.fail(stderrFailure, error); @@ -465,6 +494,7 @@ export const make = ( ), ), ), + Effect.ensuring(Deferred.succeed(stderrDrained, undefined)), Effect.ignore, Effect.forkIn(runtimeScope), ); diff --git a/apps/server/src/provider/acp/AcpStderr.test.ts b/apps/server/src/provider/acp/AcpStderr.test.ts new file mode 100644 index 000000000000..e88b59bdb0e1 --- /dev/null +++ b/apps/server/src/provider/acp/AcpStderr.test.ts @@ -0,0 +1,56 @@ +import { describe, expect, it } from "vite-plus/test"; + +import { + ACP_STDERR_TAIL_MAX_CHARS, + appendAcpStderrTail, + sanitizeAcpStderrExcerpt, +} from "./AcpStderr.ts"; + +describe("AcpStderr", () => { + it("keeps a bounded tail of stderr chunks", () => { + const prefix = "x".repeat(ACP_STDERR_TAIL_MAX_CHARS); + expect(appendAcpStderrTail(prefix, "abc")).toBe(`${prefix.slice(3)}abc`); + }); + + it("redacts home paths, pairing URLs, and tokens from stderr excerpts", () => { + const excerpt = sanitizeAcpStderrExcerpt( + [ + "Invalid project config at /Users/ada/.cursor/cli.json", + "Authorization: Bearer secret-token-value", + "Visit http://localhost:5733/pair#token=ABCDEF for pairing", + "key=sk-abcdefghijklmnopqrstuv", + ].join("\n"), + { HOME: "/Users/ada" }, + ); + + expect(excerpt).toContain("Invalid project config at ~/.cursor/cli.json"); + expect(excerpt).toContain("Bearer [redacted]"); + expect(excerpt).toContain("[pairing-url]"); + expect(excerpt).toContain("[redacted]"); + expect(excerpt).not.toContain("secret-token-value"); + expect(excerpt).not.toContain("ABCDEF"); + expect(excerpt).not.toContain("sk-abcdefghijklmnopqrstuv"); + }); + + it("redacts hyphenated OpenAI project keys and header credentials", () => { + const excerpt = sanitizeAcpStderrExcerpt( + [ + "openai=sk-proj-abcdefghijklmnopqrstuvwxyz012345", + "svc=sk-svcacct-abcdefghijklmnopqrstuvwxyz012345", + "anthropic=sk-ant-api03-abcdefghijklmnopqrstuvwxyz012345", + "Authorization: Basic dXNlcjpwYXNz", + "x-api-key: ant-api-key-value", + ].join("\n"), + ); + + expect(excerpt).toContain("[redacted]"); + expect(excerpt).toContain("Authorization: Basic [redacted]"); + expect(excerpt).toContain("x-api-key: [redacted]"); + expect(excerpt).not.toContain("sk-proj-"); + expect(excerpt).not.toContain("sk-svcacct-"); + expect(excerpt).not.toContain("sk-ant-api03-"); + expect(excerpt).not.toContain("abcdefghijklmnopqrstuvwxyz012345"); + expect(excerpt).not.toContain("dXNlcjpwYXNz"); + expect(excerpt).not.toContain("ant-api-key-value"); + }); +}); diff --git a/apps/server/src/provider/acp/AcpStderr.ts b/apps/server/src/provider/acp/AcpStderr.ts new file mode 100644 index 000000000000..52f68bb4c19a --- /dev/null +++ b/apps/server/src/provider/acp/AcpStderr.ts @@ -0,0 +1,38 @@ +// @effect-diagnostics nodeBuiltinImport:off -- The excerpt sanitizer masks the home directory, which only the Node os module can resolve. +import * as NodeOS from "node:os"; + +/** Last few KiB of ACP child stderr kept for startup / exit diagnostics. */ +export const ACP_STDERR_TAIL_MAX_CHARS = 4_096; + +const PAIRING_URL_PATTERN = /https?:\/\/[^\s]*\/pair#[^\s]*/gi; +const BEARER_TOKEN_PATTERN = /\bBearer\s+[A-Za-z0-9._\-+=/]+/gi; +const BASIC_AUTH_PATTERN = /\bAuthorization:\s*Basic\s+\S+/gi; +const API_KEY_HEADER_PATTERN = /\bx-api-key:\s*\S+/gi; +const SECRET_TOKEN_PATTERN = + /\b(?:sk-[A-Za-z0-9][A-Za-z0-9-]{7,}|ghp_[A-Za-z0-9]+|xox[a-zA-Z]-[A-Za-z0-9-]+)\b/g; + +export function appendAcpStderrTail(current: string, chunk: string): string { + const next = `${current}${chunk}`; + return next.length <= ACP_STDERR_TAIL_MAX_CHARS ? next : next.slice(-ACP_STDERR_TAIL_MAX_CHARS); +} + +/** Bounded, redacted excerpt safe to put on user-facing adapter errors. */ +export function sanitizeAcpStderrExcerpt( + text: string, + environment: NodeJS.ProcessEnv = process.env, +): string { + let result = text.replaceAll("\0", ""); + const homes = [environment.HOME, environment.USERPROFILE, NodeOS.homedir()].filter( + (value): value is string => typeof value === "string" && value.length > 1, + ); + for (const home of new Set(homes)) { + result = result.split(home).join("~"); + } + result = result + .replace(PAIRING_URL_PATTERN, "[pairing-url]") + .replace(BEARER_TOKEN_PATTERN, "Bearer [redacted]") + .replace(BASIC_AUTH_PATTERN, "Authorization: Basic [redacted]") + .replace(API_KEY_HEADER_PATTERN, "x-api-key: [redacted]") + .replace(SECRET_TOKEN_PATTERN, "[redacted]"); + return result.trim(); +} diff --git a/apps/server/src/provider/testFixtures/codexCollabMockPeer.mjs b/apps/server/src/provider/testFixtures/codexCollabMockPeer.mjs index 05ac8c8ace68..f249b787d05e 100644 --- a/apps/server/src/provider/testFixtures/codexCollabMockPeer.mjs +++ b/apps/server/src/provider/testFixtures/codexCollabMockPeer.mjs @@ -87,6 +87,14 @@ rl.on("line", (line) => { write({ id, result: fixture.responses.threadStart }); return; } + if (method === "thread/inject_items" && script.recordRequests) { + NodeFS.appendFileSync( + `${process.env.T3_CODEX_COLLAB_SCRIPT}.requests`, + `${JSON.stringify({ method, params: message.params })}\n`, + ); + write({ id, result: {} }); + return; + } if (method === "thread/resume") { if (script.recordRequests) { NodeFS.appendFileSync( diff --git a/apps/server/src/provider/testFixtures/codexMultiAgentWire.json b/apps/server/src/provider/testFixtures/codexMultiAgentWire.json index 08316d3b6334..0f183635b17e 100644 --- a/apps/server/src/provider/testFixtures/codexMultiAgentWire.json +++ b/apps/server/src/provider/testFixtures/codexMultiAgentWire.json @@ -20,6 +20,7 @@ "forkedFromId": null, "parentThreadId": null, "preview": "", + "projectId": null, "ephemeral": false, "historyMode": "legacy", "modelProvider": "openai", @@ -389,6 +390,7 @@ "forkedFromId": null, "parentThreadId": null, "preview": "", + "projectId": null, "ephemeral": false, "historyMode": "legacy", "modelProvider": "openai", diff --git a/apps/server/src/vcs/GitVcsDriverCore.test.ts b/apps/server/src/vcs/GitVcsDriverCore.test.ts index afb2559dfda7..e924e0d4cb88 100644 --- a/apps/server/src/vcs/GitVcsDriverCore.test.ts +++ b/apps/server/src/vcs/GitVcsDriverCore.test.ts @@ -1381,6 +1381,35 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => { }), ); + it.effect("does not start Git auto-maintenance from background upstream fetches", () => + Effect.gen(function* () { + const cwd = yield* makeTmpDir(); + const remote = yield* makeTmpDir("git-vcs-driver-remote-"); + const { initialBranch } = yield* initRepoWithCommit(cwd); + yield* git(remote, ["init", "--bare"]); + yield* git(cwd, ["remote", "add", "origin", remote]); + yield* git(cwd, ["push", "-u", "origin", initialBranch]); + yield* git(cwd, ["repack", "-d"]); + yield* writeTextFile(cwd, "second.txt", "second\n"); + yield* git(cwd, ["add", "second.txt"]); + yield* git(cwd, ["commit", "-m", "second commit"]); + yield* git(cwd, ["push"]); + yield* git(cwd, ["repack", "-d"]); + // Two packs make `git gc --auto` due, and without detaching it would run inside the fetch. + yield* git(cwd, ["config", "gc.autoPackLimit", "1"]); + yield* git(cwd, ["config", "gc.autoDetach", "false"]); + yield* git(cwd, ["config", "maintenance.autoDetach", "false"]); + const packCount = git(cwd, ["count-objects", "-v"]).pipe( + Effect.map((stdout) => stdout.match(/^packs: (\d+)$/m)?.[1]), + ); + assert.equal(yield* packCount, "2"); + + yield* (yield* GitVcsDriver.GitVcsDriver).statusDetailsRemote(cwd); + + assert.equal(yield* packCount, "2"); + }), + ); + it.effect("uses origin HEAD for default-branch detection with a non-origin upstream", () => Effect.gen(function* () { const cwd = yield* makeTmpDir(); diff --git a/apps/server/src/vcs/GitVcsDriverCore.ts b/apps/server/src/vcs/GitVcsDriverCore.ts index bc3ae2f5f39e..4b2fd83fce77 100644 --- a/apps/server/src/vcs/GitVcsDriverCore.ts +++ b/apps/server/src/vcs/GitVcsDriverCore.ts @@ -1028,10 +1028,14 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* ): Effect.Effect => { const fetchCwd = path.basename(gitCommonDir) === ".git" ? path.dirname(gitCommonDir) : gitCommonDir; + // `--no-auto-gc` (a synonym of `--no-auto-maintenance` that older Git also knows) keeps + // this poll from starting `git gc --auto`. When that gc fails, for example on a repository + // with missing objects, Git retries it on every fetch and leaves a full-size `tmp_pack_*` + // behind each time, so a background poll could fill the disk. return executeGit( "GitVcsDriver.fetchRemoteForStatus", fetchCwd, - ["--git-dir", gitCommonDir, "fetch", "--quiet", "--no-tags", remoteName], + ["--git-dir", gitCommonDir, "fetch", "--quiet", "--no-tags", "--no-auto-gc", remoteName], { env: STATUS_UPSTREAM_REFRESH_ENV, fallbackErrorDetail: "Background Git fetch exited with a non-zero status.", @@ -2181,13 +2185,15 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* const readRangeContext: GitVcsDriver.GitVcsDriver["Service"]["readRangeContext"] = Effect.fn( "readRangeContext", )(function* (cwd, baseRef) { - const range = `${baseRef}..HEAD`; + const commitRange = `${baseRef}..HEAD`; + // PR diffs start at the common ancestor when the base branch has advanced. + const diffRange = `${baseRef}...HEAD`; const [commitSummary, diffSummary, diffPatch] = yield* Effect.all( [ runGitStdoutWithOptions( "GitVcsDriver.readRangeContext.log", cwd, - ["log", "--oneline", range], + ["log", "--oneline", commitRange], { maxOutputBytes: RANGE_COMMIT_SUMMARY_MAX_OUTPUT_BYTES, appendTruncationMarker: true, @@ -2196,7 +2202,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* runGitStdoutWithOptions( "GitVcsDriver.readRangeContext.diffStat", cwd, - ["diff", "--stat", range], + ["diff", "--stat", diffRange], { maxOutputBytes: RANGE_DIFF_SUMMARY_MAX_OUTPUT_BYTES, appendTruncationMarker: true, @@ -2205,7 +2211,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* runGitStdoutWithOptions( "GitVcsDriver.readRangeContext.diffPatch", cwd, - ["diff", "--no-ext-diff", "--patch", "--minimal", range], + ["diff", "--no-ext-diff", "--patch", "--minimal", diffRange], { maxOutputBytes: RANGE_DIFF_PATCH_MAX_OUTPUT_BYTES, appendTruncationMarker: true, diff --git a/apps/web/package.json b/apps/web/package.json index 8a5d912f62fe..ee674ad95824 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -69,6 +69,7 @@ "@vitejs/plugin-react": "^6.0.0", "babel-plugin-react-compiler": "1.0.0", "compression": "^1.8.1", + "jsdom": "26.1.0", "react-test-renderer": "19.2.6", "tailwindcss": "^4.0.0", "unified": "^11.0.5", diff --git a/apps/web/src/components/BranchToolbar.tsx b/apps/web/src/components/BranchToolbar.tsx index 56e37b8b5013..780bb7610420 100644 --- a/apps/web/src/components/BranchToolbar.tsx +++ b/apps/web/src/components/BranchToolbar.tsx @@ -175,6 +175,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ key={env.environmentId} disabled={envLocked} value={env.environmentId} + closeOnClick > @@ -199,7 +200,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ onEnvModeChange(value as EnvMode); }} > - + {activeWorktreePath ? ( @@ -211,14 +212,14 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({ - + {resolveEnvModeLabel("worktree")} {previousWorktreeLabel ? ( - + {previousWorktreeLabel} diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx index 0184a1f55886..61b1d7a7ced7 100644 --- a/apps/web/src/components/BranchToolbarBranchSelector.tsx +++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx @@ -525,6 +525,7 @@ export function BranchToolbarBranchSelector({ setIsBranchMenuOpen(open); if (!open) { setBranchQuery(""); + highlightedBranchValueRef.current = null; } }, []); @@ -563,6 +564,9 @@ export function BranchToolbarBranchSelector({ }, [fetchNextBranchPage, hasNextPage, isBranchMenuOpen, isFetchingNextPage]); const branchListRef = useRef(null); + // Tracks the highlighted picker value so Enter can activate it even when the + // virtualized row is not mounted (Base UI Enter clicks the mounted element). + const highlightedBranchValueRef = useRef(null); const updateBranchListScrollFades = useCallback(() => { const scrollElement = branchListRef.current?.getScrollableNode?.(); if (!(scrollElement instanceof HTMLElement)) { @@ -629,6 +633,20 @@ export function BranchToolbarBranchSelector({ : ""; const openPrLink = useOpenPrLink(threadRef); + function selectPickerItem(itemValue: string) { + highlightedBranchValueRef.current = null; + if (itemValue === checkoutPullRequestItemValue && prReference && onCheckoutPullRequestRequest) { + handleOpenChange(false); + onComposerFocusRequest?.(); + onCheckoutPullRequestRequest(prReference); + } else if (itemValue === createBranchItemValue) { + createRef(trimmedBranchQuery); + } else { + const refName = branchByName.get(itemValue); + if (refName) selectBranch(refName); + } + } + function renderPickerItem(itemValue: string, index: number) { if (checkoutPullRequestItemValue && itemValue === checkoutPullRequestItemValue) { return ( @@ -638,15 +656,7 @@ export function BranchToolbarBranchSelector({ index={index} value={itemValue} className="pe-2" - onClick={() => { - if (!prReference || !onCheckoutPullRequestRequest) { - return; - } - setIsBranchMenuOpen(false); - setBranchQuery(""); - onComposerFocusRequest?.(); - onCheckoutPullRequestRequest(prReference); - }} + onClick={() => selectPickerItem(itemValue)} >
@@ -668,7 +678,7 @@ export function BranchToolbarBranchSelector({ index={index} value={itemValue} className="pe-1.5" - onClick={() => createRef(trimmedBranchQuery)} + onClick={() => selectPickerItem(itemValue)} > Create new ref "{newRefName}" @@ -696,7 +706,7 @@ export function BranchToolbarBranchSelector({ index={index} value={itemValue} className="pe-1.5" - onClick={() => selectBranch(refName)} + onClick={() => selectPickerItem(itemValue)} onContextMenu={(event) => handleBranchContextMenu(event, itemValue)} >
@@ -713,7 +723,8 @@ export function BranchToolbarBranchSelector({ filteredItems={filteredBranchPickerItems} autoHighlight virtualized - onItemHighlighted={(_value, eventDetails) => { + onItemHighlighted={(value, eventDetails) => { + highlightedBranchValueRef.current = typeof value === "string" ? value : null; if (!isBranchMenuOpen || eventDetails.index < 0 || eventDetails.reason !== "keyboard") { return; } @@ -814,6 +825,28 @@ export function BranchToolbarBranchSelector({ unstyled value={branchQuery} onChange={(event) => setBranchQuery(event.target.value)} + onKeyDown={(event) => { + if ( + event.key !== "Enter" || + event.nativeEvent.isComposing || + event.keyCode === 229 + ) { + return; + } + const highlightedValue = highlightedBranchValueRef.current; + if ( + highlightedValue === null || + !filteredBranchPickerItems.includes(highlightedValue) + ) { + return; + } + ( + event as typeof event & { preventBaseUIHandler?: () => void } + ).preventBaseUIHandler?.(); + event.preventDefault(); + event.stopPropagation(); + selectPickerItem(highlightedValue); + }} />
diff --git a/apps/web/src/components/ChatMarkdown.tsx b/apps/web/src/components/ChatMarkdown.tsx index 6e977e9e74c7..5a5fe3033dde 100644 --- a/apps/web/src/components/ChatMarkdown.tsx +++ b/apps/web/src/components/ChatMarkdown.tsx @@ -834,7 +834,10 @@ function MarkdownDetails({ {summary} -
+
{content}
@@ -3144,7 +3147,7 @@ function ChatMarkdown({
store.getDraftThreadByRef(threadRef)); - const serverThread = useThread(threadRef, { waitForShell: draftThread !== null }); + // Hidden drawers stay mounted (see MAX_HIDDEN_MOUNTED_TERMINAL_THREADS), so they read only + // the shell: a detail subscription would keep each hidden thread's history in memory. The + // active drawer shares ChatView's detail, which also covers archived threads (no shell). + const activeServerThread = useThread(active ? threadRef : null, { + waitForShell: draftThread !== null, + }); + const serverThreadShell = useThreadShell(threadRef); + const serverThread = activeServerThread ?? serverThreadShell; const projectRef = serverThread ? scopeProjectRef(serverThread.environmentId, serverThread.projectId) : draftThread @@ -7095,6 +7100,17 @@ export default function ChatView(props: ChatViewProps) { if (!activePendingUserInput) { return; } + // The option replaces the custom answer. Anything typed there is the + // user's text, so it goes back to the thread draft instead of vanishing. + const displacedAnswer = + pendingUserInputAnswersByRequestId[activePendingUserInput.requestId]?.[questionId] + ?.customAnswer; + const currentPrompt = + useComposerDraftStore.getState().getComposerDraft(composerDraftTarget)?.prompt ?? ""; + const nextPrompt = carryDisplacedCustomAnswerIntoPrompt(currentPrompt, displacedAnswer); + if (nextPrompt !== currentPrompt) { + setComposerDraftPrompt(composerDraftTarget, nextPrompt); + } setPendingUserInputAnswersByRequestId((existing) => { const question = (activePendingProgress?.activeQuestion?.id === questionId @@ -7120,7 +7136,14 @@ export default function ChatView(props: ChatViewProps) { promptRef.current = ""; composerRef.current?.resetCursorState({ cursor: 0 }); }, - [activePendingProgress?.activeQuestion, activePendingUserInput, composerRef], + [ + activePendingProgress?.activeQuestion, + activePendingUserInput, + composerDraftTarget, + composerRef, + pendingUserInputAnswersByRequestId, + setComposerDraftPrompt, + ], ); const onChangeActivePendingUserInputCustomAnswer = useCallback( diff --git a/apps/web/src/components/PullRequestThreadDialog.tsx b/apps/web/src/components/PullRequestThreadDialog.tsx index 4004b4930c27..ddbd2876d4d2 100644 --- a/apps/web/src/components/PullRequestThreadDialog.tsx +++ b/apps/web/src/components/PullRequestThreadDialog.tsx @@ -222,9 +222,12 @@ export function PullRequestThreadDialog({ if (event.key !== "Enter") { return; } + if (event.nativeEvent.isComposing || event.keyCode === 229) { + return; + } event.preventDefault(); if (!isResolving && !preparePullRequestThreadAction.isPending) { - void handleConfirm("local"); + void handleConfirm("worktree"); } }} /> diff --git a/apps/web/src/components/chat/AssistantCitationChip.test.tsx b/apps/web/src/components/chat/AssistantCitationChip.test.tsx new file mode 100644 index 000000000000..7d664f237983 --- /dev/null +++ b/apps/web/src/components/chat/AssistantCitationChip.test.tsx @@ -0,0 +1,156 @@ +import { + ASSISTANT_CITATION_MAX_COMMENT_LENGTH, + EnvironmentId, + MessageId, + ThreadId, +} from "@t3tools/contracts"; +import { act, useState, type ReactNode } from "react"; +import { create, type ReactTestRenderer } from "react-test-renderer"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test"; + +import type { AssistantCitationSourceAnchor } from "~/lib/assistantTextSelection"; + +const mocks = vi.hoisted(() => ({ observeSource: vi.fn(), dispose: vi.fn() })); +vi.mock("./AssistantCitationSource", () => ({ + observeAssistantCitationCommentSource: mocks.observeSource, +})); +vi.mock("@tanstack/react-router", () => ({ + useNavigate: () => vi.fn(), + Link: ({ children }: { children: ReactNode }) => {children}, +})); +// Keep the real chip/editor lifecycle while replacing DOM positioning and floating layers. +vi.mock("../ui/tooltip", () => ({ + Tooltip: ({ children }: { children: ReactNode }) => <>{children}, + TooltipTrigger: ({ render }: { render: ReactNode }) => render, + TooltipPopup: ({ children }: { children: ReactNode }) => <>{children}, +})); +vi.mock("../ui/popover", () => ({ + Popover: ({ children }: { children: ReactNode }) => <>{children}, + PopoverTrigger: ({ children }: { children: ReactNode }) => , + PopoverPopup: ({ children }: { children: ReactNode }) => <>{children}, +})); +vi.mock("../ui/button", () => ({ + Button: (props: React.ComponentProps<"button">) => ); + // The composer hero is a sentence, so the heading's accessible name must be + // a complete sentence too. The project picker is a control rendered inline + // in the h1; without an explicit label its widget state bleeds into the + // announced phrase. + const headingLabel = hasResolvedProject + ? `What should we build in ${activeProjectDisplayName}?` + : canChooseProject + ? `${activeProjectDisplayName ?? "Choose a project"} to start` + : "Add a project to start"; + return ( -

+

{hasResolvedProject ? ( <>What should we build in {projectSelector}? ) : canChooseProject ? ( diff --git a/apps/web/src/components/chat/assistantCitationCommentDismissal.test.ts b/apps/web/src/components/chat/assistantCitationCommentDismissal.test.ts new file mode 100644 index 000000000000..1f21677a5a82 --- /dev/null +++ b/apps/web/src/components/chat/assistantCitationCommentDismissal.test.ts @@ -0,0 +1,80 @@ +import { ASSISTANT_CITATION_MAX_COMMENT_LENGTH } from "@t3tools/contracts"; +import { describe, expect, it } from "vite-plus/test"; + +import { resolveAssistantCitationCommentDismissal } from "./assistantCitationCommentDismissal"; + +describe("resolveAssistantCitationCommentDismissal", () => { + it("commits typed text when the popover is dismissed by clicking away", () => { + expect( + resolveAssistantCitationCommentDismissal({ + reason: "outside-press", + draft: "needs a retry", + savedComment: undefined, + }), + ).toEqual({ kind: "commit", comment: "needs a retry" }); + }); + + it("commits an edited comment when focus leaves the popover", () => { + expect( + resolveAssistantCitationCommentDismissal({ + reason: "focus-out", + draft: "second thought", + savedComment: "first thought", + }), + ).toEqual({ kind: "commit", comment: "second thought" }); + }); + + it("closes without saving when nothing changed", () => { + expect( + resolveAssistantCitationCommentDismissal({ + reason: "outside-press", + draft: null, + savedComment: "kept", + }), + ).toEqual({ kind: "close" }); + expect( + resolveAssistantCitationCommentDismissal({ + reason: "outside-press", + draft: " kept ", + savedComment: "kept", + }), + ).toEqual({ kind: "close" }); + expect( + resolveAssistantCitationCommentDismissal({ + reason: "outside-press", + draft: "kept", + savedComment: " kept ", + }), + ).toEqual({ kind: "close" }); + }); + + it("clears a comment when the draft was emptied", () => { + expect( + resolveAssistantCitationCommentDismissal({ + reason: "trigger-press", + draft: "", + savedComment: "old", + }), + ).toEqual({ kind: "commit", comment: "" }); + }); + + it("keeps Escape as an explicit discard", () => { + expect( + resolveAssistantCitationCommentDismissal({ + reason: "escape-key", + draft: "unsaved", + savedComment: undefined, + }), + ).toEqual({ kind: "close" }); + }); + + it("keeps the popover open instead of dropping an over-length draft", () => { + expect( + resolveAssistantCitationCommentDismissal({ + reason: "outside-press", + draft: "x".repeat(ASSISTANT_CITATION_MAX_COMMENT_LENGTH + 1), + savedComment: undefined, + }), + ).toEqual({ kind: "keep-open" }); + }); +}); diff --git a/apps/web/src/components/chat/assistantCitationCommentDismissal.ts b/apps/web/src/components/chat/assistantCitationCommentDismissal.ts new file mode 100644 index 000000000000..a6fe2ca3bcb6 --- /dev/null +++ b/apps/web/src/components/chat/assistantCitationCommentDismissal.ts @@ -0,0 +1,21 @@ +import { ASSISTANT_CITATION_MAX_COMMENT_LENGTH } from "@t3tools/contracts"; + +export type AssistantCitationCommentDismissal = + | { kind: "commit"; comment: string } + | { kind: "close" } + | { kind: "keep-open" }; + +export function resolveAssistantCitationCommentDismissal({ + reason, + draft, + savedComment, +}: { + reason: string; + draft: string | null; + savedComment: string | undefined; +}): AssistantCitationCommentDismissal { + if (reason === "escape-key" || draft === null) return { kind: "close" }; + if (draft.trim() === (savedComment ?? "").trim()) return { kind: "close" }; + if (draft.length > ASSISTANT_CITATION_MAX_COMMENT_LENGTH) return { kind: "keep-open" }; + return { kind: "commit", comment: draft }; +} diff --git a/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx b/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx index eb1562cea251..215f90e3471d 100644 --- a/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx +++ b/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx @@ -19,6 +19,7 @@ import { FolderTreeIcon, MessageSquareIcon, MessageSquareOffIcon, + PilcrowIcon, Rows3Icon, TextWrapIcon, TriangleAlertIcon, @@ -226,6 +227,7 @@ export function PullRequestCodeTab({ const diffLayout = settings.diffLayout; const updateClientSettings = useUpdateClientSettings(); const [wordWrap, setWordWrap] = useState(settings.wordWrap); + const [ignoreWhitespace, setIgnoreWhitespace] = useState(settings.diffIgnoreWhitespace); const [fileTreeOpen, setFileTreeOpen] = useLocalStorage( PULL_REQUEST_FILE_TREE_STORAGE_KEY, false, @@ -390,16 +392,17 @@ export function PullRequestCodeTab({ loadedSlices.map((slice) => { // The patch's own hash is part of the key: a refreshed page reuses its cursor, and a // key of position alone would keep handing back the parse of the patch it replaced. - const cacheKey = `pull-request:${scopeKey}:${resolvedTheme}:${slice.cursor ?? "first"}:${fnv1a32(slice.patch)}`; + const cacheKey = `pull-request:${scopeKey}:${resolvedTheme}:${ignoreWhitespace}:${slice.cursor ?? "first"}:${fnv1a32(slice.patch)}`; const cached = parseCache.current.get(cacheKey); if (cached) return cached; const parsed = getRenderablePatch(slice.patch, cacheKey, { compactPartialHunkOffsets: true, + ignoreWhitespace, }); if (parsed) parseCache.current.set(cacheKey, parsed); return parsed; }), - [loadedSlices, resolvedTheme, scopeKey], + [loadedSlices, resolvedTheme, scopeKey, ignoreWhitespace], ); // Ordered within a slice rather than across them: ordering the accumulated set would let a late // slice push a file the reader is part way through further down the page. @@ -642,7 +645,13 @@ export function PullRequestCodeTab({ // that silently lost its first line on the other hosts would be worse than one line. const path = resolveFileDiffPath(file); const previousPath = resolveFileDiffPreviousPath(file); - const position = resolveDiffReviewPosition(file, range.end, range.endSide ?? range.side); + const sourceFile = parsedSlices + .flatMap((slice) => (slice?.kind === "files" ? slice.sourceFiles : [])) + .find((candidate) => resolveFileDiffPath(candidate) === path); + const side = range.endSide ?? range.side; + const position = + (sourceFile && resolveDiffReviewPosition(sourceFile, range.end, side)) ?? + resolveDiffReviewPosition(file, range.end, side); if (position === null) return; setDraft({ fileKey: item.id, @@ -652,7 +661,7 @@ export function PullRequestCodeTab({ range, }); }, - [canCommentOnLines, files], + [canCommentOnLines, files, parsedSlices], ); // Built here because the parsed diff only lives here, and built by the same function the @@ -1009,11 +1018,6 @@ export function PullRequestCodeTab({ } }, [commit, onSelectedCommitChange, selectedCommit]); const scopeLabel = selectedCommit ? selectedCommit.messageHeadline : "All commits"; - /** - * The same controls the thread diff panel carries, in the same order, minus the - * ignore-whitespace toggle: that is `git diff -w` on the server, and no host's pull request - * diff API offers it. - */ const toolbar = (
@@ -1106,6 +1110,30 @@ export function PullRequestCodeTab({
+ + { + setIgnoreWhitespace(Boolean(pressed)); + setDraft(null); + setSelectedLines(null); + }} + /> + } + > + + + + {ignoreWhitespace ? "Show whitespace changes" : "Hide whitespace changes"} + + {fileKeys.length > 0 ? ( {pendingDesktopServerExposureMode === "network-accessible" - ? "T3 Code will restart to expose this environment over the network." - : "T3 Code will restart and limit this environment back to this machine."} + ? "Let your other devices connect to T3 Code over the network. Pair devices to give them access. T3 Code will restart." + : "Devices connected over your local network will disconnect. Existing tunnels, such as T3 Connect or Tailscale HTTPS, keep working. T3 Code will restart."} @@ -3255,27 +3255,23 @@ export function ConnectionsSettings() { disabled={isUpdatingDesktopServerExposure} render={ diff --git a/apps/web/src/composer-logic.test.ts b/apps/web/src/composer-logic.test.ts index cbc1821b0da0..1ab4eae861bc 100644 --- a/apps/web/src/composer-logic.test.ts +++ b/apps/web/src/composer-logic.test.ts @@ -9,6 +9,7 @@ import { describe, expect, it } from "vite-plus/test"; import { clampCollapsedComposerCursor, collapseExpandedComposerCursor, + composerStateAtPromptEnd, composerSubmissionIntentForEnter, detectComposerTrigger, expandCollapsedComposerCursor, @@ -18,6 +19,7 @@ import { replaceTextRange, } from "./composer-logic"; import { INLINE_TERMINAL_CONTEXT_PLACEHOLDER } from "./lib/terminalContext"; +import { carryDisplacedCustomAnswerIntoPrompt } from "./pendingUserInput"; const citation: AssistantCitation = { version: 1, @@ -294,6 +296,34 @@ describe("expandCollapsedComposerCursor", () => { }); }); +describe("composerStateAtPromptEnd", () => { + it("puts the caret at the end of a restored parked draft", () => { + const prompt = carryDisplacedCustomAnswerIntoPrompt("first half\n", "second half"); + + expect(composerStateAtPromptEnd(prompt)).toEqual({ + cursor: prompt.length, + trigger: null, + }); + }); + + it("collapses mention chips so the next keystroke lands after the draft", () => { + const prompt = carryDisplacedCustomAnswerIntoPrompt("", "see @AGENTS.md please"); + + expect(composerStateAtPromptEnd(prompt).cursor).toBe("see ".length + 1 + " please".length); + expect(composerStateAtPromptEnd(prompt).cursor).not.toBe(0); + expect(composerStateAtPromptEnd(prompt).cursor).not.toBe(prompt.length); + }); + + it("keeps a trailing mention trigger when the restored draft ends with @", () => { + const prompt = "look at @"; + + expect(composerStateAtPromptEnd(prompt)).toEqual({ + cursor: prompt.length, + trigger: { kind: "path", query: "", rangeStart: "look at ".length, rangeEnd: prompt.length }, + }); + }); +}); + describe("collapseExpandedComposerCursor", () => { it("keeps cursor unchanged when no mention segment is present", () => { expect(collapseExpandedComposerCursor("plain text", 5)).toBe(5); diff --git a/apps/web/src/composer-logic.ts b/apps/web/src/composer-logic.ts index 4a5b7022adc7..266c273b825c 100644 --- a/apps/web/src/composer-logic.ts +++ b/apps/web/src/composer-logic.ts @@ -261,6 +261,18 @@ export function detectComposerTrigger(text: string, cursorInput: number): Compos }; } +/** Caret and trigger after replacing composer text and continuing at the end. */ +export function composerStateAtPromptEnd(text: string): { + cursor: number; + trigger: ComposerTrigger | null; +} { + const cursor = collapseExpandedComposerCursor(text, text.length); + return { + cursor, + trigger: detectComposerTrigger(text, expandCollapsedComposerCursor(text, cursor)), + }; +} + export function parseStandaloneComposerSlashCommand( text: string, ): Exclude | null { diff --git a/apps/web/src/connection/storage.test.ts b/apps/web/src/connection/storage.test.ts index 6d503387bb64..497e92215638 100644 --- a/apps/web/src/connection/storage.test.ts +++ b/apps/web/src/connection/storage.test.ts @@ -74,4 +74,27 @@ describe("makeCatalogBackend", () => { expect(setConnectionCatalog).toHaveBeenCalledWith("{}"); }), ); + + it.effect("fails IndexedDB writes whose commit aborts", () => + Effect.gen(function* () { + vi.stubGlobal("window", {}); + const transaction = Object.assign(new EventTarget(), { + error: null as DOMException | null, + objectStore: () => ({ + put: () => { + // A failed commit aborts the transaction without an "error" event. + queueMicrotask(() => { + transaction.error = new DOMException("Quota exceeded", "QuotaExceededError"); + transaction.dispatchEvent(new Event("abort")); + }); + }, + }), + }); + const backend = makeCatalogBackend({ transaction: () => transaction } as never); + + const error = yield* backend.write("{}").pipe(Effect.flip); + + expect(error.message).toContain("QuotaExceededError"); + }), + ); }); diff --git a/apps/web/src/connection/storage.ts b/apps/web/src/connection/storage.ts index 4ae476c1d11f..20db380ce595 100644 --- a/apps/web/src/connection/storage.ts +++ b/apps/web/src/connection/storage.ts @@ -6,6 +6,7 @@ import { ConnectionTargetStore, EMPTY_CONNECTION_CATALOG_DOCUMENT, EnvironmentCacheStore, + encodeShellSnapshotForCache, registerConnectionInCatalog, removeCatalogValue, removeConnectionFromCatalog, @@ -79,7 +80,6 @@ const ConnectionCatalogDocumentJson = Schema.fromJsonString(ConnectionCatalogDoc const decodeConnectionCatalogDocument = Schema.decodeUnknownEffect(ConnectionCatalogDocumentJson); const encodeConnectionCatalogDocument = Schema.encodeEffect(ConnectionCatalogDocumentJson); const decodeStoredShellSnapshot = Schema.decodeUnknownEffect(StoredShellSnapshotJson); -const encodeStoredShellSnapshot = Schema.encodeEffect(StoredShellSnapshotJson); const decodeStoredThreadSnapshot = Schema.decodeUnknownEffect(StoredThreadSnapshotJson); const encodeStoredThreadSnapshot = Schema.encodeEffect(StoredThreadSnapshotJson); const decodeStoredServerConfig = Schema.decodeUnknownEffect(StoredServerConfigJson); @@ -174,7 +174,9 @@ function writeDatabaseValue( ) { return Effect.callback((resume) => { const transaction = database.transaction(storeName, "readwrite"); - transaction.addEventListener("error", () => { + // Every failed write fires "abort". A failed commit, such as + // QuotaExceededError, fires only "abort" and no "error". + transaction.addEventListener("abort", () => { resume( Effect.fail(catalogError("write", transaction.error ?? "Unknown IndexedDB write error")), ); @@ -489,11 +491,17 @@ export const connectionStorageLayer = Layer.effectContext( ), saveShell: (environmentId, snapshot) => Effect.gen(function* () { - const encoded = yield* encodeStoredShellSnapshot({ - schemaVersion: SHELL_SNAPSHOT_CACHE_SCHEMA_VERSION, - environmentId, - snapshot, - }).pipe(Effect.mapError((cause) => persistenceError("save-shell", cause))); + const encodedSnapshot = yield* encodeShellSnapshotForCache(snapshot); + const encoded = yield* Effect.try({ + try: () => + // @effect-diagnostics-next-line preferSchemaOverJson:off - the snapshot is already encoded. + JSON.stringify({ + schemaVersion: SHELL_SNAPSHOT_CACHE_SCHEMA_VERSION, + environmentId, + snapshot: encodedSnapshot, + } satisfies typeof StoredShellSnapshot.Encoded), + catch: (cause) => persistenceError("save-shell", cause), + }); yield* writeDatabaseValue(database, SHELL_STORE_NAME, environmentId, encoded); }).pipe( Effect.mapError((cause) => diff --git a/apps/web/src/lib/diffRendering.test.ts b/apps/web/src/lib/diffRendering.test.ts index 47a97069876e..e7ce0c550716 100644 --- a/apps/web/src/lib/diffRendering.test.ts +++ b/apps/web/src/lib/diffRendering.test.ts @@ -1,4 +1,6 @@ +import { hydratePartialDiff } from "@pierre/diffs"; import { describe, expect, it } from "vite-plus/test"; +import { resolveDiffReviewPosition } from "../reviewCommentContext"; import { buildFileDiffContentVersion, buildFileDiffIdentityKey, @@ -32,6 +34,135 @@ describe("buildPatchCacheKey", () => { }); describe("getRenderablePatch", () => { + it("hides indentation changes around inserted JSX without moving review lines", () => { + const patch = [ + "diff --git a/item.tsx b/item.tsx", + "--- a/item.tsx", + "+++ b/item.tsx", + "@@ -40,5 +40,7 @@", + ' ', + "- ", + '-

{name}

', + "-
", + "+ {showName && (", + "+ ", + '+

{name}

', + "+
", + "+ )}", + "
", + "@@ -80 +82 @@", + "-const value = 1;", + "+const value = 2;", + ].join("\n"); + const shown = getRenderablePatch(patch, "pr", { compactPartialHunkOffsets: true }); + const hidden = getRenderablePatch(patch, "pr", { + compactPartialHunkOffsets: true, + ignoreWhitespace: true, + }); + expect(shown?.kind).toBe("files"); + expect(hidden?.kind).toBe("files"); + if (shown?.kind !== "files" || hidden?.kind !== "files") return; + expect(getDiffLineStat(shown.files)).toEqual({ additions: 6, deletions: 4 }); + expect(getDiffLineStat(hidden.files)).toEqual({ additions: 3, deletions: 1 }); + const file = hidden.files[0]!; + expect(file.additionLines).toEqual(shown.files[0]!.additionLines); + expect(file.deletionLines).toEqual(shown.files[0]!.deletionLines); + expect(file.cacheKey).not.toBe(shown.files[0]!.cacheKey); + expect(resolveDiffReviewPosition(hidden.sourceFiles[0]!, 43, "additions")).toEqual({ + kind: "added", + newLine: 43, + }); + expect(resolveDiffReviewPosition(hidden.sourceFiles[0]!, 42, "deletions")).toEqual({ + kind: "deleted", + oldLine: 42, + }); + expect(file.hunks[0]?.hunkContent).toContainEqual({ + type: "context", + lines: 3, + additionLineIndex: 2, + deletionLineIndex: 1, + }); + expect(resolveDiffReviewPosition(file, 41, "additions")).toEqual({ + kind: "added", + newLine: 41, + }); + expect(resolveDiffReviewPosition(file, 43, "additions")).toEqual({ + kind: "context", + oldLine: 42, + newLine: 43, + side: "right", + }); + expect(resolveDiffReviewPosition(file, 42, "deletions")).toEqual({ + kind: "context", + oldLine: 42, + newLine: 43, + side: "left", + }); + expect(file.hunks[1]).toMatchObject({ + additionStart: 82, + deletionStart: 80, + splitLineStart: 7, + unifiedLineStart: 7, + }); + const prefix = "unchanged\n".repeat(39); + const gap = "unchanged\n".repeat(35); + const hydrated = hydratePartialDiff("clone", file, { + oldFile: { + name: file.name, + contents: prefix + file.deletionLines.slice(0, 5).join("") + gap + "const value = 1;\n", + }, + newFile: { + name: file.name, + contents: prefix + file.additionLines.slice(0, 7).join("") + gap + "const value = 2;\n", + }, + }); + expect(getDiffLineStat([hydrated])).toEqual({ additions: 3, deletions: 1 }); + expect(resolveDiffReviewPosition(hydrated, 43, "additions")).toEqual( + resolveDiffReviewPosition(file, 43, "additions"), + ); + }); + + it.each([ + [" const x = 1;\t", "\tconst x=1;", 0, 0], + ["const x = 1;", "const x = 2;", 1, 1], + ["const x = 1;", "const x = 1;\n", 1, 0], + ])("filters whitespace in %j to %j", (before, after, additions, deletions) => { + const patch = [ + "diff --git a/example.ts b/example.ts", + "--- a/example.ts", + "+++ b/example.ts", + `@@ -1 +1,${after.split("\n").length} @@`, + `-${before}`, + ...after.split("\n").map((line) => `+${line}`), + "", + ].join("\n"); + const filtered = getRenderablePatch(patch, "pr", { ignoreWhitespace: true }); + expect(filtered?.kind).toBe("files"); + if (filtered?.kind !== "files") return; + expect(getDiffLineStat(filtered.files)).toEqual({ additions, deletions }); + }); + + it.each(["+", "-"])("keeps %s blank lines without a final newline", (sign) => { + const parsed = getRenderablePatch( + [ + "diff --git a/blank.txt b/blank.txt", + "--- a/blank.txt", + "+++ b/blank.txt", + sign === "+" ? "@@ -0,0 +1 @@" : "@@ -1 +0,0 @@", + `${sign} `, + "\\ No newline at end of file", + ].join("\n"), + "pr", + { ignoreWhitespace: true }, + ); + expect(parsed?.kind).toBe("files"); + if (parsed?.kind !== "files") return; + expect(getDiffLineStat(parsed.files)).toEqual({ + additions: sign === "+" ? 1 : 0, + deletions: sign === "-" ? 1 : 0, + }); + }); + it("compacts partial hunk render offsets for virtualized review diffs", () => { const patch = [ "diff --git a/example.ts b/example.ts", diff --git a/apps/web/src/lib/diffRendering.ts b/apps/web/src/lib/diffRendering.ts index 4708ae6685f2..a1b4467cf7e9 100644 --- a/apps/web/src/lib/diffRendering.ts +++ b/apps/web/src/lib/diffRendering.ts @@ -1,4 +1,5 @@ import { parsePatchFiles } from "@pierre/diffs/utils/parsePatchFiles"; +import { parseDiffFromFile } from "@pierre/diffs"; import type { FileDiffMetadata } from "@pierre/diffs/types"; export const DIFF_THEME_NAMES = { @@ -45,6 +46,7 @@ export type RenderablePatch = | { kind: "files"; files: FileDiffMetadata[]; + sourceFiles: FileDiffMetadata[]; } | { kind: "raw"; @@ -72,6 +74,7 @@ export function getDiffLineStat(files: ReadonlyArray): DiffLin } interface RenderablePatchOptions { + ignoreWhitespace?: boolean; /** * Pierre's partial-patch parser keeps hunk render starts in source-file * coordinates. Its virtualizer iterates partial patches as compact rows, so @@ -81,6 +84,59 @@ interface RenderablePatchOptions { compactPartialHunkOffsets?: boolean; } +function hideWhitespaceChanges(file: FileDiffMetadata): FileDiffMetadata { + let splitDelta = 0; + let unifiedDelta = 0; + const hunks = file.hunks.map((hunk) => { + const oldContents = file.deletionLines + .slice(hunk.deletionLineIndex, hunk.deletionLineIndex + hunk.deletionCount) + .map((line) => `${line.replace(/\s/g, "")}\n`) + .join(""); + const newContents = file.additionLines + .slice(hunk.additionLineIndex, hunk.additionLineIndex + hunk.additionCount) + .map((line) => `${line.replace(/\s/g, "")}\n`) + .join(""); + const filtered = parseDiffFromFile( + { name: file.name, contents: oldContents }, + { name: file.name, contents: newContents }, + { context: Infinity }, + ).hunks[0]; + const next = { + ...hunk, + additionLines: filtered?.additionLines ?? 0, + deletionLines: filtered?.deletionLines ?? 0, + hunkContent: filtered + ? filtered.hunkContent.map((content) => ({ + ...content, + additionLineIndex: content.additionLineIndex + hunk.additionLineIndex, + deletionLineIndex: content.deletionLineIndex + hunk.deletionLineIndex, + })) + : [ + { + type: "context" as const, + lines: hunk.additionCount, + additionLineIndex: hunk.additionLineIndex, + deletionLineIndex: hunk.deletionLineIndex, + }, + ], + splitLineStart: hunk.splitLineStart + splitDelta, + unifiedLineStart: hunk.unifiedLineStart + unifiedDelta, + splitLineCount: filtered?.splitLineCount ?? hunk.additionCount, + unifiedLineCount: filtered?.unifiedLineCount ?? hunk.additionCount, + }; + splitDelta += next.splitLineCount - hunk.splitLineCount; + unifiedDelta += next.unifiedLineCount - hunk.unifiedLineCount; + return next; + }); + return { + ...file, + hunks, + splitLineCount: file.splitLineCount + splitDelta, + unifiedLineCount: file.unifiedLineCount + unifiedDelta, + ...(file.cacheKey ? { cacheKey: `${file.cacheKey}:ignore-whitespace` } : {}), + }; +} + export function compactPartialHunkOffsets(file: FileDiffMetadata): FileDiffMetadata { if (!file.isPartial) return file; @@ -120,13 +176,13 @@ export function getRenderablePatch( normalizedPatch, buildPatchCacheKey(normalizedPatch, cacheScope), ); - const files = parsedPatches.flatMap((parsedPatch) => - options.compactPartialHunkOffsets - ? parsedPatch.files.map(compactPartialHunkOffsets) - : parsedPatch.files, - ); + const sourceFiles = parsedPatches.flatMap((parsedPatch) => parsedPatch.files); + const files = sourceFiles.map((file) => { + const filtered = options.ignoreWhitespace ? hideWhitespaceChanges(file) : file; + return options.compactPartialHunkOffsets ? compactPartialHunkOffsets(filtered) : filtered; + }); if (files.length > 0) { - return { kind: "files", files }; + return { kind: "files", files, sourceFiles }; } return { diff --git a/apps/web/src/pendingUserInput.test.ts b/apps/web/src/pendingUserInput.test.ts index 7ccc59ff1016..142c05997599 100644 --- a/apps/web/src/pendingUserInput.test.ts +++ b/apps/web/src/pendingUserInput.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from "vite-plus/test"; import { buildPendingUserInputAnswers, + carryDisplacedCustomAnswerIntoPrompt, countAnsweredPendingUserInputQuestions, derivePendingUserInputProgress, resolvePendingUserInputAnswer, @@ -302,3 +303,21 @@ describe("pending user input question progress", () => { }); }); }); +describe("carryDisplacedCustomAnswerIntoPrompt", () => { + it("keeps the thread draft when nothing was typed into the answer", () => { + expect(carryDisplacedCustomAnswerIntoPrompt("draft", undefined)).toBe("draft"); + expect(carryDisplacedCustomAnswerIntoPrompt("draft", " ")).toBe("draft"); + }); + + it("moves the typed answer into an empty thread draft", () => { + expect(carryDisplacedCustomAnswerIntoPrompt("", "also rename the flag ")).toBe( + "also rename the flag", + ); + }); + + it("appends the typed answer after an existing thread draft", () => { + expect(carryDisplacedCustomAnswerIntoPrompt("first half\n", "second half")).toBe( + "first half\n\nsecond half", + ); + }); +}); diff --git a/apps/web/src/pendingUserInput.ts b/apps/web/src/pendingUserInput.ts index a10e9d716c22..0747df76818d 100644 --- a/apps/web/src/pendingUserInput.ts +++ b/apps/web/src/pendingUserInput.ts @@ -72,6 +72,28 @@ export function setPendingUserInputCustomAnswer( }; } +const DISPLACED_ANSWER_SEPARATOR = "\n\n"; + +/** + * Selecting an option replaces the custom answer, because a non-empty custom + * answer outranks selected options in `resolvePendingUserInputAnswer`. Text the + * user typed into the answer field must not vanish on that click: it moves back + * into the thread draft, after whatever was already waiting there. + */ +export function carryDisplacedCustomAnswerIntoPrompt( + prompt: string, + customAnswer: string | undefined, +): string { + const displaced = customAnswer?.trim() ?? ""; + if (displaced.length === 0) { + return prompt; + } + if (prompt.trim().length === 0) { + return displaced; + } + return `${prompt.trimEnd()}${DISPLACED_ANSWER_SEPARATOR}${displaced}`; +} + export function togglePendingUserInputOptionSelection( question: UserInputQuestion, draft: PendingUserInputDraftAnswer | undefined, diff --git a/apps/web/src/shortcutModifierState.test.ts b/apps/web/src/shortcutModifierState.test.ts index 4ef4b3b6bf2d..20b63220072d 100644 --- a/apps/web/src/shortcutModifierState.test.ts +++ b/apps/web/src/shortcutModifierState.test.ts @@ -1,8 +1,13 @@ -import { describe, expect, it } from "vite-plus/test"; +// @vitest-environment jsdom + +import { act, createElement } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test"; import { areShortcutModifierStatesEqual, shortcutModifierStateAfterKeyboardEvent, + useShortcutModifierState, type ShortcutModifierState, } from "./shortcutModifierState"; @@ -13,6 +18,67 @@ const emptyState = (): ShortcutModifierState => ({ shiftKey: false, }); +describe("useShortcutModifierState", () => { + let root: Root; + let container: HTMLDivElement; + + beforeEach(() => { + vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true); + container = document.createElement("div"); + document.body.append(container); + root = createRoot(container); + }); + + afterEach(async () => { + await act(async () => root.unmount()); + container.remove(); + vi.unstubAllGlobals(); + }); + + it.each(["keyup", "paste", "blur"] as const)( + "does not render for unchanged modifiers after %s resets the state", + async (reset) => { + const render = vi.fn(); + function Consumer() { + render(useShortcutModifierState()); + return null; + } + await act(async () => { + root.render(createElement(Consumer)); + }); + const press = async (type: "keydown" | "keyup", key: string, shiftKey = false) => { + await act(async () => { + window.dispatchEvent(new KeyboardEvent(type, { key, shiftKey })); + }); + }; + + await press("keydown", "Shift", true); + expect(render).toHaveBeenLastCalledWith({ ...emptyState(), shiftKey: true }); + if (reset === "keyup") { + await press("keyup", "Shift"); + } else { + await act(async () => { + window.dispatchEvent(new Event(reset)); + }); + } + expect(render).toHaveBeenLastCalledWith(emptyState()); + render.mockClear(); + + for (const key of "typing") { + await press("keydown", key); + await press("keyup", key); + } + await act(async () => { + window.dispatchEvent(new Event("paste")); + window.dispatchEvent(new Event("blur")); + }); + expect(render).not.toHaveBeenCalled(); + await press("keydown", "Shift", true); + expect(render).toHaveBeenCalledExactlyOnceWith({ ...emptyState(), shiftKey: true }); + }, + ); +}); + function keyboardEventLike(type: "keydown" | "keyup", init: Partial): KeyboardEvent { return { type, diff --git a/apps/web/src/shortcutModifierState.ts b/apps/web/src/shortcutModifierState.ts index 3abeeaa3e8aa..15d6e0a1bcae 100644 --- a/apps/web/src/shortcutModifierState.ts +++ b/apps/web/src/shortcutModifierState.ts @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useEffect, useRef, useState } from "react"; export interface ShortcutModifierState { metaKey: boolean; @@ -28,10 +28,18 @@ export function areShortcutModifierStatesEqual( export function useShortcutModifierState(): ShortcutModifierState { const [state, setState] = useState(EMPTY_SHORTCUT_MODIFIER_STATE); + const stateRef = useRef(EMPTY_SHORTCUT_MODIFIER_STATE); useEffect(() => { + const updateState = (next: ShortcutModifierState) => { + // Even a no-op state dispatch can cost work in the sidebar's large tree. + // Ordinary typing must return before dispatching a React update. + if (areShortcutModifierStatesEqual(stateRef.current, next)) return; + stateRef.current = next; + setState(next); + }; const onKeyboardEvent = (event: KeyboardEvent) => { - setState((current) => shortcutModifierStateAfterKeyboardEvent(current, event)); + updateState(shortcutModifierStateAfterKeyboardEvent(stateRef.current, event)); }; // Dictation tools (Wispr Flow) paste with a synthetic ⌘V whose Meta keyup // never reaches the page, so the tracked state stays "⌘ held" forever and @@ -39,11 +47,7 @@ export function useShortcutModifierState(): ShortcutModifierState { // treat it like a blur and reset. A physically held modifier re-registers // on the next real key event. const onResetEvent = () => { - setState((current) => - areShortcutModifierStatesEqual(current, EMPTY_SHORTCUT_MODIFIER_STATE) - ? current - : EMPTY_SHORTCUT_MODIFIER_STATE, - ); + updateState(EMPTY_SHORTCUT_MODIFIER_STATE); }; window.addEventListener("keydown", onKeyboardEvent, true); diff --git a/docs/user/composer.md b/docs/user/composer.md index ad6e6f5e4ffb..67303218d33a 100644 --- a/docs/user/composer.md +++ b/docs/user/composer.md @@ -10,7 +10,8 @@ composers. You can attach images up to 10 MB. On servers that support file uploads, you can also attach videos, text files, PDFs, ZIP archives, and other files. Each file can be up to the limit advertised -by the server, capped at 50 MB. Each message can contain up to eight attachments in total. Files +by the server, capped at 50 MB. Each message can contain up to 100 attachments in total. Images +can total up to 80 MiB per message. Files upload directly to the environment, where your agent can read, copy, or edit them by their file path. Attachments upload as soon as you add them while connected to a server that supports uploads. diff --git a/packages/client-runtime/src/codexFileCitations.ts b/packages/client-runtime/src/codexFileCitations.ts index b5042f0806e6..d29996501ea6 100644 --- a/packages/client-runtime/src/codexFileCitations.ts +++ b/packages/client-runtime/src/codexFileCitations.ts @@ -44,6 +44,7 @@ function markdownLabel(value: string): string { function markdownDestination(value: string): string { return value + .replaceAll("\\", "%5C") .replaceAll("<", "%3C") .replaceAll(">", "%3E") .replaceAll("\r", "%0D") diff --git a/packages/client-runtime/src/codexMarkdownDirectives.test.ts b/packages/client-runtime/src/codexMarkdownDirectives.test.ts index b2a22901eac2..efd5262d073c 100644 --- a/packages/client-runtime/src/codexMarkdownDirectives.test.ts +++ b/packages/client-runtime/src/codexMarkdownDirectives.test.ts @@ -8,6 +8,7 @@ import { renderCodexFileCitationsAsMarkdown, splitCodexArtifactTemplateMarkdown, } from "./codexMarkdownDirectives.js"; +import { parseMarkdownFileLink } from "./markdownLinks.js"; interface TestNode { readonly type: string; @@ -89,6 +90,24 @@ describe("remarkCodexDirectives", () => { }); }); +describe.each([ + { name: "renderCodexDirectivesForCopy", render: renderCodexDirectivesForCopy }, + { name: "renderCodexFileCitationsAsMarkdown", render: renderCodexFileCitationsAsMarkdown }, +])("$name file citation round trips", ({ render }) => { + it.each([ + "C:\\Users\\test\\[draft]\\report.md", + "\\\\server\\share\\report.md", + "outputs/report.md", + "/tmp/report%5C.md", + ])("preserves the literal path and line: %s", (path) => { + const markdown = render(`:codex-file-citation{path="${path}" line_range_start="7"}`); + const link = parseOrdinaryMarkdown(markdown).children?.[0]?.children?.[0]; + + expect(link?.type).toBe("link"); + expect(parseMarkdownFileLink(link?.url ?? "")).toEqual({ path, line: 7 }); + }); +}); + describe("native Markdown adapters", () => { it("uses the same parser to render file citations as portable links", () => { expect(renderCodexFileCitationsAsMarkdown(`Created ${FILE_CITATION}.`)).toBe( diff --git a/packages/client-runtime/src/platform/persistence.test.ts b/packages/client-runtime/src/platform/persistence.test.ts new file mode 100644 index 000000000000..3f779625373e --- /dev/null +++ b/packages/client-runtime/src/platform/persistence.test.ts @@ -0,0 +1,46 @@ +import { + OrchestrationProjectShell, + OrchestrationShellSnapshot, + OrchestrationThreadShell, +} from "@t3tools/contracts"; +import { describe, expect, it } from "@effect/vitest"; +import * as Arr from "effect/Array"; +import * as Effect from "effect/Effect"; +import * as Schema from "effect/Schema"; +import * as FastCheck from "effect/testing/FastCheck"; + +import { encodeShellSnapshotForCache } from "./persistence.ts"; + +// Generated values can hold untrimmed strings, which a decoded value never +// has. One encode and decode gives a value a client can hold; values that +// fail are dropped. +const sampleDecoded = (schema: S) => + Effect.gen(function* () { + const encode = Schema.encodeEffect(schema); + const decode = Schema.decodeEffect(schema); + const generated = FastCheck.sample(Schema.toArbitrary(schema), { numRuns: 1000 }); + const decoded = yield* Effect.forEach(generated, (value) => + encode(value).pipe(Effect.flatMap(decode), Effect.option), + ); + return Arr.getSomes(decoded); + }); +const encodeSnapshot = Schema.encodeEffect(OrchestrationShellSnapshot); + +describe("encodeShellSnapshotForCache", () => { + it.effect("matches the Schema encoding of a generated snapshot", () => + Effect.gen(function* () { + const threads = yield* sampleDecoded(OrchestrationThreadShell); + const projects = yield* sampleDecoded(OrchestrationProjectShell); + const snapshot: OrchestrationShellSnapshot = { + snapshotSequence: 1, + projects, + threads, + updatedAt: "2026-09-25T00:00:00.000Z", + }; + + expect(threads.length).toBeGreaterThan(0); + expect(projects.length).toBeGreaterThan(0); + expect(yield* encodeShellSnapshotForCache(snapshot)).toEqual(yield* encodeSnapshot(snapshot)); + }), + ); +}); diff --git a/packages/client-runtime/src/platform/persistence.ts b/packages/client-runtime/src/platform/persistence.ts index 14a322bcd303..77d1498af9eb 100644 --- a/packages/client-runtime/src/platform/persistence.ts +++ b/packages/client-runtime/src/platform/persistence.ts @@ -1,5 +1,6 @@ import { type EnvironmentId, + OrchestrationProjectShell, type OrchestrationShellSnapshot, type OrchestrationThreadDetailSnapshot, type ServerConfig, @@ -122,6 +123,21 @@ export class EnvironmentCacheStore extends Context.Service< } >()("@t3tools/client-runtime/platform/persistence/EnvironmentCacheStore") {} +const encodeProjectShells = Schema.encodeEffect(Schema.Array(OrchestrationProjectShell)); + +/** + * Encodes a shell snapshot for `EnvironmentCacheStore.saveShell`. The result + * equals `Schema.encode(OrchestrationShellSnapshot)`, so the cache format does + * not change. Walking thousands of threads through Schema blocks the UI + * thread, and a decoded thread shell is already in its encoded form, so only + * the projects go through Schema: their icon has a real encode transform. + */ +export const encodeShellSnapshotForCache = (snapshot: OrchestrationShellSnapshot) => + Effect.map( + encodeProjectShells(snapshot.projects), + (projects) => ({ ...snapshot, projects }) satisfies typeof OrchestrationShellSnapshot.Encoded, + ); + export class EnvironmentOwnedDataCleanup extends Context.Reference<{ readonly clear: (environmentId: EnvironmentId) => Effect.Effect; }>("@t3tools/client-runtime/platform/persistence/EnvironmentOwnedDataCleanup", { diff --git a/packages/contracts/src/orchestration.ts b/packages/contracts/src/orchestration.ts index 897df6666f90..4feff09e7c9c 100644 --- a/packages/contracts/src/orchestration.ts +++ b/packages/contracts/src/orchestration.ts @@ -157,8 +157,9 @@ export const ProviderUserInputAnswers = Schema.Record(Schema.String, Schema.Unkn export type ProviderUserInputAnswers = typeof ProviderUserInputAnswers.Type; export const PROVIDER_SEND_TURN_MAX_INPUT_CHARS = 120_000; -export const PROVIDER_SEND_TURN_MAX_ATTACHMENTS = 8; +export const PROVIDER_SEND_TURN_MAX_ATTACHMENTS = 100; export const PROVIDER_SEND_TURN_MAX_IMAGE_BYTES = 10 * 1024 * 1024; +const PROVIDER_SEND_TURN_MAX_TOTAL_IMAGE_BYTES = 80 * 1024 * 1024; export const PROVIDER_SEND_TURN_MAX_FILE_BYTES = 50 * 1024 * 1024; export const PROVIDER_SEND_TURN_SUPPORTED_IMAGE_MIME_TYPES = [ "image/gif", @@ -246,6 +247,25 @@ export const ChatAttachment = Schema.Union([ ChatUnknownAttachment, ]); export type ChatAttachment = typeof ChatAttachment.Type; + +export function getProviderAttachmentLimitError( + attachments: ReadonlyArray>, +): string | undefined { + if (attachments.length > PROVIDER_SEND_TURN_MAX_ATTACHMENTS) { + return `You can attach up to ${PROVIDER_SEND_TURN_MAX_ATTACHMENTS} files per message.`; + } + const imageBytes = attachments.reduce( + (total, attachment) => + total + + (attachment.type === "image" || isProviderSendTurnSupportedImageMimeType(attachment.mimeType) + ? attachment.sizeBytes + : 0), + 0, + ); + if (imageBytes > PROVIDER_SEND_TURN_MAX_TOTAL_IMAGE_BYTES) { + return "Images can total up to 80 MiB per message. Use smaller images or send fewer at once."; + } +} const UploadChatAttachment = Schema.Union([UploadChatImageAttachment]); export type UploadChatAttachment = typeof UploadChatAttachment.Type; diff --git a/packages/contracts/src/provider.test.ts b/packages/contracts/src/provider.test.ts index ba7ca63745b6..2c25977b7ed4 100644 --- a/packages/contracts/src/provider.test.ts +++ b/packages/contracts/src/provider.test.ts @@ -121,6 +121,57 @@ describe("ProviderSessionStartInput", () => { }); describe("ProviderSendTurnInput", () => { + it("accepts 100 attachments and rejects 101", () => { + const attachments = Array.from({ length: 100 }, (_, index) => ({ + type: "image", + id: `image-${index}`, + name: "image.png", + mimeType: "image/png", + sizeBytes: 1, + })); + expect( + decodeProviderSendTurnInput({ threadId: "thread-1", attachments }).attachments, + ).toHaveLength(100); + expect(() => + decodeProviderSendTurnInput({ + threadId: "thread-1", + attachments: [...attachments, attachments[0]], + }), + ).toThrow(); + }); + + it.each(["image", "file"])( + "caps total image bytes for %s attachments without charging videos", + (type) => { + const image = { + type, + id: "image", + name: "image.png", + mimeType: "image/png", + sizeBytes: 10 * 1024 * 1024, + }; + const video = { + type: "file", + id: "video", + name: "video.mp4", + mimeType: "video/mp4", + sizeBytes: 50 * 1024 * 1024, + }; + expect( + decodeProviderSendTurnInput({ + threadId: "thread-1", + attachments: [...Array.from({ length: 8 }, () => image), video], + }).attachments, + ).toHaveLength(9); + expect(() => + decodeProviderSendTurnInput({ + threadId: "thread-1", + attachments: [...Array.from({ length: 8 }, () => image), { ...image, sizeBytes: 1 }], + }), + ).toThrow(/80 MiB/); + }, + ); + it("accepts codex modelSelection", () => { const parsed = decodeProviderSendTurnInput({ threadId: "thread-1", diff --git a/packages/contracts/src/provider.ts b/packages/contracts/src/provider.ts index 3f9570a30233..400538245a9d 100644 --- a/packages/contracts/src/provider.ts +++ b/packages/contracts/src/provider.ts @@ -10,8 +10,8 @@ import { } from "./baseSchemas.ts"; import { ChatAttachment, + getProviderAttachmentLimitError, ModelSelection, - PROVIDER_SEND_TURN_MAX_ATTACHMENTS, PROVIDER_SEND_TURN_MAX_INPUT_CHARS, ProviderApprovalDecision, ProviderApprovalPolicy, @@ -74,7 +74,9 @@ export const ProviderSendTurnInput = Schema.Struct({ TrimmedNonEmptyString.check(Schema.isMaxLength(PROVIDER_SEND_TURN_MAX_INPUT_CHARS)), ), attachments: Schema.optional( - Schema.Array(ChatAttachment).check(Schema.isMaxLength(PROVIDER_SEND_TURN_MAX_ATTACHMENTS)), + Schema.Array(ChatAttachment).check( + Schema.makeFilter((attachments) => getProviderAttachmentLimitError(attachments) ?? true), + ), ), modelSelection: Schema.optional(ModelSelection), interactionMode: Schema.optional(ProviderInteractionMode), diff --git a/packages/effect-acp/src/errors.ts b/packages/effect-acp/src/errors.ts index a3e6ffa65c2e..38a9e016d386 100644 --- a/packages/effect-acp/src/errors.ts +++ b/packages/effect-acp/src/errors.ts @@ -95,13 +95,15 @@ export class AcpProcessExitedError extends Schema.TaggedErrorClass 0 ? `${base}\n${excerpt}` : base; } } diff --git a/packages/effect-codex-app-server/scripts/generate.ts b/packages/effect-codex-app-server/scripts/generate.ts index 88a85f9eac59..55b20bd3cdc3 100644 --- a/packages/effect-codex-app-server/scripts/generate.ts +++ b/packages/effect-codex-app-server/scripts/generate.ts @@ -17,7 +17,7 @@ import { } from "effect/unstable/http"; import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -const UPSTREAM_REF = "678157acaa819d5510adfe359abb5d0392cfe461"; +const UPSTREAM_REF = "687a119f0fcaace47e1f1abcc77cec6c813fd6da"; const USER_AGENT = "effect-codex-app-server-generator"; const GITHUB_API_BASE = "https://api.github.com/repos/openai/codex/contents/codex-rs/app-server-protocol"; @@ -166,28 +166,8 @@ const Codex0150DefinitionSchemas: Record = { type: "string", enum: ["inProgress", "completed", "failed", "interrupted"], }, - PlanType: { - type: "string", - enum: [ - "free", - "go", - "plus", - "pro", - "prolite", - "team", - "self_serve_business_prolite", - "self_serve_business_usage_based", - "business", - "ent26", - "enterprise_cbp_automation", - "enterprise_cbp_usage_based", - "enterprise", - "edu", - "edu_plus", - "edu_pro", - "unknown", - ], - }, + // Unknown plan slugs are labels, not protocol failures (upstream #14304). + PlanType: { type: "string" }, SubAgentActivityKind: { type: "string", enum: ["started", "interacted", "interrupted", "completed"], @@ -506,6 +486,9 @@ function resolveResponseTypeName( generatedSchemaNames: ReadonlySet, ): string { const overrides: Record = { + "account/gatewayOAuth/cancel": "GatewayOAuthCancelResponse", + "account/gatewayOAuth/login": "GatewayOAuthLoginResponse", + "account/gatewayOAuth/read": "GatewayOAuthReadResponse", "account/logout": "LogoutAccountResponse", "account/rateLimits/read": "GetAccountRateLimitsResponse", "account/usage/read": "GetAccountTokenUsageResponse", diff --git a/packages/effect-codex-app-server/src/_generated/meta.gen.ts b/packages/effect-codex-app-server/src/_generated/meta.gen.ts index 24452e881f66..1c9d47e58523 100644 --- a/packages/effect-codex-app-server/src/_generated/meta.gen.ts +++ b/packages/effect-codex-app-server/src/_generated/meta.gen.ts @@ -1,5 +1,5 @@ // This file is generated by the effect-codex-app-server package. Do not edit manually. -// Upstream protocol ref: 678157acaa819d5510adfe359abb5d0392cfe461 +// Upstream protocol ref: 687a119f0fcaace47e1f1abcc77cec6c813fd6da import * as CodexSchema from "./schema.gen.ts"; @@ -16,14 +16,24 @@ export const CLIENT_REQUEST_METHODS = { "thread/goal/get": "thread/goal/get", "thread/goal/clear": "thread/goal/clear", "thread/metadata/update": "thread/metadata/update", + "thread/attachment/add": "thread/attachment/add", + "thread/attachment/list": "thread/attachment/list", + "thread/attachment/remove": "thread/attachment/remove", + "thread/section/move": "thread/section/move", "thread/unarchive": "thread/unarchive", "thread/compact/start": "thread/compact/start", "thread/shellCommand": "thread/shellCommand", "thread/approveGuardianDeniedAction": "thread/approveGuardianDeniedAction", - "thread/rollback": "thread/rollback", + "thread/revert": "thread/revert", "thread/list": "thread/list", + "threadSection/list": "threadSection/list", + "threadSection/create": "threadSection/create", + "threadSection/update": "threadSection/update", + "threadSection/delete": "threadSection/delete", "thread/loaded/list": "thread/loaded/list", "thread/read": "thread/read", + "thread/turns/list": "thread/turns/list", + "thread/items/list": "thread/items/list", "thread/inject_items": "thread/inject_items", "skills/list": "skills/list", "skills/extraRoots/set": "skills/extraRoots/set", @@ -33,6 +43,7 @@ export const CLIENT_REQUEST_METHODS = { "marketplace/upgrade": "marketplace/upgrade", "plugin/list": "plugin/list", "plugin/installed": "plugin/installed", + "plugin/reconcile": "plugin/reconcile", "plugin/read": "plugin/read", "plugin/skill/read": "plugin/skill/read", "plugin/share/save": "plugin/share/save", @@ -60,6 +71,9 @@ export const CLIENT_REQUEST_METHODS = { "turn/interrupt": "turn/interrupt", "review/start": "review/start", "model/list": "model/list", + "account/gatewayOAuth/read": "account/gatewayOAuth/read", + "account/gatewayOAuth/login": "account/gatewayOAuth/login", + "account/gatewayOAuth/cancel": "account/gatewayOAuth/cancel", "modelProvider/capabilities/read": "modelProvider/capabilities/read", "experimentalFeature/list": "experimentalFeature/list", "permissionProfile/list": "permissionProfile/list", @@ -87,6 +101,7 @@ export const CLIENT_REQUEST_METHODS = { "config/read": "config/read", "externalAgentConfig/detect": "externalAgentConfig/detect", "externalAgentConfig/import": "externalAgentConfig/import", + "externalAgentConfig/import/recordHistory": "externalAgentConfig/import/recordHistory", "externalAgentConfig/import/readHistories": "externalAgentConfig/import/readHistories", "config/value/write": "config/value/write", "config/batchWrite": "config/batchWrite", @@ -123,10 +138,15 @@ export const SERVER_NOTIFICATION_METHODS = { "thread/deleted": "thread/deleted", "thread/unarchived": "thread/unarchived", "thread/closed": "thread/closed", + "thread/reverted": "thread/reverted", "skills/changed": "skills/changed", "thread/name/updated": "thread/name/updated", + "thread/attachment/updated": "thread/attachment/updated", "thread/goal/updated": "thread/goal/updated", "thread/goal/cleared": "thread/goal/cleared", + "thread/queue/changed": "thread/queue/changed", + "project/changed": "project/changed", + "thread/project/updated": "thread/project/updated", "thread/environment/connected": "thread/environment/connected", "thread/environment/disconnected": "thread/environment/disconnected", "thread/settings/updated": "thread/settings/updated", @@ -140,6 +160,7 @@ export const SERVER_NOTIFICATION_METHODS = { "item/started": "item/started", "item/autoApprovalReview/started": "item/autoApprovalReview/started", "item/autoApprovalReview/completed": "item/autoApprovalReview/completed", + "autoApprovalReview/strictReviewRequired": "autoApprovalReview/strictReviewRequired", "item/completed": "item/completed", "rawResponseItem/completed": "rawResponseItem/completed", "rawResponse/completed": "rawResponse/completed", @@ -156,7 +177,9 @@ export const SERVER_NOTIFICATION_METHODS = { "item/mcpToolCall/progress": "item/mcpToolCall/progress", "mcpServer/oauthLogin/completed": "mcpServer/oauthLogin/completed", "mcpServer/startupStatus/updated": "mcpServer/startupStatus/updated", + "mcpServer/event/stream/notification": "mcpServer/event/stream/notification", "account/updated": "account/updated", + "account/gatewayOAuth/changed": "account/gatewayOAuth/changed", "account/rateLimits/updated": "account/rateLimits/updated", "app/list/updated": "app/list/updated", "remoteControl/status/changed": "remoteControl/status/changed", @@ -169,6 +192,8 @@ export const SERVER_NOTIFICATION_METHODS = { "thread/compacted": "thread/compacted", "model/rerouted": "model/rerouted", "model/verification": "model/verification", + "modelProvider/authRecoveryStarted": "modelProvider/authRecoveryStarted", + "modelProvider/authRecoveryCompleted": "modelProvider/authRecoveryCompleted", "turn/moderationMetadata": "turn/moderationMetadata", "model/safetyBuffering/updated": "model/safetyBuffering/updated", warning: "warning", @@ -179,6 +204,9 @@ export const SERVER_NOTIFICATION_METHODS = { "fuzzyFileSearch/sessionCompleted": "fuzzyFileSearch/sessionCompleted", "thread/realtime/started": "thread/realtime/started", "thread/realtime/itemAdded": "thread/realtime/itemAdded", + "thread/realtime/item/started": "thread/realtime/item/started", + "thread/realtime/item/transcript/delta": "thread/realtime/item/transcript/delta", + "thread/realtime/item/completed": "thread/realtime/item/completed", "thread/realtime/transcript/delta": "thread/realtime/transcript/delta", "thread/realtime/transcript/done": "thread/realtime/transcript/done", "thread/realtime/outputAudio/delta": "thread/realtime/outputAudio/delta", @@ -208,14 +236,24 @@ export interface ClientRequestParamsByMethod { readonly "thread/goal/get": CodexSchema.V2ThreadGoalGetParams; readonly "thread/goal/clear": CodexSchema.V2ThreadGoalClearParams; readonly "thread/metadata/update": CodexSchema.V2ThreadMetadataUpdateParams; + readonly "thread/attachment/add": CodexSchema.V2ThreadAttachmentAddParams; + readonly "thread/attachment/list": CodexSchema.V2ThreadAttachmentListParams; + readonly "thread/attachment/remove": CodexSchema.V2ThreadAttachmentRemoveParams; + readonly "thread/section/move": CodexSchema.V2ThreadSectionMoveParams; readonly "thread/unarchive": CodexSchema.V2ThreadUnarchiveParams; readonly "thread/compact/start": CodexSchema.V2ThreadCompactStartParams; readonly "thread/shellCommand": CodexSchema.V2ThreadShellCommandParams; readonly "thread/approveGuardianDeniedAction": CodexSchema.V2ThreadApproveGuardianDeniedActionParams; - readonly "thread/rollback": CodexSchema.V2ThreadRollbackParams; + readonly "thread/revert": CodexSchema.V2ThreadRevertParams; readonly "thread/list": CodexSchema.V2ThreadListParams; + readonly "threadSection/list": CodexSchema.V2ThreadSectionListParams; + readonly "threadSection/create": CodexSchema.V2ThreadSectionCreateParams; + readonly "threadSection/update": CodexSchema.V2ThreadSectionUpdateParams; + readonly "threadSection/delete": CodexSchema.V2ThreadSectionDeleteParams; readonly "thread/loaded/list": CodexSchema.V2ThreadLoadedListParams; readonly "thread/read": CodexSchema.V2ThreadReadParams; + readonly "thread/turns/list": CodexSchema.V2ThreadTurnsListParams; + readonly "thread/items/list": CodexSchema.V2ThreadItemsListParams; readonly "thread/inject_items": CodexSchema.V2ThreadInjectItemsParams; readonly "skills/list": CodexSchema.V2SkillsListParams; readonly "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetParams; @@ -225,6 +263,7 @@ export interface ClientRequestParamsByMethod { readonly "marketplace/upgrade": CodexSchema.V2MarketplaceUpgradeParams; readonly "plugin/list": CodexSchema.V2PluginListParams; readonly "plugin/installed": CodexSchema.V2PluginInstalledParams; + readonly "plugin/reconcile": CodexSchema.V2PluginReconcileParams; readonly "plugin/read": CodexSchema.V2PluginReadParams; readonly "plugin/skill/read": CodexSchema.V2PluginSkillReadParams; readonly "plugin/share/save": CodexSchema.V2PluginShareSaveParams; @@ -252,6 +291,9 @@ export interface ClientRequestParamsByMethod { readonly "turn/interrupt": CodexSchema.V2TurnInterruptParams; readonly "review/start": CodexSchema.V2ReviewStartParams; readonly "model/list": CodexSchema.V2ModelListParams; + readonly "account/gatewayOAuth/read": undefined; + readonly "account/gatewayOAuth/login": undefined; + readonly "account/gatewayOAuth/cancel": undefined; readonly "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadParams; readonly "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListParams; readonly "permissionProfile/list": CodexSchema.V2PermissionProfileListParams; @@ -266,9 +308,9 @@ export interface ClientRequestParamsByMethod { readonly "account/login/start": CodexSchema.V2LoginAccountParams; readonly "account/login/cancel": CodexSchema.V2CancelLoginAccountParams; readonly "account/logout": undefined; - readonly "account/rateLimits/read": undefined; + readonly "account/rateLimits/read": CodexSchema.V2NullableGetAccountRateLimitsParams; readonly "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditParams; - readonly "account/usage/read": undefined; + readonly "account/usage/read": CodexSchema.V2NullableGetAccountTokenUsageParams; readonly "account/workspaceMessages/read": undefined; readonly "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailParams; readonly "feedback/upload": CodexSchema.V2FeedbackUploadParams; @@ -279,6 +321,7 @@ export interface ClientRequestParamsByMethod { readonly "config/read": CodexSchema.V2ConfigReadParams; readonly "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectParams; readonly "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportParams; + readonly "externalAgentConfig/import/recordHistory": CodexSchema.V2ExternalAgentConfigImportHistoryRecordParams; readonly "externalAgentConfig/import/readHistories": undefined; readonly "config/value/write": CodexSchema.V2ConfigValueWriteParams; readonly "config/batchWrite": CodexSchema.V2ConfigBatchWriteParams; @@ -303,14 +346,24 @@ export interface ClientRequestResponsesByMethod { readonly "thread/goal/get": CodexSchema.V2ThreadGoalGetResponse; readonly "thread/goal/clear": CodexSchema.V2ThreadGoalClearResponse; readonly "thread/metadata/update": CodexSchema.V2ThreadMetadataUpdateResponse; + readonly "thread/attachment/add": CodexSchema.V2ThreadAttachmentAddResponse; + readonly "thread/attachment/list": CodexSchema.V2ThreadAttachmentListResponse; + readonly "thread/attachment/remove": CodexSchema.V2ThreadAttachmentRemoveResponse; + readonly "thread/section/move": CodexSchema.V2ThreadSectionMoveResponse; readonly "thread/unarchive": CodexSchema.V2ThreadUnarchiveResponse; readonly "thread/compact/start": CodexSchema.V2ThreadCompactStartResponse; readonly "thread/shellCommand": CodexSchema.V2ThreadShellCommandResponse; readonly "thread/approveGuardianDeniedAction": CodexSchema.V2ThreadApproveGuardianDeniedActionResponse; - readonly "thread/rollback": CodexSchema.V2ThreadRollbackResponse; + readonly "thread/revert": CodexSchema.V2ThreadRevertResponse; readonly "thread/list": CodexSchema.V2ThreadListResponse; + readonly "threadSection/list": CodexSchema.V2ThreadSectionListResponse; + readonly "threadSection/create": CodexSchema.V2ThreadSectionCreateResponse; + readonly "threadSection/update": CodexSchema.V2ThreadSectionUpdateResponse; + readonly "threadSection/delete": CodexSchema.V2ThreadSectionDeleteResponse; readonly "thread/loaded/list": CodexSchema.V2ThreadLoadedListResponse; readonly "thread/read": CodexSchema.V2ThreadReadResponse; + readonly "thread/turns/list": CodexSchema.V2ThreadTurnsListResponse; + readonly "thread/items/list": CodexSchema.V2ThreadItemsListResponse; readonly "thread/inject_items": CodexSchema.V2ThreadInjectItemsResponse; readonly "skills/list": CodexSchema.V2SkillsListResponse; readonly "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetResponse; @@ -320,6 +373,7 @@ export interface ClientRequestResponsesByMethod { readonly "marketplace/upgrade": CodexSchema.V2MarketplaceUpgradeResponse; readonly "plugin/list": CodexSchema.V2PluginListResponse; readonly "plugin/installed": CodexSchema.V2PluginInstalledResponse; + readonly "plugin/reconcile": CodexSchema.V2PluginReconcileResponse; readonly "plugin/read": CodexSchema.V2PluginReadResponse; readonly "plugin/skill/read": CodexSchema.V2PluginSkillReadResponse; readonly "plugin/share/save": CodexSchema.V2PluginShareSaveResponse; @@ -347,6 +401,9 @@ export interface ClientRequestResponsesByMethod { readonly "turn/interrupt": CodexSchema.V2TurnInterruptResponse; readonly "review/start": CodexSchema.V2ReviewStartResponse; readonly "model/list": CodexSchema.V2ModelListResponse; + readonly "account/gatewayOAuth/read": CodexSchema.V2GatewayOAuthReadResponse; + readonly "account/gatewayOAuth/login": CodexSchema.V2GatewayOAuthLoginResponse; + readonly "account/gatewayOAuth/cancel": CodexSchema.V2GatewayOAuthCancelResponse; readonly "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadResponse; readonly "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListResponse; readonly "permissionProfile/list": CodexSchema.V2PermissionProfileListResponse; @@ -374,6 +431,7 @@ export interface ClientRequestResponsesByMethod { readonly "config/read": CodexSchema.V2ConfigReadResponse; readonly "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectResponse; readonly "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportResponse; + readonly "externalAgentConfig/import/recordHistory": CodexSchema.V2ExternalAgentConfigImportHistoryRecordResponse; readonly "externalAgentConfig/import/readHistories": CodexSchema.V2ExternalAgentConfigImportHistoriesReadResponse; readonly "config/value/write": CodexSchema.V2ConfigWriteResponse; readonly "config/batchWrite": CodexSchema.V2ConfigWriteResponse; @@ -423,10 +481,15 @@ export interface ServerNotificationParamsByMethod { readonly "thread/deleted": CodexSchema.V2ThreadDeletedNotification; readonly "thread/unarchived": CodexSchema.V2ThreadUnarchivedNotification; readonly "thread/closed": CodexSchema.V2ThreadClosedNotification; + readonly "thread/reverted": CodexSchema.V2ThreadRevertedNotification; readonly "skills/changed": CodexSchema.V2SkillsChangedNotification; readonly "thread/name/updated": CodexSchema.V2ThreadNameUpdatedNotification; + readonly "thread/attachment/updated": CodexSchema.V2ThreadAttachmentUpdatedNotification; readonly "thread/goal/updated": CodexSchema.V2ThreadGoalUpdatedNotification; readonly "thread/goal/cleared": CodexSchema.V2ThreadGoalClearedNotification; + readonly "thread/queue/changed": CodexSchema.V2ThreadQueueChangedNotification; + readonly "project/changed": CodexSchema.V2ProjectChangedNotification; + readonly "thread/project/updated": CodexSchema.V2ThreadProjectUpdatedNotification; readonly "thread/environment/connected": CodexSchema.V2EnvironmentConnectionNotification; readonly "thread/environment/disconnected": CodexSchema.V2EnvironmentConnectionNotification; readonly "thread/settings/updated": CodexSchema.V2ThreadSettingsUpdatedNotification; @@ -440,6 +503,7 @@ export interface ServerNotificationParamsByMethod { readonly "item/started": CodexSchema.V2ItemStartedNotification; readonly "item/autoApprovalReview/started": CodexSchema.V2ItemGuardianApprovalReviewStartedNotification; readonly "item/autoApprovalReview/completed": CodexSchema.V2ItemGuardianApprovalReviewCompletedNotification; + readonly "autoApprovalReview/strictReviewRequired": CodexSchema.V2StrictReviewRequiredNotification; readonly "item/completed": CodexSchema.V2ItemCompletedNotification; readonly "rawResponseItem/completed": CodexSchema.V2RawResponseItemCompletedNotification; readonly "rawResponse/completed": CodexSchema.V2RawResponseCompletedNotification; @@ -456,7 +520,9 @@ export interface ServerNotificationParamsByMethod { readonly "item/mcpToolCall/progress": CodexSchema.V2McpToolCallProgressNotification; readonly "mcpServer/oauthLogin/completed": CodexSchema.V2McpServerOauthLoginCompletedNotification; readonly "mcpServer/startupStatus/updated": CodexSchema.V2McpServerStatusUpdatedNotification; + readonly "mcpServer/event/stream/notification": CodexSchema.V2McpServerEventStreamNotification; readonly "account/updated": CodexSchema.V2AccountUpdatedNotification; + readonly "account/gatewayOAuth/changed": CodexSchema.V2GatewayOAuthChangedNotification; readonly "account/rateLimits/updated": CodexSchema.V2AccountRateLimitsUpdatedNotification; readonly "app/list/updated": CodexSchema.V2AppListUpdatedNotification; readonly "remoteControl/status/changed": CodexSchema.V2RemoteControlStatusChangedNotification; @@ -469,6 +535,8 @@ export interface ServerNotificationParamsByMethod { readonly "thread/compacted": CodexSchema.V2ContextCompactedNotification; readonly "model/rerouted": CodexSchema.V2ModelReroutedNotification; readonly "model/verification": CodexSchema.V2ModelVerificationNotification; + readonly "modelProvider/authRecoveryStarted": CodexSchema.V2AuthRecoveryNotification; + readonly "modelProvider/authRecoveryCompleted": CodexSchema.V2AuthRecoveryNotification; readonly "turn/moderationMetadata": CodexSchema.V2TurnModerationMetadataNotification; readonly "model/safetyBuffering/updated": CodexSchema.V2ModelSafetyBufferingUpdatedNotification; readonly warning: CodexSchema.V2WarningNotification; @@ -479,6 +547,9 @@ export interface ServerNotificationParamsByMethod { readonly "fuzzyFileSearch/sessionCompleted": CodexSchema.FuzzyFileSearchSessionCompletedNotification; readonly "thread/realtime/started": CodexSchema.V2ThreadRealtimeStartedNotification; readonly "thread/realtime/itemAdded": CodexSchema.V2ThreadRealtimeItemAddedNotification; + readonly "thread/realtime/item/started": CodexSchema.V2ThreadRealtimeItemStartedNotification; + readonly "thread/realtime/item/transcript/delta": CodexSchema.V2ThreadRealtimeItemTranscriptDeltaNotification; + readonly "thread/realtime/item/completed": CodexSchema.V2ThreadRealtimeItemCompletedNotification; readonly "thread/realtime/transcript/delta": CodexSchema.V2ThreadRealtimeTranscriptDeltaNotification; readonly "thread/realtime/transcript/done": CodexSchema.V2ThreadRealtimeTranscriptDoneNotification; readonly "thread/realtime/outputAudio/delta": CodexSchema.V2ThreadRealtimeOutputAudioDeltaNotification; @@ -503,14 +574,24 @@ export const CLIENT_REQUEST_PARAMS = { "thread/goal/get": CodexSchema.V2ThreadGoalGetParams, "thread/goal/clear": CodexSchema.V2ThreadGoalClearParams, "thread/metadata/update": CodexSchema.V2ThreadMetadataUpdateParams, + "thread/attachment/add": CodexSchema.V2ThreadAttachmentAddParams, + "thread/attachment/list": CodexSchema.V2ThreadAttachmentListParams, + "thread/attachment/remove": CodexSchema.V2ThreadAttachmentRemoveParams, + "thread/section/move": CodexSchema.V2ThreadSectionMoveParams, "thread/unarchive": CodexSchema.V2ThreadUnarchiveParams, "thread/compact/start": CodexSchema.V2ThreadCompactStartParams, "thread/shellCommand": CodexSchema.V2ThreadShellCommandParams, "thread/approveGuardianDeniedAction": CodexSchema.V2ThreadApproveGuardianDeniedActionParams, - "thread/rollback": CodexSchema.V2ThreadRollbackParams, + "thread/revert": CodexSchema.V2ThreadRevertParams, "thread/list": CodexSchema.V2ThreadListParams, + "threadSection/list": CodexSchema.V2ThreadSectionListParams, + "threadSection/create": CodexSchema.V2ThreadSectionCreateParams, + "threadSection/update": CodexSchema.V2ThreadSectionUpdateParams, + "threadSection/delete": CodexSchema.V2ThreadSectionDeleteParams, "thread/loaded/list": CodexSchema.V2ThreadLoadedListParams, "thread/read": CodexSchema.V2ThreadReadParams, + "thread/turns/list": CodexSchema.V2ThreadTurnsListParams, + "thread/items/list": CodexSchema.V2ThreadItemsListParams, "thread/inject_items": CodexSchema.V2ThreadInjectItemsParams, "skills/list": CodexSchema.V2SkillsListParams, "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetParams, @@ -520,6 +601,7 @@ export const CLIENT_REQUEST_PARAMS = { "marketplace/upgrade": CodexSchema.V2MarketplaceUpgradeParams, "plugin/list": CodexSchema.V2PluginListParams, "plugin/installed": CodexSchema.V2PluginInstalledParams, + "plugin/reconcile": CodexSchema.V2PluginReconcileParams, "plugin/read": CodexSchema.V2PluginReadParams, "plugin/skill/read": CodexSchema.V2PluginSkillReadParams, "plugin/share/save": CodexSchema.V2PluginShareSaveParams, @@ -547,6 +629,9 @@ export const CLIENT_REQUEST_PARAMS = { "turn/interrupt": CodexSchema.V2TurnInterruptParams, "review/start": CodexSchema.V2ReviewStartParams, "model/list": CodexSchema.V2ModelListParams, + "account/gatewayOAuth/read": undefined, + "account/gatewayOAuth/login": undefined, + "account/gatewayOAuth/cancel": undefined, "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadParams, "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListParams, "permissionProfile/list": CodexSchema.V2PermissionProfileListParams, @@ -561,9 +646,9 @@ export const CLIENT_REQUEST_PARAMS = { "account/login/start": CodexSchema.V2LoginAccountParams, "account/login/cancel": CodexSchema.V2CancelLoginAccountParams, "account/logout": undefined, - "account/rateLimits/read": undefined, + "account/rateLimits/read": CodexSchema.V2NullableGetAccountRateLimitsParams, "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditParams, - "account/usage/read": undefined, + "account/usage/read": CodexSchema.V2NullableGetAccountTokenUsageParams, "account/workspaceMessages/read": undefined, "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailParams, "feedback/upload": CodexSchema.V2FeedbackUploadParams, @@ -574,6 +659,8 @@ export const CLIENT_REQUEST_PARAMS = { "config/read": CodexSchema.V2ConfigReadParams, "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectParams, "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportParams, + "externalAgentConfig/import/recordHistory": + CodexSchema.V2ExternalAgentConfigImportHistoryRecordParams, "externalAgentConfig/import/readHistories": undefined, "config/value/write": CodexSchema.V2ConfigValueWriteParams, "config/batchWrite": CodexSchema.V2ConfigBatchWriteParams, @@ -598,14 +685,24 @@ export const CLIENT_REQUEST_RESPONSES = { "thread/goal/get": CodexSchema.V2ThreadGoalGetResponse, "thread/goal/clear": CodexSchema.V2ThreadGoalClearResponse, "thread/metadata/update": CodexSchema.V2ThreadMetadataUpdateResponse, + "thread/attachment/add": CodexSchema.V2ThreadAttachmentAddResponse, + "thread/attachment/list": CodexSchema.V2ThreadAttachmentListResponse, + "thread/attachment/remove": CodexSchema.V2ThreadAttachmentRemoveResponse, + "thread/section/move": CodexSchema.V2ThreadSectionMoveResponse, "thread/unarchive": CodexSchema.V2ThreadUnarchiveResponse, "thread/compact/start": CodexSchema.V2ThreadCompactStartResponse, "thread/shellCommand": CodexSchema.V2ThreadShellCommandResponse, "thread/approveGuardianDeniedAction": CodexSchema.V2ThreadApproveGuardianDeniedActionResponse, - "thread/rollback": CodexSchema.V2ThreadRollbackResponse, + "thread/revert": CodexSchema.V2ThreadRevertResponse, "thread/list": CodexSchema.V2ThreadListResponse, + "threadSection/list": CodexSchema.V2ThreadSectionListResponse, + "threadSection/create": CodexSchema.V2ThreadSectionCreateResponse, + "threadSection/update": CodexSchema.V2ThreadSectionUpdateResponse, + "threadSection/delete": CodexSchema.V2ThreadSectionDeleteResponse, "thread/loaded/list": CodexSchema.V2ThreadLoadedListResponse, "thread/read": CodexSchema.V2ThreadReadResponse, + "thread/turns/list": CodexSchema.V2ThreadTurnsListResponse, + "thread/items/list": CodexSchema.V2ThreadItemsListResponse, "thread/inject_items": CodexSchema.V2ThreadInjectItemsResponse, "skills/list": CodexSchema.V2SkillsListResponse, "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetResponse, @@ -615,6 +712,7 @@ export const CLIENT_REQUEST_RESPONSES = { "marketplace/upgrade": CodexSchema.V2MarketplaceUpgradeResponse, "plugin/list": CodexSchema.V2PluginListResponse, "plugin/installed": CodexSchema.V2PluginInstalledResponse, + "plugin/reconcile": CodexSchema.V2PluginReconcileResponse, "plugin/read": CodexSchema.V2PluginReadResponse, "plugin/skill/read": CodexSchema.V2PluginSkillReadResponse, "plugin/share/save": CodexSchema.V2PluginShareSaveResponse, @@ -642,6 +740,9 @@ export const CLIENT_REQUEST_RESPONSES = { "turn/interrupt": CodexSchema.V2TurnInterruptResponse, "review/start": CodexSchema.V2ReviewStartResponse, "model/list": CodexSchema.V2ModelListResponse, + "account/gatewayOAuth/read": CodexSchema.V2GatewayOAuthReadResponse, + "account/gatewayOAuth/login": CodexSchema.V2GatewayOAuthLoginResponse, + "account/gatewayOAuth/cancel": CodexSchema.V2GatewayOAuthCancelResponse, "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadResponse, "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListResponse, "permissionProfile/list": CodexSchema.V2PermissionProfileListResponse, @@ -669,6 +770,8 @@ export const CLIENT_REQUEST_RESPONSES = { "config/read": CodexSchema.V2ConfigReadResponse, "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectResponse, "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportResponse, + "externalAgentConfig/import/recordHistory": + CodexSchema.V2ExternalAgentConfigImportHistoryRecordResponse, "externalAgentConfig/import/readHistories": CodexSchema.V2ExternalAgentConfigImportHistoriesReadResponse, "config/value/write": CodexSchema.V2ConfigWriteResponse, @@ -719,10 +822,15 @@ export const SERVER_NOTIFICATION_PARAMS = { "thread/deleted": CodexSchema.V2ThreadDeletedNotification, "thread/unarchived": CodexSchema.V2ThreadUnarchivedNotification, "thread/closed": CodexSchema.V2ThreadClosedNotification, + "thread/reverted": CodexSchema.V2ThreadRevertedNotification, "skills/changed": CodexSchema.V2SkillsChangedNotification, "thread/name/updated": CodexSchema.V2ThreadNameUpdatedNotification, + "thread/attachment/updated": CodexSchema.V2ThreadAttachmentUpdatedNotification, "thread/goal/updated": CodexSchema.V2ThreadGoalUpdatedNotification, "thread/goal/cleared": CodexSchema.V2ThreadGoalClearedNotification, + "thread/queue/changed": CodexSchema.V2ThreadQueueChangedNotification, + "project/changed": CodexSchema.V2ProjectChangedNotification, + "thread/project/updated": CodexSchema.V2ThreadProjectUpdatedNotification, "thread/environment/connected": CodexSchema.V2EnvironmentConnectionNotification, "thread/environment/disconnected": CodexSchema.V2EnvironmentConnectionNotification, "thread/settings/updated": CodexSchema.V2ThreadSettingsUpdatedNotification, @@ -737,6 +845,7 @@ export const SERVER_NOTIFICATION_PARAMS = { "item/autoApprovalReview/started": CodexSchema.V2ItemGuardianApprovalReviewStartedNotification, "item/autoApprovalReview/completed": CodexSchema.V2ItemGuardianApprovalReviewCompletedNotification, + "autoApprovalReview/strictReviewRequired": CodexSchema.V2StrictReviewRequiredNotification, "item/completed": CodexSchema.V2ItemCompletedNotification, "rawResponseItem/completed": CodexSchema.V2RawResponseItemCompletedNotification, "rawResponse/completed": CodexSchema.V2RawResponseCompletedNotification, @@ -753,7 +862,9 @@ export const SERVER_NOTIFICATION_PARAMS = { "item/mcpToolCall/progress": CodexSchema.V2McpToolCallProgressNotification, "mcpServer/oauthLogin/completed": CodexSchema.V2McpServerOauthLoginCompletedNotification, "mcpServer/startupStatus/updated": CodexSchema.V2McpServerStatusUpdatedNotification, + "mcpServer/event/stream/notification": CodexSchema.V2McpServerEventStreamNotification, "account/updated": CodexSchema.V2AccountUpdatedNotification, + "account/gatewayOAuth/changed": CodexSchema.V2GatewayOAuthChangedNotification, "account/rateLimits/updated": CodexSchema.V2AccountRateLimitsUpdatedNotification, "app/list/updated": CodexSchema.V2AppListUpdatedNotification, "remoteControl/status/changed": CodexSchema.V2RemoteControlStatusChangedNotification, @@ -768,6 +879,8 @@ export const SERVER_NOTIFICATION_PARAMS = { "thread/compacted": CodexSchema.V2ContextCompactedNotification, "model/rerouted": CodexSchema.V2ModelReroutedNotification, "model/verification": CodexSchema.V2ModelVerificationNotification, + "modelProvider/authRecoveryStarted": CodexSchema.V2AuthRecoveryNotification, + "modelProvider/authRecoveryCompleted": CodexSchema.V2AuthRecoveryNotification, "turn/moderationMetadata": CodexSchema.V2TurnModerationMetadataNotification, "model/safetyBuffering/updated": CodexSchema.V2ModelSafetyBufferingUpdatedNotification, warning: CodexSchema.V2WarningNotification, @@ -778,6 +891,10 @@ export const SERVER_NOTIFICATION_PARAMS = { "fuzzyFileSearch/sessionCompleted": CodexSchema.FuzzyFileSearchSessionCompletedNotification, "thread/realtime/started": CodexSchema.V2ThreadRealtimeStartedNotification, "thread/realtime/itemAdded": CodexSchema.V2ThreadRealtimeItemAddedNotification, + "thread/realtime/item/started": CodexSchema.V2ThreadRealtimeItemStartedNotification, + "thread/realtime/item/transcript/delta": + CodexSchema.V2ThreadRealtimeItemTranscriptDeltaNotification, + "thread/realtime/item/completed": CodexSchema.V2ThreadRealtimeItemCompletedNotification, "thread/realtime/transcript/delta": CodexSchema.V2ThreadRealtimeTranscriptDeltaNotification, "thread/realtime/transcript/done": CodexSchema.V2ThreadRealtimeTranscriptDoneNotification, "thread/realtime/outputAudio/delta": CodexSchema.V2ThreadRealtimeOutputAudioDeltaNotification, diff --git a/packages/effect-codex-app-server/src/_generated/namespaces.gen.ts b/packages/effect-codex-app-server/src/_generated/namespaces.gen.ts index 8665ad6f436d..47474330d286 100644 --- a/packages/effect-codex-app-server/src/_generated/namespaces.gen.ts +++ b/packages/effect-codex-app-server/src/_generated/namespaces.gen.ts @@ -1,5 +1,5 @@ // This file is generated by the effect-codex-app-server package. Do not edit manually. -// Upstream protocol ref: 678157acaa819d5510adfe359abb5d0392cfe461 +// Upstream protocol ref: 687a119f0fcaace47e1f1abcc77cec6c813fd6da import * as CodexSchema from "./schema.gen.ts"; @@ -20,6 +20,7 @@ export const v2 = { AppsListResponse: CodexSchema.V2AppsListResponse, AppsReadParams: CodexSchema.V2AppsReadParams, AppsReadResponse: CodexSchema.V2AppsReadResponse, + AuthRecoveryNotification: CodexSchema.V2AuthRecoveryNotification, CancelLoginAccountParams: CodexSchema.V2CancelLoginAccountParams, CancelLoginAccountResponse: CodexSchema.V2CancelLoginAccountResponse, CommandExecOutputDeltaNotification: CodexSchema.V2CommandExecOutputDeltaNotification, @@ -56,6 +57,10 @@ export const v2 = { CodexSchema.V2ExternalAgentConfigImportCompletedNotification, ExternalAgentConfigImportHistoriesReadResponse: CodexSchema.V2ExternalAgentConfigImportHistoriesReadResponse, + ExternalAgentConfigImportHistoryRecordParams: + CodexSchema.V2ExternalAgentConfigImportHistoryRecordParams, + ExternalAgentConfigImportHistoryRecordResponse: + CodexSchema.V2ExternalAgentConfigImportHistoryRecordResponse, ExternalAgentConfigImportParams: CodexSchema.V2ExternalAgentConfigImportParams, ExternalAgentConfigImportProgressNotification: CodexSchema.V2ExternalAgentConfigImportProgressNotification, @@ -83,6 +88,10 @@ export const v2 = { FsWatchResponse: CodexSchema.V2FsWatchResponse, FsWriteFileParams: CodexSchema.V2FsWriteFileParams, FsWriteFileResponse: CodexSchema.V2FsWriteFileResponse, + GatewayOAuthCancelResponse: CodexSchema.V2GatewayOAuthCancelResponse, + GatewayOAuthChangedNotification: CodexSchema.V2GatewayOAuthChangedNotification, + GatewayOAuthLoginResponse: CodexSchema.V2GatewayOAuthLoginResponse, + GatewayOAuthReadResponse: CodexSchema.V2GatewayOAuthReadResponse, GetAccountParams: CodexSchema.V2GetAccountParams, GetAccountRateLimitsResponse: CodexSchema.V2GetAccountRateLimitsResponse, GetAccountResponse: CodexSchema.V2GetAccountResponse, @@ -112,6 +121,7 @@ export const v2 = { MarketplaceUpgradeResponse: CodexSchema.V2MarketplaceUpgradeResponse, McpResourceReadParams: CodexSchema.V2McpResourceReadParams, McpResourceReadResponse: CodexSchema.V2McpResourceReadResponse, + McpServerEventStreamNotification: CodexSchema.V2McpServerEventStreamNotification, McpServerOauthLoginCompletedNotification: CodexSchema.V2McpServerOauthLoginCompletedNotification, McpServerOauthLoginParams: CodexSchema.V2McpServerOauthLoginParams, McpServerOauthLoginResponse: CodexSchema.V2McpServerOauthLoginResponse, @@ -127,6 +137,8 @@ export const v2 = { ModelReroutedNotification: CodexSchema.V2ModelReroutedNotification, ModelSafetyBufferingUpdatedNotification: CodexSchema.V2ModelSafetyBufferingUpdatedNotification, ModelVerificationNotification: CodexSchema.V2ModelVerificationNotification, + NullableGetAccountRateLimitsParams: CodexSchema.V2NullableGetAccountRateLimitsParams, + NullableGetAccountTokenUsageParams: CodexSchema.V2NullableGetAccountTokenUsageParams, PermissionProfileListParams: CodexSchema.V2PermissionProfileListParams, PermissionProfileListResponse: CodexSchema.V2PermissionProfileListResponse, PlanDeltaNotification: CodexSchema.V2PlanDeltaNotification, @@ -138,6 +150,8 @@ export const v2 = { PluginListResponse: CodexSchema.V2PluginListResponse, PluginReadParams: CodexSchema.V2PluginReadParams, PluginReadResponse: CodexSchema.V2PluginReadResponse, + PluginReconcileParams: CodexSchema.V2PluginReconcileParams, + PluginReconcileResponse: CodexSchema.V2PluginReconcileResponse, PluginShareCheckoutParams: CodexSchema.V2PluginShareCheckoutParams, PluginShareCheckoutResponse: CodexSchema.V2PluginShareCheckoutResponse, PluginShareDeleteParams: CodexSchema.V2PluginShareDeleteParams, @@ -154,6 +168,7 @@ export const v2 = { PluginUninstallResponse: CodexSchema.V2PluginUninstallResponse, ProcessExitedNotification: CodexSchema.V2ProcessExitedNotification, ProcessOutputDeltaNotification: CodexSchema.V2ProcessOutputDeltaNotification, + ProjectChangedNotification: CodexSchema.V2ProjectChangedNotification, RawResponseCompletedNotification: CodexSchema.V2RawResponseCompletedNotification, RawResponseItemCompletedNotification: CodexSchema.V2RawResponseItemCompletedNotification, ReasoningSummaryPartAddedNotification: CodexSchema.V2ReasoningSummaryPartAddedNotification, @@ -172,6 +187,7 @@ export const v2 = { SkillsExtraRootsSetResponse: CodexSchema.V2SkillsExtraRootsSetResponse, SkillsListParams: CodexSchema.V2SkillsListParams, SkillsListResponse: CodexSchema.V2SkillsListResponse, + StrictReviewRequiredNotification: CodexSchema.V2StrictReviewRequiredNotification, TerminalInteractionNotification: CodexSchema.V2TerminalInteractionNotification, ThreadApproveGuardianDeniedActionParams: CodexSchema.V2ThreadApproveGuardianDeniedActionParams, ThreadApproveGuardianDeniedActionResponse: @@ -179,6 +195,13 @@ export const v2 = { ThreadArchivedNotification: CodexSchema.V2ThreadArchivedNotification, ThreadArchiveParams: CodexSchema.V2ThreadArchiveParams, ThreadArchiveResponse: CodexSchema.V2ThreadArchiveResponse, + ThreadAttachmentAddParams: CodexSchema.V2ThreadAttachmentAddParams, + ThreadAttachmentAddResponse: CodexSchema.V2ThreadAttachmentAddResponse, + ThreadAttachmentListParams: CodexSchema.V2ThreadAttachmentListParams, + ThreadAttachmentListResponse: CodexSchema.V2ThreadAttachmentListResponse, + ThreadAttachmentRemoveParams: CodexSchema.V2ThreadAttachmentRemoveParams, + ThreadAttachmentRemoveResponse: CodexSchema.V2ThreadAttachmentRemoveResponse, + ThreadAttachmentUpdatedNotification: CodexSchema.V2ThreadAttachmentUpdatedNotification, ThreadClosedNotification: CodexSchema.V2ThreadClosedNotification, ThreadCompactStartParams: CodexSchema.V2ThreadCompactStartParams, ThreadCompactStartResponse: CodexSchema.V2ThreadCompactStartResponse, @@ -197,6 +220,8 @@ export const v2 = { ThreadGoalUpdatedNotification: CodexSchema.V2ThreadGoalUpdatedNotification, ThreadInjectItemsParams: CodexSchema.V2ThreadInjectItemsParams, ThreadInjectItemsResponse: CodexSchema.V2ThreadInjectItemsResponse, + ThreadItemsListParams: CodexSchema.V2ThreadItemsListParams, + ThreadItemsListResponse: CodexSchema.V2ThreadItemsListResponse, ThreadListParams: CodexSchema.V2ThreadListParams, ThreadListResponse: CodexSchema.V2ThreadListResponse, ThreadLoadedListParams: CodexSchema.V2ThreadLoadedListParams, @@ -204,11 +229,17 @@ export const v2 = { ThreadMetadataUpdateParams: CodexSchema.V2ThreadMetadataUpdateParams, ThreadMetadataUpdateResponse: CodexSchema.V2ThreadMetadataUpdateResponse, ThreadNameUpdatedNotification: CodexSchema.V2ThreadNameUpdatedNotification, + ThreadProjectUpdatedNotification: CodexSchema.V2ThreadProjectUpdatedNotification, + ThreadQueueChangedNotification: CodexSchema.V2ThreadQueueChangedNotification, ThreadReadParams: CodexSchema.V2ThreadReadParams, ThreadReadResponse: CodexSchema.V2ThreadReadResponse, ThreadRealtimeClosedNotification: CodexSchema.V2ThreadRealtimeClosedNotification, ThreadRealtimeErrorNotification: CodexSchema.V2ThreadRealtimeErrorNotification, ThreadRealtimeItemAddedNotification: CodexSchema.V2ThreadRealtimeItemAddedNotification, + ThreadRealtimeItemCompletedNotification: CodexSchema.V2ThreadRealtimeItemCompletedNotification, + ThreadRealtimeItemStartedNotification: CodexSchema.V2ThreadRealtimeItemStartedNotification, + ThreadRealtimeItemTranscriptDeltaNotification: + CodexSchema.V2ThreadRealtimeItemTranscriptDeltaNotification, ThreadRealtimeOutputAudioDeltaNotification: CodexSchema.V2ThreadRealtimeOutputAudioDeltaNotification, ThreadRealtimeSdpNotification: CodexSchema.V2ThreadRealtimeSdpNotification, @@ -218,8 +249,19 @@ export const v2 = { ThreadRealtimeTranscriptDoneNotification: CodexSchema.V2ThreadRealtimeTranscriptDoneNotification, ThreadResumeParams: CodexSchema.V2ThreadResumeParams, ThreadResumeResponse: CodexSchema.V2ThreadResumeResponse, - ThreadRollbackParams: CodexSchema.V2ThreadRollbackParams, - ThreadRollbackResponse: CodexSchema.V2ThreadRollbackResponse, + ThreadRevertedNotification: CodexSchema.V2ThreadRevertedNotification, + ThreadRevertParams: CodexSchema.V2ThreadRevertParams, + ThreadRevertResponse: CodexSchema.V2ThreadRevertResponse, + ThreadSectionCreateParams: CodexSchema.V2ThreadSectionCreateParams, + ThreadSectionCreateResponse: CodexSchema.V2ThreadSectionCreateResponse, + ThreadSectionDeleteParams: CodexSchema.V2ThreadSectionDeleteParams, + ThreadSectionDeleteResponse: CodexSchema.V2ThreadSectionDeleteResponse, + ThreadSectionListParams: CodexSchema.V2ThreadSectionListParams, + ThreadSectionListResponse: CodexSchema.V2ThreadSectionListResponse, + ThreadSectionMoveParams: CodexSchema.V2ThreadSectionMoveParams, + ThreadSectionMoveResponse: CodexSchema.V2ThreadSectionMoveResponse, + ThreadSectionUpdateParams: CodexSchema.V2ThreadSectionUpdateParams, + ThreadSectionUpdateResponse: CodexSchema.V2ThreadSectionUpdateResponse, ThreadSetNameParams: CodexSchema.V2ThreadSetNameParams, ThreadSetNameResponse: CodexSchema.V2ThreadSetNameResponse, ThreadSettingsUpdatedNotification: CodexSchema.V2ThreadSettingsUpdatedNotification, @@ -230,6 +272,8 @@ export const v2 = { ThreadStartResponse: CodexSchema.V2ThreadStartResponse, ThreadStatusChangedNotification: CodexSchema.V2ThreadStatusChangedNotification, ThreadTokenUsageUpdatedNotification: CodexSchema.V2ThreadTokenUsageUpdatedNotification, + ThreadTurnsListParams: CodexSchema.V2ThreadTurnsListParams, + ThreadTurnsListResponse: CodexSchema.V2ThreadTurnsListResponse, ThreadUnarchivedNotification: CodexSchema.V2ThreadUnarchivedNotification, ThreadUnarchiveParams: CodexSchema.V2ThreadUnarchiveParams, ThreadUnarchiveResponse: CodexSchema.V2ThreadUnarchiveResponse, diff --git a/packages/effect-codex-app-server/src/_generated/schema.gen.ts b/packages/effect-codex-app-server/src/_generated/schema.gen.ts index f4b186147705..38b46712257a 100644 --- a/packages/effect-codex-app-server/src/_generated/schema.gen.ts +++ b/packages/effect-codex-app-server/src/_generated/schema.gen.ts @@ -1,8 +1,13 @@ // This file is generated by the effect-codex-app-server package. Do not edit manually. -// Upstream protocol ref: 678157acaa819d5510adfe359abb5d0392cfe461 +// Upstream protocol ref: 687a119f0fcaace47e1f1abcc77cec6c813fd6da import * as Schema from "effect/Schema"; +export type ApplyPatchApprovalParams__ThreadId = string; +export const ApplyPatchApprovalParams__ThreadId = Schema.String.annotate({ + identifier: "ApplyPatchApprovalParams__ThreadId", +}); + export type ApplyPatchApprovalParams__FileChange = | { readonly content: string; readonly type: "add" } | { readonly content: string; readonly type: "delete" } @@ -24,143 +29,97 @@ export const ApplyPatchApprovalParams__FileChange = Schema.Union( }).annotate({ title: "UpdateFileChange" }), ], { mode: "oneOf" }, -); - -export type ApplyPatchApprovalParams__ThreadId = string; -export const ApplyPatchApprovalParams__ThreadId = Schema.String; +).annotate({ identifier: "ApplyPatchApprovalParams__FileChange" }); export type ApplyPatchApprovalResponse__NetworkPolicyRuleAction = "allow" | "deny"; export const ApplyPatchApprovalResponse__NetworkPolicyRuleAction = Schema.Literals([ "allow", "deny", -]); +]).annotate({ identifier: "ApplyPatchApprovalResponse__NetworkPolicyRuleAction" }); export type ChatgptAuthTokensRefreshParams__ChatgptAuthTokensRefreshReason = "unauthorized"; -export const ChatgptAuthTokensRefreshParams__ChatgptAuthTokensRefreshReason = - Schema.Literal("unauthorized"); - -export type ClientRequest__AbsolutePathBuf = string; -export const ClientRequest__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type ClientRequest__AddCreditsNudgeCreditType = "credits" | "usage_limit"; -export const ClientRequest__AddCreditsNudgeCreditType = Schema.Literals(["credits", "usage_limit"]); - -export type ClientRequest__AdditionalContextKind = "untrusted" | "application"; -export const ClientRequest__AdditionalContextKind = Schema.Literals(["untrusted", "application"]); - -export type ClientRequest__AgentMessageInputContent = - | { readonly text: string; readonly type: "input_text" } - | { readonly encrypted_content: string; readonly type: "encrypted_content" }; -export const ClientRequest__AgentMessageInputContent = Schema.Union( +export const ChatgptAuthTokensRefreshParams__ChatgptAuthTokensRefreshReason = Schema.Union( [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ - title: "InputTextAgentMessageInputContentType", - }), - }).annotate({ title: "InputTextAgentMessageInputContent" }), - Schema.Struct({ - encrypted_content: Schema.String, - type: Schema.Literal("encrypted_content").annotate({ - title: "EncryptedContentAgentMessageInputContentType", - }), - }).annotate({ title: "EncryptedContentAgentMessageInputContent" }), + Schema.Literal("unauthorized").annotate({ + description: "Codex attempted a backend request and received `401 Unauthorized`.", + }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "ChatgptAuthTokensRefreshParams__ChatgptAuthTokensRefreshReason" }); -export type ClientRequest__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const ClientRequest__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); +export type ClientRequest__RequestId = string | number; +export const ClientRequest__RequestId = Schema.Union([ + Schema.String, + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +]).annotate({ identifier: "ClientRequest__RequestId" }); -export type ClientRequest__AppsInstalledParams = { - readonly forceRefresh?: boolean; - readonly threadId?: string | null; +export type ClientRequest__InitializeCapabilities = { + readonly experimentalApi?: boolean; + readonly explicitGatewayOauth?: boolean; + readonly extensions?: { readonly [x: string]: Schema.Json } | null; + readonly mcpServerOpenaiFormElicitation?: boolean; + readonly optOutNotificationMethods?: ReadonlyArray | null; + readonly requestAttestation?: boolean; }; -export const ClientRequest__AppsInstalledParams = Schema.Struct({ - forceRefresh: Schema.optionalKey( +export const ClientRequest__InitializeCapabilities = Schema.Struct({ + experimentalApi: Schema.optionalKey( Schema.Boolean.annotate({ - description: - "When true and Apps are permitted, refresh and publish the hosted connector runtime tool snapshot first.", + description: "Opt into receiving experimental API methods and fields.", + default: false, }), ), - threadId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional loaded thread id used to evaluate effective app configuration.", - }), - Schema.Null, - ]), + explicitGatewayOauth: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Use explicit gateway OAuth login instead of automatic browser authorization. Applies to this app-server's gateway runtime; later connections cannot undo it.", + }), ), -}).annotate({ description: "Read the committed installed connector runtime snapshot." }); - -export type ClientRequest__AppsListParams = { - readonly cursor?: string | null; - readonly forceRefetch?: boolean; - readonly limit?: number | null; - readonly threadId?: string | null; -}; -export const ClientRequest__AppsListParams = Schema.Struct({ - cursor: Schema.optionalKey( + extensions: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ - description: "Opaque pagination cursor returned by a previous call.", + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({ + description: "MCP extension settings declared by the app-server client.", }), Schema.Null, ]), ), - forceRefetch: Schema.optionalKey( + mcpServerOpenaiFormElicitation: Schema.optionalKey( Schema.Boolean.annotate({ - description: "When true, bypass app caches and fetch the latest data from sources.", + description: + "Legacy opt-in for the `openai/form` MCP extension.\n\nNew clients should declare `openai/form` in [`Self::extensions`].", }), ), - limit: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ - description: "Optional page size; defaults to a reasonable server-side value.", - format: "uint32", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - threadId: Schema.optionalKey( + optOutNotificationMethods: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ + Schema.Array(Schema.String).annotate({ description: - "Optional thread id used to evaluate app feature gating from that thread's config.", + "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", }), Schema.Null, ]), ), -}).annotate({ description: "EXPERIMENTAL - list available apps/connectors." }); - -export type ClientRequest__AppsReadParams = { - readonly appIds: ReadonlyArray; - readonly includeTools?: boolean; -}; -export const ClientRequest__AppsReadParams = Schema.Struct({ - appIds: Schema.Array(Schema.String).annotate({ - description: - "App ids to read. The server accepts at most 100 ids and deduplicates repeated ids while preserving their first-request order.", - }), - includeTools: Schema.optionalKey( + requestAttestation: Schema.optionalKey( Schema.Boolean.annotate({ - description: - "When true, include display-only public tool summaries in the returned metadata.", + description: "Opt into `attestation/generate` requests for upstream `x-oai-attestation`.", + default: false, }), ), -}).annotate({ description: "EXPERIMENTAL - read metadata for specific apps/connectors." }); +}).annotate({ + description: "Client-declared capabilities negotiated during initialize.", + identifier: "ClientRequest__InitializeCapabilities", +}); + +export type ClientRequest__ClientInfo = { + readonly name: string; + readonly title?: string | null; + readonly version: string; +}; +export const ClientRequest__ClientInfo = Schema.Struct({ + name: Schema.String, + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + version: Schema.String, +}).annotate({ identifier: "ClientRequest__ClientInfo" }); export type ClientRequest__AskForApproval = | "untrusted" @@ -189,182 +148,326 @@ export const ClientRequest__AskForApproval = Schema.Union( }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "ClientRequest__AskForApproval" }); -export type ClientRequest__CancelLoginAccountParams = { readonly loginId: string }; -export const ClientRequest__CancelLoginAccountParams = Schema.Struct({ loginId: Schema.String }); +export type ClientRequest__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const ClientRequest__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "ClientRequest__ApprovalsReviewer", +}); -export type ClientRequest__ClientInfo = { +export type ClientRequest__Personality = "none" | "friendly" | "pragmatic"; +export const ClientRequest__Personality = Schema.Literals([ + "none", + "friendly", + "pragmatic", +]).annotate({ + description: "Deprecated: `friendly` and `pragmatic` no longer select a style.", + identifier: "ClientRequest__Personality", +}); + +export type ClientRequest__SandboxMode = "read-only" | "workspace-write" | "danger-full-access"; +export const ClientRequest__SandboxMode = Schema.Literals([ + "read-only", + "workspace-write", + "danger-full-access", +]).annotate({ identifier: "ClientRequest__SandboxMode" }); + +export type ClientRequest__ThreadStartSource = "startup" | "clear"; +export const ClientRequest__ThreadStartSource = Schema.Literals(["startup", "clear"]).annotate({ + identifier: "ClientRequest__ThreadStartSource", +}); + +export type ClientRequest__ThreadSource = string; +export const ClientRequest__ThreadSource = Schema.String.annotate({ + identifier: "ClientRequest__ThreadSource", +}); + +export type ClientRequest__ThreadArchiveParams = { readonly threadId: string }; +export const ClientRequest__ThreadArchiveParams = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadArchiveParams" }); + +export type ClientRequest__ThreadDeleteParams = { readonly threadId: string }; +export const ClientRequest__ThreadDeleteParams = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadDeleteParams" }); + +export type ClientRequest__ThreadUnsubscribeParams = { readonly threadId: string }; +export const ClientRequest__ThreadUnsubscribeParams = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadUnsubscribeParams" }); + +export type ClientRequest__ThreadSetNameParams = { readonly name: string; - readonly title?: string | null; - readonly version: string; + readonly threadId: string; }; -export const ClientRequest__ClientInfo = Schema.Struct({ +export const ClientRequest__ThreadSetNameParams = Schema.Struct({ name: Schema.String, - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - version: Schema.String, -}); + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadSetNameParams" }); -export type ClientRequest__CommandExecResizeParams = { - readonly processId: string; - readonly size: { readonly cols: number; readonly rows: number }; -}; -export const ClientRequest__CommandExecResizeParams = Schema.Struct({ - processId: Schema.String.annotate({ - description: - "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", - }), - size: Schema.Struct({ - cols: Schema.Number.annotate({ - description: "Terminal width in character cells.", - format: "uint16", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - rows: Schema.Number.annotate({ - description: "Terminal height in character cells.", - format: "uint16", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ description: "PTY size in character cells for `command/exec` PTY sessions." }), -}).annotate({ description: "Resize a running PTY-backed `command/exec` session." }); +export type ClientRequest__ThreadGoalStatus = + | "active" + | "paused" + | "blocked" + | "usageLimited" + | "budgetLimited" + | "complete"; +export const ClientRequest__ThreadGoalStatus = Schema.Literals([ + "active", + "paused", + "blocked", + "usageLimited", + "budgetLimited", + "complete", +]).annotate({ identifier: "ClientRequest__ThreadGoalStatus" }); -export type ClientRequest__CommandExecTerminalSize = { - readonly cols: number; - readonly rows: number; -}; -export const ClientRequest__CommandExecTerminalSize = Schema.Struct({ - cols: Schema.Number.annotate({ - description: "Terminal width in character cells.", - format: "uint16", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - rows: Schema.Number.annotate({ - description: "Terminal height in character cells.", - format: "uint16", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}).annotate({ description: "PTY size in character cells for `command/exec` PTY sessions." }); +export type ClientRequest__ThreadGoalGetParams = { readonly threadId: string }; +export const ClientRequest__ThreadGoalGetParams = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadGoalGetParams" }); -export type ClientRequest__CommandExecTerminateParams = { readonly processId: string }; -export const ClientRequest__CommandExecTerminateParams = Schema.Struct({ - processId: Schema.String.annotate({ - description: - "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", - }), -}).annotate({ description: "Terminate a running `command/exec` session." }); +export type ClientRequest__ThreadGoalClearParams = { readonly threadId: string }; +export const ClientRequest__ThreadGoalClearParams = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadGoalClearParams" }); -export type ClientRequest__CommandExecWriteParams = { - readonly closeStdin?: boolean; - readonly deltaBase64?: string | null; - readonly processId: string; +export type ClientRequest__ThreadMetadataGitInfoUpdateParams = { + readonly branch?: string | null; + readonly originUrl?: string | null; + readonly sha?: string | null; }; -export const ClientRequest__CommandExecWriteParams = Schema.Struct({ - closeStdin: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "Close stdin after writing `deltaBase64`, if present.", - }), +export const ClientRequest__ThreadMetadataGitInfoUpdateParams = Schema.Struct({ + branch: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + }), + Schema.Null, + ]), ), - deltaBase64: Schema.optionalKey( + originUrl: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Optional base64-encoded stdin bytes to write." }), + Schema.String.annotate({ + description: + "Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + }), Schema.Null, ]), ), - processId: Schema.String.annotate({ - description: - "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", - }), + sha: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__ThreadMetadataGitInfoUpdateParams" }); + +export type ClientRequest__ThreadAttachmentAddParams = { + readonly attachmentType: string; + readonly identityKey: string; + readonly payload: Schema.Json; + readonly threadId: string; +}; +export const ClientRequest__ThreadAttachmentAddParams = Schema.Struct({ + attachmentType: Schema.String, + identityKey: Schema.String, + payload: Schema.Json.annotate({ expected: "JSON value" }), + threadId: Schema.String, }).annotate({ - description: "Write stdin bytes to a running `command/exec` session, close stdin, or both.", + description: "Parameters for creating or locating an attachment on its owning thread.", + identifier: "ClientRequest__ThreadAttachmentAddParams", }); -export type ClientRequest__CommandMigration = { readonly name: string }; -export const ClientRequest__CommandMigration = Schema.Struct({ name: Schema.String }); - -export type ClientRequest__ConfigReadParams = { - readonly cwd?: string | null; - readonly includeLayers?: boolean; +export type ClientRequest__ThreadAttachmentListParams = { + readonly cursor?: string | null; + readonly limit?: number | null; + readonly threadId: string; }; -export const ClientRequest__ConfigReadParams = Schema.Struct({ - cwd: Schema.optionalKey( +export const ClientRequest__ThreadAttachmentListParams = Schema.Struct({ + cursor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + limit: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ - description: - "Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between `cwd` and the project/repo root).", - }), + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), - includeLayers: Schema.optionalKey(Schema.Boolean), + threadId: Schema.String, +}).annotate({ + description: "Parameters for listing attachments from one thread.", + identifier: "ClientRequest__ThreadAttachmentListParams", }); -export type ClientRequest__ConsumeAccountRateLimitResetCreditParams = { - readonly creditId?: string | null; - readonly idempotencyKey: string; +export type ClientRequest__ThreadAttachmentRemoveParams = { + readonly attachmentType: string; + readonly identityKey: string; + readonly threadId: string; }; -export const ClientRequest__ConsumeAccountRateLimitResetCreditParams = Schema.Struct({ - creditId: Schema.optionalKey( +export const ClientRequest__ThreadAttachmentRemoveParams = Schema.Struct({ + attachmentType: Schema.String, + identityKey: Schema.String, + threadId: Schema.String, +}).annotate({ + description: "Parameters for deleting an attachment by its stable thread-local identity.", + identifier: "ClientRequest__ThreadAttachmentRemoveParams", +}); + +export type ClientRequest__ThreadSectionMoveParams = { + readonly beforeThreadId?: string | null; + readonly sectionId: string | null; + readonly threadId: string; +}; +export const ClientRequest__ThreadSectionMoveParams = Schema.Struct({ + beforeThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: - "Opaque reset-credit identifier to redeem. When omitted, the backend selects the next available credit.", + description: "Existing thread to insert before; omission or null appends to the section.", }), Schema.Null, ]), ), - idempotencyKey: Schema.String.annotate({ - description: - "Identifies one logical reset attempt. A UUID is recommended; reuse the same value when retrying that attempt.", + sectionId: Schema.Union([ + Schema.String.annotate({ + description: "Destination section, or `null` to remove the thread from its section.", + }), + Schema.Null, + ]), + threadId: Schema.String.annotate({ + description: "Thread to move into, within, or out of a section.", }), +}).annotate({ + description: "Parameters for moving a thread within a server-owned section ordering.", + identifier: "ClientRequest__ThreadSectionMoveParams", }); -export type ClientRequest__ConversationTextRole = "user" | "developer" | "assistant"; -export const ClientRequest__ConversationTextRole = Schema.Literals([ - "user", - "developer", - "assistant", -]); +export type ClientRequest__ThreadUnarchiveParams = { readonly threadId: string }; +export const ClientRequest__ThreadUnarchiveParams = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadUnarchiveParams" }); -export type ClientRequest__DynamicToolNamespaceTool = { - readonly deferLoading?: boolean; - readonly description: string; - readonly inputSchema: unknown; - readonly name: string; - readonly type: "function"; -}; -export const ClientRequest__DynamicToolNamespaceTool = Schema.Union( - [ - Schema.Struct({ - deferLoading: Schema.optionalKey(Schema.Boolean), - description: Schema.String, - inputSchema: Schema.Unknown, - name: Schema.String, - type: Schema.Literal("function").annotate({ title: "FunctionDynamicToolNamespaceToolType" }), - }).annotate({ title: "FunctionDynamicToolNamespaceTool" }), - ], - { mode: "oneOf" }, -); +export type ClientRequest__ThreadCompactStartParams = { readonly threadId: string }; +export const ClientRequest__ThreadCompactStartParams = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadCompactStartParams" }); -export type ClientRequest__ExperimentalFeatureEnablementSetParams = { - readonly enablement: { readonly [x: string]: boolean }; +export type ClientRequest__ThreadShellCommandParams = { + readonly command: string; + readonly threadId: string; + readonly timeoutMs?: number | null; }; -export const ClientRequest__ExperimentalFeatureEnablementSetParams = Schema.Struct({ - enablement: Schema.Record(Schema.String, Schema.Boolean).annotate({ +export const ClientRequest__ThreadShellCommandParams = Schema.Struct({ + command: Schema.String.annotate({ description: - "Process-wide runtime feature enablement keyed by canonical feature name.\n\nOnly named features are updated. Omitted features are left unchanged. Send an empty map for a no-op.", + "Shell command string evaluated by the thread's configured shell. Unlike `command/exec`, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.", + }), + threadId: Schema.String, + timeoutMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Maximum execution time in milliseconds. Defaults to one hour when omitted or null. Must be non-negative; zero requests an immediate timeout, not unlimited execution. Does not affect the immediate RPC acknowledgement.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__ThreadShellCommandParams" }); + +export type ClientRequest__ThreadApproveGuardianDeniedActionParams = { + readonly event: Schema.Json; + readonly threadId: string; +}; +export const ClientRequest__ThreadApproveGuardianDeniedActionParams = Schema.Struct({ + event: Schema.Json.annotate({ + expected: "JSON value", + description: "Serialized `codex_protocol::protocol::GuardianAssessmentEvent`.", + }), + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadApproveGuardianDeniedActionParams" }); + +export type ClientRequest__ThreadRevertParams = { + readonly beforeTurnId: string; + readonly threadId: string; +}; +export const ClientRequest__ThreadRevertParams = Schema.Struct({ + beforeTurnId: Schema.String.annotate({ + description: "Turn excluded from the replacement history, together with every later turn.", }), + threadId: Schema.String, +}).annotate({ + description: + "Replace a paginated thread's durable history with the prefix before one turn.\n\nThis only changes persisted conversation history. It does not revert local file changes.", + identifier: "ClientRequest__ThreadRevertParams", }); -export type ClientRequest__ExperimentalFeatureListParams = { +export type ClientRequest__ThreadListCwdFilter = string | ReadonlyArray; +export const ClientRequest__ThreadListCwdFilter = Schema.Union([ + Schema.String, + Schema.Array(Schema.String), +]).annotate({ identifier: "ClientRequest__ThreadListCwdFilter" }); + +export type ClientRequest__SortDirection = "asc" | "desc"; +export const ClientRequest__SortDirection = Schema.Literals(["asc", "desc"]).annotate({ + identifier: "ClientRequest__SortDirection", +}); + +export type ClientRequest__ThreadSortKey = + | "created_at" + | "updated_at" + | "recency_at" + | "section_position"; +export const ClientRequest__ThreadSortKey = Schema.Literals([ + "created_at", + "updated_at", + "recency_at", + "section_position", +]).annotate({ identifier: "ClientRequest__ThreadSortKey" }); + +export type ClientRequest__ThreadSourceKind = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "subAgent" + | "subAgentReview" + | "subAgentCompact" + | "subAgentThreadSpawn" + | "subAgentOther" + | "unknown"; +export const ClientRequest__ThreadSourceKind = Schema.Literals([ + "cli", + "vscode", + "exec", + "appServer", + "subAgent", + "subAgentReview", + "subAgentCompact", + "subAgentThreadSpawn", + "subAgentOther", + "unknown", +]).annotate({ identifier: "ClientRequest__ThreadSourceKind" }); + +export type ClientRequest__ThreadSectionListParams = { readonly cursor?: string | null; readonly limit?: number | null; - readonly threadId?: string | null; }; -export const ClientRequest__ExperimentalFeatureListParams = Schema.Struct({ +export const ClientRequest__ThreadSectionListParams = Schema.Struct({ cursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -376,253 +479,157 @@ export const ClientRequest__ExperimentalFeatureListParams = Schema.Struct({ limit: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ - description: "Optional page size; defaults to a reasonable server-side value.", + description: "Maximum number of sections to return.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - threadId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional loaded thread id. Pass this when showing feature state for an existing thread so enablement is computed from that thread's refreshed config, including project-local config for the thread's cwd.", - }), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), +}).annotate({ + description: "Parameters for listing independently persisted thread sections.", + identifier: "ClientRequest__ThreadSectionListParams", }); -export type ClientRequest__ExternalAgentConfigDetectParams = { - readonly cwds?: ReadonlyArray | null; - readonly includeHome?: boolean; - readonly migrationSource?: string | null; - readonly source?: string | null; +export type ClientRequest__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const ClientRequest__ExternalAgentConfigDetectParams = Schema.Struct({ - cwds: Schema.optionalKey( - Schema.Union([ - Schema.Array(Schema.String).annotate({ - description: "Zero or more working directories to include for repo-scoped detection.", - }), - Schema.Null, - ]), - ), - includeHome: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "If true, include detection under the user's home directory.", - }), - ), - migrationSource: Schema.optionalKey( +export const ClientRequest__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "ClientRequest__ThreadSectionAppearance", +}); + +export type ClientRequest__ThreadSectionDeleteParams = { readonly sectionId: string }; +export const ClientRequest__ThreadSectionDeleteParams = Schema.Struct({ + sectionId: Schema.String.annotate({ + description: "The stable, server-generated identity of the section to delete.", + }), +}).annotate({ + description: "Parameters for deleting an independently persisted thread section.", + identifier: "ClientRequest__ThreadSectionDeleteParams", +}); + +export type ClientRequest__ThreadLoadedListParams = { + readonly cursor?: string | null; + readonly limit?: number | null; +}; +export const ClientRequest__ThreadLoadedListParams = Schema.Struct({ + cursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: - "Optional migration-source selector. Missing or unrecognized values use the default source.", + description: "Opaque pagination cursor returned by a previous call.", }), Schema.Null, ]), ), - source: Schema.optionalKey( + limit: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ - description: - "Deprecated field retained for compatibility. This field is ignored; use `migrationSource` to select the migration source.", - }), + Schema.Number.annotate({ + description: "Optional page size; defaults to no limit.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), +}).annotate({ identifier: "ClientRequest__ThreadLoadedListParams" }); + +export type ClientRequest__ThreadReadParams = { + readonly includeTurns?: boolean; + readonly threadId: string; +}; +export const ClientRequest__ThreadReadParams = Schema.Struct({ + includeTurns: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true, include turns and their items from rollout history. Full-history hydration is deprecated for paginated threads; prefer a metadata-only read and page with `thread/turns/list` and `thread/items/list`.", + }), + ), + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadReadParams" }); + +export type ClientRequest__TurnItemsView = "notLoaded" | "summary" | "full"; +export const ClientRequest__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ClientRequest__TurnItemsView" }); + +export type ClientRequest__ThreadItemsListAnchor = { + readonly itemId: string; + readonly type: "item"; +}; +export const ClientRequest__ThreadItemsListAnchor = Schema.Union( + [ + Schema.Struct({ + itemId: Schema.String, + type: Schema.Literal("item").annotate({ title: "ItemThreadItemsListAnchorType" }), + }).annotate({ title: "ItemThreadItemsListAnchor" }), + ], + { mode: "oneOf" }, +).annotate({ + description: "An exclusive item position within the requested visible turn.", + identifier: "ClientRequest__ThreadItemsListAnchor", }); -export type ClientRequest__ExternalAgentConfigMigrationItemType = - | "AGENTS_MD" - | "CONFIG" - | "SKILLS" - | "PLUGINS" - | "MCP_SERVER_CONFIG" - | "SUBAGENTS" - | "HOOKS" - | "COMMANDS" - | "MEMORY" - | "SESSIONS"; -export const ClientRequest__ExternalAgentConfigMigrationItemType = Schema.Literals([ - "AGENTS_MD", - "CONFIG", - "SKILLS", - "PLUGINS", - "MCP_SERVER_CONFIG", - "SUBAGENTS", - "HOOKS", - "COMMANDS", - "MEMORY", - "SESSIONS", -]); - -export type ClientRequest__FeedbackUploadParams = { - readonly classification: string; - readonly extraLogFiles?: ReadonlyArray | null; - readonly includeLogs?: boolean; - readonly reason?: string | null; - readonly tags?: { readonly [x: string]: string } | null; - readonly threadId?: string | null; -}; -export const ClientRequest__FeedbackUploadParams = Schema.Struct({ - classification: Schema.String, - extraLogFiles: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - includeLogs: Schema.optionalKey(Schema.Boolean), - reason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - tags: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type ClientRequest__FsCopyParams = { - readonly destinationPath: string; - readonly recursive?: boolean; - readonly sourcePath: string; -}; -export const ClientRequest__FsCopyParams = Schema.Struct({ - destinationPath: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), - recursive: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "Required for directory copies; ignored for file copies.", - }), - ), - sourcePath: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), -}).annotate({ description: "Copy a file or directory tree on the host filesystem." }); - -export type ClientRequest__FsCreateDirectoryParams = { - readonly path: string; - readonly recursive?: boolean | null; +export type ClientRequest__ThreadInjectItemsParams = { + readonly items: ReadonlyArray; + readonly threadId: string; }; -export const ClientRequest__FsCreateDirectoryParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), - recursive: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: "Whether parent directories should also be created. Defaults to `true`.", - }), - Schema.Null, - ]), - ), -}).annotate({ description: "Create a directory on the host filesystem." }); - -export type ClientRequest__FsGetMetadataParams = { readonly path: string }; -export const ClientRequest__FsGetMetadataParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), -}).annotate({ description: "Request metadata for an absolute path." }); - -export type ClientRequest__FsReadDirectoryParams = { readonly path: string }; -export const ClientRequest__FsReadDirectoryParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), -}).annotate({ description: "List direct child names for a directory." }); - -export type ClientRequest__FsReadFileParams = { readonly path: string }; -export const ClientRequest__FsReadFileParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +export const ClientRequest__ThreadInjectItemsParams = Schema.Struct({ + items: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ + description: "Raw Responses API items to append to the thread's model-visible history.", }), -}).annotate({ description: "Read a file from the host filesystem." }); + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadInjectItemsParams" }); -export type ClientRequest__FsRemoveParams = { - readonly force?: boolean | null; - readonly path: string; - readonly recursive?: boolean | null; +export type ClientRequest__SkillsListParams = { + readonly cwds?: ReadonlyArray; + readonly forceReload?: boolean; }; -export const ClientRequest__FsRemoveParams = Schema.Struct({ - force: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: "Whether missing paths should be ignored. Defaults to `true`.", - }), - Schema.Null, - ]), - ), - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), - recursive: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: "Whether directory removal should recurse. Defaults to `true`.", - }), - Schema.Null, - ]), +export const ClientRequest__SkillsListParams = Schema.Struct({ + cwds: Schema.optionalKey( + Schema.Array(Schema.String).annotate({ + description: "When empty, defaults to the current session working directory.", + }), ), -}).annotate({ description: "Remove a file or directory tree from the host filesystem." }); - -export type ClientRequest__FsUnwatchParams = { readonly watchId: string }; -export const ClientRequest__FsUnwatchParams = Schema.Struct({ - watchId: Schema.String.annotate({ - description: "Watch identifier previously provided to `fs/watch`.", - }), -}).annotate({ description: "Stop filesystem watch notifications for a prior `fs/watch`." }); - -export type ClientRequest__FsWatchParams = { readonly path: string; readonly watchId: string }; -export const ClientRequest__FsWatchParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), - watchId: Schema.String.annotate({ - description: "Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`.", - }), -}).annotate({ description: "Start filesystem watch notifications for an absolute path." }); - -export type ClientRequest__FsWriteFileParams = { - readonly dataBase64: string; - readonly path: string; -}; -export const ClientRequest__FsWriteFileParams = Schema.Struct({ - dataBase64: Schema.String.annotate({ description: "File contents encoded as base64." }), - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), -}).annotate({ description: "Write a file on the host filesystem." }); - -export type ClientRequest__FuzzyFileSearchParams = { - readonly cancellationToken?: string | null; - readonly query: string; - readonly roots: ReadonlyArray; -}; -export const ClientRequest__FuzzyFileSearchParams = Schema.Struct({ - cancellationToken: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.String, - roots: Schema.Array(Schema.String), -}); - -export type ClientRequest__GetAccountParams = { readonly refreshToken?: boolean }; -export const ClientRequest__GetAccountParams = Schema.Struct({ - refreshToken: Schema.optionalKey( + forceReload: Schema.optionalKey( Schema.Boolean.annotate({ - description: - "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.", + description: "When true, bypass the skills cache and re-scan skills from disk.", }), ), -}); +}).annotate({ identifier: "ClientRequest__SkillsListParams" }); -export type ClientRequest__HookMigration = { readonly name: string }; -export const ClientRequest__HookMigration = Schema.Struct({ name: Schema.String }); +export type ClientRequest__AbsolutePathBuf = string; +export const ClientRequest__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "ClientRequest__AbsolutePathBuf", +}); export type ClientRequest__HooksListParams = { readonly cwds?: ReadonlyArray }; export const ClientRequest__HooksListParams = Schema.Struct({ @@ -631,99 +638,7 @@ export const ClientRequest__HooksListParams = Schema.Struct({ description: "When empty, defaults to the current session working directory.", }), ), -}); - -export type ClientRequest__ImageDetail = "auto" | "low" | "high" | "original"; -export const ClientRequest__ImageDetail = Schema.Literals(["auto", "low", "high", "original"]); - -export type ClientRequest__InitializeCapabilities = { - readonly experimentalApi?: boolean; - readonly mcpServerOpenaiFormElicitation?: boolean; - readonly optOutNotificationMethods?: ReadonlyArray | null; - readonly requestAttestation?: boolean; -}; -export const ClientRequest__InitializeCapabilities = Schema.Struct({ - experimentalApi: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "Opt into receiving experimental API methods and fields.", - default: false, - }), - ), - mcpServerOpenaiFormElicitation: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "Allow downstream MCP servers to request OpenAI extended form elicitations.", - }), - ), - optOutNotificationMethods: Schema.optionalKey( - Schema.Union([ - Schema.Array(Schema.String).annotate({ - description: - "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", - }), - Schema.Null, - ]), - ), - requestAttestation: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "Opt into `attestation/generate` requests for upstream `x-oai-attestation`.", - default: false, - }), - ), -}).annotate({ description: "Client-declared capabilities negotiated during initialize." }); - -export type ClientRequest__InternalChatMessageMetadataPassthrough = { - readonly turn_id?: string | null; -}; -export const ClientRequest__InternalChatMessageMetadataPassthrough = Schema.Struct({ - turn_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ - description: - "Internal Responses API passthrough metadata copied into underlying chat messages.\n\nResponses API strongly types this payload. Do not modify it without first getting API approval and making the corresponding Responses API change.", -}); - -export type ClientRequest__LegacyAppPathString = string; -export const ClientRequest__LegacyAppPathString = Schema.String; - -export type ClientRequest__LocalShellAction = { - readonly command: ReadonlyArray; - readonly env?: { readonly [x: string]: string } | null; - readonly timeout_ms?: number | null; - readonly type: "exec"; - readonly user?: string | null; - readonly working_directory?: string | null; -}; -export const ClientRequest__LocalShellAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.Array(Schema.String), - env: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - timeout_ms: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - type: Schema.Literal("exec").annotate({ title: "ExecLocalShellActionType" }), - user: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - working_directory: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "ExecLocalShellAction" }), - ], - { mode: "oneOf" }, -); - -export type ClientRequest__LocalShellStatus = "completed" | "in_progress" | "incomplete"; -export const ClientRequest__LocalShellStatus = Schema.Literals([ - "completed", - "in_progress", - "incomplete", -]); - -export type ClientRequest__LoginAppBrand = "codex" | "chatgpt"; -export const ClientRequest__LoginAppBrand = Schema.Literals(["codex", "chatgpt"]); +}).annotate({ identifier: "ClientRequest__HooksListParams" }); export type ClientRequest__MarketplaceAddParams = { readonly refName?: string | null; @@ -734,87 +649,133 @@ export const ClientRequest__MarketplaceAddParams = Schema.Struct({ refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), source: Schema.String, sparsePaths: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), -}); +}).annotate({ identifier: "ClientRequest__MarketplaceAddParams" }); export type ClientRequest__MarketplaceRemoveParams = { readonly marketplaceName: string }; export const ClientRequest__MarketplaceRemoveParams = Schema.Struct({ marketplaceName: Schema.String, -}); +}).annotate({ identifier: "ClientRequest__MarketplaceRemoveParams" }); export type ClientRequest__MarketplaceUpgradeParams = { readonly marketplaceName?: string | null }; export const ClientRequest__MarketplaceUpgradeParams = Schema.Struct({ marketplaceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "ClientRequest__MarketplaceUpgradeParams" }); -export type ClientRequest__McpResourceReadParams = { - readonly server: string; - readonly threadId?: string | null; - readonly uri: string; -}; -export const ClientRequest__McpResourceReadParams = Schema.Struct({ - server: Schema.String, - threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - uri: Schema.String, -}); +export type ClientRequest__PluginListMarketplaceKind = + | "local" + | "vertical" + | "workspace-directory" + | "shared-with-me" + | "created-by-me-remote"; +export const ClientRequest__PluginListMarketplaceKind = Schema.Literals([ + "local", + "vertical", + "workspace-directory", + "shared-with-me", + "created-by-me-remote", +]).annotate({ identifier: "ClientRequest__PluginListMarketplaceKind" }); -export type ClientRequest__McpServerMigration = { readonly name: string }; -export const ClientRequest__McpServerMigration = Schema.Struct({ name: Schema.String }); +export type ClientRequest__PluginReconcileParams = { readonly reason?: string | null }; +export const ClientRequest__PluginReconcileParams = Schema.Struct({ + reason: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional client-provided reason recorded with the reconciliation attempt.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__PluginReconcileParams" }); -export type ClientRequest__McpServerOauthLoginParams = { - readonly name: string; - readonly scopes?: ReadonlyArray | null; - readonly threadId?: string | null; - readonly timeoutSecs?: number | null; +export type ClientRequest__PluginSkillReadParams = { + readonly remoteMarketplaceName: string; + readonly remotePluginId: string; + readonly skillName: string; }; -export const ClientRequest__McpServerOauthLoginParams = Schema.Struct({ - name: Schema.String, - scopes: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - timeoutSecs: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), -}); +export const ClientRequest__PluginSkillReadParams = Schema.Struct({ + remoteMarketplaceName: Schema.String, + remotePluginId: Schema.String, + skillName: Schema.String, +}).annotate({ identifier: "ClientRequest__PluginSkillReadParams" }); -export type ClientRequest__McpServerStatusDetail = "full" | "toolsAndAuthOnly"; -export const ClientRequest__McpServerStatusDetail = Schema.Literals(["full", "toolsAndAuthOnly"]); +export type ClientRequest__PluginShareDiscoverability = "LISTED" | "UNLISTED" | "PRIVATE"; +export const ClientRequest__PluginShareDiscoverability = Schema.Literals([ + "LISTED", + "UNLISTED", + "PRIVATE", +]).annotate({ identifier: "ClientRequest__PluginShareDiscoverability" }); -export type ClientRequest__McpServerToolCallParams = { - readonly _meta?: unknown; - readonly arguments?: unknown; - readonly server: string; - readonly threadId: string; - readonly tool: string; -}; -export const ClientRequest__McpServerToolCallParams = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - arguments: Schema.optionalKey(Schema.Unknown), - server: Schema.String, - threadId: Schema.String, - tool: Schema.String, +export type ClientRequest__PluginSharePrincipalType = "user" | "group" | "workspace"; +export const ClientRequest__PluginSharePrincipalType = Schema.Literals([ + "user", + "group", + "workspace", +]).annotate({ identifier: "ClientRequest__PluginSharePrincipalType" }); + +export type ClientRequest__PluginShareTargetRole = "reader" | "editor"; +export const ClientRequest__PluginShareTargetRole = Schema.Literals(["reader", "editor"]).annotate({ + identifier: "ClientRequest__PluginShareTargetRole", }); -export type ClientRequest__MergeStrategy = "replace" | "upsert"; -export const ClientRequest__MergeStrategy = Schema.Literals(["replace", "upsert"]); +export type ClientRequest__PluginShareUpdateDiscoverability = "UNLISTED" | "PRIVATE" | "LISTED"; +export const ClientRequest__PluginShareUpdateDiscoverability = Schema.Literals([ + "UNLISTED", + "PRIVATE", + "LISTED", +]).annotate({ identifier: "ClientRequest__PluginShareUpdateDiscoverability" }); -export type ClientRequest__MessagePhase = "commentary" | "final_answer"; -export const ClientRequest__MessagePhase = Schema.Literals(["commentary", "final_answer"]).annotate( - { - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', - }, -); +export type ClientRequest__PluginShareListParams = { readonly [x: string]: Schema.Json }; +export const ClientRequest__PluginShareListParams = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ identifier: "ClientRequest__PluginShareListParams" }); -export type ClientRequest__ModeKind = "plan" | "default"; -export const ClientRequest__ModeKind = Schema.Literals(["plan", "default"]).annotate({ - description: "Initial collaboration mode to use when the TUI starts.", +export type ClientRequest__PluginShareCheckoutParams = { readonly remotePluginId: string }; +export const ClientRequest__PluginShareCheckoutParams = Schema.Struct({ + remotePluginId: Schema.String, +}).annotate({ identifier: "ClientRequest__PluginShareCheckoutParams" }); + +export type ClientRequest__PluginShareDeleteParams = { readonly remotePluginId: string }; +export const ClientRequest__PluginShareDeleteParams = Schema.Struct({ + remotePluginId: Schema.String, +}).annotate({ identifier: "ClientRequest__PluginShareDeleteParams" }); + +export type ClientRequest__AppsReadParams = { + readonly appIds: ReadonlyArray; + readonly includeTools?: boolean; + readonly threadId?: string | null; +}; +export const ClientRequest__AppsReadParams = Schema.Struct({ + appIds: Schema.Array(Schema.String).annotate({ + description: + "App ids to read. The server accepts at most 100 ids and deduplicates repeated ids while preserving their first-request order.", + }), + includeTools: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true, include display-only public tool summaries in the returned metadata.", + }), + ), + threadId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional loaded thread id used to evaluate effective app configuration.", + }), + Schema.Null, + ]), + ), +}).annotate({ + description: "EXPERIMENTAL - read metadata for specific apps/connectors.", + identifier: "ClientRequest__AppsReadParams", }); -export type ClientRequest__ModelListParams = { +export type ClientRequest__AppsListParams = { readonly cursor?: string | null; - readonly includeHidden?: boolean | null; + readonly forceRefetch?: boolean; readonly limit?: number | null; + readonly threadId?: string | null; }; -export const ClientRequest__ModelListParams = Schema.Struct({ +export const ClientRequest__AppsListParams = Schema.Struct({ cursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -823,13 +784,10 @@ export const ClientRequest__ModelListParams = Schema.Struct({ Schema.Null, ]), ), - includeHidden: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: "When true, include models that are hidden from the default picker list.", - }), - Schema.Null, - ]), + forceRefetch: Schema.optionalKey( + Schema.Boolean.annotate({ + description: "When true, bypass app caches and fetch the latest data from sources.", + }), ), limit: Schema.optionalKey( Schema.Union([ @@ -837,167 +795,104 @@ export const ClientRequest__ModelListParams = Schema.Struct({ description: "Optional page size; defaults to a reasonable server-side value.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), -}); - -export type ClientRequest__ModelProviderCapabilitiesReadParams = {}; -export const ClientRequest__ModelProviderCapabilitiesReadParams = Schema.Struct({}); - -export type ClientRequest__PermissionProfileListParams = { - readonly cursor?: string | null; - readonly cwd?: string | null; - readonly limit?: number | null; -}; -export const ClientRequest__PermissionProfileListParams = Schema.Struct({ - cursor: Schema.optionalKey( + threadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Opaque pagination cursor returned by a previous call.", + description: + "Optional thread id used to evaluate app feature gating from that thread's config.", }), Schema.Null, ]), ), - cwd: Schema.optionalKey( +}).annotate({ + description: "EXPERIMENTAL - list available apps/connectors.", + identifier: "ClientRequest__AppsListParams", +}); + +export type ClientRequest__AppsInstalledParams = { + readonly forceRefresh?: boolean; + readonly threadId?: string | null; +}; +export const ClientRequest__AppsInstalledParams = Schema.Struct({ + forceRefresh: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true and Apps are permitted, refresh and publish the hosted connector runtime tool snapshot first.", + }), + ), + threadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional working directory to resolve project config layers.", + description: "Optional loaded thread id used to evaluate effective app configuration.", }), Schema.Null, ]), ), - limit: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ - description: "Optional page size; defaults to the full result set.", - format: "uint32", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), +}).annotate({ + description: "Read the committed installed connector runtime snapshot.", + identifier: "ClientRequest__AppsInstalledParams", }); -export type ClientRequest__Personality = "none" | "friendly" | "pragmatic"; -export const ClientRequest__Personality = Schema.Literals(["none", "friendly", "pragmatic"]); - -export type ClientRequest__PluginListMarketplaceKind = - | "local" - | "vertical" - | "workspace-directory" - | "shared-with-me" - | "created-by-me-remote"; -export const ClientRequest__PluginListMarketplaceKind = Schema.Literals([ - "local", - "vertical", - "workspace-directory", - "shared-with-me", - "created-by-me-remote", -]); - -export type ClientRequest__PluginShareCheckoutParams = { readonly remotePluginId: string }; -export const ClientRequest__PluginShareCheckoutParams = Schema.Struct({ - remotePluginId: Schema.String, +export type ClientRequest__FsUnwatchParams = { readonly watchId: string }; +export const ClientRequest__FsUnwatchParams = Schema.Struct({ + watchId: Schema.String.annotate({ + description: "Watch identifier previously provided to `fs/watch`.", + }), +}).annotate({ + description: "Stop filesystem watch notifications for a prior `fs/watch`.", + identifier: "ClientRequest__FsUnwatchParams", }); -export type ClientRequest__PluginShareDeleteParams = { readonly remotePluginId: string }; -export const ClientRequest__PluginShareDeleteParams = Schema.Struct({ - remotePluginId: Schema.String, -}); +export type ClientRequest__PluginUninstallParams = { readonly pluginId: string }; +export const ClientRequest__PluginUninstallParams = Schema.Struct({ + pluginId: Schema.String, +}).annotate({ identifier: "ClientRequest__PluginUninstallParams" }); -export type ClientRequest__PluginShareDiscoverability = "LISTED" | "UNLISTED" | "PRIVATE"; -export const ClientRequest__PluginShareDiscoverability = Schema.Literals([ - "LISTED", - "UNLISTED", - "PRIVATE", -]); +export type ClientRequest__ReasoningEffort = string; +export const ClientRequest__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "ClientRequest__ReasoningEffort", + }), +); -export type ClientRequest__PluginShareListParams = {}; -export const ClientRequest__PluginShareListParams = Schema.Struct({}); +export type ClientRequest__ByteRange = { readonly end: number; readonly start: number }; +export const ClientRequest__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "ClientRequest__ByteRange" }); -export type ClientRequest__PluginSharePrincipalType = "user" | "group" | "workspace"; -export const ClientRequest__PluginSharePrincipalType = Schema.Literals([ - "user", - "group", - "workspace", -]); +export type ClientRequest__ImageDetail = "auto" | "low" | "high" | "original"; +export const ClientRequest__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "ClientRequest__ImageDetail" }); -export type ClientRequest__PluginShareTargetRole = "reader" | "editor"; -export const ClientRequest__PluginShareTargetRole = Schema.Literals(["reader", "editor"]); - -export type ClientRequest__PluginShareUpdateDiscoverability = "UNLISTED" | "PRIVATE" | "LISTED"; -export const ClientRequest__PluginShareUpdateDiscoverability = Schema.Literals([ - "UNLISTED", - "PRIVATE", - "LISTED", -]); - -export type ClientRequest__PluginSkillReadParams = { - readonly remoteMarketplaceName: string; - readonly remotePluginId: string; - readonly skillName: string; -}; -export const ClientRequest__PluginSkillReadParams = Schema.Struct({ - remoteMarketplaceName: Schema.String, - remotePluginId: Schema.String, - skillName: Schema.String, -}); - -export type ClientRequest__PluginUninstallParams = { readonly pluginId: string }; -export const ClientRequest__PluginUninstallParams = Schema.Struct({ pluginId: Schema.String }); - -export type ClientRequest__PluginsMigration = { - readonly marketplaceName: string; - readonly pluginNames: ReadonlyArray; -}; -export const ClientRequest__PluginsMigration = Schema.Struct({ - marketplaceName: Schema.String, - pluginNames: Schema.Array(Schema.String), -}); - -export type ClientRequest__ReasoningEffort = string; -export const ClientRequest__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); - -export type ClientRequest__ReasoningItemContent = - | { readonly text: string; readonly type: "reasoning_text" } - | { readonly text: string; readonly type: "text" }; -export const ClientRequest__ReasoningItemContent = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("reasoning_text").annotate({ - title: "ReasoningTextReasoningItemContentType", - }), - }).annotate({ title: "ReasoningTextReasoningItemContent" }), - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("text").annotate({ title: "TextReasoningItemContentType" }), - }).annotate({ title: "TextReasoningItemContent" }), - ], - { mode: "oneOf" }, -); - -export type ClientRequest__ReasoningItemReasoningSummary = { - readonly text: string; - readonly type: "summary_text"; -}; -export const ClientRequest__ReasoningItemReasoningSummary = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("summary_text").annotate({ - title: "SummaryTextReasoningItemReasoningSummaryType", - }), - }).annotate({ title: "SummaryTextReasoningItemReasoningSummary" }), - ], - { mode: "oneOf" }, -); +export type ClientRequest__NetworkAccess = "restricted" | "enabled"; +export const ClientRequest__NetworkAccess = Schema.Literals(["restricted", "enabled"]).annotate({ + identifier: "ClientRequest__NetworkAccess", +}); export type ClientRequest__ReasoningSummary = "auto" | "concise" | "detailed" | "none"; export const ClientRequest__ReasoningSummary = Schema.Union( @@ -1009,56 +904,22 @@ export const ClientRequest__ReasoningSummary = Schema.Union( ).annotate({ description: "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + identifier: "ClientRequest__ReasoningSummary", }); -export type ClientRequest__RequestId = string | number; -export const ClientRequest__RequestId = Schema.Union([ - Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -]); - -export type ClientRequest__ResponsesApiWebSearchAction = - | { - readonly queries?: ReadonlyArray | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly type: "open_page"; readonly url?: string | null } - | { - readonly pattern?: string | null; - readonly type: "find_in_page"; - readonly url?: string | null; - } - | { readonly type: "other" }; -export const ClientRequest__ResponsesApiWebSearchAction = Schema.Union( - [ - Schema.Struct({ - queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchResponsesApiWebSearchActionType" }), - }).annotate({ title: "SearchResponsesApiWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("open_page").annotate({ - title: "OpenPageResponsesApiWebSearchActionType", - }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageResponsesApiWebSearchAction" }), - Schema.Struct({ - pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("find_in_page").annotate({ - title: "FindInPageResponsesApiWebSearchActionType", - }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageResponsesApiWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherResponsesApiWebSearchActionType" }), - }).annotate({ title: "OtherResponsesApiWebSearchAction" }), - ], - { mode: "oneOf" }, -); +export type ClientRequest__TurnInterruptParams = { + readonly threadId: string; + readonly turnId: string; +}; +export const ClientRequest__TurnInterruptParams = Schema.Struct({ + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ClientRequest__TurnInterruptParams" }); export type ClientRequest__ReviewDelivery = "inline" | "detached"; -export const ClientRequest__ReviewDelivery = Schema.Literals(["inline", "detached"]); +export const ClientRequest__ReviewDelivery = Schema.Literals(["inline", "detached"]).annotate({ + identifier: "ClientRequest__ReviewDelivery", +}); export type ClientRequest__ReviewTarget = | { readonly type: "uncommittedChanges" } @@ -1106,141 +967,61 @@ export const ClientRequest__ReviewTarget = Schema.Union( }), ], { mode: "oneOf" }, -); - -export type ClientRequest__SandboxMode = "read-only" | "workspace-write" | "danger-full-access"; -export const ClientRequest__SandboxMode = Schema.Literals([ - "read-only", - "workspace-write", - "danger-full-access", -]); - -export type ClientRequest__SessionMigration = { - readonly cwd: string; - readonly path: string; - readonly title?: string | null; -}; -export const ClientRequest__SessionMigration = Schema.Struct({ - cwd: Schema.String, - path: Schema.String, - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type ClientRequest__SkillMigration = { readonly name: string }; -export const ClientRequest__SkillMigration = Schema.Struct({ name: Schema.String }); - -export type ClientRequest__SkillsListParams = { - readonly cwds?: ReadonlyArray; - readonly forceReload?: boolean; -}; -export const ClientRequest__SkillsListParams = Schema.Struct({ - cwds: Schema.optionalKey( - Schema.Array(Schema.String).annotate({ - description: "When empty, defaults to the current session working directory.", - }), - ), - forceReload: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "When true, bypass the skills cache and re-scan skills from disk.", - }), - ), -}); +).annotate({ identifier: "ClientRequest__ReviewTarget" }); -export type ClientRequest__SortDirection = "asc" | "desc"; -export const ClientRequest__SortDirection = Schema.Literals(["asc", "desc"]); - -export type ClientRequest__SubagentMigration = { readonly name: string }; -export const ClientRequest__SubagentMigration = Schema.Struct({ name: Schema.String }); - -export type ClientRequest__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type ClientRequest__ModelListParams = { + readonly cursor?: string | null; + readonly includeHidden?: boolean | null; + readonly limit?: number | null; }; -export const ClientRequest__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( +export const ClientRequest__ModelListParams = Schema.Struct({ + cursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", + description: "Opaque pagination cursor returned by a previous call.", }), Schema.Null, ]), ), -}); - -export type ClientRequest__ThreadApproveGuardianDeniedActionParams = { - readonly event: unknown; - readonly threadId: string; -}; -export const ClientRequest__ThreadApproveGuardianDeniedActionParams = Schema.Struct({ - event: Schema.Unknown.annotate({ - description: "Serialized `codex_protocol::protocol::GuardianAssessmentEvent`.", - }), - threadId: Schema.String, -}); - -export type ClientRequest__ThreadArchiveParams = { readonly threadId: string }; -export const ClientRequest__ThreadArchiveParams = Schema.Struct({ threadId: Schema.String }); - -export type ClientRequest__ThreadCompactStartParams = { readonly threadId: string }; -export const ClientRequest__ThreadCompactStartParams = Schema.Struct({ threadId: Schema.String }); - -export type ClientRequest__ThreadDeleteParams = { readonly threadId: string }; -export const ClientRequest__ThreadDeleteParams = Schema.Struct({ threadId: Schema.String }); - -export type ClientRequest__ThreadGoalClearParams = { readonly threadId: string }; -export const ClientRequest__ThreadGoalClearParams = Schema.Struct({ threadId: Schema.String }); - -export type ClientRequest__ThreadGoalGetParams = { readonly threadId: string }; -export const ClientRequest__ThreadGoalGetParams = Schema.Struct({ threadId: Schema.String }); - -export type ClientRequest__ThreadGoalStatus = - | "active" - | "paused" - | "blocked" - | "usageLimited" - | "budgetLimited" - | "complete"; -export const ClientRequest__ThreadGoalStatus = Schema.Literals([ - "active", - "paused", - "blocked", - "usageLimited", - "budgetLimited", - "complete", -]); + includeHidden: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: "When true, include models that are hidden from the default picker list.", + }), + Schema.Null, + ]), + ), + limit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Optional page size; defaults to a reasonable server-side value.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__ModelListParams" }); -export type ClientRequest__ThreadInjectItemsParams = { - readonly items: ReadonlyArray; - readonly threadId: string; +export type ClientRequest__ModelProviderCapabilitiesReadParams = { + readonly [x: string]: Schema.Json; }; -export const ClientRequest__ThreadInjectItemsParams = Schema.Struct({ - items: Schema.Array(Schema.Unknown).annotate({ - description: "Raw Responses API items to append to the thread's model-visible history.", - }), - threadId: Schema.String, -}); - -export type ClientRequest__ThreadListCwdFilter = string | ReadonlyArray; -export const ClientRequest__ThreadListCwdFilter = Schema.Union([ +export const ClientRequest__ModelProviderCapabilitiesReadParams = Schema.Record( Schema.String, - Schema.Array(Schema.String), -]); + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ identifier: "ClientRequest__ModelProviderCapabilitiesReadParams" }); -export type ClientRequest__ThreadLoadedListParams = { +export type ClientRequest__ExperimentalFeatureListParams = { readonly cursor?: string | null; readonly limit?: number | null; + readonly threadId?: string | null; }; -export const ClientRequest__ThreadLoadedListParams = Schema.Struct({ +export const ClientRequest__ExperimentalFeatureListParams = Schema.Struct({ cursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -1252,180 +1033,717 @@ export const ClientRequest__ThreadLoadedListParams = Schema.Struct({ limit: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ - description: "Optional page size; defaults to no limit.", + description: "Optional page size; defaults to a reasonable server-side value.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), -}); - -export type ClientRequest__ThreadMetadataGitInfoUpdateParams = { - readonly branch?: string | null; - readonly originUrl?: string | null; - readonly sha?: string | null; -}; -export const ClientRequest__ThreadMetadataGitInfoUpdateParams = Schema.Struct({ - branch: Schema.optionalKey( + threadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ description: - "Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "Optional loaded thread id. Pass this when showing feature state for an existing thread so enablement is computed from that thread's refreshed config, including project-local config for the thread's cwd.", }), Schema.Null, ]), ), - originUrl: Schema.optionalKey( +}).annotate({ identifier: "ClientRequest__ExperimentalFeatureListParams" }); + +export type ClientRequest__PermissionProfileListParams = { + readonly cursor?: string | null; + readonly cwd?: string | null; + readonly limit?: number | null; +}; +export const ClientRequest__PermissionProfileListParams = Schema.Struct({ + cursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: - "Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + description: "Opaque pagination cursor returned by a previous call.", }), Schema.Null, ]), ), - sha: Schema.optionalKey( + cwd: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: - "Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + description: "Optional working directory to resolve project config layers.", }), Schema.Null, ]), ), -}); - -export type ClientRequest__ThreadReadParams = { - readonly includeTurns?: boolean; - readonly threadId: string; -}; -export const ClientRequest__ThreadReadParams = Schema.Struct({ - includeTurns: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "When true, include turns and their items from rollout history.", - }), + limit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Optional page size; defaults to the full result set.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), ), - threadId: Schema.String, -}); +}).annotate({ identifier: "ClientRequest__PermissionProfileListParams" }); -export type ClientRequest__ThreadRollbackParams = { - readonly numTurns: number; - readonly threadId: string; +export type ClientRequest__ExperimentalFeatureEnablementSetParams = { + readonly enablement: { readonly [x: string]: boolean }; }; -export const ClientRequest__ThreadRollbackParams = Schema.Struct({ - numTurns: Schema.Number.annotate({ +export const ClientRequest__ExperimentalFeatureEnablementSetParams = Schema.Struct({ + enablement: Schema.Record(Schema.String, Schema.Boolean).annotate({ description: - "The number of turns to drop from the end of the thread. Must be >= 1.\n\nThis only modifies the thread's history and does not revert local file changes that have been made by the agent. Clients are responsible for reverting these changes.", - format: "uint32", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - threadId: Schema.String, -}).annotate({ description: "DEPRECATED: `thread/rollback` will be removed soon." }); + "Process-wide runtime feature enablement keyed by canonical feature name.\n\nOnly named features are updated. Omitted features are left unchanged. Send an empty map for a no-op.", + }), +}).annotate({ identifier: "ClientRequest__ExperimentalFeatureEnablementSetParams" }); -export type ClientRequest__ThreadSetNameParams = { - readonly name: string; - readonly threadId: string; +export type ClientRequest__McpServerOauthClientRegistration = "auto" | "cimd" | "dcr"; +export const ClientRequest__McpServerOauthClientRegistration = Schema.Literals([ + "auto", + "cimd", + "dcr", +]).annotate({ identifier: "ClientRequest__McpServerOauthClientRegistration" }); + +export type ClientRequest__McpServerStatusDetail = "full" | "toolsAndAuthOnly"; +export const ClientRequest__McpServerStatusDetail = Schema.Literals([ + "full", + "toolsAndAuthOnly", +]).annotate({ identifier: "ClientRequest__McpServerStatusDetail" }); + +export type ClientRequest__McpResourceReadTarget = { + readonly connectorId: string; + readonly linkId: string | null; }; -export const ClientRequest__ThreadSetNameParams = Schema.Struct({ - name: Schema.String, - threadId: Schema.String, -}); +export const ClientRequest__McpResourceReadTarget = Schema.Struct({ + connectorId: Schema.String, + linkId: Schema.Union([ + Schema.String.annotate({ + description: "Null explicitly requests no-auth access, subject to the app's resource policy.", + }), + Schema.Null, + ]), +}).annotate({ identifier: "ClientRequest__McpResourceReadTarget" }); -export type ClientRequest__ThreadShellCommandParams = { - readonly command: string; +export type ClientRequest__McpServerToolCallParams = { + readonly _meta?: Schema.Json; + readonly arguments?: Schema.Json; + readonly server: string; readonly threadId: string; + readonly tool: string; }; -export const ClientRequest__ThreadShellCommandParams = Schema.Struct({ - command: Schema.String.annotate({ - description: - "Shell command string evaluated by the thread's configured shell. Unlike `command/exec`, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.", - }), +export const ClientRequest__McpServerToolCallParams = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + arguments: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + server: Schema.String, threadId: Schema.String, + tool: Schema.String, +}).annotate({ identifier: "ClientRequest__McpServerToolCallParams" }); + +export type ClientRequest__WindowsSandboxSetupMode = "elevated" | "unelevated"; +export const ClientRequest__WindowsSandboxSetupMode = Schema.Literals([ + "elevated", + "unelevated", +]).annotate({ identifier: "ClientRequest__WindowsSandboxSetupMode" }); + +export type ClientRequest__LoginAppBrand = "codex" | "chatgpt"; +export const ClientRequest__LoginAppBrand = Schema.Literals(["codex", "chatgpt"]).annotate({ + identifier: "ClientRequest__LoginAppBrand", }); -export type ClientRequest__ThreadSortKey = "created_at" | "updated_at" | "recency_at"; -export const ClientRequest__ThreadSortKey = Schema.Literals([ - "created_at", - "updated_at", - "recency_at", -]); +export type ClientRequest__CancelLoginAccountParams = { readonly loginId: string }; +export const ClientRequest__CancelLoginAccountParams = Schema.Struct({ + loginId: Schema.String, +}).annotate({ identifier: "ClientRequest__CancelLoginAccountParams" }); -export type ClientRequest__ThreadSource = string; -export const ClientRequest__ThreadSource = Schema.String; +export type ClientRequest__GetAccountRateLimitsParams = { + readonly excludeResetCreditDetails?: boolean; + readonly supportsLunaReserve?: boolean; +}; +export const ClientRequest__GetAccountRateLimitsParams = Schema.Struct({ + excludeResetCreditDetails: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Skip the separate reset-credit detail lookup for background usage polls. The usage response still includes the available count; omitted/false preserves detailed reads.", + }), + ), + supportsLunaReserve: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "The client supports automatic Luna Reserve fallback. For eligible ChatGPT CLI users, allow the backend to record experiment exposure after ordinary usage is blocked.", + }), + ), +}).annotate({ + description: + "Usage-read capabilities of the requesting client, never inferred from its experiment arm.", + identifier: "ClientRequest__GetAccountRateLimitsParams", +}); -export type ClientRequest__ThreadSourceKind = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "subAgent" - | "subAgentReview" - | "subAgentCompact" - | "subAgentThreadSpawn" - | "subAgentOther" - | "unknown"; -export const ClientRequest__ThreadSourceKind = Schema.Literals([ - "cli", - "vscode", - "exec", - "appServer", - "subAgent", - "subAgentReview", - "subAgentCompact", - "subAgentThreadSpawn", - "subAgentOther", - "unknown", -]); +export type ClientRequest__ConsumeAccountRateLimitResetCreditParams = { + readonly creditId?: string | null; + readonly idempotencyKey: string; +}; +export const ClientRequest__ConsumeAccountRateLimitResetCreditParams = Schema.Struct({ + creditId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Opaque reset-credit identifier to redeem. When omitted, the backend selects the next available credit.", + }), + Schema.Null, + ]), + ), + idempotencyKey: Schema.String.annotate({ + description: + "Identifies one logical reset attempt. A UUID is recommended; reuse the same value when retrying that attempt.", + }), +}).annotate({ identifier: "ClientRequest__ConsumeAccountRateLimitResetCreditParams" }); -export type ClientRequest__ThreadStartSource = "startup" | "clear"; -export const ClientRequest__ThreadStartSource = Schema.Literals(["startup", "clear"]); +export type ClientRequest__GetAccountTokenUsageParams = { readonly threadId?: string | null }; +export const ClientRequest__GetAccountTokenUsageParams = Schema.Struct({ + threadId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "When present, read estimated usage for this thread instead of account-wide token activity.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__GetAccountTokenUsageParams" }); -export type ClientRequest__ThreadUnarchiveParams = { readonly threadId: string }; -export const ClientRequest__ThreadUnarchiveParams = Schema.Struct({ threadId: Schema.String }); +export type ClientRequest__AddCreditsNudgeCreditType = "credits" | "usage_limit"; +export const ClientRequest__AddCreditsNudgeCreditType = Schema.Literals([ + "credits", + "usage_limit", +]).annotate({ identifier: "ClientRequest__AddCreditsNudgeCreditType" }); -export type ClientRequest__ThreadUnsubscribeParams = { readonly threadId: string }; -export const ClientRequest__ThreadUnsubscribeParams = Schema.Struct({ threadId: Schema.String }); +export type ClientRequest__FeedbackUploadParams = { + readonly classification: string; + readonly extraLogFiles?: ReadonlyArray | null; + readonly includeLogs?: boolean; + readonly reason?: string | null; + readonly tags?: { readonly [x: string]: string } | null; + readonly threadId?: string | null; +}; +export const ClientRequest__FeedbackUploadParams = Schema.Struct({ + classification: Schema.String, + extraLogFiles: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + includeLogs: Schema.optionalKey(Schema.Boolean), + reason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + tags: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ClientRequest__FeedbackUploadParams" }); -export type ClientRequest__TurnInterruptParams = { - readonly threadId: string; - readonly turnId: string; +export type ClientRequest__CommandExecTerminalSize = { + readonly cols: number; + readonly rows: number; }; -export const ClientRequest__TurnInterruptParams = Schema.Struct({ - threadId: Schema.String, - turnId: Schema.String, +export const ClientRequest__CommandExecTerminalSize = Schema.Struct({ + cols: Schema.Number.annotate({ + description: "Terminal width in character cells.", + format: "uint16", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + rows: Schema.Number.annotate({ + description: "Terminal height in character cells.", + format: "uint16", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ + description: "PTY size in character cells for `command/exec` PTY sessions.", + identifier: "ClientRequest__CommandExecTerminalSize", }); -export type ClientRequest__TurnItemsView = "notLoaded" | "summary" | "full"; -export const ClientRequest__TurnItemsView = Schema.Literals(["notLoaded", "summary", "full"]); - -export type ClientRequest__WindowsSandboxSetupMode = "elevated" | "unelevated"; -export const ClientRequest__WindowsSandboxSetupMode = Schema.Literals(["elevated", "unelevated"]); +export type ClientRequest__CommandExecWriteParams = { + readonly closeStdin?: boolean; + readonly deltaBase64?: string | null; + readonly processId: string; +}; +export const ClientRequest__CommandExecWriteParams = Schema.Struct({ + closeStdin: Schema.optionalKey( + Schema.Boolean.annotate({ + description: "Close stdin after writing `deltaBase64`, if present.", + }), + ), + deltaBase64: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Optional base64-encoded stdin bytes to write." }), + Schema.Null, + ]), + ), + processId: Schema.String.annotate({ + description: + "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + }), +}).annotate({ + description: "Write stdin bytes to a running `command/exec` session, close stdin, or both.", + identifier: "ClientRequest__CommandExecWriteParams", +}); -export type CommandExecutionRequestApprovalParams__AbsolutePathBuf = string; -export const CommandExecutionRequestApprovalParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +export type ClientRequest__CommandExecTerminateParams = { readonly processId: string }; +export const ClientRequest__CommandExecTerminateParams = Schema.Struct({ + processId: Schema.String.annotate({ + description: + "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + }), +}).annotate({ + description: "Terminate a running `command/exec` session.", + identifier: "ClientRequest__CommandExecTerminateParams", }); -export type CommandExecutionRequestApprovalParams__AdditionalNetworkPermissions = { - readonly enabled?: boolean | null; +export type ClientRequest__ConfigReadParams = { + readonly cwd?: string | null; + readonly includeLayers?: boolean; }; -export const CommandExecutionRequestApprovalParams__AdditionalNetworkPermissions = Schema.Struct({ - enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), -}); +export const ClientRequest__ConfigReadParams = Schema.Struct({ + cwd: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between `cwd` and the project/repo root).", + }), + Schema.Null, + ]), + ), + includeLayers: Schema.optionalKey(Schema.Boolean), +}).annotate({ identifier: "ClientRequest__ConfigReadParams" }); -export type CommandExecutionRequestApprovalParams__FileSystemAccessMode = "read" | "write" | "deny"; -export const CommandExecutionRequestApprovalParams__FileSystemAccessMode = Schema.Literals([ - "read", - "write", - "deny", -]); +export type ClientRequest__ExternalAgentConfigDetectParams = { + readonly cwds?: ReadonlyArray | null; + readonly includeHome?: boolean; + readonly maxSessionAgeDays?: number | null; + readonly maxSessions?: number | null; + readonly migrationSource?: string | null; + readonly source?: string | null; +}; +export const ClientRequest__ExternalAgentConfigDetectParams = Schema.Struct({ + cwds: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: "Zero or more working directories to include for repo-scoped detection.", + }), + Schema.Null, + ]), + ), + includeHome: Schema.optionalKey( + Schema.Boolean.annotate({ + description: "If true, include detection under the user's home directory.", + }), + ), + maxSessionAgeDays: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Maximum age in days for detected sessions. Missing values use the default limit.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + maxSessions: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Maximum number of sessions to detect. Missing values use the default limit.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + migrationSource: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional migration-source selector. Missing or unrecognized values use the default source.", + }), + Schema.Null, + ]), + ), + source: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Deprecated field retained for compatibility. This field is ignored; use `migrationSource` to select the migration source.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__ExternalAgentConfigDetectParams" }); + +export type ClientRequest__CommandMigration = { readonly name: string }; +export const ClientRequest__CommandMigration = Schema.Struct({ name: Schema.String }).annotate({ + identifier: "ClientRequest__CommandMigration", +}); + +export type ClientRequest__HookMigration = { readonly name: string }; +export const ClientRequest__HookMigration = Schema.Struct({ name: Schema.String }).annotate({ + identifier: "ClientRequest__HookMigration", +}); + +export type ClientRequest__McpServerMigration = { readonly name: string }; +export const ClientRequest__McpServerMigration = Schema.Struct({ name: Schema.String }).annotate({ + identifier: "ClientRequest__McpServerMigration", +}); + +export type ClientRequest__PluginsMigration = { + readonly marketplaceName: string; + readonly pluginNames: ReadonlyArray; +}; +export const ClientRequest__PluginsMigration = Schema.Struct({ + marketplaceName: Schema.String, + pluginNames: Schema.Array(Schema.String), +}).annotate({ identifier: "ClientRequest__PluginsMigration" }); + +export type ClientRequest__SessionMigration = { + readonly cwd: string; + readonly path: string; + readonly title?: string | null; +}; +export const ClientRequest__SessionMigration = Schema.Struct({ + cwd: Schema.String, + path: Schema.String, + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ClientRequest__SessionMigration" }); + +export type ClientRequest__SkillMigration = { readonly name: string }; +export const ClientRequest__SkillMigration = Schema.Struct({ name: Schema.String }).annotate({ + identifier: "ClientRequest__SkillMigration", +}); + +export type ClientRequest__SubagentMigration = { readonly name: string }; +export const ClientRequest__SubagentMigration = Schema.Struct({ name: Schema.String }).annotate({ + identifier: "ClientRequest__SubagentMigration", +}); + +export type ClientRequest__ExternalAgentConfigMigrationItemType = + | "AGENTS_MD" + | "CONFIG" + | "SKILLS" + | "PLUGINS" + | "MCP_SERVER_CONFIG" + | "SUBAGENTS" + | "HOOKS" + | "COMMANDS" + | "MEMORY" + | "SESSIONS"; +export const ClientRequest__ExternalAgentConfigMigrationItemType = Schema.Literals([ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "MEMORY", + "SESSIONS", +]).annotate({ identifier: "ClientRequest__ExternalAgentConfigMigrationItemType" }); + +export type ClientRequest__MergeStrategy = "replace" | "upsert"; +export const ClientRequest__MergeStrategy = Schema.Literals(["replace", "upsert"]).annotate({ + identifier: "ClientRequest__MergeStrategy", +}); + +export type ClientRequest__GetAccountParams = { readonly refreshToken?: boolean }; +export const ClientRequest__GetAccountParams = Schema.Struct({ + refreshToken: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.", + }), + ), +}).annotate({ identifier: "ClientRequest__GetAccountParams" }); + +export type ClientRequest__FuzzyFileSearchParams = { + readonly cancellationToken?: string | null; + readonly query: string; + readonly roots: ReadonlyArray; +}; +export const ClientRequest__FuzzyFileSearchParams = Schema.Struct({ + cancellationToken: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.String, + roots: Schema.Array(Schema.String), +}).annotate({ identifier: "ClientRequest__FuzzyFileSearchParams" }); + +export type ClientRequest__AdditionalContextKind = "untrusted" | "application"; +export const ClientRequest__AdditionalContextKind = Schema.Literals([ + "untrusted", + "application", +]).annotate({ identifier: "ClientRequest__AdditionalContextKind" }); + +export type ClientRequest__ModeKind = "plan" | "default"; +export const ClientRequest__ModeKind = Schema.Literals(["plan", "default"]).annotate({ + description: "Initial collaboration mode to use when the TUI starts.", + identifier: "ClientRequest__ModeKind", +}); + +export type ClientRequest__DynamicToolNamespaceTool = { + readonly deferLoading?: boolean; + readonly description: string; + readonly inputSchema: Schema.Json; + readonly name: string; + readonly type: "function"; +}; +export const ClientRequest__DynamicToolNamespaceTool = Schema.Union( + [ + Schema.Struct({ + deferLoading: Schema.optionalKey(Schema.Boolean), + description: Schema.String, + inputSchema: Schema.Json.annotate({ expected: "JSON value" }), + name: Schema.String, + type: Schema.Literal("function").annotate({ title: "FunctionDynamicToolNamespaceToolType" }), + }).annotate({ title: "FunctionDynamicToolNamespaceTool" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ClientRequest__DynamicToolNamespaceTool" }); + +export type ClientRequest__InternalChatMessageMetadataPassthrough = { + readonly turn_id?: string | null; +}; +export const ClientRequest__InternalChatMessageMetadataPassthrough = Schema.Struct({ + turn_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: + "Internal Responses API passthrough metadata copied into underlying chat messages.\n\nResponses API strongly types this payload. Do not modify it without first getting API approval and making the corresponding Responses API change.", + identifier: "ClientRequest__InternalChatMessageMetadataPassthrough", +}); + +export type ClientRequest__MessagePhase = "commentary" | "final_answer"; +export const ClientRequest__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "ClientRequest__MessagePhase", +}); + +export type ClientRequest__AgentMessageInputContent = + | { readonly text: string; readonly type: "input_text" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const ClientRequest__AgentMessageInputContent = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextAgentMessageInputContentType", + }), + }).annotate({ title: "InputTextAgentMessageInputContent" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentAgentMessageInputContentType", + }), + }).annotate({ title: "EncryptedContentAgentMessageInputContent" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ClientRequest__AgentMessageInputContent" }); + +export type ClientRequest__ReasoningItemContent = + | { readonly text: string; readonly type: "reasoning_text" } + | { readonly text: string; readonly type: "text" }; +export const ClientRequest__ReasoningItemContent = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("reasoning_text").annotate({ + title: "ReasoningTextReasoningItemContentType", + }), + }).annotate({ title: "ReasoningTextReasoningItemContent" }), + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("text").annotate({ title: "TextReasoningItemContentType" }), + }).annotate({ title: "TextReasoningItemContent" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ClientRequest__ReasoningItemContent" }); + +export type ClientRequest__ReasoningItemReasoningSummary = { + readonly text: string; + readonly type: "summary_text"; +}; +export const ClientRequest__ReasoningItemReasoningSummary = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("summary_text").annotate({ + title: "SummaryTextReasoningItemReasoningSummaryType", + }), + }).annotate({ title: "SummaryTextReasoningItemReasoningSummary" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ClientRequest__ReasoningItemReasoningSummary" }); + +export type ClientRequest__LocalShellAction = { + readonly command: ReadonlyArray; + readonly env?: { readonly [x: string]: string } | null; + readonly timeout_ms?: number | null; + readonly type: "exec"; + readonly user?: string | null; + readonly working_directory?: string | null; +}; +export const ClientRequest__LocalShellAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.Array(Schema.String), + env: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + timeout_ms: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("exec").annotate({ title: "ExecLocalShellActionType" }), + user: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + working_directory: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "ExecLocalShellAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ClientRequest__LocalShellAction" }); + +export type ClientRequest__LocalShellStatus = "completed" | "in_progress" | "incomplete"; +export const ClientRequest__LocalShellStatus = Schema.Literals([ + "completed", + "in_progress", + "incomplete", +]).annotate({ identifier: "ClientRequest__LocalShellStatus" }); + +export type ClientRequest__ResponsesApiWebSearchAction = + | { + readonly queries?: ReadonlyArray | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly type: "open_page"; readonly url?: string | null } + | { + readonly pattern?: string | null; + readonly type: "find_in_page"; + readonly url?: string | null; + } + | { readonly type: "other" }; +export const ClientRequest__ResponsesApiWebSearchAction = Schema.Union( + [ + Schema.Struct({ + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchResponsesApiWebSearchActionType" }), + }).annotate({ title: "SearchResponsesApiWebSearchAction" }), + Schema.Struct({ + type: Schema.Literal("open_page").annotate({ + title: "OpenPageResponsesApiWebSearchActionType", + }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageResponsesApiWebSearchAction" }), + Schema.Struct({ + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("find_in_page").annotate({ + title: "FindInPageResponsesApiWebSearchActionType", + }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageResponsesApiWebSearchAction" }), + Schema.Struct({ + type: Schema.Literal("other").annotate({ title: "OtherResponsesApiWebSearchActionType" }), + }).annotate({ title: "OtherResponsesApiWebSearchAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ClientRequest__ResponsesApiWebSearchAction" }); + +export type ClientRequest__CapabilityRootLocation = { + readonly environmentId: string; + readonly path: string; + readonly type: "environment"; +}; +export const ClientRequest__CapabilityRootLocation = Schema.Union( + [ + Schema.Struct({ + environmentId: Schema.String, + path: Schema.String.annotate({ + description: "Absolute path for the root in the selected environment.", + }), + type: Schema.Literal("environment").annotate({ + title: "EnvironmentCapabilityRootLocationType", + }), + }).annotate({ + title: "EnvironmentCapabilityRootLocation", + description: "A path owned by an execution environment.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: "Location used to resolve a selected capability root.", + identifier: "ClientRequest__CapabilityRootLocation", +}); + +export type ClientRequest__ConversationTextRole = "user" | "developer" | "assistant"; +export const ClientRequest__ConversationTextRole = Schema.Literals([ + "user", + "developer", + "assistant", +]).annotate({ identifier: "ClientRequest__ConversationTextRole" }); + +export type ClientRequest__LegacyAppPathString = string; +export const ClientRequest__LegacyAppPathString = Schema.String.annotate({ + identifier: "ClientRequest__LegacyAppPathString", +}); export type CommandExecutionRequestApprovalParams__LegacyAppPathString = string; -export const CommandExecutionRequestApprovalParams__LegacyAppPathString = Schema.String; +export const CommandExecutionRequestApprovalParams__LegacyAppPathString = Schema.String.annotate({ + identifier: "CommandExecutionRequestApprovalParams__LegacyAppPathString", +}); + +export type CommandExecutionRequestApprovalParams__CommandExecutionApprovalKind = + | "command" + | "writeStdin"; +export const CommandExecutionRequestApprovalParams__CommandExecutionApprovalKind = Schema.Literals([ + "command", + "writeStdin", +]).annotate({ + description: "Distinguishes a command approval from input sent to an existing terminal.", + identifier: "CommandExecutionRequestApprovalParams__CommandExecutionApprovalKind", +}); export type CommandExecutionRequestApprovalParams__NetworkApprovalProtocol = | "http" @@ -1437,19 +1755,33 @@ export const CommandExecutionRequestApprovalParams__NetworkApprovalProtocol = Sc "https", "socks5Tcp", "socks5Udp", -]); +]).annotate({ identifier: "CommandExecutionRequestApprovalParams__NetworkApprovalProtocol" }); export type CommandExecutionRequestApprovalParams__NetworkPolicyRuleAction = "allow" | "deny"; export const CommandExecutionRequestApprovalParams__NetworkPolicyRuleAction = Schema.Literals([ "allow", "deny", -]); +]).annotate({ identifier: "CommandExecutionRequestApprovalParams__NetworkPolicyRuleAction" }); + +export type CommandExecutionRequestApprovalParams__FileSystemAccessMode = "read" | "write" | "deny"; +export const CommandExecutionRequestApprovalParams__FileSystemAccessMode = Schema.Literals([ + "read", + "write", + "deny", +]).annotate({ identifier: "CommandExecutionRequestApprovalParams__FileSystemAccessMode" }); + +export type CommandExecutionRequestApprovalParams__AdditionalNetworkPermissions = { + readonly enabled?: boolean | null; +}; +export const CommandExecutionRequestApprovalParams__AdditionalNetworkPermissions = Schema.Struct({ + enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), +}).annotate({ identifier: "CommandExecutionRequestApprovalParams__AdditionalNetworkPermissions" }); export type CommandExecutionRequestApprovalResponse__NetworkPolicyRuleAction = "allow" | "deny"; export const CommandExecutionRequestApprovalResponse__NetworkPolicyRuleAction = Schema.Literals([ "allow", "deny", -]); +]).annotate({ identifier: "CommandExecutionRequestApprovalResponse__NetworkPolicyRuleAction" }); export type DynamicToolCallResponse__DynamicToolCallOutputContentItem = | { readonly text: string; readonly type: "inputText" } @@ -1477,7 +1809,12 @@ export const DynamicToolCallResponse__DynamicToolCallOutputContentItem = Schema. }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "DynamicToolCallResponse__DynamicToolCallOutputContentItem" }); + +export type ExecCommandApprovalParams__ThreadId = string; +export const ExecCommandApprovalParams__ThreadId = Schema.String.annotate({ + identifier: "ExecCommandApprovalParams__ThreadId", +}); export type ExecCommandApprovalParams__ParsedCommand = | { readonly cmd: string; readonly name: string; readonly path: string; readonly type: "read" } @@ -1517,34 +1854,41 @@ export const ExecCommandApprovalParams__ParsedCommand = Schema.Union( }).annotate({ title: "UnknownParsedCommand" }), ], { mode: "oneOf" }, -); - -export type ExecCommandApprovalParams__ThreadId = string; -export const ExecCommandApprovalParams__ThreadId = Schema.String; +).annotate({ identifier: "ExecCommandApprovalParams__ParsedCommand" }); export type ExecCommandApprovalResponse__NetworkPolicyRuleAction = "allow" | "deny"; export const ExecCommandApprovalResponse__NetworkPolicyRuleAction = Schema.Literals([ "allow", "deny", -]); +]).annotate({ identifier: "ExecCommandApprovalResponse__NetworkPolicyRuleAction" }); export type FileChangeRequestApprovalResponse__FileChangeApprovalDecision = | "accept" | "acceptForSession" | "decline" | "cancel"; -export const FileChangeRequestApprovalResponse__FileChangeApprovalDecision = Schema.Literals([ - "accept", - "acceptForSession", - "decline", - "cancel", -]); +export const FileChangeRequestApprovalResponse__FileChangeApprovalDecision = Schema.Union( + [ + Schema.Literal("accept").annotate({ description: "User approved the file changes." }), + Schema.Literal("acceptForSession").annotate({ + description: + "User approved the file changes and future changes to the same files should run without prompting.", + }), + Schema.Literal("decline").annotate({ + description: "User denied the file changes. The agent will continue the turn.", + }), + Schema.Literal("cancel").annotate({ + description: "User denied the file changes. The turn will also be immediately interrupted.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "FileChangeRequestApprovalResponse__FileChangeApprovalDecision" }); export type FuzzyFileSearchResponse__FuzzyFileSearchMatchType = "file" | "directory"; export const FuzzyFileSearchResponse__FuzzyFileSearchMatchType = Schema.Literals([ "file", "directory", -]); +]).annotate({ identifier: "FuzzyFileSearchResponse__FuzzyFileSearchMatchType" }); export type FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchMatchType = | "file" @@ -1552,50 +1896,36 @@ export type FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchMatchType export const FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchMatchType = Schema.Literals([ "file", "directory", -]); +]).annotate({ identifier: "FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchMatchType" }); export type JSONRPCError__JSONRPCErrorError = { readonly code: number; - readonly data?: unknown; + readonly data?: Schema.Json; readonly message: string; }; export const JSONRPCError__JSONRPCErrorError = Schema.Struct({ - code: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - data: Schema.optionalKey(Schema.Unknown), + code: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + data: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), message: Schema.String, -}); +}).annotate({ identifier: "JSONRPCError__JSONRPCErrorError" }); export type JSONRPCError__RequestId = string | number; export const JSONRPCError__RequestId = Schema.Union([ Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -]); - -export type JSONRPCMessage__JSONRPCErrorError = { - readonly code: number; - readonly data?: unknown; - readonly message: string; -}; -export const JSONRPCMessage__JSONRPCErrorError = Schema.Struct({ - code: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - data: Schema.optionalKey(Schema.Unknown), - message: Schema.String, -}); - -export type JSONRPCMessage__JSONRPCNotification = { - readonly method: string; - readonly params?: unknown; -}; -export const JSONRPCMessage__JSONRPCNotification = Schema.Struct({ - method: Schema.String, - params: Schema.optionalKey(Schema.Unknown), -}).annotate({ description: "A notification which does not expect a response." }); + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +]).annotate({ identifier: "JSONRPCError__RequestId" }); export type JSONRPCMessage__RequestId = string | number; export const JSONRPCMessage__RequestId = Schema.Union([ Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -]); + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +]).annotate({ identifier: "JSONRPCMessage__RequestId" }); export type JSONRPCMessage__W3cTraceContext = { readonly traceparent?: string | null; @@ -1604,13 +1934,40 @@ export type JSONRPCMessage__W3cTraceContext = { export const JSONRPCMessage__W3cTraceContext = Schema.Struct({ traceparent: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), tracestate: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "JSONRPCMessage__W3cTraceContext" }); + +export type JSONRPCMessage__JSONRPCNotification = { + readonly method: string; + readonly params?: Schema.Json; +}; +export const JSONRPCMessage__JSONRPCNotification = Schema.Struct({ + method: Schema.String, + params: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ + description: "A notification which does not expect a response.", + identifier: "JSONRPCMessage__JSONRPCNotification", }); +export type JSONRPCMessage__JSONRPCErrorError = { + readonly code: number; + readonly data?: Schema.Json; + readonly message: string; +}; +export const JSONRPCMessage__JSONRPCErrorError = Schema.Struct({ + code: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + data: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + message: Schema.String, +}).annotate({ identifier: "JSONRPCMessage__JSONRPCErrorError" }); + export type JSONRPCRequest__RequestId = string | number; export const JSONRPCRequest__RequestId = Schema.Union([ Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -]); + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +]).annotate({ identifier: "JSONRPCRequest__RequestId" }); export type JSONRPCRequest__W3cTraceContext = { readonly traceparent?: string | null; @@ -1619,20 +1976,20 @@ export type JSONRPCRequest__W3cTraceContext = { export const JSONRPCRequest__W3cTraceContext = Schema.Struct({ traceparent: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), tracestate: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "JSONRPCRequest__W3cTraceContext" }); export type JSONRPCResponse__RequestId = string | number; export const JSONRPCResponse__RequestId = Schema.Union([ Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -]); - -export type McpServerElicitationRequestParams__McpElicitationArrayType = "array"; -export const McpServerElicitationRequestParams__McpElicitationArrayType = Schema.Literal("array"); + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +]).annotate({ identifier: "JSONRPCResponse__RequestId" }); -export type McpServerElicitationRequestParams__McpElicitationBooleanType = "boolean"; -export const McpServerElicitationRequestParams__McpElicitationBooleanType = - Schema.Literal("boolean"); +export type McpServerElicitationRequestParams__McpElicitationStringType = "string"; +export const McpServerElicitationRequestParams__McpElicitationStringType = Schema.Literal( + "string", +).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationStringType" }); export type McpServerElicitationRequestParams__McpElicitationConstOption = { readonly const: string; @@ -1641,16 +1998,12 @@ export type McpServerElicitationRequestParams__McpElicitationConstOption = { export const McpServerElicitationRequestParams__McpElicitationConstOption = Schema.Struct({ const: Schema.String, title: Schema.String, -}); - -export type McpServerElicitationRequestParams__McpElicitationNumberType = "number" | "integer"; -export const McpServerElicitationRequestParams__McpElicitationNumberType = Schema.Literals([ - "number", - "integer", -]); +}).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationConstOption" }); -export type McpServerElicitationRequestParams__McpElicitationObjectType = "object"; -export const McpServerElicitationRequestParams__McpElicitationObjectType = Schema.Literal("object"); +export type McpServerElicitationRequestParams__McpElicitationArrayType = "array"; +export const McpServerElicitationRequestParams__McpElicitationArrayType = Schema.Literal( + "array", +).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationArrayType" }); export type McpServerElicitationRequestParams__McpElicitationStringFormat = | "email" @@ -1662,10 +2015,23 @@ export const McpServerElicitationRequestParams__McpElicitationStringFormat = Sch "uri", "date", "date-time", -]); +]).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationStringFormat" }); -export type McpServerElicitationRequestParams__McpElicitationStringType = "string"; -export const McpServerElicitationRequestParams__McpElicitationStringType = Schema.Literal("string"); +export type McpServerElicitationRequestParams__McpElicitationNumberType = "number" | "integer"; +export const McpServerElicitationRequestParams__McpElicitationNumberType = Schema.Literals([ + "number", + "integer", +]).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationNumberType" }); + +export type McpServerElicitationRequestParams__McpElicitationBooleanType = "boolean"; +export const McpServerElicitationRequestParams__McpElicitationBooleanType = Schema.Literal( + "boolean", +).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationBooleanType" }); + +export type McpServerElicitationRequestParams__McpElicitationObjectType = "object"; +export const McpServerElicitationRequestParams__McpElicitationObjectType = Schema.Literal( + "object", +).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationObjectType" }); export type McpServerElicitationRequestResponse__McpServerElicitationAction = | "accept" @@ -1675,256 +2041,231 @@ export const McpServerElicitationRequestResponse__McpServerElicitationAction = S "accept", "decline", "cancel", -]); +]).annotate({ identifier: "McpServerElicitationRequestResponse__McpServerElicitationAction" }); -export type PermissionsRequestApprovalParams__AbsolutePathBuf = string; -export const PermissionsRequestApprovalParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +export type PermissionsRequestApprovalParams__LegacyAppPathString = string; +export const PermissionsRequestApprovalParams__LegacyAppPathString = Schema.String.annotate({ + identifier: "PermissionsRequestApprovalParams__LegacyAppPathString", }); +export type PermissionsRequestApprovalParams__FileSystemAccessMode = "read" | "write" | "deny"; +export const PermissionsRequestApprovalParams__FileSystemAccessMode = Schema.Literals([ + "read", + "write", + "deny", +]).annotate({ identifier: "PermissionsRequestApprovalParams__FileSystemAccessMode" }); + export type PermissionsRequestApprovalParams__AdditionalNetworkPermissions = { readonly enabled?: boolean | null; }; export const PermissionsRequestApprovalParams__AdditionalNetworkPermissions = Schema.Struct({ enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), -}); +}).annotate({ identifier: "PermissionsRequestApprovalParams__AdditionalNetworkPermissions" }); -export type PermissionsRequestApprovalParams__FileSystemAccessMode = "read" | "write" | "deny"; -export const PermissionsRequestApprovalParams__FileSystemAccessMode = Schema.Literals([ +export type PermissionsRequestApprovalResponse__FileSystemAccessMode = "read" | "write" | "deny"; +export const PermissionsRequestApprovalResponse__FileSystemAccessMode = Schema.Literals([ "read", "write", "deny", -]); +]).annotate({ identifier: "PermissionsRequestApprovalResponse__FileSystemAccessMode" }); -export type PermissionsRequestApprovalParams__LegacyAppPathString = string; -export const PermissionsRequestApprovalParams__LegacyAppPathString = Schema.String; +export type PermissionsRequestApprovalResponse__LegacyAppPathString = string; +export const PermissionsRequestApprovalResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "PermissionsRequestApprovalResponse__LegacyAppPathString", +}); export type PermissionsRequestApprovalResponse__AdditionalNetworkPermissions = { readonly enabled?: boolean | null; }; export const PermissionsRequestApprovalResponse__AdditionalNetworkPermissions = Schema.Struct({ enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), -}); +}).annotate({ identifier: "PermissionsRequestApprovalResponse__AdditionalNetworkPermissions" }); -export type PermissionsRequestApprovalResponse__FileSystemAccessMode = "read" | "write" | "deny"; -export const PermissionsRequestApprovalResponse__FileSystemAccessMode = Schema.Literals([ - "read", - "write", - "deny", -]); +export type PermissionsRequestApprovalResponse__PermissionGrantScope = "turn" | "session"; +export const PermissionsRequestApprovalResponse__PermissionGrantScope = Schema.Literals([ + "turn", + "session", +]).annotate({ identifier: "PermissionsRequestApprovalResponse__PermissionGrantScope" }); -export type PermissionsRequestApprovalResponse__LegacyAppPathString = string; -export const PermissionsRequestApprovalResponse__LegacyAppPathString = Schema.String; +export type ServerNotification__NonSteerableTurnKind = "review" | "compact"; +export const ServerNotification__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "ServerNotification__NonSteerableTurnKind" }); + +export type ServerNotification__MisalignmentSteer = { readonly message: string }; +export const ServerNotification__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "ServerNotification__MisalignmentSteer" }); export type ServerNotification__AbsolutePathBuf = string; export const ServerNotification__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "ServerNotification__AbsolutePathBuf", }); -export type ServerNotification__AccountLoginCompletedNotification = { - readonly error?: string | null; - readonly loginId?: string | null; - readonly success: boolean; +export type ServerNotification__GitInfo = { + readonly branch?: string | null; + readonly originUrl?: string | null; + readonly sha?: string | null; }; -export const ServerNotification__AccountLoginCompletedNotification = Schema.Struct({ - error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - loginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - success: Schema.Boolean, -}); +export const ServerNotification__GitInfo = Schema.Struct({ + branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__GitInfo" }); -export type ServerNotification__ActivePermissionProfile = { - readonly extends?: string | null; - readonly id: string; -}; -export const ServerNotification__ActivePermissionProfile = Schema.Struct({ - extends: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", - }), - Schema.Null, - ]), - ), - id: Schema.String.annotate({ - description: - "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", - }), -}); +export type ServerNotification__ThreadHistoryMode = "legacy" | "paginated"; +export const ServerNotification__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "ServerNotification__ThreadHistoryMode" }); -export type ServerNotification__AdditionalNetworkPermissions = { - readonly enabled?: boolean | null; -}; -export const ServerNotification__AdditionalNetworkPermissions = Schema.Struct({ - enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), -}); +export type ServerNotification__ReasoningEffort = string; +export const ServerNotification__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "ServerNotification__ReasoningEffort", + }), +); -export type ServerNotification__AgentMessageDeltaNotification = { - readonly delta: string; - readonly itemId: string; - readonly threadId: string; - readonly turnId: string; +export type ServerNotification__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const ServerNotification__AgentMessageDeltaNotification = Schema.Struct({ - delta: Schema.String, - itemId: Schema.String, - threadId: Schema.String, - turnId: Schema.String, +export const ServerNotification__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "ServerNotification__ThreadSectionAppearance", }); export type ServerNotification__AgentPath = string; -export const ServerNotification__AgentPath = Schema.String; +export const ServerNotification__AgentPath = Schema.String.annotate({ + identifier: "ServerNotification__AgentPath", +}); -export type ServerNotification__AppBranding = { - readonly category?: string | null; - readonly developer?: string | null; - readonly isDiscoverableApp: boolean; - readonly privacyPolicy?: string | null; - readonly termsOfService?: string | null; - readonly website?: string | null; -}; -export const ServerNotification__AppBranding = Schema.Struct({ - category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - developer: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - isDiscoverableApp: Schema.Boolean, - privacyPolicy: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - termsOfService: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - website: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ description: "EXPERIMENTAL - app metadata returned by app-list APIs." }); +export type ServerNotification__ThreadId = string; +export const ServerNotification__ThreadId = Schema.String.annotate({ + identifier: "ServerNotification__ThreadId", +}); -export type ServerNotification__AppReview = { readonly status: string }; -export const ServerNotification__AppReview = Schema.Struct({ status: Schema.String }); +export type ServerNotification__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; +export const ServerNotification__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "ServerNotification__ThreadActiveFlag" }); -export type ServerNotification__AppScreenshot = { - readonly fileId?: string | null; - readonly url?: string | null; - readonly userPrompt: string; -}; -export const ServerNotification__AppScreenshot = Schema.Struct({ - fileId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - userPrompt: Schema.String, +export type ServerNotification__ThreadSource = string; +export const ServerNotification__ThreadSource = Schema.String.annotate({ + identifier: "ServerNotification__ThreadSource", }); -export type ServerNotification__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const ServerNotification__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); +export type ServerNotification__ByteRange = { readonly end: number; readonly start: number }; +export const ServerNotification__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "ServerNotification__ByteRange" }); -export type ServerNotification__AskForApproval = - | "untrusted" - | "on-request" - | "never" - | { - readonly granular: { - readonly mcp_elicitations: boolean; - readonly request_permissions?: boolean; - readonly rules: boolean; - readonly sandbox_approval: boolean; - readonly skill_approval?: boolean; - }; - }; -export const ServerNotification__AskForApproval = Schema.Union( - [ - Schema.Literals(["untrusted", "on-request", "never"]), - Schema.Struct({ - granular: Schema.Struct({ - mcp_elicitations: Schema.Boolean, - request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - rules: Schema.Boolean, - sandbox_approval: Schema.Boolean, - skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - }), - }).annotate({ title: "GranularAskForApproval" }), - ], - { mode: "oneOf" }, -); +export type ServerNotification__ImageDetail = "auto" | "low" | "high" | "original"; +export const ServerNotification__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "ServerNotification__ImageDetail" }); -export type ServerNotification__AuthMode = - | "apikey" - | "chatgpt" - | "chatgptAuthTokens" - | "headers" - | "agentIdentity" - | "personalAccessToken" - | "bedrockApiKey"; -export const ServerNotification__AuthMode = Schema.Literals([ - "apikey", - "chatgpt", - "chatgptAuthTokens", - "headers", - "agentIdentity", - "personalAccessToken", - "bedrockApiKey", -]).annotate({ description: "Authentication mode for OpenAI-backed providers." }); +export type ServerNotification__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; +}; +export const ServerNotification__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "ServerNotification__HookPromptFragment" }); -export type ServerNotification__AutoReviewDecisionSource = "agent"; -export const ServerNotification__AutoReviewDecisionSource = Schema.Literal("agent").annotate({ - description: "[UNSTABLE] Source that produced a terminal approval auto-review decision.", +export type ServerNotification__AgentMessageDelivery = "async"; +export const ServerNotification__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "ServerNotification__AgentMessageDelivery", }); -export type ServerNotification__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const ServerNotification__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); - -export type ServerNotification__CommandExecOutputDeltaNotification = { - readonly capReached: boolean; - readonly deltaBase64: string; - readonly processId: string; - readonly stream: "stdout" | "stderr"; +export type ServerNotification__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; }; -export const ServerNotification__CommandExecOutputDeltaNotification = Schema.Struct({ - capReached: Schema.Boolean.annotate({ - description: - "`true` on the final streamed chunk for a stream when `outputBytesCap` truncated later output on that stream.", - }), - deltaBase64: Schema.String.annotate({ description: "Base64-encoded output bytes." }), - processId: Schema.String.annotate({ - description: - "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", - }), - stream: Schema.Literals(["stdout", "stderr"]).annotate({ - description: "Stream label for `command/exec/outputDelta` notifications.", - }), -}).annotate({ +export const ServerNotification__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "ServerNotification__MemoryCitationEntry" }); + +export type ServerNotification__MessagePhase = "commentary" | "final_answer"; +export const ServerNotification__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: - "Base64-encoded output chunk emitted for a streaming `command/exec` request.\n\nThese notifications are connection-scoped. If the originating connection closes, the server terminates the process.", + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "ServerNotification__MessagePhase", }); -export type ServerNotification__CommandExecutionOutputDeltaNotification = { - readonly delta: string; - readonly itemId: string; - readonly threadId: string; - readonly turnId: string; +export type ServerNotification__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; }; -export const ServerNotification__CommandExecutionOutputDeltaNotification = Schema.Struct({ - delta: Schema.String, - itemId: Schema.String, - threadId: Schema.String, - turnId: Schema.String, +export const ServerNotification__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "ServerNotification__AsyncUserInputQuestion" }); + +export type ServerNotification__LegacyAppPathString = string; +export const ServerNotification__LegacyAppPathString = Schema.String.annotate({ + identifier: "ServerNotification__LegacyAppPathString", }); +export type ServerNotification__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const ServerNotification__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "ServerNotification__CommandExecutionSource" }); + export type ServerNotification__CommandExecutionStatus = | "inProgress" | "completed" @@ -1935,43 +2276,83 @@ export const ServerNotification__CommandExecutionStatus = Schema.Literals([ "completed", "failed", "declined", -]); +]).annotate({ identifier: "ServerNotification__CommandExecutionStatus" }); -export type ServerNotification__ContextCompactedNotification = { - readonly threadId: string; - readonly turnId: string; -}; -export const ServerNotification__ContextCompactedNotification = Schema.Struct({ - threadId: Schema.String, - turnId: Schema.String, -}).annotate({ description: "Deprecated: Use `ContextCompaction` item type instead." }); +export type ServerNotification__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const ServerNotification__PatchChangeKind = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), + Schema.Struct({ + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), + Schema.Struct({ + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__PatchChangeKind" }); -export type ServerNotification__CreditsSnapshot = { - readonly balance?: string | null; - readonly hasCredits: boolean; - readonly unlimited: boolean; +export type ServerNotification__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const ServerNotification__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "ServerNotification__PatchApplyStatus" }); + +export type ServerNotification__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const ServerNotification__CreditsSnapshot = Schema.Struct({ - balance: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - hasCredits: Schema.Boolean, - unlimited: Schema.Boolean, -}); +export const ServerNotification__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__McpToolCallAppContext" }); -export type ServerNotification__DeprecationNoticeNotification = { - readonly details?: string | null; - readonly summary: string; +export type ServerNotification__McpToolCallError = { readonly message: string }; +export const ServerNotification__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "ServerNotification__McpToolCallError" }); + +export type ServerNotification__McpAppDisplayMode = "inline" | "fullscreen"; +export const ServerNotification__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "ServerNotification__McpAppDisplayMode" }); + +export type ServerNotification__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; }; -export const ServerNotification__DeprecationNoticeNotification = Schema.Struct({ - details: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional extra guidance, such as migration steps or rationale.", - }), - Schema.Null, - ]), - ), - summary: Schema.String.annotate({ description: "Concise summary of what is deprecated." }), -}); +export const ServerNotification__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "ServerNotification__McpToolCallResult" }); + +export type ServerNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const ServerNotification__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "ServerNotification__McpToolCallStatus" }); export type ServerNotification__DynamicToolCallOutputContentItem = | { readonly text: string; readonly type: "inputText" } @@ -1999,132 +2380,405 @@ export const ServerNotification__DynamicToolCallOutputContentItem = Schema.Union }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "ServerNotification__DynamicToolCallOutputContentItem" }); export type ServerNotification__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; export const ServerNotification__DynamicToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); +]).annotate({ identifier: "ServerNotification__DynamicToolCallStatus" }); -export type ServerNotification__EnvironmentConnectionNotification = { - readonly environmentId: string; - readonly threadId: string; -}; -export const ServerNotification__EnvironmentConnectionNotification = Schema.Struct({ - environmentId: Schema.String, - threadId: Schema.String, -}); +export type ServerNotification__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const ServerNotification__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "ServerNotification__CollabAgentStatus" }); -export type ServerNotification__ExternalAgentConfigMigrationItemType = - | "AGENTS_MD" - | "CONFIG" - | "SKILLS" - | "PLUGINS" - | "MCP_SERVER_CONFIG" - | "SUBAGENTS" - | "HOOKS" - | "COMMANDS" - | "MEMORY" - | "SESSIONS"; -export const ServerNotification__ExternalAgentConfigMigrationItemType = Schema.Literals([ - "AGENTS_MD", - "CONFIG", - "SKILLS", - "PLUGINS", - "MCP_SERVER_CONFIG", - "SUBAGENTS", - "HOOKS", - "COMMANDS", - "MEMORY", - "SESSIONS", -]); +export type ServerNotification__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const ServerNotification__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "ServerNotification__CollabAgentToolCallStatus" }); -export type ServerNotification__FileChangeOutputDeltaNotification = { - readonly delta: string; - readonly itemId: string; - readonly threadId: string; - readonly turnId: string; -}; -export const ServerNotification__FileChangeOutputDeltaNotification = Schema.Struct({ - delta: Schema.String, - itemId: Schema.String, - threadId: Schema.String, - turnId: Schema.String, -}).annotate({ - description: - "Deprecated legacy notification for `apply_patch` textual output.\n\nThe server no longer emits this notification.", -}); +export type ServerNotification__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const ServerNotification__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "ServerNotification__CollabAgentTool" }); -export type ServerNotification__FileSystemAccessMode = "read" | "write" | "deny"; -export const ServerNotification__FileSystemAccessMode = Schema.Literals(["read", "write", "deny"]); +export type ServerNotification__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const ServerNotification__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "ServerNotification__SubAgentActivityKind" }); -export type ServerNotification__FuzzyFileSearchMatchType = "file" | "directory"; -export const ServerNotification__FuzzyFileSearchMatchType = Schema.Literals(["file", "directory"]); +export type ServerNotification__WebSearchAction = + | { + readonly queries?: ReadonlyArray | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const ServerNotification__WebSearchAction = Schema.Union( + [ + Schema.Struct({ + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), + Schema.Struct({ + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), + Schema.Struct({ + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), + Schema.Struct({ + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__WebSearchAction" }); -export type ServerNotification__FuzzyFileSearchSessionCompletedNotification = { - readonly sessionId: string; +export type ServerNotification__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; }; -export const ServerNotification__FuzzyFileSearchSessionCompletedNotification = Schema.Struct({ - sessionId: Schema.String, -}); +export const ServerNotification__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__ImageGenerationFailure" }); -export type ServerNotification__GitInfo = { - readonly branch?: string | null; - readonly originUrl?: string | null; - readonly sha?: string | null; -}; -export const ServerNotification__GitInfo = Schema.Struct({ - branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export type ServerNotification__TurnItemsView = "notLoaded" | "summary" | "full"; +export const ServerNotification__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__TurnItemsView" }); -export type ServerNotification__GuardianApprovalReviewStatus = - | "inProgress" - | "approved" - | "denied" - | "timedOut" - | "aborted"; -export const ServerNotification__GuardianApprovalReviewStatus = Schema.Literals([ +export type ServerNotification__TurnStatus = "completed" | "interrupted" | "failed" | "inProgress"; +export const ServerNotification__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", "inProgress", - "approved", - "denied", - "timedOut", - "aborted", -]).annotate({ description: "[UNSTABLE] Lifecycle state for an approval auto-review." }); +]).annotate({ identifier: "ServerNotification__TurnStatus" }); -export type ServerNotification__GuardianCommandSource = "shell" | "unifiedExec"; -export const ServerNotification__GuardianCommandSource = Schema.Literals(["shell", "unifiedExec"]); +export type ServerNotification__ThreadArchivedNotification = { readonly threadId: string }; +export const ServerNotification__ThreadArchivedNotification = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadArchivedNotification" }); -export type ServerNotification__GuardianRiskLevel = "low" | "medium" | "high" | "critical"; -export const ServerNotification__GuardianRiskLevel = Schema.Literals([ - "low", - "medium", - "high", - "critical", -]).annotate({ description: "[UNSTABLE] Risk level assigned by approval auto-review." }); +export type ServerNotification__ThreadDeletedNotification = { readonly threadId: string }; +export const ServerNotification__ThreadDeletedNotification = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadDeletedNotification" }); -export type ServerNotification__GuardianUserAuthorization = "unknown" | "low" | "medium" | "high"; -export const ServerNotification__GuardianUserAuthorization = Schema.Literals([ - "unknown", - "low", - "medium", - "high", -]).annotate({ description: "[UNSTABLE] Authorization level assigned by approval auto-review." }); +export type ServerNotification__ThreadUnarchivedNotification = { readonly threadId: string }; +export const ServerNotification__ThreadUnarchivedNotification = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadUnarchivedNotification" }); -export type ServerNotification__GuardianWarningNotification = { - readonly message: string; +export type ServerNotification__ThreadClosedNotification = { readonly threadId: string }; +export const ServerNotification__ThreadClosedNotification = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadClosedNotification" }); + +export type ServerNotification__ThreadRevertedNotification = { readonly threadId: string }; +export const ServerNotification__ThreadRevertedNotification = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadRevertedNotification" }); + +export type ServerNotification__SkillsChangedNotification = { readonly [x: string]: Schema.Json }; +export const ServerNotification__SkillsChangedNotification = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ + description: + "Notification emitted when watched local skill files change.\n\nTreat this as an invalidation signal and re-run `skills/list` with the client's current parameters when refreshed skill metadata is needed.", + identifier: "ServerNotification__SkillsChangedNotification", +}); + +export type ServerNotification__ThreadNameUpdatedNotification = { readonly threadId: string; + readonly threadName?: string | null; }; -export const ServerNotification__GuardianWarningNotification = Schema.Struct({ - message: Schema.String.annotate({ - description: "Concise guardian warning message for the user.", +export const ServerNotification__ThreadNameUpdatedNotification = Schema.Struct({ + threadId: Schema.String, + threadName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__ThreadNameUpdatedNotification" }); + +export type ServerNotification__ThreadAttachmentOperation = "created" | "deleted"; +export const ServerNotification__ThreadAttachmentOperation = Schema.Literals([ + "created", + "deleted", +]).annotate({ + description: "The persisted attachment change represented by a notification.", + identifier: "ServerNotification__ThreadAttachmentOperation", +}); + +export type ServerNotification__ThreadGoalStatus = + | "active" + | "paused" + | "blocked" + | "usageLimited" + | "budgetLimited" + | "complete"; +export const ServerNotification__ThreadGoalStatus = Schema.Literals([ + "active", + "paused", + "blocked", + "usageLimited", + "budgetLimited", + "complete", +]).annotate({ identifier: "ServerNotification__ThreadGoalStatus" }); + +export type ServerNotification__ThreadGoalClearedNotification = { readonly threadId: string }; +export const ServerNotification__ThreadGoalClearedNotification = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadGoalClearedNotification" }); + +export type ServerNotification__ThreadQueueChangedNotification = { readonly threadId: string }; +export const ServerNotification__ThreadQueueChangedNotification = Schema.Struct({ + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadQueueChangedNotification" }); + +export type ServerNotification__ProjectChangeType = "created" | "updated" | "deleted"; +export const ServerNotification__ProjectChangeType = Schema.Literals([ + "created", + "updated", + "deleted", +]).annotate({ identifier: "ServerNotification__ProjectChangeType" }); + +export type ServerNotification__ThreadProjectUpdatedNotification = { + readonly projectId: string | null; + readonly threadId: string; +}; +export const ServerNotification__ThreadProjectUpdatedNotification = Schema.Struct({ + projectId: Schema.Union([Schema.String, Schema.Null]), + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadProjectUpdatedNotification" }); + +export type ServerNotification__EnvironmentConnectionNotification = { + readonly environmentId: string; + readonly threadId: string; +}; +export const ServerNotification__EnvironmentConnectionNotification = Schema.Struct({ + environmentId: Schema.String, + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__EnvironmentConnectionNotification" }); + +export type ServerNotification__ActivePermissionProfile = { + readonly extends?: string | null; + readonly id: string; +}; +export const ServerNotification__ActivePermissionProfile = Schema.Struct({ + extends: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", + }), + Schema.Null, + ]), + ), + id: Schema.String.annotate({ + description: + "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", }), - threadId: Schema.String.annotate({ description: "Thread target for the guardian warning." }), +}).annotate({ identifier: "ServerNotification__ActivePermissionProfile" }); + +export type ServerNotification__AskForApproval = + | "untrusted" + | "on-request" + | "never" + | { + readonly granular: { + readonly mcp_elicitations: boolean; + readonly request_permissions?: boolean; + readonly rules: boolean; + readonly sandbox_approval: boolean; + readonly skill_approval?: boolean; + }; + }; +export const ServerNotification__AskForApproval = Schema.Union( + [ + Schema.Literals(["untrusted", "on-request", "never"]), + Schema.Struct({ + granular: Schema.Struct({ + mcp_elicitations: Schema.Boolean, + request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + rules: Schema.Boolean, + sandbox_approval: Schema.Boolean, + skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + }), + }).annotate({ title: "GranularAskForApproval" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__AskForApproval" }); + +export type ServerNotification__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const ServerNotification__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "ServerNotification__ApprovalsReviewer", +}); + +export type ServerNotification__ModeKind = "plan" | "default"; +export const ServerNotification__ModeKind = Schema.Literals(["plan", "default"]).annotate({ + description: "Initial collaboration mode to use when the TUI starts.", + identifier: "ServerNotification__ModeKind", +}); + +export type ServerNotification__Personality = "none" | "friendly" | "pragmatic"; +export const ServerNotification__Personality = Schema.Literals([ + "none", + "friendly", + "pragmatic", +]).annotate({ + description: "Deprecated: `friendly` and `pragmatic` no longer select a style.", + identifier: "ServerNotification__Personality", +}); + +export type ServerNotification__NetworkAccess = "restricted" | "enabled"; +export const ServerNotification__NetworkAccess = Schema.Literals([ + "restricted", + "enabled", +]).annotate({ identifier: "ServerNotification__NetworkAccess" }); + +export type ServerNotification__ReasoningSummary = "auto" | "concise" | "detailed" | "none"; +export const ServerNotification__ReasoningSummary = Schema.Union( + [ + Schema.Literals(["auto", "concise", "detailed"]), + Schema.Literal("none").annotate({ description: "Option to disable reasoning summaries." }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + identifier: "ServerNotification__ReasoningSummary", }); +export type ServerNotification__TokenUsageBreakdown = { + readonly cacheWriteInputTokens?: number; + readonly cachedInputTokens: number; + readonly inputTokens: number; + readonly outputTokens: number; + readonly reasoningOutputTokens: number; + readonly totalTokens: number; +}; +export const ServerNotification__TokenUsageBreakdown = Schema.Struct({ + cacheWriteInputTokens: Schema.optionalKey( + Schema.Number.annotate({ default: 0, format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + ), + cachedInputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + inputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + outputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + reasoningOutputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + totalTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +}).annotate({ identifier: "ServerNotification__TokenUsageBreakdown" }); + +export type ServerNotification__HookOutputEntryKind = + | "warning" + | "stop" + | "feedback" + | "context" + | "error"; +export const ServerNotification__HookOutputEntryKind = Schema.Literals([ + "warning", + "stop", + "feedback", + "context", + "error", +]).annotate({ identifier: "ServerNotification__HookOutputEntryKind" }); + export type ServerNotification__HookEventName = | "preToolUse" | "permissionRequest" @@ -2136,7 +2790,8 @@ export type ServerNotification__HookEventName = | "userPromptSubmit" | "subagentStart" | "subagentStop" - | "stop"; + | "stop" + | "interrupt"; export const ServerNotification__HookEventName = Schema.Literals([ "preToolUse", "permissionRequest", @@ -2149,37 +2804,53 @@ export const ServerNotification__HookEventName = Schema.Literals([ "subagentStart", "subagentStop", "stop", -]); + "interrupt", +]).annotate({ identifier: "ServerNotification__HookEventName" }); export type ServerNotification__HookExecutionMode = "sync" | "async"; -export const ServerNotification__HookExecutionMode = Schema.Literals(["sync", "async"]); - -export type ServerNotification__HookHandlerType = "command" | "prompt" | "agent"; -export const ServerNotification__HookHandlerType = Schema.Literals(["command", "prompt", "agent"]); +export const ServerNotification__HookExecutionMode = Schema.Literals(["sync", "async"]).annotate({ + identifier: "ServerNotification__HookExecutionMode", +}); -export type ServerNotification__HookOutputEntryKind = - | "warning" - | "stop" - | "feedback" - | "context" - | "error"; -export const ServerNotification__HookOutputEntryKind = Schema.Literals([ - "warning", - "stop", - "feedback", - "context", - "error", -]); +export type ServerNotification__HookHandlerType = "command" | "mcpTool" | "prompt" | "agent"; +export const ServerNotification__HookHandlerType = Schema.Literals([ + "command", + "mcpTool", + "prompt", + "agent", +]).annotate({ identifier: "ServerNotification__HookHandlerType" }); -export type ServerNotification__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const ServerNotification__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, +export type ServerNotification__HookScope = "thread" | "turn"; +export const ServerNotification__HookScope = Schema.Literals(["thread", "turn"]).annotate({ + identifier: "ServerNotification__HookScope", }); +export type ServerNotification__HookSource = + | "system" + | "user" + | "project" + | "mdm" + | "sessionFlags" + | "plugin" + | "cloudRequirements" + | "cloudManagedConfig" + | "legacyManagedConfigFile" + | "legacyManagedConfigMdm" + | "unknown"; +export const ServerNotification__HookSource = Schema.Literals([ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "cloudManagedConfig", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown", +]).annotate({ identifier: "ServerNotification__HookSource" }); + export type ServerNotification__HookRunStatus = | "running" | "completed" @@ -2192,151 +2863,35 @@ export const ServerNotification__HookRunStatus = Schema.Literals([ "failed", "blocked", "stopped", -]); - -export type ServerNotification__HookScope = "thread" | "turn"; -export const ServerNotification__HookScope = Schema.Literals(["thread", "turn"]); - -export type ServerNotification__ImageDetail = "auto" | "low" | "high" | "original"; -export const ServerNotification__ImageDetail = Schema.Literals(["auto", "low", "high", "original"]); - -export type ServerNotification__LegacyAppPathString = string; -export const ServerNotification__LegacyAppPathString = Schema.String; - -export type ServerNotification__McpServerOauthLoginCompletedNotification = { - readonly error?: string | null; - readonly name: string; - readonly success: boolean; - readonly threadId?: string | null; -}; -export const ServerNotification__McpServerOauthLoginCompletedNotification = Schema.Struct({ - error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - name: Schema.String, - success: Schema.Boolean, - threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type ServerNotification__McpServerStartupFailureReason = "reauthenticationRequired"; -export const ServerNotification__McpServerStartupFailureReason = Schema.Literal( - "reauthenticationRequired", -); - -export type ServerNotification__McpServerStartupState = - | "starting" - | "ready" - | "failed" - | "cancelled"; -export const ServerNotification__McpServerStartupState = Schema.Literals([ - "starting", - "ready", - "failed", - "cancelled", -]); - -export type ServerNotification__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; -}; -export const ServerNotification__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type ServerNotification__McpToolCallError = { readonly message: string }; -export const ServerNotification__McpToolCallError = Schema.Struct({ message: Schema.String }); +]).annotate({ identifier: "ServerNotification__HookRunStatus" }); -export type ServerNotification__McpToolCallProgressNotification = { - readonly itemId: string; - readonly message: string; +export type ServerNotification__TurnDiffUpdatedNotification = { + readonly diff: string; readonly threadId: string; readonly turnId: string; }; -export const ServerNotification__McpToolCallProgressNotification = Schema.Struct({ - itemId: Schema.String, - message: Schema.String, +export const ServerNotification__TurnDiffUpdatedNotification = Schema.Struct({ + diff: Schema.String, threadId: Schema.String, turnId: Schema.String, +}).annotate({ + description: + "Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn.", + identifier: "ServerNotification__TurnDiffUpdatedNotification", }); -export type ServerNotification__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const ServerNotification__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); - -export type ServerNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const ServerNotification__McpToolCallStatus = Schema.Literals([ +export type ServerNotification__TurnPlanStepStatus = "pending" | "inProgress" | "completed"; +export const ServerNotification__TurnPlanStepStatus = Schema.Literals([ + "pending", "inProgress", "completed", - "failed", -]); - -export type ServerNotification__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; -}; -export const ServerNotification__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, -}); - -export type ServerNotification__MessagePhase = "commentary" | "final_answer"; -export const ServerNotification__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', -}); - -export type ServerNotification__ModeKind = "plan" | "default"; -export const ServerNotification__ModeKind = Schema.Literals(["plan", "default"]).annotate({ - description: "Initial collaboration mode to use when the TUI starts.", -}); - -export type ServerNotification__ModelRerouteReason = "highRiskCyberActivity"; -export const ServerNotification__ModelRerouteReason = Schema.Literal("highRiskCyberActivity"); - -export type ServerNotification__ModelSafetyBufferingUpdatedNotification = { - readonly fasterModel?: string | null; - readonly model: string; - readonly reasons: ReadonlyArray; - readonly showBufferingUi: boolean; - readonly threadId: string; - readonly turnId: string; - readonly useCases: ReadonlyArray; -}; -export const ServerNotification__ModelSafetyBufferingUpdatedNotification = Schema.Struct({ - fasterModel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - model: Schema.String, - reasons: Schema.Array(Schema.String), - showBufferingUi: Schema.Boolean, - threadId: Schema.String, - turnId: Schema.String, - useCases: Schema.Array(Schema.String), -}); +]).annotate({ identifier: "ServerNotification__TurnPlanStepStatus" }); -export type ServerNotification__ModelVerification = "trustedAccessForCyber"; -export const ServerNotification__ModelVerification = Schema.Literal("trustedAccessForCyber"); +export type ServerNotification__GuardianCommandSource = "shell" | "unifiedExec"; +export const ServerNotification__GuardianCommandSource = Schema.Literals([ + "shell", + "unifiedExec", +]).annotate({ identifier: "ServerNotification__GuardianCommandSource" }); export type ServerNotification__NetworkApprovalProtocol = | "http" @@ -2348,45 +2903,93 @@ export const ServerNotification__NetworkApprovalProtocol = Schema.Literals([ "https", "socks5Tcp", "socks5Udp", -]); +]).annotate({ identifier: "ServerNotification__NetworkApprovalProtocol" }); -export type ServerNotification__NonSteerableTurnKind = "review" | "compact"; -export const ServerNotification__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); +export type ServerNotification__FileSystemAccessMode = "read" | "write" | "deny"; +export const ServerNotification__FileSystemAccessMode = Schema.Literals([ + "read", + "write", + "deny", +]).annotate({ identifier: "ServerNotification__FileSystemAccessMode" }); -export type ServerNotification__PatchApplyStatus = +export type ServerNotification__AdditionalNetworkPermissions = { + readonly enabled?: boolean | null; +}; +export const ServerNotification__AdditionalNetworkPermissions = Schema.Struct({ + enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), +}).annotate({ identifier: "ServerNotification__AdditionalNetworkPermissions" }); + +export type ServerNotification__GuardianRiskLevel = "low" | "medium" | "high" | "critical"; +export const ServerNotification__GuardianRiskLevel = Schema.Literals([ + "low", + "medium", + "high", + "critical", +]).annotate({ + description: "[UNSTABLE] Risk level assigned by approval auto-review.", + identifier: "ServerNotification__GuardianRiskLevel", +}); + +export type ServerNotification__GuardianApprovalReviewStatus = | "inProgress" - | "completed" - | "failed" - | "declined"; -export const ServerNotification__PatchApplyStatus = Schema.Literals([ + | "approved" + | "denied" + | "timedOut" + | "aborted"; +export const ServerNotification__GuardianApprovalReviewStatus = Schema.Literals([ "inProgress", - "completed", - "failed", - "declined", -]); + "approved", + "denied", + "timedOut", + "aborted", +]).annotate({ + description: "[UNSTABLE] Lifecycle state for an approval auto-review.", + identifier: "ServerNotification__GuardianApprovalReviewStatus", +}); -export type ServerNotification__PatchChangeKind = - | { readonly type: "add" } - | { readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update" }; -export const ServerNotification__PatchChangeKind = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), - }).annotate({ title: "AddPatchChangeKind" }), - Schema.Struct({ - type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), - }).annotate({ title: "DeletePatchChangeKind" }), - Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), - }).annotate({ title: "UpdatePatchChangeKind" }), - ], - { mode: "oneOf" }, -); +export type ServerNotification__GuardianUserAuthorization = "unknown" | "low" | "medium" | "high"; +export const ServerNotification__GuardianUserAuthorization = Schema.Literals([ + "unknown", + "low", + "medium", + "high", +]).annotate({ + description: "[UNSTABLE] Authorization level assigned by approval auto-review.", + identifier: "ServerNotification__GuardianUserAuthorization", +}); -export type ServerNotification__Personality = "none" | "friendly" | "pragmatic"; -export const ServerNotification__Personality = Schema.Literals(["none", "friendly", "pragmatic"]); +export type ServerNotification__AutoReviewDecisionSource = "agent"; +export const ServerNotification__AutoReviewDecisionSource = Schema.Literal("agent").annotate({ + description: "[UNSTABLE] Source that produced a terminal approval auto-review decision.", + identifier: "ServerNotification__AutoReviewDecisionSource", +}); + +export type ServerNotification__StrictReviewRequiredNotification = { + readonly startedAtMs: number; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__StrictReviewRequiredNotification = Schema.Struct({ + startedAtMs: Schema.Number.annotate({ + description: "Unix timestamp (in milliseconds) when this review started.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__StrictReviewRequiredNotification" }); + +export type ServerNotification__AgentMessageDeltaNotification = { + readonly delta: string; + readonly itemId: string; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__AgentMessageDeltaNotification = Schema.Struct({ + delta: Schema.String, + itemId: Schema.String, + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__AgentMessageDeltaNotification" }); export type ServerNotification__PlanDeltaNotification = { readonly delta: string; @@ -2402,45 +3005,36 @@ export const ServerNotification__PlanDeltaNotification = Schema.Struct({ }).annotate({ description: "EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content.", + identifier: "ServerNotification__PlanDeltaNotification", }); -export type ServerNotification__PlanType = - | "free" - | "go" - | "plus" - | "pro" - | "prolite" - | "team" - | "self_serve_business_prolite" - | "self_serve_business_usage_based" - | "business" - | "ent26" - | "enterprise_cbp_automation" - | "enterprise_cbp_usage_based" - | "enterprise" - | "edu" - | "edu_plus" - | "edu_pro" - | "unknown"; -export const ServerNotification__PlanType = Schema.Literals([ - "free", - "go", - "plus", - "pro", - "prolite", - "team", - "self_serve_business_prolite", - "self_serve_business_usage_based", - "business", - "ent26", - "enterprise_cbp_automation", - "enterprise_cbp_usage_based", - "enterprise", - "edu", - "edu_plus", - "edu_pro", - "unknown", -]); +export type ServerNotification__CommandExecOutputStream = "stdout" | "stderr"; +export const ServerNotification__CommandExecOutputStream = Schema.Union( + [ + Schema.Literal("stdout").annotate({ + description: "stdout stream. PTY mode multiplexes terminal output here.", + }), + Schema.Literal("stderr").annotate({ description: "stderr stream." }), + ], + { mode: "oneOf" }, +).annotate({ + description: "Stream label for `command/exec/outputDelta` notifications.", + identifier: "ServerNotification__CommandExecOutputStream", +}); + +export type ServerNotification__ProcessOutputStream = "stdout" | "stderr"; +export const ServerNotification__ProcessOutputStream = Schema.Union( + [ + Schema.Literal("stdout").annotate({ + description: "stdout stream. PTY mode multiplexes terminal output here.", + }), + Schema.Literal("stderr").annotate({ description: "stderr stream." }), + ], + { mode: "oneOf" }, +).annotate({ + description: "Stream label for `process/outputDelta` notifications.", + identifier: "ServerNotification__ProcessOutputStream", +}); export type ServerNotification__ProcessExitedNotification = { readonly exitCode: number; @@ -2452,7 +3046,7 @@ export type ServerNotification__ProcessExitedNotification = { }; export const ServerNotification__ProcessExitedNotification = Schema.Struct({ exitCode: Schema.Number.annotate({ description: "Process exit code.", format: "int32" }).check( - Schema.isInt(), + Schema.isInt().annotate({ expected: "an integer" }), ), processHandle: Schema.String.annotate({ description: "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", @@ -2473,146 +3067,187 @@ export const ServerNotification__ProcessExitedNotification = Schema.Struct({ description: "Whether stdout reached `outputBytesCap`.\n\nIn streaming mode, stdout is empty and cap state is also reported on the final stdout `process/outputDelta` notification.", }), -}).annotate({ description: "Final process exit notification for `process/spawn`." }); - -export type ServerNotification__ProcessOutputDeltaNotification = { - readonly capReached: boolean; - readonly deltaBase64: string; - readonly processHandle: string; - readonly stream: "stdout" | "stderr"; -}; -export const ServerNotification__ProcessOutputDeltaNotification = Schema.Struct({ - capReached: Schema.Boolean.annotate({ - description: - "True on the final streamed chunk for this stream when output was truncated by `outputBytesCap`.", - }), - deltaBase64: Schema.String.annotate({ description: "Base64-encoded output bytes." }), - processHandle: Schema.String.annotate({ - description: "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", - }), - stream: Schema.Literals(["stdout", "stderr"]).annotate({ - description: "Stream label for `process/outputDelta` notifications.", - }), }).annotate({ - description: "Base64-encoded output chunk emitted for a streaming `process/spawn` request.", + description: "Final process exit notification for `process/spawn`.", + identifier: "ServerNotification__ProcessExitedNotification", }); -export type ServerNotification__RateLimitReachedType = - | "rate_limit_reached" - | "workspace_owner_credits_depleted" - | "workspace_member_credits_depleted" - | "workspace_owner_usage_limit_reached" - | "workspace_member_usage_limit_reached"; -export const ServerNotification__RateLimitReachedType = Schema.Literals([ - "rate_limit_reached", - "workspace_owner_credits_depleted", - "workspace_member_credits_depleted", - "workspace_owner_usage_limit_reached", - "workspace_member_usage_limit_reached", -]); - -export type ServerNotification__RateLimitWindow = { - readonly resetsAt?: number | null; - readonly usedPercent: number; - readonly windowDurationMins?: number | null; +export type ServerNotification__CommandExecutionOutputDeltaNotification = { + readonly delta: string; + readonly itemId: string; + readonly threadId: string; + readonly turnId: string; }; -export const ServerNotification__RateLimitWindow = Schema.Struct({ - resetsAt: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - usedPercent: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - windowDurationMins: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), -}); - -export type ServerNotification__RealtimeConversationVersion = "v1" | "v2" | "v3"; -export const ServerNotification__RealtimeConversationVersion = Schema.Literals(["v1", "v2", "v3"]); - -export type ServerNotification__ReasoningEffort = string; -export const ServerNotification__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); - -export type ServerNotification__ReasoningSummary = "auto" | "concise" | "detailed" | "none"; -export const ServerNotification__ReasoningSummary = Schema.Union( - [ - Schema.Literals(["auto", "concise", "detailed"]), - Schema.Literal("none").annotate({ description: "Option to disable reasoning summaries." }), - ], - { mode: "oneOf" }, -).annotate({ - description: - "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", -}); +export const ServerNotification__CommandExecutionOutputDeltaNotification = Schema.Struct({ + delta: Schema.String, + itemId: Schema.String, + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__CommandExecutionOutputDeltaNotification" }); -export type ServerNotification__ReasoningSummaryPartAddedNotification = { +export type ServerNotification__TerminalInteractionNotification = { readonly itemId: string; - readonly summaryIndex: number; + readonly processId: string; + readonly stdin: string; readonly threadId: string; readonly turnId: string; }; -export const ServerNotification__ReasoningSummaryPartAddedNotification = Schema.Struct({ +export const ServerNotification__TerminalInteractionNotification = Schema.Struct({ itemId: Schema.String, - summaryIndex: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + processId: Schema.String, + stdin: Schema.String, threadId: Schema.String, turnId: Schema.String, -}); +}).annotate({ identifier: "ServerNotification__TerminalInteractionNotification" }); -export type ServerNotification__ReasoningSummaryTextDeltaNotification = { +export type ServerNotification__FileChangeOutputDeltaNotification = { readonly delta: string; readonly itemId: string; - readonly summaryIndex: number; readonly threadId: string; readonly turnId: string; }; -export const ServerNotification__ReasoningSummaryTextDeltaNotification = Schema.Struct({ +export const ServerNotification__FileChangeOutputDeltaNotification = Schema.Struct({ delta: Schema.String, itemId: Schema.String, - summaryIndex: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), threadId: Schema.String, turnId: Schema.String, +}).annotate({ + description: + "Deprecated legacy notification for `apply_patch` textual output.\n\nThe server no longer emits this notification.", + identifier: "ServerNotification__FileChangeOutputDeltaNotification", }); -export type ServerNotification__ReasoningTextDeltaNotification = { - readonly contentIndex: number; - readonly delta: string; +export type ServerNotification__RequestId = string | number; +export const ServerNotification__RequestId = Schema.Union([ + Schema.String, + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +]).annotate({ identifier: "ServerNotification__RequestId" }); + +export type ServerNotification__McpToolCallProgressNotification = { readonly itemId: string; + readonly message: string; readonly threadId: string; readonly turnId: string; }; -export const ServerNotification__ReasoningTextDeltaNotification = Schema.Struct({ - contentIndex: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - delta: Schema.String, +export const ServerNotification__McpToolCallProgressNotification = Schema.Struct({ itemId: Schema.String, + message: Schema.String, threadId: Schema.String, turnId: Schema.String, -}); +}).annotate({ identifier: "ServerNotification__McpToolCallProgressNotification" }); -export type ServerNotification__RemoteControlConnectionStatus = - | "disabled" - | "connecting" - | "connected" - | "errored"; -export const ServerNotification__RemoteControlConnectionStatus = Schema.Literals([ - "disabled", - "connecting", - "connected", - "errored", -]); +export type ServerNotification__McpServerOauthLoginCompletedNotification = { + readonly error?: string | null; + readonly name: string; + readonly success: boolean; + readonly threadId?: string | null; +}; +export const ServerNotification__McpServerOauthLoginCompletedNotification = Schema.Struct({ + error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + name: Schema.String, + success: Schema.Boolean, + threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__McpServerOauthLoginCompletedNotification" }); -export type ServerNotification__RequestId = string | number; -export const ServerNotification__RequestId = Schema.Union([ - Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -]); +export type ServerNotification__McpServerStartupFailureReason = "reauthenticationRequired"; +export const ServerNotification__McpServerStartupFailureReason = Schema.Literal( + "reauthenticationRequired", +).annotate({ identifier: "ServerNotification__McpServerStartupFailureReason" }); -export type ServerNotification__SkillsChangedNotification = {}; -export const ServerNotification__SkillsChangedNotification = Schema.Struct({}).annotate({ - description: - "Notification emitted when watched local skill files change.\n\nTreat this as an invalidation signal and re-run `skills/list` with the client's current parameters when refreshed skill metadata is needed.", +export type ServerNotification__McpServerStartupState = + | "starting" + | "ready" + | "failed" + | "cancelled"; +export const ServerNotification__McpServerStartupState = Schema.Literals([ + "starting", + "ready", + "failed", + "cancelled", +]).annotate({ identifier: "ServerNotification__McpServerStartupState" }); + +export type ServerNotification__McpServerEventNotification = { + readonly method: string; + readonly params: Schema.Json; +}; +export const ServerNotification__McpServerEventNotification = Schema.Struct({ + method: Schema.String, + params: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ identifier: "ServerNotification__McpServerEventNotification" }); + +export type ServerNotification__AuthMode = + | "apikey" + | "chatgpt" + | "chatgptAuthTokens" + | "headers" + | "agentIdentity" + | "personalAccessToken" + | "bedrockApiKey" + | "bedrockAccessKeys"; +export const ServerNotification__AuthMode = Schema.Union( + [ + Schema.Literal("apikey").annotate({ + description: "OpenAI API key provided by the caller and stored by Codex.", + }), + Schema.Literal("chatgpt").annotate({ + description: "ChatGPT OAuth managed by Codex (tokens persisted and refreshed by Codex).", + }), + Schema.Literal("chatgptAuthTokens").annotate({ + description: + "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.", + }), + Schema.Literal("headers").annotate({ + description: "Backend auth supplied as request headers.", + }), + Schema.Literal("agentIdentity").annotate({ + description: "Programmatic Codex auth backed by a registered Agent Identity.", + }), + Schema.Literal("personalAccessToken").annotate({ + description: "Programmatic Codex auth backed by a personal access token.", + }), + Schema.Literal("bedrockApiKey").annotate({ + description: "Amazon Bedrock bearer token managed by Codex.", + }), + Schema.Literal("bedrockAccessKeys").annotate({ + description: "Amazon Bedrock AWS access keys managed by Codex.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: "Authentication mode for OpenAI-backed providers.", + identifier: "ServerNotification__AuthMode", }); +export type ServerNotification__PlanType = string; +export const ServerNotification__PlanType = Schema.String.annotate({ + identifier: "ServerNotification__PlanType", +}); + +export type ServerNotification__GatewayOAuthStatus = + | "notReady" + | "started" + | "succeeded" + | "failed"; +export const ServerNotification__GatewayOAuthStatus = Schema.Literals([ + "notReady", + "started", + "succeeded", + "failed", +]).annotate({ identifier: "ServerNotification__GatewayOAuthStatus" }); + +export type ServerNotification__CreditsSnapshot = { + readonly balance?: string | null; + readonly hasCredits: boolean; + readonly unlimited: boolean; +}; +export const ServerNotification__CreditsSnapshot = Schema.Struct({ + balance: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + hasCredits: Schema.Boolean, + unlimited: Schema.Boolean, +}).annotate({ identifier: "ServerNotification__CreditsSnapshot" }); + export type ServerNotification__SpendControlLimitSnapshot = { readonly limit: string; readonly remainingPercent: number; @@ -2621,62 +3256,284 @@ export type ServerNotification__SpendControlLimitSnapshot = { }; export const ServerNotification__SpendControlLimitSnapshot = Schema.Struct({ limit: Schema.String, - remainingPercent: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - resetsAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + remainingPercent: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + resetsAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), used: Schema.String, +}).annotate({ identifier: "ServerNotification__SpendControlLimitSnapshot" }); + +export type ServerNotification__RateLimitWindow = { + readonly resetsAt?: number | null; + readonly usedPercent: number; + readonly windowDurationMins?: number | null; +}; +export const ServerNotification__RateLimitWindow = Schema.Struct({ + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + usedPercent: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + windowDurationMins: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ServerNotification__RateLimitWindow" }); + +export type ServerNotification__RateLimitReachedType = + | "rate_limit_reached" + | "workspace_owner_credits_depleted" + | "workspace_member_credits_depleted" + | "workspace_owner_usage_limit_reached" + | "workspace_member_usage_limit_reached"; +export const ServerNotification__RateLimitReachedType = Schema.Literals([ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached", +]).annotate({ identifier: "ServerNotification__RateLimitReachedType" }); + +export type ServerNotification__AppReview = { readonly status: string }; +export const ServerNotification__AppReview = Schema.Struct({ status: Schema.String }).annotate({ + identifier: "ServerNotification__AppReview", }); -export type ServerNotification__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const ServerNotification__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", - "completed", -]); +export type ServerNotification__AppScreenshot = { + readonly fileId?: string | null; + readonly url?: string | null; + readonly userPrompt: string; +}; +export const ServerNotification__AppScreenshot = Schema.Struct({ + fileId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + userPrompt: Schema.String, +}).annotate({ identifier: "ServerNotification__AppScreenshot" }); -export type ServerNotification__TerminalInteractionNotification = { +export type ServerNotification__AppBranding = { + readonly category?: string | null; + readonly developer?: string | null; + readonly isDiscoverableApp: boolean; + readonly privacyPolicy?: string | null; + readonly termsOfService?: string | null; + readonly website?: string | null; +}; +export const ServerNotification__AppBranding = Schema.Struct({ + category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + developer: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + isDiscoverableApp: Schema.Boolean, + privacyPolicy: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + termsOfService: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + website: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "EXPERIMENTAL - app metadata returned by app-list APIs.", + identifier: "ServerNotification__AppBranding", +}); + +export type ServerNotification__RemoteControlConnectionStatus = + | "disabled" + | "connecting" + | "connected" + | "errored"; +export const ServerNotification__RemoteControlConnectionStatus = Schema.Literals([ + "disabled", + "connecting", + "connected", + "errored", +]).annotate({ identifier: "ServerNotification__RemoteControlConnectionStatus" }); + +export type ServerNotification__ExternalAgentConfigMigrationItemType = + | "AGENTS_MD" + | "CONFIG" + | "SKILLS" + | "PLUGINS" + | "MCP_SERVER_CONFIG" + | "SUBAGENTS" + | "HOOKS" + | "COMMANDS" + | "MEMORY" + | "SESSIONS"; +export const ServerNotification__ExternalAgentConfigMigrationItemType = Schema.Literals([ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "MEMORY", + "SESSIONS", +]).annotate({ identifier: "ServerNotification__ExternalAgentConfigMigrationItemType" }); + +export type ServerNotification__ReasoningSummaryTextDeltaNotification = { + readonly delta: string; readonly itemId: string; - readonly processId: string; - readonly stdin: string; + readonly summaryIndex: number; readonly threadId: string; readonly turnId: string; }; -export const ServerNotification__TerminalInteractionNotification = Schema.Struct({ +export const ServerNotification__ReasoningSummaryTextDeltaNotification = Schema.Struct({ + delta: Schema.String, + itemId: Schema.String, + summaryIndex: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__ReasoningSummaryTextDeltaNotification" }); + +export type ServerNotification__ReasoningSummaryPartAddedNotification = { + readonly itemId: string; + readonly summaryIndex: number; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__ReasoningSummaryPartAddedNotification = Schema.Struct({ + itemId: Schema.String, + summaryIndex: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__ReasoningSummaryPartAddedNotification" }); + +export type ServerNotification__ReasoningTextDeltaNotification = { + readonly contentIndex: number; + readonly delta: string; + readonly itemId: string; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__ReasoningTextDeltaNotification = Schema.Struct({ + contentIndex: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + delta: Schema.String, itemId: Schema.String, - processId: Schema.String, - stdin: Schema.String, threadId: Schema.String, turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__ReasoningTextDeltaNotification" }); + +export type ServerNotification__ContextCompactedNotification = { + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__ContextCompactedNotification = Schema.Struct({ + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ + description: "Deprecated: Use `ContextCompaction` item type instead.", + identifier: "ServerNotification__ContextCompactedNotification", }); -export type ServerNotification__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type ServerNotification__ModelRerouteReason = "highRiskCyberActivity"; +export const ServerNotification__ModelRerouteReason = Schema.Literal( + "highRiskCyberActivity", +).annotate({ identifier: "ServerNotification__ModelRerouteReason" }); + +export type ServerNotification__ModelVerification = "trustedAccessForCyber"; +export const ServerNotification__ModelVerification = Schema.Literal( + "trustedAccessForCyber", +).annotate({ identifier: "ServerNotification__ModelVerification" }); + +export type ServerNotification__AuthRecoveryNotification = { + readonly message: string; + readonly provider: string; + readonly threadId: string; + readonly turnId: string; }; -export const ServerNotification__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", +export const ServerNotification__AuthRecoveryNotification = Schema.Struct({ + message: Schema.String, + provider: Schema.String, + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__AuthRecoveryNotification" }); + +export type ServerNotification__TurnModerationMetadataNotification = { + readonly metadata: Schema.Json; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__TurnModerationMetadataNotification = Schema.Struct({ + metadata: Schema.Json.annotate({ expected: "JSON value" }), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__TurnModerationMetadataNotification" }); + +export type ServerNotification__ModelSafetyBufferingUpdatedNotification = { + readonly fasterModel?: string | null; + readonly model: string; + readonly reasons: ReadonlyArray; + readonly showBufferingUi: boolean; + readonly threadId: string; + readonly turnId: string; + readonly useCases: ReadonlyArray; +}; +export const ServerNotification__ModelSafetyBufferingUpdatedNotification = Schema.Struct({ + fasterModel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + model: Schema.String, + reasons: Schema.Array(Schema.String), + showBufferingUi: Schema.Boolean, + threadId: Schema.String, + turnId: Schema.String, + useCases: Schema.Array(Schema.String), +}).annotate({ identifier: "ServerNotification__ModelSafetyBufferingUpdatedNotification" }); + +export type ServerNotification__WarningNotification = { + readonly message: string; + readonly threadId?: string | null; +}; +export const ServerNotification__WarningNotification = Schema.Struct({ + message: Schema.String.annotate({ description: "Concise warning message for the user." }), + threadId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional thread target when the warning applies to a specific thread.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ServerNotification__WarningNotification" }); + +export type ServerNotification__GuardianWarningNotification = { + readonly message: string; + readonly threadId: string; +}; +export const ServerNotification__GuardianWarningNotification = Schema.Struct({ + message: Schema.String.annotate({ + description: "Concise guardian warning message for the user.", }), - placeholder: Schema.optionalKey( + threadId: Schema.String.annotate({ description: "Thread target for the guardian warning." }), +}).annotate({ identifier: "ServerNotification__GuardianWarningNotification" }); + +export type ServerNotification__DeprecationNoticeNotification = { + readonly details?: string | null; + readonly summary: string; +}; +export const ServerNotification__DeprecationNoticeNotification = Schema.Struct({ + details: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", + description: "Optional extra guidance, such as migration steps or rationale.", }), Schema.Null, ]), ), -}); + summary: Schema.String.annotate({ description: "Concise summary of what is deprecated." }), +}).annotate({ identifier: "ServerNotification__DeprecationNoticeNotification" }); export type ServerNotification__TextPosition = { readonly column: number; readonly line: number }; export const ServerNotification__TextPosition = Schema.Struct({ @@ -2684,65 +3541,138 @@ export const ServerNotification__TextPosition = Schema.Struct({ description: "1-based column number (in Unicode scalar values).", format: "uint", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), line: Schema.Number.annotate({ description: "1-based line number.", format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "ServerNotification__TextPosition" }); -export type ServerNotification__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; -export const ServerNotification__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); +export type ServerNotification__FuzzyFileSearchMatchType = "file" | "directory"; +export const ServerNotification__FuzzyFileSearchMatchType = Schema.Literals([ + "file", + "directory", +]).annotate({ identifier: "ServerNotification__FuzzyFileSearchMatchType" }); -export type ServerNotification__ThreadArchivedNotification = { readonly threadId: string }; -export const ServerNotification__ThreadArchivedNotification = Schema.Struct({ +export type ServerNotification__FuzzyFileSearchSessionCompletedNotification = { + readonly sessionId: string; +}; +export const ServerNotification__FuzzyFileSearchSessionCompletedNotification = Schema.Struct({ + sessionId: Schema.String, +}).annotate({ identifier: "ServerNotification__FuzzyFileSearchSessionCompletedNotification" }); + +export type ServerNotification__RealtimeConversationVersion = "v1" | "v2" | "v3"; +export const ServerNotification__RealtimeConversationVersion = Schema.Literals([ + "v1", + "v2", + "v3", +]).annotate({ identifier: "ServerNotification__RealtimeConversationVersion" }); + +export type ServerNotification__ThreadRealtimeItemAddedNotification = { + readonly item: Schema.Json; + readonly threadId: string; +}; +export const ServerNotification__ThreadRealtimeItemAddedNotification = Schema.Struct({ + item: Schema.Json.annotate({ expected: "JSON value" }), threadId: Schema.String, +}).annotate({ + description: "EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.", + identifier: "ServerNotification__ThreadRealtimeItemAddedNotification", }); -export type ServerNotification__ThreadClosedNotification = { readonly threadId: string }; -export const ServerNotification__ThreadClosedNotification = Schema.Struct({ - threadId: Schema.String, +export type ServerNotification__ThreadRealtimeTranscriptRole = "user" | "assistant"; +export const ServerNotification__ThreadRealtimeTranscriptRole = Schema.Literals([ + "user", + "assistant", +]).annotate({ identifier: "ServerNotification__ThreadRealtimeTranscriptRole" }); + +export type ServerNotification__ThreadRealtimeBemItemPresentation = + | { readonly type: "wholeItem" } + | { readonly type: "inlineMarkdown" } + | { readonly index: number; readonly type: "inlineVisualization" }; +export const ServerNotification__ThreadRealtimeBemItemPresentation = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("wholeItem").annotate({ + title: "WholeItemThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "WholeItemThreadRealtimeBemItemPresentation" }), + Schema.Struct({ + type: Schema.Literal("inlineMarkdown").annotate({ + title: "InlineMarkdownThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "InlineMarkdownThreadRealtimeBemItemPresentation" }), + Schema.Struct({ + index: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + type: Schema.Literal("inlineVisualization").annotate({ + title: "InlineVisualizationThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "InlineVisualizationThreadRealtimeBemItemPresentation" }), + ], + { mode: "oneOf" }, +).annotate({ + description: "EXPERIMENTAL - how an existing agent item appears in a realtime conversation.", + identifier: "ServerNotification__ThreadRealtimeBemItemPresentation", }); -export type ServerNotification__ThreadDeletedNotification = { readonly threadId: string }; -export const ServerNotification__ThreadDeletedNotification = Schema.Struct({ +export type ServerNotification__ThreadRealtimeSessionOutcome = "ended" | "failed"; +export const ServerNotification__ThreadRealtimeSessionOutcome = Schema.Literals([ + "ended", + "failed", +]).annotate({ identifier: "ServerNotification__ThreadRealtimeSessionOutcome" }); + +export type ServerNotification__ThreadRealtimeItemTranscriptDeltaNotification = { + readonly delta: string; + readonly itemId: string; + readonly threadId: string; +}; +export const ServerNotification__ThreadRealtimeItemTranscriptDeltaNotification = Schema.Struct({ + delta: Schema.String, + itemId: Schema.String, threadId: Schema.String, +}).annotate({ + description: "EXPERIMENTAL - text appended to an active realtime transcript item.", + identifier: "ServerNotification__ThreadRealtimeItemTranscriptDeltaNotification", }); -export type ServerNotification__ThreadGoalClearedNotification = { readonly threadId: string }; -export const ServerNotification__ThreadGoalClearedNotification = Schema.Struct({ +export type ServerNotification__ThreadRealtimeTranscriptDeltaNotification = { + readonly delta: string; + readonly role: string; + readonly threadId: string; +}; +export const ServerNotification__ThreadRealtimeTranscriptDeltaNotification = Schema.Struct({ + delta: Schema.String.annotate({ description: "Live transcript delta from the realtime event." }), + role: Schema.String, threadId: Schema.String, +}).annotate({ + description: + "EXPERIMENTAL - flat transcript delta emitted whenever realtime transcript text changes.", + identifier: "ServerNotification__ThreadRealtimeTranscriptDeltaNotification", }); -export type ServerNotification__ThreadGoalStatus = - | "active" - | "paused" - | "blocked" - | "usageLimited" - | "budgetLimited" - | "complete"; -export const ServerNotification__ThreadGoalStatus = Schema.Literals([ - "active", - "paused", - "blocked", - "usageLimited", - "budgetLimited", - "complete", -]); - -export type ServerNotification__ThreadId = string; -export const ServerNotification__ThreadId = Schema.String; - -export type ServerNotification__ThreadNameUpdatedNotification = { +export type ServerNotification__ThreadRealtimeTranscriptDoneNotification = { + readonly role: string; + readonly text: string; readonly threadId: string; - readonly threadName?: string | null; }; -export const ServerNotification__ThreadNameUpdatedNotification = Schema.Struct({ +export const ServerNotification__ThreadRealtimeTranscriptDoneNotification = Schema.Struct({ + role: Schema.String, + text: Schema.String.annotate({ description: "Final complete text for the transcript part." }), threadId: Schema.String, - threadName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: + "EXPERIMENTAL - final transcript text emitted when realtime completes a transcript part.", + identifier: "ServerNotification__ThreadRealtimeTranscriptDoneNotification", }); export type ServerNotification__ThreadRealtimeAudioChunk = { @@ -2756,29 +3686,43 @@ export const ServerNotification__ThreadRealtimeAudioChunk = Schema.Struct({ data: Schema.String, itemId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), numChannels: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), sampleRate: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), samplesPerChannel: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), -}).annotate({ description: "EXPERIMENTAL - thread realtime audio chunk." }); +}).annotate({ + description: "EXPERIMENTAL - thread realtime audio chunk.", + identifier: "ServerNotification__ThreadRealtimeAudioChunk", +}); -export type ServerNotification__ThreadRealtimeClosedNotification = { - readonly reason?: string | null; +export type ServerNotification__ThreadRealtimeSdpNotification = { + readonly sdp: string; readonly threadId: string; }; -export const ServerNotification__ThreadRealtimeClosedNotification = Schema.Struct({ - reason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export const ServerNotification__ThreadRealtimeSdpNotification = Schema.Struct({ + sdp: Schema.String, threadId: Schema.String, -}).annotate({ description: "EXPERIMENTAL - emitted when thread realtime transport closes." }); +}).annotate({ + description: "EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.", + identifier: "ServerNotification__ThreadRealtimeSdpNotification", +}); export type ServerNotification__ThreadRealtimeErrorNotification = { readonly message: string; @@ -2787,179 +3731,23 @@ export type ServerNotification__ThreadRealtimeErrorNotification = { export const ServerNotification__ThreadRealtimeErrorNotification = Schema.Struct({ message: Schema.String, threadId: Schema.String, -}).annotate({ description: "EXPERIMENTAL - emitted when thread realtime encounters an error." }); - -export type ServerNotification__ThreadRealtimeItemAddedNotification = { - readonly item: unknown; - readonly threadId: string; -}; -export const ServerNotification__ThreadRealtimeItemAddedNotification = Schema.Struct({ - item: Schema.Unknown, - threadId: Schema.String, }).annotate({ - description: "EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.", + description: "EXPERIMENTAL - emitted when thread realtime encounters an error.", + identifier: "ServerNotification__ThreadRealtimeErrorNotification", }); -export type ServerNotification__ThreadRealtimeSdpNotification = { - readonly sdp: string; +export type ServerNotification__ThreadRealtimeClosedNotification = { + readonly reason?: string | null; readonly threadId: string; }; -export const ServerNotification__ThreadRealtimeSdpNotification = Schema.Struct({ - sdp: Schema.String, +export const ServerNotification__ThreadRealtimeClosedNotification = Schema.Struct({ + reason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), threadId: Schema.String, }).annotate({ - description: "EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.", -}); - -export type ServerNotification__ThreadRealtimeTranscriptDeltaNotification = { - readonly delta: string; - readonly role: string; - readonly threadId: string; -}; -export const ServerNotification__ThreadRealtimeTranscriptDeltaNotification = Schema.Struct({ - delta: Schema.String.annotate({ description: "Live transcript delta from the realtime event." }), - role: Schema.String, - threadId: Schema.String, -}).annotate({ - description: - "EXPERIMENTAL - flat transcript delta emitted whenever realtime transcript text changes.", -}); - -export type ServerNotification__ThreadRealtimeTranscriptDoneNotification = { - readonly role: string; - readonly text: string; - readonly threadId: string; -}; -export const ServerNotification__ThreadRealtimeTranscriptDoneNotification = Schema.Struct({ - role: Schema.String, - text: Schema.String.annotate({ description: "Final complete text for the transcript part." }), - threadId: Schema.String, -}).annotate({ - description: - "EXPERIMENTAL - final transcript text emitted when realtime completes a transcript part.", -}); - -export type ServerNotification__ThreadSource = string; -export const ServerNotification__ThreadSource = Schema.String; - -export type ServerNotification__ThreadUnarchivedNotification = { readonly threadId: string }; -export const ServerNotification__ThreadUnarchivedNotification = Schema.Struct({ - threadId: Schema.String, -}); - -export type ServerNotification__TokenUsageBreakdown = { - readonly cacheWriteInputTokens?: number; - readonly cachedInputTokens: number; - readonly inputTokens: number; - readonly outputTokens: number; - readonly reasoningOutputTokens: number; - readonly totalTokens: number; -}; -export const ServerNotification__TokenUsageBreakdown = Schema.Struct({ - cacheWriteInputTokens: Schema.optionalKey( - Schema.Number.annotate({ default: 0, format: "int64" }).check(Schema.isInt()), - ), - cachedInputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - inputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - outputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - reasoningOutputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - totalTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -}); - -export type ServerNotification__TurnDiffUpdatedNotification = { - readonly diff: string; - readonly threadId: string; - readonly turnId: string; -}; -export const ServerNotification__TurnDiffUpdatedNotification = Schema.Struct({ - diff: Schema.String, - threadId: Schema.String, - turnId: Schema.String, -}).annotate({ - description: - "Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn.", -}); - -export type ServerNotification__TurnModerationMetadataNotification = { - readonly metadata: unknown; - readonly threadId: string; - readonly turnId: string; -}; -export const ServerNotification__TurnModerationMetadataNotification = Schema.Struct({ - metadata: Schema.Unknown, - threadId: Schema.String, - turnId: Schema.String, -}); - -export type ServerNotification__TurnPlanStepStatus = "pending" | "inProgress" | "completed"; -export const ServerNotification__TurnPlanStepStatus = Schema.Literals([ - "pending", - "inProgress", - "completed", -]); - -export type ServerNotification__TurnStatus = "completed" | "interrupted" | "failed" | "inProgress"; -export const ServerNotification__TurnStatus = Schema.Literals([ - "completed", - "interrupted", - "failed", - "inProgress", -]); - -export type ServerNotification__WarningNotification = { - readonly message: string; - readonly threadId?: string | null; -}; -export const ServerNotification__WarningNotification = Schema.Struct({ - message: Schema.String.annotate({ description: "Concise warning message for the user." }), - threadId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional thread target when the warning applies to a specific thread.", - }), - Schema.Null, - ]), - ), + description: "EXPERIMENTAL - emitted when thread realtime transport closes.", + identifier: "ServerNotification__ThreadRealtimeClosedNotification", }); -export type ServerNotification__WebSearchAction = - | { - readonly queries?: ReadonlyArray | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly type: "openPage"; readonly url?: string | null } - | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } - | { readonly type: "other" }; -export const ServerNotification__WebSearchAction = Schema.Union( - [ - Schema.Struct({ - queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), - }).annotate({ title: "SearchWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageWebSearchAction" }), - Schema.Struct({ - pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), - }).annotate({ title: "OtherWebSearchAction" }), - ], - { mode: "oneOf" }, -); - -export type ServerNotification__WindowsSandboxSetupMode = "elevated" | "unelevated"; -export const ServerNotification__WindowsSandboxSetupMode = Schema.Literals([ - "elevated", - "unelevated", -]); - export type ServerNotification__WindowsWorldWritableWarningNotification = { readonly extraCount: number; readonly failedScan: boolean; @@ -2967,68 +3755,59 @@ export type ServerNotification__WindowsWorldWritableWarningNotification = { }; export const ServerNotification__WindowsWorldWritableWarningNotification = Schema.Struct({ extraCount: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), failedScan: Schema.Boolean, samplePaths: Schema.Array(Schema.String), -}); +}).annotate({ identifier: "ServerNotification__WindowsWorldWritableWarningNotification" }); -export type ServerRequest__AbsolutePathBuf = string; -export const ServerRequest__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +export type ServerNotification__WindowsSandboxSetupMode = "elevated" | "unelevated"; +export const ServerNotification__WindowsSandboxSetupMode = Schema.Literals([ + "elevated", + "unelevated", +]).annotate({ identifier: "ServerNotification__WindowsSandboxSetupMode" }); -export type ServerRequest__AdditionalNetworkPermissions = { readonly enabled?: boolean | null }; -export const ServerRequest__AdditionalNetworkPermissions = Schema.Struct({ - enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), -}); +export type ServerNotification__DesktopOnboardingEntrypoint = "life_sciences"; +export const ServerNotification__DesktopOnboardingEntrypoint = Schema.Literal( + "life_sciences", +).annotate({ identifier: "ServerNotification__DesktopOnboardingEntrypoint" }); -export type ServerRequest__AttestationGenerateParams = {}; -export const ServerRequest__AttestationGenerateParams = Schema.Struct({}); +export type ServerRequest__RequestId = string | number; +export const ServerRequest__RequestId = Schema.Union([ + Schema.String, + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +]).annotate({ identifier: "ServerRequest__RequestId" }); -export type ServerRequest__ChatgptAuthTokensRefreshReason = "unauthorized"; -export const ServerRequest__ChatgptAuthTokensRefreshReason = Schema.Literal("unauthorized"); +export type ServerRequest__LegacyAppPathString = string; +export const ServerRequest__LegacyAppPathString = Schema.String.annotate({ + identifier: "ServerRequest__LegacyAppPathString", +}); -export type ServerRequest__DynamicToolCallParams = { - readonly arguments: unknown; - readonly callId: string; - readonly namespace?: string | null; - readonly threadId: string; - readonly tool: string; - readonly turnId: string; -}; -export const ServerRequest__DynamicToolCallParams = Schema.Struct({ - arguments: Schema.Unknown, - callId: Schema.String, - namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - threadId: Schema.String, - tool: Schema.String, - turnId: Schema.String, +export type ServerRequest__CommandExecutionApprovalKind = "command" | "writeStdin"; +export const ServerRequest__CommandExecutionApprovalKind = Schema.Literals([ + "command", + "writeStdin", +]).annotate({ + description: "Distinguishes a command approval from input sent to an existing terminal.", + identifier: "ServerRequest__CommandExecutionApprovalKind", }); -export type ServerRequest__FileChange = - | { readonly content: string; readonly type: "add" } - | { readonly content: string; readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update"; readonly unified_diff: string }; -export const ServerRequest__FileChange = Schema.Union( - [ - Schema.Struct({ - content: Schema.String, - type: Schema.Literal("add").annotate({ title: "AddFileChangeType" }), - }).annotate({ title: "AddFileChange" }), - Schema.Struct({ - content: Schema.String, - type: Schema.Literal("delete").annotate({ title: "DeleteFileChangeType" }), - }).annotate({ title: "DeleteFileChange" }), - Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdateFileChangeType" }), - unified_diff: Schema.String, - }).annotate({ title: "UpdateFileChange" }), - ], - { mode: "oneOf" }, -); +export type ServerRequest__NetworkApprovalProtocol = "http" | "https" | "socks5Tcp" | "socks5Udp"; +export const ServerRequest__NetworkApprovalProtocol = Schema.Literals([ + "http", + "https", + "socks5Tcp", + "socks5Udp", +]).annotate({ identifier: "ServerRequest__NetworkApprovalProtocol" }); + +export type ServerRequest__NetworkPolicyRuleAction = "allow" | "deny"; +export const ServerRequest__NetworkPolicyRuleAction = Schema.Literals(["allow", "deny"]).annotate({ + identifier: "ServerRequest__NetworkPolicyRuleAction", +}); export type ServerRequest__FileChangeRequestApprovalParams = { readonly grantRoot?: string | null; @@ -3060,22 +3839,27 @@ export const ServerRequest__FileChangeRequestApprovalParams = Schema.Struct({ startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this approval request started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), threadId: Schema.String, turnId: Schema.String, -}); +}).annotate({ identifier: "ServerRequest__FileChangeRequestApprovalParams" }); -export type ServerRequest__FileSystemAccessMode = "read" | "write" | "deny"; -export const ServerRequest__FileSystemAccessMode = Schema.Literals(["read", "write", "deny"]); - -export type ServerRequest__LegacyAppPathString = string; -export const ServerRequest__LegacyAppPathString = Schema.String; - -export type ServerRequest__McpElicitationArrayType = "array"; -export const ServerRequest__McpElicitationArrayType = Schema.Literal("array"); +export type ServerRequest__ToolRequestUserInputOption = { + readonly description: string; + readonly label: string; +}; +export const ServerRequest__ToolRequestUserInputOption = Schema.Struct({ + description: Schema.String, + label: Schema.String, +}).annotate({ + description: "EXPERIMENTAL. Defines a single selectable option for request_user_input.", + identifier: "ServerRequest__ToolRequestUserInputOption", +}); -export type ServerRequest__McpElicitationBooleanType = "boolean"; -export const ServerRequest__McpElicitationBooleanType = Schema.Literal("boolean"); +export type ServerRequest__McpElicitationStringType = "string"; +export const ServerRequest__McpElicitationStringType = Schema.Literal("string").annotate({ + identifier: "ServerRequest__McpElicitationStringType", +}); export type ServerRequest__McpElicitationConstOption = { readonly const: string; @@ -3084,13 +3868,12 @@ export type ServerRequest__McpElicitationConstOption = { export const ServerRequest__McpElicitationConstOption = Schema.Struct({ const: Schema.String, title: Schema.String, -}); - -export type ServerRequest__McpElicitationNumberType = "number" | "integer"; -export const ServerRequest__McpElicitationNumberType = Schema.Literals(["number", "integer"]); +}).annotate({ identifier: "ServerRequest__McpElicitationConstOption" }); -export type ServerRequest__McpElicitationObjectType = "object"; -export const ServerRequest__McpElicitationObjectType = Schema.Literal("object"); +export type ServerRequest__McpElicitationArrayType = "array"; +export const ServerRequest__McpElicitationArrayType = Schema.Literal("array").annotate({ + identifier: "ServerRequest__McpElicitationArrayType", +}); export type ServerRequest__McpElicitationStringFormat = "email" | "uri" | "date" | "date-time"; export const ServerRequest__McpElicitationStringFormat = Schema.Literals([ @@ -3098,21 +3881,96 @@ export const ServerRequest__McpElicitationStringFormat = Schema.Literals([ "uri", "date", "date-time", -]); +]).annotate({ identifier: "ServerRequest__McpElicitationStringFormat" }); -export type ServerRequest__McpElicitationStringType = "string"; -export const ServerRequest__McpElicitationStringType = Schema.Literal("string"); +export type ServerRequest__McpElicitationNumberType = "number" | "integer"; +export const ServerRequest__McpElicitationNumberType = Schema.Literals([ + "number", + "integer", +]).annotate({ identifier: "ServerRequest__McpElicitationNumberType" }); -export type ServerRequest__NetworkApprovalProtocol = "http" | "https" | "socks5Tcp" | "socks5Udp"; -export const ServerRequest__NetworkApprovalProtocol = Schema.Literals([ - "http", - "https", - "socks5Tcp", - "socks5Udp", -]); +export type ServerRequest__McpElicitationBooleanType = "boolean"; +export const ServerRequest__McpElicitationBooleanType = Schema.Literal("boolean").annotate({ + identifier: "ServerRequest__McpElicitationBooleanType", +}); -export type ServerRequest__NetworkPolicyRuleAction = "allow" | "deny"; -export const ServerRequest__NetworkPolicyRuleAction = Schema.Literals(["allow", "deny"]); +export type ServerRequest__McpElicitationObjectType = "object"; +export const ServerRequest__McpElicitationObjectType = Schema.Literal("object").annotate({ + identifier: "ServerRequest__McpElicitationObjectType", +}); + +export type ServerRequest__FileSystemAccessMode = "read" | "write" | "deny"; +export const ServerRequest__FileSystemAccessMode = Schema.Literals([ + "read", + "write", + "deny", +]).annotate({ identifier: "ServerRequest__FileSystemAccessMode" }); + +export type ServerRequest__AdditionalNetworkPermissions = { readonly enabled?: boolean | null }; +export const ServerRequest__AdditionalNetworkPermissions = Schema.Struct({ + enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), +}).annotate({ identifier: "ServerRequest__AdditionalNetworkPermissions" }); + +export type ServerRequest__DynamicToolCallParams = { + readonly arguments: Schema.Json; + readonly callId: string; + readonly namespace?: string | null; + readonly threadId: string; + readonly tool: string; + readonly turnId: string; +}; +export const ServerRequest__DynamicToolCallParams = Schema.Struct({ + arguments: Schema.Json.annotate({ expected: "JSON value" }), + callId: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + threadId: Schema.String, + tool: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerRequest__DynamicToolCallParams" }); + +export type ServerRequest__ChatgptAuthTokensRefreshReason = "unauthorized"; +export const ServerRequest__ChatgptAuthTokensRefreshReason = Schema.Union( + [ + Schema.Literal("unauthorized").annotate({ + description: "Codex attempted a backend request and received `401 Unauthorized`.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerRequest__ChatgptAuthTokensRefreshReason" }); + +export type ServerRequest__AttestationGenerateParams = { readonly [x: string]: Schema.Json }; +export const ServerRequest__AttestationGenerateParams = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ identifier: "ServerRequest__AttestationGenerateParams" }); + +export type ServerRequest__ThreadId = string; +export const ServerRequest__ThreadId = Schema.String.annotate({ + identifier: "ServerRequest__ThreadId", +}); + +export type ServerRequest__FileChange = + | { readonly content: string; readonly type: "add" } + | { readonly content: string; readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update"; readonly unified_diff: string }; +export const ServerRequest__FileChange = Schema.Union( + [ + Schema.Struct({ + content: Schema.String, + type: Schema.Literal("add").annotate({ title: "AddFileChangeType" }), + }).annotate({ title: "AddFileChange" }), + Schema.Struct({ + content: Schema.String, + type: Schema.Literal("delete").annotate({ title: "DeleteFileChangeType" }), + }).annotate({ title: "DeleteFileChange" }), + Schema.Struct({ + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdateFileChangeType" }), + unified_diff: Schema.String, + }).annotate({ title: "UpdateFileChange" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerRequest__FileChange" }); export type ServerRequest__ParsedCommand = | { readonly cmd: string; readonly name: string; readonly path: string; readonly type: "read" } @@ -3152,27 +4010,7 @@ export const ServerRequest__ParsedCommand = Schema.Union( }).annotate({ title: "UnknownParsedCommand" }), ], { mode: "oneOf" }, -); - -export type ServerRequest__RequestId = string | number; -export const ServerRequest__RequestId = Schema.Union([ - Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -]); - -export type ServerRequest__ThreadId = string; -export const ServerRequest__ThreadId = Schema.String; - -export type ServerRequest__ToolRequestUserInputOption = { - readonly description: string; - readonly label: string; -}; -export const ServerRequest__ToolRequestUserInputOption = Schema.Struct({ - description: Schema.String, - label: Schema.String, -}).annotate({ - description: "EXPERIMENTAL. Defines a single selectable option for request_user_input.", -}); +).annotate({ identifier: "ServerRequest__ParsedCommand" }); export type ToolRequestUserInputParams__ToolRequestUserInputOption = { readonly description: string; @@ -3183,6 +4021,7 @@ export const ToolRequestUserInputParams__ToolRequestUserInputOption = Schema.Str label: Schema.String, }).annotate({ description: "EXPERIMENTAL. Defines a single selectable option for request_user_input.", + identifier: "ToolRequestUserInputParams__ToolRequestUserInputOption", }); export type ToolRequestUserInputResponse__ToolRequestUserInputAnswer = { @@ -3192,21 +4031,13 @@ export const ToolRequestUserInputResponse__ToolRequestUserInputAnswer = Schema.S answers: Schema.Array(Schema.String), }).annotate({ description: "EXPERIMENTAL. Captures a user's answer to a request_user_input question.", -}); - -export type V1InitializeParams__ClientInfo = { - readonly name: string; - readonly title?: string | null; - readonly version: string; -}; -export const V1InitializeParams__ClientInfo = Schema.Struct({ - name: Schema.String, - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - version: Schema.String, + identifier: "ToolRequestUserInputResponse__ToolRequestUserInputAnswer", }); export type V1InitializeParams__InitializeCapabilities = { readonly experimentalApi?: boolean; + readonly explicitGatewayOauth?: boolean; + readonly extensions?: { readonly [x: string]: Schema.Json } | null; readonly mcpServerOpenaiFormElicitation?: boolean; readonly optOutNotificationMethods?: ReadonlyArray | null; readonly requestAttestation?: boolean; @@ -3218,9 +4049,24 @@ export const V1InitializeParams__InitializeCapabilities = Schema.Struct({ default: false, }), ), + explicitGatewayOauth: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Use explicit gateway OAuth login instead of automatic browser authorization. Applies to this app-server's gateway runtime; later connections cannot undo it.", + }), + ), + extensions: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({ + description: "MCP extension settings declared by the app-server client.", + }), + Schema.Null, + ]), + ), mcpServerOpenaiFormElicitation: Schema.optionalKey( Schema.Boolean.annotate({ - description: "Allow downstream MCP servers to request OpenAI extended form elicitations.", + description: + "Legacy opt-in for the `openai/form` MCP extension.\n\nNew clients should declare `openai/form` in [`Self::extensions`].", }), ), optOutNotificationMethods: Schema.optionalKey( @@ -3238,7 +4084,33 @@ export const V1InitializeParams__InitializeCapabilities = Schema.Struct({ default: false, }), ), -}).annotate({ description: "Client-declared capabilities negotiated during initialize." }); +}).annotate({ + description: "Client-declared capabilities negotiated during initialize.", + identifier: "V1InitializeParams__InitializeCapabilities", +}); + +export type V1InitializeParams__ClientInfo = { + readonly name: string; + readonly title?: string | null; + readonly version: string; +}; +export const V1InitializeParams__ClientInfo = Schema.Struct({ + name: Schema.String, + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + version: Schema.String, +}).annotate({ identifier: "V1InitializeParams__ClientInfo" }); + +export type V1InitializeResponse__AbsolutePathBuf = string; +export const V1InitializeResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V1InitializeResponse__AbsolutePathBuf", +}); + +export type V2AccountLoginCompletedNotification__DesktopOnboardingEntrypoint = "life_sciences"; +export const V2AccountLoginCompletedNotification__DesktopOnboardingEntrypoint = Schema.Literal( + "life_sciences", +).annotate({ identifier: "V2AccountLoginCompletedNotification__DesktopOnboardingEntrypoint" }); export type V2AccountRateLimitsUpdatedNotification__CreditsSnapshot = { readonly balance?: string | null; @@ -3249,45 +4121,56 @@ export const V2AccountRateLimitsUpdatedNotification__CreditsSnapshot = Schema.St balance: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), hasCredits: Schema.Boolean, unlimited: Schema.Boolean, +}).annotate({ identifier: "V2AccountRateLimitsUpdatedNotification__CreditsSnapshot" }); + +export type V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot = { + readonly limit: string; + readonly remainingPercent: number; + readonly resetsAt: number; + readonly used: string; +}; +export const V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot = Schema.Struct({ + limit: Schema.String, + remainingPercent: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + resetsAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + used: Schema.String, +}).annotate({ identifier: "V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot" }); + +export type V2AccountRateLimitsUpdatedNotification__PlanType = string; +export const V2AccountRateLimitsUpdatedNotification__PlanType = Schema.String.annotate({ + identifier: "V2AccountRateLimitsUpdatedNotification__PlanType", }); -export type V2AccountRateLimitsUpdatedNotification__PlanType = - | "free" - | "go" - | "plus" - | "pro" - | "prolite" - | "team" - | "self_serve_business_prolite" - | "self_serve_business_usage_based" - | "business" - | "ent26" - | "enterprise_cbp_automation" - | "enterprise_cbp_usage_based" - | "enterprise" - | "edu" - | "edu_plus" - | "edu_pro" - | "unknown"; -export const V2AccountRateLimitsUpdatedNotification__PlanType = Schema.Literals([ - "free", - "go", - "plus", - "pro", - "prolite", - "team", - "self_serve_business_prolite", - "self_serve_business_usage_based", - "business", - "ent26", - "enterprise_cbp_automation", - "enterprise_cbp_usage_based", - "enterprise", - "edu", - "edu_plus", - "edu_pro", - "unknown", -]); +export type V2AccountRateLimitsUpdatedNotification__RateLimitWindow = { + readonly resetsAt?: number | null; + readonly usedPercent: number; + readonly windowDurationMins?: number | null; +}; +export const V2AccountRateLimitsUpdatedNotification__RateLimitWindow = Schema.Struct({ + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + usedPercent: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + windowDurationMins: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2AccountRateLimitsUpdatedNotification__RateLimitWindow" }); export type V2AccountRateLimitsUpdatedNotification__RateLimitReachedType = | "rate_limit_reached" @@ -3301,35 +4184,7 @@ export const V2AccountRateLimitsUpdatedNotification__RateLimitReachedType = Sche "workspace_member_credits_depleted", "workspace_owner_usage_limit_reached", "workspace_member_usage_limit_reached", -]); - -export type V2AccountRateLimitsUpdatedNotification__RateLimitWindow = { - readonly resetsAt?: number | null; - readonly usedPercent: number; - readonly windowDurationMins?: number | null; -}; -export const V2AccountRateLimitsUpdatedNotification__RateLimitWindow = Schema.Struct({ - resetsAt: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - usedPercent: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - windowDurationMins: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), -}); - -export type V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot = { - readonly limit: string; - readonly remainingPercent: number; - readonly resetsAt: number; - readonly used: string; -}; -export const V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot = Schema.Struct({ - limit: Schema.String, - remainingPercent: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - resetsAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - used: Schema.String, -}); +]).annotate({ identifier: "V2AccountRateLimitsUpdatedNotification__RateLimitReachedType" }); export type V2AccountUpdatedNotification__AuthMode = | "apikey" @@ -3338,54 +4193,62 @@ export type V2AccountUpdatedNotification__AuthMode = | "headers" | "agentIdentity" | "personalAccessToken" - | "bedrockApiKey"; -export const V2AccountUpdatedNotification__AuthMode = Schema.Literals([ - "apikey", - "chatgpt", - "chatgptAuthTokens", - "headers", - "agentIdentity", - "personalAccessToken", - "bedrockApiKey", -]).annotate({ description: "Authentication mode for OpenAI-backed providers." }); - -export type V2AccountUpdatedNotification__PlanType = - | "free" - | "go" - | "plus" - | "pro" - | "prolite" - | "team" - | "self_serve_business_prolite" - | "self_serve_business_usage_based" - | "business" - | "ent26" - | "enterprise_cbp_automation" - | "enterprise_cbp_usage_based" - | "enterprise" - | "edu" - | "edu_plus" - | "edu_pro" - | "unknown"; -export const V2AccountUpdatedNotification__PlanType = Schema.Literals([ - "free", - "go", - "plus", - "pro", - "prolite", - "team", - "self_serve_business_prolite", - "self_serve_business_usage_based", - "business", - "ent26", - "enterprise_cbp_automation", - "enterprise_cbp_usage_based", - "enterprise", - "edu", - "edu_plus", - "edu_pro", - "unknown", -]); + | "bedrockApiKey" + | "bedrockAccessKeys"; +export const V2AccountUpdatedNotification__AuthMode = Schema.Union( + [ + Schema.Literal("apikey").annotate({ + description: "OpenAI API key provided by the caller and stored by Codex.", + }), + Schema.Literal("chatgpt").annotate({ + description: "ChatGPT OAuth managed by Codex (tokens persisted and refreshed by Codex).", + }), + Schema.Literal("chatgptAuthTokens").annotate({ + description: + "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.", + }), + Schema.Literal("headers").annotate({ + description: "Backend auth supplied as request headers.", + }), + Schema.Literal("agentIdentity").annotate({ + description: "Programmatic Codex auth backed by a registered Agent Identity.", + }), + Schema.Literal("personalAccessToken").annotate({ + description: "Programmatic Codex auth backed by a personal access token.", + }), + Schema.Literal("bedrockApiKey").annotate({ + description: "Amazon Bedrock bearer token managed by Codex.", + }), + Schema.Literal("bedrockAccessKeys").annotate({ + description: "Amazon Bedrock AWS access keys managed by Codex.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: "Authentication mode for OpenAI-backed providers.", + identifier: "V2AccountUpdatedNotification__AuthMode", +}); + +export type V2AccountUpdatedNotification__PlanType = string; +export const V2AccountUpdatedNotification__PlanType = Schema.String.annotate({ + identifier: "V2AccountUpdatedNotification__PlanType", +}); + +export type V2AppListUpdatedNotification__AppReview = { readonly status: string }; +export const V2AppListUpdatedNotification__AppReview = Schema.Struct({ + status: Schema.String, +}).annotate({ identifier: "V2AppListUpdatedNotification__AppReview" }); + +export type V2AppListUpdatedNotification__AppScreenshot = { + readonly fileId?: string | null; + readonly url?: string | null; + readonly userPrompt: string; +}; +export const V2AppListUpdatedNotification__AppScreenshot = Schema.Struct({ + fileId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + userPrompt: Schema.String, +}).annotate({ identifier: "V2AppListUpdatedNotification__AppScreenshot" }); export type V2AppListUpdatedNotification__AppBranding = { readonly category?: string | null; @@ -3402,20 +4265,9 @@ export const V2AppListUpdatedNotification__AppBranding = Schema.Struct({ privacyPolicy: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), termsOfService: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), website: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ description: "EXPERIMENTAL - app metadata returned by app-list APIs." }); - -export type V2AppListUpdatedNotification__AppReview = { readonly status: string }; -export const V2AppListUpdatedNotification__AppReview = Schema.Struct({ status: Schema.String }); - -export type V2AppListUpdatedNotification__AppScreenshot = { - readonly fileId?: string | null; - readonly url?: string | null; - readonly userPrompt: string; -}; -export const V2AppListUpdatedNotification__AppScreenshot = Schema.Struct({ - fileId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - userPrompt: Schema.String, +}).annotate({ + description: "EXPERIMENTAL - app metadata returned by app-list APIs.", + identifier: "V2AppListUpdatedNotification__AppBranding", }); export type V2AppsInstalledResponse__InstalledApp = { @@ -3443,7 +4295,26 @@ export const V2AppsInstalledResponse__InstalledApp = Schema.Struct({ Schema.Null, ]), ), -}).annotate({ description: "Installed connector runtime state." }); +}).annotate({ + description: "Installed connector runtime state.", + identifier: "V2AppsInstalledResponse__InstalledApp", +}); + +export type V2AppsListResponse__AppReview = { readonly status: string }; +export const V2AppsListResponse__AppReview = Schema.Struct({ status: Schema.String }).annotate({ + identifier: "V2AppsListResponse__AppReview", +}); + +export type V2AppsListResponse__AppScreenshot = { + readonly fileId?: string | null; + readonly url?: string | null; + readonly userPrompt: string; +}; +export const V2AppsListResponse__AppScreenshot = Schema.Struct({ + fileId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + userPrompt: Schema.String, +}).annotate({ identifier: "V2AppsListResponse__AppScreenshot" }); export type V2AppsListResponse__AppBranding = { readonly category?: string | null; @@ -3460,43 +4331,62 @@ export const V2AppsListResponse__AppBranding = Schema.Struct({ privacyPolicy: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), termsOfService: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), website: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ description: "EXPERIMENTAL - app metadata returned by app-list APIs." }); - -export type V2AppsListResponse__AppReview = { readonly status: string }; -export const V2AppsListResponse__AppReview = Schema.Struct({ status: Schema.String }); - -export type V2AppsListResponse__AppScreenshot = { - readonly fileId?: string | null; - readonly url?: string | null; - readonly userPrompt: string; -}; -export const V2AppsListResponse__AppScreenshot = Schema.Struct({ - fileId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - userPrompt: Schema.String, +}).annotate({ + description: "EXPERIMENTAL - app metadata returned by app-list APIs.", + identifier: "V2AppsListResponse__AppBranding", }); export type V2AppsReadResponse__AppToolSummary = { readonly description: string; + readonly disabledReason?: string | null; + readonly isEnabled?: boolean; + readonly isReadOnly?: boolean; readonly name: string; readonly title?: string | null; }; export const V2AppsReadResponse__AppToolSummary = Schema.Struct({ description: Schema.String, + disabledReason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + isEnabled: Schema.optionalKey(Schema.Boolean.annotate({ default: true })), + isReadOnly: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), name: Schema.String, title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ description: "EXPERIMENTAL - metadata returned by app/read." }); +}).annotate({ + description: "EXPERIMENTAL - metadata returned by app/read.", + identifier: "V2AppsReadResponse__AppToolSummary", +}); export type V2CancelLoginAccountResponse__CancelLoginAccountStatus = "canceled" | "notFound"; export const V2CancelLoginAccountResponse__CancelLoginAccountStatus = Schema.Literals([ "canceled", "notFound", -]); +]).annotate({ identifier: "V2CancelLoginAccountResponse__CancelLoginAccountStatus" }); -export type V2CommandExecParams__AbsolutePathBuf = string; -export const V2CommandExecParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +export type V2CommandExecOutputDeltaNotification__CommandExecOutputStream = "stdout" | "stderr"; +export const V2CommandExecOutputDeltaNotification__CommandExecOutputStream = Schema.Union( + [ + Schema.Literal("stdout").annotate({ + description: "stdout stream. PTY mode multiplexes terminal output here.", + }), + Schema.Literal("stderr").annotate({ description: "stderr stream." }), + ], + { mode: "oneOf" }, +).annotate({ + description: "Stream label for `command/exec/outputDelta` notifications.", + identifier: "V2CommandExecOutputDeltaNotification__CommandExecOutputStream", +}); + +export type V2CommandExecParams__NetworkAccess = "restricted" | "enabled"; +export const V2CommandExecParams__NetworkAccess = Schema.Literals([ + "restricted", + "enabled", +]).annotate({ identifier: "V2CommandExecParams__NetworkAccess" }); + +export type V2CommandExecParams__AbsolutePathBuf = string; +export const V2CommandExecParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2CommandExecParams__AbsolutePathBuf", }); export type V2CommandExecParams__CommandExecTerminalSize = { @@ -3508,54 +4398,62 @@ export const V2CommandExecParams__CommandExecTerminalSize = Schema.Struct({ description: "Terminal width in character cells.", format: "uint16", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), rows: Schema.Number.annotate({ description: "Terminal height in character cells.", format: "uint16", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}).annotate({ description: "PTY size in character cells for `command/exec` PTY sessions." }); - -export type V2ConfigBatchWriteParams__MergeStrategy = "replace" | "upsert"; -export const V2ConfigBatchWriteParams__MergeStrategy = Schema.Literals(["replace", "upsert"]); + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ + description: "PTY size in character cells for `command/exec` PTY sessions.", + identifier: "V2CommandExecParams__CommandExecTerminalSize", +}); -export type V2ConfigReadResponse__AbsolutePathBuf = string; -export const V2ConfigReadResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +export type V2CommandExecResizeParams__CommandExecTerminalSize = { + readonly cols: number; + readonly rows: number; +}; +export const V2CommandExecResizeParams__CommandExecTerminalSize = Schema.Struct({ + cols: Schema.Number.annotate({ + description: "Terminal width in character cells.", + format: "uint16", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + rows: Schema.Number.annotate({ + description: "Terminal height in character cells.", + format: "uint16", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ + description: "PTY size in character cells for `command/exec` PTY sessions.", + identifier: "V2CommandExecResizeParams__CommandExecTerminalSize", }); -export type V2ConfigReadResponse__AnalyticsConfig = { - readonly enabled?: boolean | null; - readonly [x: string]: unknown; +export type V2ConfigBatchWriteParams__MergeStrategy = "replace" | "upsert"; +export const V2ConfigBatchWriteParams__MergeStrategy = Schema.Literals([ + "replace", + "upsert", +]).annotate({ identifier: "V2ConfigBatchWriteParams__MergeStrategy" }); + +export type V2ConfigReadResponse__AnalyticsConfig = { readonly enabled?: boolean | null } & { + readonly [x: string]: Schema.Json; }; export const V2ConfigReadResponse__AnalyticsConfig = Schema.StructWithRest( Schema.Struct({ enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }), - [Schema.Record(Schema.String, Schema.Unknown)], -); - -export type V2ConfigReadResponse__AppToolApproval = "auto" | "prompt" | "writes" | "approve"; -export const V2ConfigReadResponse__AppToolApproval = Schema.Literals([ - "auto", - "prompt", - "writes", - "approve", -]); - -export type V2ConfigReadResponse__AppToolsConfig = {}; -export const V2ConfigReadResponse__AppToolsConfig = Schema.Struct({}); - -export type V2ConfigReadResponse__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const V2ConfigReadResponse__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); + [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))], +).annotate({ identifier: "V2ConfigReadResponse__AnalyticsConfig" }); export type V2ConfigReadResponse__AskForApproval = | "untrusted" @@ -3584,32 +4482,65 @@ export const V2ConfigReadResponse__AskForApproval = Schema.Union( }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ConfigReadResponse__AskForApproval" }); -export type V2ConfigReadResponse__AutoCompactTokenLimitScope = "total" | "body_after_prefix"; -export const V2ConfigReadResponse__AutoCompactTokenLimitScope = Schema.Literals([ - "total", - "body_after_prefix", +export type V2ConfigReadResponse__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const V2ConfigReadResponse__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", ]).annotate({ description: - "Selects which part of the active context is charged against `model_auto_compact_token_limit`.", + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2ConfigReadResponse__ApprovalsReviewer", }); +export type V2ConfigReadResponse__AllowDenyRequirement = "allow" | "deny"; +export const V2ConfigReadResponse__AllowDenyRequirement = Schema.Literals([ + "allow", + "deny", +]).annotate({ identifier: "V2ConfigReadResponse__AllowDenyRequirement" }); + export type V2ConfigReadResponse__ForcedChatgptWorkspaceIds = string | ReadonlyArray; export const V2ConfigReadResponse__ForcedChatgptWorkspaceIds = Schema.Union([ Schema.String, Schema.Array(Schema.String), ]).annotate({ description: "Backward-compatible API shape for ChatGPT workspace login restrictions.", + identifier: "V2ConfigReadResponse__ForcedChatgptWorkspaceIds", }); export type V2ConfigReadResponse__ForcedLoginMethod = "chatgpt" | "api"; -export const V2ConfigReadResponse__ForcedLoginMethod = Schema.Literals(["chatgpt", "api"]); +export const V2ConfigReadResponse__ForcedLoginMethod = Schema.Literals(["chatgpt", "api"]).annotate( + { identifier: "V2ConfigReadResponse__ForcedLoginMethod" }, +); + +export type V2ConfigReadResponse__AutoCompactTokenLimitScope = "total" | "body_after_prefix"; +export const V2ConfigReadResponse__AutoCompactTokenLimitScope = Schema.Union( + [ + Schema.Literal("total").annotate({ + description: "Count the full active context against the limit.", + }), + Schema.Literal("body_after_prefix").annotate({ + description: "Count sampled output and later growth after the carried window prefix.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Selects which part of the active context is charged against `model_auto_compact_token_limit`.", + identifier: "V2ConfigReadResponse__AutoCompactTokenLimitScope", +}); export type V2ConfigReadResponse__ReasoningEffort = string; export const V2ConfigReadResponse__ReasoningEffort = Schema.String.annotate({ description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ConfigReadResponse__ReasoningEffort", + }), +); export type V2ConfigReadResponse__ReasoningSummary = "auto" | "concise" | "detailed" | "none"; export const V2ConfigReadResponse__ReasoningSummary = Schema.Union( @@ -3621,6 +4552,14 @@ export const V2ConfigReadResponse__ReasoningSummary = Schema.Union( ).annotate({ description: "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + identifier: "V2ConfigReadResponse__ReasoningSummary", +}); + +export type V2ConfigReadResponse__Verbosity = "low" | "medium" | "high"; +export const V2ConfigReadResponse__Verbosity = Schema.Literals(["low", "medium", "high"]).annotate({ + description: + "Controls output length/detail on GPT-5 models via the Responses API. Serialized with lowercase values to match the OpenAI API.", + identifier: "V2ConfigReadResponse__Verbosity", }); export type V2ConfigReadResponse__SandboxMode = @@ -3631,7 +4570,7 @@ export const V2ConfigReadResponse__SandboxMode = Schema.Literals([ "read-only", "workspace-write", "danger-full-access", -]); +]).annotate({ identifier: "V2ConfigReadResponse__SandboxMode" }); export type V2ConfigReadResponse__SandboxWorkspaceWrite = { readonly exclude_slash_tmp?: boolean; @@ -3644,20 +4583,14 @@ export const V2ConfigReadResponse__SandboxWorkspaceWrite = Schema.Struct({ exclude_tmpdir_env_var: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), network_access: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), writable_roots: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), -}); - -export type V2ConfigReadResponse__Verbosity = "low" | "medium" | "high"; -export const V2ConfigReadResponse__Verbosity = Schema.Literals(["low", "medium", "high"]).annotate({ - description: - "Controls output length/detail on GPT-5 models via the Responses API. Serialized with lowercase values to match the OpenAI API.", -}); +}).annotate({ identifier: "V2ConfigReadResponse__SandboxWorkspaceWrite" }); export type V2ConfigReadResponse__WebSearchContextSize = "low" | "medium" | "high"; export const V2ConfigReadResponse__WebSearchContextSize = Schema.Literals([ "low", "medium", "high", -]); +]).annotate({ identifier: "V2ConfigReadResponse__WebSearchContextSize" }); export type V2ConfigReadResponse__WebSearchLocation = { readonly city?: string | null; @@ -3670,7 +4603,7 @@ export const V2ConfigReadResponse__WebSearchLocation = Schema.Struct({ country: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), region: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), timezone: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ConfigReadResponse__WebSearchLocation" }); export type V2ConfigReadResponse__WebSearchMode = "disabled" | "cached" | "indexed" | "live"; export const V2ConfigReadResponse__WebSearchMode = Schema.Literals([ @@ -3678,7 +4611,56 @@ export const V2ConfigReadResponse__WebSearchMode = Schema.Literals([ "cached", "indexed", "live", -]); +]).annotate({ identifier: "V2ConfigReadResponse__WebSearchMode" }); + +export type V2ConfigReadResponse__AbsolutePathBuf = string; +export const V2ConfigReadResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ConfigReadResponse__AbsolutePathBuf", +}); + +export type V2ConfigReadResponse__AppToolApproval = "auto" | "prompt" | "writes" | "approve"; +export const V2ConfigReadResponse__AppToolApproval = Schema.Literals([ + "auto", + "prompt", + "writes", + "approve", +]).annotate({ identifier: "V2ConfigReadResponse__AppToolApproval" }); + +export type V2ConfigReadResponse__AppLinksConfig = { readonly [x: string]: Schema.Json }; +export const V2ConfigReadResponse__AppLinksConfig = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ + description: "Account settings for a single app.", + identifier: "V2ConfigReadResponse__AppLinksConfig", +}); + +export type V2ConfigReadResponse__ToolExposureSurface = "code_mode" | "deferred" | "direct"; +export const V2ConfigReadResponse__ToolExposureSurface = Schema.Union( + [ + Schema.Literal("code_mode").annotate({ + description: "Nested tools available to Code Mode scripts.", + }), + Schema.Literal("deferred").annotate({ + description: "Tools discovered later through tool search.", + }), + Schema.Literal("direct").annotate({ + description: "Tools present in the model's initial tool list.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: "A model-facing surface on which a tool can be exposed.", + identifier: "V2ConfigReadResponse__ToolExposureSurface", +}); + +export type V2ConfigReadResponse__AppToolsConfig = { readonly [x: string]: Schema.Json }; +export const V2ConfigReadResponse__AppToolsConfig = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ identifier: "V2ConfigReadResponse__AppToolsConfig" }); export type V2ConfigRequirementsReadResponse__AskForApproval = | "untrusted" @@ -3707,17 +4689,119 @@ export const V2ConfigRequirementsReadResponse__AskForApproval = Schema.Union( }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, +).annotate({ identifier: "V2ConfigRequirementsReadResponse__AskForApproval" }); + +export type V2ConfigRequirementsReadResponse__ForcedLoginMethod = "chatgpt" | "api"; +export const V2ConfigRequirementsReadResponse__ForcedLoginMethod = Schema.Literals([ + "chatgpt", + "api", +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__ForcedLoginMethod" }); + +export type V2ConfigRequirementsReadResponse__SandboxMode = + | "read-only" + | "workspace-write" + | "danger-full-access"; +export const V2ConfigRequirementsReadResponse__SandboxMode = Schema.Literals([ + "read-only", + "workspace-write", + "danger-full-access", +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__SandboxMode" }); + +export type V2ConfigRequirementsReadResponse__WebSearchMode = + | "disabled" + | "cached" + | "indexed" + | "live"; +export const V2ConfigRequirementsReadResponse__WebSearchMode = Schema.Literals([ + "disabled", + "cached", + "indexed", + "live", +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__WebSearchMode" }); + +export type V2ConfigRequirementsReadResponse__WindowsSandboxImplementation = + | "elevated" + | "unelevated" + | "mxc"; +export const V2ConfigRequirementsReadResponse__WindowsSandboxImplementation = Schema.Literals([ + "elevated", + "unelevated", + "mxc", +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__WindowsSandboxImplementation" }); + +export type V2ConfigRequirementsReadResponse__AutoReviewRequirements = { + readonly ignoreRules?: ReadonlyArray | null; + readonly requiredOnModels?: ReadonlyArray | null; +}; +export const V2ConfigRequirementsReadResponse__AutoReviewRequirements = Schema.Struct({ + ignoreRules: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + requiredOnModels: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__AutoReviewRequirements" }); + +export type V2ConfigRequirementsReadResponse__AllowDenyRequirement = "allow" | "deny"; +export const V2ConfigRequirementsReadResponse__AllowDenyRequirement = Schema.Literals([ + "allow", + "deny", +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__AllowDenyRequirement" }); + +export type V2ConfigRequirementsReadResponse__BrowserUseAccessApprovalLifetime = "turn" | "thread"; +export const V2ConfigRequirementsReadResponse__BrowserUseAccessApprovalLifetime = Schema.Literals([ + "turn", + "thread", +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__BrowserUseAccessApprovalLifetime" }); + +export type V2ConfigRequirementsReadResponse__CliAuthCredentialsStoreMode = + | "file" + | "keyring" + | "auto" + | "ephemeral"; +export const V2ConfigRequirementsReadResponse__CliAuthCredentialsStoreMode = Schema.Literals([ + "file", + "keyring", + "auto", + "ephemeral", +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__CliAuthCredentialsStoreMode" }); + +export type V2ConfigRequirementsReadResponse__ResidencyRequirement = "us"; +export const V2ConfigRequirementsReadResponse__ResidencyRequirement = Schema.Literal("us").annotate( + { identifier: "V2ConfigRequirementsReadResponse__ResidencyRequirement" }, ); -export type V2ConfigRequirementsReadResponse__ComputerUseRequirements = { - readonly allowLockedComputerUse?: boolean | null; +export type V2ConfigRequirementsReadResponse__FeedbackRequirements = { + readonly enabled?: boolean | null; }; -export const V2ConfigRequirementsReadResponse__ComputerUseRequirements = Schema.Struct({ - allowLockedComputerUse: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), -}); +export const V2ConfigRequirementsReadResponse__FeedbackRequirements = Schema.Struct({ + enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__FeedbackRequirements" }); + +export type V2ConfigRequirementsReadResponse__InAppBrowserRequirements = { + readonly allowExternalBrowserSettingsImport?: boolean | null; +}; +export const V2ConfigRequirementsReadResponse__InAppBrowserRequirements = Schema.Struct({ + allowExternalBrowserSettingsImport: Schema.optionalKey( + Schema.Union([Schema.Boolean, Schema.Null]), + ), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__InAppBrowserRequirements" }); + +export type V2ConfigRequirementsReadResponse__ReasoningEffort = string; +export const V2ConfigRequirementsReadResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ConfigRequirementsReadResponse__ReasoningEffort", + }), +); + +export type V2ConfigRequirementsReadResponse__NetworkDomainPermission = "allow" | "deny"; +export const V2ConfigRequirementsReadResponse__NetworkDomainPermission = Schema.Literals([ + "allow", + "deny", +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__NetworkDomainPermission" }); export type V2ConfigRequirementsReadResponse__ConfiguredHookHandler = | { + readonly additionalContextLimit?: number | null; readonly async: boolean; readonly command: string; readonly commandWindows?: string | null; @@ -3725,11 +4809,35 @@ export type V2ConfigRequirementsReadResponse__ConfiguredHookHandler = readonly timeoutSec?: number | null; readonly type: "command"; } + | { + readonly input: { readonly [x: string]: Schema.Json }; + readonly server: string; + readonly statusMessage?: string | null; + readonly timeoutSec?: number | null; + readonly tool: string; + readonly type: "mcp_tool"; + } | { readonly type: "prompt" } | { readonly type: "agent" }; export const V2ConfigRequirementsReadResponse__ConfiguredHookHandler = Schema.Union( [ Schema.Struct({ + additionalContextLimit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Approximate token threshold for spilling this hook's `additionalContext` to disk. `null` uses 2,500 tokens; `0` disables spilling for this hook. The threshold is evaluated against the original context; a spilled preview also includes recovery metadata.", + format: "uint", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), async: Schema.Boolean, command: Schema.String, commandWindows: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -3737,13 +4845,36 @@ export const V2ConfigRequirementsReadResponse__ConfiguredHookHandler = Schema.Un timeoutSec: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), type: Schema.Literal("command").annotate({ title: "CommandConfiguredHookHandlerType" }), }).annotate({ title: "CommandConfiguredHookHandler" }), + Schema.Struct({ + input: Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), + server: Schema.String, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + timeoutSec: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + tool: Schema.String, + type: Schema.Literal("mcp_tool").annotate({ title: "McpToolConfiguredHookHandlerType" }), + }).annotate({ title: "McpToolConfiguredHookHandler" }), Schema.Struct({ type: Schema.Literal("prompt").annotate({ title: "PromptConfiguredHookHandlerType" }), }).annotate({ title: "PromptConfiguredHookHandler" }), @@ -3752,58 +4883,19 @@ export const V2ConfigRequirementsReadResponse__ConfiguredHookHandler = Schema.Un }).annotate({ title: "AgentConfiguredHookHandler" }), ], { mode: "oneOf" }, -); - -export type V2ConfigRequirementsReadResponse__NetworkDomainPermission = "allow" | "deny"; -export const V2ConfigRequirementsReadResponse__NetworkDomainPermission = Schema.Literals([ - "allow", - "deny", -]); +).annotate({ identifier: "V2ConfigRequirementsReadResponse__ConfiguredHookHandler" }); export type V2ConfigRequirementsReadResponse__NetworkUnixSocketPermission = "allow" | "deny"; export const V2ConfigRequirementsReadResponse__NetworkUnixSocketPermission = Schema.Literals([ "allow", "deny", -]); - -export type V2ConfigRequirementsReadResponse__ReasoningEffort = string; -export const V2ConfigRequirementsReadResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); - -export type V2ConfigRequirementsReadResponse__ResidencyRequirement = "us"; -export const V2ConfigRequirementsReadResponse__ResidencyRequirement = Schema.Literal("us"); - -export type V2ConfigRequirementsReadResponse__SandboxMode = - | "read-only" - | "workspace-write" - | "danger-full-access"; -export const V2ConfigRequirementsReadResponse__SandboxMode = Schema.Literals([ - "read-only", - "workspace-write", - "danger-full-access", -]); - -export type V2ConfigRequirementsReadResponse__WebSearchMode = - | "disabled" - | "cached" - | "indexed" - | "live"; -export const V2ConfigRequirementsReadResponse__WebSearchMode = Schema.Literals([ - "disabled", - "cached", - "indexed", - "live", -]); - -export type V2ConfigRequirementsReadResponse__WindowsSandboxSetupMode = "elevated" | "unelevated"; -export const V2ConfigRequirementsReadResponse__WindowsSandboxSetupMode = Schema.Literals([ - "elevated", - "unelevated", -]); +]).annotate({ identifier: "V2ConfigRequirementsReadResponse__NetworkUnixSocketPermission" }); export type V2ConfigValueWriteParams__MergeStrategy = "replace" | "upsert"; -export const V2ConfigValueWriteParams__MergeStrategy = Schema.Literals(["replace", "upsert"]); +export const V2ConfigValueWriteParams__MergeStrategy = Schema.Literals([ + "replace", + "upsert", +]).annotate({ identifier: "V2ConfigValueWriteParams__MergeStrategy" }); export type V2ConfigWarningNotification__TextPosition = { readonly column: number; @@ -3814,21 +4906,28 @@ export const V2ConfigWarningNotification__TextPosition = Schema.Struct({ description: "1-based column number (in Unicode scalar values).", format: "uint", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), line: Schema.Number.annotate({ description: "1-based line number.", format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ConfigWarningNotification__TextPosition" }); export type V2ConfigWriteResponse__AbsolutePathBuf = string; export const V2ConfigWriteResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ConfigWriteResponse__AbsolutePathBuf", }); export type V2ConfigWriteResponse__WriteStatus = "ok" | "okOverridden"; -export const V2ConfigWriteResponse__WriteStatus = Schema.Literals(["ok", "okOverridden"]); +export const V2ConfigWriteResponse__WriteStatus = Schema.Literals(["ok", "okOverridden"]).annotate({ + identifier: "V2ConfigWriteResponse__WriteStatus", +}); export type V2ConsumeAccountRateLimitResetCreditResponse__ConsumeAccountRateLimitResetCreditOutcome = | "reset" @@ -3836,101 +4935,85 @@ export type V2ConsumeAccountRateLimitResetCreditResponse__ConsumeAccountRateLimi | "noCredit" | "alreadyRedeemed"; export const V2ConsumeAccountRateLimitResetCreditResponse__ConsumeAccountRateLimitResetCreditOutcome = - Schema.Literals(["reset", "nothingToReset", "noCredit", "alreadyRedeemed"]); - -export type V2ErrorNotification__NonSteerableTurnKind = "review" | "compact"; -export const V2ErrorNotification__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); - -export type V2ExperimentalFeatureListResponse__ExperimentalFeature = { - readonly announcement?: string | null; - readonly defaultEnabled: boolean; - readonly description?: string | null; - readonly displayName?: string | null; - readonly enabled: boolean; - readonly name: string; - readonly stage: "beta" | "underDevelopment" | "stable" | "deprecated" | "removed"; -}; -export const V2ExperimentalFeatureListResponse__ExperimentalFeature = Schema.Struct({ - announcement: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Announcement copy shown to users when the feature is introduced. Null when this feature is not in beta.", + Schema.Union( + [ + Schema.Literal("reset").annotate({ + description: "A reset credit was consumed and the eligible rate-limit windows were reset.", }), - Schema.Null, - ]), - ), - defaultEnabled: Schema.Boolean.annotate({ - description: "Whether this feature is enabled by default.", - }), - description: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Short summary describing what the feature does. Null when this feature is not in beta.", + Schema.Literal("nothingToReset").annotate({ + description: "No current rate-limit window is eligible for a reset.", }), - Schema.Null, - ]), - ), - displayName: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "User-facing display name shown in the experimental features UI. Null when this feature is not in beta.", + Schema.Literal("noCredit").annotate({ + description: "The account has no earned reset credits available.", }), - Schema.Null, - ]), - ), - enabled: Schema.Boolean.annotate({ - description: "Whether this feature is currently enabled in the loaded config.", - }), - name: Schema.String.annotate({ - description: "Stable key used in config.toml and CLI flag toggles.", - }), - stage: Schema.Literals(["beta", "underDevelopment", "stable", "deprecated", "removed"]).annotate({ - description: "Lifecycle stage of this feature flag.", - }), -}); + Schema.Literal("alreadyRedeemed").annotate({ + description: "The same idempotency key already completed a reset successfully.", + }), + ], + { mode: "oneOf" }, + ).annotate({ + identifier: + "V2ConsumeAccountRateLimitResetCreditResponse__ConsumeAccountRateLimitResetCreditOutcome", + }); + +export type V2ErrorNotification__NonSteerableTurnKind = "review" | "compact"; +export const V2ErrorNotification__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ErrorNotification__NonSteerableTurnKind" }); + +export type V2ErrorNotification__MisalignmentSteer = { readonly message: string }; +export const V2ErrorNotification__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ErrorNotification__MisalignmentSteer" }); + +export type V2ExperimentalFeatureListResponse__ExperimentalFeatureStage = + | "beta" + | "underDevelopment" + | "stable" + | "deprecated" + | "removed"; +export const V2ExperimentalFeatureListResponse__ExperimentalFeatureStage = Schema.Union( + [ + Schema.Literal("beta").annotate({ + description: "Feature is available for user testing and feedback.", + }), + Schema.Literal("underDevelopment").annotate({ + description: "Feature is still being built and not ready for broad use.", + }), + Schema.Literal("stable").annotate({ description: "Feature is production-ready." }), + Schema.Literal("deprecated").annotate({ + description: "Feature is deprecated and should be avoided.", + }), + Schema.Literal("removed").annotate({ + description: "Feature flag is retained only for backwards compatibility.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ExperimentalFeatureListResponse__ExperimentalFeatureStage" }); + +export type V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorSource = + | "remoteMcpServersConfig" + | "sessionToolUse"; +export const V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorSource = + Schema.Literals(["remoteMcpServersConfig", "sessionToolUse"]).annotate({ + identifier: "V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorSource", + }); export type V2ExternalAgentConfigDetectResponse__CommandMigration = { readonly name: string }; export const V2ExternalAgentConfigDetectResponse__CommandMigration = Schema.Struct({ name: Schema.String, -}); - -export type V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType = - | "AGENTS_MD" - | "CONFIG" - | "SKILLS" - | "PLUGINS" - | "MCP_SERVER_CONFIG" - | "SUBAGENTS" - | "HOOKS" - | "COMMANDS" - | "MEMORY" - | "SESSIONS"; -export const V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType = - Schema.Literals([ - "AGENTS_MD", - "CONFIG", - "SKILLS", - "PLUGINS", - "MCP_SERVER_CONFIG", - "SUBAGENTS", - "HOOKS", - "COMMANDS", - "MEMORY", - "SESSIONS", - ]); +}).annotate({ identifier: "V2ExternalAgentConfigDetectResponse__CommandMigration" }); export type V2ExternalAgentConfigDetectResponse__HookMigration = { readonly name: string }; export const V2ExternalAgentConfigDetectResponse__HookMigration = Schema.Struct({ name: Schema.String, -}); +}).annotate({ identifier: "V2ExternalAgentConfigDetectResponse__HookMigration" }); export type V2ExternalAgentConfigDetectResponse__McpServerMigration = { readonly name: string }; export const V2ExternalAgentConfigDetectResponse__McpServerMigration = Schema.Struct({ name: Schema.String, -}); +}).annotate({ identifier: "V2ExternalAgentConfigDetectResponse__McpServerMigration" }); export type V2ExternalAgentConfigDetectResponse__PluginsMigration = { readonly marketplaceName: string; @@ -3939,7 +5022,7 @@ export type V2ExternalAgentConfigDetectResponse__PluginsMigration = { export const V2ExternalAgentConfigDetectResponse__PluginsMigration = Schema.Struct({ marketplaceName: Schema.String, pluginNames: Schema.Array(Schema.String), -}); +}).annotate({ identifier: "V2ExternalAgentConfigDetectResponse__PluginsMigration" }); export type V2ExternalAgentConfigDetectResponse__SessionMigration = { readonly cwd: string; @@ -3950,19 +5033,19 @@ export const V2ExternalAgentConfigDetectResponse__SessionMigration = Schema.Stru cwd: Schema.String, path: Schema.String, title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ExternalAgentConfigDetectResponse__SessionMigration" }); export type V2ExternalAgentConfigDetectResponse__SkillMigration = { readonly name: string }; export const V2ExternalAgentConfigDetectResponse__SkillMigration = Schema.Struct({ name: Schema.String, -}); +}).annotate({ identifier: "V2ExternalAgentConfigDetectResponse__SkillMigration" }); export type V2ExternalAgentConfigDetectResponse__SubagentMigration = { readonly name: string }; export const V2ExternalAgentConfigDetectResponse__SubagentMigration = Schema.Struct({ name: Schema.String, -}); +}).annotate({ identifier: "V2ExternalAgentConfigDetectResponse__SubagentMigration" }); -export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType = +export type V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType = | "AGENTS_MD" | "CONFIG" | "SKILLS" @@ -3973,7 +5056,7 @@ export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfi | "COMMANDS" | "MEMORY" | "SESSIONS"; -export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType = +export const V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType = Schema.Literals([ "AGENTS_MD", "CONFIG", @@ -3985,9 +5068,11 @@ export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConf "COMMANDS", "MEMORY", "SESSIONS", - ]); + ]).annotate({ + identifier: "V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType", + }); -export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType = +export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType = | "AGENTS_MD" | "CONFIG" | "SKILLS" @@ -3998,7 +5083,7 @@ export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfi | "COMMANDS" | "MEMORY" | "SESSIONS"; -export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType = +export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType = Schema.Literals([ "AGENTS_MD", "CONFIG", @@ -4010,19 +5095,48 @@ export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConf "COMMANDS", "MEMORY", "SESSIONS", - ]); + ]).annotate({ + identifier: + "V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType", + }); export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorSource = "remoteMcpServersConfig"; export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorSource = - Schema.Literal("remoteMcpServersConfig"); + Schema.Literal("remoteMcpServersConfig").annotate({ + identifier: + "V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorSource", + }); -export type V2ExternalAgentConfigImportParams__CommandMigration = { readonly name: string }; -export const V2ExternalAgentConfigImportParams__CommandMigration = Schema.Struct({ - name: Schema.String, -}); +export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType = + | "AGENTS_MD" + | "CONFIG" + | "SKILLS" + | "PLUGINS" + | "MCP_SERVER_CONFIG" + | "SUBAGENTS" + | "HOOKS" + | "COMMANDS" + | "MEMORY" + | "SESSIONS"; +export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType = + Schema.Literals([ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "MEMORY", + "SESSIONS", + ]).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType", + }); -export type V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType = +export type V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType = | "AGENTS_MD" | "CONFIG" | "SKILLS" @@ -4033,7 +5147,7 @@ export type V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemT | "COMMANDS" | "MEMORY" | "SESSIONS"; -export const V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType = +export const V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType = Schema.Literals([ "AGENTS_MD", "CONFIG", @@ -4045,17 +5159,25 @@ export const V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem "COMMANDS", "MEMORY", "SESSIONS", - ]); + ]).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType", + }); + +export type V2ExternalAgentConfigImportParams__CommandMigration = { readonly name: string }; +export const V2ExternalAgentConfigImportParams__CommandMigration = Schema.Struct({ + name: Schema.String, +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__CommandMigration" }); export type V2ExternalAgentConfigImportParams__HookMigration = { readonly name: string }; export const V2ExternalAgentConfigImportParams__HookMigration = Schema.Struct({ name: Schema.String, -}); +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__HookMigration" }); export type V2ExternalAgentConfigImportParams__McpServerMigration = { readonly name: string }; export const V2ExternalAgentConfigImportParams__McpServerMigration = Schema.Struct({ name: Schema.String, -}); +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__McpServerMigration" }); export type V2ExternalAgentConfigImportParams__PluginsMigration = { readonly marketplaceName: string; @@ -4064,7 +5186,7 @@ export type V2ExternalAgentConfigImportParams__PluginsMigration = { export const V2ExternalAgentConfigImportParams__PluginsMigration = Schema.Struct({ marketplaceName: Schema.String, pluginNames: Schema.Array(Schema.String), -}); +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__PluginsMigration" }); export type V2ExternalAgentConfigImportParams__SessionMigration = { readonly cwd: string; @@ -4075,17 +5197,44 @@ export const V2ExternalAgentConfigImportParams__SessionMigration = Schema.Struct cwd: Schema.String, path: Schema.String, title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__SessionMigration" }); export type V2ExternalAgentConfigImportParams__SkillMigration = { readonly name: string }; export const V2ExternalAgentConfigImportParams__SkillMigration = Schema.Struct({ name: Schema.String, -}); +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__SkillMigration" }); export type V2ExternalAgentConfigImportParams__SubagentMigration = { readonly name: string }; export const V2ExternalAgentConfigImportParams__SubagentMigration = Schema.Struct({ name: Schema.String, -}); +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__SubagentMigration" }); + +export type V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType = + | "AGENTS_MD" + | "CONFIG" + | "SKILLS" + | "PLUGINS" + | "MCP_SERVER_CONFIG" + | "SUBAGENTS" + | "HOOKS" + | "COMMANDS" + | "MEMORY" + | "SESSIONS"; +export const V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType = + Schema.Literals([ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "MEMORY", + "SESSIONS", + ]).annotate({ + identifier: "V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType", + }); export type V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType = | "AGENTS_MD" @@ -4110,7 +5259,10 @@ export const V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfi "COMMANDS", "MEMORY", "SESSIONS", - ]); + ]).annotate({ + identifier: + "V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType", + }); export type V2FileChangePatchUpdatedNotification__PatchChangeKind = | { readonly type: "add" } @@ -4130,12 +5282,41 @@ export const V2FileChangePatchUpdatedNotification__PatchChangeKind = Schema.Unio }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2FileChangePatchUpdatedNotification__PatchChangeKind" }); export type V2FsChangedNotification__AbsolutePathBuf = string; export const V2FsChangedNotification__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsChangedNotification__AbsolutePathBuf", +}); + +export type V2FsCopyParams__AbsolutePathBuf = string; +export const V2FsCopyParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsCopyParams__AbsolutePathBuf", +}); + +export type V2FsCreateDirectoryParams__AbsolutePathBuf = string; +export const V2FsCreateDirectoryParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsCreateDirectoryParams__AbsolutePathBuf", +}); + +export type V2FsGetMetadataParams__AbsolutePathBuf = string; +export const V2FsGetMetadataParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsGetMetadataParams__AbsolutePathBuf", +}); + +export type V2FsReadDirectoryParams__AbsolutePathBuf = string; +export const V2FsReadDirectoryParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsReadDirectoryParams__AbsolutePathBuf", }); export type V2FsReadDirectoryResponse__FsReadDirectoryEntry = { @@ -4153,88 +5334,120 @@ export const V2FsReadDirectoryResponse__FsReadDirectoryEntry = Schema.Struct({ isFile: Schema.Boolean.annotate({ description: "Whether this entry resolves to a regular file.", }), -}).annotate({ description: "A directory entry returned by `fs/readDirectory`." }); +}).annotate({ + description: "A directory entry returned by `fs/readDirectory`.", + identifier: "V2FsReadDirectoryResponse__FsReadDirectoryEntry", +}); -export type V2GetAccountRateLimitsResponse__CreditsSnapshot = { - readonly balance?: string | null; - readonly hasCredits: boolean; - readonly unlimited: boolean; -}; -export const V2GetAccountRateLimitsResponse__CreditsSnapshot = Schema.Struct({ - balance: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - hasCredits: Schema.Boolean, - unlimited: Schema.Boolean, +export type V2FsReadFileParams__AbsolutePathBuf = string; +export const V2FsReadFileParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsReadFileParams__AbsolutePathBuf", }); -export type V2GetAccountRateLimitsResponse__PlanType = - | "free" - | "go" - | "plus" - | "pro" - | "prolite" - | "team" - | "self_serve_business_prolite" - | "self_serve_business_usage_based" - | "business" - | "ent26" - | "enterprise_cbp_automation" - | "enterprise_cbp_usage_based" - | "enterprise" - | "edu" - | "edu_plus" - | "edu_pro" - | "unknown"; -export const V2GetAccountRateLimitsResponse__PlanType = Schema.Literals([ - "free", - "go", - "plus", - "pro", - "prolite", - "team", - "self_serve_business_prolite", - "self_serve_business_usage_based", - "business", - "ent26", - "enterprise_cbp_automation", - "enterprise_cbp_usage_based", - "enterprise", - "edu", - "edu_plus", - "edu_pro", - "unknown", -]); +export type V2FsRemoveParams__AbsolutePathBuf = string; +export const V2FsRemoveParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsRemoveParams__AbsolutePathBuf", +}); -export type V2GetAccountRateLimitsResponse__RateLimitReachedType = - | "rate_limit_reached" - | "workspace_owner_credits_depleted" - | "workspace_member_credits_depleted" - | "workspace_owner_usage_limit_reached" - | "workspace_member_usage_limit_reached"; -export const V2GetAccountRateLimitsResponse__RateLimitReachedType = Schema.Literals([ - "rate_limit_reached", - "workspace_owner_credits_depleted", - "workspace_member_credits_depleted", - "workspace_owner_usage_limit_reached", - "workspace_member_usage_limit_reached", -]); +export type V2FsWatchParams__AbsolutePathBuf = string; +export const V2FsWatchParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsWatchParams__AbsolutePathBuf", +}); -export type V2GetAccountRateLimitsResponse__RateLimitResetCreditStatus = - | "available" - | "redeeming" - | "redeemed" +export type V2FsWatchResponse__AbsolutePathBuf = string; +export const V2FsWatchResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsWatchResponse__AbsolutePathBuf", +}); + +export type V2FsWriteFileParams__AbsolutePathBuf = string; +export const V2FsWriteFileParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2FsWriteFileParams__AbsolutePathBuf", +}); + +export type V2GatewayOAuthChangedNotification__GatewayOAuthStatus = + | "notReady" + | "started" + | "succeeded" + | "failed"; +export const V2GatewayOAuthChangedNotification__GatewayOAuthStatus = Schema.Literals([ + "notReady", + "started", + "succeeded", + "failed", +]).annotate({ identifier: "V2GatewayOAuthChangedNotification__GatewayOAuthStatus" }); + +export type V2GatewayOAuthReadResponse__GatewayOAuthStatus = + | "notReady" + | "started" + | "succeeded" + | "failed"; +export const V2GatewayOAuthReadResponse__GatewayOAuthStatus = Schema.Literals([ + "notReady", + "started", + "succeeded", + "failed", +]).annotate({ identifier: "V2GatewayOAuthReadResponse__GatewayOAuthStatus" }); + +export type V2GetAccountRateLimitsResponse__RateLimitResetType = "codexRateLimits" | "unknown"; +export const V2GetAccountRateLimitsResponse__RateLimitResetType = Schema.Literals([ + "codexRateLimits", + "unknown", +]).annotate({ identifier: "V2GetAccountRateLimitsResponse__RateLimitResetType" }); + +export type V2GetAccountRateLimitsResponse__RateLimitResetCreditStatus = + | "available" + | "redeeming" + | "redeemed" | "unknown"; export const V2GetAccountRateLimitsResponse__RateLimitResetCreditStatus = Schema.Literals([ "available", "redeeming", "redeemed", "unknown", -]); +]).annotate({ identifier: "V2GetAccountRateLimitsResponse__RateLimitResetCreditStatus" }); -export type V2GetAccountRateLimitsResponse__RateLimitResetType = "codexRateLimits" | "unknown"; -export const V2GetAccountRateLimitsResponse__RateLimitResetType = Schema.Literals([ - "codexRateLimits", - "unknown", -]); +export type V2GetAccountRateLimitsResponse__CreditsSnapshot = { + readonly balance?: string | null; + readonly hasCredits: boolean; + readonly unlimited: boolean; +}; +export const V2GetAccountRateLimitsResponse__CreditsSnapshot = Schema.Struct({ + balance: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + hasCredits: Schema.Boolean, + unlimited: Schema.Boolean, +}).annotate({ identifier: "V2GetAccountRateLimitsResponse__CreditsSnapshot" }); + +export type V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot = { + readonly limit: string; + readonly remainingPercent: number; + readonly resetsAt: number; + readonly used: string; +}; +export const V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot = Schema.Struct({ + limit: Schema.String, + remainingPercent: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + resetsAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + used: Schema.String, +}).annotate({ identifier: "V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot" }); + +export type V2GetAccountRateLimitsResponse__PlanType = string; +export const V2GetAccountRateLimitsResponse__PlanType = Schema.String.annotate({ + identifier: "V2GetAccountRateLimitsResponse__PlanType", +}); export type V2GetAccountRateLimitsResponse__RateLimitWindow = { readonly resetsAt?: number | null; @@ -4243,64 +5456,54 @@ export type V2GetAccountRateLimitsResponse__RateLimitWindow = { }; export const V2GetAccountRateLimitsResponse__RateLimitWindow = Schema.Struct({ resetsAt: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + usedPercent: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), ), - usedPercent: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), windowDurationMins: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), -}); +}).annotate({ identifier: "V2GetAccountRateLimitsResponse__RateLimitWindow" }); -export type V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot = { - readonly limit: string; - readonly remainingPercent: number; - readonly resetsAt: number; - readonly used: string; -}; -export const V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot = Schema.Struct({ - limit: Schema.String, - remainingPercent: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - resetsAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - used: Schema.String, +export type V2GetAccountRateLimitsResponse__RateLimitReachedType = + | "rate_limit_reached" + | "workspace_owner_credits_depleted" + | "workspace_member_credits_depleted" + | "workspace_owner_usage_limit_reached" + | "workspace_member_usage_limit_reached"; +export const V2GetAccountRateLimitsResponse__RateLimitReachedType = Schema.Literals([ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached", +]).annotate({ identifier: "V2GetAccountRateLimitsResponse__RateLimitReachedType" }); + +export type V2GetAccountResponse__PlanType = string; +export const V2GetAccountResponse__PlanType = Schema.String.annotate({ + identifier: "V2GetAccountResponse__PlanType", }); -export type V2GetAccountResponse__PlanType = - | "free" - | "go" - | "plus" - | "pro" - | "prolite" - | "team" - | "self_serve_business_prolite" - | "self_serve_business_usage_based" - | "business" - | "ent26" - | "enterprise_cbp_automation" - | "enterprise_cbp_usage_based" - | "enterprise" - | "edu" - | "edu_plus" - | "edu_pro" - | "unknown"; -export const V2GetAccountResponse__PlanType = Schema.Literals([ - "free", - "go", - "plus", - "pro", - "prolite", - "team", - "self_serve_business_prolite", - "self_serve_business_usage_based", - "business", - "ent26", - "enterprise_cbp_automation", - "enterprise_cbp_usage_based", - "enterprise", - "edu", - "edu_plus", - "edu_pro", - "unknown", -]); +export type V2GetAccountResponse__AccountRoutingOverride = "NO_CONSTRAINT" | "us" | "us_cr"; +export const V2GetAccountResponse__AccountRoutingOverride = Schema.Literals([ + "NO_CONSTRAINT", + "us", + "us_cr", +]).annotate({ + description: "Backend routing policy. Wire values match the accounts/check contract.", + identifier: "V2GetAccountResponse__AccountRoutingOverride", +}); export type V2GetAccountTokenUsageResponse__AccountTokenUsageDailyBucket = { readonly startDate: string; @@ -4308,8 +5511,10 @@ export type V2GetAccountTokenUsageResponse__AccountTokenUsageDailyBucket = { }; export const V2GetAccountTokenUsageResponse__AccountTokenUsageDailyBucket = Schema.Struct({ startDate: Schema.String, - tokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -}); + tokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +}).annotate({ identifier: "V2GetAccountTokenUsageResponse__AccountTokenUsageDailyBucket" }); export type V2GetAccountTokenUsageResponse__AccountTokenUsageSummary = { readonly currentStreakDays?: number | null; @@ -4320,21 +5525,106 @@ export type V2GetAccountTokenUsageResponse__AccountTokenUsageSummary = { }; export const V2GetAccountTokenUsageResponse__AccountTokenUsageSummary = Schema.Struct({ currentStreakDays: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), lifetimeTokens: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), longestRunningTurnSec: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), longestStreakDays: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), peakDailyTokens: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), -}); +}).annotate({ identifier: "V2GetAccountTokenUsageResponse__AccountTokenUsageSummary" }); + +export type V2GetAccountTokenUsageResponse__ThreadUsageBreakdownGroup = { + readonly cachedInputTokens?: number | null; + readonly estimatedUsageCreditsMicros: number; + readonly inputTokens?: number | null; + readonly model?: string | null; + readonly netNewInputTokens?: number | null; + readonly outputTokens?: number | null; + readonly reasoningEffort?: string | null; + readonly speed?: string | null; + readonly totalTokens?: number | null; +}; +export const V2GetAccountTokenUsageResponse__ThreadUsageBreakdownGroup = Schema.Struct({ + cachedInputTokens: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + estimatedUsageCreditsMicros: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + inputTokens: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + model: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + netNewInputTokens: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + outputTokens: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + reasoningEffort: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + speed: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + totalTokens: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2GetAccountTokenUsageResponse__ThreadUsageBreakdownGroup" }); export type V2GetWorkspaceMessagesResponse__WorkspaceMessageType = | "headline" @@ -4344,13 +5634,21 @@ export const V2GetWorkspaceMessagesResponse__WorkspaceMessageType = Schema.Liter "headline", "announcement", "unknown", -]); +]).annotate({ identifier: "V2GetWorkspaceMessagesResponse__WorkspaceMessageType" }); -export type V2HookCompletedNotification__AbsolutePathBuf = string; -export const V2HookCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +export type V2HookCompletedNotification__HookOutputEntryKind = + | "warning" + | "stop" + | "feedback" + | "context" + | "error"; +export const V2HookCompletedNotification__HookOutputEntryKind = Schema.Literals([ + "warning", + "stop", + "feedback", + "context", + "error", +]).annotate({ identifier: "V2HookCompletedNotification__HookOutputEntryKind" }); export type V2HookCompletedNotification__HookEventName = | "preToolUse" @@ -4363,7 +5661,8 @@ export type V2HookCompletedNotification__HookEventName = | "userPromptSubmit" | "subagentStart" | "subagentStop" - | "stop"; + | "stop" + | "interrupt"; export const V2HookCompletedNotification__HookEventName = Schema.Literals([ "preToolUse", "permissionRequest", @@ -4376,31 +5675,64 @@ export const V2HookCompletedNotification__HookEventName = Schema.Literals([ "subagentStart", "subagentStop", "stop", -]); + "interrupt", +]).annotate({ identifier: "V2HookCompletedNotification__HookEventName" }); export type V2HookCompletedNotification__HookExecutionMode = "sync" | "async"; -export const V2HookCompletedNotification__HookExecutionMode = Schema.Literals(["sync", "async"]); - -export type V2HookCompletedNotification__HookHandlerType = "command" | "prompt" | "agent"; +export const V2HookCompletedNotification__HookExecutionMode = Schema.Literals([ + "sync", + "async", +]).annotate({ identifier: "V2HookCompletedNotification__HookExecutionMode" }); + +export type V2HookCompletedNotification__HookHandlerType = + | "command" + | "mcpTool" + | "prompt" + | "agent"; export const V2HookCompletedNotification__HookHandlerType = Schema.Literals([ "command", + "mcpTool", "prompt", "agent", -]); +]).annotate({ identifier: "V2HookCompletedNotification__HookHandlerType" }); -export type V2HookCompletedNotification__HookOutputEntryKind = - | "warning" - | "stop" - | "feedback" - | "context" - | "error"; -export const V2HookCompletedNotification__HookOutputEntryKind = Schema.Literals([ - "warning", - "stop", - "feedback", - "context", - "error", -]); +export type V2HookCompletedNotification__HookScope = "thread" | "turn"; +export const V2HookCompletedNotification__HookScope = Schema.Literals(["thread", "turn"]).annotate({ + identifier: "V2HookCompletedNotification__HookScope", +}); + +export type V2HookCompletedNotification__HookSource = + | "system" + | "user" + | "project" + | "mdm" + | "sessionFlags" + | "plugin" + | "cloudRequirements" + | "cloudManagedConfig" + | "legacyManagedConfigFile" + | "legacyManagedConfigMdm" + | "unknown"; +export const V2HookCompletedNotification__HookSource = Schema.Literals([ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "cloudManagedConfig", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown", +]).annotate({ identifier: "V2HookCompletedNotification__HookSource" }); + +export type V2HookCompletedNotification__AbsolutePathBuf = string; +export const V2HookCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2HookCompletedNotification__AbsolutePathBuf", +}); export type V2HookCompletedNotification__HookRunStatus = | "running" @@ -4414,16 +5746,7 @@ export const V2HookCompletedNotification__HookRunStatus = Schema.Literals([ "failed", "blocked", "stopped", -]); - -export type V2HookCompletedNotification__HookScope = "thread" | "turn"; -export const V2HookCompletedNotification__HookScope = Schema.Literals(["thread", "turn"]); - -export type V2HooksListResponse__AbsolutePathBuf = string; -export const V2HooksListResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +]).annotate({ identifier: "V2HookCompletedNotification__HookRunStatus" }); export type V2HooksListResponse__HookErrorInfo = { readonly message: string; @@ -4432,7 +5755,7 @@ export type V2HooksListResponse__HookErrorInfo = { export const V2HooksListResponse__HookErrorInfo = Schema.Struct({ message: Schema.String, path: Schema.String, -}); +}).annotate({ identifier: "V2HooksListResponse__HookErrorInfo" }); export type V2HooksListResponse__HookEventName = | "preToolUse" @@ -4445,7 +5768,8 @@ export type V2HooksListResponse__HookEventName = | "userPromptSubmit" | "subagentStart" | "subagentStop" - | "stop"; + | "stop" + | "interrupt"; export const V2HooksListResponse__HookEventName = Schema.Literals([ "preToolUse", "permissionRequest", @@ -4458,10 +5782,8 @@ export const V2HooksListResponse__HookEventName = Schema.Literals([ "subagentStart", "subagentStop", "stop", -]); - -export type V2HooksListResponse__HookHandlerType = "command" | "prompt" | "agent"; -export const V2HooksListResponse__HookHandlerType = Schema.Literals(["command", "prompt", "agent"]); + "interrupt", +]).annotate({ identifier: "V2HooksListResponse__HookEventName" }); export type V2HooksListResponse__HookSource = | "system" @@ -4487,7 +5809,14 @@ export const V2HooksListResponse__HookSource = Schema.Literals([ "legacyManagedConfigFile", "legacyManagedConfigMdm", "unknown", -]); +]).annotate({ identifier: "V2HooksListResponse__HookSource" }); + +export type V2HooksListResponse__AbsolutePathBuf = string; +export const V2HooksListResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2HooksListResponse__AbsolutePathBuf", +}); export type V2HooksListResponse__HookTrustStatus = "managed" | "untrusted" | "trusted" | "modified"; export const V2HooksListResponse__HookTrustStatus = Schema.Literals([ @@ -4495,13 +5824,21 @@ export const V2HooksListResponse__HookTrustStatus = Schema.Literals([ "untrusted", "trusted", "modified", -]); +]).annotate({ identifier: "V2HooksListResponse__HookTrustStatus" }); -export type V2HookStartedNotification__AbsolutePathBuf = string; -export const V2HookStartedNotification__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +export type V2HookStartedNotification__HookOutputEntryKind = + | "warning" + | "stop" + | "feedback" + | "context" + | "error"; +export const V2HookStartedNotification__HookOutputEntryKind = Schema.Literals([ + "warning", + "stop", + "feedback", + "context", + "error", +]).annotate({ identifier: "V2HookStartedNotification__HookOutputEntryKind" }); export type V2HookStartedNotification__HookEventName = | "preToolUse" @@ -4514,7 +5851,8 @@ export type V2HookStartedNotification__HookEventName = | "userPromptSubmit" | "subagentStart" | "subagentStop" - | "stop"; + | "stop" + | "interrupt"; export const V2HookStartedNotification__HookEventName = Schema.Literals([ "preToolUse", "permissionRequest", @@ -4527,31 +5865,60 @@ export const V2HookStartedNotification__HookEventName = Schema.Literals([ "subagentStart", "subagentStop", "stop", -]); + "interrupt", +]).annotate({ identifier: "V2HookStartedNotification__HookEventName" }); export type V2HookStartedNotification__HookExecutionMode = "sync" | "async"; -export const V2HookStartedNotification__HookExecutionMode = Schema.Literals(["sync", "async"]); +export const V2HookStartedNotification__HookExecutionMode = Schema.Literals([ + "sync", + "async", +]).annotate({ identifier: "V2HookStartedNotification__HookExecutionMode" }); -export type V2HookStartedNotification__HookHandlerType = "command" | "prompt" | "agent"; +export type V2HookStartedNotification__HookHandlerType = "command" | "mcpTool" | "prompt" | "agent"; export const V2HookStartedNotification__HookHandlerType = Schema.Literals([ "command", + "mcpTool", "prompt", "agent", -]); +]).annotate({ identifier: "V2HookStartedNotification__HookHandlerType" }); -export type V2HookStartedNotification__HookOutputEntryKind = - | "warning" - | "stop" - | "feedback" - | "context" - | "error"; -export const V2HookStartedNotification__HookOutputEntryKind = Schema.Literals([ - "warning", - "stop", - "feedback", - "context", - "error", -]); +export type V2HookStartedNotification__HookScope = "thread" | "turn"; +export const V2HookStartedNotification__HookScope = Schema.Literals(["thread", "turn"]).annotate({ + identifier: "V2HookStartedNotification__HookScope", +}); + +export type V2HookStartedNotification__HookSource = + | "system" + | "user" + | "project" + | "mdm" + | "sessionFlags" + | "plugin" + | "cloudRequirements" + | "cloudManagedConfig" + | "legacyManagedConfigFile" + | "legacyManagedConfigMdm" + | "unknown"; +export const V2HookStartedNotification__HookSource = Schema.Literals([ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "cloudManagedConfig", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown", +]).annotate({ identifier: "V2HookStartedNotification__HookSource" }); + +export type V2HookStartedNotification__AbsolutePathBuf = string; +export const V2HookStartedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2HookStartedNotification__AbsolutePathBuf", +}); export type V2HookStartedNotification__HookRunStatus = | "running" @@ -4565,34 +5932,111 @@ export const V2HookStartedNotification__HookRunStatus = Schema.Literals([ "failed", "blocked", "stopped", -]); +]).annotate({ identifier: "V2HookStartedNotification__HookRunStatus" }); -export type V2HookStartedNotification__HookScope = "thread" | "turn"; -export const V2HookStartedNotification__HookScope = Schema.Literals(["thread", "turn"]); +export type V2ItemCompletedNotification__ByteRange = { + readonly end: number; + readonly start: number; +}; +export const V2ItemCompletedNotification__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ItemCompletedNotification__ByteRange" }); -export type V2ItemCompletedNotification__AbsolutePathBuf = string; -export const V2ItemCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ +export type V2ItemCompletedNotification__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ItemCompletedNotification__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ItemCompletedNotification__ImageDetail" }); + +export type V2ItemCompletedNotification__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; +}; +export const V2ItemCompletedNotification__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ItemCompletedNotification__HookPromptFragment" }); + +export type V2ItemCompletedNotification__AgentMessageDelivery = "async"; +export const V2ItemCompletedNotification__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ItemCompletedNotification__AgentMessageDelivery", +}); + +export type V2ItemCompletedNotification__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; +}; +export const V2ItemCompletedNotification__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2ItemCompletedNotification__MemoryCitationEntry" }); + +export type V2ItemCompletedNotification__MessagePhase = "commentary" | "final_answer"; +export const V2ItemCompletedNotification__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ItemCompletedNotification__MessagePhase", }); -export type V2ItemCompletedNotification__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ItemCompletedNotification__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +export type V2ItemCompletedNotification__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ItemCompletedNotification__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ItemCompletedNotification__AsyncUserInputQuestion" }); + +export type V2ItemCompletedNotification__LegacyAppPathString = string; +export const V2ItemCompletedNotification__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ItemCompletedNotification__LegacyAppPathString", +}); + +export type V2ItemCompletedNotification__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ItemCompletedNotification__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ItemCompletedNotification__CommandExecutionSource" }); export type V2ItemCompletedNotification__CommandExecutionStatus = | "inProgress" @@ -4604,65 +6048,39 @@ export const V2ItemCompletedNotification__CommandExecutionStatus = Schema.Litera "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ItemCompletedNotification__CommandExecutionStatus" }); -export type V2ItemCompletedNotification__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ItemCompletedNotification__DynamicToolCallOutputContentItem = Schema.Union( +export type V2ItemCompletedNotification__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2ItemCompletedNotification__PatchChangeKind = Schema.Union( [ Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ItemCompletedNotification__PatchChangeKind" }); -export type V2ItemCompletedNotification__DynamicToolCallStatus = +export type V2ItemCompletedNotification__PatchApplyStatus = | "inProgress" | "completed" - | "failed"; -export const V2ItemCompletedNotification__DynamicToolCallStatus = Schema.Literals([ + | "failed" + | "declined"; +export const V2ItemCompletedNotification__PatchApplyStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); - -export type V2ItemCompletedNotification__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const V2ItemCompletedNotification__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); - -export type V2ItemCompletedNotification__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ItemCompletedNotification__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); - -export type V2ItemCompletedNotification__LegacyAppPathString = string; -export const V2ItemCompletedNotification__LegacyAppPathString = Schema.String; + "declined", +]).annotate({ identifier: "V2ItemCompletedNotification__PatchApplyStatus" }); export type V2ItemCompletedNotification__McpToolCallAppContext = { readonly actionName?: string | null; @@ -4677,93 +6095,136 @@ export const V2ItemCompletedNotification__McpToolCallAppContext = Schema.Struct( connectorId: Schema.String, linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ItemCompletedNotification__McpToolCallAppContext" }); export type V2ItemCompletedNotification__McpToolCallError = { readonly message: string }; export const V2ItemCompletedNotification__McpToolCallError = Schema.Struct({ message: Schema.String, -}); +}).annotate({ identifier: "V2ItemCompletedNotification__McpToolCallError" }); + +export type V2ItemCompletedNotification__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ItemCompletedNotification__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ItemCompletedNotification__McpAppDisplayMode" }); export type V2ItemCompletedNotification__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; }; export const V2ItemCompletedNotification__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ItemCompletedNotification__McpToolCallResult" }); export type V2ItemCompletedNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; export const V2ItemCompletedNotification__McpToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); - -export type V2ItemCompletedNotification__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; -}; -export const V2ItemCompletedNotification__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, -}); +]).annotate({ identifier: "V2ItemCompletedNotification__McpToolCallStatus" }); -export type V2ItemCompletedNotification__MessagePhase = "commentary" | "final_answer"; -export const V2ItemCompletedNotification__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', -}); +export type V2ItemCompletedNotification__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ItemCompletedNotification__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemCompletedNotification__DynamicToolCallOutputContentItem" }); -export type V2ItemCompletedNotification__PatchApplyStatus = +export type V2ItemCompletedNotification__DynamicToolCallStatus = | "inProgress" | "completed" - | "failed" - | "declined"; -export const V2ItemCompletedNotification__PatchApplyStatus = Schema.Literals([ + | "failed"; +export const V2ItemCompletedNotification__DynamicToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", - "declined", -]); +]).annotate({ identifier: "V2ItemCompletedNotification__DynamicToolCallStatus" }); -export type V2ItemCompletedNotification__PatchChangeKind = - | { readonly type: "add" } - | { readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ItemCompletedNotification__PatchChangeKind = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), - }).annotate({ title: "AddPatchChangeKind" }), - Schema.Struct({ - type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), - }).annotate({ title: "DeletePatchChangeKind" }), - Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), - }).annotate({ title: "UpdatePatchChangeKind" }), - ], - { mode: "oneOf" }, -); +export type V2ItemCompletedNotification__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ItemCompletedNotification__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ItemCompletedNotification__CollabAgentStatus" }); export type V2ItemCompletedNotification__ReasoningEffort = string; export const V2ItemCompletedNotification__ReasoningEffort = Schema.String.annotate({ description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ItemCompletedNotification__ReasoningEffort", + }), +); + +export type V2ItemCompletedNotification__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2ItemCompletedNotification__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2ItemCompletedNotification__CollabAgentToolCallStatus" }); + +export type V2ItemCompletedNotification__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ItemCompletedNotification__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ItemCompletedNotification__CollabAgentTool" }); export type V2ItemCompletedNotification__SubAgentActivityKind = | "started" @@ -4775,32 +6236,7 @@ export const V2ItemCompletedNotification__SubAgentActivityKind = Schema.Literals "interacted", "interrupted", "completed", -]); - -export type V2ItemCompletedNotification__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; -}; -export const V2ItemCompletedNotification__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); +]).annotate({ identifier: "V2ItemCompletedNotification__SubAgentActivityKind" }); export type V2ItemCompletedNotification__WebSearchAction = | { @@ -4832,33 +6268,109 @@ export const V2ItemCompletedNotification__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ItemCompletedNotification__WebSearchAction" }); + +export type V2ItemCompletedNotification__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ItemCompletedNotification__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemCompletedNotification__ImageGenerationFailure" }); + +export type V2ItemCompletedNotification__AbsolutePathBuf = string; +export const V2ItemCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ItemCompletedNotification__AbsolutePathBuf", +}); + +export type V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString = string; +export const V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString = + Schema.String.annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString", + }); + +export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource = + | "shell" + | "unifiedExec"; +export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource = + Schema.Literals(["shell", "unifiedExec"]).annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource", + }); export type V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf = string; export const V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf", + }); + +export type V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol = + | "http" + | "https" + | "socks5Tcp" + | "socks5Udp"; +export const V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol = + Schema.Literals(["http", "https", "socks5Tcp", "socks5Udp"]).annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol", + }); + +export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode = + | "read" + | "write" + | "deny"; +export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode = + Schema.Literals(["read", "write", "deny"]).annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode", }); export type V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions = { readonly enabled?: boolean | null; }; export const V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions = - Schema.Struct({ enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }); + Schema.Struct({ + enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + }).annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions", + }); export type V2ItemGuardianApprovalReviewCompletedNotification__AutoReviewDecisionSource = "agent"; export const V2ItemGuardianApprovalReviewCompletedNotification__AutoReviewDecisionSource = Schema.Literal("agent").annotate({ description: "[UNSTABLE] Source that produced a terminal approval auto-review decision.", + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__AutoReviewDecisionSource", }); -export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode = - | "read" - | "write" - | "deny"; -export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode = - Schema.Literals(["read", "write", "deny"]); +export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel = + | "low" + | "medium" + | "high" + | "critical"; +export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel = Schema.Literals( + ["low", "medium", "high", "critical"], +).annotate({ + description: "[UNSTABLE] Risk level assigned by approval auto-review.", + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel", +}); export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus = | "inProgress" @@ -4869,23 +6381,9 @@ export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalR export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus = Schema.Literals(["inProgress", "approved", "denied", "timedOut", "aborted"]).annotate({ description: "[UNSTABLE] Lifecycle state for an approval auto-review.", + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus", }); -export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource = - | "shell" - | "unifiedExec"; -export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource = - Schema.Literals(["shell", "unifiedExec"]); - -export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel = - | "low" - | "medium" - | "high" - | "critical"; -export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel = Schema.Literals( - ["low", "medium", "high", "critical"], -).annotate({ description: "[UNSTABLE] Risk level assigned by approval auto-review." }); - export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization = | "unknown" | "low" @@ -4894,55 +6392,59 @@ export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAutho export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization = Schema.Literals(["unknown", "low", "medium", "high"]).annotate({ description: "[UNSTABLE] Authorization level assigned by approval auto-review.", + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization", }); -export type V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString = string; -export const V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString = Schema.String; +export type V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString = string; +export const V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString = + Schema.String.annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString", + }); -export type V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol = - | "http" - | "https" - | "socks5Tcp" - | "socks5Udp"; -export const V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol = - Schema.Literals(["http", "https", "socks5Tcp", "socks5Udp"]); +export type V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource = + | "shell" + | "unifiedExec"; +export const V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource = + Schema.Literals(["shell", "unifiedExec"]).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource", + }); export type V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf = string; export const V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf", }); -export type V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions = { - readonly enabled?: boolean | null; -}; -export const V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions = - Schema.Struct({ enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }); +export type V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol = + | "http" + | "https" + | "socks5Tcp" + | "socks5Udp"; +export const V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol = + Schema.Literals(["http", "https", "socks5Tcp", "socks5Udp"]).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol", + }); export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode = | "read" | "write" | "deny"; export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode = - Schema.Literals(["read", "write", "deny"]); - -export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus = - | "inProgress" - | "approved" - | "denied" - | "timedOut" - | "aborted"; -export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus = - Schema.Literals(["inProgress", "approved", "denied", "timedOut", "aborted"]).annotate({ - description: "[UNSTABLE] Lifecycle state for an approval auto-review.", + Schema.Literals(["read", "write", "deny"]).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode", }); -export type V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource = - | "shell" - | "unifiedExec"; -export const V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource = - Schema.Literals(["shell", "unifiedExec"]); +export type V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions = { + readonly enabled?: boolean | null; +}; +export const V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions = + Schema.Struct({ + enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + }).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions", + }); export type V2ItemGuardianApprovalReviewStartedNotification__GuardianRiskLevel = | "low" @@ -4954,7 +6456,22 @@ export const V2ItemGuardianApprovalReviewStartedNotification__GuardianRiskLevel "medium", "high", "critical", -]).annotate({ description: "[UNSTABLE] Risk level assigned by approval auto-review." }); +]).annotate({ + description: "[UNSTABLE] Risk level assigned by approval auto-review.", + identifier: "V2ItemGuardianApprovalReviewStartedNotification__GuardianRiskLevel", +}); + +export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus = + | "inProgress" + | "approved" + | "denied" + | "timedOut" + | "aborted"; +export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus = + Schema.Literals(["inProgress", "approved", "denied", "timedOut", "aborted"]).annotate({ + description: "[UNSTABLE] Lifecycle state for an approval auto-review.", + identifier: "V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus", + }); export type V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization = | "unknown" @@ -4964,42 +6481,109 @@ export type V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthori export const V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization = Schema.Literals(["unknown", "low", "medium", "high"]).annotate({ description: "[UNSTABLE] Authorization level assigned by approval auto-review.", + identifier: "V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization", }); -export type V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString = string; -export const V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString = Schema.String; +export type V2ItemStartedNotification__ByteRange = { readonly end: number; readonly start: number }; +export const V2ItemStartedNotification__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ItemStartedNotification__ByteRange" }); -export type V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol = - | "http" - | "https" - | "socks5Tcp" - | "socks5Udp"; -export const V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol = - Schema.Literals(["http", "https", "socks5Tcp", "socks5Udp"]); +export type V2ItemStartedNotification__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ItemStartedNotification__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ItemStartedNotification__ImageDetail" }); -export type V2ItemStartedNotification__AbsolutePathBuf = string; -export const V2ItemStartedNotification__AbsolutePathBuf = Schema.String.annotate({ +export type V2ItemStartedNotification__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; +}; +export const V2ItemStartedNotification__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ItemStartedNotification__HookPromptFragment" }); + +export type V2ItemStartedNotification__AgentMessageDelivery = "async"; +export const V2ItemStartedNotification__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ItemStartedNotification__AgentMessageDelivery", +}); + +export type V2ItemStartedNotification__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; +}; +export const V2ItemStartedNotification__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2ItemStartedNotification__MemoryCitationEntry" }); + +export type V2ItemStartedNotification__MessagePhase = "commentary" | "final_answer"; +export const V2ItemStartedNotification__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ItemStartedNotification__MessagePhase", }); -export type V2ItemStartedNotification__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ItemStartedNotification__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +export type V2ItemStartedNotification__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ItemStartedNotification__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ItemStartedNotification__AsyncUserInputQuestion" }); + +export type V2ItemStartedNotification__LegacyAppPathString = string; +export const V2ItemStartedNotification__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ItemStartedNotification__LegacyAppPathString", +}); + +export type V2ItemStartedNotification__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ItemStartedNotification__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ItemStartedNotification__CommandExecutionSource" }); export type V2ItemStartedNotification__CommandExecutionStatus = | "inProgress" @@ -5011,65 +6595,39 @@ export const V2ItemStartedNotification__CommandExecutionStatus = Schema.Literals "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ItemStartedNotification__CommandExecutionStatus" }); -export type V2ItemStartedNotification__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ItemStartedNotification__DynamicToolCallOutputContentItem = Schema.Union( +export type V2ItemStartedNotification__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2ItemStartedNotification__PatchChangeKind = Schema.Union( [ Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ItemStartedNotification__PatchChangeKind" }); -export type V2ItemStartedNotification__DynamicToolCallStatus = +export type V2ItemStartedNotification__PatchApplyStatus = | "inProgress" | "completed" - | "failed"; -export const V2ItemStartedNotification__DynamicToolCallStatus = Schema.Literals([ + | "failed" + | "declined"; +export const V2ItemStartedNotification__PatchApplyStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); - -export type V2ItemStartedNotification__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const V2ItemStartedNotification__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); - -export type V2ItemStartedNotification__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ItemStartedNotification__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); - -export type V2ItemStartedNotification__LegacyAppPathString = string; -export const V2ItemStartedNotification__LegacyAppPathString = Schema.String; + "declined", +]).annotate({ identifier: "V2ItemStartedNotification__PatchApplyStatus" }); export type V2ItemStartedNotification__McpToolCallAppContext = { readonly actionName?: string | null; @@ -5084,93 +6642,136 @@ export const V2ItemStartedNotification__McpToolCallAppContext = Schema.Struct({ connectorId: Schema.String, linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ItemStartedNotification__McpToolCallAppContext" }); export type V2ItemStartedNotification__McpToolCallError = { readonly message: string }; export const V2ItemStartedNotification__McpToolCallError = Schema.Struct({ message: Schema.String, -}); +}).annotate({ identifier: "V2ItemStartedNotification__McpToolCallError" }); + +export type V2ItemStartedNotification__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ItemStartedNotification__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ItemStartedNotification__McpAppDisplayMode" }); export type V2ItemStartedNotification__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; }; export const V2ItemStartedNotification__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ItemStartedNotification__McpToolCallResult" }); export type V2ItemStartedNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; export const V2ItemStartedNotification__McpToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); - -export type V2ItemStartedNotification__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; -}; -export const V2ItemStartedNotification__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, -}); +]).annotate({ identifier: "V2ItemStartedNotification__McpToolCallStatus" }); -export type V2ItemStartedNotification__MessagePhase = "commentary" | "final_answer"; -export const V2ItemStartedNotification__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', -}); +export type V2ItemStartedNotification__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ItemStartedNotification__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemStartedNotification__DynamicToolCallOutputContentItem" }); -export type V2ItemStartedNotification__PatchApplyStatus = +export type V2ItemStartedNotification__DynamicToolCallStatus = | "inProgress" | "completed" - | "failed" - | "declined"; -export const V2ItemStartedNotification__PatchApplyStatus = Schema.Literals([ + | "failed"; +export const V2ItemStartedNotification__DynamicToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", - "declined", -]); +]).annotate({ identifier: "V2ItemStartedNotification__DynamicToolCallStatus" }); -export type V2ItemStartedNotification__PatchChangeKind = - | { readonly type: "add" } - | { readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ItemStartedNotification__PatchChangeKind = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), - }).annotate({ title: "AddPatchChangeKind" }), - Schema.Struct({ - type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), - }).annotate({ title: "DeletePatchChangeKind" }), - Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), - }).annotate({ title: "UpdatePatchChangeKind" }), - ], - { mode: "oneOf" }, -); +export type V2ItemStartedNotification__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ItemStartedNotification__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ItemStartedNotification__CollabAgentStatus" }); export type V2ItemStartedNotification__ReasoningEffort = string; export const V2ItemStartedNotification__ReasoningEffort = Schema.String.annotate({ description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ItemStartedNotification__ReasoningEffort", + }), +); + +export type V2ItemStartedNotification__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2ItemStartedNotification__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2ItemStartedNotification__CollabAgentToolCallStatus" }); + +export type V2ItemStartedNotification__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ItemStartedNotification__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ItemStartedNotification__CollabAgentTool" }); export type V2ItemStartedNotification__SubAgentActivityKind = | "started" @@ -5182,32 +6783,7 @@ export const V2ItemStartedNotification__SubAgentActivityKind = Schema.Literals([ "interacted", "interrupted", "completed", -]); - -export type V2ItemStartedNotification__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; -}; -export const V2ItemStartedNotification__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); +]).annotate({ identifier: "V2ItemStartedNotification__SubAgentActivityKind" }); export type V2ItemStartedNotification__WebSearchAction = | { @@ -5239,48 +6815,85 @@ export const V2ItemStartedNotification__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ItemStartedNotification__WebSearchAction" }); + +export type V2ItemStartedNotification__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ItemStartedNotification__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemStartedNotification__ImageGenerationFailure" }); + +export type V2ItemStartedNotification__AbsolutePathBuf = string; +export const V2ItemStartedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ItemStartedNotification__AbsolutePathBuf", +}); export type V2ListMcpServerStatusParams__McpServerStatusDetail = "full" | "toolsAndAuthOnly"; export const V2ListMcpServerStatusParams__McpServerStatusDetail = Schema.Literals([ "full", "toolsAndAuthOnly", -]); +]).annotate({ identifier: "V2ListMcpServerStatusParams__McpServerStatusDetail" }); export type V2ListMcpServerStatusResponse__McpAuthStatus = + | "unknown" | "unsupported" | "notLoggedIn" | "bearerToken" | "oAuth"; export const V2ListMcpServerStatusResponse__McpAuthStatus = Schema.Literals([ + "unknown", "unsupported", "notLoggedIn", "bearerToken", "oAuth", -]); +]).annotate({ identifier: "V2ListMcpServerStatusResponse__McpAuthStatus" }); -export type V2ListMcpServerStatusResponse__McpServerInfo = { +export type V2ListMcpServerStatusResponse__ResourceTemplate = { + readonly annotations?: Schema.Json; readonly description?: string | null; - readonly icons?: ReadonlyArray | null; + readonly mimeType?: string | null; readonly name: string; readonly title?: string | null; - readonly version: string; - readonly websiteUrl?: string | null; + readonly uriTemplate: string; }; -export const V2ListMcpServerStatusResponse__McpServerInfo = Schema.Struct({ +export const V2ListMcpServerStatusResponse__ResourceTemplate = Schema.Struct({ + annotations: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - icons: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Unknown), Schema.Null])), + mimeType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), name: Schema.String, title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - version: Schema.String, - websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ description: "Presentation metadata advertised by an initialized MCP server." }); + uriTemplate: Schema.String, +}).annotate({ + description: "A template description for resources available on the server.", + identifier: "V2ListMcpServerStatusResponse__ResourceTemplate", +}); export type V2ListMcpServerStatusResponse__Resource = { - readonly _meta?: unknown; - readonly annotations?: unknown; + readonly _meta?: Schema.Json; + readonly annotations?: Schema.Json; readonly description?: string | null; - readonly icons?: ReadonlyArray | null; + readonly icons?: ReadonlyArray | null; readonly mimeType?: string | null; readonly name: string; readonly size?: number | null; @@ -5288,76 +6901,112 @@ export type V2ListMcpServerStatusResponse__Resource = { readonly uri: string; }; export const V2ListMcpServerStatusResponse__Resource = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - annotations: Schema.optionalKey(Schema.Unknown), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + annotations: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - icons: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Unknown), Schema.Null])), + icons: Schema.optionalKey( + Schema.Union([Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), Schema.Null]), + ), mimeType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), name: Schema.String, size: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), uri: Schema.String, -}).annotate({ description: "A known resource that the server is capable of reading." }); +}).annotate({ + description: "A known resource that the server is capable of reading.", + identifier: "V2ListMcpServerStatusResponse__Resource", +}); -export type V2ListMcpServerStatusResponse__ResourceTemplate = { - readonly annotations?: unknown; +export type V2ListMcpServerStatusResponse__McpServerConnectionStatus = + | "notStarted" + | "starting" + | "connected" + | "authenticationRequired" + | "failed" + | "cancelled" + | "disabled"; +export const V2ListMcpServerStatusResponse__McpServerConnectionStatus = Schema.Literals([ + "notStarted", + "starting", + "connected", + "authenticationRequired", + "failed", + "cancelled", + "disabled", +]).annotate({ identifier: "V2ListMcpServerStatusResponse__McpServerConnectionStatus" }); + +export type V2ListMcpServerStatusResponse__McpServerInfo = { readonly description?: string | null; - readonly mimeType?: string | null; + readonly icons?: ReadonlyArray | null; readonly name: string; readonly title?: string | null; - readonly uriTemplate: string; + readonly version: string; + readonly websiteUrl?: string | null; }; -export const V2ListMcpServerStatusResponse__ResourceTemplate = Schema.Struct({ - annotations: Schema.optionalKey(Schema.Unknown), +export const V2ListMcpServerStatusResponse__McpServerInfo = Schema.Struct({ description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - mimeType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icons: Schema.optionalKey( + Schema.Union([Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), Schema.Null]), + ), name: Schema.String, title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - uriTemplate: Schema.String, -}).annotate({ description: "A template description for resources available on the server." }); + version: Schema.String, + websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Presentation metadata advertised by an initialized MCP server.", + identifier: "V2ListMcpServerStatusResponse__McpServerInfo", +}); export type V2ListMcpServerStatusResponse__Tool = { - readonly _meta?: unknown; - readonly annotations?: unknown; + readonly _meta?: Schema.Json; + readonly annotations?: Schema.Json; readonly description?: string | null; - readonly icons?: ReadonlyArray | null; - readonly inputSchema: unknown; + readonly icons?: ReadonlyArray | null; + readonly inputSchema: Schema.Json; readonly name: string; - readonly outputSchema?: unknown; + readonly outputSchema?: Schema.Json; readonly title?: string | null; }; export const V2ListMcpServerStatusResponse__Tool = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - annotations: Schema.optionalKey(Schema.Unknown), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + annotations: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - icons: Schema.optionalKey(Schema.Union([Schema.Array(Schema.Unknown), Schema.Null])), - inputSchema: Schema.Unknown, + icons: Schema.optionalKey( + Schema.Union([Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), Schema.Null]), + ), + inputSchema: Schema.Json.annotate({ expected: "JSON value" }), name: Schema.String, - outputSchema: Schema.optionalKey(Schema.Unknown), + outputSchema: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ description: "Definition for a tool the client can call." }); +}).annotate({ + description: "Definition for a tool the client can call.", + identifier: "V2ListMcpServerStatusResponse__Tool", +}); export type V2LoginAccountParams__LoginAppBrand = "codex" | "chatgpt"; -export const V2LoginAccountParams__LoginAppBrand = Schema.Literals(["codex", "chatgpt"]); +export const V2LoginAccountParams__LoginAppBrand = Schema.Literals(["codex", "chatgpt"]).annotate({ + identifier: "V2LoginAccountParams__LoginAppBrand", +}); export type V2MarketplaceAddResponse__AbsolutePathBuf = string; export const V2MarketplaceAddResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2MarketplaceAddResponse__AbsolutePathBuf", }); export type V2MarketplaceRemoveResponse__AbsolutePathBuf = string; export const V2MarketplaceRemoveResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2MarketplaceUpgradeResponse__AbsolutePathBuf = string; -export const V2MarketplaceUpgradeResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2MarketplaceRemoveResponse__AbsolutePathBuf", }); export type V2MarketplaceUpgradeResponse__MarketplaceUpgradeErrorInfo = { @@ -5367,41 +7016,81 @@ export type V2MarketplaceUpgradeResponse__MarketplaceUpgradeErrorInfo = { export const V2MarketplaceUpgradeResponse__MarketplaceUpgradeErrorInfo = Schema.Struct({ marketplaceName: Schema.String, message: Schema.String, +}).annotate({ identifier: "V2MarketplaceUpgradeResponse__MarketplaceUpgradeErrorInfo" }); + +export type V2MarketplaceUpgradeResponse__AbsolutePathBuf = string; +export const V2MarketplaceUpgradeResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2MarketplaceUpgradeResponse__AbsolutePathBuf", }); +export type V2McpResourceReadParams__McpResourceReadTarget = { + readonly connectorId: string; + readonly linkId: string | null; +}; +export const V2McpResourceReadParams__McpResourceReadTarget = Schema.Struct({ + connectorId: Schema.String, + linkId: Schema.Union([ + Schema.String.annotate({ + description: "Null explicitly requests no-auth access, subject to the app's resource policy.", + }), + Schema.Null, + ]), +}).annotate({ identifier: "V2McpResourceReadParams__McpResourceReadTarget" }); + export type V2McpResourceReadResponse__ResourceContent = | { - readonly _meta?: unknown; + readonly _meta?: Schema.Json; readonly mimeType?: string | null; readonly text: string; readonly uri: string; } | { - readonly _meta?: unknown; + readonly _meta?: Schema.Json; readonly blob: string; readonly mimeType?: string | null; readonly uri: string; }; export const V2McpResourceReadResponse__ResourceContent = Schema.Union([ Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), mimeType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), text: Schema.String, uri: Schema.String.annotate({ description: "The URI of this resource." }), }), Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), blob: Schema.String, mimeType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), uri: Schema.String.annotate({ description: "The URI of this resource." }), }), -]).annotate({ description: "Contents returned when reading a resource from an MCP server." }); +]).annotate({ + description: "Contents returned when reading a resource from an MCP server.", + identifier: "V2McpResourceReadResponse__ResourceContent", +}); + +export type V2McpServerEventStreamNotification__McpServerEventNotification = { + readonly method: string; + readonly params: Schema.Json; +}; +export const V2McpServerEventStreamNotification__McpServerEventNotification = Schema.Struct({ + method: Schema.String, + params: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ identifier: "V2McpServerEventStreamNotification__McpServerEventNotification" }); + +export type V2McpServerOauthLoginParams__McpServerOauthClientRegistration = "auto" | "cimd" | "dcr"; +export const V2McpServerOauthLoginParams__McpServerOauthClientRegistration = Schema.Literals([ + "auto", + "cimd", + "dcr", +]).annotate({ identifier: "V2McpServerOauthLoginParams__McpServerOauthClientRegistration" }); export type V2McpServerStatusUpdatedNotification__McpServerStartupFailureReason = "reauthenticationRequired"; export const V2McpServerStatusUpdatedNotification__McpServerStartupFailureReason = Schema.Literal( "reauthenticationRequired", -); +).annotate({ identifier: "V2McpServerStatusUpdatedNotification__McpServerStartupFailureReason" }); export type V2McpServerStatusUpdatedNotification__McpServerStartupState = | "starting" @@ -5413,17 +7102,56 @@ export const V2McpServerStatusUpdatedNotification__McpServerStartupState = Schem "ready", "failed", "cancelled", -]); +]).annotate({ identifier: "V2McpServerStatusUpdatedNotification__McpServerStartupState" }); + +export type V2ModelListResponse__ModelAvailabilityNux = { readonly message: string }; +export const V2ModelListResponse__ModelAvailabilityNux = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ModelListResponse__ModelAvailabilityNux" }); + +export type V2ModelListResponse__CyberAccessProgram = "standard" | "daybreakBlue" | "daybreakRed"; +export const V2ModelListResponse__CyberAccessProgram = Schema.Literals([ + "standard", + "daybreakBlue", + "daybreakRed", +]).annotate({ + description: + "Requested cyber treatment for a ChatGPT-authenticated Codex turn. Authorization and model-tier restrictions remain server-owned.", + identifier: "V2ModelListResponse__CyberAccessProgram", +}); + +export type V2ModelListResponse__ReasoningEffort = string; +export const V2ModelListResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ModelListResponse__ReasoningEffort", + }), +); export type V2ModelListResponse__InputModality = "text" | "image" | "audio"; -export const V2ModelListResponse__InputModality = Schema.Literals([ - "text", - "image", - "audio", -]).annotate({ description: "Canonical user-input modality tags advertised by a model." }); +export const V2ModelListResponse__InputModality = Schema.Union( + [ + Schema.Literal("text").annotate({ description: "Plain text turns and tool payloads." }), + Schema.Literal("image").annotate({ description: "Image attachments included in user turns." }), + Schema.Literal("audio").annotate({ description: "Audio attachments included in user turns." }), + ], + { mode: "oneOf" }, +).annotate({ + description: "Canonical user-input modality tags advertised by a model.", + identifier: "V2ModelListResponse__InputModality", +}); -export type V2ModelListResponse__ModelAvailabilityNux = { readonly message: string }; -export const V2ModelListResponse__ModelAvailabilityNux = Schema.Struct({ message: Schema.String }); +export type V2ModelListResponse__MultiAgentVersion = "disabled" | "v1" | "v2"; +export const V2ModelListResponse__MultiAgentVersion = Schema.Literals([ + "disabled", + "v1", + "v2", +]).annotate({ + description: "Multi-agent runtime supported by a model.", + identifier: "V2ModelListResponse__MultiAgentVersion", +}); export type V2ModelListResponse__ModelServiceTier = { readonly description: string; @@ -5434,33 +7162,79 @@ export const V2ModelListResponse__ModelServiceTier = Schema.Struct({ description: Schema.String, id: Schema.String, name: Schema.String, -}); +}).annotate({ identifier: "V2ModelListResponse__ModelServiceTier" }); export type V2ModelListResponse__ModelUpgradeInfo = { readonly migrationMarkdown?: string | null; readonly model: string; readonly modelLink?: string | null; + readonly retirementAt?: number | null; readonly upgradeCopy?: string | null; }; export const V2ModelListResponse__ModelUpgradeInfo = Schema.Struct({ migrationMarkdown: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), model: Schema.String, modelLink: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + retirementAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Informational Unix timestamp for this upgrade's scheduled retirement, if known.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), upgradeCopy: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ModelListResponse__ReasoningEffort = string; -export const V2ModelListResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +}).annotate({ identifier: "V2ModelListResponse__ModelUpgradeInfo" }); export type V2ModelReroutedNotification__ModelRerouteReason = "highRiskCyberActivity"; -export const V2ModelReroutedNotification__ModelRerouteReason = - Schema.Literal("highRiskCyberActivity"); +export const V2ModelReroutedNotification__ModelRerouteReason = Schema.Literal( + "highRiskCyberActivity", +).annotate({ identifier: "V2ModelReroutedNotification__ModelRerouteReason" }); export type V2ModelVerificationNotification__ModelVerification = "trustedAccessForCyber"; -export const V2ModelVerificationNotification__ModelVerification = - Schema.Literal("trustedAccessForCyber"); +export const V2ModelVerificationNotification__ModelVerification = Schema.Literal( + "trustedAccessForCyber", +).annotate({ identifier: "V2ModelVerificationNotification__ModelVerification" }); + +export type V2NullableGetAccountRateLimitsParams__GetAccountRateLimitsParams = { + readonly excludeResetCreditDetails?: boolean; + readonly supportsLunaReserve?: boolean; +}; +export const V2NullableGetAccountRateLimitsParams__GetAccountRateLimitsParams = Schema.Struct({ + excludeResetCreditDetails: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Skip the separate reset-credit detail lookup for background usage polls. The usage response still includes the available count; omitted/false preserves detailed reads.", + }), + ), + supportsLunaReserve: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "The client supports automatic Luna Reserve fallback. For eligible ChatGPT CLI users, allow the backend to record experiment exposure after ordinary usage is blocked.", + }), + ), +}).annotate({ + description: + "Usage-read capabilities of the requesting client, never inferred from its experiment arm.", + identifier: "V2NullableGetAccountRateLimitsParams__GetAccountRateLimitsParams", +}); + +export type V2NullableGetAccountTokenUsageParams__GetAccountTokenUsageParams = { + readonly threadId?: string | null; +}; +export const V2NullableGetAccountTokenUsageParams__GetAccountTokenUsageParams = Schema.Struct({ + threadId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "When present, read estimated usage for this thread instead of account-wide token activity.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2NullableGetAccountTokenUsageParams__GetAccountTokenUsageParams" }); export type V2PermissionProfileListResponse__PermissionProfileSummary = { readonly allowed: boolean; @@ -5480,18 +7254,20 @@ export const V2PermissionProfileListResponse__PermissionProfileSummary = Schema. ]), ), id: Schema.String.annotate({ description: "Available permission profile identifier." }), -}); +}).annotate({ identifier: "V2PermissionProfileListResponse__PermissionProfileSummary" }); export type V2PluginInstalledParams__AbsolutePathBuf = string; export const V2PluginInstalledParams__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginInstalledParams__AbsolutePathBuf", }); export type V2PluginInstalledResponse__AbsolutePathBuf = string; export const V2PluginInstalledResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginInstalledResponse__AbsolutePathBuf", }); export type V2PluginInstalledResponse__MarketplaceInterface = { @@ -5499,13 +7275,37 @@ export type V2PluginInstalledResponse__MarketplaceInterface = { }; export const V2PluginInstalledResponse__MarketplaceInterface = Schema.Struct({ displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2PluginInstalledResponse__MarketplaceInterface" }); export type V2PluginInstalledResponse__PluginAuthPolicy = "ON_INSTALL" | "ON_USE"; export const V2PluginInstalledResponse__PluginAuthPolicy = Schema.Literals([ "ON_INSTALL", "ON_USE", -]); +]).annotate({ identifier: "V2PluginInstalledResponse__PluginAuthPolicy" }); + +export type V2PluginInstalledResponse__PluginAvailability = "DISABLED_BY_ADMIN" | "AVAILABLE"; +export const V2PluginInstalledResponse__PluginAvailability = Schema.Union( + [ + Schema.Literal("DISABLED_BY_ADMIN"), + Schema.Literal("AVAILABLE").annotate({ + description: + 'Plugin-service currently sends `"ENABLED"` for available remote plugins. Codex app-server exposes `"AVAILABLE"` in its API; the alias keeps decoding compatible with that upstream response.', + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginInstalledResponse__PluginAvailability" }); + +export type V2PluginInstalledResponse__PluginDisabledReason = + | "disabled_by_admin" + | "plan_not_eligible" + | "required_app_unavailable" + | "unknown"; +export const V2PluginInstalledResponse__PluginDisabledReason = Schema.Literals([ + "disabled_by_admin", + "plan_not_eligible", + "required_app_unavailable", + "unknown", +]).annotate({ identifier: "V2PluginInstalledResponse__PluginDisabledReason" }); export type V2PluginInstalledResponse__PluginInstallPolicy = | "NOT_AVAILABLE" @@ -5515,7 +7315,7 @@ export const V2PluginInstalledResponse__PluginInstallPolicy = Schema.Literals([ "NOT_AVAILABLE", "AVAILABLE", "INSTALLED_BY_DEFAULT", -]); +]).annotate({ identifier: "V2PluginInstalledResponse__PluginInstallPolicy" }); export type V2PluginInstalledResponse__PluginInstallPolicySource = | "WORKSPACE_SETTING" @@ -5523,7 +7323,7 @@ export type V2PluginInstalledResponse__PluginInstallPolicySource = export const V2PluginInstalledResponse__PluginInstallPolicySource = Schema.Literals([ "WORKSPACE_SETTING", "IMPLICIT_CANONICAL_APP", -]); +]).annotate({ identifier: "V2PluginInstalledResponse__PluginInstallPolicySource" }); export type V2PluginInstalledResponse__PluginShareDiscoverability = | "LISTED" @@ -5533,26 +7333,27 @@ export const V2PluginInstalledResponse__PluginShareDiscoverability = Schema.Lite "LISTED", "UNLISTED", "PRIVATE", -]); - -export type V2PluginInstalledResponse__PluginSharePrincipalRole = "reader" | "editor" | "owner"; -export const V2PluginInstalledResponse__PluginSharePrincipalRole = Schema.Literals([ - "reader", - "editor", - "owner", -]); +]).annotate({ identifier: "V2PluginInstalledResponse__PluginShareDiscoverability" }); export type V2PluginInstalledResponse__PluginSharePrincipalType = "user" | "group" | "workspace"; export const V2PluginInstalledResponse__PluginSharePrincipalType = Schema.Literals([ "user", "group", "workspace", -]); +]).annotate({ identifier: "V2PluginInstalledResponse__PluginSharePrincipalType" }); + +export type V2PluginInstalledResponse__PluginSharePrincipalRole = "reader" | "editor" | "owner"; +export const V2PluginInstalledResponse__PluginSharePrincipalRole = Schema.Literals([ + "reader", + "editor", + "owner", +]).annotate({ identifier: "V2PluginInstalledResponse__PluginSharePrincipalRole" }); export type V2PluginInstallParams__AbsolutePathBuf = string; export const V2PluginInstallParams__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginInstallParams__AbsolutePathBuf", }); export type V2PluginInstallResponse__AppSummary = { @@ -5568,15 +7369,22 @@ export const V2PluginInstallResponse__AppSummary = Schema.Struct({ id: Schema.String, installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), name: Schema.String, -}).annotate({ description: "EXPERIMENTAL - app metadata summary for plugin responses." }); +}).annotate({ + description: "EXPERIMENTAL - app metadata summary for plugin responses.", + identifier: "V2PluginInstallResponse__AppSummary", +}); export type V2PluginInstallResponse__PluginAuthPolicy = "ON_INSTALL" | "ON_USE"; -export const V2PluginInstallResponse__PluginAuthPolicy = Schema.Literals(["ON_INSTALL", "ON_USE"]); +export const V2PluginInstallResponse__PluginAuthPolicy = Schema.Literals([ + "ON_INSTALL", + "ON_USE", +]).annotate({ identifier: "V2PluginInstallResponse__PluginAuthPolicy" }); export type V2PluginListParams__AbsolutePathBuf = string; export const V2PluginListParams__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginListParams__AbsolutePathBuf", }); export type V2PluginListParams__PluginListMarketplaceKind = @@ -5591,21 +7399,49 @@ export const V2PluginListParams__PluginListMarketplaceKind = Schema.Literals([ "workspace-directory", "shared-with-me", "created-by-me-remote", -]); +]).annotate({ identifier: "V2PluginListParams__PluginListMarketplaceKind" }); export type V2PluginListResponse__AbsolutePathBuf = string; export const V2PluginListResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginListResponse__AbsolutePathBuf", }); export type V2PluginListResponse__MarketplaceInterface = { readonly displayName?: string | null }; export const V2PluginListResponse__MarketplaceInterface = Schema.Struct({ displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2PluginListResponse__MarketplaceInterface" }); export type V2PluginListResponse__PluginAuthPolicy = "ON_INSTALL" | "ON_USE"; -export const V2PluginListResponse__PluginAuthPolicy = Schema.Literals(["ON_INSTALL", "ON_USE"]); +export const V2PluginListResponse__PluginAuthPolicy = Schema.Literals([ + "ON_INSTALL", + "ON_USE", +]).annotate({ identifier: "V2PluginListResponse__PluginAuthPolicy" }); + +export type V2PluginListResponse__PluginAvailability = "DISABLED_BY_ADMIN" | "AVAILABLE"; +export const V2PluginListResponse__PluginAvailability = Schema.Union( + [ + Schema.Literal("DISABLED_BY_ADMIN"), + Schema.Literal("AVAILABLE").annotate({ + description: + 'Plugin-service currently sends `"ENABLED"` for available remote plugins. Codex app-server exposes `"AVAILABLE"` in its API; the alias keeps decoding compatible with that upstream response.', + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginListResponse__PluginAvailability" }); + +export type V2PluginListResponse__PluginDisabledReason = + | "disabled_by_admin" + | "plan_not_eligible" + | "required_app_unavailable" + | "unknown"; +export const V2PluginListResponse__PluginDisabledReason = Schema.Literals([ + "disabled_by_admin", + "plan_not_eligible", + "required_app_unavailable", + "unknown", +]).annotate({ identifier: "V2PluginListResponse__PluginDisabledReason" }); export type V2PluginListResponse__PluginInstallPolicy = | "NOT_AVAILABLE" @@ -5615,7 +7451,7 @@ export const V2PluginListResponse__PluginInstallPolicy = Schema.Literals([ "NOT_AVAILABLE", "AVAILABLE", "INSTALLED_BY_DEFAULT", -]); +]).annotate({ identifier: "V2PluginListResponse__PluginInstallPolicy" }); export type V2PluginListResponse__PluginInstallPolicySource = | "WORKSPACE_SETTING" @@ -5623,40 +7459,43 @@ export type V2PluginListResponse__PluginInstallPolicySource = export const V2PluginListResponse__PluginInstallPolicySource = Schema.Literals([ "WORKSPACE_SETTING", "IMPLICIT_CANONICAL_APP", -]); +]).annotate({ identifier: "V2PluginListResponse__PluginInstallPolicySource" }); export type V2PluginListResponse__PluginShareDiscoverability = "LISTED" | "UNLISTED" | "PRIVATE"; export const V2PluginListResponse__PluginShareDiscoverability = Schema.Literals([ "LISTED", "UNLISTED", "PRIVATE", -]); - -export type V2PluginListResponse__PluginSharePrincipalRole = "reader" | "editor" | "owner"; -export const V2PluginListResponse__PluginSharePrincipalRole = Schema.Literals([ - "reader", - "editor", - "owner", -]); +]).annotate({ identifier: "V2PluginListResponse__PluginShareDiscoverability" }); export type V2PluginListResponse__PluginSharePrincipalType = "user" | "group" | "workspace"; export const V2PluginListResponse__PluginSharePrincipalType = Schema.Literals([ "user", "group", "workspace", -]); +]).annotate({ identifier: "V2PluginListResponse__PluginSharePrincipalType" }); + +export type V2PluginListResponse__PluginSharePrincipalRole = "reader" | "editor" | "owner"; +export const V2PluginListResponse__PluginSharePrincipalRole = Schema.Literals([ + "reader", + "editor", + "owner", +]).annotate({ identifier: "V2PluginListResponse__PluginSharePrincipalRole" }); export type V2PluginReadParams__AbsolutePathBuf = string; export const V2PluginReadParams__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginReadParams__AbsolutePathBuf", }); -export type V2PluginReadResponse__AbsolutePathBuf = string; -export const V2PluginReadResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +export type V2PluginReadResponse__AppTemplateUnavailableReason = + | "NOT_CONFIGURED_FOR_WORKSPACE" + | "NO_ACTIVE_WORKSPACE"; +export const V2PluginReadResponse__AppTemplateUnavailableReason = Schema.Literals([ + "NOT_CONFIGURED_FOR_WORKSPACE", + "NO_ACTIVE_WORKSPACE", +]).annotate({ identifier: "V2PluginReadResponse__AppTemplateUnavailableReason" }); export type V2PluginReadResponse__AppSummary = { readonly category?: string | null; @@ -5671,15 +7510,10 @@ export const V2PluginReadResponse__AppSummary = Schema.Struct({ id: Schema.String, installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), name: Schema.String, -}).annotate({ description: "EXPERIMENTAL - app metadata summary for plugin responses." }); - -export type V2PluginReadResponse__AppTemplateUnavailableReason = - | "NOT_CONFIGURED_FOR_WORKSPACE" - | "NO_ACTIVE_WORKSPACE"; -export const V2PluginReadResponse__AppTemplateUnavailableReason = Schema.Literals([ - "NOT_CONFIGURED_FOR_WORKSPACE", - "NO_ACTIVE_WORKSPACE", -]); +}).annotate({ + description: "EXPERIMENTAL - app metadata summary for plugin responses.", + identifier: "V2PluginReadResponse__AppSummary", +}); export type V2PluginReadResponse__HookEventName = | "preToolUse" @@ -5692,7 +7526,8 @@ export type V2PluginReadResponse__HookEventName = | "userPromptSubmit" | "subagentStart" | "subagentStop" - | "stop"; + | "stop" + | "interrupt"; export const V2PluginReadResponse__HookEventName = Schema.Literals([ "preToolUse", "permissionRequest", @@ -5705,10 +7540,63 @@ export const V2PluginReadResponse__HookEventName = Schema.Literals([ "subagentStart", "subagentStop", "stop", -]); + "interrupt", +]).annotate({ identifier: "V2PluginReadResponse__HookEventName" }); + +export type V2PluginReadResponse__AbsolutePathBuf = string; +export const V2PluginReadResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginReadResponse__AbsolutePathBuf", +}); + +export type V2PluginReadResponse__ScheduledTaskWeekday = + | "MO" + | "TU" + | "WE" + | "TH" + | "FR" + | "SA" + | "SU"; +export const V2PluginReadResponse__ScheduledTaskWeekday = Schema.Literals([ + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU", +]).annotate({ identifier: "V2PluginReadResponse__ScheduledTaskWeekday" }); export type V2PluginReadResponse__PluginAuthPolicy = "ON_INSTALL" | "ON_USE"; -export const V2PluginReadResponse__PluginAuthPolicy = Schema.Literals(["ON_INSTALL", "ON_USE"]); +export const V2PluginReadResponse__PluginAuthPolicy = Schema.Literals([ + "ON_INSTALL", + "ON_USE", +]).annotate({ identifier: "V2PluginReadResponse__PluginAuthPolicy" }); + +export type V2PluginReadResponse__PluginAvailability = "DISABLED_BY_ADMIN" | "AVAILABLE"; +export const V2PluginReadResponse__PluginAvailability = Schema.Union( + [ + Schema.Literal("DISABLED_BY_ADMIN"), + Schema.Literal("AVAILABLE").annotate({ + description: + 'Plugin-service currently sends `"ENABLED"` for available remote plugins. Codex app-server exposes `"AVAILABLE"` in its API; the alias keeps decoding compatible with that upstream response.', + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginReadResponse__PluginAvailability" }); + +export type V2PluginReadResponse__PluginDisabledReason = + | "disabled_by_admin" + | "plan_not_eligible" + | "required_app_unavailable" + | "unknown"; +export const V2PluginReadResponse__PluginDisabledReason = Schema.Literals([ + "disabled_by_admin", + "plan_not_eligible", + "required_app_unavailable", + "unknown", +]).annotate({ identifier: "V2PluginReadResponse__PluginDisabledReason" }); export type V2PluginReadResponse__PluginInstallPolicy = | "NOT_AVAILABLE" @@ -5718,7 +7606,7 @@ export const V2PluginReadResponse__PluginInstallPolicy = Schema.Literals([ "NOT_AVAILABLE", "AVAILABLE", "INSTALLED_BY_DEFAULT", -]); +]).annotate({ identifier: "V2PluginReadResponse__PluginInstallPolicy" }); export type V2PluginReadResponse__PluginInstallPolicySource = | "WORKSPACE_SETTING" @@ -5726,64 +7614,96 @@ export type V2PluginReadResponse__PluginInstallPolicySource = export const V2PluginReadResponse__PluginInstallPolicySource = Schema.Literals([ "WORKSPACE_SETTING", "IMPLICIT_CANONICAL_APP", -]); +]).annotate({ identifier: "V2PluginReadResponse__PluginInstallPolicySource" }); export type V2PluginReadResponse__PluginShareDiscoverability = "LISTED" | "UNLISTED" | "PRIVATE"; export const V2PluginReadResponse__PluginShareDiscoverability = Schema.Literals([ "LISTED", "UNLISTED", "PRIVATE", -]); - -export type V2PluginReadResponse__PluginSharePrincipalRole = "reader" | "editor" | "owner"; -export const V2PluginReadResponse__PluginSharePrincipalRole = Schema.Literals([ - "reader", - "editor", - "owner", -]); +]).annotate({ identifier: "V2PluginReadResponse__PluginShareDiscoverability" }); export type V2PluginReadResponse__PluginSharePrincipalType = "user" | "group" | "workspace"; export const V2PluginReadResponse__PluginSharePrincipalType = Schema.Literals([ "user", "group", "workspace", -]); +]).annotate({ identifier: "V2PluginReadResponse__PluginSharePrincipalType" }); -export type V2PluginReadResponse__ScheduledTaskWeekday = - | "MO" - | "TU" - | "WE" - | "TH" - | "FR" - | "SA" - | "SU"; -export const V2PluginReadResponse__ScheduledTaskWeekday = Schema.Literals([ - "MO", - "TU", - "WE", - "TH", - "FR", - "SA", - "SU", -]); +export type V2PluginReadResponse__PluginSharePrincipalRole = "reader" | "editor" | "owner"; +export const V2PluginReadResponse__PluginSharePrincipalRole = Schema.Literals([ + "reader", + "editor", + "owner", +]).annotate({ identifier: "V2PluginReadResponse__PluginSharePrincipalRole" }); + +export type V2PluginReconcileResponse__PluginReconcileChangedPlugin = { + readonly hasApps: boolean; + readonly hasHooks: boolean; + readonly hasMcps: boolean; + readonly hasSkills: boolean; + readonly id: string; +}; +export const V2PluginReconcileResponse__PluginReconcileChangedPlugin = Schema.Struct({ + hasApps: Schema.Boolean, + hasHooks: Schema.Boolean, + hasMcps: Schema.Boolean, + hasSkills: Schema.Boolean.annotate({ + description: + "Whether either bundle declares skill roots; not a validated inventory of enabled skills.", + }), + id: Schema.String.annotate({ + description: "Local plugin ID (`name@marketplace`), matching `PluginSummary.id`.", + }), +}).annotate({ + description: + "Runtime categories affected by this change, not just capabilities currently present. Flags describe declarations before runtime policy filtering. Updates OR the old and new bundle flags; enablement changes and cached reinstalls use the cached bundle; removals retain the old bundle's flags.", + identifier: "V2PluginReconcileResponse__PluginReconcileChangedPlugin", +}); export type V2PluginShareCheckoutResponse__AbsolutePathBuf = string; export const V2PluginShareCheckoutResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginShareCheckoutResponse__AbsolutePathBuf", }); export type V2PluginShareListResponse__AbsolutePathBuf = string; export const V2PluginShareListResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginShareListResponse__AbsolutePathBuf", }); export type V2PluginShareListResponse__PluginAuthPolicy = "ON_INSTALL" | "ON_USE"; export const V2PluginShareListResponse__PluginAuthPolicy = Schema.Literals([ "ON_INSTALL", "ON_USE", -]); +]).annotate({ identifier: "V2PluginShareListResponse__PluginAuthPolicy" }); + +export type V2PluginShareListResponse__PluginAvailability = "DISABLED_BY_ADMIN" | "AVAILABLE"; +export const V2PluginShareListResponse__PluginAvailability = Schema.Union( + [ + Schema.Literal("DISABLED_BY_ADMIN"), + Schema.Literal("AVAILABLE").annotate({ + description: + 'Plugin-service currently sends `"ENABLED"` for available remote plugins. Codex app-server exposes `"AVAILABLE"` in its API; the alias keeps decoding compatible with that upstream response.', + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginShareListResponse__PluginAvailability" }); + +export type V2PluginShareListResponse__PluginDisabledReason = + | "disabled_by_admin" + | "plan_not_eligible" + | "required_app_unavailable" + | "unknown"; +export const V2PluginShareListResponse__PluginDisabledReason = Schema.Literals([ + "disabled_by_admin", + "plan_not_eligible", + "required_app_unavailable", + "unknown", +]).annotate({ identifier: "V2PluginShareListResponse__PluginDisabledReason" }); export type V2PluginShareListResponse__PluginInstallPolicy = | "NOT_AVAILABLE" @@ -5793,7 +7713,7 @@ export const V2PluginShareListResponse__PluginInstallPolicy = Schema.Literals([ "NOT_AVAILABLE", "AVAILABLE", "INSTALLED_BY_DEFAULT", -]); +]).annotate({ identifier: "V2PluginShareListResponse__PluginInstallPolicy" }); export type V2PluginShareListResponse__PluginInstallPolicySource = | "WORKSPACE_SETTING" @@ -5801,7 +7721,7 @@ export type V2PluginShareListResponse__PluginInstallPolicySource = export const V2PluginShareListResponse__PluginInstallPolicySource = Schema.Literals([ "WORKSPACE_SETTING", "IMPLICIT_CANONICAL_APP", -]); +]).annotate({ identifier: "V2PluginShareListResponse__PluginInstallPolicySource" }); export type V2PluginShareListResponse__PluginShareDiscoverability = | "LISTED" @@ -5811,44 +7731,58 @@ export const V2PluginShareListResponse__PluginShareDiscoverability = Schema.Lite "LISTED", "UNLISTED", "PRIVATE", -]); - -export type V2PluginShareListResponse__PluginSharePrincipalRole = "reader" | "editor" | "owner"; -export const V2PluginShareListResponse__PluginSharePrincipalRole = Schema.Literals([ - "reader", - "editor", - "owner", -]); +]).annotate({ identifier: "V2PluginShareListResponse__PluginShareDiscoverability" }); export type V2PluginShareListResponse__PluginSharePrincipalType = "user" | "group" | "workspace"; export const V2PluginShareListResponse__PluginSharePrincipalType = Schema.Literals([ "user", "group", "workspace", -]); +]).annotate({ identifier: "V2PluginShareListResponse__PluginSharePrincipalType" }); -export type V2PluginShareSaveParams__AbsolutePathBuf = string; -export const V2PluginShareSaveParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +export type V2PluginShareListResponse__PluginSharePrincipalRole = "reader" | "editor" | "owner"; +export const V2PluginShareListResponse__PluginSharePrincipalRole = Schema.Literals([ + "reader", + "editor", + "owner", +]).annotate({ identifier: "V2PluginShareListResponse__PluginSharePrincipalRole" }); export type V2PluginShareSaveParams__PluginShareDiscoverability = "LISTED" | "UNLISTED" | "PRIVATE"; export const V2PluginShareSaveParams__PluginShareDiscoverability = Schema.Literals([ "LISTED", "UNLISTED", "PRIVATE", -]); +]).annotate({ identifier: "V2PluginShareSaveParams__PluginShareDiscoverability" }); + +export type V2PluginShareSaveParams__AbsolutePathBuf = string; +export const V2PluginShareSaveParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2PluginShareSaveParams__AbsolutePathBuf", +}); export type V2PluginShareSaveParams__PluginSharePrincipalType = "user" | "group" | "workspace"; export const V2PluginShareSaveParams__PluginSharePrincipalType = Schema.Literals([ "user", "group", "workspace", -]); +]).annotate({ identifier: "V2PluginShareSaveParams__PluginSharePrincipalType" }); export type V2PluginShareSaveParams__PluginShareTargetRole = "reader" | "editor"; -export const V2PluginShareSaveParams__PluginShareTargetRole = Schema.Literals(["reader", "editor"]); +export const V2PluginShareSaveParams__PluginShareTargetRole = Schema.Literals([ + "reader", + "editor", +]).annotate({ identifier: "V2PluginShareSaveParams__PluginShareTargetRole" }); + +export type V2PluginShareUpdateTargetsParams__PluginShareUpdateDiscoverability = + | "UNLISTED" + | "PRIVATE" + | "LISTED"; +export const V2PluginShareUpdateTargetsParams__PluginShareUpdateDiscoverability = Schema.Literals([ + "UNLISTED", + "PRIVATE", + "LISTED", +]).annotate({ identifier: "V2PluginShareUpdateTargetsParams__PluginShareUpdateDiscoverability" }); export type V2PluginShareUpdateTargetsParams__PluginSharePrincipalType = | "user" @@ -5858,23 +7792,13 @@ export const V2PluginShareUpdateTargetsParams__PluginSharePrincipalType = Schema "user", "group", "workspace", -]); +]).annotate({ identifier: "V2PluginShareUpdateTargetsParams__PluginSharePrincipalType" }); export type V2PluginShareUpdateTargetsParams__PluginShareTargetRole = "reader" | "editor"; export const V2PluginShareUpdateTargetsParams__PluginShareTargetRole = Schema.Literals([ "reader", "editor", -]); - -export type V2PluginShareUpdateTargetsParams__PluginShareUpdateDiscoverability = - | "UNLISTED" - | "PRIVATE" - | "LISTED"; -export const V2PluginShareUpdateTargetsParams__PluginShareUpdateDiscoverability = Schema.Literals([ - "UNLISTED", - "PRIVATE", - "LISTED", -]); +]).annotate({ identifier: "V2PluginShareUpdateTargetsParams__PluginShareTargetRole" }); export type V2PluginShareUpdateTargetsResponse__PluginShareDiscoverability = | "LISTED" @@ -5884,7 +7808,17 @@ export const V2PluginShareUpdateTargetsResponse__PluginShareDiscoverability = Sc "LISTED", "UNLISTED", "PRIVATE", -]); +]).annotate({ identifier: "V2PluginShareUpdateTargetsResponse__PluginShareDiscoverability" }); + +export type V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType = + | "user" + | "group" + | "workspace"; +export const V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType = Schema.Literals([ + "user", + "group", + "workspace", +]).annotate({ identifier: "V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType" }); export type V2PluginShareUpdateTargetsResponse__PluginSharePrincipalRole = | "reader" @@ -5894,17 +7828,28 @@ export const V2PluginShareUpdateTargetsResponse__PluginSharePrincipalRole = Sche "reader", "editor", "owner", -]); +]).annotate({ identifier: "V2PluginShareUpdateTargetsResponse__PluginSharePrincipalRole" }); -export type V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType = - | "user" - | "group" - | "workspace"; -export const V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType = Schema.Literals([ - "user", - "group", - "workspace", -]); +export type V2ProcessOutputDeltaNotification__ProcessOutputStream = "stdout" | "stderr"; +export const V2ProcessOutputDeltaNotification__ProcessOutputStream = Schema.Union( + [ + Schema.Literal("stdout").annotate({ + description: "stdout stream. PTY mode multiplexes terminal output here.", + }), + Schema.Literal("stderr").annotate({ description: "stderr stream." }), + ], + { mode: "oneOf" }, +).annotate({ + description: "Stream label for `process/outputDelta` notifications.", + identifier: "V2ProcessOutputDeltaNotification__ProcessOutputStream", +}); + +export type V2ProjectChangedNotification__ProjectChangeType = "created" | "updated" | "deleted"; +export const V2ProjectChangedNotification__ProjectChangeType = Schema.Literals([ + "created", + "updated", + "deleted", +]).annotate({ identifier: "V2ProjectChangedNotification__ProjectChangeType" }); export type V2RawResponseCompletedNotification__TokenUsageBreakdown = { readonly cacheWriteInputTokens?: number; @@ -5916,35 +7861,38 @@ export type V2RawResponseCompletedNotification__TokenUsageBreakdown = { }; export const V2RawResponseCompletedNotification__TokenUsageBreakdown = Schema.Struct({ cacheWriteInputTokens: Schema.optionalKey( - Schema.Number.annotate({ default: 0, format: "int64" }).check(Schema.isInt()), + Schema.Number.annotate({ default: 0, format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), ), - cachedInputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - inputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - outputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - reasoningOutputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - totalTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -}); + cachedInputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + inputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + outputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + reasoningOutputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + totalTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +}).annotate({ identifier: "V2RawResponseCompletedNotification__TokenUsageBreakdown" }); -export type V2RawResponseItemCompletedNotification__AgentMessageInputContent = - | { readonly text: string; readonly type: "input_text" } - | { readonly encrypted_content: string; readonly type: "encrypted_content" }; -export const V2RawResponseItemCompletedNotification__AgentMessageInputContent = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ - title: "InputTextAgentMessageInputContentType", - }), - }).annotate({ title: "InputTextAgentMessageInputContent" }), - Schema.Struct({ - encrypted_content: Schema.String, - type: Schema.Literal("encrypted_content").annotate({ - title: "EncryptedContentAgentMessageInputContentType", - }), - }).annotate({ title: "EncryptedContentAgentMessageInputContent" }), - ], - { mode: "oneOf" }, -); +export type V2RawResponseCompletedNotification__ResponseUsageMetadata = { + readonly amount?: string | null; + readonly metadata?: Schema.Json; +}; +export const V2RawResponseCompletedNotification__ResponseUsageMetadata = Schema.Struct({ + amount: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + metadata: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ + description: "Usage metadata reported for one upstream response.", + identifier: "V2RawResponseCompletedNotification__ResponseUsageMetadata", +}); export type V2RawResponseItemCompletedNotification__ImageDetail = | "auto" @@ -5956,7 +7904,7 @@ export const V2RawResponseItemCompletedNotification__ImageDetail = Schema.Litera "low", "high", "original", -]); +]).annotate({ identifier: "V2RawResponseItemCompletedNotification__ImageDetail" }); export type V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough = { readonly turn_id?: string | null; @@ -5967,76 +7915,66 @@ export const V2RawResponseItemCompletedNotification__InternalChatMessageMetadata }).annotate({ description: "Internal Responses API passthrough metadata copied into underlying chat messages.\n\nResponses API strongly types this payload. Do not modify it without first getting API approval and making the corresponding Responses API change.", + identifier: "V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough", }); -export type V2RawResponseItemCompletedNotification__LocalShellAction = { - readonly command: ReadonlyArray; - readonly env?: { readonly [x: string]: string } | null; - readonly timeout_ms?: number | null; - readonly type: "exec"; - readonly user?: string | null; - readonly working_directory?: string | null; -}; -export const V2RawResponseItemCompletedNotification__LocalShellAction = Schema.Union( +export type V2RawResponseItemCompletedNotification__MessagePhase = "commentary" | "final_answer"; +export const V2RawResponseItemCompletedNotification__MessagePhase = Schema.Union( [ - Schema.Struct({ - command: Schema.Array(Schema.String), - env: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - timeout_ms: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - type: Schema.Literal("exec").annotate({ title: "ExecLocalShellActionType" }), - user: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - working_directory: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "ExecLocalShellAction" }), + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), ], { mode: "oneOf" }, -); - -export type V2RawResponseItemCompletedNotification__LocalShellStatus = - | "completed" - | "in_progress" - | "incomplete"; -export const V2RawResponseItemCompletedNotification__LocalShellStatus = Schema.Literals([ - "completed", - "in_progress", - "incomplete", -]); - -export type V2RawResponseItemCompletedNotification__MessagePhase = "commentary" | "final_answer"; -export const V2RawResponseItemCompletedNotification__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2RawResponseItemCompletedNotification__MessagePhase", }); -export type V2RawResponseItemCompletedNotification__ReasoningItemContent = - | { readonly text: string; readonly type: "reasoning_text" } - | { readonly text: string; readonly type: "text" }; -export const V2RawResponseItemCompletedNotification__ReasoningItemContent = Schema.Union( +export type V2RawResponseItemCompletedNotification__AgentMessageInputContent = + | { readonly text: string; readonly type: "input_text" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2RawResponseItemCompletedNotification__AgentMessageInputContent = Schema.Union( [ Schema.Struct({ text: Schema.String, - type: Schema.Literal("reasoning_text").annotate({ - title: "ReasoningTextReasoningItemContentType", + type: Schema.Literal("input_text").annotate({ + title: "InputTextAgentMessageInputContentType", }), - }).annotate({ title: "ReasoningTextReasoningItemContent" }), + }).annotate({ title: "InputTextAgentMessageInputContent" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentAgentMessageInputContentType", + }), + }).annotate({ title: "EncryptedContentAgentMessageInputContent" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2RawResponseItemCompletedNotification__AgentMessageInputContent" }); + +export type V2RawResponseItemCompletedNotification__ReasoningItemContent = + | { readonly text: string; readonly type: "reasoning_text" } + | { readonly text: string; readonly type: "text" }; +export const V2RawResponseItemCompletedNotification__ReasoningItemContent = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("reasoning_text").annotate({ + title: "ReasoningTextReasoningItemContentType", + }), + }).annotate({ title: "ReasoningTextReasoningItemContent" }), Schema.Struct({ text: Schema.String, type: Schema.Literal("text").annotate({ title: "TextReasoningItemContentType" }), }).annotate({ title: "TextReasoningItemContent" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2RawResponseItemCompletedNotification__ReasoningItemContent" }); export type V2RawResponseItemCompletedNotification__ReasoningItemReasoningSummary = { readonly text: string; @@ -6052,7 +7990,52 @@ export const V2RawResponseItemCompletedNotification__ReasoningItemReasoningSumma }).annotate({ title: "SummaryTextReasoningItemReasoningSummary" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2RawResponseItemCompletedNotification__ReasoningItemReasoningSummary" }); + +export type V2RawResponseItemCompletedNotification__LocalShellAction = { + readonly command: ReadonlyArray; + readonly env?: { readonly [x: string]: string } | null; + readonly timeout_ms?: number | null; + readonly type: "exec"; + readonly user?: string | null; + readonly working_directory?: string | null; +}; +export const V2RawResponseItemCompletedNotification__LocalShellAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.Array(Schema.String), + env: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + timeout_ms: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("exec").annotate({ title: "ExecLocalShellActionType" }), + user: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + working_directory: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "ExecLocalShellAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2RawResponseItemCompletedNotification__LocalShellAction" }); + +export type V2RawResponseItemCompletedNotification__LocalShellStatus = + | "completed" + | "in_progress" + | "incomplete"; +export const V2RawResponseItemCompletedNotification__LocalShellStatus = Schema.Literals([ + "completed", + "in_progress", + "incomplete", +]).annotate({ identifier: "V2RawResponseItemCompletedNotification__LocalShellStatus" }); export type V2RawResponseItemCompletedNotification__ResponsesApiWebSearchAction = | { @@ -6092,6 +8075,16 @@ export const V2RawResponseItemCompletedNotification__ResponsesApiWebSearchAction }).annotate({ title: "OtherResponsesApiWebSearchAction" }), ], { mode: "oneOf" }, +).annotate({ identifier: "V2RawResponseItemCompletedNotification__ResponsesApiWebSearchAction" }); + +export type V2RawResponseItemCompletedNotification__ReasoningEffort = string; +export const V2RawResponseItemCompletedNotification__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2RawResponseItemCompletedNotification__ReasoningEffort", + }), ); export type V2RemoteControlStatusChangedNotification__RemoteControlConnectionStatus = @@ -6100,10 +8093,14 @@ export type V2RemoteControlStatusChangedNotification__RemoteControlConnectionSta | "connected" | "errored"; export const V2RemoteControlStatusChangedNotification__RemoteControlConnectionStatus = - Schema.Literals(["disabled", "connecting", "connected", "errored"]); + Schema.Literals(["disabled", "connecting", "connected", "errored"]).annotate({ + identifier: "V2RemoteControlStatusChangedNotification__RemoteControlConnectionStatus", + }); export type V2ReviewStartParams__ReviewDelivery = "inline" | "detached"; -export const V2ReviewStartParams__ReviewDelivery = Schema.Literals(["inline", "detached"]); +export const V2ReviewStartParams__ReviewDelivery = Schema.Literals(["inline", "detached"]).annotate( + { identifier: "V2ReviewStartParams__ReviewDelivery" }, +); export type V2ReviewStartParams__ReviewTarget = | { readonly type: "uncommittedChanges" } @@ -6151,87 +8148,32 @@ export const V2ReviewStartParams__ReviewTarget = Schema.Union( }), ], { mode: "oneOf" }, -); - -export type V2ReviewStartResponse__AbsolutePathBuf = string; -export const V2ReviewStartResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2ReviewStartResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ReviewStartResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); - -export type V2ReviewStartResponse__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2ReviewStartResponse__CommandExecutionStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); +).annotate({ identifier: "V2ReviewStartParams__ReviewTarget" }); -export type V2ReviewStartResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ReviewStartResponse__DynamicToolCallOutputContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), - ], - { mode: "oneOf" }, -); +export type V2ReviewStartResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ReviewStartResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ReviewStartResponse__NonSteerableTurnKind" }); -export type V2ReviewStartResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ReviewStartResponse__DynamicToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ReviewStartResponse__MisalignmentSteer = { readonly message: string }; +export const V2ReviewStartResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ReviewStartResponse__MisalignmentSteer" }); -export type V2ReviewStartResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const V2ReviewStartResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); +export type V2ReviewStartResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ReviewStartResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ReviewStartResponse__ByteRange" }); export type V2ReviewStartResponse__ImageDetail = "auto" | "low" | "high" | "original"; export const V2ReviewStartResponse__ImageDetail = Schema.Literals([ @@ -6239,47 +8181,22 @@ export const V2ReviewStartResponse__ImageDetail = Schema.Literals([ "low", "high", "original", -]); - -export type V2ReviewStartResponse__LegacyAppPathString = string; -export const V2ReviewStartResponse__LegacyAppPathString = Schema.String; +]).annotate({ identifier: "V2ReviewStartResponse__ImageDetail" }); -export type V2ReviewStartResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; +export type V2ReviewStartResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const V2ReviewStartResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ReviewStartResponse__McpToolCallError = { readonly message: string }; -export const V2ReviewStartResponse__McpToolCallError = Schema.Struct({ message: Schema.String }); +export const V2ReviewStartResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ReviewStartResponse__HookPromptFragment" }); -export type V2ReviewStartResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2ReviewStartResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), +export type V2ReviewStartResponse__AgentMessageDelivery = "async"; +export const V2ReviewStartResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ReviewStartResponse__AgentMessageDelivery", }); -export type V2ReviewStartResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ReviewStartResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); - export type V2ReviewStartResponse__MemoryCitationEntry = { readonly lineEnd: number; readonly lineStart: number; @@ -6288,38 +8205,74 @@ export type V2ReviewStartResponse__MemoryCitationEntry = { }; export const V2ReviewStartResponse__MemoryCitationEntry = Schema.Struct({ lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), note: Schema.String, path: Schema.String, -}); +}).annotate({ identifier: "V2ReviewStartResponse__MemoryCitationEntry" }); export type V2ReviewStartResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ReviewStartResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +export const V2ReviewStartResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ReviewStartResponse__MessagePhase", }); -export type V2ReviewStartResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ReviewStartResponse__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); +export type V2ReviewStartResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ReviewStartResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ReviewStartResponse__AsyncUserInputQuestion" }); -export type V2ReviewStartResponse__PatchApplyStatus = +export type V2ReviewStartResponse__LegacyAppPathString = string; +export const V2ReviewStartResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ReviewStartResponse__LegacyAppPathString", +}); + +export type V2ReviewStartResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ReviewStartResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ReviewStartResponse__CommandExecutionSource" }); + +export type V2ReviewStartResponse__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2ReviewStartResponse__PatchApplyStatus = Schema.Literals([ +export const V2ReviewStartResponse__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ReviewStartResponse__CommandExecutionStatus" }); export type V2ReviewStartResponse__PatchChangeKind = | { readonly type: "add" } @@ -6339,12 +8292,160 @@ export const V2ReviewStartResponse__PatchChangeKind = Schema.Union( }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ReviewStartResponse__PatchChangeKind" }); + +export type V2ReviewStartResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ReviewStartResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2ReviewStartResponse__PatchApplyStatus" }); + +export type V2ReviewStartResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; +}; +export const V2ReviewStartResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ReviewStartResponse__McpToolCallAppContext" }); + +export type V2ReviewStartResponse__McpToolCallError = { readonly message: string }; +export const V2ReviewStartResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ReviewStartResponse__McpToolCallError" }); + +export type V2ReviewStartResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ReviewStartResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ReviewStartResponse__McpAppDisplayMode" }); + +export type V2ReviewStartResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ReviewStartResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ReviewStartResponse__McpToolCallResult" }); + +export type V2ReviewStartResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ReviewStartResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ReviewStartResponse__McpToolCallStatus" }); + +export type V2ReviewStartResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ReviewStartResponse__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ReviewStartResponse__DynamicToolCallOutputContentItem" }); + +export type V2ReviewStartResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ReviewStartResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ReviewStartResponse__DynamicToolCallStatus" }); + +export type V2ReviewStartResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ReviewStartResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ReviewStartResponse__CollabAgentStatus" }); export type V2ReviewStartResponse__ReasoningEffort = string; export const V2ReviewStartResponse__ReasoningEffort = Schema.String.annotate({ description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ReviewStartResponse__ReasoningEffort", + }), +); + +export type V2ReviewStartResponse__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2ReviewStartResponse__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2ReviewStartResponse__CollabAgentToolCallStatus" }); + +export type V2ReviewStartResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ReviewStartResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ReviewStartResponse__CollabAgentTool" }); export type V2ReviewStartResponse__SubAgentActivityKind = | "started" @@ -6356,44 +8457,7 @@ export const V2ReviewStartResponse__SubAgentActivityKind = Schema.Literals([ "interacted", "interrupted", "completed", -]); - -export type V2ReviewStartResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; -}; -export const V2ReviewStartResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); - -export type V2ReviewStartResponse__TurnStatus = - | "completed" - | "interrupted" - | "failed" - | "inProgress"; -export const V2ReviewStartResponse__TurnStatus = Schema.Literals([ - "completed", - "interrupted", - "failed", - "inProgress", -]); +]).annotate({ identifier: "V2ReviewStartResponse__SubAgentActivityKind" }); export type V2ReviewStartResponse__WebSearchAction = | { @@ -6425,13 +8489,74 @@ export const V2ReviewStartResponse__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ReviewStartResponse__WebSearchAction" }); + +export type V2ReviewStartResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ReviewStartResponse__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ReviewStartResponse__ImageGenerationFailure" }); + +export type V2ReviewStartResponse__AbsolutePathBuf = string; +export const V2ReviewStartResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ReviewStartResponse__AbsolutePathBuf", +}); + +export type V2ReviewStartResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ReviewStartResponse__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ReviewStartResponse__TurnItemsView" }); + +export type V2ReviewStartResponse__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2ReviewStartResponse__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2ReviewStartResponse__TurnStatus" }); export type V2SendAddCreditsNudgeEmailParams__AddCreditsNudgeCreditType = "credits" | "usage_limit"; export const V2SendAddCreditsNudgeEmailParams__AddCreditsNudgeCreditType = Schema.Literals([ "credits", "usage_limit", -]); +]).annotate({ identifier: "V2SendAddCreditsNudgeEmailParams__AddCreditsNudgeCreditType" }); export type V2SendAddCreditsNudgeEmailResponse__AddCreditsNudgeEmailStatus = | "sent" @@ -6439,30 +8564,28 @@ export type V2SendAddCreditsNudgeEmailResponse__AddCreditsNudgeEmailStatus = export const V2SendAddCreditsNudgeEmailResponse__AddCreditsNudgeEmailStatus = Schema.Literals([ "sent", "cooldown_active", -]); +]).annotate({ identifier: "V2SendAddCreditsNudgeEmailResponse__AddCreditsNudgeEmailStatus" }); export type V2ServerRequestResolvedNotification__RequestId = string | number; export const V2ServerRequestResolvedNotification__RequestId = Schema.Union([ Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -]); + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +]).annotate({ identifier: "V2ServerRequestResolvedNotification__RequestId" }); export type V2SkillsConfigWriteParams__AbsolutePathBuf = string; export const V2SkillsConfigWriteParams__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2SkillsConfigWriteParams__AbsolutePathBuf", }); export type V2SkillsExtraRootsSetParams__AbsolutePathBuf = string; export const V2SkillsExtraRootsSetParams__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2SkillsListResponse__AbsolutePathBuf = string; -export const V2SkillsListResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2SkillsExtraRootsSetParams__AbsolutePathBuf", }); export type V2SkillsListResponse__SkillErrorInfo = { @@ -6472,15 +8595,7 @@ export type V2SkillsListResponse__SkillErrorInfo = { export const V2SkillsListResponse__SkillErrorInfo = Schema.Struct({ message: Schema.String, path: Schema.String, -}); - -export type V2SkillsListResponse__SkillScope = "user" | "repo" | "system" | "admin"; -export const V2SkillsListResponse__SkillScope = Schema.Literals([ - "user", - "repo", - "system", - "admin", -]); +}).annotate({ identifier: "V2SkillsListResponse__SkillErrorInfo" }); export type V2SkillsListResponse__SkillToolDependency = { readonly command?: string | null; @@ -6497,16 +8612,81 @@ export const V2SkillsListResponse__SkillToolDependency = Schema.Struct({ type: Schema.String, url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), value: Schema.String, +}).annotate({ identifier: "V2SkillsListResponse__SkillToolDependency" }); + +export type V2SkillsListResponse__AbsolutePathBuf = string; +export const V2SkillsListResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2SkillsListResponse__AbsolutePathBuf", }); -export type V2ThreadForkParams__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const V2ThreadForkParams__ApprovalsReviewer = Schema.Literals([ +export type V2SkillsListResponse__SkillScope = "user" | "repo" | "system" | "admin"; +export const V2SkillsListResponse__SkillScope = Schema.Literals([ "user", - "auto_review", - "guardian_subagent", + "repo", + "system", + "admin", +]).annotate({ identifier: "V2SkillsListResponse__SkillScope" }); + +export type V2ThreadAttachmentAddResponse__ThreadAttachment = { + readonly attachmentType: string; + readonly createdAt: number; + readonly id: string; + readonly identityKey: string; + readonly payload: Schema.Json; +}; +export const V2ThreadAttachmentAddResponse__ThreadAttachment = Schema.Struct({ + attachmentType: Schema.String, + createdAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + id: Schema.String, + identityKey: Schema.String, + payload: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ + description: "An independently persisted attachment associated with a thread.", + identifier: "V2ThreadAttachmentAddResponse__ThreadAttachment", +}); + +export type V2ThreadAttachmentAddResponse__ThreadAttachmentAddOutcome = "created" | "existing"; +export const V2ThreadAttachmentAddResponse__ThreadAttachmentAddOutcome = Schema.Literals([ + "created", + "existing", ]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + description: "Result of attempting to associate an attachment with a thread.", + identifier: "V2ThreadAttachmentAddResponse__ThreadAttachmentAddOutcome", +}); + +export type V2ThreadAttachmentListResponse__ThreadAttachment = { + readonly attachmentType: string; + readonly createdAt: number; + readonly id: string; + readonly identityKey: string; + readonly payload: Schema.Json; +}; +export const V2ThreadAttachmentListResponse__ThreadAttachment = Schema.Struct({ + attachmentType: Schema.String, + createdAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + id: Schema.String, + identityKey: Schema.String, + payload: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ + description: "An independently persisted attachment associated with a thread.", + identifier: "V2ThreadAttachmentListResponse__ThreadAttachment", +}); + +export type V2ThreadAttachmentUpdatedNotification__ThreadAttachmentOperation = + | "created" + | "deleted"; +export const V2ThreadAttachmentUpdatedNotification__ThreadAttachmentOperation = Schema.Literals([ + "created", + "deleted", +]).annotate({ + description: "The persisted attachment change represented by a notification.", + identifier: "V2ThreadAttachmentUpdatedNotification__ThreadAttachmentOperation", }); export type V2ThreadForkParams__AskForApproval = @@ -6536,7 +8716,18 @@ export const V2ThreadForkParams__AskForApproval = Schema.Union( }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadForkParams__AskForApproval" }); + +export type V2ThreadForkParams__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const V2ThreadForkParams__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2ThreadForkParams__ApprovalsReviewer", +}); export type V2ThreadForkParams__SandboxMode = | "read-only" @@ -6546,20 +8737,13 @@ export const V2ThreadForkParams__SandboxMode = Schema.Literals([ "read-only", "workspace-write", "danger-full-access", -]); +]).annotate({ identifier: "V2ThreadForkParams__SandboxMode" }); export type V2ThreadForkParams__ThreadSource = string; -export const V2ThreadForkParams__ThreadSource = Schema.String; - -export type V2ThreadForkResponse__AbsolutePathBuf = string; -export const V2ThreadForkResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +export const V2ThreadForkParams__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadForkParams__ThreadSource", }); -export type V2ThreadForkResponse__AgentPath = string; -export const V2ThreadForkResponse__AgentPath = Schema.String; - export type V2ThreadForkResponse__AskForApproval = | "untrusted" | "on-request" @@ -6587,72 +8771,46 @@ export const V2ThreadForkResponse__AskForApproval = Schema.Union( }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, -); - -export type V2ThreadForkResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ThreadForkResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +).annotate({ identifier: "V2ThreadForkResponse__AskForApproval" }); -export type V2ThreadForkResponse__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2ThreadForkResponse__CommandExecutionStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); +export type V2ThreadForkResponse__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const V2ThreadForkResponse__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2ThreadForkResponse__ApprovalsReviewer", +}); -export type V2ThreadForkResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadForkResponse__DynamicToolCallOutputContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), - ], - { mode: "oneOf" }, +export type V2ThreadForkResponse__AbsolutePathBuf = string; +export const V2ThreadForkResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadForkResponse__AbsolutePathBuf", +}); + +export type V2ThreadForkResponse__LegacyAppPathString = string; +export const V2ThreadForkResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadForkResponse__LegacyAppPathString", +}); + +export type V2ThreadForkResponse__ReasoningEffort = string; +export const V2ThreadForkResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadForkResponse__ReasoningEffort", + }), ); -export type V2ThreadForkResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadForkResponse__DynamicToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadForkResponse__NetworkAccess = "restricted" | "enabled"; +export const V2ThreadForkResponse__NetworkAccess = Schema.Literals([ + "restricted", + "enabled", +]).annotate({ identifier: "V2ThreadForkResponse__NetworkAccess" }); export type V2ThreadForkResponse__GitInfo = { readonly branch?: string | null; @@ -6663,64 +8821,94 @@ export const V2ThreadForkResponse__GitInfo = Schema.Struct({ branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ThreadForkResponse__GitInfo" }); -export type V2ThreadForkResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; +export type V2ThreadForkResponse__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadForkResponse__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadForkResponse__ThreadHistoryMode" }); + +export type V2ThreadForkResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2ThreadForkResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, +export const V2ThreadForkResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadForkResponse__ThreadSectionAppearance", +}); + +export type V2ThreadForkResponse__AgentPath = string; +export const V2ThreadForkResponse__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadForkResponse__AgentPath", +}); + +export type V2ThreadForkResponse__ThreadId = string; +export const V2ThreadForkResponse__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadForkResponse__ThreadId", +}); + +export type V2ThreadForkResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; +export const V2ThreadForkResponse__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadForkResponse__ThreadActiveFlag" }); + +export type V2ThreadForkResponse__ThreadSource = string; +export const V2ThreadForkResponse__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadForkResponse__ThreadSource", }); +export type V2ThreadForkResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadForkResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadForkResponse__NonSteerableTurnKind" }); + +export type V2ThreadForkResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadForkResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadForkResponse__MisalignmentSteer" }); + +export type V2ThreadForkResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadForkResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadForkResponse__ByteRange" }); + export type V2ThreadForkResponse__ImageDetail = "auto" | "low" | "high" | "original"; export const V2ThreadForkResponse__ImageDetail = Schema.Literals([ "auto", "low", "high", "original", -]); +]).annotate({ identifier: "V2ThreadForkResponse__ImageDetail" }); -export type V2ThreadForkResponse__LegacyAppPathString = string; -export const V2ThreadForkResponse__LegacyAppPathString = Schema.String; - -export type V2ThreadForkResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; +export type V2ThreadForkResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const V2ThreadForkResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ThreadForkResponse__McpToolCallError = { readonly message: string }; -export const V2ThreadForkResponse__McpToolCallError = Schema.Struct({ message: Schema.String }); +export const V2ThreadForkResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadForkResponse__HookPromptFragment" }); -export type V2ThreadForkResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2ThreadForkResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), +export type V2ThreadForkResponse__AgentMessageDelivery = "async"; +export const V2ThreadForkResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadForkResponse__AgentMessageDelivery", }); -export type V2ThreadForkResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadForkResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); - export type V2ThreadForkResponse__MemoryCitationEntry = { readonly lineEnd: number; readonly lineStart: number; @@ -6729,38 +8917,69 @@ export type V2ThreadForkResponse__MemoryCitationEntry = { }; export const V2ThreadForkResponse__MemoryCitationEntry = Schema.Struct({ lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), note: Schema.String, path: Schema.String, -}); +}).annotate({ identifier: "V2ThreadForkResponse__MemoryCitationEntry" }); export type V2ThreadForkResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadForkResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +export const V2ThreadForkResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadForkResponse__MessagePhase", }); -export type V2ThreadForkResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadForkResponse__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); +export type V2ThreadForkResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ThreadForkResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadForkResponse__AsyncUserInputQuestion" }); -export type V2ThreadForkResponse__PatchApplyStatus = +export type V2ThreadForkResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadForkResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadForkResponse__CommandExecutionSource" }); + +export type V2ThreadForkResponse__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2ThreadForkResponse__PatchApplyStatus = Schema.Literals([ +export const V2ThreadForkResponse__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ThreadForkResponse__CommandExecutionStatus" }); export type V2ThreadForkResponse__PatchChangeKind = | { readonly type: "add" } @@ -6780,73 +8999,162 @@ export const V2ThreadForkResponse__PatchChangeKind = Schema.Union( }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); - -export type V2ThreadForkResponse__ReasoningEffort = string; -export const V2ThreadForkResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +).annotate({ identifier: "V2ThreadForkResponse__PatchChangeKind" }); -export type V2ThreadForkResponse__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2ThreadForkResponse__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", +export type V2ThreadForkResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadForkResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", "completed", -]); + "failed", + "declined", +]).annotate({ identifier: "V2ThreadForkResponse__PatchApplyStatus" }); -export type V2ThreadForkResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadForkResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const V2ThreadForkResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); +export const V2ThreadForkResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadForkResponse__McpToolCallAppContext" }); -export type V2ThreadForkResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; -export const V2ThreadForkResponse__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); +export type V2ThreadForkResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadForkResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadForkResponse__McpToolCallError" }); -export type V2ThreadForkResponse__ThreadId = string; -export const V2ThreadForkResponse__ThreadId = Schema.String; +export type V2ThreadForkResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadForkResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadForkResponse__McpAppDisplayMode" }); -export type V2ThreadForkResponse__ThreadSource = string; -export const V2ThreadForkResponse__ThreadSource = Schema.String; +export type V2ThreadForkResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadForkResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadForkResponse__McpToolCallResult" }); -export type V2ThreadForkResponse__TurnStatus = - | "completed" +export type V2ThreadForkResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadForkResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadForkResponse__McpToolCallStatus" }); + +export type V2ThreadForkResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadForkResponse__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__DynamicToolCallOutputContentItem" }); + +export type V2ThreadForkResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadForkResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadForkResponse__DynamicToolCallStatus" }); + +export type V2ThreadForkResponse__CollabAgentStatus = + | "pendingInit" + | "running" | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadForkResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadForkResponse__CollabAgentStatus" }); + +export type V2ThreadForkResponse__CollabAgentToolCallStatus = + | "inProgress" + | "completed" | "failed" - | "inProgress"; -export const V2ThreadForkResponse__TurnStatus = Schema.Literals([ + | "interrupted"; +export const V2ThreadForkResponse__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", "completed", - "interrupted", "failed", - "inProgress", -]); + "interrupted", +]).annotate({ identifier: "V2ThreadForkResponse__CollabAgentToolCallStatus" }); + +export type V2ThreadForkResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadForkResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadForkResponse__CollabAgentTool" }); + +export type V2ThreadForkResponse__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2ThreadForkResponse__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2ThreadForkResponse__SubAgentActivityKind" }); export type V2ThreadForkResponse__WebSearchAction = | { @@ -6878,7 +9186,61 @@ export const V2ThreadForkResponse__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadForkResponse__WebSearchAction" }); + +export type V2ThreadForkResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ThreadForkResponse__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__ImageGenerationFailure" }); + +export type V2ThreadForkResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadForkResponse__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__TurnItemsView" }); + +export type V2ThreadForkResponse__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadForkResponse__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2ThreadForkResponse__TurnStatus" }); export type V2ThreadGoalGetResponse__ThreadGoalStatus = | "active" @@ -6894,7 +9256,7 @@ export const V2ThreadGoalGetResponse__ThreadGoalStatus = Schema.Literals([ "usageLimited", "budgetLimited", "complete", -]); +]).annotate({ identifier: "V2ThreadGoalGetResponse__ThreadGoalStatus" }); export type V2ThreadGoalSetParams__ThreadGoalStatus = | "active" @@ -6910,7 +9272,7 @@ export const V2ThreadGoalSetParams__ThreadGoalStatus = Schema.Literals([ "usageLimited", "budgetLimited", "complete", -]); +]).annotate({ identifier: "V2ThreadGoalSetParams__ThreadGoalStatus" }); export type V2ThreadGoalSetResponse__ThreadGoalStatus = | "active" @@ -6926,7 +9288,7 @@ export const V2ThreadGoalSetResponse__ThreadGoalStatus = Schema.Literals([ "usageLimited", "budgetLimited", "complete", -]); +]).annotate({ identifier: "V2ThreadGoalSetResponse__ThreadGoalStatus" }); export type V2ThreadGoalUpdatedNotification__ThreadGoalStatus = | "active" @@ -6942,317 +9304,332 @@ export const V2ThreadGoalUpdatedNotification__ThreadGoalStatus = Schema.Literals "usageLimited", "budgetLimited", "complete", -]); +]).annotate({ identifier: "V2ThreadGoalUpdatedNotification__ThreadGoalStatus" }); -export type V2ThreadListParams__SortDirection = "asc" | "desc"; -export const V2ThreadListParams__SortDirection = Schema.Literals(["asc", "desc"]); +export type V2ThreadItemsListParams__ThreadItemsListAnchor = { + readonly itemId: string; + readonly type: "item"; +}; +export const V2ThreadItemsListParams__ThreadItemsListAnchor = Schema.Union( + [ + Schema.Struct({ + itemId: Schema.String, + type: Schema.Literal("item").annotate({ title: "ItemThreadItemsListAnchorType" }), + }).annotate({ title: "ItemThreadItemsListAnchor" }), + ], + { mode: "oneOf" }, +).annotate({ + description: "An exclusive item position within the requested visible turn.", + identifier: "V2ThreadItemsListParams__ThreadItemsListAnchor", +}); -export type V2ThreadListParams__ThreadListCwdFilter = string | ReadonlyArray; -export const V2ThreadListParams__ThreadListCwdFilter = Schema.Union([ - Schema.String, - Schema.Array(Schema.String), -]); +export type V2ThreadItemsListParams__SortDirection = "asc" | "desc"; +export const V2ThreadItemsListParams__SortDirection = Schema.Literals(["asc", "desc"]).annotate({ + identifier: "V2ThreadItemsListParams__SortDirection", +}); -export type V2ThreadListParams__ThreadSortKey = "created_at" | "updated_at" | "recency_at"; -export const V2ThreadListParams__ThreadSortKey = Schema.Literals([ - "created_at", - "updated_at", - "recency_at", -]); +export type V2ThreadItemsListResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadItemsListResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadItemsListResponse__ByteRange" }); -export type V2ThreadListParams__ThreadSourceKind = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "subAgent" - | "subAgentReview" - | "subAgentCompact" - | "subAgentThreadSpawn" - | "subAgentOther" - | "unknown"; -export const V2ThreadListParams__ThreadSourceKind = Schema.Literals([ - "cli", - "vscode", - "exec", - "appServer", - "subAgent", - "subAgentReview", - "subAgentCompact", - "subAgentThreadSpawn", - "subAgentOther", - "unknown", -]); +export type V2ThreadItemsListResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadItemsListResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadItemsListResponse__ImageDetail" }); -export type V2ThreadListResponse__AbsolutePathBuf = string; -export const V2ThreadListResponse__AbsolutePathBuf = Schema.String.annotate({ +export type V2ThreadItemsListResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; +}; +export const V2ThreadItemsListResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadItemsListResponse__HookPromptFragment" }); + +export type V2ThreadItemsListResponse__AgentMessageDelivery = "async"; +export const V2ThreadItemsListResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadItemsListResponse__AgentMessageDelivery", +}); + +export type V2ThreadItemsListResponse__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; +}; +export const V2ThreadItemsListResponse__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2ThreadItemsListResponse__MemoryCitationEntry" }); + +export type V2ThreadItemsListResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadItemsListResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadItemsListResponse__MessagePhase", }); -export type V2ThreadListResponse__AgentPath = string; -export const V2ThreadListResponse__AgentPath = Schema.String; +export type V2ThreadItemsListResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ThreadItemsListResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadItemsListResponse__AsyncUserInputQuestion" }); -export type V2ThreadListResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ThreadListResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +export type V2ThreadItemsListResponse__LegacyAppPathString = string; +export const V2ThreadItemsListResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadItemsListResponse__LegacyAppPathString", +}); -export type V2ThreadListResponse__CommandExecutionStatus = +export type V2ThreadItemsListResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadItemsListResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadItemsListResponse__CommandExecutionSource" }); + +export type V2ThreadItemsListResponse__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2ThreadListResponse__CommandExecutionStatus = Schema.Literals([ +export const V2ThreadItemsListResponse__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ThreadItemsListResponse__CommandExecutionStatus" }); -export type V2ThreadListResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadListResponse__DynamicToolCallOutputContentItem = Schema.Union( +export type V2ThreadItemsListResponse__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2ThreadItemsListResponse__PatchChangeKind = Schema.Union( [ Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadItemsListResponse__PatchChangeKind" }); -export type V2ThreadListResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadListResponse__DynamicToolCallStatus = Schema.Literals([ +export type V2ThreadItemsListResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadItemsListResponse__PatchApplyStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); - -export type V2ThreadListResponse__GitInfo = { - readonly branch?: string | null; - readonly originUrl?: string | null; - readonly sha?: string | null; -}; -export const V2ThreadListResponse__GitInfo = Schema.Struct({ - branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ThreadListResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const V2ThreadListResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); - -export type V2ThreadListResponse__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadListResponse__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); - -export type V2ThreadListResponse__LegacyAppPathString = string; -export const V2ThreadListResponse__LegacyAppPathString = Schema.String; + "declined", +]).annotate({ identifier: "V2ThreadItemsListResponse__PatchApplyStatus" }); -export type V2ThreadListResponse__McpToolCallAppContext = { +export type V2ThreadItemsListResponse__McpToolCallAppContext = { readonly actionName?: string | null; readonly appName?: string | null; readonly connectorId: string; readonly linkId?: string | null; readonly resourceUri?: string | null; }; -export const V2ThreadListResponse__McpToolCallAppContext = Schema.Struct({ +export const V2ThreadItemsListResponse__McpToolCallAppContext = Schema.Struct({ actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), connectorId: Schema.String, linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ThreadItemsListResponse__McpToolCallAppContext" }); -export type V2ThreadListResponse__McpToolCallError = { readonly message: string }; -export const V2ThreadListResponse__McpToolCallError = Schema.Struct({ message: Schema.String }); +export type V2ThreadItemsListResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadItemsListResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadItemsListResponse__McpToolCallError" }); + +export type V2ThreadItemsListResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadItemsListResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadItemsListResponse__McpAppDisplayMode" }); + +export type V2ThreadItemsListResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadItemsListResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadItemsListResponse__McpToolCallResult" }); + +export type V2ThreadItemsListResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadItemsListResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadItemsListResponse__McpToolCallStatus" }); -export type V2ThreadListResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2ThreadListResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); +export type V2ThreadItemsListResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadItemsListResponse__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadItemsListResponse__DynamicToolCallOutputContentItem" }); -export type V2ThreadListResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadListResponse__McpToolCallStatus = Schema.Literals([ +export type V2ThreadItemsListResponse__DynamicToolCallStatus = + | "inProgress" + | "completed" + | "failed"; +export const V2ThreadItemsListResponse__DynamicToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); - -export type V2ThreadListResponse__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; -}; -export const V2ThreadListResponse__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, -}); +]).annotate({ identifier: "V2ThreadItemsListResponse__DynamicToolCallStatus" }); -export type V2ThreadListResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadListResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', -}); +export type V2ThreadItemsListResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadItemsListResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadItemsListResponse__CollabAgentStatus" }); -export type V2ThreadListResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadListResponse__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); +export type V2ThreadItemsListResponse__ReasoningEffort = string; +export const V2ThreadItemsListResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadItemsListResponse__ReasoningEffort", + }), +); -export type V2ThreadListResponse__PatchApplyStatus = +export type V2ThreadItemsListResponse__CollabAgentToolCallStatus = | "inProgress" | "completed" | "failed" - | "declined"; -export const V2ThreadListResponse__PatchApplyStatus = Schema.Literals([ + | "interrupted"; +export const V2ThreadItemsListResponse__CollabAgentToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", - "declined", -]); - -export type V2ThreadListResponse__PatchChangeKind = - | { readonly type: "add" } - | { readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ThreadListResponse__PatchChangeKind = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), - }).annotate({ title: "AddPatchChangeKind" }), - Schema.Struct({ - type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), - }).annotate({ title: "DeletePatchChangeKind" }), - Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), - }).annotate({ title: "UpdatePatchChangeKind" }), - ], - { mode: "oneOf" }, -); + "interrupted", +]).annotate({ identifier: "V2ThreadItemsListResponse__CollabAgentToolCallStatus" }); -export type V2ThreadListResponse__ReasoningEffort = string; -export const V2ThreadListResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +export type V2ThreadItemsListResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadItemsListResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadItemsListResponse__CollabAgentTool" }); -export type V2ThreadListResponse__SubAgentActivityKind = +export type V2ThreadItemsListResponse__SubAgentActivityKind = | "started" | "interacted" | "interrupted" | "completed"; -export const V2ThreadListResponse__SubAgentActivityKind = Schema.Literals([ +export const V2ThreadItemsListResponse__SubAgentActivityKind = Schema.Literals([ "started", "interacted", "interrupted", "completed", -]); - -export type V2ThreadListResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; -}; -export const V2ThreadListResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); - -export type V2ThreadListResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; -export const V2ThreadListResponse__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); - -export type V2ThreadListResponse__ThreadId = string; -export const V2ThreadListResponse__ThreadId = Schema.String; - -export type V2ThreadListResponse__ThreadSource = string; -export const V2ThreadListResponse__ThreadSource = Schema.String; - -export type V2ThreadListResponse__TurnStatus = - | "completed" - | "interrupted" - | "failed" - | "inProgress"; -export const V2ThreadListResponse__TurnStatus = Schema.Literals([ - "completed", - "interrupted", - "failed", - "inProgress", -]); +]).annotate({ identifier: "V2ThreadItemsListResponse__SubAgentActivityKind" }); -export type V2ThreadListResponse__WebSearchAction = +export type V2ThreadItemsListResponse__WebSearchAction = | { readonly queries?: ReadonlyArray | null; readonly query?: string | null; @@ -7261,7 +9638,7 @@ export type V2ThreadListResponse__WebSearchAction = | { readonly type: "openPage"; readonly url?: string | null } | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } | { readonly type: "other" }; -export const V2ThreadListResponse__WebSearchAction = Schema.Union( +export const V2ThreadItemsListResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), @@ -7282,241 +9659,283 @@ export const V2ThreadListResponse__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadItemsListResponse__WebSearchAction" }); -export type V2ThreadMetadataUpdateParams__ThreadMetadataGitInfoUpdateParams = { - readonly branch?: string | null; - readonly originUrl?: string | null; - readonly sha?: string | null; +export type V2ThreadItemsListResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; }; -export const V2ThreadMetadataUpdateParams__ThreadMetadataGitInfoUpdateParams = Schema.Struct({ - branch: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", - }), - Schema.Null, - ]), - ), - originUrl: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", - }), - Schema.Null, - ]), - ), - sha: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", +export const V2ThreadItemsListResponse__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", }), - Schema.Null, - ]), - ), -}); + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadItemsListResponse__ImageGenerationFailure" }); -export type V2ThreadMetadataUpdateResponse__AbsolutePathBuf = string; -export const V2ThreadMetadataUpdateResponse__AbsolutePathBuf = Schema.String.annotate({ +export type V2ThreadItemsListResponse__AbsolutePathBuf = string; +export const V2ThreadItemsListResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadItemsListResponse__AbsolutePathBuf", }); -export type V2ThreadMetadataUpdateResponse__AgentPath = string; -export const V2ThreadMetadataUpdateResponse__AgentPath = Schema.String; +export type V2ThreadListParams__ThreadListCwdFilter = string | ReadonlyArray; +export const V2ThreadListParams__ThreadListCwdFilter = Schema.Union([ + Schema.String, + Schema.Array(Schema.String), +]).annotate({ identifier: "V2ThreadListParams__ThreadListCwdFilter" }); -export type V2ThreadMetadataUpdateResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ThreadMetadataUpdateResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +export type V2ThreadListParams__SortDirection = "asc" | "desc"; +export const V2ThreadListParams__SortDirection = Schema.Literals(["asc", "desc"]).annotate({ + identifier: "V2ThreadListParams__SortDirection", +}); -export type V2ThreadMetadataUpdateResponse__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2ThreadMetadataUpdateResponse__CommandExecutionStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); +export type V2ThreadListParams__ThreadSortKey = + | "created_at" + | "updated_at" + | "recency_at" + | "section_position"; +export const V2ThreadListParams__ThreadSortKey = Schema.Literals([ + "created_at", + "updated_at", + "recency_at", + "section_position", +]).annotate({ identifier: "V2ThreadListParams__ThreadSortKey" }); -export type V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), - ], - { mode: "oneOf" }, -); +export type V2ThreadListParams__ThreadSourceKind = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "subAgent" + | "subAgentReview" + | "subAgentCompact" + | "subAgentThreadSpawn" + | "subAgentOther" + | "unknown"; +export const V2ThreadListParams__ThreadSourceKind = Schema.Literals([ + "cli", + "vscode", + "exec", + "appServer", + "subAgent", + "subAgentReview", + "subAgentCompact", + "subAgentThreadSpawn", + "subAgentOther", + "unknown", +]).annotate({ identifier: "V2ThreadListParams__ThreadSourceKind" }); -export type V2ThreadMetadataUpdateResponse__DynamicToolCallStatus = - | "inProgress" - | "completed" - | "failed"; -export const V2ThreadMetadataUpdateResponse__DynamicToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadListResponse__AbsolutePathBuf = string; +export const V2ThreadListResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadListResponse__AbsolutePathBuf", +}); -export type V2ThreadMetadataUpdateResponse__GitInfo = { +export type V2ThreadListResponse__GitInfo = { readonly branch?: string | null; readonly originUrl?: string | null; readonly sha?: string | null; }; -export const V2ThreadMetadataUpdateResponse__GitInfo = Schema.Struct({ +export const V2ThreadListResponse__GitInfo = Schema.Struct({ branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ThreadListResponse__GitInfo" }); -export type V2ThreadMetadataUpdateResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; +export type V2ThreadListResponse__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadListResponse__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadListResponse__ThreadHistoryMode" }); + +export type V2ThreadListResponse__ReasoningEffort = string; +export const V2ThreadListResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadListResponse__ReasoningEffort", + }), +); + +export type V2ThreadListResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2ThreadMetadataUpdateResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, +export const V2ThreadListResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadListResponse__ThreadSectionAppearance", }); -export type V2ThreadMetadataUpdateResponse__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadMetadataUpdateResponse__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); +export type V2ThreadListResponse__AgentPath = string; +export const V2ThreadListResponse__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadListResponse__AgentPath", +}); -export type V2ThreadMetadataUpdateResponse__LegacyAppPathString = string; -export const V2ThreadMetadataUpdateResponse__LegacyAppPathString = Schema.String; +export type V2ThreadListResponse__ThreadId = string; +export const V2ThreadListResponse__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadListResponse__ThreadId", +}); -export type V2ThreadMetadataUpdateResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; -}; -export const V2ThreadMetadataUpdateResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export type V2ThreadListResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; +export const V2ThreadListResponse__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadListResponse__ThreadActiveFlag" }); + +export type V2ThreadListResponse__ThreadSource = string; +export const V2ThreadListResponse__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadListResponse__ThreadSource", }); -export type V2ThreadMetadataUpdateResponse__McpToolCallError = { readonly message: string }; -export const V2ThreadMetadataUpdateResponse__McpToolCallError = Schema.Struct({ +export type V2ThreadListResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadListResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadListResponse__NonSteerableTurnKind" }); + +export type V2ThreadListResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadListResponse__MisalignmentSteer = Schema.Struct({ message: Schema.String, -}); +}).annotate({ identifier: "V2ThreadListResponse__MisalignmentSteer" }); -export type V2ThreadMetadataUpdateResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; +export type V2ThreadListResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadListResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadListResponse__ByteRange" }); + +export type V2ThreadListResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadListResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadListResponse__ImageDetail" }); + +export type V2ThreadListResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const V2ThreadMetadataUpdateResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); +export const V2ThreadListResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadListResponse__HookPromptFragment" }); -export type V2ThreadMetadataUpdateResponse__McpToolCallStatus = - | "inProgress" - | "completed" - | "failed"; -export const V2ThreadMetadataUpdateResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadListResponse__AgentMessageDelivery = "async"; +export const V2ThreadListResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadListResponse__AgentMessageDelivery", +}); -export type V2ThreadMetadataUpdateResponse__MemoryCitationEntry = { +export type V2ThreadListResponse__MemoryCitationEntry = { readonly lineEnd: number; readonly lineStart: number; readonly note: string; readonly path: string; }; -export const V2ThreadMetadataUpdateResponse__MemoryCitationEntry = Schema.Struct({ +export const V2ThreadListResponse__MemoryCitationEntry = Schema.Struct({ lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), note: Schema.String, path: Schema.String, -}); +}).annotate({ identifier: "V2ThreadListResponse__MemoryCitationEntry" }); -export type V2ThreadMetadataUpdateResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadMetadataUpdateResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +export type V2ThreadListResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadListResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadListResponse__MessagePhase", }); -export type V2ThreadMetadataUpdateResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadMetadataUpdateResponse__NonSteerableTurnKind = Schema.Literals([ - "review", - "compact", -]); +export type V2ThreadListResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ThreadListResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadListResponse__AsyncUserInputQuestion" }); -export type V2ThreadMetadataUpdateResponse__PatchApplyStatus = +export type V2ThreadListResponse__LegacyAppPathString = string; +export const V2ThreadListResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadListResponse__LegacyAppPathString", +}); + +export type V2ThreadListResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadListResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadListResponse__CommandExecutionSource" }); + +export type V2ThreadListResponse__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2ThreadMetadataUpdateResponse__PatchApplyStatus = Schema.Literals([ +export const V2ThreadListResponse__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ThreadListResponse__CommandExecutionStatus" }); -export type V2ThreadMetadataUpdateResponse__PatchChangeKind = +export type V2ThreadListResponse__PatchChangeKind = | { readonly type: "add" } | { readonly type: "delete" } | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ThreadMetadataUpdateResponse__PatchChangeKind = Schema.Union( +export const V2ThreadListResponse__PatchChangeKind = Schema.Union( [ Schema.Struct({ type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), @@ -7530,77 +9949,164 @@ export const V2ThreadMetadataUpdateResponse__PatchChangeKind = Schema.Union( }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); - -export type V2ThreadMetadataUpdateResponse__ReasoningEffort = string; -export const V2ThreadMetadataUpdateResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +).annotate({ identifier: "V2ThreadListResponse__PatchChangeKind" }); -export type V2ThreadMetadataUpdateResponse__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2ThreadMetadataUpdateResponse__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", +export type V2ThreadListResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadListResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", "completed", -]); + "failed", + "declined", +]).annotate({ identifier: "V2ThreadListResponse__PatchApplyStatus" }); -export type V2ThreadMetadataUpdateResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadListResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const V2ThreadMetadataUpdateResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); +export const V2ThreadListResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadListResponse__McpToolCallAppContext" }); -export type V2ThreadMetadataUpdateResponse__ThreadActiveFlag = - | "waitingOnApproval" - | "waitingOnUserInput"; -export const V2ThreadMetadataUpdateResponse__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); +export type V2ThreadListResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadListResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadListResponse__McpToolCallError" }); -export type V2ThreadMetadataUpdateResponse__ThreadId = string; -export const V2ThreadMetadataUpdateResponse__ThreadId = Schema.String; +export type V2ThreadListResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadListResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadListResponse__McpAppDisplayMode" }); -export type V2ThreadMetadataUpdateResponse__ThreadSource = string; -export const V2ThreadMetadataUpdateResponse__ThreadSource = Schema.String; +export type V2ThreadListResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadListResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadListResponse__McpToolCallResult" }); -export type V2ThreadMetadataUpdateResponse__TurnStatus = - | "completed" +export type V2ThreadListResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadListResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadListResponse__McpToolCallStatus" }); + +export type V2ThreadListResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadListResponse__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadListResponse__DynamicToolCallOutputContentItem" }); + +export type V2ThreadListResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadListResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadListResponse__DynamicToolCallStatus" }); + +export type V2ThreadListResponse__CollabAgentStatus = + | "pendingInit" + | "running" | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadListResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadListResponse__CollabAgentStatus" }); + +export type V2ThreadListResponse__CollabAgentToolCallStatus = + | "inProgress" + | "completed" | "failed" - | "inProgress"; -export const V2ThreadMetadataUpdateResponse__TurnStatus = Schema.Literals([ + | "interrupted"; +export const V2ThreadListResponse__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", "completed", - "interrupted", "failed", - "inProgress", -]); + "interrupted", +]).annotate({ identifier: "V2ThreadListResponse__CollabAgentToolCallStatus" }); -export type V2ThreadMetadataUpdateResponse__WebSearchAction = +export type V2ThreadListResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadListResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadListResponse__CollabAgentTool" }); + +export type V2ThreadListResponse__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2ThreadListResponse__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2ThreadListResponse__SubAgentActivityKind" }); + +export type V2ThreadListResponse__WebSearchAction = | { readonly queries?: ReadonlyArray | null; readonly query?: string | null; @@ -7609,7 +10115,7 @@ export type V2ThreadMetadataUpdateResponse__WebSearchAction = | { readonly type: "openPage"; readonly url?: string | null } | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } | { readonly type: "other" }; -export const V2ThreadMetadataUpdateResponse__WebSearchAction = Schema.Union( +export const V2ThreadListResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), @@ -7630,195 +10136,298 @@ export const V2ThreadMetadataUpdateResponse__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadListResponse__WebSearchAction" }); -export type V2ThreadReadResponse__AbsolutePathBuf = string; -export const V2ThreadReadResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2ThreadReadResponse__AgentPath = string; -export const V2ThreadReadResponse__AgentPath = Schema.String; +export type V2ThreadListResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ThreadListResponse__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadListResponse__ImageGenerationFailure" }); -export type V2ThreadReadResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ThreadReadResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +export type V2ThreadListResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadListResponse__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadListResponse__TurnItemsView" }); -export type V2ThreadReadResponse__CommandExecutionStatus = - | "inProgress" +export type V2ThreadListResponse__TurnStatus = | "completed" + | "interrupted" | "failed" - | "declined"; -export const V2ThreadReadResponse__CommandExecutionStatus = Schema.Literals([ - "inProgress", + | "inProgress"; +export const V2ThreadListResponse__TurnStatus = Schema.Literals([ "completed", + "interrupted", "failed", - "declined", -]); + "inProgress", +]).annotate({ identifier: "V2ThreadListResponse__TurnStatus" }); -export type V2ThreadReadResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadReadResponse__DynamicToolCallOutputContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", +export type V2ThreadMetadataUpdateParams__ThreadMetadataGitInfoUpdateParams = { + readonly branch?: string | null; + readonly originUrl?: string | null; + readonly sha?: string | null; +}; +export const V2ThreadMetadataUpdateParams__ThreadMetadataGitInfoUpdateParams = Schema.Struct({ + branch: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", + Schema.Null, + ]), + ), + originUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", + Schema.Null, + ]), + ), + sha: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), - ], - { mode: "oneOf" }, -); + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadMetadataUpdateParams__ThreadMetadataGitInfoUpdateParams" }); -export type V2ThreadReadResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadReadResponse__DynamicToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadMetadataUpdateResponse__AbsolutePathBuf = string; +export const V2ThreadMetadataUpdateResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadMetadataUpdateResponse__AbsolutePathBuf", +}); -export type V2ThreadReadResponse__GitInfo = { +export type V2ThreadMetadataUpdateResponse__GitInfo = { readonly branch?: string | null; readonly originUrl?: string | null; readonly sha?: string | null; }; -export const V2ThreadReadResponse__GitInfo = Schema.Struct({ +export const V2ThreadMetadataUpdateResponse__GitInfo = Schema.Struct({ branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__GitInfo" }); -export type V2ThreadReadResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; +export type V2ThreadMetadataUpdateResponse__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadMetadataUpdateResponse__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__ThreadHistoryMode" }); + +export type V2ThreadMetadataUpdateResponse__ReasoningEffort = string; +export const V2ThreadMetadataUpdateResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadMetadataUpdateResponse__ReasoningEffort", + }), +); + +export type V2ThreadMetadataUpdateResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2ThreadReadResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, +export const V2ThreadMetadataUpdateResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadMetadataUpdateResponse__ThreadSectionAppearance", }); -export type V2ThreadReadResponse__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadReadResponse__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); +export type V2ThreadMetadataUpdateResponse__AgentPath = string; +export const V2ThreadMetadataUpdateResponse__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadMetadataUpdateResponse__AgentPath", +}); -export type V2ThreadReadResponse__LegacyAppPathString = string; -export const V2ThreadReadResponse__LegacyAppPathString = Schema.String; +export type V2ThreadMetadataUpdateResponse__ThreadId = string; +export const V2ThreadMetadataUpdateResponse__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadMetadataUpdateResponse__ThreadId", +}); -export type V2ThreadReadResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; -}; -export const V2ThreadReadResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export type V2ThreadMetadataUpdateResponse__ThreadActiveFlag = + | "waitingOnApproval" + | "waitingOnUserInput"; +export const V2ThreadMetadataUpdateResponse__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__ThreadActiveFlag" }); + +export type V2ThreadMetadataUpdateResponse__ThreadSource = string; +export const V2ThreadMetadataUpdateResponse__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadMetadataUpdateResponse__ThreadSource", }); -export type V2ThreadReadResponse__McpToolCallError = { readonly message: string }; -export const V2ThreadReadResponse__McpToolCallError = Schema.Struct({ message: Schema.String }); +export type V2ThreadMetadataUpdateResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadMetadataUpdateResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__NonSteerableTurnKind" }); -export type V2ThreadReadResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; +export type V2ThreadMetadataUpdateResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadMetadataUpdateResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__MisalignmentSteer" }); + +export type V2ThreadMetadataUpdateResponse__ByteRange = { + readonly end: number; + readonly start: number; }; -export const V2ThreadReadResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); +export const V2ThreadMetadataUpdateResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__ByteRange" }); -export type V2ThreadReadResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadReadResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadMetadataUpdateResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadMetadataUpdateResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__ImageDetail" }); -export type V2ThreadReadResponse__MemoryCitationEntry = { +export type V2ThreadMetadataUpdateResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; +}; +export const V2ThreadMetadataUpdateResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__HookPromptFragment" }); + +export type V2ThreadMetadataUpdateResponse__AgentMessageDelivery = "async"; +export const V2ThreadMetadataUpdateResponse__AgentMessageDelivery = Schema.Literal( + "async", +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__AgentMessageDelivery" }); + +export type V2ThreadMetadataUpdateResponse__MemoryCitationEntry = { readonly lineEnd: number; readonly lineStart: number; readonly note: string; readonly path: string; }; -export const V2ThreadReadResponse__MemoryCitationEntry = Schema.Struct({ +export const V2ThreadMetadataUpdateResponse__MemoryCitationEntry = Schema.Struct({ lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), note: Schema.String, path: Schema.String, -}); +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__MemoryCitationEntry" }); -export type V2ThreadReadResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadReadResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +export type V2ThreadMetadataUpdateResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadMetadataUpdateResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadMetadataUpdateResponse__MessagePhase", }); -export type V2ThreadReadResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadReadResponse__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); +export type V2ThreadMetadataUpdateResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ThreadMetadataUpdateResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__AsyncUserInputQuestion" }); -export type V2ThreadReadResponse__PatchApplyStatus = +export type V2ThreadMetadataUpdateResponse__LegacyAppPathString = string; +export const V2ThreadMetadataUpdateResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadMetadataUpdateResponse__LegacyAppPathString", +}); + +export type V2ThreadMetadataUpdateResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadMetadataUpdateResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__CommandExecutionSource" }); + +export type V2ThreadMetadataUpdateResponse__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2ThreadReadResponse__PatchApplyStatus = Schema.Literals([ +export const V2ThreadMetadataUpdateResponse__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__CommandExecutionStatus" }); -export type V2ThreadReadResponse__PatchChangeKind = +export type V2ThreadMetadataUpdateResponse__PatchChangeKind = | { readonly type: "add" } | { readonly type: "delete" } | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ThreadReadResponse__PatchChangeKind = Schema.Union( +export const V2ThreadMetadataUpdateResponse__PatchChangeKind = Schema.Union( [ Schema.Struct({ type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), @@ -7832,580 +10441,451 @@ export const V2ThreadReadResponse__PatchChangeKind = Schema.Union( }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); - -export type V2ThreadReadResponse__ReasoningEffort = string; -export const V2ThreadReadResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__PatchChangeKind" }); -export type V2ThreadReadResponse__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2ThreadReadResponse__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", +export type V2ThreadMetadataUpdateResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadMetadataUpdateResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", "completed", -]); + "failed", + "declined", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__PatchApplyStatus" }); -export type V2ThreadReadResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadMetadataUpdateResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const V2ThreadReadResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); +export const V2ThreadMetadataUpdateResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__McpToolCallAppContext" }); -export type V2ThreadReadResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; -export const V2ThreadReadResponse__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); +export type V2ThreadMetadataUpdateResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadMetadataUpdateResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__McpToolCallError" }); -export type V2ThreadReadResponse__ThreadId = string; -export const V2ThreadReadResponse__ThreadId = Schema.String; +export type V2ThreadMetadataUpdateResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadMetadataUpdateResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__McpAppDisplayMode" }); -export type V2ThreadReadResponse__ThreadSource = string; -export const V2ThreadReadResponse__ThreadSource = Schema.String; +export type V2ThreadMetadataUpdateResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadMetadataUpdateResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__McpToolCallResult" }); -export type V2ThreadReadResponse__TurnStatus = +export type V2ThreadMetadataUpdateResponse__McpToolCallStatus = + | "inProgress" | "completed" - | "interrupted" - | "failed" - | "inProgress"; -export const V2ThreadReadResponse__TurnStatus = Schema.Literals([ + | "failed"; +export const V2ThreadMetadataUpdateResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", "completed", - "interrupted", "failed", - "inProgress", -]); +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__McpToolCallStatus" }); -export type V2ThreadReadResponse__WebSearchAction = - | { - readonly queries?: ReadonlyArray | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly type: "openPage"; readonly url?: string | null } - | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } - | { readonly type: "other" }; -export const V2ThreadReadResponse__WebSearchAction = Schema.Union( - [ - Schema.Struct({ - queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), - }).annotate({ title: "SearchWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageWebSearchAction" }), - Schema.Struct({ - pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), - }).annotate({ title: "OtherWebSearchAction" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadRealtimeOutputAudioDeltaNotification__ThreadRealtimeAudioChunk = { - readonly data: string; - readonly itemId?: string | null; - readonly numChannels: number; - readonly sampleRate: number; - readonly samplesPerChannel?: number | null; -}; -export const V2ThreadRealtimeOutputAudioDeltaNotification__ThreadRealtimeAudioChunk = Schema.Struct( - { - data: Schema.String, - itemId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - numChannels: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - sampleRate: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - samplesPerChannel: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }, -).annotate({ description: "EXPERIMENTAL - thread realtime audio chunk." }); - -export type V2ThreadRealtimeStartedNotification__RealtimeConversationVersion = "v1" | "v2" | "v3"; -export const V2ThreadRealtimeStartedNotification__RealtimeConversationVersion = Schema.Literals([ - "v1", - "v2", - "v3", -]); - -export type V2ThreadResumeParams__AgentMessageInputContent = - | { readonly text: string; readonly type: "input_text" } - | { readonly encrypted_content: string; readonly type: "encrypted_content" }; -export const V2ThreadResumeParams__AgentMessageInputContent = Schema.Union( +export type V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem = Schema.Union( [ Schema.Struct({ text: Schema.String, - type: Schema.Literal("input_text").annotate({ - title: "InputTextAgentMessageInputContentType", + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", }), - }).annotate({ title: "InputTextAgentMessageInputContent" }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), Schema.Struct({ - encrypted_content: Schema.String, - type: Schema.Literal("encrypted_content").annotate({ - title: "EncryptedContentAgentMessageInputContentType", + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", }), - }).annotate({ title: "EncryptedContentAgentMessageInputContent" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadResumeParams__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const V2ThreadResumeParams__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); - -export type V2ThreadResumeParams__AskForApproval = - | "untrusted" - | "on-request" - | "never" - | { - readonly granular: { - readonly mcp_elicitations: boolean; - readonly request_permissions?: boolean; - readonly rules: boolean; - readonly sandbox_approval: boolean; - readonly skill_approval?: boolean; - }; - }; -export const V2ThreadResumeParams__AskForApproval = Schema.Union( - [ - Schema.Literals(["untrusted", "on-request", "never"]), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), Schema.Struct({ - granular: Schema.Struct({ - mcp_elicitations: Schema.Boolean, - request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - rules: Schema.Boolean, - sandbox_approval: Schema.Boolean, - skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", }), - }).annotate({ title: "GranularAskForApproval" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadResumeParams__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadResumeParams__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); - -export type V2ThreadResumeParams__InternalChatMessageMetadataPassthrough = { - readonly turn_id?: string | null; -}; -export const V2ThreadResumeParams__InternalChatMessageMetadataPassthrough = Schema.Struct({ - turn_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ - description: - "Internal Responses API passthrough metadata copied into underlying chat messages.\n\nResponses API strongly types this payload. Do not modify it without first getting API approval and making the corresponding Responses API change.", -}); - -export type V2ThreadResumeParams__LocalShellAction = { - readonly command: ReadonlyArray; - readonly env?: { readonly [x: string]: string } | null; - readonly timeout_ms?: number | null; - readonly type: "exec"; - readonly user?: string | null; - readonly working_directory?: string | null; -}; -export const V2ThreadResumeParams__LocalShellAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.Array(Schema.String), - env: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - timeout_ms: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - type: Schema.Literal("exec").annotate({ title: "ExecLocalShellActionType" }), - user: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - working_directory: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "ExecLocalShellAction" }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem" }); -export type V2ThreadResumeParams__LocalShellStatus = "completed" | "in_progress" | "incomplete"; -export const V2ThreadResumeParams__LocalShellStatus = Schema.Literals([ +export type V2ThreadMetadataUpdateResponse__DynamicToolCallStatus = + | "inProgress" + | "completed" + | "failed"; +export const V2ThreadMetadataUpdateResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", "completed", - "in_progress", - "incomplete", -]); + "failed", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__DynamicToolCallStatus" }); -export type V2ThreadResumeParams__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadResumeParams__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', -}); +export type V2ThreadMetadataUpdateResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadMetadataUpdateResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__CollabAgentStatus" }); -export type V2ThreadResumeParams__Personality = "none" | "friendly" | "pragmatic"; -export const V2ThreadResumeParams__Personality = Schema.Literals(["none", "friendly", "pragmatic"]); +export type V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus" }); -export type V2ThreadResumeParams__ReasoningItemContent = - | { readonly text: string; readonly type: "reasoning_text" } - | { readonly text: string; readonly type: "text" }; -export const V2ThreadResumeParams__ReasoningItemContent = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("reasoning_text").annotate({ - title: "ReasoningTextReasoningItemContentType", - }), - }).annotate({ title: "ReasoningTextReasoningItemContent" }), - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("text").annotate({ title: "TextReasoningItemContentType" }), - }).annotate({ title: "TextReasoningItemContent" }), - ], - { mode: "oneOf" }, -); +export type V2ThreadMetadataUpdateResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadMetadataUpdateResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__CollabAgentTool" }); -export type V2ThreadResumeParams__ReasoningItemReasoningSummary = { - readonly text: string; - readonly type: "summary_text"; -}; -export const V2ThreadResumeParams__ReasoningItemReasoningSummary = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("summary_text").annotate({ - title: "SummaryTextReasoningItemReasoningSummaryType", - }), - }).annotate({ title: "SummaryTextReasoningItemReasoningSummary" }), - ], - { mode: "oneOf" }, -); +export type V2ThreadMetadataUpdateResponse__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2ThreadMetadataUpdateResponse__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__SubAgentActivityKind" }); -export type V2ThreadResumeParams__ResponsesApiWebSearchAction = +export type V2ThreadMetadataUpdateResponse__WebSearchAction = | { readonly queries?: ReadonlyArray | null; readonly query?: string | null; readonly type: "search"; } - | { readonly type: "open_page"; readonly url?: string | null } - | { - readonly pattern?: string | null; - readonly type: "find_in_page"; - readonly url?: string | null; - } + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } | { readonly type: "other" }; -export const V2ThreadResumeParams__ResponsesApiWebSearchAction = Schema.Union( +export const V2ThreadMetadataUpdateResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchResponsesApiWebSearchActionType" }), - }).annotate({ title: "SearchResponsesApiWebSearchAction" }), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), Schema.Struct({ - type: Schema.Literal("open_page").annotate({ - title: "OpenPageResponsesApiWebSearchActionType", - }), + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageResponsesApiWebSearchAction" }), + }).annotate({ title: "OpenPageWebSearchAction" }), Schema.Struct({ pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("find_in_page").annotate({ - title: "FindInPageResponsesApiWebSearchActionType", - }), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageResponsesApiWebSearchAction" }), + }).annotate({ title: "FindInPageWebSearchAction" }), Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherResponsesApiWebSearchActionType" }), - }).annotate({ title: "OtherResponsesApiWebSearchAction" }), + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); - -export type V2ThreadResumeParams__SandboxMode = - | "read-only" - | "workspace-write" - | "danger-full-access"; -export const V2ThreadResumeParams__SandboxMode = Schema.Literals([ - "read-only", - "workspace-write", - "danger-full-access", -]); - -export type V2ThreadResumeParams__SortDirection = "asc" | "desc"; -export const V2ThreadResumeParams__SortDirection = Schema.Literals(["asc", "desc"]); - -export type V2ThreadResumeParams__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadResumeParams__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); - -export type V2ThreadResumeResponse__AbsolutePathBuf = string; -export const V2ThreadResumeResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2ThreadResumeResponse__AgentPath = string; -export const V2ThreadResumeResponse__AgentPath = Schema.String; +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__WebSearchAction" }); -export type V2ThreadResumeResponse__AskForApproval = - | "untrusted" - | "on-request" - | "never" - | { - readonly granular: { - readonly mcp_elicitations: boolean; - readonly request_permissions?: boolean; - readonly rules: boolean; - readonly sandbox_approval: boolean; - readonly skill_approval?: boolean; - }; - }; -export const V2ThreadResumeResponse__AskForApproval = Schema.Union( +export type V2ThreadMetadataUpdateResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ThreadMetadataUpdateResponse__ImageGenerationFailure = Schema.Union( [ - Schema.Literals(["untrusted", "on-request", "never"]), Schema.Struct({ - granular: Schema.Struct({ - mcp_elicitations: Schema.Boolean, - request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - rules: Schema.Boolean, - sandbox_approval: Schema.Boolean, - skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", }), - }).annotate({ title: "GranularAskForApproval" }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), ], { mode: "oneOf" }, -); - -export type V2ThreadResumeResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ThreadResumeResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); - -export type V2ThreadResumeResponse__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2ThreadResumeResponse__CommandExecutionStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__ImageGenerationFailure" }); -export type V2ThreadResumeResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadResumeResponse__DynamicToolCallOutputContentItem = Schema.Union( +export type V2ThreadMetadataUpdateResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadMetadataUpdateResponse__TurnItemsView = Schema.Union( [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__TurnItemsView" }); -export type V2ThreadResumeResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadResumeResponse__DynamicToolCallStatus = Schema.Literals([ - "inProgress", +export type V2ThreadMetadataUpdateResponse__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadMetadataUpdateResponse__TurnStatus = Schema.Literals([ "completed", + "interrupted", "failed", -]); + "inProgress", +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__TurnStatus" }); -export type V2ThreadResumeResponse__GitInfo = { +export type V2ThreadReadResponse__AbsolutePathBuf = string; +export const V2ThreadReadResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadReadResponse__AbsolutePathBuf", +}); + +export type V2ThreadReadResponse__GitInfo = { readonly branch?: string | null; readonly originUrl?: string | null; readonly sha?: string | null; }; -export const V2ThreadResumeResponse__GitInfo = Schema.Struct({ +export const V2ThreadReadResponse__GitInfo = Schema.Struct({ branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ThreadResumeResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const V2ThreadResumeResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); +}).annotate({ identifier: "V2ThreadReadResponse__GitInfo" }); -export type V2ThreadResumeResponse__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadResumeResponse__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); +export type V2ThreadReadResponse__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadReadResponse__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadReadResponse__ThreadHistoryMode" }); -export type V2ThreadResumeResponse__LegacyAppPathString = string; -export const V2ThreadResumeResponse__LegacyAppPathString = Schema.String; +export type V2ThreadReadResponse__ReasoningEffort = string; +export const V2ThreadReadResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadReadResponse__ReasoningEffort", + }), +); -export type V2ThreadResumeResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; +export type V2ThreadReadResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2ThreadResumeResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export const V2ThreadReadResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadReadResponse__ThreadSectionAppearance", }); -export type V2ThreadResumeResponse__McpToolCallError = { readonly message: string }; -export const V2ThreadResumeResponse__McpToolCallError = Schema.Struct({ message: Schema.String }); +export type V2ThreadReadResponse__AgentPath = string; +export const V2ThreadReadResponse__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadReadResponse__AgentPath", +}); -export type V2ThreadResumeResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2ThreadResumeResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), +export type V2ThreadReadResponse__ThreadId = string; +export const V2ThreadReadResponse__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadReadResponse__ThreadId", }); -export type V2ThreadResumeResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadResumeResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadReadResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; +export const V2ThreadReadResponse__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadReadResponse__ThreadActiveFlag" }); -export type V2ThreadResumeResponse__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; -}; -export const V2ThreadResumeResponse__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, +export type V2ThreadReadResponse__ThreadSource = string; +export const V2ThreadReadResponse__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadReadResponse__ThreadSource", }); -export type V2ThreadResumeResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadResumeResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', -}); +export type V2ThreadReadResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadReadResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadReadResponse__NonSteerableTurnKind" }); -export type V2ThreadResumeResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadResumeResponse__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); +export type V2ThreadReadResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadReadResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadReadResponse__MisalignmentSteer" }); -export type V2ThreadResumeResponse__PatchApplyStatus = +export type V2ThreadReadResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadReadResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadReadResponse__ByteRange" }); + +export type V2ThreadReadResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadReadResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadReadResponse__ImageDetail" }); + +export type V2ThreadReadResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; +}; +export const V2ThreadReadResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadReadResponse__HookPromptFragment" }); + +export type V2ThreadReadResponse__AgentMessageDelivery = "async"; +export const V2ThreadReadResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadReadResponse__AgentMessageDelivery", +}); + +export type V2ThreadReadResponse__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; +}; +export const V2ThreadReadResponse__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2ThreadReadResponse__MemoryCitationEntry" }); + +export type V2ThreadReadResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadReadResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadReadResponse__MessagePhase", +}); + +export type V2ThreadReadResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ThreadReadResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadReadResponse__AsyncUserInputQuestion" }); + +export type V2ThreadReadResponse__LegacyAppPathString = string; +export const V2ThreadReadResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadReadResponse__LegacyAppPathString", +}); + +export type V2ThreadReadResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadReadResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadReadResponse__CommandExecutionSource" }); + +export type V2ThreadReadResponse__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2ThreadResumeResponse__PatchApplyStatus = Schema.Literals([ +export const V2ThreadReadResponse__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ThreadReadResponse__CommandExecutionStatus" }); -export type V2ThreadResumeResponse__PatchChangeKind = +export type V2ThreadReadResponse__PatchChangeKind = | { readonly type: "add" } | { readonly type: "delete" } | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ThreadResumeResponse__PatchChangeKind = Schema.Union( +export const V2ThreadReadResponse__PatchChangeKind = Schema.Union( [ Schema.Struct({ type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), @@ -8419,150 +10899,69 @@ export const V2ThreadResumeResponse__PatchChangeKind = Schema.Union( }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); - -export type V2ThreadResumeResponse__ReasoningEffort = string; -export const V2ThreadResumeResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); - -export type V2ThreadResumeResponse__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2ThreadResumeResponse__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", - "completed", -]); +).annotate({ identifier: "V2ThreadReadResponse__PatchChangeKind" }); -export type V2ThreadResumeResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; -}; -export const V2ThreadResumeResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); - -export type V2ThreadResumeResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; -export const V2ThreadResumeResponse__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); - -export type V2ThreadResumeResponse__ThreadId = string; -export const V2ThreadResumeResponse__ThreadId = Schema.String; - -export type V2ThreadResumeResponse__ThreadSource = string; -export const V2ThreadResumeResponse__ThreadSource = Schema.String; - -export type V2ThreadResumeResponse__TurnStatus = +export type V2ThreadReadResponse__PatchApplyStatus = + | "inProgress" | "completed" - | "interrupted" | "failed" - | "inProgress"; -export const V2ThreadResumeResponse__TurnStatus = Schema.Literals([ + | "declined"; +export const V2ThreadReadResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", "completed", - "interrupted", "failed", - "inProgress", -]); + "declined", +]).annotate({ identifier: "V2ThreadReadResponse__PatchApplyStatus" }); -export type V2ThreadResumeResponse__WebSearchAction = - | { - readonly queries?: ReadonlyArray | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly type: "openPage"; readonly url?: string | null } - | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } - | { readonly type: "other" }; -export const V2ThreadResumeResponse__WebSearchAction = Schema.Union( - [ - Schema.Struct({ - queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), - }).annotate({ title: "SearchWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageWebSearchAction" }), - Schema.Struct({ - pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), - }).annotate({ title: "OtherWebSearchAction" }), - ], - { mode: "oneOf" }, -); +export type V2ThreadReadResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; +}; +export const V2ThreadReadResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadReadResponse__McpToolCallAppContext" }); -export type V2ThreadRollbackResponse__AbsolutePathBuf = string; -export const V2ThreadRollbackResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +export type V2ThreadReadResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadReadResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadReadResponse__McpToolCallError" }); -export type V2ThreadRollbackResponse__AgentPath = string; -export const V2ThreadRollbackResponse__AgentPath = Schema.String; +export type V2ThreadReadResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadReadResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadReadResponse__McpAppDisplayMode" }); -export type V2ThreadRollbackResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ThreadRollbackResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +export type V2ThreadReadResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadReadResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadReadResponse__McpToolCallResult" }); -export type V2ThreadRollbackResponse__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2ThreadRollbackResponse__CommandExecutionStatus = Schema.Literals([ +export type V2ThreadReadResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadReadResponse__McpToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", - "declined", -]); +]).annotate({ identifier: "V2ThreadReadResponse__McpToolCallStatus" }); -export type V2ThreadRollbackResponse__DynamicToolCallOutputContentItem = +export type V2ThreadReadResponse__DynamicToolCallOutputContentItem = | { readonly text: string; readonly type: "inputText" } | { readonly imageUrl: string; readonly type: "inputImage" } | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadRollbackResponse__DynamicToolCallOutputContentItem = Schema.Union( +export const V2ThreadReadResponse__DynamicToolCallOutputContentItem = Schema.Union( [ Schema.Struct({ text: Schema.String, @@ -8584,213 +10983,80 @@ export const V2ThreadRollbackResponse__DynamicToolCallOutputContentItem = Schema }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadReadResponse__DynamicToolCallOutputContentItem" }); -export type V2ThreadRollbackResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadRollbackResponse__DynamicToolCallStatus = Schema.Literals([ +export type V2ThreadReadResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadReadResponse__DynamicToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); - -export type V2ThreadRollbackResponse__GitInfo = { - readonly branch?: string | null; - readonly originUrl?: string | null; - readonly sha?: string | null; -}; -export const V2ThreadRollbackResponse__GitInfo = Schema.Struct({ - branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ThreadRollbackResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const V2ThreadRollbackResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); - -export type V2ThreadRollbackResponse__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadRollbackResponse__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); - -export type V2ThreadRollbackResponse__LegacyAppPathString = string; -export const V2ThreadRollbackResponse__LegacyAppPathString = Schema.String; - -export type V2ThreadRollbackResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; -}; -export const V2ThreadRollbackResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ThreadRollbackResponse__McpToolCallError = { readonly message: string }; -export const V2ThreadRollbackResponse__McpToolCallError = Schema.Struct({ message: Schema.String }); - -export type V2ThreadRollbackResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2ThreadRollbackResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); +]).annotate({ identifier: "V2ThreadReadResponse__DynamicToolCallStatus" }); -export type V2ThreadRollbackResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadRollbackResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", +export type V2ThreadReadResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadReadResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", "completed", - "failed", -]); - -export type V2ThreadRollbackResponse__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; -}; -export const V2ThreadRollbackResponse__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, -}); - -export type V2ThreadRollbackResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadRollbackResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', -}); - -export type V2ThreadRollbackResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadRollbackResponse__NonSteerableTurnKind = Schema.Literals([ - "review", - "compact", -]); + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadReadResponse__CollabAgentStatus" }); -export type V2ThreadRollbackResponse__PatchApplyStatus = +export type V2ThreadReadResponse__CollabAgentToolCallStatus = | "inProgress" | "completed" | "failed" - | "declined"; -export const V2ThreadRollbackResponse__PatchApplyStatus = Schema.Literals([ + | "interrupted"; +export const V2ThreadReadResponse__CollabAgentToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", - "declined", -]); - -export type V2ThreadRollbackResponse__PatchChangeKind = - | { readonly type: "add" } - | { readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ThreadRollbackResponse__PatchChangeKind = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), - }).annotate({ title: "AddPatchChangeKind" }), - Schema.Struct({ - type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), - }).annotate({ title: "DeletePatchChangeKind" }), - Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), - }).annotate({ title: "UpdatePatchChangeKind" }), - ], - { mode: "oneOf" }, -); + "interrupted", +]).annotate({ identifier: "V2ThreadReadResponse__CollabAgentToolCallStatus" }); -export type V2ThreadRollbackResponse__ReasoningEffort = string; -export const V2ThreadRollbackResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +export type V2ThreadReadResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadReadResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadReadResponse__CollabAgentTool" }); -export type V2ThreadRollbackResponse__SubAgentActivityKind = +export type V2ThreadReadResponse__SubAgentActivityKind = | "started" | "interacted" | "interrupted" | "completed"; -export const V2ThreadRollbackResponse__SubAgentActivityKind = Schema.Literals([ +export const V2ThreadReadResponse__SubAgentActivityKind = Schema.Literals([ "started", "interacted", "interrupted", "completed", -]); - -export type V2ThreadRollbackResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; -}; -export const V2ThreadRollbackResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); - -export type V2ThreadRollbackResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; -export const V2ThreadRollbackResponse__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); - -export type V2ThreadRollbackResponse__ThreadId = string; -export const V2ThreadRollbackResponse__ThreadId = Schema.String; - -export type V2ThreadRollbackResponse__ThreadSource = string; -export const V2ThreadRollbackResponse__ThreadSource = Schema.String; - -export type V2ThreadRollbackResponse__TurnStatus = - | "completed" - | "interrupted" - | "failed" - | "inProgress"; -export const V2ThreadRollbackResponse__TurnStatus = Schema.Literals([ - "completed", - "interrupted", - "failed", - "inProgress", -]); +]).annotate({ identifier: "V2ThreadReadResponse__SubAgentActivityKind" }); -export type V2ThreadRollbackResponse__WebSearchAction = +export type V2ThreadReadResponse__WebSearchAction = | { readonly queries?: ReadonlyArray | null; readonly query?: string | null; @@ -8799,7 +11065,7 @@ export type V2ThreadRollbackResponse__WebSearchAction = | { readonly type: "openPage"; readonly url?: string | null } | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } | { readonly type: "other" }; -export const V2ThreadRollbackResponse__WebSearchAction = Schema.Union( +export const V2ThreadReadResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), @@ -8820,431 +11086,484 @@ export const V2ThreadRollbackResponse__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); - -export type V2ThreadSettingsUpdatedNotification__AbsolutePathBuf = string; -export const V2ThreadSettingsUpdatedNotification__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +).annotate({ identifier: "V2ThreadReadResponse__WebSearchAction" }); -export type V2ThreadSettingsUpdatedNotification__ActivePermissionProfile = { - readonly extends?: string | null; - readonly id: string; +export type V2ThreadReadResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; }; -export const V2ThreadSettingsUpdatedNotification__ActivePermissionProfile = Schema.Struct({ - extends: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", - }), - Schema.Null, - ]), - ), - id: Schema.String.annotate({ - description: - "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", - }), -}); - -export type V2ThreadSettingsUpdatedNotification__ApprovalsReviewer = - | "user" - | "auto_review" - | "guardian_subagent"; -export const V2ThreadSettingsUpdatedNotification__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); - -export type V2ThreadSettingsUpdatedNotification__AskForApproval = - | "untrusted" - | "on-request" - | "never" - | { - readonly granular: { - readonly mcp_elicitations: boolean; - readonly request_permissions?: boolean; - readonly rules: boolean; - readonly sandbox_approval: boolean; - readonly skill_approval?: boolean; - }; - }; -export const V2ThreadSettingsUpdatedNotification__AskForApproval = Schema.Union( +export const V2ThreadReadResponse__ImageGenerationFailure = Schema.Union( [ - Schema.Literals(["untrusted", "on-request", "never"]), Schema.Struct({ - granular: Schema.Struct({ - mcp_elicitations: Schema.Boolean, - request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - rules: Schema.Boolean, - sandbox_approval: Schema.Boolean, - skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", }), - }).annotate({ title: "GranularAskForApproval" }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), ], { mode: "oneOf" }, -); - -export type V2ThreadSettingsUpdatedNotification__ModeKind = "plan" | "default"; -export const V2ThreadSettingsUpdatedNotification__ModeKind = Schema.Literals([ - "plan", - "default", -]).annotate({ description: "Initial collaboration mode to use when the TUI starts." }); - -export type V2ThreadSettingsUpdatedNotification__Personality = "none" | "friendly" | "pragmatic"; -export const V2ThreadSettingsUpdatedNotification__Personality = Schema.Literals([ - "none", - "friendly", - "pragmatic", -]); +).annotate({ identifier: "V2ThreadReadResponse__ImageGenerationFailure" }); -export type V2ThreadSettingsUpdatedNotification__ReasoningEffort = string; -export const V2ThreadSettingsUpdatedNotification__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); - -export type V2ThreadSettingsUpdatedNotification__ReasoningSummary = - | "auto" - | "concise" - | "detailed" - | "none"; -export const V2ThreadSettingsUpdatedNotification__ReasoningSummary = Schema.Union( +export type V2ThreadReadResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadReadResponse__TurnItemsView = Schema.Union( [ - Schema.Literals(["auto", "concise", "detailed"]), - Schema.Literal("none").annotate({ description: "Option to disable reasoning summaries." }), + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), ], { mode: "oneOf" }, -).annotate({ - description: - "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", -}); - -export type V2ThreadStartedNotification__AbsolutePathBuf = string; -export const V2ThreadStartedNotification__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2ThreadStartedNotification__AgentPath = string; -export const V2ThreadStartedNotification__AgentPath = Schema.String; - -export type V2ThreadStartedNotification__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ThreadStartedNotification__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +).annotate({ identifier: "V2ThreadReadResponse__TurnItemsView" }); -export type V2ThreadStartedNotification__CommandExecutionStatus = - | "inProgress" +export type V2ThreadReadResponse__TurnStatus = | "completed" + | "interrupted" | "failed" - | "declined"; -export const V2ThreadStartedNotification__CommandExecutionStatus = Schema.Literals([ - "inProgress", + | "inProgress"; +export const V2ThreadReadResponse__TurnStatus = Schema.Literals([ "completed", + "interrupted", "failed", - "declined", -]); + "inProgress", +]).annotate({ identifier: "V2ThreadReadResponse__TurnStatus" }); -export type V2ThreadStartedNotification__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadStartedNotification__DynamicToolCallOutputContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), - ], - { mode: "oneOf" }, -); +export type V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeTranscriptRole = + | "user" + | "assistant"; +export const V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeTranscriptRole = + Schema.Literals(["user", "assistant"]).annotate({ + identifier: "V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeTranscriptRole", + }); -export type V2ThreadStartedNotification__DynamicToolCallStatus = - | "inProgress" - | "completed" +export type V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeBemItemPresentation = + | { readonly type: "wholeItem" } + | { readonly type: "inlineMarkdown" } + | { readonly index: number; readonly type: "inlineVisualization" }; +export const V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeBemItemPresentation = + Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("wholeItem").annotate({ + title: "WholeItemThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "WholeItemThreadRealtimeBemItemPresentation" }), + Schema.Struct({ + type: Schema.Literal("inlineMarkdown").annotate({ + title: "InlineMarkdownThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "InlineMarkdownThreadRealtimeBemItemPresentation" }), + Schema.Struct({ + index: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + type: Schema.Literal("inlineVisualization").annotate({ + title: "InlineVisualizationThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "InlineVisualizationThreadRealtimeBemItemPresentation" }), + ], + { mode: "oneOf" }, + ).annotate({ + description: "EXPERIMENTAL - how an existing agent item appears in a realtime conversation.", + identifier: "V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeBemItemPresentation", + }); + +export type V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeSessionOutcome = + | "ended" | "failed"; -export const V2ThreadStartedNotification__DynamicToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export const V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeSessionOutcome = + Schema.Literals(["ended", "failed"]).annotate({ + identifier: "V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeSessionOutcome", + }); -export type V2ThreadStartedNotification__GitInfo = { - readonly branch?: string | null; - readonly originUrl?: string | null; - readonly sha?: string | null; -}; -export const V2ThreadStartedNotification__GitInfo = Schema.Struct({ - branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export type V2ThreadRealtimeItemStartedNotification__ThreadRealtimeTranscriptRole = + | "user" + | "assistant"; +export const V2ThreadRealtimeItemStartedNotification__ThreadRealtimeTranscriptRole = + Schema.Literals(["user", "assistant"]).annotate({ + identifier: "V2ThreadRealtimeItemStartedNotification__ThreadRealtimeTranscriptRole", + }); -export type V2ThreadStartedNotification__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; +export type V2ThreadRealtimeItemStartedNotification__ThreadRealtimeBemItemPresentation = + | { readonly type: "wholeItem" } + | { readonly type: "inlineMarkdown" } + | { readonly index: number; readonly type: "inlineVisualization" }; +export const V2ThreadRealtimeItemStartedNotification__ThreadRealtimeBemItemPresentation = + Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("wholeItem").annotate({ + title: "WholeItemThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "WholeItemThreadRealtimeBemItemPresentation" }), + Schema.Struct({ + type: Schema.Literal("inlineMarkdown").annotate({ + title: "InlineMarkdownThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "InlineMarkdownThreadRealtimeBemItemPresentation" }), + Schema.Struct({ + index: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + type: Schema.Literal("inlineVisualization").annotate({ + title: "InlineVisualizationThreadRealtimeBemItemPresentationType", + }), + }).annotate({ title: "InlineVisualizationThreadRealtimeBemItemPresentation" }), + ], + { mode: "oneOf" }, + ).annotate({ + description: "EXPERIMENTAL - how an existing agent item appears in a realtime conversation.", + identifier: "V2ThreadRealtimeItemStartedNotification__ThreadRealtimeBemItemPresentation", + }); + +export type V2ThreadRealtimeItemStartedNotification__ThreadRealtimeSessionOutcome = + | "ended" + | "failed"; +export const V2ThreadRealtimeItemStartedNotification__ThreadRealtimeSessionOutcome = + Schema.Literals(["ended", "failed"]).annotate({ + identifier: "V2ThreadRealtimeItemStartedNotification__ThreadRealtimeSessionOutcome", + }); + +export type V2ThreadRealtimeOutputAudioDeltaNotification__ThreadRealtimeAudioChunk = { + readonly data: string; + readonly itemId?: string | null; + readonly numChannels: number; + readonly sampleRate: number; + readonly samplesPerChannel?: number | null; }; -export const V2ThreadStartedNotification__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, +export const V2ThreadRealtimeOutputAudioDeltaNotification__ThreadRealtimeAudioChunk = Schema.Struct( + { + data: Schema.String, + itemId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + numChannels: Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + sampleRate: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + samplesPerChannel: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }, +).annotate({ + description: "EXPERIMENTAL - thread realtime audio chunk.", + identifier: "V2ThreadRealtimeOutputAudioDeltaNotification__ThreadRealtimeAudioChunk", }); -export type V2ThreadStartedNotification__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadStartedNotification__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); +export type V2ThreadRealtimeStartedNotification__RealtimeConversationVersion = "v1" | "v2" | "v3"; +export const V2ThreadRealtimeStartedNotification__RealtimeConversationVersion = Schema.Literals([ + "v1", + "v2", + "v3", +]).annotate({ identifier: "V2ThreadRealtimeStartedNotification__RealtimeConversationVersion" }); -export type V2ThreadStartedNotification__LegacyAppPathString = string; -export const V2ThreadStartedNotification__LegacyAppPathString = Schema.String; +export type V2ThreadResumeParams__AskForApproval = + | "untrusted" + | "on-request" + | "never" + | { + readonly granular: { + readonly mcp_elicitations: boolean; + readonly request_permissions?: boolean; + readonly rules: boolean; + readonly sandbox_approval: boolean; + readonly skill_approval?: boolean; + }; + }; +export const V2ThreadResumeParams__AskForApproval = Schema.Union( + [ + Schema.Literals(["untrusted", "on-request", "never"]), + Schema.Struct({ + granular: Schema.Struct({ + mcp_elicitations: Schema.Boolean, + request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + rules: Schema.Boolean, + sandbox_approval: Schema.Boolean, + skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + }), + }).annotate({ title: "GranularAskForApproval" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeParams__AskForApproval" }); -export type V2ThreadStartedNotification__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; -}; -export const V2ThreadStartedNotification__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export type V2ThreadResumeParams__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const V2ThreadResumeParams__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2ThreadResumeParams__ApprovalsReviewer", }); -export type V2ThreadStartedNotification__McpToolCallError = { readonly message: string }; -export const V2ThreadStartedNotification__McpToolCallError = Schema.Struct({ - message: Schema.String, +export type V2ThreadResumeParams__Personality = "none" | "friendly" | "pragmatic"; +export const V2ThreadResumeParams__Personality = Schema.Literals([ + "none", + "friendly", + "pragmatic", +]).annotate({ + description: "Deprecated: `friendly` and `pragmatic` no longer select a style.", + identifier: "V2ThreadResumeParams__Personality", }); -export type V2ThreadStartedNotification__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2ThreadStartedNotification__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); +export type V2ThreadResumeParams__SandboxMode = + | "read-only" + | "workspace-write" + | "danger-full-access"; +export const V2ThreadResumeParams__SandboxMode = Schema.Literals([ + "read-only", + "workspace-write", + "danger-full-access", +]).annotate({ identifier: "V2ThreadResumeParams__SandboxMode" }); -export type V2ThreadStartedNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadStartedNotification__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadResumeParams__ReasoningEffort = string; +export const V2ThreadResumeParams__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadResumeParams__ReasoningEffort", + }), +); -export type V2ThreadStartedNotification__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; +export type V2ThreadResumeParams__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadResumeParams__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadResumeParams__ImageDetail" }); + +export type V2ThreadResumeParams__InternalChatMessageMetadataPassthrough = { + readonly turn_id?: string | null; }; -export const V2ThreadStartedNotification__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, +export const V2ThreadResumeParams__InternalChatMessageMetadataPassthrough = Schema.Struct({ + turn_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: + "Internal Responses API passthrough metadata copied into underlying chat messages.\n\nResponses API strongly types this payload. Do not modify it without first getting API approval and making the corresponding Responses API change.", + identifier: "V2ThreadResumeParams__InternalChatMessageMetadataPassthrough", }); -export type V2ThreadStartedNotification__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadStartedNotification__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +export type V2ThreadResumeParams__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadResumeParams__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadResumeParams__MessagePhase", }); -export type V2ThreadStartedNotification__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadStartedNotification__NonSteerableTurnKind = Schema.Literals([ - "review", - "compact", -]); - -export type V2ThreadStartedNotification__PatchApplyStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2ThreadStartedNotification__PatchApplyStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); - -export type V2ThreadStartedNotification__PatchChangeKind = - | { readonly type: "add" } - | { readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ThreadStartedNotification__PatchChangeKind = Schema.Union( +export type V2ThreadResumeParams__AgentMessageInputContent = + | { readonly text: string; readonly type: "input_text" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadResumeParams__AgentMessageInputContent = Schema.Union( [ Schema.Struct({ - type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), - }).annotate({ title: "AddPatchChangeKind" }), - Schema.Struct({ - type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), - }).annotate({ title: "DeletePatchChangeKind" }), + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextAgentMessageInputContentType", + }), + }).annotate({ title: "InputTextAgentMessageInputContent" }), Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), - }).annotate({ title: "UpdatePatchChangeKind" }), + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentAgentMessageInputContentType", + }), + }).annotate({ title: "EncryptedContentAgentMessageInputContent" }), ], { mode: "oneOf" }, -); - -export type V2ThreadStartedNotification__ReasoningEffort = string; -export const V2ThreadStartedNotification__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +).annotate({ identifier: "V2ThreadResumeParams__AgentMessageInputContent" }); -export type V2ThreadStartedNotification__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2ThreadStartedNotification__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", - "completed", -]); +export type V2ThreadResumeParams__ReasoningItemContent = + | { readonly text: string; readonly type: "reasoning_text" } + | { readonly text: string; readonly type: "text" }; +export const V2ThreadResumeParams__ReasoningItemContent = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("reasoning_text").annotate({ + title: "ReasoningTextReasoningItemContentType", + }), + }).annotate({ title: "ReasoningTextReasoningItemContent" }), + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("text").annotate({ title: "TextReasoningItemContentType" }), + }).annotate({ title: "TextReasoningItemContent" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeParams__ReasoningItemContent" }); -export type V2ThreadStartedNotification__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadResumeParams__ReasoningItemReasoningSummary = { + readonly text: string; + readonly type: "summary_text"; }; -export const V2ThreadStartedNotification__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", +export const V2ThreadResumeParams__ReasoningItemReasoningSummary = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("summary_text").annotate({ + title: "SummaryTextReasoningItemReasoningSummaryType", }), - Schema.Null, - ]), - ), -}); - -export type V2ThreadStartedNotification__ThreadActiveFlag = - | "waitingOnApproval" - | "waitingOnUserInput"; -export const V2ThreadStartedNotification__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); - -export type V2ThreadStartedNotification__ThreadId = string; -export const V2ThreadStartedNotification__ThreadId = Schema.String; + }).annotate({ title: "SummaryTextReasoningItemReasoningSummary" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeParams__ReasoningItemReasoningSummary" }); -export type V2ThreadStartedNotification__ThreadSource = string; -export const V2ThreadStartedNotification__ThreadSource = Schema.String; +export type V2ThreadResumeParams__LocalShellAction = { + readonly command: ReadonlyArray; + readonly env?: { readonly [x: string]: string } | null; + readonly timeout_ms?: number | null; + readonly type: "exec"; + readonly user?: string | null; + readonly working_directory?: string | null; +}; +export const V2ThreadResumeParams__LocalShellAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.Array(Schema.String), + env: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + timeout_ms: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("exec").annotate({ title: "ExecLocalShellActionType" }), + user: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + working_directory: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "ExecLocalShellAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeParams__LocalShellAction" }); -export type V2ThreadStartedNotification__TurnStatus = - | "completed" - | "interrupted" - | "failed" - | "inProgress"; -export const V2ThreadStartedNotification__TurnStatus = Schema.Literals([ +export type V2ThreadResumeParams__LocalShellStatus = "completed" | "in_progress" | "incomplete"; +export const V2ThreadResumeParams__LocalShellStatus = Schema.Literals([ "completed", - "interrupted", - "failed", - "inProgress", -]); + "in_progress", + "incomplete", +]).annotate({ identifier: "V2ThreadResumeParams__LocalShellStatus" }); -export type V2ThreadStartedNotification__WebSearchAction = +export type V2ThreadResumeParams__ResponsesApiWebSearchAction = | { readonly queries?: ReadonlyArray | null; readonly query?: string | null; readonly type: "search"; } - | { readonly type: "openPage"; readonly url?: string | null } - | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "open_page"; readonly url?: string | null } + | { + readonly pattern?: string | null; + readonly type: "find_in_page"; + readonly url?: string | null; + } | { readonly type: "other" }; -export const V2ThreadStartedNotification__WebSearchAction = Schema.Union( +export const V2ThreadResumeParams__ResponsesApiWebSearchAction = Schema.Union( [ Schema.Struct({ queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), - }).annotate({ title: "SearchWebSearchAction" }), + type: Schema.Literal("search").annotate({ title: "SearchResponsesApiWebSearchActionType" }), + }).annotate({ title: "SearchResponsesApiWebSearchAction" }), Schema.Struct({ - type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + type: Schema.Literal("open_page").annotate({ + title: "OpenPageResponsesApiWebSearchActionType", + }), url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageWebSearchAction" }), + }).annotate({ title: "OpenPageResponsesApiWebSearchAction" }), Schema.Struct({ pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + type: Schema.Literal("find_in_page").annotate({ + title: "FindInPageResponsesApiWebSearchActionType", + }), url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageWebSearchAction" }), + }).annotate({ title: "FindInPageResponsesApiWebSearchAction" }), Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), - }).annotate({ title: "OtherWebSearchAction" }), + type: Schema.Literal("other").annotate({ title: "OtherResponsesApiWebSearchActionType" }), + }).annotate({ title: "OtherResponsesApiWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadResumeParams__ResponsesApiWebSearchAction" }); -export type V2ThreadStartParams__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const V2ThreadStartParams__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", +export type V2ThreadResumeParams__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadResumeParams__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeParams__TurnItemsView" }); + +export type V2ThreadResumeParams__SortDirection = "asc" | "desc"; +export const V2ThreadResumeParams__SortDirection = Schema.Literals(["asc", "desc"]).annotate({ + identifier: "V2ThreadResumeParams__SortDirection", }); -export type V2ThreadStartParams__AskForApproval = +export type V2ThreadResumeResponse__AskForApproval = | "untrusted" | "on-request" | "never" @@ -9257,7 +11576,7 @@ export type V2ThreadStartParams__AskForApproval = readonly skill_approval?: boolean; }; }; -export const V2ThreadStartParams__AskForApproval = Schema.Union( +export const V2ThreadResumeResponse__AskForApproval = Schema.Union( [ Schema.Literals(["untrusted", "on-request", "never"]), Schema.Struct({ @@ -9271,266 +11590,230 @@ export const V2ThreadStartParams__AskForApproval = Schema.Union( }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, -); - -export type V2ThreadStartParams__DynamicToolNamespaceTool = { - readonly deferLoading?: boolean; - readonly description: string; - readonly inputSchema: unknown; - readonly name: string; - readonly type: "function"; -}; -export const V2ThreadStartParams__DynamicToolNamespaceTool = Schema.Union( - [ - Schema.Struct({ - deferLoading: Schema.optionalKey(Schema.Boolean), - description: Schema.String, - inputSchema: Schema.Unknown, - name: Schema.String, - type: Schema.Literal("function").annotate({ title: "FunctionDynamicToolNamespaceToolType" }), - }).annotate({ title: "FunctionDynamicToolNamespaceTool" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadStartParams__LegacyAppPathString = string; -export const V2ThreadStartParams__LegacyAppPathString = Schema.String; - -export type V2ThreadStartParams__Personality = "none" | "friendly" | "pragmatic"; -export const V2ThreadStartParams__Personality = Schema.Literals(["none", "friendly", "pragmatic"]); +).annotate({ identifier: "V2ThreadResumeResponse__AskForApproval" }); -export type V2ThreadStartParams__SandboxMode = - | "read-only" - | "workspace-write" - | "danger-full-access"; -export const V2ThreadStartParams__SandboxMode = Schema.Literals([ - "read-only", - "workspace-write", - "danger-full-access", -]); +export type V2ThreadResumeResponse__ApprovalsReviewer = + | "user" + | "auto_review" + | "guardian_subagent"; +export const V2ThreadResumeResponse__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2ThreadResumeResponse__ApprovalsReviewer", +}); -export type V2ThreadStartParams__ThreadSource = string; -export const V2ThreadStartParams__ThreadSource = Schema.String; +export type V2ThreadResumeResponse__ModeKind = "plan" | "default"; +export const V2ThreadResumeResponse__ModeKind = Schema.Literals(["plan", "default"]).annotate({ + description: "Initial collaboration mode to use when the TUI starts.", + identifier: "V2ThreadResumeResponse__ModeKind", +}); -export type V2ThreadStartParams__ThreadStartSource = "startup" | "clear"; -export const V2ThreadStartParams__ThreadStartSource = Schema.Literals(["startup", "clear"]); +export type V2ThreadResumeResponse__ReasoningEffort = string; +export const V2ThreadResumeResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadResumeResponse__ReasoningEffort", + }), +); -export type V2ThreadStartResponse__AbsolutePathBuf = string; -export const V2ThreadStartResponse__AbsolutePathBuf = Schema.String.annotate({ +export type V2ThreadResumeResponse__AbsolutePathBuf = string; +export const V2ThreadResumeResponse__AbsolutePathBuf = Schema.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadResumeResponse__AbsolutePathBuf", }); -export type V2ThreadStartResponse__AgentPath = string; -export const V2ThreadStartResponse__AgentPath = Schema.String; - -export type V2ThreadStartResponse__AskForApproval = - | "untrusted" - | "on-request" - | "never" - | { - readonly granular: { - readonly mcp_elicitations: boolean; - readonly request_permissions?: boolean; - readonly rules: boolean; - readonly sandbox_approval: boolean; - readonly skill_approval?: boolean; - }; - }; -export const V2ThreadStartResponse__AskForApproval = Schema.Union( - [ - Schema.Literals(["untrusted", "on-request", "never"]), - Schema.Struct({ - granular: Schema.Struct({ - mcp_elicitations: Schema.Boolean, - request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - rules: Schema.Boolean, - sandbox_approval: Schema.Boolean, - skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - }), - }).annotate({ title: "GranularAskForApproval" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadStartResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2ThreadStartResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); - -export type V2ThreadStartResponse__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2ThreadStartResponse__CommandExecutionStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); - -export type V2ThreadStartResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadStartResponse__DynamicToolCallOutputContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), - ], - { mode: "oneOf" }, -); +export type V2ThreadResumeResponse__LegacyAppPathString = string; +export const V2ThreadResumeResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadResumeResponse__LegacyAppPathString", +}); -export type V2ThreadStartResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadStartResponse__DynamicToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadResumeResponse__NetworkAccess = "restricted" | "enabled"; +export const V2ThreadResumeResponse__NetworkAccess = Schema.Literals([ + "restricted", + "enabled", +]).annotate({ identifier: "V2ThreadResumeResponse__NetworkAccess" }); -export type V2ThreadStartResponse__GitInfo = { +export type V2ThreadResumeResponse__GitInfo = { readonly branch?: string | null; readonly originUrl?: string | null; readonly sha?: string | null; }; -export const V2ThreadStartResponse__GitInfo = Schema.Struct({ +export const V2ThreadResumeResponse__GitInfo = Schema.Struct({ branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ThreadResumeResponse__GitInfo" }); -export type V2ThreadStartResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; +export type V2ThreadResumeResponse__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadResumeResponse__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadResumeResponse__ThreadHistoryMode" }); + +export type V2ThreadResumeResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2ThreadStartResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, +export const V2ThreadResumeResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadResumeResponse__ThreadSectionAppearance", }); -export type V2ThreadStartResponse__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadStartResponse__ImageDetail = Schema.Literals([ +export type V2ThreadResumeResponse__AgentPath = string; +export const V2ThreadResumeResponse__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadResumeResponse__AgentPath", +}); + +export type V2ThreadResumeResponse__ThreadId = string; +export const V2ThreadResumeResponse__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadResumeResponse__ThreadId", +}); + +export type V2ThreadResumeResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; +export const V2ThreadResumeResponse__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadResumeResponse__ThreadActiveFlag" }); + +export type V2ThreadResumeResponse__ThreadSource = string; +export const V2ThreadResumeResponse__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadResumeResponse__ThreadSource", +}); + +export type V2ThreadResumeResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadResumeResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadResumeResponse__NonSteerableTurnKind" }); + +export type V2ThreadResumeResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadResumeResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadResumeResponse__MisalignmentSteer" }); + +export type V2ThreadResumeResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadResumeResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadResumeResponse__ByteRange" }); + +export type V2ThreadResumeResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadResumeResponse__ImageDetail = Schema.Literals([ "auto", "low", "high", "original", -]); - -export type V2ThreadStartResponse__LegacyAppPathString = string; -export const V2ThreadStartResponse__LegacyAppPathString = Schema.String; +]).annotate({ identifier: "V2ThreadResumeResponse__ImageDetail" }); -export type V2ThreadStartResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; +export type V2ThreadResumeResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const V2ThreadStartResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ThreadStartResponse__McpToolCallError = { readonly message: string }; -export const V2ThreadStartResponse__McpToolCallError = Schema.Struct({ message: Schema.String }); +export const V2ThreadResumeResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadResumeResponse__HookPromptFragment" }); -export type V2ThreadStartResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2ThreadStartResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), +export type V2ThreadResumeResponse__AgentMessageDelivery = "async"; +export const V2ThreadResumeResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadResumeResponse__AgentMessageDelivery", }); -export type V2ThreadStartResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadStartResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); - -export type V2ThreadStartResponse__MemoryCitationEntry = { +export type V2ThreadResumeResponse__MemoryCitationEntry = { readonly lineEnd: number; readonly lineStart: number; readonly note: string; readonly path: string; }; -export const V2ThreadStartResponse__MemoryCitationEntry = Schema.Struct({ +export const V2ThreadResumeResponse__MemoryCitationEntry = Schema.Struct({ lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), note: Schema.String, path: Schema.String, -}); +}).annotate({ identifier: "V2ThreadResumeResponse__MemoryCitationEntry" }); -export type V2ThreadStartResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadStartResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +export type V2ThreadResumeResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadResumeResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadResumeResponse__MessagePhase", }); -export type V2ThreadStartResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadStartResponse__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); +export type V2ThreadResumeResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ThreadResumeResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadResumeResponse__AsyncUserInputQuestion" }); -export type V2ThreadStartResponse__PatchApplyStatus = +export type V2ThreadResumeResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadResumeResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadResumeResponse__CommandExecutionSource" }); + +export type V2ThreadResumeResponse__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2ThreadStartResponse__PatchApplyStatus = Schema.Literals([ +export const V2ThreadResumeResponse__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ThreadResumeResponse__CommandExecutionStatus" }); -export type V2ThreadStartResponse__PatchChangeKind = +export type V2ThreadResumeResponse__PatchChangeKind = | { readonly type: "add" } | { readonly type: "delete" } | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ThreadStartResponse__PatchChangeKind = Schema.Union( +export const V2ThreadResumeResponse__PatchChangeKind = Schema.Union( [ Schema.Struct({ type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), @@ -9544,143 +11827,100 @@ export const V2ThreadStartResponse__PatchChangeKind = Schema.Union( }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); - -export type V2ThreadStartResponse__ReasoningEffort = string; -export const V2ThreadStartResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +).annotate({ identifier: "V2ThreadResumeResponse__PatchChangeKind" }); -export type V2ThreadStartResponse__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2ThreadStartResponse__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", +export type V2ThreadResumeResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadResumeResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", "completed", -]); + "failed", + "declined", +]).annotate({ identifier: "V2ThreadResumeResponse__PatchApplyStatus" }); -export type V2ThreadStartResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadResumeResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const V2ThreadStartResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); +export const V2ThreadResumeResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadResumeResponse__McpToolCallAppContext" }); -export type V2ThreadStartResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; -export const V2ThreadStartResponse__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); +export type V2ThreadResumeResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadResumeResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadResumeResponse__McpToolCallError" }); -export type V2ThreadStartResponse__ThreadId = string; -export const V2ThreadStartResponse__ThreadId = Schema.String; +export type V2ThreadResumeResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadResumeResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadResumeResponse__McpAppDisplayMode" }); -export type V2ThreadStartResponse__ThreadSource = string; -export const V2ThreadStartResponse__ThreadSource = Schema.String; +export type V2ThreadResumeResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadResumeResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadResumeResponse__McpToolCallResult" }); -export type V2ThreadStartResponse__TurnStatus = - | "completed" - | "interrupted" - | "failed" - | "inProgress"; -export const V2ThreadStartResponse__TurnStatus = Schema.Literals([ +export type V2ThreadResumeResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadResumeResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", "completed", - "interrupted", "failed", - "inProgress", -]); +]).annotate({ identifier: "V2ThreadResumeResponse__McpToolCallStatus" }); -export type V2ThreadStartResponse__WebSearchAction = - | { - readonly queries?: ReadonlyArray | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly type: "openPage"; readonly url?: string | null } - | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } - | { readonly type: "other" }; -export const V2ThreadStartResponse__WebSearchAction = Schema.Union( +export type V2ThreadResumeResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadResumeResponse__DynamicToolCallOutputContentItem = Schema.Union( [ Schema.Struct({ - queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), - }).annotate({ title: "SearchWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageWebSearchAction" }), + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), Schema.Struct({ - pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageWebSearchAction" }), + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), - }).annotate({ title: "OtherWebSearchAction" }), + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, -); - -export type V2ThreadStatusChangedNotification__ThreadActiveFlag = - | "waitingOnApproval" - | "waitingOnUserInput"; -export const V2ThreadStatusChangedNotification__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); - -export type V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown = { - readonly cacheWriteInputTokens?: number; - readonly cachedInputTokens: number; - readonly inputTokens: number; - readonly outputTokens: number; - readonly reasoningOutputTokens: number; - readonly totalTokens: number; -}; -export const V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown = Schema.Struct({ - cacheWriteInputTokens: Schema.optionalKey( - Schema.Number.annotate({ default: 0, format: "int64" }).check(Schema.isInt()), - ), - cachedInputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - inputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - outputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - reasoningOutputTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - totalTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -}); - -export type V2ThreadUnarchiveResponse__AbsolutePathBuf = string; -export const V2ThreadUnarchiveResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); +).annotate({ identifier: "V2ThreadResumeResponse__DynamicToolCallOutputContentItem" }); -export type V2ThreadUnarchiveResponse__AgentPath = string; -export const V2ThreadUnarchiveResponse__AgentPath = Schema.String; +export type V2ThreadResumeResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadResumeResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadResumeResponse__DynamicToolCallStatus" }); -export type V2ThreadUnarchiveResponse__CollabAgentStatus = +export type V2ThreadResumeResponse__CollabAgentStatus = | "pendingInit" | "running" | "interrupted" @@ -9688,7 +11928,7 @@ export type V2ThreadUnarchiveResponse__CollabAgentStatus = | "errored" | "shutdown" | "notFound"; -export const V2ThreadUnarchiveResponse__CollabAgentStatus = Schema.Literals([ +export const V2ThreadResumeResponse__CollabAgentStatus = Schema.Literals([ "pendingInit", "running", "interrupted", @@ -9696,176 +11936,336 @@ export const V2ThreadUnarchiveResponse__CollabAgentStatus = Schema.Literals([ "errored", "shutdown", "notFound", -]); +]).annotate({ identifier: "V2ThreadResumeResponse__CollabAgentStatus" }); -export type V2ThreadUnarchiveResponse__CommandExecutionStatus = +export type V2ThreadResumeResponse__CollabAgentToolCallStatus = | "inProgress" | "completed" | "failed" - | "declined"; -export const V2ThreadUnarchiveResponse__CommandExecutionStatus = Schema.Literals([ + | "interrupted"; +export const V2ThreadResumeResponse__CollabAgentToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", - "declined", -]); + "interrupted", +]).annotate({ identifier: "V2ThreadResumeResponse__CollabAgentToolCallStatus" }); -export type V2ThreadUnarchiveResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2ThreadUnarchiveResponse__DynamicToolCallOutputContentItem = Schema.Union( +export type V2ThreadResumeResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadResumeResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadResumeResponse__CollabAgentTool" }); + +export type V2ThreadResumeResponse__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2ThreadResumeResponse__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2ThreadResumeResponse__SubAgentActivityKind" }); + +export type V2ThreadResumeResponse__WebSearchAction = + | { + readonly queries?: ReadonlyArray | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const V2ThreadResumeResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), + Schema.Struct({ + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeResponse__WebSearchAction" }); + +export type V2ThreadResumeResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ThreadResumeResponse__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadResumeResponse__ImageGenerationFailure" }); -export type V2ThreadUnarchiveResponse__DynamicToolCallStatus = - | "inProgress" +export type V2ThreadResumeResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadResumeResponse__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeResponse__TurnItemsView" }); + +export type V2ThreadResumeResponse__TurnStatus = | "completed" - | "failed"; -export const V2ThreadUnarchiveResponse__DynamicToolCallStatus = Schema.Literals([ - "inProgress", + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadResumeResponse__TurnStatus = Schema.Literals([ "completed", + "interrupted", "failed", -]); + "inProgress", +]).annotate({ identifier: "V2ThreadResumeResponse__TurnStatus" }); -export type V2ThreadUnarchiveResponse__GitInfo = { +export type V2ThreadRevertResponse__AbsolutePathBuf = string; +export const V2ThreadRevertResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadRevertResponse__AbsolutePathBuf", +}); + +export type V2ThreadRevertResponse__GitInfo = { readonly branch?: string | null; readonly originUrl?: string | null; readonly sha?: string | null; }; -export const V2ThreadUnarchiveResponse__GitInfo = Schema.Struct({ +export const V2ThreadRevertResponse__GitInfo = Schema.Struct({ branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "V2ThreadRevertResponse__GitInfo" }); -export type V2ThreadUnarchiveResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const V2ThreadUnarchiveResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); - -export type V2ThreadUnarchiveResponse__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2ThreadUnarchiveResponse__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); +export type V2ThreadRevertResponse__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadRevertResponse__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadRevertResponse__ThreadHistoryMode" }); -export type V2ThreadUnarchiveResponse__LegacyAppPathString = string; -export const V2ThreadUnarchiveResponse__LegacyAppPathString = Schema.String; +export type V2ThreadRevertResponse__ReasoningEffort = string; +export const V2ThreadRevertResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadRevertResponse__ReasoningEffort", + }), +); -export type V2ThreadUnarchiveResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; +export type V2ThreadRevertResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2ThreadUnarchiveResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export const V2ThreadRevertResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadRevertResponse__ThreadSectionAppearance", }); -export type V2ThreadUnarchiveResponse__McpToolCallError = { readonly message: string }; -export const V2ThreadUnarchiveResponse__McpToolCallError = Schema.Struct({ - message: Schema.String, +export type V2ThreadRevertResponse__AgentPath = string; +export const V2ThreadRevertResponse__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadRevertResponse__AgentPath", }); -export type V2ThreadUnarchiveResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2ThreadUnarchiveResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), +export type V2ThreadRevertResponse__ThreadId = string; +export const V2ThreadRevertResponse__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadRevertResponse__ThreadId", }); -export type V2ThreadUnarchiveResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2ThreadUnarchiveResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadRevertResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; +export const V2ThreadRevertResponse__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadRevertResponse__ThreadActiveFlag" }); -export type V2ThreadUnarchiveResponse__MemoryCitationEntry = { +export type V2ThreadRevertResponse__ThreadSource = string; +export const V2ThreadRevertResponse__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadRevertResponse__ThreadSource", +}); + +export type V2ThreadRevertResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadRevertResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadRevertResponse__NonSteerableTurnKind" }); + +export type V2ThreadRevertResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadRevertResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadRevertResponse__MisalignmentSteer" }); + +export type V2ThreadRevertResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadRevertResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadRevertResponse__ByteRange" }); + +export type V2ThreadRevertResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadRevertResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadRevertResponse__ImageDetail" }); + +export type V2ThreadRevertResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; +}; +export const V2ThreadRevertResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadRevertResponse__HookPromptFragment" }); + +export type V2ThreadRevertResponse__AgentMessageDelivery = "async"; +export const V2ThreadRevertResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadRevertResponse__AgentMessageDelivery", +}); + +export type V2ThreadRevertResponse__MemoryCitationEntry = { readonly lineEnd: number; readonly lineStart: number; readonly note: string; readonly path: string; }; -export const V2ThreadUnarchiveResponse__MemoryCitationEntry = Schema.Struct({ +export const V2ThreadRevertResponse__MemoryCitationEntry = Schema.Struct({ lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), note: Schema.String, path: Schema.String, -}); +}).annotate({ identifier: "V2ThreadRevertResponse__MemoryCitationEntry" }); -export type V2ThreadUnarchiveResponse__MessagePhase = "commentary" | "final_answer"; -export const V2ThreadUnarchiveResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +export type V2ThreadRevertResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadRevertResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadRevertResponse__MessagePhase", }); -export type V2ThreadUnarchiveResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2ThreadUnarchiveResponse__NonSteerableTurnKind = Schema.Literals([ - "review", - "compact", -]); +export type V2ThreadRevertResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ThreadRevertResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadRevertResponse__AsyncUserInputQuestion" }); -export type V2ThreadUnarchiveResponse__PatchApplyStatus = +export type V2ThreadRevertResponse__LegacyAppPathString = string; +export const V2ThreadRevertResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadRevertResponse__LegacyAppPathString", +}); + +export type V2ThreadRevertResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadRevertResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadRevertResponse__CommandExecutionSource" }); + +export type V2ThreadRevertResponse__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2ThreadUnarchiveResponse__PatchApplyStatus = Schema.Literals([ +export const V2ThreadRevertResponse__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ThreadRevertResponse__CommandExecutionStatus" }); -export type V2ThreadUnarchiveResponse__PatchChangeKind = +export type V2ThreadRevertResponse__PatchChangeKind = | { readonly type: "add" } | { readonly type: "delete" } | { readonly move_path?: string | null; readonly type: "update" }; -export const V2ThreadUnarchiveResponse__PatchChangeKind = Schema.Union( +export const V2ThreadRevertResponse__PatchChangeKind = Schema.Union( [ Schema.Struct({ type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), @@ -9879,159 +12279,69 @@ export const V2ThreadUnarchiveResponse__PatchChangeKind = Schema.Union( }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); - -export type V2ThreadUnarchiveResponse__ReasoningEffort = string; -export const V2ThreadUnarchiveResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); - -export type V2ThreadUnarchiveResponse__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2ThreadUnarchiveResponse__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", - "completed", -]); - -export type V2ThreadUnarchiveResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; -}; -export const V2ThreadUnarchiveResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); - -export type V2ThreadUnarchiveResponse__ThreadActiveFlag = - | "waitingOnApproval" - | "waitingOnUserInput"; -export const V2ThreadUnarchiveResponse__ThreadActiveFlag = Schema.Literals([ - "waitingOnApproval", - "waitingOnUserInput", -]); - -export type V2ThreadUnarchiveResponse__ThreadId = string; -export const V2ThreadUnarchiveResponse__ThreadId = Schema.String; +).annotate({ identifier: "V2ThreadRevertResponse__PatchChangeKind" }); -export type V2ThreadUnarchiveResponse__ThreadSource = string; -export const V2ThreadUnarchiveResponse__ThreadSource = Schema.String; - -export type V2ThreadUnarchiveResponse__TurnStatus = +export type V2ThreadRevertResponse__PatchApplyStatus = + | "inProgress" | "completed" - | "interrupted" | "failed" - | "inProgress"; -export const V2ThreadUnarchiveResponse__TurnStatus = Schema.Literals([ + | "declined"; +export const V2ThreadRevertResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", "completed", - "interrupted", "failed", - "inProgress", -]); - -export type V2ThreadUnarchiveResponse__WebSearchAction = - | { - readonly queries?: ReadonlyArray | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly type: "openPage"; readonly url?: string | null } - | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } - | { readonly type: "other" }; -export const V2ThreadUnarchiveResponse__WebSearchAction = Schema.Union( - [ - Schema.Struct({ - queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), - }).annotate({ title: "SearchWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageWebSearchAction" }), - Schema.Struct({ - pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), - }).annotate({ title: "OtherWebSearchAction" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadUnsubscribeResponse__ThreadUnsubscribeStatus = - | "notLoaded" - | "notSubscribed" - | "unsubscribed"; -export const V2ThreadUnsubscribeResponse__ThreadUnsubscribeStatus = Schema.Literals([ - "notLoaded", - "notSubscribed", - "unsubscribed", -]); - -export type V2TurnCompletedNotification__AbsolutePathBuf = string; -export const V2TurnCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); + "declined", +]).annotate({ identifier: "V2ThreadRevertResponse__PatchApplyStatus" }); -export type V2TurnCompletedNotification__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2TurnCompletedNotification__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +export type V2ThreadRevertResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; +}; +export const V2ThreadRevertResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadRevertResponse__McpToolCallAppContext" }); -export type V2TurnCompletedNotification__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2TurnCompletedNotification__CommandExecutionStatus = Schema.Literals([ +export type V2ThreadRevertResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadRevertResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadRevertResponse__McpToolCallError" }); + +export type V2ThreadRevertResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadRevertResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadRevertResponse__McpAppDisplayMode" }); + +export type V2ThreadRevertResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadRevertResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadRevertResponse__McpToolCallResult" }); + +export type V2ThreadRevertResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadRevertResponse__McpToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", - "declined", -]); +]).annotate({ identifier: "V2ThreadRevertResponse__McpToolCallStatus" }); -export type V2TurnCompletedNotification__DynamicToolCallOutputContentItem = +export type V2ThreadRevertResponse__DynamicToolCallOutputContentItem = | { readonly text: string; readonly type: "inputText" } | { readonly imageUrl: string; readonly type: "inputImage" } | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2TurnCompletedNotification__DynamicToolCallOutputContentItem = Schema.Union( +export const V2ThreadRevertResponse__DynamicToolCallOutputContentItem = Schema.Union( [ Schema.Struct({ text: Schema.String, @@ -10053,195 +12363,80 @@ export const V2TurnCompletedNotification__DynamicToolCallOutputContentItem = Sch }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadRevertResponse__DynamicToolCallOutputContentItem" }); -export type V2TurnCompletedNotification__DynamicToolCallStatus = - | "inProgress" - | "completed" - | "failed"; -export const V2TurnCompletedNotification__DynamicToolCallStatus = Schema.Literals([ +export type V2ThreadRevertResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadRevertResponse__DynamicToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", -]); - -export type V2TurnCompletedNotification__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; -}; -export const V2TurnCompletedNotification__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); - -export type V2TurnCompletedNotification__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2TurnCompletedNotification__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); - -export type V2TurnCompletedNotification__LegacyAppPathString = string; -export const V2TurnCompletedNotification__LegacyAppPathString = Schema.String; - -export type V2TurnCompletedNotification__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; -}; -export const V2TurnCompletedNotification__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2TurnCompletedNotification__McpToolCallError = { readonly message: string }; -export const V2TurnCompletedNotification__McpToolCallError = Schema.Struct({ - message: Schema.String, -}); - -export type V2TurnCompletedNotification__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2TurnCompletedNotification__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), -}); +]).annotate({ identifier: "V2ThreadRevertResponse__DynamicToolCallStatus" }); -export type V2TurnCompletedNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2TurnCompletedNotification__McpToolCallStatus = Schema.Literals([ - "inProgress", +export type V2ThreadRevertResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadRevertResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", "completed", - "failed", -]); - -export type V2TurnCompletedNotification__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; -}; -export const V2TurnCompletedNotification__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, -}); - -export type V2TurnCompletedNotification__MessagePhase = "commentary" | "final_answer"; -export const V2TurnCompletedNotification__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', -}); - -export type V2TurnCompletedNotification__NonSteerableTurnKind = "review" | "compact"; -export const V2TurnCompletedNotification__NonSteerableTurnKind = Schema.Literals([ - "review", - "compact", -]); + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadRevertResponse__CollabAgentStatus" }); -export type V2TurnCompletedNotification__PatchApplyStatus = +export type V2ThreadRevertResponse__CollabAgentToolCallStatus = | "inProgress" | "completed" | "failed" - | "declined"; -export const V2TurnCompletedNotification__PatchApplyStatus = Schema.Literals([ + | "interrupted"; +export const V2ThreadRevertResponse__CollabAgentToolCallStatus = Schema.Literals([ "inProgress", "completed", "failed", - "declined", -]); - -export type V2TurnCompletedNotification__PatchChangeKind = - | { readonly type: "add" } - | { readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update" }; -export const V2TurnCompletedNotification__PatchChangeKind = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), - }).annotate({ title: "AddPatchChangeKind" }), - Schema.Struct({ - type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), - }).annotate({ title: "DeletePatchChangeKind" }), - Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), - }).annotate({ title: "UpdatePatchChangeKind" }), - ], - { mode: "oneOf" }, -); + "interrupted", +]).annotate({ identifier: "V2ThreadRevertResponse__CollabAgentToolCallStatus" }); -export type V2TurnCompletedNotification__ReasoningEffort = string; -export const V2TurnCompletedNotification__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +export type V2ThreadRevertResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadRevertResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadRevertResponse__CollabAgentTool" }); -export type V2TurnCompletedNotification__SubAgentActivityKind = +export type V2ThreadRevertResponse__SubAgentActivityKind = | "started" | "interacted" | "interrupted" | "completed"; -export const V2TurnCompletedNotification__SubAgentActivityKind = Schema.Literals([ +export const V2ThreadRevertResponse__SubAgentActivityKind = Schema.Literals([ "started", "interacted", "interrupted", "completed", -]); - -export type V2TurnCompletedNotification__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; -}; -export const V2TurnCompletedNotification__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), -}); - -export type V2TurnCompletedNotification__TurnStatus = - | "completed" - | "interrupted" - | "failed" - | "inProgress"; -export const V2TurnCompletedNotification__TurnStatus = Schema.Literals([ - "completed", - "interrupted", - "failed", - "inProgress", -]); +]).annotate({ identifier: "V2ThreadRevertResponse__SubAgentActivityKind" }); -export type V2TurnCompletedNotification__WebSearchAction = +export type V2ThreadRevertResponse__WebSearchAction = | { readonly queries?: ReadonlyArray | null; readonly query?: string | null; @@ -10250,7 +12445,7 @@ export type V2TurnCompletedNotification__WebSearchAction = | { readonly type: "openPage"; readonly url?: string | null } | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } | { readonly type: "other" }; -export const V2TurnCompletedNotification__WebSearchAction = Schema.Union( +export const V2ThreadRevertResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), @@ -10271,323 +12466,143 @@ export const V2TurnCompletedNotification__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); - -export type V2TurnPlanUpdatedNotification__TurnPlanStepStatus = - | "pending" - | "inProgress" - | "completed"; -export const V2TurnPlanUpdatedNotification__TurnPlanStepStatus = Schema.Literals([ - "pending", - "inProgress", - "completed", -]); - -export type V2TurnStartedNotification__AbsolutePathBuf = string; -export const V2TurnStartedNotification__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2TurnStartedNotification__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2TurnStartedNotification__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); - -export type V2TurnStartedNotification__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2TurnStartedNotification__CommandExecutionStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); +).annotate({ identifier: "V2ThreadRevertResponse__WebSearchAction" }); -export type V2TurnStartedNotification__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2TurnStartedNotification__DynamicToolCallOutputContentItem = Schema.Union( +export type V2ThreadRevertResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ThreadRevertResponse__ImageGenerationFailure = Schema.Union( [ Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadRevertResponse__ImageGenerationFailure" }); -export type V2TurnStartedNotification__DynamicToolCallStatus = - | "inProgress" +export type V2ThreadRevertResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadRevertResponse__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadRevertResponse__TurnItemsView" }); + +export type V2ThreadRevertResponse__TurnStatus = | "completed" - | "failed"; -export const V2TurnStartedNotification__DynamicToolCallStatus = Schema.Literals([ - "inProgress", + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadRevertResponse__TurnStatus = Schema.Literals([ "completed", + "interrupted", "failed", -]); + "inProgress", +]).annotate({ identifier: "V2ThreadRevertResponse__TurnStatus" }); -export type V2TurnStartedNotification__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; +export type V2ThreadSectionCreateParams__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2TurnStartedNotification__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, +export const V2ThreadSectionCreateParams__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadSectionCreateParams__ThreadSectionAppearance", }); -export type V2TurnStartedNotification__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2TurnStartedNotification__ImageDetail = Schema.Literals([ - "auto", - "low", - "high", - "original", -]); - -export type V2TurnStartedNotification__LegacyAppPathString = string; -export const V2TurnStartedNotification__LegacyAppPathString = Schema.String; - -export type V2TurnStartedNotification__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; +export type V2ThreadSectionCreateResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2TurnStartedNotification__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2TurnStartedNotification__McpToolCallError = { readonly message: string }; -export const V2TurnStartedNotification__McpToolCallError = Schema.Struct({ - message: Schema.String, +export const V2ThreadSectionCreateResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadSectionCreateResponse__ThreadSectionAppearance", }); -export type V2TurnStartedNotification__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; +export type V2ThreadSectionListResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2TurnStartedNotification__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), +export const V2ThreadSectionListResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadSectionListResponse__ThreadSectionAppearance", }); -export type V2TurnStartedNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2TurnStartedNotification__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); - -export type V2TurnStartedNotification__MemoryCitationEntry = { - readonly lineEnd: number; - readonly lineStart: number; - readonly note: string; - readonly path: string; +export type V2ThreadSectionUpdateParams__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const V2TurnStartedNotification__MemoryCitationEntry = Schema.Struct({ - lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - note: Schema.String, - path: Schema.String, +export const V2ThreadSectionUpdateParams__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadSectionUpdateParams__ThreadSectionAppearance", }); -export type V2TurnStartedNotification__MessagePhase = "commentary" | "final_answer"; -export const V2TurnStartedNotification__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ - description: - 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', +export type V2ThreadSectionUpdateResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; +}; +export const V2ThreadSectionUpdateResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadSectionUpdateResponse__ThreadSectionAppearance", }); -export type V2TurnStartedNotification__NonSteerableTurnKind = "review" | "compact"; -export const V2TurnStartedNotification__NonSteerableTurnKind = Schema.Literals([ - "review", - "compact", -]); - -export type V2TurnStartedNotification__PatchApplyStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2TurnStartedNotification__PatchApplyStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); - -export type V2TurnStartedNotification__PatchChangeKind = - | { readonly type: "add" } - | { readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update" }; -export const V2TurnStartedNotification__PatchChangeKind = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), - }).annotate({ title: "AddPatchChangeKind" }), - Schema.Struct({ - type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), - }).annotate({ title: "DeletePatchChangeKind" }), - Schema.Struct({ - move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), - }).annotate({ title: "UpdatePatchChangeKind" }), - ], - { mode: "oneOf" }, -); - -export type V2TurnStartedNotification__ReasoningEffort = string; -export const V2TurnStartedNotification__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); - -export type V2TurnStartedNotification__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2TurnStartedNotification__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", - "completed", -]); - -export type V2TurnStartedNotification__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadSettingsUpdatedNotification__ActivePermissionProfile = { + readonly extends?: string | null; + readonly id: string; }; -export const V2TurnStartedNotification__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( +export const V2ThreadSettingsUpdatedNotification__ActivePermissionProfile = Schema.Struct({ + extends: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", + description: + "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", }), Schema.Null, ]), ), -}); - -export type V2TurnStartedNotification__TurnStatus = - | "completed" - | "interrupted" - | "failed" - | "inProgress"; -export const V2TurnStartedNotification__TurnStatus = Schema.Literals([ - "completed", - "interrupted", - "failed", - "inProgress", -]); - -export type V2TurnStartedNotification__WebSearchAction = - | { - readonly queries?: ReadonlyArray | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly type: "openPage"; readonly url?: string | null } - | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } - | { readonly type: "other" }; -export const V2TurnStartedNotification__WebSearchAction = Schema.Union( - [ - Schema.Struct({ - queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), - }).annotate({ title: "SearchWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "OpenPageWebSearchAction" }), - Schema.Struct({ - pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), - url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }).annotate({ title: "FindInPageWebSearchAction" }), - Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), - }).annotate({ title: "OtherWebSearchAction" }), - ], - { mode: "oneOf" }, -); - -export type V2TurnStartParams__AbsolutePathBuf = string; -export const V2TurnStartParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2TurnStartParams__AdditionalContextKind = "untrusted" | "application"; -export const V2TurnStartParams__AdditionalContextKind = Schema.Literals([ - "untrusted", - "application", -]); - -export type V2TurnStartParams__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const V2TurnStartParams__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); + id: Schema.String.annotate({ + description: + "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + }), +}).annotate({ identifier: "V2ThreadSettingsUpdatedNotification__ActivePermissionProfile" }); -export type V2TurnStartParams__AskForApproval = +export type V2ThreadSettingsUpdatedNotification__AskForApproval = | "untrusted" | "on-request" | "never" @@ -10600,7 +12615,7 @@ export type V2TurnStartParams__AskForApproval = readonly skill_approval?: boolean; }; }; -export const V2TurnStartParams__AskForApproval = Schema.Union( +export const V2ThreadSettingsUpdatedNotification__AskForApproval = Schema.Union( [ Schema.Literals(["untrusted", "on-request", "never"]), Schema.Struct({ @@ -10614,29 +12629,70 @@ export const V2TurnStartParams__AskForApproval = Schema.Union( }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, -); - -export type V2TurnStartParams__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2TurnStartParams__ImageDetail = Schema.Literals(["auto", "low", "high", "original"]); +).annotate({ identifier: "V2ThreadSettingsUpdatedNotification__AskForApproval" }); -export type V2TurnStartParams__LegacyAppPathString = string; -export const V2TurnStartParams__LegacyAppPathString = Schema.String; +export type V2ThreadSettingsUpdatedNotification__ApprovalsReviewer = + | "user" + | "auto_review" + | "guardian_subagent"; +export const V2ThreadSettingsUpdatedNotification__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2ThreadSettingsUpdatedNotification__ApprovalsReviewer", +}); -export type V2TurnStartParams__ModeKind = "plan" | "default"; -export const V2TurnStartParams__ModeKind = Schema.Literals(["plan", "default"]).annotate({ +export type V2ThreadSettingsUpdatedNotification__ModeKind = "plan" | "default"; +export const V2ThreadSettingsUpdatedNotification__ModeKind = Schema.Literals([ + "plan", + "default", +]).annotate({ description: "Initial collaboration mode to use when the TUI starts.", + identifier: "V2ThreadSettingsUpdatedNotification__ModeKind", }); -export type V2TurnStartParams__Personality = "none" | "friendly" | "pragmatic"; -export const V2TurnStartParams__Personality = Schema.Literals(["none", "friendly", "pragmatic"]); - -export type V2TurnStartParams__ReasoningEffort = string; -export const V2TurnStartParams__ReasoningEffort = Schema.String.annotate({ +export type V2ThreadSettingsUpdatedNotification__ReasoningEffort = string; +export const V2ThreadSettingsUpdatedNotification__ReasoningEffort = Schema.String.annotate({ description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadSettingsUpdatedNotification__ReasoningEffort", + }), +); -export type V2TurnStartParams__ReasoningSummary = "auto" | "concise" | "detailed" | "none"; -export const V2TurnStartParams__ReasoningSummary = Schema.Union( +export type V2ThreadSettingsUpdatedNotification__AbsolutePathBuf = string; +export const V2ThreadSettingsUpdatedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadSettingsUpdatedNotification__AbsolutePathBuf", +}); + +export type V2ThreadSettingsUpdatedNotification__Personality = "none" | "friendly" | "pragmatic"; +export const V2ThreadSettingsUpdatedNotification__Personality = Schema.Literals([ + "none", + "friendly", + "pragmatic", +]).annotate({ + description: "Deprecated: `friendly` and `pragmatic` no longer select a style.", + identifier: "V2ThreadSettingsUpdatedNotification__Personality", +}); + +export type V2ThreadSettingsUpdatedNotification__NetworkAccess = "restricted" | "enabled"; +export const V2ThreadSettingsUpdatedNotification__NetworkAccess = Schema.Literals([ + "restricted", + "enabled", +]).annotate({ identifier: "V2ThreadSettingsUpdatedNotification__NetworkAccess" }); + +export type V2ThreadSettingsUpdatedNotification__ReasoningSummary = + | "auto" + | "concise" + | "detailed" + | "none"; +export const V2ThreadSettingsUpdatedNotification__ReasoningSummary = Schema.Union( [ Schema.Literals(["auto", "concise", "detailed"]), Schema.Literal("none").annotate({ description: "Option to disable reasoning summaries." }), @@ -10645,206 +12701,210 @@ export const V2TurnStartParams__ReasoningSummary = Schema.Union( ).annotate({ description: "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + identifier: "V2ThreadSettingsUpdatedNotification__ReasoningSummary", }); -export type V2TurnStartParams__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadStartedNotification__AbsolutePathBuf = string; +export const V2ThreadStartedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadStartedNotification__AbsolutePathBuf", +}); + +export type V2ThreadStartedNotification__GitInfo = { + readonly branch?: string | null; + readonly originUrl?: string | null; + readonly sha?: string | null; }; -export const V2TurnStartParams__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", +export const V2ThreadStartedNotification__GitInfo = Schema.Struct({ + branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadStartedNotification__GitInfo" }); + +export type V2ThreadStartedNotification__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadStartedNotification__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadStartedNotification__ThreadHistoryMode" }); + +export type V2ThreadStartedNotification__ReasoningEffort = string; +export const V2ThreadStartedNotification__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadStartedNotification__ReasoningEffort", }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", - }), - Schema.Null, - ]), - ), +); + +export type V2ThreadStartedNotification__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; +}; +export const V2ThreadStartedNotification__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadStartedNotification__ThreadSectionAppearance", }); -export type V2TurnStartResponse__AbsolutePathBuf = string; -export const V2TurnStartResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +export type V2ThreadStartedNotification__AgentPath = string; +export const V2ThreadStartedNotification__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadStartedNotification__AgentPath", }); -export type V2TurnStartResponse__CollabAgentStatus = - | "pendingInit" - | "running" - | "interrupted" - | "completed" - | "errored" - | "shutdown" - | "notFound"; -export const V2TurnStartResponse__CollabAgentStatus = Schema.Literals([ - "pendingInit", - "running", - "interrupted", - "completed", - "errored", - "shutdown", - "notFound", -]); +export type V2ThreadStartedNotification__ThreadId = string; +export const V2ThreadStartedNotification__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadStartedNotification__ThreadId", +}); -export type V2TurnStartResponse__CommandExecutionStatus = - | "inProgress" - | "completed" - | "failed" - | "declined"; -export const V2TurnStartResponse__CommandExecutionStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "declined", -]); +export type V2ThreadStartedNotification__ThreadActiveFlag = + | "waitingOnApproval" + | "waitingOnUserInput"; +export const V2ThreadStartedNotification__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadStartedNotification__ThreadActiveFlag" }); -export type V2TurnStartResponse__DynamicToolCallOutputContentItem = - | { readonly text: string; readonly type: "inputText" } - | { readonly imageUrl: string; readonly type: "inputImage" } - | { readonly audioUrl: string; readonly type: "inputAudio" }; -export const V2TurnStartResponse__DynamicToolCallOutputContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("inputText").annotate({ - title: "InputTextDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), - Schema.Struct({ - imageUrl: Schema.String, - type: Schema.Literal("inputImage").annotate({ - title: "InputImageDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), - Schema.Struct({ - audioUrl: Schema.String, - type: Schema.Literal("inputAudio").annotate({ - title: "InputAudioDynamicToolCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), - ], - { mode: "oneOf" }, -); +export type V2ThreadStartedNotification__ThreadSource = string; +export const V2ThreadStartedNotification__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadStartedNotification__ThreadSource", +}); -export type V2TurnStartResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2TurnStartResponse__DynamicToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); +export type V2ThreadStartedNotification__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadStartedNotification__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadStartedNotification__NonSteerableTurnKind" }); -export type V2TurnStartResponse__HookPromptFragment = { - readonly hookRunId: string; - readonly text: string; +export type V2ThreadStartedNotification__MisalignmentSteer = { readonly message: string }; +export const V2ThreadStartedNotification__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadStartedNotification__MisalignmentSteer" }); + +export type V2ThreadStartedNotification__ByteRange = { + readonly end: number; + readonly start: number; }; -export const V2TurnStartResponse__HookPromptFragment = Schema.Struct({ - hookRunId: Schema.String, - text: Schema.String, -}); +export const V2ThreadStartedNotification__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadStartedNotification__ByteRange" }); -export type V2TurnStartResponse__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2TurnStartResponse__ImageDetail = Schema.Literals([ +export type V2ThreadStartedNotification__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadStartedNotification__ImageDetail = Schema.Literals([ "auto", "low", "high", "original", -]); +]).annotate({ identifier: "V2ThreadStartedNotification__ImageDetail" }); -export type V2TurnStartResponse__LegacyAppPathString = string; -export const V2TurnStartResponse__LegacyAppPathString = Schema.String; - -export type V2TurnStartResponse__McpToolCallAppContext = { - readonly actionName?: string | null; - readonly appName?: string | null; - readonly connectorId: string; - readonly linkId?: string | null; - readonly resourceUri?: string | null; +export type V2ThreadStartedNotification__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const V2TurnStartResponse__McpToolCallAppContext = Schema.Struct({ - actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorId: Schema.String, - linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2TurnStartResponse__McpToolCallError = { readonly message: string }; -export const V2TurnStartResponse__McpToolCallError = Schema.Struct({ message: Schema.String }); +export const V2ThreadStartedNotification__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadStartedNotification__HookPromptFragment" }); -export type V2TurnStartResponse__McpToolCallResult = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; - readonly structuredContent?: unknown; -}; -export const V2TurnStartResponse__McpToolCallResult = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), - structuredContent: Schema.optionalKey(Schema.Unknown), +export type V2ThreadStartedNotification__AgentMessageDelivery = "async"; +export const V2ThreadStartedNotification__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadStartedNotification__AgentMessageDelivery", }); -export type V2TurnStartResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; -export const V2TurnStartResponse__McpToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", -]); - -export type V2TurnStartResponse__MemoryCitationEntry = { +export type V2ThreadStartedNotification__MemoryCitationEntry = { readonly lineEnd: number; readonly lineStart: number; readonly note: string; readonly path: string; }; -export const V2TurnStartResponse__MemoryCitationEntry = Schema.Struct({ +export const V2ThreadStartedNotification__MemoryCitationEntry = Schema.Struct({ lineEnd: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), lineStart: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), note: Schema.String, path: Schema.String, -}); +}).annotate({ identifier: "V2ThreadStartedNotification__MemoryCitationEntry" }); -export type V2TurnStartResponse__MessagePhase = "commentary" | "final_answer"; -export const V2TurnStartResponse__MessagePhase = Schema.Literals([ - "commentary", - "final_answer", -]).annotate({ +export type V2ThreadStartedNotification__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadStartedNotification__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadStartedNotification__MessagePhase", }); -export type V2TurnStartResponse__NonSteerableTurnKind = "review" | "compact"; -export const V2TurnStartResponse__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); +export type V2ThreadStartedNotification__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; +}; +export const V2ThreadStartedNotification__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadStartedNotification__AsyncUserInputQuestion" }); -export type V2TurnStartResponse__PatchApplyStatus = +export type V2ThreadStartedNotification__LegacyAppPathString = string; +export const V2ThreadStartedNotification__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadStartedNotification__LegacyAppPathString", +}); + +export type V2ThreadStartedNotification__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadStartedNotification__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadStartedNotification__CommandExecutionSource" }); + +export type V2ThreadStartedNotification__CommandExecutionStatus = | "inProgress" | "completed" | "failed" | "declined"; -export const V2TurnStartResponse__PatchApplyStatus = Schema.Literals([ +export const V2ThreadStartedNotification__CommandExecutionStatus = Schema.Literals([ "inProgress", "completed", "failed", "declined", -]); +]).annotate({ identifier: "V2ThreadStartedNotification__CommandExecutionStatus" }); -export type V2TurnStartResponse__PatchChangeKind = +export type V2ThreadStartedNotification__PatchChangeKind = | { readonly type: "add" } | { readonly type: "delete" } | { readonly move_path?: string | null; readonly type: "update" }; -export const V2TurnStartResponse__PatchChangeKind = Schema.Union( +export const V2ThreadStartedNotification__PatchChangeKind = Schema.Union( [ Schema.Struct({ type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), @@ -10858,59 +12918,167 @@ export const V2TurnStartResponse__PatchChangeKind = Schema.Union( }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); - -export type V2TurnStartResponse__ReasoningEffort = string; -export const V2TurnStartResponse__ReasoningEffort = Schema.String.annotate({ - description: "A non-empty reasoning effort value advertised by the model.", -}).check(Schema.isMinLength(1)); +).annotate({ identifier: "V2ThreadStartedNotification__PatchChangeKind" }); -export type V2TurnStartResponse__SubAgentActivityKind = - | "started" - | "interacted" - | "interrupted" - | "completed"; -export const V2TurnStartResponse__SubAgentActivityKind = Schema.Literals([ - "started", - "interacted", - "interrupted", +export type V2ThreadStartedNotification__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadStartedNotification__PatchApplyStatus = Schema.Literals([ + "inProgress", "completed", -]); + "failed", + "declined", +]).annotate({ identifier: "V2ThreadStartedNotification__PatchApplyStatus" }); -export type V2TurnStartResponse__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadStartedNotification__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const V2TurnStartResponse__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", +export const V2ThreadStartedNotification__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadStartedNotification__McpToolCallAppContext" }); + +export type V2ThreadStartedNotification__McpToolCallError = { readonly message: string }; +export const V2ThreadStartedNotification__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadStartedNotification__McpToolCallError" }); + +export type V2ThreadStartedNotification__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadStartedNotification__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadStartedNotification__McpAppDisplayMode" }); + +export type V2ThreadStartedNotification__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadStartedNotification__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadStartedNotification__McpToolCallResult" }); + +export type V2ThreadStartedNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadStartedNotification__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadStartedNotification__McpToolCallStatus" }); + +export type V2ThreadStartedNotification__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadStartedNotification__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", }), - Schema.Null, - ]), - ), -}); + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartedNotification__DynamicToolCallOutputContentItem" }); -export type V2TurnStartResponse__TurnStatus = "completed" | "interrupted" | "failed" | "inProgress"; -export const V2TurnStartResponse__TurnStatus = Schema.Literals([ +export type V2ThreadStartedNotification__DynamicToolCallStatus = + | "inProgress" + | "completed" + | "failed"; +export const V2ThreadStartedNotification__DynamicToolCallStatus = Schema.Literals([ + "inProgress", "completed", - "interrupted", "failed", +]).annotate({ identifier: "V2ThreadStartedNotification__DynamicToolCallStatus" }); + +export type V2ThreadStartedNotification__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadStartedNotification__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadStartedNotification__CollabAgentStatus" }); + +export type V2ThreadStartedNotification__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2ThreadStartedNotification__CollabAgentToolCallStatus = Schema.Literals([ "inProgress", -]); + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2ThreadStartedNotification__CollabAgentToolCallStatus" }); -export type V2TurnStartResponse__WebSearchAction = +export type V2ThreadStartedNotification__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadStartedNotification__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadStartedNotification__CollabAgentTool" }); + +export type V2ThreadStartedNotification__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2ThreadStartedNotification__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2ThreadStartedNotification__SubAgentActivityKind" }); + +export type V2ThreadStartedNotification__WebSearchAction = | { readonly queries?: ReadonlyArray | null; readonly query?: string | null; @@ -10919,7 +13087,7 @@ export type V2TurnStartResponse__WebSearchAction = | { readonly type: "openPage"; readonly url?: string | null } | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } | { readonly type: "other" }; -export const V2TurnStartResponse__WebSearchAction = Schema.Union( +export const V2ThreadStartedNotification__WebSearchAction = Schema.Union( [ Schema.Struct({ queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), @@ -10940,4638 +13108,3776 @@ export const V2TurnStartResponse__WebSearchAction = Schema.Union( }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); - -export type V2TurnSteerParams__AdditionalContextKind = "untrusted" | "application"; -export const V2TurnSteerParams__AdditionalContextKind = Schema.Literals([ - "untrusted", - "application", -]); +).annotate({ identifier: "V2ThreadStartedNotification__WebSearchAction" }); -export type V2TurnSteerParams__ImageDetail = "auto" | "low" | "high" | "original"; -export const V2TurnSteerParams__ImageDetail = Schema.Literals(["auto", "low", "high", "original"]); - -export type V2TurnSteerParams__TextElement = { - readonly byteRange: { readonly end: number; readonly start: number }; - readonly placeholder?: string | null; +export type V2ThreadStartedNotification__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; }; -export const V2TurnSteerParams__TextElement = Schema.Struct({ - byteRange: Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ - description: "Byte range in the parent `text` buffer that this element occupies.", - }), - placeholder: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional human-readable placeholder for the element, displayed in the UI.", +export const V2ThreadStartedNotification__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", }), - Schema.Null, - ]), - ), -}); - -export type V2WindowsSandboxReadinessResponse__WindowsSandboxReadiness = - | "ready" - | "notConfigured" - | "updateRequired"; -export const V2WindowsSandboxReadinessResponse__WindowsSandboxReadiness = Schema.Literals([ - "ready", - "notConfigured", - "updateRequired", -]); - -export type V2WindowsSandboxSetupCompletedNotification__WindowsSandboxSetupMode = - | "elevated" - | "unelevated"; -export const V2WindowsSandboxSetupCompletedNotification__WindowsSandboxSetupMode = Schema.Literals([ - "elevated", - "unelevated", -]); - -export type V2WindowsSandboxSetupStartParams__AbsolutePathBuf = string; -export const V2WindowsSandboxSetupStartParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2WindowsSandboxSetupStartParams__WindowsSandboxSetupMode = "elevated" | "unelevated"; -export const V2WindowsSandboxSetupStartParams__WindowsSandboxSetupMode = Schema.Literals([ - "elevated", - "unelevated", -]); - -export type ApplyPatchApprovalResponse__NetworkPolicyAmendment = { - readonly action: ApplyPatchApprovalResponse__NetworkPolicyRuleAction; - readonly host: string; -}; -export const ApplyPatchApprovalResponse__NetworkPolicyAmendment = Schema.Struct({ - action: ApplyPatchApprovalResponse__NetworkPolicyRuleAction, - host: Schema.String, -}); - -export type ClientRequest__PluginInstallParams = { - readonly marketplacePath?: ClientRequest__AbsolutePathBuf | null; - readonly pluginName: string; - readonly remoteMarketplaceName?: string | null; -}; -export const ClientRequest__PluginInstallParams = Schema.Struct({ - marketplacePath: Schema.optionalKey(Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null])), - pluginName: Schema.String, - remoteMarketplaceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartedNotification__ImageGenerationFailure" }); -export type ClientRequest__PluginInstalledParams = { - readonly cwds?: ReadonlyArray | null; - readonly installSuggestionPluginNames?: ReadonlyArray | null; -}; -export const ClientRequest__PluginInstalledParams = Schema.Struct({ - cwds: Schema.optionalKey( - Schema.Union([ - Schema.Array(ClientRequest__AbsolutePathBuf).annotate({ - description: "Optional working directories used to discover repo marketplaces.", - }), - Schema.Null, - ]), - ), - installSuggestionPluginNames: Schema.optionalKey( - Schema.Union([ - Schema.Array(Schema.String).annotate({ - description: - "Additional uninstalled plugin names that should be returned when present locally. This is used by mention surfaces that intentionally expose install entrypoints.", - }), - Schema.Null, - ]), - ), -}); +export type V2ThreadStartedNotification__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadStartedNotification__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartedNotification__TurnItemsView" }); -export type ClientRequest__PluginReadParams = { - readonly marketplacePath?: ClientRequest__AbsolutePathBuf | null; - readonly pluginName: string; - readonly remoteMarketplaceName?: string | null; -}; -export const ClientRequest__PluginReadParams = Schema.Struct({ - marketplacePath: Schema.optionalKey(Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null])), - pluginName: Schema.String, - remoteMarketplaceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export type V2ThreadStartedNotification__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadStartedNotification__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2ThreadStartedNotification__TurnStatus" }); -export type ClientRequest__SandboxPolicy = - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } +export type V2ThreadStartParams__AskForApproval = + | "untrusted" + | "on-request" + | "never" | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; + readonly granular: { + readonly mcp_elicitations: boolean; + readonly request_permissions?: boolean; + readonly rules: boolean; + readonly sandbox_approval: boolean; + readonly skill_approval?: boolean; + }; }; -export const ClientRequest__SandboxPolicy = Schema.Union( +export const V2ThreadStartParams__AskForApproval = Schema.Union( [ + Schema.Literals(["untrusted", "on-request", "never"]), Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", + granular: Schema.Struct({ + mcp_elicitations: Schema.Boolean, + request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + rules: Schema.Boolean, + sandbox_approval: Schema.Boolean, + skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), - writableRoots: Schema.optionalKey( - Schema.Array(ClientRequest__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartParams__AskForApproval" }); -export type ClientRequest__SkillsConfigWriteParams = { - readonly enabled: boolean; - readonly name?: string | null; - readonly path?: ClientRequest__AbsolutePathBuf | null; -}; -export const ClientRequest__SkillsConfigWriteParams = Schema.Struct({ - enabled: Schema.Boolean, - name: Schema.optionalKey( - Schema.Union([Schema.String.annotate({ description: "Name-based selector." }), Schema.Null]), - ), - path: Schema.optionalKey( - Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Path-based selector.", - }), - ), +export type V2ThreadStartParams__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const V2ThreadStartParams__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2ThreadStartParams__ApprovalsReviewer", }); -export type ClientRequest__SkillsExtraRootsSetParams = { - readonly extraRoots: ReadonlyArray; -}; -export const ClientRequest__SkillsExtraRootsSetParams = Schema.Struct({ - extraRoots: Schema.Array(ClientRequest__AbsolutePathBuf), +export type V2ThreadStartParams__Personality = "none" | "friendly" | "pragmatic"; +export const V2ThreadStartParams__Personality = Schema.Literals([ + "none", + "friendly", + "pragmatic", +]).annotate({ + description: "Deprecated: `friendly` and `pragmatic` no longer select a style.", + identifier: "V2ThreadStartParams__Personality", }); -export type ClientRequest__SendAddCreditsNudgeEmailParams = { - readonly creditType: ClientRequest__AddCreditsNudgeCreditType; -}; -export const ClientRequest__SendAddCreditsNudgeEmailParams = Schema.Struct({ - creditType: ClientRequest__AddCreditsNudgeCreditType, +export type V2ThreadStartParams__SandboxMode = + | "read-only" + | "workspace-write" + | "danger-full-access"; +export const V2ThreadStartParams__SandboxMode = Schema.Literals([ + "read-only", + "workspace-write", + "danger-full-access", +]).annotate({ identifier: "V2ThreadStartParams__SandboxMode" }); + +export type V2ThreadStartParams__ThreadStartSource = "startup" | "clear"; +export const V2ThreadStartParams__ThreadStartSource = Schema.Literals([ + "startup", + "clear", +]).annotate({ identifier: "V2ThreadStartParams__ThreadStartSource" }); + +export type V2ThreadStartParams__ThreadSource = string; +export const V2ThreadStartParams__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadStartParams__ThreadSource", }); -export type ClientRequest__ContentItem = - | { readonly text: string; readonly type: "input_text" } - | { - readonly detail?: ClientRequest__ImageDetail | null; - readonly image_url: string; - readonly type: "input_image"; - } - | { readonly audio_url: string; readonly type: "input_audio" } - | { readonly text: string; readonly type: "output_text" }; -export const ClientRequest__ContentItem = Schema.Union( +export type V2ThreadStartParams__DynamicToolNamespaceTool = { + readonly deferLoading?: boolean; + readonly description: string; + readonly inputSchema: Schema.Json; + readonly name: string; + readonly type: "function"; +}; +export const V2ThreadStartParams__DynamicToolNamespaceTool = Schema.Union( [ Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), - }).annotate({ title: "InputTextContentItem" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), - }).annotate({ title: "InputImageContentItem" }), - Schema.Struct({ - audio_url: Schema.String, - type: Schema.Literal("input_audio").annotate({ title: "InputAudioContentItemType" }), - }).annotate({ title: "InputAudioContentItem" }), - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), - }).annotate({ title: "OutputTextContentItem" }), + deferLoading: Schema.optionalKey(Schema.Boolean), + description: Schema.String, + inputSchema: Schema.Json.annotate({ expected: "JSON value" }), + name: Schema.String, + type: Schema.Literal("function").annotate({ title: "FunctionDynamicToolNamespaceToolType" }), + }).annotate({ title: "FunctionDynamicToolNamespaceTool" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartParams__DynamicToolNamespaceTool" }); -export type ClientRequest__FunctionCallOutputContentItem = - | { readonly text: string; readonly type: "input_text" } - | { - readonly detail?: ClientRequest__ImageDetail | null; - readonly image_url: string; - readonly type: "input_image"; - } - | { readonly audio_url: string; readonly type: "input_audio" } - | { readonly encrypted_content: string; readonly type: "encrypted_content" }; -export const ClientRequest__FunctionCallOutputContentItem = Schema.Union( +export type V2ThreadStartParams__CapabilityRootLocation = { + readonly environmentId: string; + readonly path: string; + readonly type: "environment"; +}; +export const V2ThreadStartParams__CapabilityRootLocation = Schema.Union( [ Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ - title: "InputTextFunctionCallOutputContentItemType", - }), - }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ - title: "InputImageFunctionCallOutputContentItemType", - }), - }).annotate({ title: "InputImageFunctionCallOutputContentItem" }), - Schema.Struct({ - audio_url: Schema.String, - type: Schema.Literal("input_audio").annotate({ - title: "InputAudioFunctionCallOutputContentItemType", + environmentId: Schema.String, + path: Schema.String.annotate({ + description: "Absolute path for the root in the selected environment.", }), - }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), - Schema.Struct({ - encrypted_content: Schema.String, - type: Schema.Literal("encrypted_content").annotate({ - title: "EncryptedContentFunctionCallOutputContentItemType", + type: Schema.Literal("environment").annotate({ + title: "EnvironmentCapabilityRootLocationType", }), - }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + }).annotate({ + title: "EnvironmentCapabilityRootLocation", + description: "A path owned by an execution environment.", + }), ], { mode: "oneOf" }, ).annotate({ - description: - "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + description: "Location used to resolve a selected capability root.", + identifier: "V2ThreadStartParams__CapabilityRootLocation", }); -export type ClientRequest__InitializeParams = { - readonly capabilities?: ClientRequest__InitializeCapabilities | null; - readonly clientInfo: ClientRequest__ClientInfo; -}; -export const ClientRequest__InitializeParams = Schema.Struct({ - capabilities: Schema.optionalKey( - Schema.Union([ClientRequest__InitializeCapabilities, Schema.Null]), - ), - clientInfo: ClientRequest__ClientInfo, +export type V2ThreadStartParams__LegacyAppPathString = string; +export const V2ThreadStartParams__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadStartParams__LegacyAppPathString", }); -export type ClientRequest__LoginAccountParams = - | { readonly apiKey: string; readonly type: "apiKey" } - | { - readonly appBrand?: ClientRequest__LoginAppBrand | null; - readonly codexStreamlinedLogin?: boolean; - readonly type: "chatgpt"; - readonly useHostedLoginSuccessPage?: boolean; - } - | { readonly type: "chatgptDeviceCode" } +export type V2ThreadStartResponse__AskForApproval = + | "untrusted" + | "on-request" + | "never" | { - readonly accessToken: string; - readonly chatgptAccountId: string; - readonly chatgptPlanType?: string | null; - readonly type: "chatgptAuthTokens"; - } - | { readonly apiKey: string; readonly region: string; readonly type: "amazonBedrock" }; -export const ClientRequest__LoginAccountParams = Schema.Union( + readonly granular: { + readonly mcp_elicitations: boolean; + readonly request_permissions?: boolean; + readonly rules: boolean; + readonly sandbox_approval: boolean; + readonly skill_approval?: boolean; + }; + }; +export const V2ThreadStartResponse__AskForApproval = Schema.Union( [ + Schema.Literals(["untrusted", "on-request", "never"]), Schema.Struct({ - apiKey: Schema.String, - type: Schema.Literal("apiKey").annotate({ title: "ApiKeyLoginAccountParamsType" }), - }).annotate({ title: "ApiKeyLoginAccountParams" }), - Schema.Struct({ - appBrand: Schema.optionalKey(Schema.Union([ClientRequest__LoginAppBrand, Schema.Null])), - codexStreamlinedLogin: Schema.optionalKey(Schema.Boolean), - type: Schema.Literal("chatgpt").annotate({ title: "ChatgptLoginAccountParamsType" }), - useHostedLoginSuccessPage: Schema.optionalKey(Schema.Boolean), - }).annotate({ title: "ChatgptLoginAccountParams" }), - Schema.Struct({ - type: Schema.Literal("chatgptDeviceCode").annotate({ - title: "ChatgptDeviceCodeLoginAccountParamsType", - }), - }).annotate({ title: "ChatgptDeviceCodeLoginAccountParams" }), - Schema.Struct({ - accessToken: Schema.String.annotate({ - description: - "Access token (JWT) supplied by the client. This token is used for backend API requests and email extraction.", - }), - chatgptAccountId: Schema.String.annotate({ - description: "Workspace/account identifier supplied by the client.", - }), - chatgptPlanType: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional plan type supplied by the client.\n\nWhen `null`, Codex attempts to derive the plan type from access-token claims. If unavailable, the plan defaults to `unknown`.", - }), - Schema.Null, - ]), - ), - type: Schema.Literal("chatgptAuthTokens").annotate({ - title: "ChatgptAuthTokensLoginAccountParamsType", - }), - }).annotate({ - title: "ChatgptAuthTokensLoginAccountParams", - description: - "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE. The access token must contain the same scopes that Codex-managed ChatGPT auth tokens have.", - }), - Schema.Struct({ - apiKey: Schema.String, - region: Schema.String, - type: Schema.Literal("amazonBedrock").annotate({ - title: "AmazonBedrockLoginAccountParamsType", + granular: Schema.Struct({ + mcp_elicitations: Schema.Boolean, + request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + rules: Schema.Boolean, + sandbox_approval: Schema.Boolean, + skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), }), - }).annotate({ - title: "AmazonBedrockLoginAccountParams", - description: "[UNSTABLE] Managed Amazon Bedrock login is experimental.", - }), + }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartResponse__AskForApproval" }); + +export type V2ThreadStartResponse__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const V2ThreadStartResponse__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ + description: + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2ThreadStartResponse__ApprovalsReviewer", +}); + +export type V2ThreadStartResponse__AbsolutePathBuf = string; +export const V2ThreadStartResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadStartResponse__AbsolutePathBuf", +}); + +export type V2ThreadStartResponse__LegacyAppPathString = string; +export const V2ThreadStartResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadStartResponse__LegacyAppPathString", +}); + +export type V2ThreadStartResponse__ReasoningEffort = string; +export const V2ThreadStartResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadStartResponse__ReasoningEffort", + }), ); -export type ClientRequest__ListMcpServerStatusParams = { - readonly cursor?: string | null; - readonly detail?: ClientRequest__McpServerStatusDetail | null; - readonly limit?: number | null; - readonly threadId?: string | null; +export type V2ThreadStartResponse__NetworkAccess = "restricted" | "enabled"; +export const V2ThreadStartResponse__NetworkAccess = Schema.Literals([ + "restricted", + "enabled", +]).annotate({ identifier: "V2ThreadStartResponse__NetworkAccess" }); + +export type V2ThreadStartResponse__GitInfo = { + readonly branch?: string | null; + readonly originUrl?: string | null; + readonly sha?: string | null; }; -export const ClientRequest__ListMcpServerStatusParams = Schema.Struct({ - cursor: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Opaque pagination cursor returned by a previous call.", - }), - Schema.Null, - ]), - ), - detail: Schema.optionalKey( - Schema.Union([ClientRequest__McpServerStatusDetail, Schema.Null]).annotate({ - description: - "Controls how much MCP inventory data to fetch for each server. Defaults to `Full` when omitted.", - }), - ), - limit: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ - description: "Optional page size; defaults to a server-defined value.", - format: "uint32", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export const V2ThreadStartResponse__GitInfo = Schema.Struct({ + branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadStartResponse__GitInfo" }); -export type ClientRequest__ConfigEdit = { - readonly keyPath: string; - readonly mergeStrategy: ClientRequest__MergeStrategy; - readonly value: unknown; +export type V2ThreadStartResponse__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadStartResponse__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadStartResponse__ThreadHistoryMode" }); + +export type V2ThreadStartResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const ClientRequest__ConfigEdit = Schema.Struct({ - keyPath: Schema.String, - mergeStrategy: ClientRequest__MergeStrategy, - value: Schema.Unknown, +export const V2ThreadStartResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadStartResponse__ThreadSectionAppearance", }); -export type ClientRequest__ConfigValueWriteParams = { - readonly expectedVersion?: string | null; - readonly filePath?: string | null; - readonly keyPath: string; - readonly mergeStrategy: ClientRequest__MergeStrategy; - readonly value: unknown; -}; -export const ClientRequest__ConfigValueWriteParams = Schema.Struct({ - expectedVersion: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - filePath: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Path to the config file to write; defaults to the user's `config.toml` when omitted.", - }), - Schema.Null, - ]), - ), - keyPath: Schema.String, - mergeStrategy: ClientRequest__MergeStrategy, - value: Schema.Unknown, +export type V2ThreadStartResponse__AgentPath = string; +export const V2ThreadStartResponse__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadStartResponse__AgentPath", }); -export type ClientRequest__PluginListParams = { - readonly cwds?: ReadonlyArray | null; - readonly marketplaceKinds?: ReadonlyArray | null; -}; -export const ClientRequest__PluginListParams = Schema.Struct({ - cwds: Schema.optionalKey( - Schema.Union([ - Schema.Array(ClientRequest__AbsolutePathBuf).annotate({ - description: - "Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered.", - }), - Schema.Null, - ]), - ), - marketplaceKinds: Schema.optionalKey( - Schema.Union([ - Schema.Array(ClientRequest__PluginListMarketplaceKind).annotate({ - description: - "Optional marketplace kind filter. When omitted, only local marketplaces are queried, plus the default remote catalog when enabled by feature flag.", - }), - Schema.Null, - ]), - ), +export type V2ThreadStartResponse__ThreadId = string; +export const V2ThreadStartResponse__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadStartResponse__ThreadId", }); -export type ClientRequest__PluginShareTarget = { - readonly principalId: string; - readonly principalType: ClientRequest__PluginSharePrincipalType; - readonly role: ClientRequest__PluginShareTargetRole; -}; -export const ClientRequest__PluginShareTarget = Schema.Struct({ - principalId: Schema.String, - principalType: ClientRequest__PluginSharePrincipalType, - role: ClientRequest__PluginShareTargetRole, +export type V2ThreadStartResponse__ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput"; +export const V2ThreadStartResponse__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadStartResponse__ThreadActiveFlag" }); + +export type V2ThreadStartResponse__ThreadSource = string; +export const V2ThreadStartResponse__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadStartResponse__ThreadSource", }); -export type ClientRequest__Settings = { - readonly developer_instructions?: string | null; - readonly model: string; - readonly reasoning_effort?: ClientRequest__ReasoningEffort | null; -}; -export const ClientRequest__Settings = Schema.Struct({ - developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - model: Schema.String, - reasoning_effort: Schema.optionalKey(Schema.Union([ClientRequest__ReasoningEffort, Schema.Null])), -}).annotate({ description: "Settings for a collaboration mode." }); +export type V2ThreadStartResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadStartResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadStartResponse__NonSteerableTurnKind" }); -export type ClientRequest__ReviewStartParams = { - readonly delivery?: ClientRequest__ReviewDelivery | null; - readonly target: ClientRequest__ReviewTarget; - readonly threadId: string; +export type V2ThreadStartResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadStartResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadStartResponse__MisalignmentSteer" }); + +export type V2ThreadStartResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadStartResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadStartResponse__ByteRange" }); + +export type V2ThreadStartResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadStartResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadStartResponse__ImageDetail" }); + +export type V2ThreadStartResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const ClientRequest__ReviewStartParams = Schema.Struct({ - delivery: Schema.optionalKey( - Schema.Union([ClientRequest__ReviewDelivery, Schema.Null]).annotate({ - description: - "Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`).", - }), - ), - target: ClientRequest__ReviewTarget, - threadId: Schema.String, +export const V2ThreadStartResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadStartResponse__HookPromptFragment" }); + +export type V2ThreadStartResponse__AgentMessageDelivery = "async"; +export const V2ThreadStartResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadStartResponse__AgentMessageDelivery", }); -export type ClientRequest__ThreadResumeParams = { - readonly approvalPolicy?: ClientRequest__AskForApproval | null; - readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; - readonly baseInstructions?: string | null; - readonly config?: { readonly [x: string]: unknown } | null; - readonly cwd?: string | null; - readonly developerInstructions?: string | null; - readonly model?: string | null; - readonly modelProvider?: string | null; - readonly personality?: ClientRequest__Personality | null; - readonly sandbox?: ClientRequest__SandboxMode | null; - readonly serviceTier?: string | null; - readonly threadId: string; +export type V2ThreadStartResponse__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; }; -export const ClientRequest__ThreadResumeParams = Schema.Struct({ - approvalPolicy: Schema.optionalKey(Schema.Union([ClientRequest__AskForApproval, Schema.Null])), - approvalsReviewer: Schema.optionalKey( - Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ +export const V2ThreadStartResponse__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2ThreadStartResponse__MemoryCitationEntry" }); + +export type V2ThreadStartResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadStartResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ description: - "Override where approval requests are routed for review on this thread and subsequent turns.", + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", }), - ), - baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - config: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null]), - ), - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - model: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Configuration overrides for the resumed thread, if any.", - }), - Schema.Null, - ]), - ), - modelProvider: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - personality: Schema.optionalKey(Schema.Union([ClientRequest__Personality, Schema.Null])), - sandbox: Schema.optionalKey(Schema.Union([ClientRequest__SandboxMode, Schema.Null])), - serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - threadId: Schema.String, -}).annotate({ + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: - "There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.\n\nFor non-running threads, the precedence is: history > non-empty path > thread_id. If using history or a non-empty path for a non-running thread, the thread_id param will be ignored.\n\nIf thread_id identifies a running thread, app-server rejoins that thread and treats a non-empty path as a consistency check against the active rollout path. Empty string path values are treated as absent.\n\nPrefer using thread_id whenever possible.", + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadStartResponse__MessagePhase", }); -export type ClientRequest__MigrationDetails = { - readonly commands?: ReadonlyArray; - readonly hooks?: ReadonlyArray; - readonly mcpServers?: ReadonlyArray; - readonly memory?: ReadonlyArray; - readonly plugins?: ReadonlyArray; - readonly sessions?: ReadonlyArray; - readonly skills?: ReadonlyArray; - readonly subagents?: ReadonlyArray; +export type V2ThreadStartResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; }; -export const ClientRequest__MigrationDetails = Schema.Struct({ - commands: Schema.optionalKey( - Schema.Array(ClientRequest__CommandMigration).annotate({ default: [] }), - ), - hooks: Schema.optionalKey(Schema.Array(ClientRequest__HookMigration).annotate({ default: [] })), - mcpServers: Schema.optionalKey( - Schema.Array(ClientRequest__McpServerMigration).annotate({ default: [] }), - ), - memory: Schema.optionalKey(Schema.Array(Schema.String)), - plugins: Schema.optionalKey( - Schema.Array(ClientRequest__PluginsMigration).annotate({ default: [] }), - ), - sessions: Schema.optionalKey( - Schema.Array(ClientRequest__SessionMigration).annotate({ default: [] }), - ), - skills: Schema.optionalKey(Schema.Array(ClientRequest__SkillMigration).annotate({ default: [] })), - subagents: Schema.optionalKey( - Schema.Array(ClientRequest__SubagentMigration).annotate({ default: [] }), - ), -}); +export const V2ThreadStartResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadStartResponse__AsyncUserInputQuestion" }); -export type ClientRequest__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: ClientRequest__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: ClientRequest__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const ClientRequest__UserInput = Schema.Union( +export type V2ThreadStartResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadStartResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadStartResponse__CommandExecutionSource" }); + +export type V2ThreadStartResponse__CommandExecutionStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadStartResponse__CommandExecutionStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2ThreadStartResponse__CommandExecutionStatus" }); + +export type V2ThreadStartResponse__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2ThreadStartResponse__PatchChangeKind = Schema.Union( [ Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(ClientRequest__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartResponse__PatchChangeKind" }); -export type ClientRequest__ThreadGoalSetParams = { - readonly objective?: string | null; - readonly status?: ClientRequest__ThreadGoalStatus | null; - readonly threadId: string; - readonly tokenBudget?: number | null; -}; -export const ClientRequest__ThreadGoalSetParams = Schema.Struct({ - objective: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: Schema.optionalKey(Schema.Union([ClientRequest__ThreadGoalStatus, Schema.Null])), - threadId: Schema.String, - tokenBudget: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), -}); +export type V2ThreadStartResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadStartResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2ThreadStartResponse__PatchApplyStatus" }); -export type ClientRequest__ThreadMetadataUpdateParams = { - readonly gitInfo?: ClientRequest__ThreadMetadataGitInfoUpdateParams | null; - readonly threadId: string; +export type V2ThreadStartResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const ClientRequest__ThreadMetadataUpdateParams = Schema.Struct({ - gitInfo: Schema.optionalKey( - Schema.Union([ClientRequest__ThreadMetadataGitInfoUpdateParams, Schema.Null]).annotate({ - description: - "Patch the stored Git metadata for this thread. Omit a field to leave it unchanged, set it to `null` to clear it, or provide a string to replace the stored value.", - }), - ), - threadId: Schema.String, -}); +export const V2ThreadStartResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadStartResponse__McpToolCallAppContext" }); -export type ClientRequest__ThreadForkParams = { - readonly approvalPolicy?: ClientRequest__AskForApproval | null; - readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; - readonly baseInstructions?: string | null; - readonly config?: { readonly [x: string]: unknown } | null; - readonly cwd?: string | null; - readonly developerInstructions?: string | null; - readonly ephemeral?: boolean; - readonly lastTurnId?: string | null; - readonly model?: string | null; - readonly modelProvider?: string | null; - readonly sandbox?: ClientRequest__SandboxMode | null; - readonly serviceTier?: string | null; - readonly threadId: string; - readonly threadSource?: ClientRequest__ThreadSource | null; +export type V2ThreadStartResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadStartResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadStartResponse__McpToolCallError" }); + +export type V2ThreadStartResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadStartResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadStartResponse__McpAppDisplayMode" }); + +export type V2ThreadStartResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; }; -export const ClientRequest__ThreadForkParams = Schema.Struct({ - approvalPolicy: Schema.optionalKey(Schema.Union([ClientRequest__AskForApproval, Schema.Null])), - approvalsReviewer: Schema.optionalKey( - Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ - description: - "Override where approval requests are routed for review on this thread and subsequent turns.", - }), - ), - baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - config: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null]), - ), - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - ephemeral: Schema.optionalKey(Schema.Boolean), - lastTurnId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional last turn id to fork through, inclusive.\n\nWhen specified, turns after `last_turn_id` are omitted from the fork. The referenced turn cannot be in progress.", - }), - Schema.Null, - ]), - ), - model: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Configuration overrides for the forked thread, if any.", +export const V2ThreadStartResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadStartResponse__McpToolCallResult" }); + +export type V2ThreadStartResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadStartResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadStartResponse__McpToolCallStatus" }); + +export type V2ThreadStartResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadStartResponse__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", }), - Schema.Null, - ]), - ), - modelProvider: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sandbox: Schema.optionalKey(Schema.Union([ClientRequest__SandboxMode, Schema.Null])), - serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - threadId: Schema.String, - threadSource: Schema.optionalKey( - Schema.Union([ClientRequest__ThreadSource, Schema.Null]).annotate({ - description: - "Optional client-supplied analytics source classification for this forked thread.", - }), - ), -}).annotate({ - description: - "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using a non-empty path, the thread_id param will be ignored. Empty string path values are treated as absent.\n\nPrefer using thread_id whenever possible.", -}); - -export type ClientRequest__ThreadListParams = { - readonly archived?: boolean | null; - readonly cursor?: string | null; - readonly cwd?: ClientRequest__ThreadListCwdFilter | null; - readonly limit?: number | null; - readonly modelProviders?: ReadonlyArray | null; - readonly searchTerm?: string | null; - readonly sortDirection?: ClientRequest__SortDirection | null; - readonly sortKey?: ClientRequest__ThreadSortKey | null; - readonly sourceKinds?: ReadonlyArray | null; - readonly useStateDbOnly?: boolean; -}; -export const ClientRequest__ThreadListParams = Schema.Struct({ - archived: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: - "Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned.", - }), - Schema.Null, - ]), - ), - cursor: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Opaque pagination cursor returned by a previous call.", - }), - Schema.Null, - ]), - ), - cwd: Schema.optionalKey( - Schema.Union([ClientRequest__ThreadListCwdFilter, Schema.Null]).annotate({ - description: - "Optional cwd filter or filters; when set, only threads whose session cwd exactly matches one of these paths are returned.", - }), - ), - limit: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ - description: "Optional page size; defaults to a reasonable server-side value.", - format: "uint32", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - modelProviders: Schema.optionalKey( - Schema.Union([ - Schema.Array(Schema.String).annotate({ - description: - "Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.", - }), - Schema.Null, - ]), - ), - searchTerm: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional substring filter for the extracted thread title.", + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", }), - Schema.Null, - ]), - ), - sortDirection: Schema.optionalKey( - Schema.Union([ClientRequest__SortDirection, Schema.Null]).annotate({ - description: "Optional sort direction; defaults to descending (newest first).", - }), - ), - sortKey: Schema.optionalKey( - Schema.Union([ClientRequest__ThreadSortKey, Schema.Null]).annotate({ - description: "Optional sort key; defaults to created_at.", - }), - ), - sourceKinds: Schema.optionalKey( - Schema.Union([ - Schema.Array(ClientRequest__ThreadSourceKind).annotate({ - description: - "Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.", + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", }), - Schema.Null, - ]), - ), - useStateDbOnly: Schema.optionalKey( - Schema.Boolean.annotate({ - description: - "If true, return from the state DB without scanning JSONL rollouts to repair thread metadata. Omitted or false preserves scan-and-repair behavior.", - }), - ), -}); + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartResponse__DynamicToolCallOutputContentItem" }); -export type ClientRequest__ThreadStartParams = { - readonly approvalPolicy?: ClientRequest__AskForApproval | null; - readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; - readonly baseInstructions?: string | null; - readonly config?: { readonly [x: string]: unknown } | null; - readonly cwd?: string | null; - readonly developerInstructions?: string | null; - readonly ephemeral?: boolean | null; - readonly model?: string | null; - readonly modelProvider?: string | null; - readonly personality?: ClientRequest__Personality | null; - readonly sandbox?: ClientRequest__SandboxMode | null; - readonly serviceName?: string | null; - readonly serviceTier?: string | null; - readonly sessionStartSource?: ClientRequest__ThreadStartSource | null; - readonly threadSource?: ClientRequest__ThreadSource | null; -}; -export const ClientRequest__ThreadStartParams = Schema.Struct({ - approvalPolicy: Schema.optionalKey(Schema.Union([ClientRequest__AskForApproval, Schema.Null])), - approvalsReviewer: Schema.optionalKey( - Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ - description: - "Override where approval requests are routed for review on this thread and subsequent turns.", - }), - ), - baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - config: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null]), - ), - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - ephemeral: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - model: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - modelProvider: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - personality: Schema.optionalKey(Schema.Union([ClientRequest__Personality, Schema.Null])), - sandbox: Schema.optionalKey(Schema.Union([ClientRequest__SandboxMode, Schema.Null])), - serviceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sessionStartSource: Schema.optionalKey( - Schema.Union([ClientRequest__ThreadStartSource, Schema.Null]), - ), - threadSource: Schema.optionalKey( - Schema.Union([ClientRequest__ThreadSource, Schema.Null]).annotate({ - description: "Optional client-supplied analytics source classification for this thread.", - }), - ), -}); +export type V2ThreadStartResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadStartResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadStartResponse__DynamicToolCallStatus" }); -export type ClientRequest__WindowsSandboxSetupStartParams = { - readonly cwd?: ClientRequest__AbsolutePathBuf | null; - readonly mode: ClientRequest__WindowsSandboxSetupMode; -}; -export const ClientRequest__WindowsSandboxSetupStartParams = Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null])), - mode: ClientRequest__WindowsSandboxSetupMode, -}); +export type V2ThreadStartResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadStartResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadStartResponse__CollabAgentStatus" }); -export type CommandExecutionRequestApprovalParams__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: CommandExecutionRequestApprovalParams__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } +export type V2ThreadStartResponse__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2ThreadStartResponse__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2ThreadStartResponse__CollabAgentToolCallStatus" }); + +export type V2ThreadStartResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadStartResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadStartResponse__CollabAgentTool" }); + +export type V2ThreadStartResponse__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2ThreadStartResponse__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2ThreadStartResponse__SubAgentActivityKind" }); + +export type V2ThreadStartResponse__WebSearchAction = | { - readonly command: string; - readonly path?: string | null; + readonly queries?: ReadonlyArray | null; readonly query?: string | null; readonly type: "search"; } - | { readonly command: string; readonly type: "unknown" }; -export const CommandExecutionRequestApprovalParams__CommandAction = Schema.Union( + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const V2ThreadStartResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: CommandExecutionRequestApprovalParams__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartResponse__WebSearchAction" }); -export type CommandExecutionRequestApprovalParams__FileSystemSpecialPath = - | { readonly kind: "root" } - | { readonly kind: "minimal" } - | { - readonly kind: "project_roots"; - readonly subpath?: CommandExecutionRequestApprovalParams__LegacyAppPathString | null; - } - | { readonly kind: "tmpdir" } - | { readonly kind: "slash_tmp" } - | { - readonly kind: "unknown"; - readonly path: string; - readonly subpath?: CommandExecutionRequestApprovalParams__LegacyAppPathString | null; - }; -export const CommandExecutionRequestApprovalParams__FileSystemSpecialPath = Schema.Union( +export type V2ThreadStartResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2ThreadStartResponse__ImageGenerationFailure = Schema.Union( [ - Schema.Struct({ kind: Schema.Literal("root") }).annotate({ - title: "RootFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ - title: "MinimalFileSystemSpecialPath", - }), Schema.Struct({ - kind: Schema.Literal("project_roots"), - subpath: Schema.optionalKey( - Schema.Union([CommandExecutionRequestApprovalParams__LegacyAppPathString, Schema.Null]), + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), - }).annotate({ title: "KindFileSystemSpecialPath" }), - Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ - title: "TmpdirFileSystemSpecialPath", + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartResponse__ImageGenerationFailure" }); + +export type V2ThreadStartResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadStartResponse__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", }), - Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ - title: "SlashTmpFileSystemSpecialPath", + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", }), - Schema.Struct({ - kind: Schema.Literal("unknown"), - path: Schema.String, - subpath: Schema.optionalKey( - Schema.Union([CommandExecutionRequestApprovalParams__LegacyAppPathString, Schema.Null]), - ), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartResponse__TurnItemsView" }); -export type CommandExecutionRequestApprovalParams__NetworkApprovalContext = { - readonly host: string; - readonly protocol: CommandExecutionRequestApprovalParams__NetworkApprovalProtocol; -}; -export const CommandExecutionRequestApprovalParams__NetworkApprovalContext = Schema.Struct({ - host: Schema.String, - protocol: CommandExecutionRequestApprovalParams__NetworkApprovalProtocol, -}); +export type V2ThreadStartResponse__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadStartResponse__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2ThreadStartResponse__TurnStatus" }); -export type CommandExecutionRequestApprovalParams__NetworkPolicyAmendment = { - readonly action: CommandExecutionRequestApprovalParams__NetworkPolicyRuleAction; - readonly host: string; -}; -export const CommandExecutionRequestApprovalParams__NetworkPolicyAmendment = Schema.Struct({ - action: CommandExecutionRequestApprovalParams__NetworkPolicyRuleAction, - host: Schema.String, -}); +export type V2ThreadStatusChangedNotification__ThreadActiveFlag = + | "waitingOnApproval" + | "waitingOnUserInput"; +export const V2ThreadStatusChangedNotification__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadStatusChangedNotification__ThreadActiveFlag" }); -export type CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment = { - readonly action: CommandExecutionRequestApprovalResponse__NetworkPolicyRuleAction; - readonly host: string; +export type V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown = { + readonly cacheWriteInputTokens?: number; + readonly cachedInputTokens: number; + readonly inputTokens: number; + readonly outputTokens: number; + readonly reasoningOutputTokens: number; + readonly totalTokens: number; }; -export const CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment = Schema.Struct({ - action: CommandExecutionRequestApprovalResponse__NetworkPolicyRuleAction, - host: Schema.String, +export const V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown = Schema.Struct({ + cacheWriteInputTokens: Schema.optionalKey( + Schema.Number.annotate({ default: 0, format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + ), + cachedInputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + inputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + outputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + reasoningOutputTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + totalTokens: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +}).annotate({ identifier: "V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown" }); + +export type V2ThreadTurnsListParams__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadTurnsListParams__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadTurnsListParams__TurnItemsView" }); + +export type V2ThreadTurnsListParams__SortDirection = "asc" | "desc"; +export const V2ThreadTurnsListParams__SortDirection = Schema.Literals(["asc", "desc"]).annotate({ + identifier: "V2ThreadTurnsListParams__SortDirection", }); -export type ExecCommandApprovalResponse__NetworkPolicyAmendment = { - readonly action: ExecCommandApprovalResponse__NetworkPolicyRuleAction; - readonly host: string; +export type V2ThreadTurnsListResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadTurnsListResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadTurnsListResponse__NonSteerableTurnKind" }); + +export type V2ThreadTurnsListResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadTurnsListResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadTurnsListResponse__MisalignmentSteer" }); + +export type V2ThreadTurnsListResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadTurnsListResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadTurnsListResponse__ByteRange" }); + +export type V2ThreadTurnsListResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadTurnsListResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadTurnsListResponse__ImageDetail" }); + +export type V2ThreadTurnsListResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const ExecCommandApprovalResponse__NetworkPolicyAmendment = Schema.Struct({ - action: ExecCommandApprovalResponse__NetworkPolicyRuleAction, - host: Schema.String, +export const V2ThreadTurnsListResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadTurnsListResponse__HookPromptFragment" }); + +export type V2ThreadTurnsListResponse__AgentMessageDelivery = "async"; +export const V2ThreadTurnsListResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadTurnsListResponse__AgentMessageDelivery", }); -export type FuzzyFileSearchResponse__FuzzyFileSearchResult = { - readonly file_name: string; - readonly indices?: ReadonlyArray | null; - readonly match_type: FuzzyFileSearchResponse__FuzzyFileSearchMatchType; +export type V2ThreadTurnsListResponse__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; readonly path: string; - readonly root: string; - readonly score: number; }; -export const FuzzyFileSearchResponse__FuzzyFileSearchResult = Schema.Struct({ - file_name: Schema.String, - indices: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - ), - Schema.Null, - ]), - ), - match_type: FuzzyFileSearchResponse__FuzzyFileSearchMatchType, +export const V2ThreadTurnsListResponse__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, path: Schema.String, - root: Schema.String, - score: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}).annotate({ description: "Superset of [`codex_file_search::FileMatch`]" }); +}).annotate({ identifier: "V2ThreadTurnsListResponse__MemoryCitationEntry" }); -export type FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchResult = { - readonly file_name: string; - readonly indices?: ReadonlyArray | null; - readonly match_type: FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchMatchType; - readonly path: string; - readonly root: string; - readonly score: number; -}; -export const FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchResult = Schema.Struct({ - file_name: Schema.String, - indices: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - ), - Schema.Null, - ]), - ), - match_type: FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchMatchType, - path: Schema.String, - root: Schema.String, - score: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}).annotate({ description: "Superset of [`codex_file_search::FileMatch`]" }); +export type V2ThreadTurnsListResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadTurnsListResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadTurnsListResponse__MessagePhase", +}); -export type JSONRPCMessage__JSONRPCError = { - readonly error: JSONRPCMessage__JSONRPCErrorError; - readonly id: JSONRPCMessage__RequestId; +export type V2ThreadTurnsListResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; }; -export const JSONRPCMessage__JSONRPCError = Schema.Struct({ - error: JSONRPCMessage__JSONRPCErrorError, - id: JSONRPCMessage__RequestId, -}).annotate({ description: "A response to a request that indicates an error occurred." }); +export const V2ThreadTurnsListResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadTurnsListResponse__AsyncUserInputQuestion" }); -export type JSONRPCMessage__JSONRPCResponse = { - readonly id: JSONRPCMessage__RequestId; - readonly result: unknown; -}; -export const JSONRPCMessage__JSONRPCResponse = Schema.Struct({ - id: JSONRPCMessage__RequestId, - result: Schema.Unknown, -}).annotate({ description: "A successful (non-error) response to a request." }); +export type V2ThreadTurnsListResponse__LegacyAppPathString = string; +export const V2ThreadTurnsListResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadTurnsListResponse__LegacyAppPathString", +}); -export type JSONRPCMessage__JSONRPCRequest = { - readonly id: JSONRPCMessage__RequestId; - readonly method: string; - readonly params?: unknown; - readonly trace?: JSONRPCMessage__W3cTraceContext | null; -}; -export const JSONRPCMessage__JSONRPCRequest = Schema.Struct({ - id: JSONRPCMessage__RequestId, - method: Schema.String, - params: Schema.optionalKey(Schema.Unknown), - trace: Schema.optionalKey( - Schema.Union([JSONRPCMessage__W3cTraceContext, Schema.Null]).annotate({ - description: "Optional W3C Trace Context for distributed tracing.", - }), - ), -}).annotate({ description: "A request that expects a response." }); +export type V2ThreadTurnsListResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadTurnsListResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadTurnsListResponse__CommandExecutionSource" }); -export type McpServerElicitationRequestParams__McpElicitationBooleanSchema = { - readonly default?: boolean | null; - readonly description?: string | null; - readonly title?: string | null; - readonly type: McpServerElicitationRequestParams__McpElicitationBooleanType; -}; -export const McpServerElicitationRequestParams__McpElicitationBooleanSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: McpServerElicitationRequestParams__McpElicitationBooleanType, -}); - -export type McpServerElicitationRequestParams__McpElicitationTitledEnumItems = { - readonly anyOf: ReadonlyArray; -}; -export const McpServerElicitationRequestParams__McpElicitationTitledEnumItems = Schema.Struct({ - anyOf: Schema.Array(McpServerElicitationRequestParams__McpElicitationConstOption), -}); - -export type McpServerElicitationRequestParams__McpElicitationNumberSchema = { - readonly default?: number | null; - readonly description?: string | null; - readonly maximum?: number | null; - readonly minimum?: number | null; - readonly title?: string | null; - readonly type: McpServerElicitationRequestParams__McpElicitationNumberType; -}; -export const McpServerElicitationRequestParams__McpElicitationNumberSchema = Schema.Struct({ - default: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "double" }).check(Schema.isFinite()), - Schema.Null, - ]), - ), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - maximum: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "double" }).check(Schema.isFinite()), - Schema.Null, - ]), - ), - minimum: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "double" }).check(Schema.isFinite()), - Schema.Null, - ]), - ), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: McpServerElicitationRequestParams__McpElicitationNumberType, -}); - -export type McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema = { - readonly default?: string | null; - readonly description?: string | null; - readonly enum: ReadonlyArray; - readonly enumNames?: ReadonlyArray | null; - readonly title?: string | null; - readonly type: McpServerElicitationRequestParams__McpElicitationStringType; -}; -export const McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema = - Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - enum: Schema.Array(Schema.String), - enumNames: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: McpServerElicitationRequestParams__McpElicitationStringType, - }); - -export type McpServerElicitationRequestParams__McpElicitationStringSchema = { - readonly default?: string | null; - readonly description?: string | null; - readonly format?: McpServerElicitationRequestParams__McpElicitationStringFormat | null; - readonly maxLength?: number | null; - readonly minLength?: number | null; - readonly title?: string | null; - readonly type: McpServerElicitationRequestParams__McpElicitationStringType; -}; -export const McpServerElicitationRequestParams__McpElicitationStringSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - format: Schema.optionalKey( - Schema.Union([McpServerElicitationRequestParams__McpElicitationStringFormat, Schema.Null]), - ), - maxLength: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - minLength: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: McpServerElicitationRequestParams__McpElicitationStringType, -}); - -export type McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema = { - readonly default?: string | null; - readonly description?: string | null; - readonly oneOf: ReadonlyArray; - readonly title?: string | null; - readonly type: McpServerElicitationRequestParams__McpElicitationStringType; -}; -export const McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema = - Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - oneOf: Schema.Array(McpServerElicitationRequestParams__McpElicitationConstOption), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: McpServerElicitationRequestParams__McpElicitationStringType, - }); - -export type McpServerElicitationRequestParams__McpElicitationUntitledEnumItems = { - readonly enum: ReadonlyArray; - readonly type: McpServerElicitationRequestParams__McpElicitationStringType; -}; -export const McpServerElicitationRequestParams__McpElicitationUntitledEnumItems = Schema.Struct({ - enum: Schema.Array(Schema.String), - type: McpServerElicitationRequestParams__McpElicitationStringType, -}); - -export type McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema = { - readonly default?: string | null; - readonly description?: string | null; - readonly enum: ReadonlyArray; - readonly title?: string | null; - readonly type: McpServerElicitationRequestParams__McpElicitationStringType; -}; -export const McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema = - Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - enum: Schema.Array(Schema.String), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: McpServerElicitationRequestParams__McpElicitationStringType, - }); +export type V2ThreadTurnsListResponse__CommandExecutionStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadTurnsListResponse__CommandExecutionStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2ThreadTurnsListResponse__CommandExecutionStatus" }); -export type PermissionsRequestApprovalParams__FileSystemSpecialPath = - | { readonly kind: "root" } - | { readonly kind: "minimal" } - | { - readonly kind: "project_roots"; - readonly subpath?: PermissionsRequestApprovalParams__LegacyAppPathString | null; - } - | { readonly kind: "tmpdir" } - | { readonly kind: "slash_tmp" } - | { - readonly kind: "unknown"; - readonly path: string; - readonly subpath?: PermissionsRequestApprovalParams__LegacyAppPathString | null; - }; -export const PermissionsRequestApprovalParams__FileSystemSpecialPath = Schema.Union( +export type V2ThreadTurnsListResponse__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2ThreadTurnsListResponse__PatchChangeKind = Schema.Union( [ - Schema.Struct({ kind: Schema.Literal("root") }).annotate({ - title: "RootFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ - title: "MinimalFileSystemSpecialPath", - }), Schema.Struct({ - kind: Schema.Literal("project_roots"), - subpath: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalParams__LegacyAppPathString, Schema.Null]), - ), - }).annotate({ title: "KindFileSystemSpecialPath" }), - Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ - title: "TmpdirFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ - title: "SlashTmpFileSystemSpecialPath", - }), + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), Schema.Struct({ - kind: Schema.Literal("unknown"), - path: Schema.String, - subpath: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalParams__LegacyAppPathString, Schema.Null]), - ), - }), + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), + Schema.Struct({ + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadTurnsListResponse__PatchChangeKind" }); -export type PermissionsRequestApprovalResponse__FileSystemSpecialPath = - | { readonly kind: "root" } - | { readonly kind: "minimal" } - | { - readonly kind: "project_roots"; - readonly subpath?: PermissionsRequestApprovalResponse__LegacyAppPathString | null; - } - | { readonly kind: "tmpdir" } - | { readonly kind: "slash_tmp" } - | { - readonly kind: "unknown"; - readonly path: string; - readonly subpath?: PermissionsRequestApprovalResponse__LegacyAppPathString | null; - }; -export const PermissionsRequestApprovalResponse__FileSystemSpecialPath = Schema.Union( +export type V2ThreadTurnsListResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadTurnsListResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2ThreadTurnsListResponse__PatchApplyStatus" }); + +export type V2ThreadTurnsListResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; +}; +export const V2ThreadTurnsListResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadTurnsListResponse__McpToolCallAppContext" }); + +export type V2ThreadTurnsListResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadTurnsListResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadTurnsListResponse__McpToolCallError" }); + +export type V2ThreadTurnsListResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadTurnsListResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadTurnsListResponse__McpAppDisplayMode" }); + +export type V2ThreadTurnsListResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; +}; +export const V2ThreadTurnsListResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadTurnsListResponse__McpToolCallResult" }); + +export type V2ThreadTurnsListResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadTurnsListResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadTurnsListResponse__McpToolCallStatus" }); + +export type V2ThreadTurnsListResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadTurnsListResponse__DynamicToolCallOutputContentItem = Schema.Union( [ - Schema.Struct({ kind: Schema.Literal("root") }).annotate({ - title: "RootFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ - title: "MinimalFileSystemSpecialPath", - }), Schema.Struct({ - kind: Schema.Literal("project_roots"), - subpath: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalResponse__LegacyAppPathString, Schema.Null]), - ), - }).annotate({ title: "KindFileSystemSpecialPath" }), - Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ - title: "TmpdirFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ - title: "SlashTmpFileSystemSpecialPath", - }), + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), Schema.Struct({ - kind: Schema.Literal("unknown"), - path: Schema.String, - subpath: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalResponse__LegacyAppPathString, Schema.Null]), - ), - }), + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadTurnsListResponse__DynamicToolCallOutputContentItem" }); + +export type V2ThreadTurnsListResponse__DynamicToolCallStatus = + | "inProgress" + | "completed" + | "failed"; +export const V2ThreadTurnsListResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadTurnsListResponse__DynamicToolCallStatus" }); + +export type V2ThreadTurnsListResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadTurnsListResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadTurnsListResponse__CollabAgentStatus" }); + +export type V2ThreadTurnsListResponse__ReasoningEffort = string; +export const V2ThreadTurnsListResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadTurnsListResponse__ReasoningEffort", + }), ); -export type ServerNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: ServerNotification__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } +export type V2ThreadTurnsListResponse__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2ThreadTurnsListResponse__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2ThreadTurnsListResponse__CollabAgentToolCallStatus" }); + +export type V2ThreadTurnsListResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadTurnsListResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadTurnsListResponse__CollabAgentTool" }); + +export type V2ThreadTurnsListResponse__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2ThreadTurnsListResponse__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2ThreadTurnsListResponse__SubAgentActivityKind" }); + +export type V2ThreadTurnsListResponse__WebSearchAction = | { - readonly command: string; - readonly path?: string | null; + readonly queries?: ReadonlyArray | null; readonly query?: string | null; readonly type: "search"; } - | { readonly command: string; readonly type: "unknown" }; -export const ServerNotification__CommandAction = Schema.Union( + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const V2ThreadTurnsListResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: ServerNotification__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadTurnsListResponse__WebSearchAction" }); -export type ServerNotification__FsChangedNotification = { - readonly changedPaths: ReadonlyArray; - readonly watchId: string; +export type V2ThreadTurnsListResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; }; -export const ServerNotification__FsChangedNotification = Schema.Struct({ - changedPaths: Schema.Array(ServerNotification__AbsolutePathBuf).annotate({ - description: "File or directory paths associated with this event.", - }), - watchId: Schema.String.annotate({ - description: "Watch identifier previously provided to `fs/watch`.", - }), -}).annotate({ description: "Filesystem watch notification emitted for `fs/watch` subscribers." }); - -export type ServerNotification__SandboxPolicy = - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } - | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; -export const ServerNotification__SandboxPolicy = Schema.Union( +export const V2ThreadTurnsListResponse__ImageGenerationFailure = Schema.Union( [ Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), - writableRoots: Schema.optionalKey( - Schema.Array(ServerNotification__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadTurnsListResponse__ImageGenerationFailure" }); -export type ServerNotification__AppMetadata = { - readonly categories?: ReadonlyArray | null; - readonly developer?: string | null; - readonly firstPartyRequiresInstall?: boolean | null; - readonly firstPartyType?: string | null; - readonly review?: ServerNotification__AppReview | null; - readonly screenshots?: ReadonlyArray | null; - readonly seoDescription?: string | null; - readonly showInComposerWhenUnlinked?: boolean | null; - readonly subCategories?: ReadonlyArray | null; - readonly version?: string | null; - readonly versionId?: string | null; - readonly versionNotes?: string | null; -}; -export const ServerNotification__AppMetadata = Schema.Struct({ - categories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - developer: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - firstPartyRequiresInstall: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - firstPartyType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - review: Schema.optionalKey(Schema.Union([ServerNotification__AppReview, Schema.Null])), - screenshots: Schema.optionalKey( - Schema.Union([Schema.Array(ServerNotification__AppScreenshot), Schema.Null]), - ), - seoDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - showInComposerWhenUnlinked: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - subCategories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - version: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - versionId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - versionNotes: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export type V2ThreadTurnsListResponse__AbsolutePathBuf = string; +export const V2ThreadTurnsListResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadTurnsListResponse__AbsolutePathBuf", }); -export type ServerNotification__CollabAgentState = { - readonly message?: string | null; - readonly status: ServerNotification__CollabAgentStatus; -}; -export const ServerNotification__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: ServerNotification__CollabAgentStatus, -}); +export type V2ThreadTurnsListResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadTurnsListResponse__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadTurnsListResponse__TurnItemsView" }); -export type ServerNotification__ExternalAgentConfigImportItemTypeFailure = { - readonly cwd?: string | null; - readonly errorType?: string | null; - readonly failureStage: string; - readonly itemType: ServerNotification__ExternalAgentConfigMigrationItemType; - readonly message: string; - readonly source?: string | null; - readonly subErrorType?: string | null; -}; -export const ServerNotification__ExternalAgentConfigImportItemTypeFailure = Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - failureStage: Schema.String, - itemType: ServerNotification__ExternalAgentConfigMigrationItemType, - message: Schema.String, - source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export type V2ThreadTurnsListResponse__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadTurnsListResponse__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2ThreadTurnsListResponse__TurnStatus" }); + +export type V2ThreadUnarchiveResponse__AbsolutePathBuf = string; +export const V2ThreadUnarchiveResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2ThreadUnarchiveResponse__AbsolutePathBuf", }); -export type ServerNotification__ExternalAgentConfigImportItemTypeSuccess = { - readonly cwd?: string | null; - readonly itemType: ServerNotification__ExternalAgentConfigMigrationItemType; - readonly source?: string | null; - readonly target?: string | null; +export type V2ThreadUnarchiveResponse__GitInfo = { + readonly branch?: string | null; + readonly originUrl?: string | null; + readonly sha?: string | null; }; -export const ServerNotification__ExternalAgentConfigImportItemTypeSuccess = Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - itemType: ServerNotification__ExternalAgentConfigMigrationItemType, - source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export const V2ThreadUnarchiveResponse__GitInfo = Schema.Struct({ + branch: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + originUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__GitInfo" }); -export type ServerNotification__FuzzyFileSearchResult = { - readonly file_name: string; - readonly indices?: ReadonlyArray | null; - readonly match_type: ServerNotification__FuzzyFileSearchMatchType; - readonly path: string; - readonly root: string; - readonly score: number; -}; -export const ServerNotification__FuzzyFileSearchResult = Schema.Struct({ - file_name: Schema.String, - indices: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - ), - Schema.Null, - ]), - ), - match_type: ServerNotification__FuzzyFileSearchMatchType, - path: Schema.String, - root: Schema.String, - score: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}).annotate({ description: "Superset of [`codex_file_search::FileMatch`]" }); +export type V2ThreadUnarchiveResponse__ThreadHistoryMode = "legacy" | "paginated"; +export const V2ThreadUnarchiveResponse__ThreadHistoryMode = Schema.Literals([ + "legacy", + "paginated", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__ThreadHistoryMode" }); -export type ServerNotification__GuardianApprovalReview = { - readonly rationale?: string | null; - readonly riskLevel?: ServerNotification__GuardianRiskLevel | null; - readonly status: ServerNotification__GuardianApprovalReviewStatus; - readonly userAuthorization?: ServerNotification__GuardianUserAuthorization | null; +export type V2ThreadUnarchiveResponse__ReasoningEffort = string; +export const V2ThreadUnarchiveResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2ThreadUnarchiveResponse__ReasoningEffort", + }), +); + +export type V2ThreadUnarchiveResponse__ThreadSectionAppearance = { + readonly color?: string | null; + readonly icon?: string | null; }; -export const ServerNotification__GuardianApprovalReview = Schema.Struct({ - rationale: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - riskLevel: Schema.optionalKey(Schema.Union([ServerNotification__GuardianRiskLevel, Schema.Null])), - status: ServerNotification__GuardianApprovalReviewStatus, - userAuthorization: Schema.optionalKey( - Schema.Union([ServerNotification__GuardianUserAuthorization, Schema.Null]), - ), +export const V2ThreadUnarchiveResponse__ThreadSectionAppearance = Schema.Struct({ + color: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + icon: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }).annotate({ - description: - "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + description: "Extensible visual presentation for a custom thread section.", + identifier: "V2ThreadUnarchiveResponse__ThreadSectionAppearance", }); -export type ServerNotification__HookOutputEntry = { - readonly kind: ServerNotification__HookOutputEntryKind; - readonly text: string; -}; -export const ServerNotification__HookOutputEntry = Schema.Struct({ - kind: ServerNotification__HookOutputEntryKind, - text: Schema.String, +export type V2ThreadUnarchiveResponse__AgentPath = string; +export const V2ThreadUnarchiveResponse__AgentPath = Schema.String.annotate({ + identifier: "V2ThreadUnarchiveResponse__AgentPath", }); -export type ServerNotification__FileSystemSpecialPath = - | { readonly kind: "root" } - | { readonly kind: "minimal" } - | { - readonly kind: "project_roots"; - readonly subpath?: ServerNotification__LegacyAppPathString | null; - } - | { readonly kind: "tmpdir" } - | { readonly kind: "slash_tmp" } - | { - readonly kind: "unknown"; - readonly path: string; - readonly subpath?: ServerNotification__LegacyAppPathString | null; - }; -export const ServerNotification__FileSystemSpecialPath = Schema.Union( - [ - Schema.Struct({ kind: Schema.Literal("root") }).annotate({ - title: "RootFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ - title: "MinimalFileSystemSpecialPath", - }), - Schema.Struct({ - kind: Schema.Literal("project_roots"), - subpath: Schema.optionalKey( - Schema.Union([ServerNotification__LegacyAppPathString, Schema.Null]), - ), - }).annotate({ title: "KindFileSystemSpecialPath" }), - Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ - title: "TmpdirFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ - title: "SlashTmpFileSystemSpecialPath", - }), - Schema.Struct({ - kind: Schema.Literal("unknown"), - path: Schema.String, - subpath: Schema.optionalKey( - Schema.Union([ServerNotification__LegacyAppPathString, Schema.Null]), - ), - }), - ], - { mode: "oneOf" }, -); - -export type ServerNotification__McpServerStatusUpdatedNotification = { - readonly error?: string | null; - readonly failureReason?: ServerNotification__McpServerStartupFailureReason | null; - readonly name: string; - readonly status: ServerNotification__McpServerStartupState; - readonly threadId?: string | null; -}; -export const ServerNotification__McpServerStatusUpdatedNotification = Schema.Struct({ - error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - failureReason: Schema.optionalKey( - Schema.Union([ServerNotification__McpServerStartupFailureReason, Schema.Null]), - ), - name: Schema.String, - status: ServerNotification__McpServerStartupState, - threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export type V2ThreadUnarchiveResponse__ThreadId = string; +export const V2ThreadUnarchiveResponse__ThreadId = Schema.String.annotate({ + identifier: "V2ThreadUnarchiveResponse__ThreadId", }); -export type ServerNotification__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; -}; -export const ServerNotification__MemoryCitation = Schema.Struct({ - entries: Schema.Array(ServerNotification__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), +export type V2ThreadUnarchiveResponse__ThreadActiveFlag = + | "waitingOnApproval" + | "waitingOnUserInput"; +export const V2ThreadUnarchiveResponse__ThreadActiveFlag = Schema.Literals([ + "waitingOnApproval", + "waitingOnUserInput", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__ThreadActiveFlag" }); + +export type V2ThreadUnarchiveResponse__ThreadSource = string; +export const V2ThreadUnarchiveResponse__ThreadSource = Schema.String.annotate({ + identifier: "V2ThreadUnarchiveResponse__ThreadSource", }); -export type ServerNotification__ModelReroutedNotification = { - readonly fromModel: string; - readonly reason: ServerNotification__ModelRerouteReason; - readonly threadId: string; - readonly toModel: string; - readonly turnId: string; +export type V2ThreadUnarchiveResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadUnarchiveResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__NonSteerableTurnKind" }); + +export type V2ThreadUnarchiveResponse__MisalignmentSteer = { readonly message: string }; +export const V2ThreadUnarchiveResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadUnarchiveResponse__MisalignmentSteer" }); + +export type V2ThreadUnarchiveResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2ThreadUnarchiveResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__ByteRange" }); + +export type V2ThreadUnarchiveResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2ThreadUnarchiveResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__ImageDetail" }); + +export type V2ThreadUnarchiveResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const ServerNotification__ModelReroutedNotification = Schema.Struct({ - fromModel: Schema.String, - reason: ServerNotification__ModelRerouteReason, - threadId: Schema.String, - toModel: Schema.String, - turnId: Schema.String, +export const V2ThreadUnarchiveResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2ThreadUnarchiveResponse__HookPromptFragment" }); + +export type V2ThreadUnarchiveResponse__AgentMessageDelivery = "async"; +export const V2ThreadUnarchiveResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2ThreadUnarchiveResponse__AgentMessageDelivery", }); -export type ServerNotification__ModelVerificationNotification = { - readonly threadId: string; - readonly turnId: string; - readonly verifications: ReadonlyArray; +export type V2ThreadUnarchiveResponse__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; }; -export const ServerNotification__ModelVerificationNotification = Schema.Struct({ - threadId: Schema.String, - turnId: Schema.String, - verifications: Schema.Array(ServerNotification__ModelVerification), -}); +export const V2ThreadUnarchiveResponse__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2ThreadUnarchiveResponse__MemoryCitationEntry" }); -export type ServerNotification__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } - | { - readonly activeTurnNotSteerable: { - readonly turnKind: ServerNotification__NonSteerableTurnKind; - }; - }; -export const ServerNotification__CodexErrorInfo = Schema.Union( +export type V2ThreadUnarchiveResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadUnarchiveResponse__MessagePhase = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), - Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", + Schema.Literal("commentary").annotate({ description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), - Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", }), - Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ turnKind: ServerNotification__NonSteerableTurnKind }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", }), ], { mode: "oneOf" }, ).annotate({ description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2ThreadUnarchiveResponse__MessagePhase", }); -export type ServerNotification__FileUpdateChange = { - readonly diff: string; - readonly kind: ServerNotification__PatchChangeKind; - readonly path: string; +export type V2ThreadUnarchiveResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; }; -export const ServerNotification__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: ServerNotification__PatchChangeKind, - path: Schema.String, -}); +export const V2ThreadUnarchiveResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2ThreadUnarchiveResponse__AsyncUserInputQuestion" }); -export type ServerNotification__AccountUpdatedNotification = { - readonly authMode?: ServerNotification__AuthMode | null; - readonly planType?: ServerNotification__PlanType | null; -}; -export const ServerNotification__AccountUpdatedNotification = Schema.Struct({ - authMode: Schema.optionalKey(Schema.Union([ServerNotification__AuthMode, Schema.Null])), - planType: Schema.optionalKey(Schema.Union([ServerNotification__PlanType, Schema.Null])), +export type V2ThreadUnarchiveResponse__LegacyAppPathString = string; +export const V2ThreadUnarchiveResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2ThreadUnarchiveResponse__LegacyAppPathString", }); -export type ServerNotification__ThreadRealtimeStartedNotification = { - readonly realtimeSessionId?: string | null; - readonly threadId: string; - readonly version: ServerNotification__RealtimeConversationVersion; -}; -export const ServerNotification__ThreadRealtimeStartedNotification = Schema.Struct({ - realtimeSessionId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - threadId: Schema.String, - version: ServerNotification__RealtimeConversationVersion, -}).annotate({ description: "EXPERIMENTAL - emitted when thread realtime startup is accepted." }); +export type V2ThreadUnarchiveResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2ThreadUnarchiveResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__CommandExecutionSource" }); -export type ServerNotification__Settings = { - readonly developer_instructions?: string | null; - readonly model: string; - readonly reasoning_effort?: ServerNotification__ReasoningEffort | null; -}; -export const ServerNotification__Settings = Schema.Struct({ - developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - model: Schema.String, - reasoning_effort: Schema.optionalKey( - Schema.Union([ServerNotification__ReasoningEffort, Schema.Null]), - ), -}).annotate({ description: "Settings for a collaboration mode." }); +export type V2ThreadUnarchiveResponse__CommandExecutionStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadUnarchiveResponse__CommandExecutionStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__CommandExecutionStatus" }); -export type ServerNotification__RemoteControlStatusChangedNotification = { - readonly environmentId?: string | null; - readonly installationId: string; - readonly serverName: string; - readonly status: ServerNotification__RemoteControlConnectionStatus; -}; -export const ServerNotification__RemoteControlStatusChangedNotification = Schema.Struct({ - environmentId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - installationId: Schema.String, - serverName: Schema.String, - status: ServerNotification__RemoteControlConnectionStatus, -}).annotate({ - description: "Current remote-control connection status and remote identity exposed to clients.", -}); +export type V2ThreadUnarchiveResponse__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2ThreadUnarchiveResponse__PatchChangeKind = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), + Schema.Struct({ + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), + Schema.Struct({ + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadUnarchiveResponse__PatchChangeKind" }); -export type ServerNotification__ServerRequestResolvedNotification = { - readonly requestId: ServerNotification__RequestId; - readonly threadId: string; +export type V2ThreadUnarchiveResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadUnarchiveResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__PatchApplyStatus" }); + +export type V2ThreadUnarchiveResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const ServerNotification__ServerRequestResolvedNotification = Schema.Struct({ - requestId: ServerNotification__RequestId, - threadId: Schema.String, -}); +export const V2ThreadUnarchiveResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__McpToolCallAppContext" }); -export type ServerNotification__RateLimitSnapshot = { - readonly credits?: ServerNotification__CreditsSnapshot | null; - readonly individualLimit?: ServerNotification__SpendControlLimitSnapshot | null; - readonly limitId?: string | null; - readonly limitName?: string | null; - readonly planType?: ServerNotification__PlanType | null; - readonly primary?: ServerNotification__RateLimitWindow | null; - readonly rateLimitReachedType?: ServerNotification__RateLimitReachedType | null; - readonly secondary?: ServerNotification__RateLimitWindow | null; - readonly spendControlReached?: boolean | null; +export type V2ThreadUnarchiveResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadUnarchiveResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2ThreadUnarchiveResponse__McpToolCallError" }); + +export type V2ThreadUnarchiveResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2ThreadUnarchiveResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__McpAppDisplayMode" }); + +export type V2ThreadUnarchiveResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; }; -export const ServerNotification__RateLimitSnapshot = Schema.Struct({ - credits: Schema.optionalKey(Schema.Union([ServerNotification__CreditsSnapshot, Schema.Null])), - individualLimit: Schema.optionalKey( - Schema.Union([ServerNotification__SpendControlLimitSnapshot, Schema.Null]), - ), - limitId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - limitName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - planType: Schema.optionalKey(Schema.Union([ServerNotification__PlanType, Schema.Null])), - primary: Schema.optionalKey(Schema.Union([ServerNotification__RateLimitWindow, Schema.Null])), - rateLimitReachedType: Schema.optionalKey( - Schema.Union([ServerNotification__RateLimitReachedType, Schema.Null]), - ), - secondary: Schema.optionalKey(Schema.Union([ServerNotification__RateLimitWindow, Schema.Null])), - spendControlReached: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: - "Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.", - }), - Schema.Null, - ]), - ), -}); +export const V2ThreadUnarchiveResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__McpToolCallResult" }); -export type ServerNotification__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: ServerNotification__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: ServerNotification__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const ServerNotification__UserInput = Schema.Union( +export type V2ThreadUnarchiveResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadUnarchiveResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__McpToolCallStatus" }); + +export type V2ThreadUnarchiveResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2ThreadUnarchiveResponse__DynamicToolCallOutputContentItem = Schema.Union( [ Schema.Struct({ text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(ServerNotification__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadUnarchiveResponse__DynamicToolCallOutputContentItem" }); -export type ServerNotification__TextRange = { - readonly end: ServerNotification__TextPosition; - readonly start: ServerNotification__TextPosition; -}; -export const ServerNotification__TextRange = Schema.Struct({ - end: ServerNotification__TextPosition, - start: ServerNotification__TextPosition, -}); +export type V2ThreadUnarchiveResponse__DynamicToolCallStatus = + | "inProgress" + | "completed" + | "failed"; +export const V2ThreadUnarchiveResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__DynamicToolCallStatus" }); -export type ServerNotification__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } +export type V2ThreadUnarchiveResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadUnarchiveResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__CollabAgentStatus" }); + +export type V2ThreadUnarchiveResponse__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2ThreadUnarchiveResponse__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__CollabAgentToolCallStatus" }); + +export type V2ThreadUnarchiveResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2ThreadUnarchiveResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__CollabAgentTool" }); + +export type V2ThreadUnarchiveResponse__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2ThreadUnarchiveResponse__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__SubAgentActivityKind" }); + +export type V2ThreadUnarchiveResponse__WebSearchAction = | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const ServerNotification__ThreadStatus = Schema.Union( + readonly queries?: ReadonlyArray | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const V2ThreadUnarchiveResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), Schema.Struct({ - activeFlags: Schema.Array(ServerNotification__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadUnarchiveResponse__WebSearchAction" }); -export type ServerNotification__ThreadGoal = { - readonly createdAt: number; - readonly objective: string; - readonly status: ServerNotification__ThreadGoalStatus; - readonly threadId: string; - readonly timeUsedSeconds: number; - readonly tokenBudget?: number | null; - readonly tokensUsed: number; - readonly updatedAt: number; +export type V2ThreadUnarchiveResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; }; -export const ServerNotification__ThreadGoal = Schema.Struct({ - createdAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - objective: Schema.String, - status: ServerNotification__ThreadGoalStatus, - threadId: Schema.String, - timeUsedSeconds: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - tokenBudget: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - tokensUsed: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updatedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), -}); - -export type ServerNotification__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: ServerNotification__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: ServerNotification__ThreadId; - }; - } - | { readonly other: string }; -export const ServerNotification__SubAgentSource = Schema.Union( +export const V2ThreadUnarchiveResponse__ImageGenerationFailure = Schema.Union( [ - Schema.Literals(["review", "compact", "memory_consolidation"]), Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey(Schema.Union([ServerNotification__AgentPath, Schema.Null])), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: ServerNotification__ThreadId, + limitId: Schema.String, + resetsAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadUnarchiveResponse__ImageGenerationFailure" }); -export type ServerNotification__ThreadRealtimeOutputAudioDeltaNotification = { - readonly audio: ServerNotification__ThreadRealtimeAudioChunk; - readonly threadId: string; -}; -export const ServerNotification__ThreadRealtimeOutputAudioDeltaNotification = Schema.Struct({ - audio: ServerNotification__ThreadRealtimeAudioChunk, - threadId: Schema.String, -}).annotate({ description: "EXPERIMENTAL - streamed output audio emitted by thread realtime." }); +export type V2ThreadUnarchiveResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2ThreadUnarchiveResponse__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadUnarchiveResponse__TurnItemsView" }); -export type ServerNotification__ThreadTokenUsage = { - readonly last: ServerNotification__TokenUsageBreakdown; - readonly modelContextWindow?: number | null; - readonly total: ServerNotification__TokenUsageBreakdown; +export type V2ThreadUnarchiveResponse__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadUnarchiveResponse__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2ThreadUnarchiveResponse__TurnStatus" }); + +export type V2ThreadUnsubscribeResponse__ThreadUnsubscribeStatus = + | "notLoaded" + | "notSubscribed" + | "unsubscribed"; +export const V2ThreadUnsubscribeResponse__ThreadUnsubscribeStatus = Schema.Literals([ + "notLoaded", + "notSubscribed", + "unsubscribed", +]).annotate({ identifier: "V2ThreadUnsubscribeResponse__ThreadUnsubscribeStatus" }); + +export type V2TurnCompletedNotification__NonSteerableTurnKind = "review" | "compact"; +export const V2TurnCompletedNotification__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2TurnCompletedNotification__NonSteerableTurnKind" }); + +export type V2TurnCompletedNotification__MisalignmentSteer = { readonly message: string }; +export const V2TurnCompletedNotification__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2TurnCompletedNotification__MisalignmentSteer" }); + +export type V2TurnCompletedNotification__ByteRange = { + readonly end: number; + readonly start: number; }; -export const ServerNotification__ThreadTokenUsage = Schema.Struct({ - last: ServerNotification__TokenUsageBreakdown, - modelContextWindow: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - total: ServerNotification__TokenUsageBreakdown, -}); +export const V2TurnCompletedNotification__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2TurnCompletedNotification__ByteRange" }); -export type ServerNotification__TurnPlanStep = { - readonly status: ServerNotification__TurnPlanStepStatus; - readonly step: string; +export type V2TurnCompletedNotification__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2TurnCompletedNotification__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2TurnCompletedNotification__ImageDetail" }); + +export type V2TurnCompletedNotification__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const ServerNotification__TurnPlanStep = Schema.Struct({ - status: ServerNotification__TurnPlanStepStatus, - step: Schema.String, +export const V2TurnCompletedNotification__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2TurnCompletedNotification__HookPromptFragment" }); + +export type V2TurnCompletedNotification__AgentMessageDelivery = "async"; +export const V2TurnCompletedNotification__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2TurnCompletedNotification__AgentMessageDelivery", }); -export type ServerNotification__WindowsSandboxSetupCompletedNotification = { - readonly error?: string | null; - readonly mode: ServerNotification__WindowsSandboxSetupMode; - readonly success: boolean; +export type V2TurnCompletedNotification__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; }; -export const ServerNotification__WindowsSandboxSetupCompletedNotification = Schema.Struct({ - error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - mode: ServerNotification__WindowsSandboxSetupMode, - success: Schema.Boolean, -}); +export const V2TurnCompletedNotification__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2TurnCompletedNotification__MemoryCitationEntry" }); -export type ServerRequest__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: ServerRequest__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const ServerRequest__CommandAction = Schema.Union( +export type V2TurnCompletedNotification__MessagePhase = "commentary" | "final_answer"; +export const V2TurnCompletedNotification__MessagePhase = Schema.Union( [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: ServerRequest__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), ], { mode: "oneOf" }, -); +).annotate({ + description: + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2TurnCompletedNotification__MessagePhase", +}); -export type ServerRequest__ChatgptAuthTokensRefreshParams = { - readonly previousAccountId?: string | null; - readonly reason: ServerRequest__ChatgptAuthTokensRefreshReason; +export type V2TurnCompletedNotification__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; }; -export const ServerRequest__ChatgptAuthTokensRefreshParams = Schema.Struct({ - previousAccountId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Workspace/account identifier that Codex was previously using.\n\nClients that manage multiple accounts/workspaces can use this as a hint to refresh the token for the correct workspace.\n\nThis may be `null` when the prior auth state did not include a workspace identifier (`chatgpt_account_id`).", - }), - Schema.Null, - ]), - ), - reason: ServerRequest__ChatgptAuthTokensRefreshReason, +export const V2TurnCompletedNotification__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2TurnCompletedNotification__AsyncUserInputQuestion" }); + +export type V2TurnCompletedNotification__LegacyAppPathString = string; +export const V2TurnCompletedNotification__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2TurnCompletedNotification__LegacyAppPathString", }); -export type ServerRequest__FileSystemSpecialPath = - | { readonly kind: "root" } - | { readonly kind: "minimal" } - | { readonly kind: "project_roots"; readonly subpath?: ServerRequest__LegacyAppPathString | null } - | { readonly kind: "tmpdir" } - | { readonly kind: "slash_tmp" } - | { - readonly kind: "unknown"; - readonly path: string; - readonly subpath?: ServerRequest__LegacyAppPathString | null; - }; -export const ServerRequest__FileSystemSpecialPath = Schema.Union( +export type V2TurnCompletedNotification__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2TurnCompletedNotification__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2TurnCompletedNotification__CommandExecutionSource" }); + +export type V2TurnCompletedNotification__CommandExecutionStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2TurnCompletedNotification__CommandExecutionStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2TurnCompletedNotification__CommandExecutionStatus" }); + +export type V2TurnCompletedNotification__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2TurnCompletedNotification__PatchChangeKind = Schema.Union( [ - Schema.Struct({ kind: Schema.Literal("root") }).annotate({ - title: "RootFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ - title: "MinimalFileSystemSpecialPath", - }), Schema.Struct({ - kind: Schema.Literal("project_roots"), - subpath: Schema.optionalKey(Schema.Union([ServerRequest__LegacyAppPathString, Schema.Null])), - }).annotate({ title: "KindFileSystemSpecialPath" }), - Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ - title: "TmpdirFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ - title: "SlashTmpFileSystemSpecialPath", - }), + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), Schema.Struct({ - kind: Schema.Literal("unknown"), - path: Schema.String, - subpath: Schema.optionalKey(Schema.Union([ServerRequest__LegacyAppPathString, Schema.Null])), - }), + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), + Schema.Struct({ + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnCompletedNotification__PatchChangeKind" }); -export type ServerRequest__McpElicitationBooleanSchema = { - readonly default?: boolean | null; - readonly description?: string | null; - readonly title?: string | null; - readonly type: ServerRequest__McpElicitationBooleanType; -}; -export const ServerRequest__McpElicitationBooleanSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: ServerRequest__McpElicitationBooleanType, -}); +export type V2TurnCompletedNotification__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2TurnCompletedNotification__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2TurnCompletedNotification__PatchApplyStatus" }); -export type ServerRequest__McpElicitationTitledEnumItems = { - readonly anyOf: ReadonlyArray; +export type V2TurnCompletedNotification__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const ServerRequest__McpElicitationTitledEnumItems = Schema.Struct({ - anyOf: Schema.Array(ServerRequest__McpElicitationConstOption), -}); +export const V2TurnCompletedNotification__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2TurnCompletedNotification__McpToolCallAppContext" }); -export type ServerRequest__McpElicitationNumberSchema = { - readonly default?: number | null; - readonly description?: string | null; - readonly maximum?: number | null; - readonly minimum?: number | null; - readonly title?: string | null; - readonly type: ServerRequest__McpElicitationNumberType; -}; -export const ServerRequest__McpElicitationNumberSchema = Schema.Struct({ - default: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "double" }).check(Schema.isFinite()), - Schema.Null, - ]), - ), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - maximum: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "double" }).check(Schema.isFinite()), - Schema.Null, - ]), - ), - minimum: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "double" }).check(Schema.isFinite()), - Schema.Null, - ]), - ), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: ServerRequest__McpElicitationNumberType, -}); +export type V2TurnCompletedNotification__McpToolCallError = { readonly message: string }; +export const V2TurnCompletedNotification__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2TurnCompletedNotification__McpToolCallError" }); -export type ServerRequest__McpElicitationLegacyTitledEnumSchema = { - readonly default?: string | null; - readonly description?: string | null; - readonly enum: ReadonlyArray; - readonly enumNames?: ReadonlyArray | null; - readonly title?: string | null; - readonly type: ServerRequest__McpElicitationStringType; +export type V2TurnCompletedNotification__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2TurnCompletedNotification__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2TurnCompletedNotification__McpAppDisplayMode" }); + +export type V2TurnCompletedNotification__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; }; -export const ServerRequest__McpElicitationLegacyTitledEnumSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - enum: Schema.Array(Schema.String), - enumNames: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: ServerRequest__McpElicitationStringType, -}); +export const V2TurnCompletedNotification__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2TurnCompletedNotification__McpToolCallResult" }); -export type ServerRequest__McpElicitationStringSchema = { - readonly default?: string | null; - readonly description?: string | null; - readonly format?: ServerRequest__McpElicitationStringFormat | null; - readonly maxLength?: number | null; - readonly minLength?: number | null; - readonly title?: string | null; - readonly type: ServerRequest__McpElicitationStringType; -}; -export const ServerRequest__McpElicitationStringSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - format: Schema.optionalKey( - Schema.Union([ServerRequest__McpElicitationStringFormat, Schema.Null]), - ), - maxLength: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - minLength: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: ServerRequest__McpElicitationStringType, -}); - -export type ServerRequest__McpElicitationTitledSingleSelectEnumSchema = { - readonly default?: string | null; - readonly description?: string | null; - readonly oneOf: ReadonlyArray; - readonly title?: string | null; - readonly type: ServerRequest__McpElicitationStringType; -}; -export const ServerRequest__McpElicitationTitledSingleSelectEnumSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - oneOf: Schema.Array(ServerRequest__McpElicitationConstOption), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: ServerRequest__McpElicitationStringType, -}); - -export type ServerRequest__McpElicitationUntitledEnumItems = { - readonly enum: ReadonlyArray; - readonly type: ServerRequest__McpElicitationStringType; -}; -export const ServerRequest__McpElicitationUntitledEnumItems = Schema.Struct({ - enum: Schema.Array(Schema.String), - type: ServerRequest__McpElicitationStringType, -}); - -export type ServerRequest__McpElicitationUntitledSingleSelectEnumSchema = { - readonly default?: string | null; - readonly description?: string | null; - readonly enum: ReadonlyArray; - readonly title?: string | null; - readonly type: ServerRequest__McpElicitationStringType; -}; -export const ServerRequest__McpElicitationUntitledSingleSelectEnumSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - enum: Schema.Array(Schema.String), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: ServerRequest__McpElicitationStringType, -}); - -export type ServerRequest__NetworkApprovalContext = { - readonly host: string; - readonly protocol: ServerRequest__NetworkApprovalProtocol; -}; -export const ServerRequest__NetworkApprovalContext = Schema.Struct({ - host: Schema.String, - protocol: ServerRequest__NetworkApprovalProtocol, -}); - -export type ServerRequest__NetworkPolicyAmendment = { - readonly action: ServerRequest__NetworkPolicyRuleAction; - readonly host: string; -}; -export const ServerRequest__NetworkPolicyAmendment = Schema.Struct({ - action: ServerRequest__NetworkPolicyRuleAction, - host: Schema.String, -}); +export type V2TurnCompletedNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2TurnCompletedNotification__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2TurnCompletedNotification__McpToolCallStatus" }); -export type ServerRequest__ApplyPatchApprovalParams = { - readonly callId: string; - readonly conversationId: ServerRequest__ThreadId; - readonly fileChanges: { readonly [x: string]: ServerRequest__FileChange }; - readonly grantRoot?: string | null; - readonly reason?: string | null; -}; -export const ServerRequest__ApplyPatchApprovalParams = Schema.Struct({ - callId: Schema.String.annotate({ - description: - "Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent] and [codex_protocol::protocol::PatchApplyEndEvent].", - }), - conversationId: ServerRequest__ThreadId, - fileChanges: Schema.Record(Schema.String, ServerRequest__FileChange), - grantRoot: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).", +export type V2TurnCompletedNotification__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2TurnCompletedNotification__DynamicToolCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", }), - Schema.Null, - ]), - ), - reason: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional explanatory reason (e.g. request for extra write access).", + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), + Schema.Struct({ + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", }), - Schema.Null, - ]), - ), -}); - -export type ServerRequest__ExecCommandApprovalParams = { - readonly approvalId?: string | null; - readonly callId: string; - readonly command: ReadonlyArray; - readonly conversationId: ServerRequest__ThreadId; - readonly cwd: string; - readonly parsedCmd: ReadonlyArray; - readonly reason?: string | null; -}; -export const ServerRequest__ExecCommandApprovalParams = Schema.Struct({ - approvalId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Identifier for this specific approval callback." }), - Schema.Null, - ]), - ), - callId: Schema.String.annotate({ - description: - "Use to correlate this with [codex_protocol::protocol::ExecCommandBeginEvent] and [codex_protocol::protocol::ExecCommandEndEvent].", - }), - command: Schema.Array(Schema.String), - conversationId: ServerRequest__ThreadId, - cwd: Schema.String, - parsedCmd: Schema.Array(ServerRequest__ParsedCommand), - reason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + Schema.Struct({ + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnCompletedNotification__DynamicToolCallOutputContentItem" }); -export type ServerRequest__ToolRequestUserInputQuestion = { - readonly header: string; - readonly id: string; - readonly isOther?: boolean; - readonly isSecret?: boolean; - readonly options?: ReadonlyArray | null; - readonly question: string; -}; -export const ServerRequest__ToolRequestUserInputQuestion = Schema.Struct({ - header: Schema.String, - id: Schema.String, - isOther: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - isSecret: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - options: Schema.optionalKey( - Schema.Union([Schema.Array(ServerRequest__ToolRequestUserInputOption), Schema.Null]), - ), - question: Schema.String, -}).annotate({ - description: "EXPERIMENTAL. Represents one request_user_input question and its required options.", -}); +export type V2TurnCompletedNotification__DynamicToolCallStatus = + | "inProgress" + | "completed" + | "failed"; +export const V2TurnCompletedNotification__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2TurnCompletedNotification__DynamicToolCallStatus" }); -export type ToolRequestUserInputParams__ToolRequestUserInputQuestion = { - readonly header: string; - readonly id: string; - readonly isOther?: boolean; - readonly isSecret?: boolean; - readonly options?: ReadonlyArray | null; - readonly question: string; -}; -export const ToolRequestUserInputParams__ToolRequestUserInputQuestion = Schema.Struct({ - header: Schema.String, - id: Schema.String, - isOther: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - isSecret: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - options: Schema.optionalKey( - Schema.Union([ - Schema.Array(ToolRequestUserInputParams__ToolRequestUserInputOption), - Schema.Null, - ]), - ), - question: Schema.String, -}).annotate({ - description: "EXPERIMENTAL. Represents one request_user_input question and its required options.", -}); +export type V2TurnCompletedNotification__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2TurnCompletedNotification__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2TurnCompletedNotification__CollabAgentStatus" }); -export type V2AccountRateLimitsUpdatedNotification__RateLimitSnapshot = { - readonly credits?: V2AccountRateLimitsUpdatedNotification__CreditsSnapshot | null; - readonly individualLimit?: V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot | null; - readonly limitId?: string | null; - readonly limitName?: string | null; - readonly planType?: V2AccountRateLimitsUpdatedNotification__PlanType | null; - readonly primary?: V2AccountRateLimitsUpdatedNotification__RateLimitWindow | null; - readonly rateLimitReachedType?: V2AccountRateLimitsUpdatedNotification__RateLimitReachedType | null; - readonly secondary?: V2AccountRateLimitsUpdatedNotification__RateLimitWindow | null; - readonly spendControlReached?: boolean | null; -}; -export const V2AccountRateLimitsUpdatedNotification__RateLimitSnapshot = Schema.Struct({ - credits: Schema.optionalKey( - Schema.Union([V2AccountRateLimitsUpdatedNotification__CreditsSnapshot, Schema.Null]), - ), - individualLimit: Schema.optionalKey( - Schema.Union([V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot, Schema.Null]), - ), - limitId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - limitName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - planType: Schema.optionalKey( - Schema.Union([V2AccountRateLimitsUpdatedNotification__PlanType, Schema.Null]), - ), - primary: Schema.optionalKey( - Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitWindow, Schema.Null]), - ), - rateLimitReachedType: Schema.optionalKey( - Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitReachedType, Schema.Null]), - ), - secondary: Schema.optionalKey( - Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitWindow, Schema.Null]), - ), - spendControlReached: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: - "Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.", - }), - Schema.Null, - ]), - ), -}); +export type V2TurnCompletedNotification__ReasoningEffort = string; +export const V2TurnCompletedNotification__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2TurnCompletedNotification__ReasoningEffort", + }), +); -export type V2AppListUpdatedNotification__AppMetadata = { - readonly categories?: ReadonlyArray | null; - readonly developer?: string | null; - readonly firstPartyRequiresInstall?: boolean | null; - readonly firstPartyType?: string | null; - readonly review?: V2AppListUpdatedNotification__AppReview | null; - readonly screenshots?: ReadonlyArray | null; - readonly seoDescription?: string | null; - readonly showInComposerWhenUnlinked?: boolean | null; - readonly subCategories?: ReadonlyArray | null; - readonly version?: string | null; - readonly versionId?: string | null; - readonly versionNotes?: string | null; -}; -export const V2AppListUpdatedNotification__AppMetadata = Schema.Struct({ - categories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - developer: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - firstPartyRequiresInstall: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - firstPartyType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - review: Schema.optionalKey(Schema.Union([V2AppListUpdatedNotification__AppReview, Schema.Null])), - screenshots: Schema.optionalKey( - Schema.Union([Schema.Array(V2AppListUpdatedNotification__AppScreenshot), Schema.Null]), - ), - seoDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - showInComposerWhenUnlinked: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - subCategories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - version: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - versionId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - versionNotes: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export type V2TurnCompletedNotification__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2TurnCompletedNotification__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2TurnCompletedNotification__CollabAgentToolCallStatus" }); -export type V2AppsListResponse__AppMetadata = { - readonly categories?: ReadonlyArray | null; - readonly developer?: string | null; - readonly firstPartyRequiresInstall?: boolean | null; - readonly firstPartyType?: string | null; - readonly review?: V2AppsListResponse__AppReview | null; - readonly screenshots?: ReadonlyArray | null; - readonly seoDescription?: string | null; - readonly showInComposerWhenUnlinked?: boolean | null; - readonly subCategories?: ReadonlyArray | null; - readonly version?: string | null; - readonly versionId?: string | null; - readonly versionNotes?: string | null; -}; -export const V2AppsListResponse__AppMetadata = Schema.Struct({ - categories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - developer: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - firstPartyRequiresInstall: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - firstPartyType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - review: Schema.optionalKey(Schema.Union([V2AppsListResponse__AppReview, Schema.Null])), - screenshots: Schema.optionalKey( - Schema.Union([Schema.Array(V2AppsListResponse__AppScreenshot), Schema.Null]), - ), - seoDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - showInComposerWhenUnlinked: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - subCategories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - version: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - versionId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - versionNotes: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export type V2TurnCompletedNotification__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2TurnCompletedNotification__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2TurnCompletedNotification__CollabAgentTool" }); -export type V2AppsReadResponse__ConnectorMetadata = { - readonly description?: string | null; - readonly iconUrl?: string | null; - readonly id: string; - readonly name: string; - readonly toolSummaries?: ReadonlyArray | null; -}; -export const V2AppsReadResponse__ConnectorMetadata = Schema.Struct({ - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - id: Schema.String, - name: Schema.String, - toolSummaries: Schema.optionalKey( - Schema.Union([Schema.Array(V2AppsReadResponse__AppToolSummary), Schema.Null]), - ), -}).annotate({ description: "EXPERIMENTAL - metadata returned by app/read." }); +export type V2TurnCompletedNotification__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2TurnCompletedNotification__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2TurnCompletedNotification__SubAgentActivityKind" }); -export type V2CommandExecParams__SandboxPolicy = - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } +export type V2TurnCompletedNotification__WebSearchAction = | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; -export const V2CommandExecParams__SandboxPolicy = Schema.Union( + readonly queries?: ReadonlyArray | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const V2TurnCompletedNotification__WebSearchAction = Schema.Union( [ Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), - writableRoots: Schema.optionalKey( - Schema.Array(V2CommandExecParams__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnCompletedNotification__WebSearchAction" }); -export type V2ConfigBatchWriteParams__ConfigEdit = { - readonly keyPath: string; - readonly mergeStrategy: V2ConfigBatchWriteParams__MergeStrategy; - readonly value: unknown; +export type V2TurnCompletedNotification__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; }; -export const V2ConfigBatchWriteParams__ConfigEdit = Schema.Struct({ - keyPath: Schema.String, - mergeStrategy: V2ConfigBatchWriteParams__MergeStrategy, - value: Schema.Unknown, -}); - -export type V2ConfigReadResponse__ConfigLayerSource = - | { readonly domain: string; readonly key: string; readonly type: "mdm" } - | { readonly file: string; readonly type: "system" } - | { readonly id: string; readonly name: string; readonly type: "enterpriseManaged" } - | { readonly file: string; readonly profile?: string | null; readonly type: "user" } - | { readonly dotCodexFolder: V2ConfigReadResponse__AbsolutePathBuf; readonly type: "project" } - | { readonly type: "sessionFlags" } - | { - readonly file: V2ConfigReadResponse__AbsolutePathBuf; - readonly type: "legacyManagedConfigTomlFromFile"; - } - | { readonly type: "legacyManagedConfigTomlFromMdm" }; -export const V2ConfigReadResponse__ConfigLayerSource = Schema.Union( +export const V2TurnCompletedNotification__ImageGenerationFailure = Schema.Union( [ Schema.Struct({ - domain: Schema.String, - key: Schema.String, - type: Schema.Literal("mdm").annotate({ title: "MdmConfigLayerSourceType" }), - }).annotate({ - title: "MdmConfigLayerSource", - description: "Managed preferences layer delivered by MDM (macOS only).", - }), - Schema.Struct({ - file: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), - type: Schema.Literal("system").annotate({ title: "SystemConfigLayerSourceType" }), - }).annotate({ - title: "SystemConfigLayerSource", - description: "Managed config layer from a file (usually `managed_config.toml`).", - }), - Schema.Struct({ - id: Schema.String.annotate({ description: "Stable identifier for the delivered layer." }), - name: Schema.String.annotate({ - description: - "Admin-facing name for the delivered layer. This is surfaced in diagnostics so users know which cloud layer needs administrator attention.", - }), - type: Schema.Literal("enterpriseManaged").annotate({ - title: "EnterpriseManagedConfigLayerSourceType", - }), - }).annotate({ - title: "EnterpriseManagedConfigLayerSource", - description: "Enterprise-managed config layer delivered by the cloud config bundle.", - }), - Schema.Struct({ - file: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), - profile: Schema.optionalKey( + limitId: Schema.String, + resetsAt: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ - description: - "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.", - }), + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), Schema.Null, ]), ), - type: Schema.Literal("user").annotate({ title: "UserConfigLayerSourceType" }), - }).annotate({ - title: "UserConfigLayerSource", - description: - "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory", - }), - Schema.Struct({ - dotCodexFolder: V2ConfigReadResponse__AbsolutePathBuf, - type: Schema.Literal("project").annotate({ title: "ProjectConfigLayerSourceType" }), - }).annotate({ - title: "ProjectConfigLayerSource", - description: - "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.", + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnCompletedNotification__ImageGenerationFailure" }); + +export type V2TurnCompletedNotification__AbsolutePathBuf = string; +export const V2TurnCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2TurnCompletedNotification__AbsolutePathBuf", +}); + +export type V2TurnCompletedNotification__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2TurnCompletedNotification__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", }), - Schema.Struct({ - type: Schema.Literal("sessionFlags").annotate({ title: "SessionFlagsConfigLayerSourceType" }), - }).annotate({ - title: "SessionFlagsConfigLayerSource", - description: "Session-layer overrides supplied via `-c`/`--config`.", + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", }), - Schema.Struct({ - file: V2ConfigReadResponse__AbsolutePathBuf, - type: Schema.Literal("legacyManagedConfigTomlFromFile").annotate({ - title: "LegacyManagedConfigTomlFromFileConfigLayerSourceType", - }), - }).annotate({ - title: "LegacyManagedConfigTomlFromFileConfigLayerSource", + Schema.Literal("full").annotate({ description: - '`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a "best effort" while we phase out `managed_config.toml` in favor of `requirements.toml`.', + "`items` contains every ThreadItem available from persisted app-server history for this turn.", }), - Schema.Struct({ - type: Schema.Literal("legacyManagedConfigTomlFromMdm").annotate({ - title: "LegacyManagedConfigTomlFromMdmConfigLayerSourceType", - }), - }).annotate({ title: "LegacyManagedConfigTomlFromMdmConfigLayerSource" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnCompletedNotification__TurnItemsView" }); -export type V2ConfigReadResponse__AppsDefaultConfig = { - readonly approvals_reviewer?: V2ConfigReadResponse__ApprovalsReviewer | null; - readonly default_tools_approval_mode?: V2ConfigReadResponse__AppToolApproval | null; - readonly destructive_enabled?: boolean; - readonly enabled?: boolean; - readonly open_world_enabled?: boolean; +export type V2TurnCompletedNotification__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2TurnCompletedNotification__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2TurnCompletedNotification__TurnStatus" }); + +export type V2TurnPlanUpdatedNotification__TurnPlanStepStatus = + | "pending" + | "inProgress" + | "completed"; +export const V2TurnPlanUpdatedNotification__TurnPlanStepStatus = Schema.Literals([ + "pending", + "inProgress", + "completed", +]).annotate({ identifier: "V2TurnPlanUpdatedNotification__TurnPlanStepStatus" }); + +export type V2TurnStartedNotification__NonSteerableTurnKind = "review" | "compact"; +export const V2TurnStartedNotification__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2TurnStartedNotification__NonSteerableTurnKind" }); + +export type V2TurnStartedNotification__MisalignmentSteer = { readonly message: string }; +export const V2TurnStartedNotification__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2TurnStartedNotification__MisalignmentSteer" }); + +export type V2TurnStartedNotification__ByteRange = { readonly end: number; readonly start: number }; +export const V2TurnStartedNotification__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2TurnStartedNotification__ByteRange" }); + +export type V2TurnStartedNotification__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2TurnStartedNotification__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2TurnStartedNotification__ImageDetail" }); + +export type V2TurnStartedNotification__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const V2ConfigReadResponse__AppsDefaultConfig = Schema.Struct({ - approvals_reviewer: Schema.optionalKey( - Schema.Union([V2ConfigReadResponse__ApprovalsReviewer, Schema.Null]), - ), - default_tools_approval_mode: Schema.optionalKey( - Schema.Union([V2ConfigReadResponse__AppToolApproval, Schema.Null]), - ), - destructive_enabled: Schema.optionalKey(Schema.Boolean.annotate({ default: true })), - enabled: Schema.optionalKey(Schema.Boolean.annotate({ default: true })), - open_world_enabled: Schema.optionalKey(Schema.Boolean.annotate({ default: true })), +export const V2TurnStartedNotification__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2TurnStartedNotification__HookPromptFragment" }); + +export type V2TurnStartedNotification__AgentMessageDelivery = "async"; +export const V2TurnStartedNotification__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2TurnStartedNotification__AgentMessageDelivery", }); -export type V2ConfigReadResponse__WebSearchToolConfig = { - readonly allowed_domains?: ReadonlyArray | null; - readonly context_size?: V2ConfigReadResponse__WebSearchContextSize | null; - readonly location?: V2ConfigReadResponse__WebSearchLocation | null; +export type V2TurnStartedNotification__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; }; -export const V2ConfigReadResponse__WebSearchToolConfig = Schema.Struct({ - allowed_domains: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - context_size: Schema.optionalKey( - Schema.Union([V2ConfigReadResponse__WebSearchContextSize, Schema.Null]), - ), - location: Schema.optionalKey( - Schema.Union([V2ConfigReadResponse__WebSearchLocation, Schema.Null]), - ), +export const V2TurnStartedNotification__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2TurnStartedNotification__MemoryCitationEntry" }); + +export type V2TurnStartedNotification__MessagePhase = "commentary" | "final_answer"; +export const V2TurnStartedNotification__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2TurnStartedNotification__MessagePhase", }); -export type V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup = { - readonly hooks: ReadonlyArray; - readonly matcher?: string | null; +export type V2TurnStartedNotification__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; }; -export const V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup = Schema.Struct({ - hooks: Schema.Array(V2ConfigRequirementsReadResponse__ConfiguredHookHandler), - matcher: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +export const V2TurnStartedNotification__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2TurnStartedNotification__AsyncUserInputQuestion" }); + +export type V2TurnStartedNotification__LegacyAppPathString = string; +export const V2TurnStartedNotification__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2TurnStartedNotification__LegacyAppPathString", }); -export type V2ConfigRequirementsReadResponse__NewThreadModelDefaults = { - readonly model?: string | null; - readonly modelReasoningEffort?: V2ConfigRequirementsReadResponse__ReasoningEffort | null; - readonly serviceTier?: string | null; +export type V2TurnStartedNotification__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2TurnStartedNotification__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2TurnStartedNotification__CommandExecutionSource" }); + +export type V2TurnStartedNotification__CommandExecutionStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2TurnStartedNotification__CommandExecutionStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2TurnStartedNotification__CommandExecutionStatus" }); + +export type V2TurnStartedNotification__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2TurnStartedNotification__PatchChangeKind = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), + Schema.Struct({ + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), + Schema.Struct({ + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnStartedNotification__PatchChangeKind" }); + +export type V2TurnStartedNotification__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2TurnStartedNotification__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2TurnStartedNotification__PatchApplyStatus" }); + +export type V2TurnStartedNotification__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const V2ConfigRequirementsReadResponse__NewThreadModelDefaults = Schema.Struct({ - model: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - modelReasoningEffort: Schema.optionalKey( - Schema.Union([V2ConfigRequirementsReadResponse__ReasoningEffort, Schema.Null]), - ), - serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export const V2TurnStartedNotification__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2TurnStartedNotification__McpToolCallAppContext" }); -export type V2ConfigWarningNotification__TextRange = { - readonly end: V2ConfigWarningNotification__TextPosition; - readonly start: V2ConfigWarningNotification__TextPosition; +export type V2TurnStartedNotification__McpToolCallError = { readonly message: string }; +export const V2TurnStartedNotification__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2TurnStartedNotification__McpToolCallError" }); + +export type V2TurnStartedNotification__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2TurnStartedNotification__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2TurnStartedNotification__McpAppDisplayMode" }); + +export type V2TurnStartedNotification__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; }; -export const V2ConfigWarningNotification__TextRange = Schema.Struct({ - end: V2ConfigWarningNotification__TextPosition, - start: V2ConfigWarningNotification__TextPosition, -}); +export const V2TurnStartedNotification__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2TurnStartedNotification__McpToolCallResult" }); -export type V2ConfigWriteResponse__ConfigLayerSource = - | { readonly domain: string; readonly key: string; readonly type: "mdm" } - | { readonly file: string; readonly type: "system" } - | { readonly id: string; readonly name: string; readonly type: "enterpriseManaged" } - | { readonly file: string; readonly profile?: string | null; readonly type: "user" } - | { readonly dotCodexFolder: V2ConfigWriteResponse__AbsolutePathBuf; readonly type: "project" } - | { readonly type: "sessionFlags" } - | { - readonly file: V2ConfigWriteResponse__AbsolutePathBuf; - readonly type: "legacyManagedConfigTomlFromFile"; - } - | { readonly type: "legacyManagedConfigTomlFromMdm" }; -export const V2ConfigWriteResponse__ConfigLayerSource = Schema.Union( +export type V2TurnStartedNotification__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2TurnStartedNotification__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2TurnStartedNotification__McpToolCallStatus" }); + +export type V2TurnStartedNotification__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2TurnStartedNotification__DynamicToolCallOutputContentItem = Schema.Union( [ Schema.Struct({ - domain: Schema.String, - key: Schema.String, - type: Schema.Literal("mdm").annotate({ title: "MdmConfigLayerSourceType" }), - }).annotate({ - title: "MdmConfigLayerSource", - description: "Managed preferences layer delivered by MDM (macOS only).", - }), - Schema.Struct({ - file: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", }), - type: Schema.Literal("system").annotate({ title: "SystemConfigLayerSourceType" }), - }).annotate({ - title: "SystemConfigLayerSource", - description: "Managed config layer from a file (usually `managed_config.toml`).", - }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), Schema.Struct({ - id: Schema.String.annotate({ description: "Stable identifier for the delivered layer." }), - name: Schema.String.annotate({ - description: - "Admin-facing name for the delivered layer. This is surfaced in diagnostics so users know which cloud layer needs administrator attention.", - }), - type: Schema.Literal("enterpriseManaged").annotate({ - title: "EnterpriseManagedConfigLayerSourceType", + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", }), - }).annotate({ - title: "EnterpriseManagedConfigLayerSource", - description: "Enterprise-managed config layer delivered by the cloud config bundle.", - }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), Schema.Struct({ - file: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", }), - profile: Schema.optionalKey( + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnStartedNotification__DynamicToolCallOutputContentItem" }); + +export type V2TurnStartedNotification__DynamicToolCallStatus = + | "inProgress" + | "completed" + | "failed"; +export const V2TurnStartedNotification__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2TurnStartedNotification__DynamicToolCallStatus" }); + +export type V2TurnStartedNotification__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2TurnStartedNotification__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2TurnStartedNotification__CollabAgentStatus" }); + +export type V2TurnStartedNotification__ReasoningEffort = string; +export const V2TurnStartedNotification__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2TurnStartedNotification__ReasoningEffort", + }), +); + +export type V2TurnStartedNotification__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2TurnStartedNotification__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2TurnStartedNotification__CollabAgentToolCallStatus" }); + +export type V2TurnStartedNotification__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2TurnStartedNotification__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2TurnStartedNotification__CollabAgentTool" }); + +export type V2TurnStartedNotification__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2TurnStartedNotification__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2TurnStartedNotification__SubAgentActivityKind" }); + +export type V2TurnStartedNotification__WebSearchAction = + | { + readonly queries?: ReadonlyArray | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const V2TurnStartedNotification__WebSearchAction = Schema.Union( + [ + Schema.Struct({ + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), + Schema.Struct({ + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), + Schema.Struct({ + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), + Schema.Struct({ + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnStartedNotification__WebSearchAction" }); + +export type V2TurnStartedNotification__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; +}; +export const V2TurnStartedNotification__ImageGenerationFailure = Schema.Union( + [ + Schema.Struct({ + limitId: Schema.String, + resetsAt: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ - description: - "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.", - }), + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), Schema.Null, ]), ), - type: Schema.Literal("user").annotate({ title: "UserConfigLayerSourceType" }), - }).annotate({ - title: "UserConfigLayerSource", - description: - "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory", - }), - Schema.Struct({ - dotCodexFolder: V2ConfigWriteResponse__AbsolutePathBuf, - type: Schema.Literal("project").annotate({ title: "ProjectConfigLayerSourceType" }), - }).annotate({ - title: "ProjectConfigLayerSource", - description: - "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.", + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnStartedNotification__ImageGenerationFailure" }); + +export type V2TurnStartedNotification__AbsolutePathBuf = string; +export const V2TurnStartedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2TurnStartedNotification__AbsolutePathBuf", +}); + +export type V2TurnStartedNotification__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2TurnStartedNotification__TurnItemsView = Schema.Union( + [ + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", }), - Schema.Struct({ - type: Schema.Literal("sessionFlags").annotate({ title: "SessionFlagsConfigLayerSourceType" }), - }).annotate({ - title: "SessionFlagsConfigLayerSource", - description: "Session-layer overrides supplied via `-c`/`--config`.", + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", }), - Schema.Struct({ - file: V2ConfigWriteResponse__AbsolutePathBuf, - type: Schema.Literal("legacyManagedConfigTomlFromFile").annotate({ - title: "LegacyManagedConfigTomlFromFileConfigLayerSourceType", - }), - }).annotate({ - title: "LegacyManagedConfigTomlFromFileConfigLayerSource", + Schema.Literal("full").annotate({ description: - '`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a "best effort" while we phase out `managed_config.toml` in favor of `requirements.toml`.', + "`items` contains every ThreadItem available from persisted app-server history for this turn.", }), - Schema.Struct({ - type: Schema.Literal("legacyManagedConfigTomlFromMdm").annotate({ - title: "LegacyManagedConfigTomlFromMdmConfigLayerSourceType", - }), - }).annotate({ title: "LegacyManagedConfigTomlFromMdmConfigLayerSource" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnStartedNotification__TurnItemsView" }); -export type V2ErrorNotification__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } +export type V2TurnStartedNotification__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2TurnStartedNotification__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2TurnStartedNotification__TurnStatus" }); + +export type V2TurnStartParams__AskForApproval = + | "untrusted" + | "on-request" + | "never" | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ErrorNotification__NonSteerableTurnKind; + readonly granular: { + readonly mcp_elicitations: boolean; + readonly request_permissions?: boolean; + readonly rules: boolean; + readonly sandbox_approval: boolean; + readonly skill_approval?: boolean; }; }; -export const V2ErrorNotification__CodexErrorInfo = Schema.Union( +export const V2TurnStartParams__AskForApproval = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), - Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), - Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), + Schema.Literals(["untrusted", "on-request", "never"]), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ErrorNotification__NonSteerableTurnKind, + granular: Schema.Struct({ + mcp_elicitations: Schema.Boolean, + request_permissions: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + rules: Schema.Boolean, + sandbox_approval: Schema.Boolean, + skill_approval: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", - }), + }).annotate({ title: "GranularAskForApproval" }), ], { mode: "oneOf" }, -).annotate({ +).annotate({ identifier: "V2TurnStartParams__AskForApproval" }); + +export type V2TurnStartParams__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; +export const V2TurnStartParams__ApprovalsReviewer = Schema.Literals([ + "user", + "auto_review", + "guardian_subagent", +]).annotate({ description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + identifier: "V2TurnStartParams__ApprovalsReviewer", }); -export type V2ExternalAgentConfigDetectResponse__MigrationDetails = { - readonly commands?: ReadonlyArray; - readonly hooks?: ReadonlyArray; - readonly mcpServers?: ReadonlyArray; - readonly memory?: ReadonlyArray; - readonly plugins?: ReadonlyArray; - readonly sessions?: ReadonlyArray; - readonly skills?: ReadonlyArray; - readonly subagents?: ReadonlyArray; -}; -export const V2ExternalAgentConfigDetectResponse__MigrationDetails = Schema.Struct({ - commands: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigDetectResponse__CommandMigration).annotate({ default: [] }), - ), - hooks: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigDetectResponse__HookMigration).annotate({ default: [] }), - ), - mcpServers: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigDetectResponse__McpServerMigration).annotate({ default: [] }), - ), - memory: Schema.optionalKey(Schema.Array(Schema.String)), - plugins: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigDetectResponse__PluginsMigration).annotate({ default: [] }), - ), - sessions: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigDetectResponse__SessionMigration).annotate({ default: [] }), - ), - skills: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigDetectResponse__SkillMigration).annotate({ default: [] }), - ), - subagents: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigDetectResponse__SubagentMigration).annotate({ default: [] }), - ), +export type V2TurnStartParams__ReasoningEffort = string; +export const V2TurnStartParams__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2TurnStartParams__ReasoningEffort", + }), +); + +export type V2TurnStartParams__ByteRange = { readonly end: number; readonly start: number }; +export const V2TurnStartParams__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2TurnStartParams__ByteRange" }); + +export type V2TurnStartParams__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2TurnStartParams__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2TurnStartParams__ImageDetail" }); + +export type V2TurnStartParams__Personality = "none" | "friendly" | "pragmatic"; +export const V2TurnStartParams__Personality = Schema.Literals([ + "none", + "friendly", + "pragmatic", +]).annotate({ + description: "Deprecated: `friendly` and `pragmatic` no longer select a style.", + identifier: "V2TurnStartParams__Personality", }); -export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeFailure = - { - readonly cwd?: string | null; - readonly errorType?: string | null; - readonly failureStage: string; - readonly itemType: V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType; - readonly message: string; - readonly source?: string | null; - readonly subErrorType?: string | null; - }; -export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeFailure = - Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - failureStage: Schema.String, - itemType: - V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType, - message: Schema.String, - source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }); +export type V2TurnStartParams__NetworkAccess = "restricted" | "enabled"; +export const V2TurnStartParams__NetworkAccess = Schema.Literals(["restricted", "enabled"]).annotate( + { identifier: "V2TurnStartParams__NetworkAccess" }, +); -export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeSuccess = - { - readonly cwd?: string | null; - readonly itemType: V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType; - readonly source?: string | null; - readonly target?: string | null; - }; -export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeSuccess = - Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - itemType: - V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType, - source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }); +export type V2TurnStartParams__AbsolutePathBuf = string; +export const V2TurnStartParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2TurnStartParams__AbsolutePathBuf", +}); -export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeFailure = - { - readonly cwd?: string | null; - readonly errorType?: string | null; - readonly failureStage: string; - readonly itemType: V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType; - readonly message: string; - readonly source?: string | null; - readonly subErrorType?: string | null; - }; -export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeFailure = - Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - failureStage: Schema.String, - itemType: - V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType, - message: Schema.String, - source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }); +export type V2TurnStartParams__ReasoningSummary = "auto" | "concise" | "detailed" | "none"; +export const V2TurnStartParams__ReasoningSummary = Schema.Union( + [ + Schema.Literals(["auto", "concise", "detailed"]), + Schema.Literal("none").annotate({ description: "Option to disable reasoning summaries." }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + identifier: "V2TurnStartParams__ReasoningSummary", +}); -export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeSuccess = - { - readonly cwd?: string | null; - readonly itemType: V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType; - readonly source?: string | null; - readonly target?: string | null; - }; -export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeSuccess = - Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - itemType: - V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType, - source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }); +export type V2TurnStartParams__AdditionalContextKind = "untrusted" | "application"; +export const V2TurnStartParams__AdditionalContextKind = Schema.Literals([ + "untrusted", + "application", +]).annotate({ identifier: "V2TurnStartParams__AdditionalContextKind" }); -export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorCandidate = - { - readonly name: string; - readonly sessionCount: number; - readonly source: V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorSource; - }; -export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorCandidate = - Schema.Struct({ - name: Schema.String, - sessionCount: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - source: V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorSource, - }); +export type V2TurnStartParams__ModeKind = "plan" | "default"; +export const V2TurnStartParams__ModeKind = Schema.Literals(["plan", "default"]).annotate({ + description: "Initial collaboration mode to use when the TUI starts.", + identifier: "V2TurnStartParams__ModeKind", +}); -export type V2ExternalAgentConfigImportParams__MigrationDetails = { - readonly commands?: ReadonlyArray; - readonly hooks?: ReadonlyArray; - readonly mcpServers?: ReadonlyArray; - readonly memory?: ReadonlyArray; - readonly plugins?: ReadonlyArray; - readonly sessions?: ReadonlyArray; - readonly skills?: ReadonlyArray; - readonly subagents?: ReadonlyArray; -}; -export const V2ExternalAgentConfigImportParams__MigrationDetails = Schema.Struct({ - commands: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigImportParams__CommandMigration).annotate({ default: [] }), - ), - hooks: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigImportParams__HookMigration).annotate({ default: [] }), - ), - mcpServers: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigImportParams__McpServerMigration).annotate({ default: [] }), - ), - memory: Schema.optionalKey(Schema.Array(Schema.String)), - plugins: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigImportParams__PluginsMigration).annotate({ default: [] }), - ), - sessions: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigImportParams__SessionMigration).annotate({ default: [] }), - ), - skills: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigImportParams__SkillMigration).annotate({ default: [] }), - ), - subagents: Schema.optionalKey( - Schema.Array(V2ExternalAgentConfigImportParams__SubagentMigration).annotate({ default: [] }), - ), +export type V2TurnStartParams__LegacyAppPathString = string; +export const V2TurnStartParams__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2TurnStartParams__LegacyAppPathString", }); -export type V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeFailure = - { - readonly cwd?: string | null; - readonly errorType?: string | null; - readonly failureStage: string; - readonly itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType; - readonly message: string; - readonly source?: string | null; - readonly subErrorType?: string | null; - }; -export const V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeFailure = - Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - failureStage: Schema.String, - itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType, - message: Schema.String, - source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }); +export type V2TurnStartResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2TurnStartResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]).annotate({ identifier: "V2TurnStartResponse__NonSteerableTurnKind" }); -export type V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeSuccess = - { - readonly cwd?: string | null; - readonly itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType; - readonly source?: string | null; - readonly target?: string | null; - }; -export const V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeSuccess = - Schema.Struct({ - cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType, - source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - }); +export type V2TurnStartResponse__MisalignmentSteer = { readonly message: string }; +export const V2TurnStartResponse__MisalignmentSteer = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2TurnStartResponse__MisalignmentSteer" }); -export type V2FileChangePatchUpdatedNotification__FileUpdateChange = { - readonly diff: string; - readonly kind: V2FileChangePatchUpdatedNotification__PatchChangeKind; - readonly path: string; +export type V2TurnStartResponse__ByteRange = { readonly end: number; readonly start: number }; +export const V2TurnStartResponse__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2TurnStartResponse__ByteRange" }); + +export type V2TurnStartResponse__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2TurnStartResponse__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2TurnStartResponse__ImageDetail" }); + +export type V2TurnStartResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; }; -export const V2FileChangePatchUpdatedNotification__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2FileChangePatchUpdatedNotification__PatchChangeKind, - path: Schema.String, +export const V2TurnStartResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}).annotate({ identifier: "V2TurnStartResponse__HookPromptFragment" }); + +export type V2TurnStartResponse__AgentMessageDelivery = "async"; +export const V2TurnStartResponse__AgentMessageDelivery = Schema.Literal("async").annotate({ + identifier: "V2TurnStartResponse__AgentMessageDelivery", }); -export type V2GetAccountRateLimitsResponse__RateLimitResetCredit = { - readonly description?: string | null; - readonly expiresAt?: number | null; - readonly grantedAt: number; - readonly id: string; - readonly resetType: V2GetAccountRateLimitsResponse__RateLimitResetType; - readonly status: V2GetAccountRateLimitsResponse__RateLimitResetCreditStatus; - readonly title?: string | null; +export type V2TurnStartResponse__MemoryCitationEntry = { + readonly lineEnd: number; + readonly lineStart: number; + readonly note: string; + readonly path: string; }; -export const V2GetAccountRateLimitsResponse__RateLimitResetCredit = Schema.Struct({ - description: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Backend-provided display description for this credit, or `null` when unavailable.", - }), - Schema.Null, - ]), - ), - expiresAt: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ - description: - "Unix timestamp in seconds when the credit expires, or `null` if it does not expire.", - format: "int64", - }).check(Schema.isInt()), - Schema.Null, - ]), - ), - grantedAt: Schema.Number.annotate({ - description: "Unix timestamp in seconds when the credit was granted.", - format: "int64", - }).check(Schema.isInt()), - id: Schema.String.annotate({ description: "Opaque backend identifier for this reset credit." }), - resetType: V2GetAccountRateLimitsResponse__RateLimitResetType, - status: V2GetAccountRateLimitsResponse__RateLimitResetCreditStatus, - title: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Backend-provided display title for this credit, or `null` when unavailable.", - }), - Schema.Null, - ]), - ), +export const V2TurnStartResponse__MemoryCitationEntry = Schema.Struct({ + lineEnd: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + note: Schema.String, + path: Schema.String, +}).annotate({ identifier: "V2TurnStartResponse__MemoryCitationEntry" }); + +export type V2TurnStartResponse__MessagePhase = "commentary" | "final_answer"; +export const V2TurnStartResponse__MessagePhase = Schema.Union( + [ + Schema.Literal("commentary").annotate({ + description: + "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + }), + Schema.Literal("final_answer").annotate({ + description: "The assistant's terminal answer text for the current turn.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', + identifier: "V2TurnStartResponse__MessagePhase", }); -export type V2GetAccountRateLimitsResponse__RateLimitSnapshot = { - readonly credits?: V2GetAccountRateLimitsResponse__CreditsSnapshot | null; - readonly individualLimit?: V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot | null; - readonly limitId?: string | null; - readonly limitName?: string | null; - readonly planType?: V2GetAccountRateLimitsResponse__PlanType | null; - readonly primary?: V2GetAccountRateLimitsResponse__RateLimitWindow | null; - readonly rateLimitReachedType?: V2GetAccountRateLimitsResponse__RateLimitReachedType | null; - readonly secondary?: V2GetAccountRateLimitsResponse__RateLimitWindow | null; - readonly spendControlReached?: boolean | null; +export type V2TurnStartResponse__AsyncUserInputQuestion = { + readonly options?: ReadonlyArray | null; + readonly title: string; }; -export const V2GetAccountRateLimitsResponse__RateLimitSnapshot = Schema.Struct({ - credits: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__CreditsSnapshot, Schema.Null]), - ), - individualLimit: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot, Schema.Null]), - ), - limitId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - limitName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - planType: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__PlanType, Schema.Null]), - ), - primary: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__RateLimitWindow, Schema.Null]), - ), - rateLimitReachedType: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__RateLimitReachedType, Schema.Null]), - ), - secondary: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__RateLimitWindow, Schema.Null]), - ), - spendControlReached: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: - "Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.", - }), - Schema.Null, - ]), - ), +export const V2TurnStartResponse__AsyncUserInputQuestion = Schema.Struct({ + options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.String, +}).annotate({ identifier: "V2TurnStartResponse__AsyncUserInputQuestion" }); + +export type V2TurnStartResponse__LegacyAppPathString = string; +export const V2TurnStartResponse__LegacyAppPathString = Schema.String.annotate({ + identifier: "V2TurnStartResponse__LegacyAppPathString", }); -export type V2GetAccountResponse__Account = - | { readonly type: "apiKey" } - | { - readonly email: string | null; - readonly planType: V2GetAccountResponse__PlanType; - readonly type: "chatgpt"; - } - | { readonly type: "amazonBedrock"; readonly usesCodexManagedCredentials?: boolean }; -export const V2GetAccountResponse__Account = Schema.Union( +export type V2TurnStartResponse__CommandExecutionSource = + | "agent" + | "userShell" + | "unifiedExecStartup" + | "unifiedExecInteraction"; +export const V2TurnStartResponse__CommandExecutionSource = Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", +]).annotate({ identifier: "V2TurnStartResponse__CommandExecutionSource" }); + +export type V2TurnStartResponse__CommandExecutionStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2TurnStartResponse__CommandExecutionStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2TurnStartResponse__CommandExecutionStatus" }); + +export type V2TurnStartResponse__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2TurnStartResponse__PatchChangeKind = Schema.Union( [ Schema.Struct({ - type: Schema.Literal("apiKey").annotate({ title: "ApiKeyAccountType" }), - }).annotate({ title: "ApiKeyAccount" }), + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), Schema.Struct({ - email: Schema.Union([Schema.String, Schema.Null]), - planType: V2GetAccountResponse__PlanType, - type: Schema.Literal("chatgpt").annotate({ title: "ChatgptAccountType" }), - }).annotate({ title: "ChatgptAccount" }), + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), Schema.Struct({ - type: Schema.Literal("amazonBedrock").annotate({ title: "AmazonBedrockAccountType" }), - usesCodexManagedCredentials: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - }).annotate({ title: "AmazonBedrockAccount" }), + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnStartResponse__PatchChangeKind" }); -export type V2GetWorkspaceMessagesResponse__WorkspaceMessage = { - readonly archivedAt?: number | null; - readonly createdAt?: number | null; - readonly messageBody: string; - readonly messageId: string; - readonly messageType: V2GetWorkspaceMessagesResponse__WorkspaceMessageType; -}; -export const V2GetWorkspaceMessagesResponse__WorkspaceMessage = Schema.Struct({ - archivedAt: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ - description: "Unix timestamp (in seconds) when the message was archived.", - format: "int64", - }).check(Schema.isInt()), - Schema.Null, - ]), - ), - createdAt: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ - description: "Unix timestamp (in seconds) when the message was created.", - format: "int64", - }).check(Schema.isInt()), - Schema.Null, - ]), - ), - messageBody: Schema.String, - messageId: Schema.String, - messageType: V2GetWorkspaceMessagesResponse__WorkspaceMessageType, -}); +export type V2TurnStartResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2TurnStartResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]).annotate({ identifier: "V2TurnStartResponse__PatchApplyStatus" }); -export type V2HookCompletedNotification__HookOutputEntry = { - readonly kind: V2HookCompletedNotification__HookOutputEntryKind; - readonly text: string; +export type V2TurnStartResponse__McpToolCallAppContext = { + readonly actionName?: string | null; + readonly appName?: string | null; + readonly connectorId: string; + readonly linkId?: string | null; + readonly resourceUri?: string | null; }; -export const V2HookCompletedNotification__HookOutputEntry = Schema.Struct({ - kind: V2HookCompletedNotification__HookOutputEntryKind, - text: Schema.String, -}); +export const V2TurnStartResponse__McpToolCallAppContext = Schema.Struct({ + actionName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + appName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + connectorId: Schema.String, + linkId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2TurnStartResponse__McpToolCallAppContext" }); -export type V2HooksListResponse__HookMetadata = { - readonly command?: string | null; - readonly currentHash: string; - readonly displayOrder: number; - readonly enabled: boolean; - readonly eventName: V2HooksListResponse__HookEventName; - readonly handlerType: V2HooksListResponse__HookHandlerType; - readonly isManaged: boolean; - readonly key: string; - readonly matcher?: string | null; - readonly pluginId?: string | null; - readonly source: V2HooksListResponse__HookSource; - readonly sourcePath: V2HooksListResponse__AbsolutePathBuf; - readonly statusMessage?: string | null; - readonly timeoutSec: number; - readonly trustStatus: V2HooksListResponse__HookTrustStatus; -}; -export const V2HooksListResponse__HookMetadata = Schema.Struct({ - command: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - currentHash: Schema.String, - displayOrder: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - enabled: Schema.Boolean, - eventName: V2HooksListResponse__HookEventName, - handlerType: V2HooksListResponse__HookHandlerType, - isManaged: Schema.Boolean, - key: Schema.String, - matcher: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - source: V2HooksListResponse__HookSource, - sourcePath: V2HooksListResponse__AbsolutePathBuf, - statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - timeoutSec: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - trustStatus: V2HooksListResponse__HookTrustStatus, -}); +export type V2TurnStartResponse__McpToolCallError = { readonly message: string }; +export const V2TurnStartResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}).annotate({ identifier: "V2TurnStartResponse__McpToolCallError" }); -export type V2HookStartedNotification__HookOutputEntry = { - readonly kind: V2HookStartedNotification__HookOutputEntryKind; - readonly text: string; +export type V2TurnStartResponse__McpAppDisplayMode = "inline" | "fullscreen"; +export const V2TurnStartResponse__McpAppDisplayMode = Schema.Literals([ + "inline", + "fullscreen", +]).annotate({ identifier: "V2TurnStartResponse__McpAppDisplayMode" }); + +export type V2TurnStartResponse__McpToolCallResult = { + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; + readonly structuredContent?: Schema.Json; }; -export const V2HookStartedNotification__HookOutputEntry = Schema.Struct({ - kind: V2HookStartedNotification__HookOutputEntryKind, - text: Schema.String, -}); +export const V2TurnStartResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), +}).annotate({ identifier: "V2TurnStartResponse__McpToolCallResult" }); -export type V2ItemCompletedNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: V2ItemCompletedNotification__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ItemCompletedNotification__CommandAction = Schema.Union( +export type V2TurnStartResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2TurnStartResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2TurnStartResponse__McpToolCallStatus" }); + +export type V2TurnStartResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" } + | { readonly audioUrl: string; readonly type: "inputAudio" }; +export const V2TurnStartResponse__DynamicToolCallOutputContentItem = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2ItemCompletedNotification__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + audioUrl: Schema.String, + type: Schema.Literal("inputAudio").annotate({ + title: "InputAudioDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioDynamicToolCallOutputContentItem" }), ], { mode: "oneOf" }, +).annotate({ identifier: "V2TurnStartResponse__DynamicToolCallOutputContentItem" }); + +export type V2TurnStartResponse__DynamicToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2TurnStartResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]).annotate({ identifier: "V2TurnStartResponse__DynamicToolCallStatus" }); + +export type V2TurnStartResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2TurnStartResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]).annotate({ identifier: "V2TurnStartResponse__CollabAgentStatus" }); + +export type V2TurnStartResponse__ReasoningEffort = string; +export const V2TurnStartResponse__ReasoningEffort = Schema.String.annotate({ + description: "A non-empty reasoning effort value advertised by the model.", +}).check( + Schema.isMinLength(1).annotate({ + expected: "a value with a length of at least 1", + identifier: "V2TurnStartResponse__ReasoningEffort", + }), ); -export type V2ItemCompletedNotification__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ItemCompletedNotification__CollabAgentStatus; -}; -export const V2ItemCompletedNotification__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ItemCompletedNotification__CollabAgentStatus, -}); +export type V2TurnStartResponse__CollabAgentToolCallStatus = + | "inProgress" + | "completed" + | "failed" + | "interrupted"; +export const V2TurnStartResponse__CollabAgentToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "interrupted", +]).annotate({ identifier: "V2TurnStartResponse__CollabAgentToolCallStatus" }); -export type V2ItemCompletedNotification__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; -}; -export const V2ItemCompletedNotification__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ItemCompletedNotification__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +export type V2TurnStartResponse__CollabAgentTool = + | "spawnAgent" + | "sendInput" + | "resumeAgent" + | "wait" + | "closeAgent" + | "sendMessage" + | "followupTask" + | "interruptAgent" + | "listAgents"; +export const V2TurnStartResponse__CollabAgentTool = Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + "sendMessage", + "followupTask", + "interruptAgent", + "listAgents", +]).annotate({ identifier: "V2TurnStartResponse__CollabAgentTool" }); -export type V2ItemCompletedNotification__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ItemCompletedNotification__PatchChangeKind; - readonly path: string; -}; -export const V2ItemCompletedNotification__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ItemCompletedNotification__PatchChangeKind, - path: Schema.String, -}); +export type V2TurnStartResponse__SubAgentActivityKind = + | "started" + | "interacted" + | "interrupted" + | "completed"; +export const V2TurnStartResponse__SubAgentActivityKind = Schema.Literals([ + "started", + "interacted", + "interrupted", + "completed", +]).annotate({ identifier: "V2TurnStartResponse__SubAgentActivityKind" }); -export type V2ItemCompletedNotification__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ItemCompletedNotification__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } +export type V2TurnStartResponse__WebSearchAction = | { - readonly detail?: V2ItemCompletedNotification__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; + readonly queries?: ReadonlyArray | null; + readonly query?: string | null; + readonly type: "search"; } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ItemCompletedNotification__UserInput = Schema.Union( + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const V2TurnStartResponse__WebSearchAction = Schema.Union( [ Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ItemCompletedNotification__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null]), - ), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null]), - ), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, -); - -export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReview = { - readonly rationale?: string | null; - readonly riskLevel?: V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel | null; - readonly status: V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus; - readonly userAuthorization?: V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization | null; -}; -export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReview = - Schema.Struct({ - rationale: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - riskLevel: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel, - Schema.Null, - ]), - ), - status: V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus, - userAuthorization: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization, - Schema.Null, - ]), - ), - }).annotate({ - description: - "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", - }); - -export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath = - | { readonly kind: "root" } - | { readonly kind: "minimal" } - | { - readonly kind: "project_roots"; - readonly subpath?: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString | null; - } - | { readonly kind: "tmpdir" } - | { readonly kind: "slash_tmp" } - | { - readonly kind: "unknown"; - readonly path: string; - readonly subpath?: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString | null; - }; -export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath = - Schema.Union( - [ - Schema.Struct({ kind: Schema.Literal("root") }).annotate({ - title: "RootFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ - title: "MinimalFileSystemSpecialPath", - }), - Schema.Struct({ - kind: Schema.Literal("project_roots"), - subpath: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, - Schema.Null, - ]), - ), - }).annotate({ title: "KindFileSystemSpecialPath" }), - Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ - title: "TmpdirFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ - title: "SlashTmpFileSystemSpecialPath", - }), - Schema.Struct({ - kind: Schema.Literal("unknown"), - path: Schema.String, - subpath: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, - Schema.Null, - ]), - ), - }), - ], - { mode: "oneOf" }, - ); +).annotate({ identifier: "V2TurnStartResponse__WebSearchAction" }); -export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReview = { - readonly rationale?: string | null; - readonly riskLevel?: V2ItemGuardianApprovalReviewStartedNotification__GuardianRiskLevel | null; - readonly status: V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus; - readonly userAuthorization?: V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization | null; +export type V2TurnStartResponse__ImageGenerationFailure = { + readonly limitId: string; + readonly resetsAt?: number | null; + readonly type: "usageLimitExceeded"; }; -export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReview = - Schema.Struct({ - rationale: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - riskLevel: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewStartedNotification__GuardianRiskLevel, - Schema.Null, - ]), - ), - status: V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus, - userAuthorization: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization, - Schema.Null, - ]), - ), - }).annotate({ - description: - "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", - }); - -export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath = - | { readonly kind: "root" } - | { readonly kind: "minimal" } - | { - readonly kind: "project_roots"; - readonly subpath?: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString | null; - } - | { readonly kind: "tmpdir" } - | { readonly kind: "slash_tmp" } - | { - readonly kind: "unknown"; - readonly path: string; - readonly subpath?: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString | null; - }; -export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath = Schema.Union( +export const V2TurnStartResponse__ImageGenerationFailure = Schema.Union( [ - Schema.Struct({ kind: Schema.Literal("root") }).annotate({ - title: "RootFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ - title: "MinimalFileSystemSpecialPath", - }), Schema.Struct({ - kind: Schema.Literal("project_roots"), - subpath: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, - Schema.Null, - ]), - ), - }).annotate({ title: "KindFileSystemSpecialPath" }), - Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ - title: "TmpdirFileSystemSpecialPath", - }), - Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ - title: "SlashTmpFileSystemSpecialPath", - }), - Schema.Struct({ - kind: Schema.Literal("unknown"), - path: Schema.String, - subpath: Schema.optionalKey( + limitId: Schema.String, + resetsAt: Schema.optionalKey( Schema.Union([ - V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), Schema.Null, ]), ), - }), + type: Schema.Literal("usageLimitExceeded").annotate({ + title: "UsageLimitExceededImageGenerationFailureType", + }), + }).annotate({ title: "UsageLimitExceededImageGenerationFailure" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnStartResponse__ImageGenerationFailure" }); -export type V2ItemStartedNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: V2ItemStartedNotification__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ItemStartedNotification__CommandAction = Schema.Union( +export type V2TurnStartResponse__AbsolutePathBuf = string; +export const V2TurnStartResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2TurnStartResponse__AbsolutePathBuf", +}); + +export type V2TurnStartResponse__TurnItemsView = "notLoaded" | "summary" | "full"; +export const V2TurnStartResponse__TurnItemsView = Schema.Union( [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2ItemStartedNotification__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + Schema.Literal("notLoaded").annotate({ + description: "`items` was not loaded for this turn. The field is intentionally empty.", + }), + Schema.Literal("summary").annotate({ + description: "`items` contains only a display summary for this turn.", + }), + Schema.Literal("full").annotate({ + description: + "`items` contains every ThreadItem available from persisted app-server history for this turn.", + }), ], { mode: "oneOf" }, -); - -export type V2ItemStartedNotification__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ItemStartedNotification__CollabAgentStatus; -}; -export const V2ItemStartedNotification__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ItemStartedNotification__CollabAgentStatus, -}); +).annotate({ identifier: "V2TurnStartResponse__TurnItemsView" }); -export type V2ItemStartedNotification__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; -}; -export const V2ItemStartedNotification__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ItemStartedNotification__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +export type V2TurnStartResponse__TurnStatus = "completed" | "interrupted" | "failed" | "inProgress"; +export const V2TurnStartResponse__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]).annotate({ identifier: "V2TurnStartResponse__TurnStatus" }); -export type V2ItemStartedNotification__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ItemStartedNotification__PatchChangeKind; - readonly path: string; -}; -export const V2ItemStartedNotification__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ItemStartedNotification__PatchChangeKind, - path: Schema.String, -}); +export type V2TurnSteerParams__ByteRange = { readonly end: number; readonly start: number }; +export const V2TurnSteerParams__ByteRange = Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ identifier: "V2TurnSteerParams__ByteRange" }); -export type V2ItemStartedNotification__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ItemStartedNotification__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: V2ItemStartedNotification__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ItemStartedNotification__UserInput = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ItemStartedNotification__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null]), - ), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null]), - ), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), - ], - { mode: "oneOf" }, -); +export type V2TurnSteerParams__ImageDetail = "auto" | "low" | "high" | "original"; +export const V2TurnSteerParams__ImageDetail = Schema.Literals([ + "auto", + "low", + "high", + "original", +]).annotate({ identifier: "V2TurnSteerParams__ImageDetail" }); -export type V2ListMcpServerStatusResponse__McpServerStatus = { - readonly authStatus: V2ListMcpServerStatusResponse__McpAuthStatus; - readonly name: string; - readonly resourceTemplates: ReadonlyArray; - readonly resources: ReadonlyArray; - readonly serverInfo?: V2ListMcpServerStatusResponse__McpServerInfo | null; - readonly tools: { readonly [x: string]: V2ListMcpServerStatusResponse__Tool }; -}; -export const V2ListMcpServerStatusResponse__McpServerStatus = Schema.Struct({ - authStatus: V2ListMcpServerStatusResponse__McpAuthStatus, - name: Schema.String, - resourceTemplates: Schema.Array(V2ListMcpServerStatusResponse__ResourceTemplate), - resources: Schema.Array(V2ListMcpServerStatusResponse__Resource), - serverInfo: Schema.optionalKey( - Schema.Union([V2ListMcpServerStatusResponse__McpServerInfo, Schema.Null]), - ), - tools: Schema.Record(Schema.String, V2ListMcpServerStatusResponse__Tool), +export type V2TurnSteerParams__AdditionalContextKind = "untrusted" | "application"; +export const V2TurnSteerParams__AdditionalContextKind = Schema.Literals([ + "untrusted", + "application", +]).annotate({ identifier: "V2TurnSteerParams__AdditionalContextKind" }); + +export type V2WindowsSandboxReadinessResponse__WindowsSandboxReadiness = + | "ready" + | "notConfigured" + | "updateRequired"; +export const V2WindowsSandboxReadinessResponse__WindowsSandboxReadiness = Schema.Literals([ + "ready", + "notConfigured", + "updateRequired", +]).annotate({ identifier: "V2WindowsSandboxReadinessResponse__WindowsSandboxReadiness" }); + +export type V2WindowsSandboxSetupCompletedNotification__WindowsSandboxSetupMode = + | "elevated" + | "unelevated"; +export const V2WindowsSandboxSetupCompletedNotification__WindowsSandboxSetupMode = Schema.Literals([ + "elevated", + "unelevated", +]).annotate({ identifier: "V2WindowsSandboxSetupCompletedNotification__WindowsSandboxSetupMode" }); + +export type V2WindowsSandboxSetupStartParams__AbsolutePathBuf = string; +export const V2WindowsSandboxSetupStartParams__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + identifier: "V2WindowsSandboxSetupStartParams__AbsolutePathBuf", }); -export type V2ModelListResponse__ReasoningEffortOption = { - readonly description: string; - readonly reasoningEffort: V2ModelListResponse__ReasoningEffort; +export type V2WindowsSandboxSetupStartParams__WindowsSandboxSetupMode = "elevated" | "unelevated"; +export const V2WindowsSandboxSetupStartParams__WindowsSandboxSetupMode = Schema.Literals([ + "elevated", + "unelevated", +]).annotate({ identifier: "V2WindowsSandboxSetupStartParams__WindowsSandboxSetupMode" }); + +export type ApplyPatchApprovalResponse__NetworkPolicyAmendment = { + readonly action: ApplyPatchApprovalResponse__NetworkPolicyRuleAction; + readonly host: string; }; -export const V2ModelListResponse__ReasoningEffortOption = Schema.Struct({ - description: Schema.String, - reasoningEffort: V2ModelListResponse__ReasoningEffort, -}); +export const ApplyPatchApprovalResponse__NetworkPolicyAmendment = Schema.Struct({ + action: ApplyPatchApprovalResponse__NetworkPolicyRuleAction, + host: Schema.String, +}).annotate({ identifier: "ApplyPatchApprovalResponse__NetworkPolicyAmendment" }); -export type V2PluginInstalledResponse__MarketplaceLoadErrorInfo = { - readonly marketplacePath: V2PluginInstalledResponse__AbsolutePathBuf; - readonly message: string; +export type ClientRequest__InitializeParams = { + readonly capabilities?: ClientRequest__InitializeCapabilities | null; + readonly clientInfo: ClientRequest__ClientInfo; }; -export const V2PluginInstalledResponse__MarketplaceLoadErrorInfo = Schema.Struct({ - marketplacePath: V2PluginInstalledResponse__AbsolutePathBuf, - message: Schema.String, -}); +export const ClientRequest__InitializeParams = Schema.Struct({ + capabilities: Schema.optionalKey( + Schema.Union([ClientRequest__InitializeCapabilities, Schema.Null]), + ), + clientInfo: ClientRequest__ClientInfo, +}).annotate({ identifier: "ClientRequest__InitializeParams" }); -export type V2PluginInstalledResponse__PluginInterface = { - readonly brandColor?: string | null; - readonly capabilities: ReadonlyArray; - readonly category?: string | null; - readonly composerIcon?: V2PluginInstalledResponse__AbsolutePathBuf | null; - readonly composerIconUrl?: string | null; - readonly defaultPrompt?: ReadonlyArray | null; - readonly developerName?: string | null; - readonly displayName?: string | null; - readonly logo?: V2PluginInstalledResponse__AbsolutePathBuf | null; - readonly logoDark?: V2PluginInstalledResponse__AbsolutePathBuf | null; - readonly logoUrl?: string | null; - readonly logoUrlDark?: string | null; - readonly longDescription?: string | null; - readonly privacyPolicyUrl?: string | null; - readonly screenshotUrls: ReadonlyArray; - readonly screenshots: ReadonlyArray; - readonly shortDescription?: string | null; - readonly termsOfServiceUrl?: string | null; - readonly websiteUrl?: string | null; +export type ClientRequest__ThreadResumeParams = { + readonly approvalPolicy?: ClientRequest__AskForApproval | null; + readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; + readonly baseInstructions?: string | null; + readonly config?: { readonly [x: string]: Schema.Json } | null; + readonly cwd?: string | null; + readonly developerInstructions?: string | null; + readonly excludeTurns?: boolean; + readonly model?: string | null; + readonly modelProvider?: string | null; + readonly personality?: ClientRequest__Personality | null; + readonly sandbox?: ClientRequest__SandboxMode | null; + readonly serviceTier?: string | null; + readonly threadId: string; }; -export const V2PluginInstalledResponse__PluginInterface = Schema.Struct({ - brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - capabilities: Schema.Array(Schema.String), - category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - composerIcon: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local composer icon path, resolved from the installed plugin package.", +export const ClientRequest__ThreadResumeParams = Schema.Struct({ + approvalPolicy: Schema.optionalKey(Schema.Union([ClientRequest__AskForApproval, Schema.Null])), + approvalsReviewer: Schema.optionalKey( + Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ + description: + "Override where approval requests are routed for review on this thread and subsequent turns.", }), ), - composerIconUrl: Schema.optionalKey( + baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + config: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote composer icon URL from the plugin catalog." }), + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), Schema.Null, ]), ), - defaultPrompt: Schema.optionalKey( + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + excludeTurns: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true, return only thread metadata and live-resume state without populating `thread.turns`. This is useful when the client plans to call `thread/turns/list` immediately after resuming. Full-history hydration is deprecated for paginated threads; use this with `thread/turns/list` and `thread/items/list` instead.", + }), + ), + model: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.String).annotate({ - description: - "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + Schema.String.annotate({ + description: "Configuration overrides for the resumed thread, if any.", }), Schema.Null, ]), ), - developerName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logo: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local logo path, resolved from the installed plugin package.", + modelProvider: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + personality: Schema.optionalKey( + Schema.Union([ClientRequest__Personality, Schema.Null]).annotate({ + description: + "@deprecated `friendly` and `pragmatic` no longer select a style. Changing this does not rewrite the thread's existing instructions.", }), ), - logoDark: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local dark-mode logo path, resolved from the installed plugin package.", + sandbox: Schema.optionalKey(Schema.Union([ClientRequest__SandboxMode, Schema.Null])), + serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + threadId: Schema.String, +}).annotate({ + description: + "There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.\n\nFor non-running threads, the precedence is: history > non-empty path > thread_id. If using history or a non-empty path for a non-running thread, the thread_id param will be ignored.\n\nIf thread_id identifies a running thread, app-server rejoins that thread and treats a non-empty path as a consistency check against the active rollout path. Empty string path values are treated as absent.\n\nPrefer using thread_id whenever possible.", + identifier: "ClientRequest__ThreadResumeParams", +}); + +export type ClientRequest__ThreadStartParams = { + readonly approvalPolicy?: ClientRequest__AskForApproval | null; + readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; + readonly baseInstructions?: string | null; + readonly config?: { readonly [x: string]: Schema.Json } | null; + readonly cwd?: string | null; + readonly developerInstructions?: string | null; + readonly ephemeral?: boolean | null; + readonly model?: string | null; + readonly modelProvider?: string | null; + readonly personality?: ClientRequest__Personality | null; + readonly sandbox?: ClientRequest__SandboxMode | null; + readonly serviceName?: string | null; + readonly serviceTier?: string | null; + readonly sessionStartSource?: ClientRequest__ThreadStartSource | null; + readonly threadSource?: ClientRequest__ThreadSource | null; +}; +export const ClientRequest__ThreadStartParams = Schema.Struct({ + approvalPolicy: Schema.optionalKey(Schema.Union([ClientRequest__AskForApproval, Schema.Null])), + approvalsReviewer: Schema.optionalKey( + Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ + description: + "Override where approval requests are routed for review on this thread and subsequent turns.", }), ), - logoUrl: Schema.optionalKey( + baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + config: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote logo URL from the plugin catalog." }), + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), Schema.Null, ]), ), - logoUrlDark: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Remote dark-mode logo URL from the plugin catalog." }), - Schema.Null, - ]), + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + ephemeral: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + model: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + modelProvider: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + personality: Schema.optionalKey( + Schema.Union([ClientRequest__Personality, Schema.Null]).annotate({ + description: "@deprecated `friendly` and `pragmatic` no longer select a style.", + }), ), - longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - screenshotUrls: Schema.Array(Schema.String).annotate({ - description: "Remote screenshot URLs from the plugin catalog.", - }), - screenshots: Schema.Array(V2PluginInstalledResponse__AbsolutePathBuf).annotate({ - description: "Local screenshot paths, resolved from the installed plugin package.", - }), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2PluginInstalledResponse__PluginSource = - | { readonly path: V2PluginInstalledResponse__AbsolutePathBuf; readonly type: "local" } - | { - readonly path?: string | null; - readonly refName?: string | null; - readonly sha?: string | null; - readonly type: "git"; - readonly url: string; - } - | { - readonly package: string; - readonly registry?: string | null; - readonly type: "npm"; - readonly version?: string | null; - } - | { readonly type: "remote" }; -export const V2PluginInstalledResponse__PluginSource = Schema.Union( - [ - Schema.Struct({ - path: V2PluginInstalledResponse__AbsolutePathBuf, - type: Schema.Literal("local").annotate({ title: "LocalPluginSourceType" }), - }).annotate({ title: "LocalPluginSource" }), - Schema.Struct({ - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("git").annotate({ title: "GitPluginSourceType" }), - url: Schema.String, - }).annotate({ title: "GitPluginSource" }), - Schema.Struct({ - package: Schema.String, - registry: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional HTTPS registry URL. Authentication stays in the user's npm config.", - }), - Schema.Null, - ]), - ), - type: Schema.Literal("npm").annotate({ title: "NpmPluginSourceType" }), - version: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Optional npm version or version range." }), - Schema.Null, - ]), - ), - }).annotate({ title: "NpmPluginSource" }), - Schema.Struct({ - type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), - }).annotate({ - title: "RemotePluginSource", - description: - "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + sandbox: Schema.optionalKey(Schema.Union([ClientRequest__SandboxMode, Schema.Null])), + serviceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sessionStartSource: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadStartSource, Schema.Null]), + ), + threadSource: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadSource, Schema.Null]).annotate({ + description: "Optional client-supplied analytics source classification for this thread.", }), - ], - { mode: "oneOf" }, -); - -export type V2PluginInstalledResponse__PluginSharePrincipal = { - readonly name: string; - readonly principalId: string; - readonly principalType: V2PluginInstalledResponse__PluginSharePrincipalType; - readonly role: V2PluginInstalledResponse__PluginSharePrincipalRole; -}; -export const V2PluginInstalledResponse__PluginSharePrincipal = Schema.Struct({ - name: Schema.String, - principalId: Schema.String, - principalType: V2PluginInstalledResponse__PluginSharePrincipalType, - role: V2PluginInstalledResponse__PluginSharePrincipalRole, -}); - -export type V2PluginListResponse__MarketplaceLoadErrorInfo = { - readonly marketplacePath: V2PluginListResponse__AbsolutePathBuf; - readonly message: string; -}; -export const V2PluginListResponse__MarketplaceLoadErrorInfo = Schema.Struct({ - marketplacePath: V2PluginListResponse__AbsolutePathBuf, - message: Schema.String, -}); + ), +}).annotate({ identifier: "ClientRequest__ThreadStartParams" }); -export type V2PluginListResponse__PluginInterface = { - readonly brandColor?: string | null; - readonly capabilities: ReadonlyArray; - readonly category?: string | null; - readonly composerIcon?: V2PluginListResponse__AbsolutePathBuf | null; - readonly composerIconUrl?: string | null; - readonly defaultPrompt?: ReadonlyArray | null; - readonly developerName?: string | null; - readonly displayName?: string | null; - readonly logo?: V2PluginListResponse__AbsolutePathBuf | null; - readonly logoDark?: V2PluginListResponse__AbsolutePathBuf | null; - readonly logoUrl?: string | null; - readonly logoUrlDark?: string | null; - readonly longDescription?: string | null; - readonly privacyPolicyUrl?: string | null; - readonly screenshotUrls: ReadonlyArray; - readonly screenshots: ReadonlyArray; - readonly shortDescription?: string | null; - readonly termsOfServiceUrl?: string | null; - readonly websiteUrl?: string | null; +export type ClientRequest__ThreadForkParams = { + readonly approvalPolicy?: ClientRequest__AskForApproval | null; + readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; + readonly baseInstructions?: string | null; + readonly config?: { readonly [x: string]: Schema.Json } | null; + readonly cwd?: string | null; + readonly developerInstructions?: string | null; + readonly ephemeral?: boolean; + readonly excludeTurns?: boolean; + readonly lastTurnId?: string | null; + readonly model?: string | null; + readonly modelProvider?: string | null; + readonly sandbox?: ClientRequest__SandboxMode | null; + readonly serviceTier?: string | null; + readonly threadId: string; + readonly threadSource?: ClientRequest__ThreadSource | null; }; -export const V2PluginListResponse__PluginInterface = Schema.Struct({ - brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - capabilities: Schema.Array(Schema.String), - category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - composerIcon: Schema.optionalKey( - Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local composer icon path, resolved from the installed plugin package.", +export const ClientRequest__ThreadForkParams = Schema.Struct({ + approvalPolicy: Schema.optionalKey(Schema.Union([ClientRequest__AskForApproval, Schema.Null])), + approvalsReviewer: Schema.optionalKey( + Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ + description: + "Override where approval requests are routed for review on this thread and subsequent turns.", }), ), - composerIconUrl: Schema.optionalKey( + baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + config: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote composer icon URL from the plugin catalog." }), + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), Schema.Null, ]), ), - defaultPrompt: Schema.optionalKey( + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + ephemeral: Schema.optionalKey(Schema.Boolean), + excludeTurns: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true, return only thread metadata and live fork state without populating `thread.turns`. This is useful when the client plans to call `thread/turns/list` immediately after forking. Full-history hydration is deprecated for paginated threads; use this with `thread/turns/list` and `thread/items/list` instead.", + }), + ), + lastTurnId: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.String).annotate({ + Schema.String.annotate({ description: - "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + "Optional last turn id to fork through, inclusive.\n\nWhen specified, turns after `last_turn_id` are omitted from the fork. The referenced turn cannot be in progress.", }), Schema.Null, ]), ), - developerName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logo: Schema.optionalKey( - Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local logo path, resolved from the installed plugin package.", - }), - ), - logoDark: Schema.optionalKey( - Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local dark-mode logo path, resolved from the installed plugin package.", - }), - ), - logoUrl: Schema.optionalKey( + model: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote logo URL from the plugin catalog." }), + Schema.String.annotate({ + description: "Configuration overrides for the forked thread, if any.", + }), Schema.Null, ]), ), - logoUrlDark: Schema.optionalKey( + modelProvider: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sandbox: Schema.optionalKey(Schema.Union([ClientRequest__SandboxMode, Schema.Null])), + serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + threadId: Schema.String, + threadSource: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadSource, Schema.Null]).annotate({ + description: + "Optional client-supplied analytics source classification for this forked thread.", + }), + ), +}).annotate({ + description: + "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using a non-empty path, the thread_id param will be ignored. Empty string path values are treated as absent.\n\nPrefer using thread_id whenever possible.", + identifier: "ClientRequest__ThreadForkParams", +}); + +export type ClientRequest__ThreadGoalSetParams = { + readonly objective?: string | null; + readonly status?: ClientRequest__ThreadGoalStatus | null; + readonly threadId: string; + readonly tokenBudget?: number | null; +}; +export const ClientRequest__ThreadGoalSetParams = Schema.Struct({ + objective: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: Schema.optionalKey(Schema.Union([ClientRequest__ThreadGoalStatus, Schema.Null])), + threadId: Schema.String, + tokenBudget: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote dark-mode logo URL from the plugin catalog." }), + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), Schema.Null, ]), ), - longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - screenshotUrls: Schema.Array(Schema.String).annotate({ - description: "Remote screenshot URLs from the plugin catalog.", - }), - screenshots: Schema.Array(V2PluginListResponse__AbsolutePathBuf).annotate({ - description: "Local screenshot paths, resolved from the installed plugin package.", - }), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +}).annotate({ identifier: "ClientRequest__ThreadGoalSetParams" }); -export type V2PluginListResponse__PluginSource = - | { readonly path: V2PluginListResponse__AbsolutePathBuf; readonly type: "local" } - | { - readonly path?: string | null; - readonly refName?: string | null; - readonly sha?: string | null; - readonly type: "git"; - readonly url: string; - } - | { - readonly package: string; - readonly registry?: string | null; - readonly type: "npm"; - readonly version?: string | null; - } - | { readonly type: "remote" }; -export const V2PluginListResponse__PluginSource = Schema.Union( - [ - Schema.Struct({ - path: V2PluginListResponse__AbsolutePathBuf, - type: Schema.Literal("local").annotate({ title: "LocalPluginSourceType" }), - }).annotate({ title: "LocalPluginSource" }), - Schema.Struct({ - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("git").annotate({ title: "GitPluginSourceType" }), - url: Schema.String, - }).annotate({ title: "GitPluginSource" }), - Schema.Struct({ - package: Schema.String, - registry: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional HTTPS registry URL. Authentication stays in the user's npm config.", - }), - Schema.Null, - ]), - ), - type: Schema.Literal("npm").annotate({ title: "NpmPluginSourceType" }), - version: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Optional npm version or version range." }), - Schema.Null, - ]), - ), - }).annotate({ title: "NpmPluginSource" }), - Schema.Struct({ - type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), - }).annotate({ - title: "RemotePluginSource", +export type ClientRequest__ThreadMetadataUpdateParams = { + readonly gitInfo?: ClientRequest__ThreadMetadataGitInfoUpdateParams | null; + readonly threadId: string; +}; +export const ClientRequest__ThreadMetadataUpdateParams = Schema.Struct({ + gitInfo: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadMetadataGitInfoUpdateParams, Schema.Null]).annotate({ description: - "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + "Patch the stored Git metadata for this thread. Omit a field to leave it unchanged, set it to `null` to clear it, or provide a string to replace the stored value.", }), - ], - { mode: "oneOf" }, -); - -export type V2PluginListResponse__PluginSharePrincipal = { - readonly name: string; - readonly principalId: string; - readonly principalType: V2PluginListResponse__PluginSharePrincipalType; - readonly role: V2PluginListResponse__PluginSharePrincipalRole; -}; -export const V2PluginListResponse__PluginSharePrincipal = Schema.Struct({ - name: Schema.String, - principalId: Schema.String, - principalType: V2PluginListResponse__PluginSharePrincipalType, - role: V2PluginListResponse__PluginSharePrincipalRole, -}); + ), + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadMetadataUpdateParams" }); -export type V2PluginReadResponse__PluginInterface = { - readonly brandColor?: string | null; - readonly capabilities: ReadonlyArray; - readonly category?: string | null; - readonly composerIcon?: V2PluginReadResponse__AbsolutePathBuf | null; - readonly composerIconUrl?: string | null; - readonly defaultPrompt?: ReadonlyArray | null; - readonly developerName?: string | null; - readonly displayName?: string | null; - readonly logo?: V2PluginReadResponse__AbsolutePathBuf | null; - readonly logoDark?: V2PluginReadResponse__AbsolutePathBuf | null; - readonly logoUrl?: string | null; - readonly logoUrlDark?: string | null; - readonly longDescription?: string | null; - readonly privacyPolicyUrl?: string | null; - readonly screenshotUrls: ReadonlyArray; - readonly screenshots: ReadonlyArray; - readonly shortDescription?: string | null; - readonly termsOfServiceUrl?: string | null; - readonly websiteUrl?: string | null; +export type ClientRequest__ThreadListParams = { + readonly archived?: boolean | null; + readonly cursor?: string | null; + readonly cwd?: ClientRequest__ThreadListCwdFilter | null; + readonly limit?: number | null; + readonly modelProviders?: ReadonlyArray | null; + readonly originators?: ReadonlyArray | null; + readonly searchTerm?: string | null; + readonly sectionId?: string | null; + readonly sortDirection?: ClientRequest__SortDirection | null; + readonly sortKey?: ClientRequest__ThreadSortKey | null; + readonly sourceKinds?: ReadonlyArray | null; + readonly useStateDbOnly?: boolean; }; -export const V2PluginReadResponse__PluginInterface = Schema.Struct({ - brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - capabilities: Schema.Array(Schema.String), - category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - composerIcon: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local composer icon path, resolved from the installed plugin package.", +export const ClientRequest__ThreadListParams = Schema.Struct({ + archived: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: + "Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned.", + }), + Schema.Null, + ]), + ), + cursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Opaque pagination cursor returned by a previous call.", + }), + Schema.Null, + ]), + ), + cwd: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadListCwdFilter, Schema.Null]).annotate({ + description: + "Optional cwd filter or filters; when set, only threads whose session cwd exactly matches one of these paths are returned.", }), ), - composerIconUrl: Schema.optionalKey( + limit: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote composer icon URL from the plugin catalog." }), + Schema.Number.annotate({ + description: "Optional page size; defaults to a reasonable server-side value.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), - defaultPrompt: Schema.optionalKey( + modelProviders: Schema.optionalKey( Schema.Union([ Schema.Array(Schema.String).annotate({ description: - "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + "Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.", }), Schema.Null, ]), ), - developerName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logo: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local logo path, resolved from the installed plugin package.", - }), + originators: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: + "Optional originator allowlist, matching any supplied value exactly. Supported by hosted backends only; the local app-server rejects a nonempty list. Omitted or empty lists leave originators unrestricted.", + }), + Schema.Null, + ]), ), - logoDark: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local dark-mode logo path, resolved from the installed plugin package.", - }), + searchTerm: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional substring filter for the extracted thread title.", + }), + Schema.Null, + ]), ), - logoUrl: Schema.optionalKey( + sectionId: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote logo URL from the plugin catalog." }), + Schema.String.annotate({ + description: + "Omit to include every section, set to `null` for unsectioned threads, or provide a section ID to return only threads in that section.", + }), Schema.Null, ]), ), - logoUrlDark: Schema.optionalKey( + sortDirection: Schema.optionalKey( + Schema.Union([ClientRequest__SortDirection, Schema.Null]).annotate({ + description: "Optional sort direction; defaults to descending (newest first).", + }), + ), + sortKey: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadSortKey, Schema.Null]).annotate({ + description: "Optional sort key; defaults to created_at.", + }), + ), + sourceKinds: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote dark-mode logo URL from the plugin catalog." }), + Schema.Array(ClientRequest__ThreadSourceKind).annotate({ + description: + "Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.", + }), Schema.Null, ]), ), - longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - screenshotUrls: Schema.Array(Schema.String).annotate({ - description: "Remote screenshot URLs from the plugin catalog.", - }), - screenshots: Schema.Array(V2PluginReadResponse__AbsolutePathBuf).annotate({ - description: "Local screenshot paths, resolved from the installed plugin package.", - }), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2PluginReadResponse__PluginSource = - | { readonly path: V2PluginReadResponse__AbsolutePathBuf; readonly type: "local" } - | { - readonly path?: string | null; - readonly refName?: string | null; - readonly sha?: string | null; - readonly type: "git"; - readonly url: string; - } - | { - readonly package: string; - readonly registry?: string | null; - readonly type: "npm"; - readonly version?: string | null; - } - | { readonly type: "remote" }; -export const V2PluginReadResponse__PluginSource = Schema.Union( - [ - Schema.Struct({ - path: V2PluginReadResponse__AbsolutePathBuf, - type: Schema.Literal("local").annotate({ title: "LocalPluginSourceType" }), - }).annotate({ title: "LocalPluginSource" }), - Schema.Struct({ - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("git").annotate({ title: "GitPluginSourceType" }), - url: Schema.String, - }).annotate({ title: "GitPluginSource" }), - Schema.Struct({ - package: Schema.String, - registry: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional HTTPS registry URL. Authentication stays in the user's npm config.", - }), - Schema.Null, - ]), - ), - type: Schema.Literal("npm").annotate({ title: "NpmPluginSourceType" }), - version: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Optional npm version or version range." }), - Schema.Null, - ]), - ), - }).annotate({ title: "NpmPluginSource" }), - Schema.Struct({ - type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), - }).annotate({ - title: "RemotePluginSource", + useStateDbOnly: Schema.optionalKey( + Schema.Boolean.annotate({ description: - "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + "If true, return from the state DB without scanning JSONL rollouts to repair thread metadata. Omitted or false preserves scan-and-repair behavior.", }), - ], - { mode: "oneOf" }, -); - -export type V2PluginReadResponse__SkillInterface = { - readonly brandColor?: string | null; - readonly defaultPrompt?: string | null; - readonly displayName?: string | null; - readonly iconLarge?: V2PluginReadResponse__AbsolutePathBuf | null; - readonly iconSmall?: V2PluginReadResponse__AbsolutePathBuf | null; - readonly shortDescription?: string | null; -}; -export const V2PluginReadResponse__SkillInterface = Schema.Struct({ - brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - defaultPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconLarge: Schema.optionalKey(Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null])), - iconSmall: Schema.optionalKey(Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null])), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); + ), +}).annotate({ identifier: "ClientRequest__ThreadListParams" }); -export type V2PluginReadResponse__AppTemplateSummary = { - readonly canonicalConnectorId?: string | null; - readonly category?: string | null; - readonly description?: string | null; - readonly logoUrl?: string | null; - readonly logoUrlDark?: string | null; - readonly materializedAppIds: ReadonlyArray; +export type ClientRequest__ThreadSectionCreateParams = { + readonly appearance?: ClientRequest__ThreadSectionAppearance | null; readonly name: string; - readonly reason?: V2PluginReadResponse__AppTemplateUnavailableReason | null; - readonly templateId: string; }; -export const V2PluginReadResponse__AppTemplateSummary = Schema.Struct({ - canonicalConnectorId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logoUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logoUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - materializedAppIds: Schema.Array(Schema.String), - name: Schema.String, - reason: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__AppTemplateUnavailableReason, Schema.Null]), +export const ClientRequest__ThreadSectionCreateParams = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadSectionAppearance, Schema.Null]), ), - templateId: Schema.String, -}); - -export type V2PluginReadResponse__PluginHookSummary = { - readonly eventName: V2PluginReadResponse__HookEventName; - readonly key: string; -}; -export const V2PluginReadResponse__PluginHookSummary = Schema.Struct({ - eventName: V2PluginReadResponse__HookEventName, - key: Schema.String, + name: Schema.String.annotate({ description: "The user-visible name of the section." }), +}).annotate({ + description: "Parameters for creating an independently persisted thread section.", + identifier: "ClientRequest__ThreadSectionCreateParams", }); -export type V2PluginReadResponse__PluginSharePrincipal = { +export type ClientRequest__ThreadSectionUpdateParams = { + readonly appearance?: ClientRequest__ThreadSectionAppearance | null; readonly name: string; - readonly principalId: string; - readonly principalType: V2PluginReadResponse__PluginSharePrincipalType; - readonly role: V2PluginReadResponse__PluginSharePrincipalRole; + readonly sectionId: string; }; -export const V2PluginReadResponse__PluginSharePrincipal = Schema.Struct({ - name: Schema.String, - principalId: Schema.String, - principalType: V2PluginReadResponse__PluginSharePrincipalType, - role: V2PluginReadResponse__PluginSharePrincipalRole, +export const ClientRequest__ThreadSectionUpdateParams = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Omit to preserve appearance, use `null` to clear it, or provide a replacement.", + }), + ), + name: Schema.String.annotate({ description: "The updated user-visible name of the section." }), + sectionId: Schema.String.annotate({ + description: "The stable, server-generated identity of the section to update.", + }), +}).annotate({ + description: "Parameters for updating an independently persisted thread section.", + identifier: "ClientRequest__ThreadSectionUpdateParams", }); -export type V2PluginReadResponse__ScheduledTaskSchedule = - | { - readonly days?: ReadonlyArray | null; - readonly intervalHours: number; - readonly type: "hourly"; - } - | { readonly time: string; readonly type: "daily" } - | { readonly time: string; readonly type: "weekdays" } - | { - readonly days: ReadonlyArray; - readonly time: string; - readonly type: "weekly"; - }; -export const V2PluginReadResponse__ScheduledTaskSchedule = Schema.Union( - [ - Schema.Struct({ - days: Schema.optionalKey( - Schema.Union([Schema.Array(V2PluginReadResponse__ScheduledTaskWeekday), Schema.Null]), - ), - intervalHours: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - type: Schema.Literal("hourly").annotate({ title: "HourlyScheduledTaskScheduleType" }), - }).annotate({ title: "HourlyScheduledTaskSchedule" }), - Schema.Struct({ - time: Schema.String, - type: Schema.Literal("daily").annotate({ title: "DailyScheduledTaskScheduleType" }), - }).annotate({ title: "DailyScheduledTaskSchedule" }), - Schema.Struct({ - time: Schema.String, - type: Schema.Literal("weekdays").annotate({ title: "WeekdaysScheduledTaskScheduleType" }), - }).annotate({ title: "WeekdaysScheduledTaskSchedule" }), - Schema.Struct({ - days: Schema.Array(V2PluginReadResponse__ScheduledTaskWeekday), - time: Schema.String, - type: Schema.Literal("weekly").annotate({ title: "WeeklyScheduledTaskScheduleType" }), - }).annotate({ title: "WeeklyScheduledTaskSchedule" }), - ], - { mode: "oneOf" }, -); - -export type V2PluginShareListResponse__PluginInterface = { - readonly brandColor?: string | null; - readonly capabilities: ReadonlyArray; - readonly category?: string | null; - readonly composerIcon?: V2PluginShareListResponse__AbsolutePathBuf | null; - readonly composerIconUrl?: string | null; - readonly defaultPrompt?: ReadonlyArray | null; - readonly developerName?: string | null; - readonly displayName?: string | null; - readonly logo?: V2PluginShareListResponse__AbsolutePathBuf | null; - readonly logoDark?: V2PluginShareListResponse__AbsolutePathBuf | null; - readonly logoUrl?: string | null; - readonly logoUrlDark?: string | null; - readonly longDescription?: string | null; - readonly privacyPolicyUrl?: string | null; - readonly screenshotUrls: ReadonlyArray; - readonly screenshots: ReadonlyArray; - readonly shortDescription?: string | null; - readonly termsOfServiceUrl?: string | null; - readonly websiteUrl?: string | null; +export type ClientRequest__ThreadTurnsListParams = { + readonly cursor?: string | null; + readonly itemsView?: ClientRequest__TurnItemsView | null; + readonly limit?: number | null; + readonly sortDirection?: ClientRequest__SortDirection | null; + readonly threadId: string; }; -export const V2PluginShareListResponse__PluginInterface = Schema.Struct({ - brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - capabilities: Schema.Array(Schema.String), - category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - composerIcon: Schema.optionalKey( - Schema.Union([V2PluginShareListResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local composer icon path, resolved from the installed plugin package.", - }), - ), - composerIconUrl: Schema.optionalKey( +export const ClientRequest__ThreadTurnsListParams = Schema.Struct({ + cursor: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote composer icon URL from the plugin catalog." }), + Schema.String.annotate({ + description: "Opaque cursor to pass to the next call to continue after the last turn.", + }), Schema.Null, ]), ), - defaultPrompt: Schema.optionalKey( + itemsView: Schema.optionalKey( + Schema.Union([ClientRequest__TurnItemsView, Schema.Null]).annotate({ + description: "How much item detail to include for each returned turn; defaults to summary.", + }), + ), + limit: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.String).annotate({ - description: - "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", - }), + Schema.Number.annotate({ description: "Optional turn page size.", format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), - developerName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logo: Schema.optionalKey( - Schema.Union([V2PluginShareListResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local logo path, resolved from the installed plugin package.", - }), - ), - logoDark: Schema.optionalKey( - Schema.Union([V2PluginShareListResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: "Local dark-mode logo path, resolved from the installed plugin package.", + sortDirection: Schema.optionalKey( + Schema.Union([ClientRequest__SortDirection, Schema.Null]).annotate({ + description: "Optional turn pagination direction; defaults to descending.", }), ), - logoUrl: Schema.optionalKey( + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ThreadTurnsListParams" }); + +export type ClientRequest__ThreadItemsListCursor = string | ClientRequest__ThreadItemsListAnchor; +export const ClientRequest__ThreadItemsListCursor = Schema.Union([ + Schema.String, + ClientRequest__ThreadItemsListAnchor, +]).annotate({ + description: "Starting position for an item-history page.", + identifier: "ClientRequest__ThreadItemsListCursor", +}); + +export type ClientRequest__SkillsExtraRootsSetParams = { + readonly extraRoots: ReadonlyArray; +}; +export const ClientRequest__SkillsExtraRootsSetParams = Schema.Struct({ + extraRoots: Schema.Array(ClientRequest__AbsolutePathBuf), +}).annotate({ identifier: "ClientRequest__SkillsExtraRootsSetParams" }); + +export type ClientRequest__PluginInstalledParams = { + readonly cwds?: ReadonlyArray | null; + readonly installSuggestionPluginNames?: ReadonlyArray | null; +}; +export const ClientRequest__PluginInstalledParams = Schema.Struct({ + cwds: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote logo URL from the plugin catalog." }), + Schema.Array(ClientRequest__AbsolutePathBuf).annotate({ + description: "Optional working directories used to discover repo marketplaces.", + }), Schema.Null, ]), ), - logoUrlDark: Schema.optionalKey( + installSuggestionPluginNames: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Remote dark-mode logo URL from the plugin catalog." }), + Schema.Array(Schema.String).annotate({ + description: + "Additional uninstalled plugin names that should be returned when present locally. This is used by mention surfaces that intentionally expose install entrypoints.", + }), Schema.Null, ]), ), - longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - screenshotUrls: Schema.Array(Schema.String).annotate({ - description: "Remote screenshot URLs from the plugin catalog.", - }), - screenshots: Schema.Array(V2PluginShareListResponse__AbsolutePathBuf).annotate({ - description: "Local screenshot paths, resolved from the installed plugin package.", - }), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ClientRequest__PluginInstalledParams" }); + +export type ClientRequest__PluginReadParams = { + readonly marketplacePath?: ClientRequest__AbsolutePathBuf | null; + readonly pluginName: string; + readonly remoteMarketplaceName?: string | null; +}; +export const ClientRequest__PluginReadParams = Schema.Struct({ + marketplacePath: Schema.optionalKey(Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null])), + pluginName: Schema.String, + remoteMarketplaceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ClientRequest__PluginReadParams" }); + +export type ClientRequest__FsReadFileParams = { readonly path: ClientRequest__AbsolutePathBuf }; +export const ClientRequest__FsReadFileParams = Schema.Struct({ + path: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute path to read." }), +}).annotate({ + description: "Read a file from the host filesystem.", + identifier: "ClientRequest__FsReadFileParams", }); -export type V2PluginShareListResponse__PluginSource = - | { readonly path: V2PluginShareListResponse__AbsolutePathBuf; readonly type: "local" } - | { - readonly path?: string | null; - readonly refName?: string | null; - readonly sha?: string | null; - readonly type: "git"; - readonly url: string; - } - | { - readonly package: string; - readonly registry?: string | null; - readonly type: "npm"; - readonly version?: string | null; - } - | { readonly type: "remote" }; -export const V2PluginShareListResponse__PluginSource = Schema.Union( - [ - Schema.Struct({ - path: V2PluginShareListResponse__AbsolutePathBuf, - type: Schema.Literal("local").annotate({ title: "LocalPluginSourceType" }), - }).annotate({ title: "LocalPluginSource" }), - Schema.Struct({ - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("git").annotate({ title: "GitPluginSourceType" }), - url: Schema.String, - }).annotate({ title: "GitPluginSource" }), - Schema.Struct({ - package: Schema.String, - registry: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional HTTPS registry URL. Authentication stays in the user's npm config.", - }), - Schema.Null, - ]), - ), - type: Schema.Literal("npm").annotate({ title: "NpmPluginSourceType" }), - version: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Optional npm version or version range." }), - Schema.Null, - ]), - ), - }).annotate({ title: "NpmPluginSource" }), - Schema.Struct({ - type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), - }).annotate({ - title: "RemotePluginSource", - description: - "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", - }), - ], - { mode: "oneOf" }, -); +export type ClientRequest__FsWriteFileParams = { + readonly dataBase64: string; + readonly path: ClientRequest__AbsolutePathBuf; +}; +export const ClientRequest__FsWriteFileParams = Schema.Struct({ + dataBase64: Schema.String.annotate({ description: "File contents encoded as base64." }), + path: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute path to write." }), +}).annotate({ + description: "Write a file on the host filesystem.", + identifier: "ClientRequest__FsWriteFileParams", +}); -export type V2PluginShareListResponse__PluginSharePrincipal = { - readonly name: string; - readonly principalId: string; - readonly principalType: V2PluginShareListResponse__PluginSharePrincipalType; - readonly role: V2PluginShareListResponse__PluginSharePrincipalRole; +export type ClientRequest__FsCreateDirectoryParams = { + readonly path: ClientRequest__AbsolutePathBuf; + readonly recursive?: boolean | null; }; -export const V2PluginShareListResponse__PluginSharePrincipal = Schema.Struct({ - name: Schema.String, - principalId: Schema.String, - principalType: V2PluginShareListResponse__PluginSharePrincipalType, - role: V2PluginShareListResponse__PluginSharePrincipalRole, +export const ClientRequest__FsCreateDirectoryParams = Schema.Struct({ + path: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute directory path to create." }), + recursive: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: "Whether parent directories should also be created. Defaults to `true`.", + }), + Schema.Null, + ]), + ), +}).annotate({ + description: "Create a directory on the host filesystem.", + identifier: "ClientRequest__FsCreateDirectoryParams", }); -export type V2PluginShareSaveParams__PluginShareTarget = { - readonly principalId: string; - readonly principalType: V2PluginShareSaveParams__PluginSharePrincipalType; - readonly role: V2PluginShareSaveParams__PluginShareTargetRole; +export type ClientRequest__FsGetMetadataParams = { readonly path: ClientRequest__AbsolutePathBuf }; +export const ClientRequest__FsGetMetadataParams = Schema.Struct({ + path: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute path to inspect." }), +}).annotate({ + description: "Request metadata for an absolute path.", + identifier: "ClientRequest__FsGetMetadataParams", +}); + +export type ClientRequest__FsReadDirectoryParams = { + readonly path: ClientRequest__AbsolutePathBuf; }; -export const V2PluginShareSaveParams__PluginShareTarget = Schema.Struct({ - principalId: Schema.String, - principalType: V2PluginShareSaveParams__PluginSharePrincipalType, - role: V2PluginShareSaveParams__PluginShareTargetRole, +export const ClientRequest__FsReadDirectoryParams = Schema.Struct({ + path: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute directory path to read." }), +}).annotate({ + description: "List direct child names for a directory.", + identifier: "ClientRequest__FsReadDirectoryParams", }); -export type V2PluginShareUpdateTargetsParams__PluginShareTarget = { - readonly principalId: string; - readonly principalType: V2PluginShareUpdateTargetsParams__PluginSharePrincipalType; - readonly role: V2PluginShareUpdateTargetsParams__PluginShareTargetRole; +export type ClientRequest__FsRemoveParams = { + readonly force?: boolean | null; + readonly path: ClientRequest__AbsolutePathBuf; + readonly recursive?: boolean | null; }; -export const V2PluginShareUpdateTargetsParams__PluginShareTarget = Schema.Struct({ - principalId: Schema.String, - principalType: V2PluginShareUpdateTargetsParams__PluginSharePrincipalType, - role: V2PluginShareUpdateTargetsParams__PluginShareTargetRole, +export const ClientRequest__FsRemoveParams = Schema.Struct({ + force: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: "Whether missing paths should be ignored. Defaults to `true`.", + }), + Schema.Null, + ]), + ), + path: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute path to remove." }), + recursive: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: "Whether directory removal should recurse. Defaults to `true`.", + }), + Schema.Null, + ]), + ), +}).annotate({ + description: "Remove a file or directory tree from the host filesystem.", + identifier: "ClientRequest__FsRemoveParams", }); -export type V2PluginShareUpdateTargetsResponse__PluginSharePrincipal = { - readonly name: string; +export type ClientRequest__FsCopyParams = { + readonly destinationPath: ClientRequest__AbsolutePathBuf; + readonly recursive?: boolean; + readonly sourcePath: ClientRequest__AbsolutePathBuf; +}; +export const ClientRequest__FsCopyParams = Schema.Struct({ + destinationPath: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute destination path." }), + recursive: Schema.optionalKey( + Schema.Boolean.annotate({ + description: "Required for directory copies; ignored for file copies.", + }), + ), + sourcePath: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute source path." }), +}).annotate({ + description: "Copy a file or directory tree on the host filesystem.", + identifier: "ClientRequest__FsCopyParams", +}); + +export type ClientRequest__FsWatchParams = { + readonly path: ClientRequest__AbsolutePathBuf; + readonly watchId: string; +}; +export const ClientRequest__FsWatchParams = Schema.Struct({ + path: Schema.suspend( + (): Schema.Codec => ClientRequest__AbsolutePathBuf, + ).annotate({ description: "Absolute file or directory path to watch." }), + watchId: Schema.String.annotate({ + description: "Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`.", + }), +}).annotate({ + description: "Start filesystem watch notifications for an absolute path.", + identifier: "ClientRequest__FsWatchParams", +}); + +export type ClientRequest__SkillsConfigWriteParams = { + readonly enabled: boolean; + readonly name?: string | null; + readonly path?: ClientRequest__AbsolutePathBuf | null; +}; +export const ClientRequest__SkillsConfigWriteParams = Schema.Struct({ + enabled: Schema.Boolean, + name: Schema.optionalKey( + Schema.Union([Schema.String.annotate({ description: "Name-based selector." }), Schema.Null]), + ), + path: Schema.optionalKey( + Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Path-based selector.", + }), + ), +}).annotate({ identifier: "ClientRequest__SkillsConfigWriteParams" }); + +export type ClientRequest__PluginInstallParams = { + readonly installAttemptId?: string | null; + readonly marketplacePath?: ClientRequest__AbsolutePathBuf | null; + readonly pluginName: string; + readonly remoteMarketplaceName?: string | null; +}; +export const ClientRequest__PluginInstallParams = Schema.Struct({ + installAttemptId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Client-generated identifier used to correlate one installation attempt.", + }), + Schema.Null, + ]), + ), + marketplacePath: Schema.optionalKey(Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null])), + pluginName: Schema.String, + remoteMarketplaceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ClientRequest__PluginInstallParams" }); + +export type ClientRequest__PluginListParams = { + readonly cwds?: ReadonlyArray | null; + readonly forceRefetch?: boolean; + readonly marketplaceKinds?: ReadonlyArray | null; +}; +export const ClientRequest__PluginListParams = Schema.Struct({ + cwds: Schema.optionalKey( + Schema.Union([ + Schema.Array(ClientRequest__AbsolutePathBuf).annotate({ + description: + "Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered.", + }), + Schema.Null, + ]), + ), + forceRefetch: Schema.optionalKey( + Schema.Boolean.annotate({ + description: "Whether the client requests a fresh remote plugin catalog fetch.", + }), + ), + marketplaceKinds: Schema.optionalKey( + Schema.Union([ + Schema.Array(ClientRequest__PluginListMarketplaceKind).annotate({ + description: + "Optional marketplace kind filter. When omitted, only local marketplaces are queried, plus the default remote catalog when enabled by feature flag.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__PluginListParams" }); + +export type ClientRequest__PluginShareTarget = { readonly principalId: string; - readonly principalType: V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType; - readonly role: V2PluginShareUpdateTargetsResponse__PluginSharePrincipalRole; + readonly principalType: ClientRequest__PluginSharePrincipalType; + readonly role: ClientRequest__PluginShareTargetRole; }; -export const V2PluginShareUpdateTargetsResponse__PluginSharePrincipal = Schema.Struct({ - name: Schema.String, +export const ClientRequest__PluginShareTarget = Schema.Struct({ principalId: Schema.String, - principalType: V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType, - role: V2PluginShareUpdateTargetsResponse__PluginSharePrincipalRole, + principalType: ClientRequest__PluginSharePrincipalType, + role: ClientRequest__PluginShareTargetRole, +}).annotate({ identifier: "ClientRequest__PluginShareTarget" }); + +export type ClientRequest__Settings = { + readonly developer_instructions?: string | null; + readonly model: string; + readonly reasoning_effort?: ClientRequest__ReasoningEffort | null; +}; +export const ClientRequest__Settings = Schema.Struct({ + developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + model: Schema.String, + reasoning_effort: Schema.optionalKey(Schema.Union([ClientRequest__ReasoningEffort, Schema.Null])), +}).annotate({ + description: "Settings for a collaboration mode.", + identifier: "ClientRequest__Settings", }); -export type V2RawResponseItemCompletedNotification__ContentItem = +export type ClientRequest__ConfigurationReasoning = { + readonly effort: ClientRequest__ReasoningEffort; +}; +export const ClientRequest__ConfigurationReasoning = Schema.Struct({ + effort: ClientRequest__ReasoningEffort, +}).annotate({ + description: "Reasoning settings interpreted by the backend for the routed model.", + identifier: "ClientRequest__ConfigurationReasoning", +}); + +export type ClientRequest__TextElement = { + readonly byteRange: ClientRequest__ByteRange; + readonly placeholder?: string | null; +}; +export const ClientRequest__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => ClientRequest__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__TextElement" }); + +export type ClientRequest__FunctionCallOutputContentItem = | { readonly text: string; readonly type: "input_text" } | { - readonly detail?: V2RawResponseItemCompletedNotification__ImageDetail | null; - readonly image_url: string; + readonly detail?: ClientRequest__ImageDetail | null; readonly type: "input_image"; + readonly image_url: string; } - | { readonly audio_url: string; readonly type: "input_audio" } - | { readonly text: string; readonly type: "output_text" }; -export const V2RawResponseItemCompletedNotification__ContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), - }).annotate({ title: "InputTextContentItem" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null]), - ), - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), - }).annotate({ title: "InputImageContentItem" }), - Schema.Struct({ - audio_url: Schema.String, - type: Schema.Literal("input_audio").annotate({ title: "InputAudioContentItemType" }), - }).annotate({ title: "InputAudioContentItem" }), - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), - }).annotate({ title: "OutputTextContentItem" }), - ], - { mode: "oneOf" }, -); - -export type V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem = - | { readonly text: string; readonly type: "input_text" } | { - readonly detail?: V2RawResponseItemCompletedNotification__ImageDetail | null; - readonly image_url: string; + readonly detail?: ClientRequest__ImageDetail | null; readonly type: "input_image"; + readonly file_id: string; } | { readonly audio_url: string; readonly type: "input_audio" } | { readonly encrypted_content: string; readonly type: "encrypted_content" }; -export const V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem = Schema.Union( +export const ClientRequest__FunctionCallOutputContentItem = Schema.Union( [ Schema.Struct({ text: Schema.String, @@ -15579,15 +16885,22 @@ export const V2RawResponseItemCompletedNotification__FunctionCallOutputContentIt title: "InputTextFunctionCallOutputContentItemType", }), }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null]), - ), - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ - title: "InputImageFunctionCallOutputContentItemType", - }), - }).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), Schema.Struct({ audio_url: Schema.String, type: Schema.Literal("input_audio").annotate({ @@ -15605,282 +16918,454 @@ export const V2RawResponseItemCompletedNotification__FunctionCallOutputContentIt ).annotate({ description: "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "ClientRequest__FunctionCallOutputContentItem", }); -export type V2ReviewStartResponse__CommandAction = +export type ClientRequest__ContentItem = + | { readonly text: string; readonly type: "input_text" } | { - readonly command: string; - readonly name: string; - readonly path: V2ReviewStartResponse__AbsolutePathBuf; - readonly type: "read"; + readonly detail?: ClientRequest__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; + readonly detail?: ClientRequest__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; } - | { readonly command: string; readonly type: "unknown" }; -export const V2ReviewStartResponse__CommandAction = Schema.Union( + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly text: string; readonly type: "output_text" }; +export const ClientRequest__ContentItem = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2ReviewStartResponse__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + text: Schema.String, + type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), + }).annotate({ title: "InputTextContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + file_id: Schema.String, + }).annotate({ title: "FileIdContentItem" }), + ]).annotate({ title: "InputImageContentItem" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ title: "InputAudioContentItemType" }), + }).annotate({ title: "InputAudioContentItem" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + text: Schema.String, + type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), + }).annotate({ title: "OutputTextContentItem" }), ], { mode: "oneOf" }, -); - -export type V2ReviewStartResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ReviewStartResponse__CollabAgentStatus; -}; -export const V2ReviewStartResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ReviewStartResponse__CollabAgentStatus, -}); - -export type V2ReviewStartResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; -}; -export const V2ReviewStartResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ReviewStartResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +).annotate({ identifier: "ClientRequest__ContentItem" }); -export type V2ReviewStartResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } +export type ClientRequest__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { readonly networkAccess?: boolean; readonly type: "readOnly" } + | { readonly networkAccess?: ClientRequest__NetworkAccess; readonly type: "externalSandbox" } | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ReviewStartResponse__NonSteerableTurnKind; - }; + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly type: "workspaceWrite"; + readonly writableRoots?: ReadonlyArray; }; -export const V2ReviewStartResponse__CodexErrorInfo = Schema.Union( +export const ClientRequest__SandboxPolicy = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + type: Schema.Literal("dangerFullAccess").annotate({ + title: "DangerFullAccessSandboxPolicyType", }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), + }).annotate({ title: "DangerFullAccessSandboxPolicy" }), Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), + }).annotate({ title: "ReadOnlySandboxPolicy" }), Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + networkAccess: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => ClientRequest__NetworkAccess, + ).annotate({ default: "restricted" }), + ), + type: Schema.Literal("externalSandbox").annotate({ + title: "ExternalSandboxSandboxPolicyType", }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), + }).annotate({ title: "ExternalSandboxSandboxPolicy" }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ReviewStartResponse__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", - }), + excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), + writableRoots: Schema.optionalKey( + Schema.Array(ClientRequest__AbsolutePathBuf).annotate({ default: [] }), + ), + }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), ], { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); +).annotate({ identifier: "ClientRequest__SandboxPolicy" }); -export type V2ReviewStartResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ReviewStartResponse__PatchChangeKind; - readonly path: string; +export type ClientRequest__ReviewStartParams = { + readonly delivery?: ClientRequest__ReviewDelivery | null; + readonly target: ClientRequest__ReviewTarget; + readonly threadId: string; }; -export const V2ReviewStartResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ReviewStartResponse__PatchChangeKind, - path: Schema.String, -}); +export const ClientRequest__ReviewStartParams = Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([ClientRequest__ReviewDelivery, Schema.Null]).annotate({ + description: + "Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`). Detached delivery is deprecated and emits `deprecationNotice`. Use `thread/start` followed by an inline review for a separate review thread.", + }), + ), + target: ClientRequest__ReviewTarget, + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__ReviewStartParams" }); -export type V2ReviewStartResponse__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ReviewStartResponse__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: V2ReviewStartResponse__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; +export type ClientRequest__McpServerOauthLoginParams = { + readonly clientRegistration?: ClientRequest__McpServerOauthClientRegistration | null; + readonly name: string; + readonly scopes?: ReadonlyArray | null; + readonly threadId?: string | null; + readonly timeoutSecs?: number | null; +}; +export const ClientRequest__McpServerOauthLoginParams = Schema.Struct({ + clientRegistration: Schema.optionalKey( + Schema.Union([ClientRequest__McpServerOauthClientRegistration, Schema.Null]).annotate({ + description: + "Registration strategy for this login only; omission selects automatic discovery.", + }), + ), + name: Schema.String, + scopes: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + timeoutSecs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__McpServerOauthLoginParams" }); + +export type ClientRequest__ListMcpServerStatusParams = { + readonly cursor?: string | null; + readonly detail?: ClientRequest__McpServerStatusDetail | null; + readonly limit?: number | null; + readonly serverName?: string | null; + readonly threadId?: string | null; +}; +export const ClientRequest__ListMcpServerStatusParams = Schema.Struct({ + cursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Opaque pagination cursor returned by a previous call.", + }), + Schema.Null, + ]), + ), + detail: Schema.optionalKey( + Schema.Union([ClientRequest__McpServerStatusDetail, Schema.Null]).annotate({ + description: + "Controls how much MCP inventory data to fetch for each server. Defaults to `Full` when omitted.", + }), + ), + limit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Optional page size; defaults to a server-defined value.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + serverName: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Limit discovery to one server. With a thread ID, reuse that thread's MCP connection.", + }), + Schema.Null, + ]), + ), + threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ClientRequest__ListMcpServerStatusParams" }); + +export type ClientRequest__McpResourceReadParams = { + readonly connectorId?: string | null; + readonly originCallId?: string | null; + readonly server: string; + readonly target?: ClientRequest__McpResourceReadTarget | null; + readonly threadId?: string | null; + readonly uri: string; +}; +export const ClientRequest__McpResourceReadParams = Schema.Struct({ + connectorId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + originCallId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Originating MCP tool call used to select the resource's app.", + }), + Schema.Null, + ]), + ), + server: Schema.String, + target: Schema.optionalKey( + Schema.Union([ClientRequest__McpResourceReadTarget, Schema.Null]).annotate({ + description: "Explicit hosted app/account. Omit to retain legacy resource discovery.", + }), + ), + threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + uri: Schema.String, +}).annotate({ identifier: "ClientRequest__McpResourceReadParams" }); + +export type ClientRequest__WindowsSandboxSetupStartParams = { + readonly cwd?: ClientRequest__AbsolutePathBuf | null; + readonly mode: ClientRequest__WindowsSandboxSetupMode; +}; +export const ClientRequest__WindowsSandboxSetupStartParams = Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null])), + mode: ClientRequest__WindowsSandboxSetupMode, +}).annotate({ identifier: "ClientRequest__WindowsSandboxSetupStartParams" }); + +export type ClientRequest__LoginAccountParams = + | { readonly apiKey: string; readonly type: "apiKey" } + | { + readonly appBrand?: ClientRequest__LoginAppBrand | null; + readonly codexStreamlinedLogin?: boolean; + readonly type: "chatgpt"; + readonly useHostedLoginSuccessPage?: boolean; } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ReviewStartResponse__UserInput = Schema.Union( + | { readonly type: "chatgptDeviceCode" } + | { + readonly accessToken: string; + readonly chatgptAccountId: string; + readonly chatgptPlanType?: string | null; + readonly type: "chatgptAuthTokens"; + } + | { readonly apiKey: string; readonly region: string; readonly type: "amazonBedrock" } + | { + readonly accessKeyId: string; + readonly region: string; + readonly secretAccessKey: string; + readonly sessionToken?: string | null; + readonly type: "amazonBedrockAccessKeys"; + }; +export const ClientRequest__LoginAccountParams = Schema.Union( [ Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ReviewStartResponse__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), + apiKey: Schema.String, + type: Schema.Literal("apiKey").annotate({ title: "ApiKeyLoginAccountParamsType" }), + }).annotate({ title: "ApiKeyLoginAccountParams" }), Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), + appBrand: Schema.optionalKey(Schema.Union([ClientRequest__LoginAppBrand, Schema.Null])), + codexStreamlinedLogin: Schema.optionalKey(Schema.Boolean), + type: Schema.Literal("chatgpt").annotate({ title: "ChatgptLoginAccountParamsType" }), + useHostedLoginSuccessPage: Schema.optionalKey(Schema.Boolean), + }).annotate({ title: "ChatgptLoginAccountParams" }), Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), + type: Schema.Literal("chatgptDeviceCode").annotate({ + title: "ChatgptDeviceCodeLoginAccountParamsType", + }), + }).annotate({ title: "ChatgptDeviceCodeLoginAccountParams" }), Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), + accessToken: Schema.String.annotate({ + description: + "Access token (JWT) supplied by the client. This token is used for backend API requests and email extraction.", + }), + chatgptAccountId: Schema.String.annotate({ + description: "Workspace/account identifier supplied by the client.", + }), + chatgptPlanType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional plan type supplied by the client.\n\nWhen `null`, Codex attempts to derive the plan type from access-token claims. If unavailable, the plan defaults to `unknown`.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("chatgptAuthTokens").annotate({ + title: "ChatgptAuthTokensLoginAccountParamsType", + }), + }).annotate({ + title: "ChatgptAuthTokensLoginAccountParams", + description: + "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE. The access token must contain the same scopes that Codex-managed ChatGPT auth tokens have.", + }), Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), + apiKey: Schema.String, + region: Schema.String, + type: Schema.Literal("amazonBedrock").annotate({ + title: "AmazonBedrockLoginAccountParamsType", + }), + }).annotate({ + title: "AmazonBedrockLoginAccountParams", + description: "[UNSTABLE] Managed Amazon Bedrock login is experimental.", + }), Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), + accessKeyId: Schema.String, + region: Schema.String, + secretAccessKey: Schema.String, + sessionToken: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("amazonBedrockAccessKeys").annotate({ + title: "AmazonBedrockAccessKeysLoginAccountParamsType", + }), + }).annotate({ + title: "AmazonBedrockAccessKeysLoginAccountParams", + description: "[UNSTABLE] Managed Amazon Bedrock AWS access key login is experimental.", + }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "ClientRequest__LoginAccountParams" }); -export type V2SkillsListResponse__SkillInterface = { - readonly brandColor?: string | null; - readonly defaultPrompt?: string | null; - readonly displayName?: string | null; - readonly iconLarge?: V2SkillsListResponse__AbsolutePathBuf | null; - readonly iconSmall?: V2SkillsListResponse__AbsolutePathBuf | null; - readonly shortDescription?: string | null; +export type ClientRequest__SendAddCreditsNudgeEmailParams = { + readonly creditType: ClientRequest__AddCreditsNudgeCreditType; }; -export const V2SkillsListResponse__SkillInterface = Schema.Struct({ - brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - defaultPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconLarge: Schema.optionalKey(Schema.Union([V2SkillsListResponse__AbsolutePathBuf, Schema.Null])), - iconSmall: Schema.optionalKey(Schema.Union([V2SkillsListResponse__AbsolutePathBuf, Schema.Null])), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export const ClientRequest__SendAddCreditsNudgeEmailParams = Schema.Struct({ + creditType: ClientRequest__AddCreditsNudgeCreditType, +}).annotate({ identifier: "ClientRequest__SendAddCreditsNudgeEmailParams" }); -export type V2SkillsListResponse__SkillDependencies = { - readonly tools: ReadonlyArray; +export type ClientRequest__CommandExecResizeParams = { + readonly processId: string; + readonly size: ClientRequest__CommandExecTerminalSize; }; -export const V2SkillsListResponse__SkillDependencies = Schema.Struct({ - tools: Schema.Array(V2SkillsListResponse__SkillToolDependency), +export const ClientRequest__CommandExecResizeParams = Schema.Struct({ + processId: Schema.String.annotate({ + description: + "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + }), + size: Schema.suspend( + (): Schema.Codec => + ClientRequest__CommandExecTerminalSize, + ).annotate({ description: "New PTY size in character cells." }), +}).annotate({ + description: "Resize a running PTY-backed `command/exec` session.", + identifier: "ClientRequest__CommandExecResizeParams", }); -export type V2ThreadForkResponse__CommandAction = +export type ClientRequest__MigrationDetails = { + readonly commands?: ReadonlyArray; + readonly hooks?: ReadonlyArray; + readonly mcpServers?: ReadonlyArray; + readonly memory?: ReadonlyArray; + readonly plugins?: ReadonlyArray; + readonly sessions?: ReadonlyArray; + readonly skills?: ReadonlyArray; + readonly subagents?: ReadonlyArray; +}; +export const ClientRequest__MigrationDetails = Schema.Struct({ + commands: Schema.optionalKey( + Schema.Array(ClientRequest__CommandMigration).annotate({ default: [] }), + ), + hooks: Schema.optionalKey(Schema.Array(ClientRequest__HookMigration).annotate({ default: [] })), + mcpServers: Schema.optionalKey( + Schema.Array(ClientRequest__McpServerMigration).annotate({ default: [] }), + ), + memory: Schema.optionalKey(Schema.Array(Schema.String)), + plugins: Schema.optionalKey( + Schema.Array(ClientRequest__PluginsMigration).annotate({ default: [] }), + ), + sessions: Schema.optionalKey( + Schema.Array(ClientRequest__SessionMigration).annotate({ default: [] }), + ), + skills: Schema.optionalKey(Schema.Array(ClientRequest__SkillMigration).annotate({ default: [] })), + subagents: Schema.optionalKey( + Schema.Array(ClientRequest__SubagentMigration).annotate({ default: [] }), + ), +}).annotate({ identifier: "ClientRequest__MigrationDetails" }); + +export type ClientRequest__ExternalAgentConfigImportItemTypeFailure = { + readonly cwd?: string | null; + readonly errorType?: string | null; + readonly failureStage: string; + readonly itemType: ClientRequest__ExternalAgentConfigMigrationItemType; + readonly message: string; + readonly source?: string | null; + readonly subErrorType?: string | null; +}; +export const ClientRequest__ExternalAgentConfigImportItemTypeFailure = Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + failureStage: Schema.String, + itemType: ClientRequest__ExternalAgentConfigMigrationItemType, + message: Schema.String, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ClientRequest__ExternalAgentConfigImportItemTypeFailure" }); + +export type ClientRequest__ExternalAgentConfigImportHistoryRecordSuccessParams = { + readonly cwd?: string | null; + readonly itemType: ClientRequest__ExternalAgentConfigMigrationItemType; + readonly source?: string | null; + readonly target?: string | null; + readonly title?: string | null; +}; +export const ClientRequest__ExternalAgentConfigImportHistoryRecordSuccessParams = Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + itemType: ClientRequest__ExternalAgentConfigMigrationItemType, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + title: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Original title for an imported session, when available.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__ExternalAgentConfigImportHistoryRecordSuccessParams" }); + +export type ClientRequest__ConfigValueWriteParams = { + readonly expectedVersion?: string | null; + readonly filePath?: string | null; + readonly keyPath: string; + readonly mergeStrategy: ClientRequest__MergeStrategy; + readonly value: Schema.Json; +}; +export const ClientRequest__ConfigValueWriteParams = Schema.Struct({ + expectedVersion: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + filePath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + }), + Schema.Null, + ]), + ), + keyPath: Schema.String, + mergeStrategy: ClientRequest__MergeStrategy, + value: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ identifier: "ClientRequest__ConfigValueWriteParams" }); + +export type ClientRequest__ConfigEdit = { + readonly keyPath: string; + readonly mergeStrategy: ClientRequest__MergeStrategy; + readonly value: Schema.Json; +}; +export const ClientRequest__ConfigEdit = Schema.Struct({ + keyPath: Schema.String, + mergeStrategy: ClientRequest__MergeStrategy, + value: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ identifier: "ClientRequest__ConfigEdit" }); + +export type CommandExecutionRequestApprovalParams__CommandAction = | { readonly command: string; readonly name: string; - readonly path: V2ThreadForkResponse__AbsolutePathBuf; + readonly path: CommandExecutionRequestApprovalParams__LegacyAppPathString; readonly type: "read"; } | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } @@ -15891,12 +17376,12 @@ export type V2ThreadForkResponse__CommandAction = readonly type: "search"; } | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadForkResponse__CommandAction = Schema.Union( +export const CommandExecutionRequestApprovalParams__CommandAction = Schema.Union( [ Schema.Struct({ command: Schema.String, name: Schema.String, - path: V2ThreadForkResponse__AbsolutePathBuf, + path: CommandExecutionRequestApprovalParams__LegacyAppPathString, type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), }).annotate({ title: "ReadCommandAction" }), Schema.Struct({ @@ -15916,383 +17401,473 @@ export const V2ThreadForkResponse__CommandAction = Schema.Union( }).annotate({ title: "UnknownCommandAction" }), ], { mode: "oneOf" }, -); - -export type V2ThreadForkResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadForkResponse__CollabAgentStatus; -}; -export const V2ThreadForkResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadForkResponse__CollabAgentStatus, -}); - -export type V2ThreadForkResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; -}; -export const V2ThreadForkResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadForkResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +).annotate({ identifier: "CommandExecutionRequestApprovalParams__CommandAction" }); -export type V2ThreadForkResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "rateLimitExceeded" - | "misalignmentPolicyViolation" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } +export type CommandExecutionRequestApprovalParams__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadForkResponse__NonSteerableTurnKind; - }; + readonly kind: "project_roots"; + readonly subpath?: CommandExecutionRequestApprovalParams__LegacyAppPathString | null; + } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { + readonly kind: "unknown"; + readonly path: string; + readonly subpath?: CommandExecutionRequestApprovalParams__LegacyAppPathString | null; }; -export const V2ThreadForkResponse__CodexErrorInfo = Schema.Union( +export const CommandExecutionRequestApprovalParams__FileSystemSpecialPath = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "rateLimitExceeded", - "misalignmentPolicyViolation", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", }), - Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", }), Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey( + Schema.Union([CommandExecutionRequestApprovalParams__LegacyAppPathString, Schema.Null]), + ), + }).annotate({ title: "KindFileSystemSpecialPath" }), + Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ + title: "TmpdirFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ + title: "SlashTmpFileSystemSpecialPath", }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadForkResponse__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + kind: Schema.Literal("unknown"), + path: Schema.String, + subpath: Schema.optionalKey( + Schema.Union([CommandExecutionRequestApprovalParams__LegacyAppPathString, Schema.Null]), + ), }), ], { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); +).annotate({ identifier: "CommandExecutionRequestApprovalParams__FileSystemSpecialPath" }); -export type V2ThreadForkResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadForkResponse__PatchChangeKind; - readonly path: string; +export type CommandExecutionRequestApprovalParams__NetworkApprovalContext = { + readonly host: string; + readonly protocol: CommandExecutionRequestApprovalParams__NetworkApprovalProtocol; }; -export const V2ThreadForkResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadForkResponse__PatchChangeKind, - path: Schema.String, -}); +export const CommandExecutionRequestApprovalParams__NetworkApprovalContext = Schema.Struct({ + host: Schema.String, + protocol: CommandExecutionRequestApprovalParams__NetworkApprovalProtocol, +}).annotate({ identifier: "CommandExecutionRequestApprovalParams__NetworkApprovalContext" }); -export type V2ThreadForkResponse__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ThreadForkResponse__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: V2ThreadForkResponse__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadForkResponse__UserInput = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ThreadForkResponse__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), - ], - { mode: "oneOf" }, -); +export type CommandExecutionRequestApprovalParams__NetworkPolicyAmendment = { + readonly action: CommandExecutionRequestApprovalParams__NetworkPolicyRuleAction; + readonly host: string; +}; +export const CommandExecutionRequestApprovalParams__NetworkPolicyAmendment = Schema.Struct({ + action: CommandExecutionRequestApprovalParams__NetworkPolicyRuleAction, + host: Schema.String, +}).annotate({ identifier: "CommandExecutionRequestApprovalParams__NetworkPolicyAmendment" }); -export type V2ThreadForkResponse__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadForkResponse__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadForkResponse__ThreadId; - }; - } - | { readonly other: string }; -export const V2ThreadForkResponse__SubAgentSource = Schema.Union( - [ - Schema.Literals(["review", "compact", "memory_consolidation"]), - Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadForkResponse__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), - ], - { mode: "oneOf" }, -); +export type CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment = { + readonly action: CommandExecutionRequestApprovalResponse__NetworkPolicyRuleAction; + readonly host: string; +}; +export const CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment = Schema.Struct({ + action: CommandExecutionRequestApprovalResponse__NetworkPolicyRuleAction, + host: Schema.String, +}).annotate({ identifier: "CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment" }); -export type V2ThreadGoalGetResponse__ThreadGoal = { - readonly createdAt: number; - readonly objective: string; - readonly status: V2ThreadGoalGetResponse__ThreadGoalStatus; - readonly threadId: string; - readonly timeUsedSeconds: number; - readonly tokenBudget?: number | null; - readonly tokensUsed: number; - readonly updatedAt: number; +export type ExecCommandApprovalResponse__NetworkPolicyAmendment = { + readonly action: ExecCommandApprovalResponse__NetworkPolicyRuleAction; + readonly host: string; }; -export const V2ThreadGoalGetResponse__ThreadGoal = Schema.Struct({ - createdAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - objective: Schema.String, - status: V2ThreadGoalGetResponse__ThreadGoalStatus, - threadId: Schema.String, - timeUsedSeconds: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - tokenBudget: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), +export const ExecCommandApprovalResponse__NetworkPolicyAmendment = Schema.Struct({ + action: ExecCommandApprovalResponse__NetworkPolicyRuleAction, + host: Schema.String, +}).annotate({ identifier: "ExecCommandApprovalResponse__NetworkPolicyAmendment" }); + +export type FuzzyFileSearchResponse__FuzzyFileSearchResult = { + readonly file_name: string; + readonly indices?: ReadonlyArray | null; + readonly match_type: FuzzyFileSearchResponse__FuzzyFileSearchMatchType; + readonly path: string; + readonly root: string; + readonly score: number; +}; +export const FuzzyFileSearchResponse__FuzzyFileSearchResult = Schema.Struct({ + file_name: Schema.String, + indices: Schema.optionalKey( + Schema.Union([ + Schema.Array( + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + ), + Schema.Null, + ]), ), - tokensUsed: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updatedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + match_type: FuzzyFileSearchResponse__FuzzyFileSearchMatchType, + path: Schema.String, + root: Schema.String, + score: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ + description: "Superset of [`codex_file_search::FileMatch`]", + identifier: "FuzzyFileSearchResponse__FuzzyFileSearchResult", }); -export type V2ThreadGoalSetResponse__ThreadGoal = { - readonly createdAt: number; - readonly objective: string; - readonly status: V2ThreadGoalSetResponse__ThreadGoalStatus; - readonly threadId: string; - readonly timeUsedSeconds: number; - readonly tokenBudget?: number | null; - readonly tokensUsed: number; - readonly updatedAt: number; +export type FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchResult = { + readonly file_name: string; + readonly indices?: ReadonlyArray | null; + readonly match_type: FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchMatchType; + readonly path: string; + readonly root: string; + readonly score: number; }; -export const V2ThreadGoalSetResponse__ThreadGoal = Schema.Struct({ - createdAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - objective: Schema.String, - status: V2ThreadGoalSetResponse__ThreadGoalStatus, - threadId: Schema.String, - timeUsedSeconds: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - tokenBudget: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), +export const FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchResult = Schema.Struct({ + file_name: Schema.String, + indices: Schema.optionalKey( + Schema.Union([ + Schema.Array( + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + ), + Schema.Null, + ]), ), - tokensUsed: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updatedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + match_type: FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchMatchType, + path: Schema.String, + root: Schema.String, + score: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ + description: "Superset of [`codex_file_search::FileMatch`]", + identifier: "FuzzyFileSearchSessionUpdatedNotification__FuzzyFileSearchResult", }); -export type V2ThreadGoalUpdatedNotification__ThreadGoal = { - readonly createdAt: number; - readonly objective: string; - readonly status: V2ThreadGoalUpdatedNotification__ThreadGoalStatus; - readonly threadId: string; - readonly timeUsedSeconds: number; - readonly tokenBudget?: number | null; - readonly tokensUsed: number; - readonly updatedAt: number; +export type JSONRPCMessage__JSONRPCResponse = { + readonly id: JSONRPCMessage__RequestId; + readonly result: Schema.Json; }; -export const V2ThreadGoalUpdatedNotification__ThreadGoal = Schema.Struct({ - createdAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - objective: Schema.String, - status: V2ThreadGoalUpdatedNotification__ThreadGoalStatus, - threadId: Schema.String, - timeUsedSeconds: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - tokenBudget: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), +export const JSONRPCMessage__JSONRPCResponse = Schema.Struct({ + id: JSONRPCMessage__RequestId, + result: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ + description: "A successful (non-error) response to a request.", + identifier: "JSONRPCMessage__JSONRPCResponse", +}); + +export type JSONRPCMessage__JSONRPCRequest = { + readonly id: JSONRPCMessage__RequestId; + readonly method: string; + readonly params?: Schema.Json; + readonly trace?: JSONRPCMessage__W3cTraceContext | null; +}; +export const JSONRPCMessage__JSONRPCRequest = Schema.Struct({ + id: JSONRPCMessage__RequestId, + method: Schema.String, + params: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + trace: Schema.optionalKey( + Schema.Union([JSONRPCMessage__W3cTraceContext, Schema.Null]).annotate({ + description: "Optional W3C Trace Context for distributed tracing.", + }), ), - tokensUsed: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - updatedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), +}).annotate({ + description: "A request that expects a response.", + identifier: "JSONRPCMessage__JSONRPCRequest", }); -export type V2ThreadListResponse__CommandAction = +export type JSONRPCMessage__JSONRPCError = { + readonly error: JSONRPCMessage__JSONRPCErrorError; + readonly id: JSONRPCMessage__RequestId; +}; +export const JSONRPCMessage__JSONRPCError = Schema.Struct({ + error: JSONRPCMessage__JSONRPCErrorError, + id: JSONRPCMessage__RequestId, +}).annotate({ + description: "A response to a request that indicates an error occurred.", + identifier: "JSONRPCMessage__JSONRPCError", +}); + +export type McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema = { + readonly default?: string | null; + readonly description?: string | null; + readonly enum: ReadonlyArray; + readonly title?: string | null; + readonly type: McpServerElicitationRequestParams__McpElicitationStringType; +}; +export const McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema = + Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + enum: Schema.Array(Schema.String), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: McpServerElicitationRequestParams__McpElicitationStringType, + }).annotate({ + identifier: "McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema", + }); + +export type McpServerElicitationRequestParams__McpElicitationUntitledEnumItems = { + readonly enum: ReadonlyArray; + readonly type: McpServerElicitationRequestParams__McpElicitationStringType; +}; +export const McpServerElicitationRequestParams__McpElicitationUntitledEnumItems = Schema.Struct({ + enum: Schema.Array(Schema.String), + type: McpServerElicitationRequestParams__McpElicitationStringType, +}).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationUntitledEnumItems" }); + +export type McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema = { + readonly default?: string | null; + readonly description?: string | null; + readonly enum: ReadonlyArray; + readonly enumNames?: ReadonlyArray | null; + readonly title?: string | null; + readonly type: McpServerElicitationRequestParams__McpElicitationStringType; +}; +export const McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema = + Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + enum: Schema.Array(Schema.String), + enumNames: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: McpServerElicitationRequestParams__McpElicitationStringType, + }).annotate({ + identifier: "McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema", + }); + +export type McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema = { + readonly default?: string | null; + readonly description?: string | null; + readonly oneOf: ReadonlyArray; + readonly title?: string | null; + readonly type: McpServerElicitationRequestParams__McpElicitationStringType; +}; +export const McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema = + Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + oneOf: Schema.Array(McpServerElicitationRequestParams__McpElicitationConstOption), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: McpServerElicitationRequestParams__McpElicitationStringType, + }).annotate({ + identifier: "McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema", + }); + +export type McpServerElicitationRequestParams__McpElicitationTitledEnumItems = { + readonly anyOf: ReadonlyArray; +}; +export const McpServerElicitationRequestParams__McpElicitationTitledEnumItems = Schema.Struct({ + anyOf: Schema.Array(McpServerElicitationRequestParams__McpElicitationConstOption), +}).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationTitledEnumItems" }); + +export type McpServerElicitationRequestParams__McpElicitationStringSchema = { + readonly default?: string | null; + readonly description?: string | null; + readonly format?: McpServerElicitationRequestParams__McpElicitationStringFormat | null; + readonly maxLength?: number | null; + readonly minLength?: number | null; + readonly title?: string | null; + readonly type: McpServerElicitationRequestParams__McpElicitationStringType; +}; +export const McpServerElicitationRequestParams__McpElicitationStringSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + format: Schema.optionalKey( + Schema.Union([McpServerElicitationRequestParams__McpElicitationStringFormat, Schema.Null]), + ), + maxLength: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + minLength: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: McpServerElicitationRequestParams__McpElicitationStringType, +}).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationStringSchema" }); + +export type McpServerElicitationRequestParams__McpElicitationNumberSchema = { + readonly default?: number | null; + readonly description?: string | null; + readonly maximum?: number | null; + readonly minimum?: number | null; + readonly title?: string | null; + readonly type: McpServerElicitationRequestParams__McpElicitationNumberType; +}; +export const McpServerElicitationRequestParams__McpElicitationNumberSchema = Schema.Struct({ + default: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "double" }).check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.Null, + ]), + ), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + maximum: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "double" }).check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.Null, + ]), + ), + minimum: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "double" }).check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.Null, + ]), + ), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: McpServerElicitationRequestParams__McpElicitationNumberType, +}).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationNumberSchema" }); + +export type McpServerElicitationRequestParams__McpElicitationBooleanSchema = { + readonly default?: boolean | null; + readonly description?: string | null; + readonly title?: string | null; + readonly type: McpServerElicitationRequestParams__McpElicitationBooleanType; +}; +export const McpServerElicitationRequestParams__McpElicitationBooleanSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: McpServerElicitationRequestParams__McpElicitationBooleanType, +}).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationBooleanSchema" }); + +export type PermissionsRequestApprovalParams__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } | { - readonly command: string; - readonly name: string; - readonly path: V2ThreadListResponse__AbsolutePathBuf; - readonly type: "read"; + readonly kind: "project_roots"; + readonly subpath?: PermissionsRequestApprovalParams__LegacyAppPathString | null; } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadListResponse__CommandAction = Schema.Union( + readonly kind: "unknown"; + readonly path: string; + readonly subpath?: PermissionsRequestApprovalParams__LegacyAppPathString | null; + }; +export const PermissionsRequestApprovalParams__FileSystemSpecialPath = Schema.Union( [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2ThreadListResponse__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey( + Schema.Union([PermissionsRequestApprovalParams__LegacyAppPathString, Schema.Null]), + ), + }).annotate({ title: "KindFileSystemSpecialPath" }), + Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ + title: "TmpdirFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ + title: "SlashTmpFileSystemSpecialPath", + }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + kind: Schema.Literal("unknown"), + path: Schema.String, + subpath: Schema.optionalKey( + Schema.Union([PermissionsRequestApprovalParams__LegacyAppPathString, Schema.Null]), + ), + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "PermissionsRequestApprovalParams__FileSystemSpecialPath" }); + +export type PermissionsRequestApprovalResponse__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { + readonly kind: "project_roots"; + readonly subpath?: PermissionsRequestApprovalResponse__LegacyAppPathString | null; + } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { + readonly kind: "unknown"; + readonly path: string; + readonly subpath?: PermissionsRequestApprovalResponse__LegacyAppPathString | null; + }; +export const PermissionsRequestApprovalResponse__FileSystemSpecialPath = Schema.Union( + [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey( + Schema.Union([PermissionsRequestApprovalResponse__LegacyAppPathString, Schema.Null]), + ), + }).annotate({ title: "KindFileSystemSpecialPath" }), + Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ + title: "TmpdirFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ + title: "SlashTmpFileSystemSpecialPath", + }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + kind: Schema.Literal("unknown"), + path: Schema.String, + subpath: Schema.optionalKey( + Schema.Union([PermissionsRequestApprovalResponse__LegacyAppPathString, Schema.Null]), + ), + }), ], { mode: "oneOf" }, -); - -export type V2ThreadListResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadListResponse__CollabAgentStatus; -}; -export const V2ThreadListResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadListResponse__CollabAgentStatus, -}); - -export type V2ThreadListResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; -}; -export const V2ThreadListResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadListResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +).annotate({ identifier: "PermissionsRequestApprovalResponse__FileSystemSpecialPath" }); -export type V2ThreadListResponse__CodexErrorInfo = +export type ServerNotification__CodexErrorInfo = | "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" | "serverOverloaded" | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" @@ -16305,17 +17880,21 @@ export type V2ThreadListResponse__CodexErrorInfo = | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } | { readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadListResponse__NonSteerableTurnKind; + readonly turnKind: ServerNotification__NonSteerableTurnKind; }; }; -export const V2ThreadListResponse__CodexErrorInfo = Schema.Union( +export const ServerNotification__CodexErrorInfo = Schema.Union( [ Schema.Literals([ "contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", "serverOverloaded", "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", "internalServerError", "unauthorized", "badRequest", @@ -16328,8 +17907,12 @@ export const V2ThreadListResponse__CodexErrorInfo = Schema.Union( httpStatusCode: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -16340,8 +17923,12 @@ export const V2ThreadListResponse__CodexErrorInfo = Schema.Union( httpStatusCode: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -16355,8 +17942,12 @@ export const V2ThreadListResponse__CodexErrorInfo = Schema.Union( httpStatusCode: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -16371,8 +17962,12 @@ export const V2ThreadListResponse__CodexErrorInfo = Schema.Union( httpStatusCode: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -16382,9 +17977,7 @@ export const V2ThreadListResponse__CodexErrorInfo = Schema.Union( description: "Reached the retry limit for responses.", }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadListResponse__NonSteerableTurnKind, - }), + activeTurnNotSteerable: Schema.Struct({ turnKind: ServerNotification__NonSteerableTurnKind }), }).annotate({ title: "ActiveTurnNotSteerableCodexErrorInfo", description: @@ -16395,403 +17988,243 @@ export const V2ThreadListResponse__CodexErrorInfo = Schema.Union( ).annotate({ description: "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "ServerNotification__CodexErrorInfo", }); -export type V2ThreadListResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadListResponse__PatchChangeKind; - readonly path: string; +export type ServerNotification__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: ServerNotification__MisalignmentSteer | null; }; -export const V2ThreadListResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadListResponse__PatchChangeKind, - path: Schema.String, -}); - -export type V2ThreadListResponse__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ThreadListResponse__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: V2ThreadListResponse__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadListResponse__UserInput = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ThreadListResponse__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), - ], - { mode: "oneOf" }, -); +export const ServerNotification__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([ServerNotification__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "ServerNotification__MisalignmentErrorDetails" }); -export type V2ThreadListResponse__SubAgentSource = +export type ServerNotification__FsChangedNotification = { + readonly changedPaths: ReadonlyArray; + readonly watchId: string; +}; +export const ServerNotification__FsChangedNotification = Schema.Struct({ + changedPaths: Schema.Array(ServerNotification__AbsolutePathBuf).annotate({ + description: "File or directory paths associated with this event.", + }), + watchId: Schema.String.annotate({ + description: "Watch identifier previously provided to `fs/watch`.", + }), +}).annotate({ + description: "Filesystem watch notification emitted for `fs/watch` subscribers.", + identifier: "ServerNotification__FsChangedNotification", +}); + +export type ServerNotification__Settings = { + readonly developer_instructions?: string | null; + readonly model: string; + readonly reasoning_effort?: ServerNotification__ReasoningEffort | null; +}; +export const ServerNotification__Settings = Schema.Struct({ + developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + model: Schema.String, + reasoning_effort: Schema.optionalKey( + Schema.Union([ServerNotification__ReasoningEffort, Schema.Null]), + ), +}).annotate({ + description: "Settings for a collaboration mode.", + identifier: "ServerNotification__Settings", +}); + +export type ServerNotification__ThreadSection = { + readonly appearance?: ServerNotification__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const ServerNotification__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([ServerNotification__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "ServerNotification__ThreadSection", +}); + +export type ServerNotification__SubAgentSource = | "review" | "compact" | "memory_consolidation" | { readonly thread_spawn: { readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadListResponse__AgentPath | null; + readonly agent_path?: ServerNotification__AgentPath | null; readonly agent_role?: string | null; readonly depth: number; - readonly parent_thread_id: V2ThreadListResponse__ThreadId; + readonly parent_thread_id: ServerNotification__ThreadId; }; } | { readonly other: string }; -export const V2ThreadListResponse__SubAgentSource = Schema.Union( +export const ServerNotification__SubAgentSource = Schema.Union( [ Schema.Literals(["review", "compact", "memory_consolidation"]), Schema.Struct({ thread_spawn: Schema.Struct({ agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__AgentPath, Schema.Null]), - ), + agent_path: Schema.optionalKey(Schema.Union([ServerNotification__AgentPath, Schema.Null])), agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadListResponse__ThreadId, + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: ServerNotification__ThreadId, }), }).annotate({ title: "ThreadSpawnSubAgentSource" }), Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "ServerNotification__SubAgentSource" }); -export type V2ThreadMetadataUpdateResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: V2ThreadMetadataUpdateResponse__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } +export type ServerNotification__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadMetadataUpdateResponse__CommandAction = Schema.Union( + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const ServerNotification__ThreadStatus = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2ThreadMetadataUpdateResponse__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + activeFlags: Schema.Array(ServerNotification__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), ], { mode: "oneOf" }, -); - -export type V2ThreadMetadataUpdateResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadMetadataUpdateResponse__CollabAgentStatus; -}; -export const V2ThreadMetadataUpdateResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadMetadataUpdateResponse__CollabAgentStatus, -}); +).annotate({ identifier: "ServerNotification__ThreadStatus" }); -export type V2ThreadMetadataUpdateResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; +export type ServerNotification__TextElement = { + readonly byteRange: ServerNotification__ByteRange; + readonly placeholder?: string | null; }; -export const V2ThreadMetadataUpdateResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadMetadataUpdateResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +export const ServerNotification__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => ServerNotification__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ServerNotification__TextElement" }); -export type V2ThreadMetadataUpdateResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } +export type ServerNotification__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadMetadataUpdateResponse__NonSteerableTurnKind; - }; - }; -export const V2ThreadMetadataUpdateResponse__CodexErrorInfo = Schema.Union( + readonly detail?: ServerNotification__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: ServerNotification__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const ServerNotification__FunctionCallOutputContentItem = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadMetadataUpdateResponse__NonSteerableTurnKind, + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", - }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), ], { mode: "oneOf" }, ).annotate({ description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "ServerNotification__FunctionCallOutputContentItem", }); -export type V2ThreadMetadataUpdateResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadMetadataUpdateResponse__PatchChangeKind; - readonly path: string; +export type ServerNotification__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; }; -export const V2ThreadMetadataUpdateResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadMetadataUpdateResponse__PatchChangeKind, - path: Schema.String, -}); - -export type V2ThreadMetadataUpdateResponse__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ThreadMetadataUpdateResponse__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: V2ThreadMetadataUpdateResponse__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadMetadataUpdateResponse__UserInput = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ThreadMetadataUpdateResponse__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null]), - ), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null]), - ), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadMetadataUpdateResponse__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadMetadataUpdateResponse__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadMetadataUpdateResponse__ThreadId; - }; - } - | { readonly other: string }; -export const V2ThreadMetadataUpdateResponse__SubAgentSource = Schema.Union( - [ - Schema.Literals(["review", "compact", "memory_consolidation"]), - Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadMetadataUpdateResponse__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), - ], - { mode: "oneOf" }, -); +export const ServerNotification__MemoryCitation = Schema.Struct({ + entries: Schema.Array(ServerNotification__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "ServerNotification__MemoryCitation" }); -export type V2ThreadReadResponse__CommandAction = +export type ServerNotification__CommandAction = | { readonly command: string; readonly name: string; - readonly path: V2ThreadReadResponse__AbsolutePathBuf; + readonly path: ServerNotification__LegacyAppPathString; readonly type: "read"; } | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } @@ -16802,12 +18235,12 @@ export type V2ThreadReadResponse__CommandAction = readonly type: "search"; } | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadReadResponse__CommandAction = Schema.Union( +export const ServerNotification__CommandAction = Schema.Union( [ Schema.Struct({ command: Schema.String, name: Schema.String, - path: V2ThreadReadResponse__AbsolutePathBuf, + path: ServerNotification__LegacyAppPathString, type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), }).annotate({ title: "ReadCommandAction" }), Schema.Struct({ @@ -16827,328 +18260,693 @@ export const V2ThreadReadResponse__CommandAction = Schema.Union( }).annotate({ title: "UnknownCommandAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "ServerNotification__CommandAction" }); -export type V2ThreadReadResponse__CollabAgentState = { +export type ServerNotification__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { + readonly kind: "project_roots"; + readonly subpath?: ServerNotification__LegacyAppPathString | null; + } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { + readonly kind: "unknown"; + readonly path: string; + readonly subpath?: ServerNotification__LegacyAppPathString | null; + }; +export const ServerNotification__FileSystemSpecialPath = Schema.Union( + [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey( + Schema.Union([ServerNotification__LegacyAppPathString, Schema.Null]), + ), + }).annotate({ title: "KindFileSystemSpecialPath" }), + Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ + title: "TmpdirFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ + title: "SlashTmpFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("unknown"), + path: Schema.String, + subpath: Schema.optionalKey( + Schema.Union([ServerNotification__LegacyAppPathString, Schema.Null]), + ), + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__FileSystemSpecialPath" }); + +export type ServerNotification__FileUpdateChange = { + readonly diff: string; + readonly kind: ServerNotification__PatchChangeKind; + readonly path: string; +}; +export const ServerNotification__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: ServerNotification__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "ServerNotification__FileUpdateChange" }); + +export type ServerNotification__McpAppUi = { + readonly preferredModelDisplayMode: ServerNotification__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const ServerNotification__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: ServerNotification__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "ServerNotification__McpAppUi", +}); + +export type ServerNotification__CollabAgentState = { readonly message?: string | null; - readonly status: V2ThreadReadResponse__CollabAgentStatus; + readonly status: ServerNotification__CollabAgentStatus; }; -export const V2ThreadReadResponse__CollabAgentState = Schema.Struct({ +export const ServerNotification__CollabAgentState = Schema.Struct({ message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadReadResponse__CollabAgentStatus, -}); + status: ServerNotification__CollabAgentStatus, +}).annotate({ identifier: "ServerNotification__CollabAgentState" }); -export type V2ThreadReadResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; +export type ServerNotification__ThreadAttachmentUpdatedNotification = { + readonly attachmentId: string; + readonly attachmentType: string; + readonly identityKey: string; + readonly operation: ServerNotification__ThreadAttachmentOperation; + readonly threadId: string; }; -export const V2ThreadReadResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadReadResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), +export const ServerNotification__ThreadAttachmentUpdatedNotification = Schema.Struct({ + attachmentId: Schema.String, + attachmentType: Schema.String, + identityKey: Schema.String, + operation: ServerNotification__ThreadAttachmentOperation, + threadId: Schema.String, +}).annotate({ + description: "Notification published after a thread attachment is created or deleted.", + identifier: "ServerNotification__ThreadAttachmentUpdatedNotification", }); -export type V2ThreadReadResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "rateLimitExceeded" - | "misalignmentPolicyViolation" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } +export type ServerNotification__ThreadGoal = { + readonly createdAt: number; + readonly objective: string; + readonly status: ServerNotification__ThreadGoalStatus; + readonly threadId: string; + readonly timeUsedSeconds: number; + readonly tokenBudget?: number | null; + readonly tokensUsed: number; + readonly updatedAt: number; +}; +export const ServerNotification__ThreadGoal = Schema.Struct({ + createdAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + objective: Schema.String, + status: ServerNotification__ThreadGoalStatus, + threadId: Schema.String, + timeUsedSeconds: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + tokenBudget: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + tokensUsed: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + updatedAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +}).annotate({ identifier: "ServerNotification__ThreadGoal" }); + +export type ServerNotification__ProjectChangedNotification = { + readonly changeType: ServerNotification__ProjectChangeType; + readonly projectId: string; +}; +export const ServerNotification__ProjectChangedNotification = Schema.Struct({ + changeType: ServerNotification__ProjectChangeType, + projectId: Schema.String, +}).annotate({ identifier: "ServerNotification__ProjectChangedNotification" }); + +export type ServerNotification__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { readonly networkAccess?: boolean; readonly type: "readOnly" } + | { readonly networkAccess?: ServerNotification__NetworkAccess; readonly type: "externalSandbox" } | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadReadResponse__NonSteerableTurnKind; - }; + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly type: "workspaceWrite"; + readonly writableRoots?: ReadonlyArray; }; -export const V2ThreadReadResponse__CodexErrorInfo = Schema.Union( +export const ServerNotification__SandboxPolicy = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "rateLimitExceeded", - "misalignmentPolicyViolation", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + type: Schema.Literal("dangerFullAccess").annotate({ + title: "DangerFullAccessSandboxPolicyType", }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), + }).annotate({ title: "DangerFullAccessSandboxPolicy" }), Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), + }).annotate({ title: "ReadOnlySandboxPolicy" }), Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + networkAccess: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => ServerNotification__NetworkAccess, + ).annotate({ default: "restricted" }), + ), + type: Schema.Literal("externalSandbox").annotate({ + title: "ExternalSandboxSandboxPolicyType", }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), + }).annotate({ title: "ExternalSandboxSandboxPolicy" }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadReadResponse__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", - }), + excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), + writableRoots: Schema.optionalKey( + Schema.Array(ServerNotification__AbsolutePathBuf).annotate({ default: [] }), + ), + }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), ], { mode: "oneOf" }, -).annotate({ +).annotate({ identifier: "ServerNotification__SandboxPolicy" }); + +export type ServerNotification__ThreadTokenUsage = { + readonly last: ServerNotification__TokenUsageBreakdown; + readonly modelContextWindow?: number | null; + readonly total: ServerNotification__TokenUsageBreakdown; +}; +export const ServerNotification__ThreadTokenUsage = Schema.Struct({ + last: ServerNotification__TokenUsageBreakdown, + modelContextWindow: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + total: ServerNotification__TokenUsageBreakdown, +}).annotate({ identifier: "ServerNotification__ThreadTokenUsage" }); + +export type ServerNotification__HookOutputEntry = { + readonly kind: ServerNotification__HookOutputEntryKind; + readonly text: string; +}; +export const ServerNotification__HookOutputEntry = Schema.Struct({ + kind: ServerNotification__HookOutputEntryKind, + text: Schema.String, +}).annotate({ identifier: "ServerNotification__HookOutputEntry" }); + +export type ServerNotification__TurnPlanStep = { + readonly status: ServerNotification__TurnPlanStepStatus; + readonly step: string; +}; +export const ServerNotification__TurnPlanStep = Schema.Struct({ + status: ServerNotification__TurnPlanStepStatus, + step: Schema.String, +}).annotate({ identifier: "ServerNotification__TurnPlanStep" }); + +export type ServerNotification__GuardianApprovalReview = { + readonly rationale?: string | null; + readonly riskLevel?: ServerNotification__GuardianRiskLevel | null; + readonly status: ServerNotification__GuardianApprovalReviewStatus; + readonly userAuthorization?: ServerNotification__GuardianUserAuthorization | null; +}; +export const ServerNotification__GuardianApprovalReview = Schema.Struct({ + rationale: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + riskLevel: Schema.optionalKey(Schema.Union([ServerNotification__GuardianRiskLevel, Schema.Null])), + status: ServerNotification__GuardianApprovalReviewStatus, + userAuthorization: Schema.optionalKey( + Schema.Union([ServerNotification__GuardianUserAuthorization, Schema.Null]), + ), +}).annotate({ description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + identifier: "ServerNotification__GuardianApprovalReview", }); -export type V2ThreadReadResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadReadResponse__PatchChangeKind; +export type ServerNotification__CommandExecOutputDeltaNotification = { + readonly capReached: boolean; + readonly deltaBase64: string; + readonly processId: string; + readonly stream: ServerNotification__CommandExecOutputStream; +}; +export const ServerNotification__CommandExecOutputDeltaNotification = Schema.Struct({ + capReached: Schema.Boolean.annotate({ + description: + "`true` on the final streamed chunk for a stream when `outputBytesCap` truncated later output on that stream.", + }), + deltaBase64: Schema.String.annotate({ description: "Base64-encoded output bytes." }), + processId: Schema.String.annotate({ + description: + "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + }), + stream: Schema.suspend( + (): Schema.Codec => + ServerNotification__CommandExecOutputStream, + ).annotate({ description: "Output stream for this chunk." }), +}).annotate({ + description: + "Base64-encoded output chunk emitted for a streaming `command/exec` request.\n\nThese notifications are connection-scoped. If the originating connection closes, the server terminates the process.", + identifier: "ServerNotification__CommandExecOutputDeltaNotification", +}); + +export type ServerNotification__ProcessOutputDeltaNotification = { + readonly capReached: boolean; + readonly deltaBase64: string; + readonly processHandle: string; + readonly stream: ServerNotification__ProcessOutputStream; +}; +export const ServerNotification__ProcessOutputDeltaNotification = Schema.Struct({ + capReached: Schema.Boolean.annotate({ + description: + "True on the final streamed chunk for this stream when output was truncated by `outputBytesCap`.", + }), + deltaBase64: Schema.String.annotate({ description: "Base64-encoded output bytes." }), + processHandle: Schema.String.annotate({ + description: "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + }), + stream: Schema.suspend( + (): Schema.Codec => + ServerNotification__ProcessOutputStream, + ).annotate({ description: "Output stream this chunk belongs to." }), +}).annotate({ + description: "Base64-encoded output chunk emitted for a streaming `process/spawn` request.", + identifier: "ServerNotification__ProcessOutputDeltaNotification", +}); + +export type ServerNotification__ServerRequestResolvedNotification = { + readonly requestId: ServerNotification__RequestId; + readonly threadId: string; +}; +export const ServerNotification__ServerRequestResolvedNotification = Schema.Struct({ + requestId: ServerNotification__RequestId, + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ServerRequestResolvedNotification" }); + +export type ServerNotification__McpServerStatusUpdatedNotification = { + readonly error?: string | null; + readonly failureReason?: ServerNotification__McpServerStartupFailureReason | null; + readonly name: string; + readonly status: ServerNotification__McpServerStartupState; + readonly threadId?: string | null; +}; +export const ServerNotification__McpServerStatusUpdatedNotification = Schema.Struct({ + error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + failureReason: Schema.optionalKey( + Schema.Union([ServerNotification__McpServerStartupFailureReason, Schema.Null]), + ), + name: Schema.String, + status: ServerNotification__McpServerStartupState, + threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__McpServerStatusUpdatedNotification" }); + +export type ServerNotification__McpServerEventStreamNotification = { + readonly notification: ServerNotification__McpServerEventNotification; + readonly subscriptionId: string; +}; +export const ServerNotification__McpServerEventStreamNotification = Schema.Struct({ + notification: ServerNotification__McpServerEventNotification, + subscriptionId: Schema.String, +}).annotate({ identifier: "ServerNotification__McpServerEventStreamNotification" }); + +export type ServerNotification__AccountUpdatedNotification = { + readonly authMode?: ServerNotification__AuthMode | null; + readonly planType?: ServerNotification__PlanType | null; +}; +export const ServerNotification__AccountUpdatedNotification = Schema.Struct({ + authMode: Schema.optionalKey(Schema.Union([ServerNotification__AuthMode, Schema.Null])), + planType: Schema.optionalKey(Schema.Union([ServerNotification__PlanType, Schema.Null])), +}).annotate({ identifier: "ServerNotification__AccountUpdatedNotification" }); + +export type ServerNotification__GatewayOAuthChangedNotification = { + readonly authUrl?: string | null; + readonly error?: string | null; + readonly providerId: string; + readonly status: ServerNotification__GatewayOAuthStatus; +}; +export const ServerNotification__GatewayOAuthChangedNotification = Schema.Struct({ + authUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Authorization handoff, sent only to the connection that started login.", + }), + Schema.Null, + ]), + ), + error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + providerId: Schema.String, + status: ServerNotification__GatewayOAuthStatus, +}).annotate({ identifier: "ServerNotification__GatewayOAuthChangedNotification" }); + +export type ServerNotification__RateLimitSnapshot = { + readonly credits?: ServerNotification__CreditsSnapshot | null; + readonly individualLimit?: ServerNotification__SpendControlLimitSnapshot | null; + readonly limitId?: string | null; + readonly limitName?: string | null; + readonly normalModelSlug?: string | null; + readonly planType?: ServerNotification__PlanType | null; + readonly primary?: ServerNotification__RateLimitWindow | null; + readonly rateLimitReachedType?: ServerNotification__RateLimitReachedType | null; + readonly secondary?: ServerNotification__RateLimitWindow | null; + readonly spendControlReached?: boolean | null; +}; +export const ServerNotification__RateLimitSnapshot = Schema.Struct({ + credits: Schema.optionalKey(Schema.Union([ServerNotification__CreditsSnapshot, Schema.Null])), + individualLimit: Schema.optionalKey( + Schema.Union([ServerNotification__SpendControlLimitSnapshot, Schema.Null]), + ), + limitId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + limitName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + normalModelSlug: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Normal model whose display name and reasoning options describe this quota alias.", + }), + Schema.Null, + ]), + ), + planType: Schema.optionalKey(Schema.Union([ServerNotification__PlanType, Schema.Null])), + primary: Schema.optionalKey(Schema.Union([ServerNotification__RateLimitWindow, Schema.Null])), + rateLimitReachedType: Schema.optionalKey( + Schema.Union([ServerNotification__RateLimitReachedType, Schema.Null]), + ), + secondary: Schema.optionalKey(Schema.Union([ServerNotification__RateLimitWindow, Schema.Null])), + spendControlReached: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: + "Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ServerNotification__RateLimitSnapshot" }); + +export type ServerNotification__AppMetadata = { + readonly categories?: ReadonlyArray | null; + readonly developer?: string | null; + readonly firstPartyRequiresInstall?: boolean | null; + readonly review?: ServerNotification__AppReview | null; + readonly screenshots?: ReadonlyArray | null; + readonly seoDescription?: string | null; + readonly showInComposerWhenUnlinked?: boolean | null; + readonly subCategories?: ReadonlyArray | null; + readonly version?: string | null; + readonly versionId?: string | null; + readonly versionNotes?: string | null; +}; +export const ServerNotification__AppMetadata = Schema.Struct({ + categories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + developer: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + firstPartyRequiresInstall: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + review: Schema.optionalKey(Schema.Union([ServerNotification__AppReview, Schema.Null])), + screenshots: Schema.optionalKey( + Schema.Union([Schema.Array(ServerNotification__AppScreenshot), Schema.Null]), + ), + seoDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + showInComposerWhenUnlinked: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + subCategories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + version: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + versionId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + versionNotes: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__AppMetadata" }); + +export type ServerNotification__RemoteControlStatusChangedNotification = { + readonly environmentId?: string | null; + readonly installationId: string; + readonly serverName: string; + readonly status: ServerNotification__RemoteControlConnectionStatus; +}; +export const ServerNotification__RemoteControlStatusChangedNotification = Schema.Struct({ + environmentId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + installationId: Schema.String, + serverName: Schema.String, + status: ServerNotification__RemoteControlConnectionStatus, +}).annotate({ + description: "Current remote-control connection status and remote identity exposed to clients.", + identifier: "ServerNotification__RemoteControlStatusChangedNotification", +}); + +export type ServerNotification__ExternalAgentConfigImportItemTypeFailure = { + readonly cwd?: string | null; + readonly errorType?: string | null; + readonly failureStage: string; + readonly itemType: ServerNotification__ExternalAgentConfigMigrationItemType; + readonly message: string; + readonly source?: string | null; + readonly subErrorType?: string | null; +}; +export const ServerNotification__ExternalAgentConfigImportItemTypeFailure = Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + failureStage: Schema.String, + itemType: ServerNotification__ExternalAgentConfigMigrationItemType, + message: Schema.String, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__ExternalAgentConfigImportItemTypeFailure" }); + +export type ServerNotification__ExternalAgentConfigImportItemTypeSuccess = { + readonly cwd?: string | null; + readonly itemType: ServerNotification__ExternalAgentConfigMigrationItemType; + readonly source?: string | null; + readonly target?: string | null; + readonly title?: string | null; +}; +export const ServerNotification__ExternalAgentConfigImportItemTypeSuccess = Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + itemType: ServerNotification__ExternalAgentConfigMigrationItemType, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + title: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Original title for an imported session; null for other item types.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ServerNotification__ExternalAgentConfigImportItemTypeSuccess" }); + +export type ServerNotification__ModelReroutedNotification = { + readonly fromModel: string; + readonly reason: ServerNotification__ModelRerouteReason; + readonly threadId: string; + readonly toModel: string; + readonly turnId: string; +}; +export const ServerNotification__ModelReroutedNotification = Schema.Struct({ + fromModel: Schema.String, + reason: ServerNotification__ModelRerouteReason, + threadId: Schema.String, + toModel: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__ModelReroutedNotification" }); + +export type ServerNotification__ModelVerificationNotification = { + readonly threadId: string; + readonly turnId: string; + readonly verifications: ReadonlyArray; +}; +export const ServerNotification__ModelVerificationNotification = Schema.Struct({ + threadId: Schema.String, + turnId: Schema.String, + verifications: Schema.Array(ServerNotification__ModelVerification), +}).annotate({ identifier: "ServerNotification__ModelVerificationNotification" }); + +export type ServerNotification__TextRange = { + readonly end: ServerNotification__TextPosition; + readonly start: ServerNotification__TextPosition; +}; +export const ServerNotification__TextRange = Schema.Struct({ + end: ServerNotification__TextPosition, + start: ServerNotification__TextPosition, +}).annotate({ identifier: "ServerNotification__TextRange" }); + +export type ServerNotification__FuzzyFileSearchResult = { + readonly file_name: string; + readonly indices?: ReadonlyArray | null; + readonly match_type: ServerNotification__FuzzyFileSearchMatchType; readonly path: string; + readonly root: string; + readonly score: number; }; -export const V2ThreadReadResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadReadResponse__PatchChangeKind, +export const ServerNotification__FuzzyFileSearchResult = Schema.Struct({ + file_name: Schema.String, + indices: Schema.optionalKey( + Schema.Union([ + Schema.Array( + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + ), + Schema.Null, + ]), + ), + match_type: ServerNotification__FuzzyFileSearchMatchType, path: Schema.String, + root: Schema.String, + score: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), +}).annotate({ + description: "Superset of [`codex_file_search::FileMatch`]", + identifier: "ServerNotification__FuzzyFileSearchResult", }); -export type V2ThreadReadResponse__UserInput = +export type ServerNotification__ThreadRealtimeStartedNotification = { + readonly realtimeSessionId?: string | null; + readonly threadId: string; + readonly version: ServerNotification__RealtimeConversationVersion; +}; +export const ServerNotification__ThreadRealtimeStartedNotification = Schema.Struct({ + realtimeSessionId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + threadId: Schema.String, + version: ServerNotification__RealtimeConversationVersion, +}).annotate({ + description: "EXPERIMENTAL - emitted when thread realtime startup is accepted.", + identifier: "ServerNotification__ThreadRealtimeStartedNotification", +}); + +export type ServerNotification__ThreadRealtimeItem = | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; + readonly id: string; + readonly realtimeSessionId: string; + readonly type: "realtimeSessionStarted"; } | { - readonly detail?: V2ThreadReadResponse__ImageDetail | null; - readonly type: "image"; - readonly url: string; + readonly id: string; + readonly realtimeSessionId: string; + readonly role: ServerNotification__ThreadRealtimeTranscriptRole; + readonly text: string; + readonly type: "transcriptSegment"; } | { - readonly detail?: V2ThreadReadResponse__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; + readonly id: string; + readonly realtimeSessionId: string; + readonly item_id: string; + readonly presentation: ServerNotification__ThreadRealtimeBemItemPresentation; + readonly turn_id: string; + readonly type: "bemItemPromoted"; } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadReadResponse__UserInput = Schema.Union( + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly outcome: ServerNotification__ThreadRealtimeSessionOutcome; + readonly type: "realtimeSessionClosed"; + }; +export const ServerNotification__ThreadRealtimeItem = Schema.Union( [ Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ThreadReadResponse__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), + id: Schema.String, + realtimeSessionId: Schema.String, + type: Schema.Literal("realtimeSessionStarted").annotate({ + title: "RealtimeSessionStartedThreadRealtimeItemType", + }), + }).annotate({ title: "RealtimeSessionStartedThreadRealtimeItem" }), Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), + id: Schema.String, + realtimeSessionId: Schema.String, + role: ServerNotification__ThreadRealtimeTranscriptRole, + text: Schema.String, + type: Schema.Literal("transcriptSegment").annotate({ + title: "TranscriptSegmentThreadRealtimeItemType", + }), + }).annotate({ title: "TranscriptSegmentThreadRealtimeItem" }), Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), + id: Schema.String, + realtimeSessionId: Schema.String, + item_id: Schema.String, + presentation: ServerNotification__ThreadRealtimeBemItemPresentation, + turn_id: Schema.String, + type: Schema.Literal("bemItemPromoted").annotate({ + title: "BemItemPromotedThreadRealtimeItemType", + }), + }).annotate({ title: "BemItemPromotedThreadRealtimeItem" }), Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadReadResponse__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadReadResponse__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadReadResponse__ThreadId; - }; - } - | { readonly other: string }; -export const V2ThreadReadResponse__SubAgentSource = Schema.Union( - [ - Schema.Literals(["review", "compact", "memory_consolidation"]), - Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadReadResponse__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadResumeParams__ContentItem = - | { readonly text: string; readonly type: "input_text" } - | { - readonly detail?: V2ThreadResumeParams__ImageDetail | null; - readonly image_url: string; - readonly type: "input_image"; - } - | { readonly audio_url: string; readonly type: "input_audio" } - | { readonly text: string; readonly type: "output_text" }; -export const V2ThreadResumeParams__ContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), - }).annotate({ title: "InputTextContentItem" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), - }).annotate({ title: "InputImageContentItem" }), - Schema.Struct({ - audio_url: Schema.String, - type: Schema.Literal("input_audio").annotate({ title: "InputAudioContentItemType" }), - }).annotate({ title: "InputAudioContentItem" }), - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), - }).annotate({ title: "OutputTextContentItem" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadResumeParams__FunctionCallOutputContentItem = - | { readonly text: string; readonly type: "input_text" } - | { - readonly detail?: V2ThreadResumeParams__ImageDetail | null; - readonly image_url: string; - readonly type: "input_image"; - } - | { readonly audio_url: string; readonly type: "input_audio" } - | { readonly encrypted_content: string; readonly type: "encrypted_content" }; -export const V2ThreadResumeParams__FunctionCallOutputContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ - title: "InputTextFunctionCallOutputContentItemType", - }), - }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ - title: "InputImageFunctionCallOutputContentItemType", - }), - }).annotate({ title: "InputImageFunctionCallOutputContentItem" }), - Schema.Struct({ - audio_url: Schema.String, - type: Schema.Literal("input_audio").annotate({ - title: "InputAudioFunctionCallOutputContentItemType", - }), - }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), - Schema.Struct({ - encrypted_content: Schema.String, - type: Schema.Literal("encrypted_content").annotate({ - title: "EncryptedContentFunctionCallOutputContentItemType", + id: Schema.String, + realtimeSessionId: Schema.String, + outcome: ServerNotification__ThreadRealtimeSessionOutcome, + type: Schema.Literal("realtimeSessionClosed").annotate({ + title: "RealtimeSessionClosedThreadRealtimeItemType", }), - }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + }).annotate({ title: "RealtimeSessionClosedThreadRealtimeItem" }), ], { mode: "oneOf" }, ).annotate({ - description: - "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + description: "EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline.", + identifier: "ServerNotification__ThreadRealtimeItem", }); -export type V2ThreadResumeResponse__CommandAction = +export type ServerNotification__ThreadRealtimeOutputAudioDeltaNotification = { + readonly audio: ServerNotification__ThreadRealtimeAudioChunk; + readonly threadId: string; +}; +export const ServerNotification__ThreadRealtimeOutputAudioDeltaNotification = Schema.Struct({ + audio: ServerNotification__ThreadRealtimeAudioChunk, + threadId: Schema.String, +}).annotate({ + description: "EXPERIMENTAL - streamed output audio emitted by thread realtime.", + identifier: "ServerNotification__ThreadRealtimeOutputAudioDeltaNotification", +}); + +export type ServerNotification__WindowsSandboxSetupCompletedNotification = { + readonly error?: string | null; + readonly mode: ServerNotification__WindowsSandboxSetupMode; + readonly success: boolean; +}; +export const ServerNotification__WindowsSandboxSetupCompletedNotification = Schema.Struct({ + error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + mode: ServerNotification__WindowsSandboxSetupMode, + success: Schema.Boolean, +}).annotate({ identifier: "ServerNotification__WindowsSandboxSetupCompletedNotification" }); + +export type ServerNotification__AccountLoginCompletedNotification = { + readonly error?: string | null; + readonly loginId?: string | null; + readonly onboardingEntrypoint?: ServerNotification__DesktopOnboardingEntrypoint | null; + readonly success: boolean; +}; +export const ServerNotification__AccountLoginCompletedNotification = Schema.Struct({ + error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + loginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + onboardingEntrypoint: Schema.optionalKey( + Schema.Union([ServerNotification__DesktopOnboardingEntrypoint, Schema.Null]), + ), + success: Schema.Boolean, +}).annotate({ identifier: "ServerNotification__AccountLoginCompletedNotification" }); + +export type ServerRequest__CommandAction = | { readonly command: string; readonly name: string; - readonly path: V2ThreadResumeResponse__AbsolutePathBuf; + readonly path: ServerRequest__LegacyAppPathString; readonly type: "read"; } | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } @@ -17159,12 +18957,12 @@ export type V2ThreadResumeResponse__CommandAction = readonly type: "search"; } | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadResumeResponse__CommandAction = Schema.Union( +export const ServerRequest__CommandAction = Schema.Union( [ Schema.Struct({ command: Schema.String, name: Schema.String, - path: V2ThreadResumeResponse__AbsolutePathBuf, + path: ServerRequest__LegacyAppPathString, type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), }).annotate({ title: "ReadCommandAction" }), Schema.Struct({ @@ -17184,546 +18982,499 @@ export const V2ThreadResumeResponse__CommandAction = Schema.Union( }).annotate({ title: "UnknownCommandAction" }), ], { mode: "oneOf" }, -); - -export type V2ThreadResumeResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadResumeResponse__CollabAgentStatus; -}; -export const V2ThreadResumeResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadResumeResponse__CollabAgentStatus, -}); +).annotate({ identifier: "ServerRequest__CommandAction" }); -export type V2ThreadResumeResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; -}; -export const V2ThreadResumeResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadResumeResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); - -export type V2ThreadResumeResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "rateLimitExceeded" - | "misalignmentPolicyViolation" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } +export type ServerRequest__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { readonly kind: "project_roots"; readonly subpath?: ServerRequest__LegacyAppPathString | null } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadResumeResponse__NonSteerableTurnKind; - }; + readonly kind: "unknown"; + readonly path: string; + readonly subpath?: ServerRequest__LegacyAppPathString | null; }; -export const V2ThreadResumeResponse__CodexErrorInfo = Schema.Union( +export const ServerRequest__FileSystemSpecialPath = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "rateLimitExceeded", - "misalignmentPolicyViolation", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", }), - Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", }), Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey(Schema.Union([ServerRequest__LegacyAppPathString, Schema.Null])), + }).annotate({ title: "KindFileSystemSpecialPath" }), + Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ + title: "TmpdirFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ + title: "SlashTmpFileSystemSpecialPath", }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadResumeResponse__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + kind: Schema.Literal("unknown"), + path: Schema.String, + subpath: Schema.optionalKey(Schema.Union([ServerRequest__LegacyAppPathString, Schema.Null])), }), ], { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); +).annotate({ identifier: "ServerRequest__FileSystemSpecialPath" }); -export type V2ThreadResumeResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadResumeResponse__PatchChangeKind; - readonly path: string; +export type ServerRequest__NetworkApprovalContext = { + readonly host: string; + readonly protocol: ServerRequest__NetworkApprovalProtocol; }; -export const V2ThreadResumeResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadResumeResponse__PatchChangeKind, - path: Schema.String, -}); +export const ServerRequest__NetworkApprovalContext = Schema.Struct({ + host: Schema.String, + protocol: ServerRequest__NetworkApprovalProtocol, +}).annotate({ identifier: "ServerRequest__NetworkApprovalContext" }); -export type V2ThreadResumeResponse__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ThreadResumeResponse__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: V2ThreadResumeResponse__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadResumeResponse__UserInput = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ThreadResumeResponse__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null])), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), - ], - { mode: "oneOf" }, -); +export type ServerRequest__NetworkPolicyAmendment = { + readonly action: ServerRequest__NetworkPolicyRuleAction; + readonly host: string; +}; +export const ServerRequest__NetworkPolicyAmendment = Schema.Struct({ + action: ServerRequest__NetworkPolicyRuleAction, + host: Schema.String, +}).annotate({ identifier: "ServerRequest__NetworkPolicyAmendment" }); -export type V2ThreadResumeResponse__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadResumeResponse__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadResumeResponse__ThreadId; - }; - } - | { readonly other: string }; -export const V2ThreadResumeResponse__SubAgentSource = Schema.Union( - [ - Schema.Literals(["review", "compact", "memory_consolidation"]), - Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadResumeResponse__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), - ], - { mode: "oneOf" }, -); +export type ServerRequest__ToolRequestUserInputQuestion = { + readonly header: string; + readonly id: string; + readonly isOther?: boolean; + readonly isSecret?: boolean; + readonly options?: ReadonlyArray | null; + readonly question: string; +}; +export const ServerRequest__ToolRequestUserInputQuestion = Schema.Struct({ + header: Schema.String, + id: Schema.String, + isOther: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + isSecret: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + options: Schema.optionalKey( + Schema.Union([Schema.Array(ServerRequest__ToolRequestUserInputOption), Schema.Null]), + ), + question: Schema.String, +}).annotate({ + description: "EXPERIMENTAL. Represents one request_user_input question and its required options.", + identifier: "ServerRequest__ToolRequestUserInputQuestion", +}); -export type V2ThreadRollbackResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: V2ThreadRollbackResponse__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadRollbackResponse__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2ThreadRollbackResponse__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); +export type ServerRequest__McpElicitationUntitledSingleSelectEnumSchema = { + readonly default?: string | null; + readonly description?: string | null; + readonly enum: ReadonlyArray; + readonly title?: string | null; + readonly type: ServerRequest__McpElicitationStringType; +}; +export const ServerRequest__McpElicitationUntitledSingleSelectEnumSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + enum: Schema.Array(Schema.String), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: ServerRequest__McpElicitationStringType, +}).annotate({ identifier: "ServerRequest__McpElicitationUntitledSingleSelectEnumSchema" }); -export type V2ThreadRollbackResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadRollbackResponse__CollabAgentStatus; +export type ServerRequest__McpElicitationUntitledEnumItems = { + readonly enum: ReadonlyArray; + readonly type: ServerRequest__McpElicitationStringType; }; -export const V2ThreadRollbackResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadRollbackResponse__CollabAgentStatus, -}); +export const ServerRequest__McpElicitationUntitledEnumItems = Schema.Struct({ + enum: Schema.Array(Schema.String), + type: ServerRequest__McpElicitationStringType, +}).annotate({ identifier: "ServerRequest__McpElicitationUntitledEnumItems" }); -export type V2ThreadRollbackResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; +export type ServerRequest__McpElicitationLegacyTitledEnumSchema = { + readonly default?: string | null; + readonly description?: string | null; + readonly enum: ReadonlyArray; + readonly enumNames?: ReadonlyArray | null; + readonly title?: string | null; + readonly type: ServerRequest__McpElicitationStringType; }; -export const V2ThreadRollbackResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadRollbackResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +export const ServerRequest__McpElicitationLegacyTitledEnumSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + enum: Schema.Array(Schema.String), + enumNames: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: ServerRequest__McpElicitationStringType, +}).annotate({ identifier: "ServerRequest__McpElicitationLegacyTitledEnumSchema" }); -export type V2ThreadRollbackResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "rateLimitExceeded" - | "misalignmentPolicyViolation" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } - | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadRollbackResponse__NonSteerableTurnKind; - }; - }; -export const V2ThreadRollbackResponse__CodexErrorInfo = Schema.Union( - [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "rateLimitExceeded", - "misalignmentPolicyViolation", - "other", +export type ServerRequest__McpElicitationTitledSingleSelectEnumSchema = { + readonly default?: string | null; + readonly description?: string | null; + readonly oneOf: ReadonlyArray; + readonly title?: string | null; + readonly type: ServerRequest__McpElicitationStringType; +}; +export const ServerRequest__McpElicitationTitledSingleSelectEnumSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + oneOf: Schema.Array(ServerRequest__McpElicitationConstOption), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: ServerRequest__McpElicitationStringType, +}).annotate({ identifier: "ServerRequest__McpElicitationTitledSingleSelectEnumSchema" }); + +export type ServerRequest__McpElicitationTitledEnumItems = { + readonly anyOf: ReadonlyArray; +}; +export const ServerRequest__McpElicitationTitledEnumItems = Schema.Struct({ + anyOf: Schema.Array(ServerRequest__McpElicitationConstOption), +}).annotate({ identifier: "ServerRequest__McpElicitationTitledEnumItems" }); + +export type ServerRequest__McpElicitationStringSchema = { + readonly default?: string | null; + readonly description?: string | null; + readonly format?: ServerRequest__McpElicitationStringFormat | null; + readonly maxLength?: number | null; + readonly minLength?: number | null; + readonly title?: string | null; + readonly type: ServerRequest__McpElicitationStringType; +}; +export const ServerRequest__McpElicitationStringSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + format: Schema.optionalKey( + Schema.Union([ServerRequest__McpElicitationStringFormat, Schema.Null]), + ), + maxLength: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), + ), + minLength: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), ), + Schema.Null, + ]), + ), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: ServerRequest__McpElicitationStringType, +}).annotate({ identifier: "ServerRequest__McpElicitationStringSchema" }); + +export type ServerRequest__McpElicitationNumberSchema = { + readonly default?: number | null; + readonly description?: string | null; + readonly maximum?: number | null; + readonly minimum?: number | null; + readonly title?: string | null; + readonly type: ServerRequest__McpElicitationNumberType; +}; +export const ServerRequest__McpElicitationNumberSchema = Schema.Struct({ + default: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "double" }).check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.Null, + ]), + ), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + maximum: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "double" }).check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.Null, + ]), + ), + minimum: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "double" }).check( + Schema.isFinite().annotate({ expected: "a finite number" }), + ), + Schema.Null, + ]), + ), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: ServerRequest__McpElicitationNumberType, +}).annotate({ identifier: "ServerRequest__McpElicitationNumberSchema" }); + +export type ServerRequest__McpElicitationBooleanSchema = { + readonly default?: boolean | null; + readonly description?: string | null; + readonly title?: string | null; + readonly type: ServerRequest__McpElicitationBooleanType; +}; +export const ServerRequest__McpElicitationBooleanSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: ServerRequest__McpElicitationBooleanType, +}).annotate({ identifier: "ServerRequest__McpElicitationBooleanSchema" }); + +export type ServerRequest__ChatgptAuthTokensRefreshParams = { + readonly previousAccountId?: string | null; + readonly reason: ServerRequest__ChatgptAuthTokensRefreshReason; +}; +export const ServerRequest__ChatgptAuthTokensRefreshParams = Schema.Struct({ + previousAccountId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Workspace/account identifier that Codex was previously using.\n\nClients that manage multiple accounts/workspaces can use this as a hint to refresh the token for the correct workspace.\n\nThis may be `null` when the prior auth state did not include a workspace identifier (`chatgpt_account_id`).", }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + Schema.Null, + ]), + ), + reason: ServerRequest__ChatgptAuthTokensRefreshReason, +}).annotate({ identifier: "ServerRequest__ChatgptAuthTokensRefreshParams" }); + +export type ServerRequest__ApplyPatchApprovalParams = { + readonly callId: string; + readonly conversationId: ServerRequest__ThreadId; + readonly fileChanges: { readonly [x: string]: ServerRequest__FileChange }; + readonly grantRoot?: string | null; + readonly reason?: string | null; +}; +export const ServerRequest__ApplyPatchApprovalParams = Schema.Struct({ + callId: Schema.String.annotate({ + description: + "Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent] and [codex_protocol::protocol::PatchApplyEndEvent].", + }), + conversationId: ServerRequest__ThreadId, + fileChanges: Schema.Record(Schema.String, ServerRequest__FileChange), + grantRoot: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).", }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), - Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + Schema.Null, + ]), + ), + reason: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional explanatory reason (e.g. request for extra write access).", }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), - Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ServerRequest__ApplyPatchApprovalParams" }); + +export type ServerRequest__ExecCommandApprovalParams = { + readonly approvalId?: string | null; + readonly callId: string; + readonly command: ReadonlyArray; + readonly conversationId: ServerRequest__ThreadId; + readonly cwd: string; + readonly parsedCmd: ReadonlyArray; + readonly reason?: string | null; +}; +export const ServerRequest__ExecCommandApprovalParams = Schema.Struct({ + approvalId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Identifier for this specific approval callback." }), + Schema.Null, + ]), + ), + callId: Schema.String.annotate({ + description: + "Use to correlate this with [codex_protocol::protocol::ExecCommandBeginEvent] and [codex_protocol::protocol::ExecCommandEndEvent].", + }), + command: Schema.Array(Schema.String), + conversationId: ServerRequest__ThreadId, + cwd: Schema.String, + parsedCmd: Schema.Array(ServerRequest__ParsedCommand), + reason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerRequest__ExecCommandApprovalParams" }); + +export type ToolRequestUserInputParams__ToolRequestUserInputQuestion = { + readonly header: string; + readonly id: string; + readonly isOther?: boolean; + readonly isSecret?: boolean; + readonly options?: ReadonlyArray | null; + readonly question: string; +}; +export const ToolRequestUserInputParams__ToolRequestUserInputQuestion = Schema.Struct({ + header: Schema.String, + id: Schema.String, + isOther: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + isSecret: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + options: Schema.optionalKey( + Schema.Union([ + Schema.Array(ToolRequestUserInputParams__ToolRequestUserInputOption), + Schema.Null, + ]), + ), + question: Schema.String, +}).annotate({ + description: "EXPERIMENTAL. Represents one request_user_input question and its required options.", + identifier: "ToolRequestUserInputParams__ToolRequestUserInputQuestion", +}); + +export type V2AccountRateLimitsUpdatedNotification__RateLimitSnapshot = { + readonly credits?: V2AccountRateLimitsUpdatedNotification__CreditsSnapshot | null; + readonly individualLimit?: V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot | null; + readonly limitId?: string | null; + readonly limitName?: string | null; + readonly normalModelSlug?: string | null; + readonly planType?: V2AccountRateLimitsUpdatedNotification__PlanType | null; + readonly primary?: V2AccountRateLimitsUpdatedNotification__RateLimitWindow | null; + readonly rateLimitReachedType?: V2AccountRateLimitsUpdatedNotification__RateLimitReachedType | null; + readonly secondary?: V2AccountRateLimitsUpdatedNotification__RateLimitWindow | null; + readonly spendControlReached?: boolean | null; +}; +export const V2AccountRateLimitsUpdatedNotification__RateLimitSnapshot = Schema.Struct({ + credits: Schema.optionalKey( + Schema.Union([V2AccountRateLimitsUpdatedNotification__CreditsSnapshot, Schema.Null]), + ), + individualLimit: Schema.optionalKey( + Schema.Union([V2AccountRateLimitsUpdatedNotification__SpendControlLimitSnapshot, Schema.Null]), + ), + limitId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + limitName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + normalModelSlug: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Normal model whose display name and reasoning options describe this quota alias.", }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), - Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadRollbackResponse__NonSteerableTurnKind, + Schema.Null, + ]), + ), + planType: Schema.optionalKey( + Schema.Union([V2AccountRateLimitsUpdatedNotification__PlanType, Schema.Null]), + ), + primary: Schema.optionalKey( + Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitWindow, Schema.Null]), + ), + rateLimitReachedType: Schema.optionalKey( + Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitReachedType, Schema.Null]), + ), + secondary: Schema.optionalKey( + Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitWindow, Schema.Null]), + ), + spendControlReached: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: + "Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.", }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", - }), - ], - { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2AccountRateLimitsUpdatedNotification__RateLimitSnapshot" }); -export type V2ThreadRollbackResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadRollbackResponse__PatchChangeKind; - readonly path: string; +export type V2AppListUpdatedNotification__AppMetadata = { + readonly categories?: ReadonlyArray | null; + readonly developer?: string | null; + readonly firstPartyRequiresInstall?: boolean | null; + readonly review?: V2AppListUpdatedNotification__AppReview | null; + readonly screenshots?: ReadonlyArray | null; + readonly seoDescription?: string | null; + readonly showInComposerWhenUnlinked?: boolean | null; + readonly subCategories?: ReadonlyArray | null; + readonly version?: string | null; + readonly versionId?: string | null; + readonly versionNotes?: string | null; }; -export const V2ThreadRollbackResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadRollbackResponse__PatchChangeKind, - path: Schema.String, -}); +export const V2AppListUpdatedNotification__AppMetadata = Schema.Struct({ + categories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + developer: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + firstPartyRequiresInstall: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + review: Schema.optionalKey(Schema.Union([V2AppListUpdatedNotification__AppReview, Schema.Null])), + screenshots: Schema.optionalKey( + Schema.Union([Schema.Array(V2AppListUpdatedNotification__AppScreenshot), Schema.Null]), + ), + seoDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + showInComposerWhenUnlinked: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + subCategories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + version: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + versionId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + versionNotes: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2AppListUpdatedNotification__AppMetadata" }); -export type V2ThreadRollbackResponse__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ThreadRollbackResponse__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: V2ThreadRollbackResponse__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadRollbackResponse__UserInput = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ThreadRollbackResponse__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__ImageDetail, Schema.Null]), - ), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__ImageDetail, Schema.Null]), - ), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), - ], - { mode: "oneOf" }, -); +export type V2AppsListResponse__AppMetadata = { + readonly categories?: ReadonlyArray | null; + readonly developer?: string | null; + readonly firstPartyRequiresInstall?: boolean | null; + readonly review?: V2AppsListResponse__AppReview | null; + readonly screenshots?: ReadonlyArray | null; + readonly seoDescription?: string | null; + readonly showInComposerWhenUnlinked?: boolean | null; + readonly subCategories?: ReadonlyArray | null; + readonly version?: string | null; + readonly versionId?: string | null; + readonly versionNotes?: string | null; +}; +export const V2AppsListResponse__AppMetadata = Schema.Struct({ + categories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + developer: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + firstPartyRequiresInstall: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + review: Schema.optionalKey(Schema.Union([V2AppsListResponse__AppReview, Schema.Null])), + screenshots: Schema.optionalKey( + Schema.Union([Schema.Array(V2AppsListResponse__AppScreenshot), Schema.Null]), + ), + seoDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + showInComposerWhenUnlinked: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + subCategories: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + version: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + versionId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + versionNotes: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2AppsListResponse__AppMetadata" }); -export type V2ThreadRollbackResponse__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadRollbackResponse__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadRollbackResponse__ThreadId; - }; - } - | { readonly other: string }; -export const V2ThreadRollbackResponse__SubAgentSource = Schema.Union( - [ - Schema.Literals(["review", "compact", "memory_consolidation"]), - Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadRollbackResponse__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), - ], - { mode: "oneOf" }, -); +export type V2AppsReadResponse__ConnectorMetadata = { + readonly description?: string | null; + readonly distributionChannel?: string | null; + readonly iconUrl?: string | null; + readonly iconUrlDark?: string | null; + readonly id: string; + readonly installUrl?: string | null; + readonly name: string; + readonly pluginDisplayNames?: ReadonlyArray; + readonly toolSummaries?: ReadonlyArray | null; +}; +export const V2AppsReadResponse__ConnectorMetadata = Schema.Struct({ + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + distributionChannel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + id: Schema.String, + installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + name: Schema.String, + pluginDisplayNames: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + toolSummaries: Schema.optionalKey( + Schema.Union([Schema.Array(V2AppsReadResponse__AppToolSummary), Schema.Null]), + ), +}).annotate({ + description: "EXPERIMENTAL - metadata returned by app/read.", + identifier: "V2AppsReadResponse__ConnectorMetadata", +}); -export type V2ThreadSettingsUpdatedNotification__SandboxPolicy = +export type V2CommandExecParams__SandboxPolicy = | { readonly type: "dangerFullAccess" } | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } + | { + readonly networkAccess?: V2CommandExecParams__NetworkAccess; + readonly type: "externalSandbox"; + } | { readonly excludeSlashTmp?: boolean; readonly excludeTmpdirEnvVar?: boolean; readonly networkAccess?: boolean; readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; + readonly writableRoots?: ReadonlyArray; }; -export const V2ThreadSettingsUpdatedNotification__SandboxPolicy = Schema.Union( +export const V2CommandExecParams__SandboxPolicy = Schema.Union( [ Schema.Struct({ type: Schema.Literal("dangerFullAccess").annotate({ @@ -17736,7 +19487,10 @@ export const V2ThreadSettingsUpdatedNotification__SandboxPolicy = Schema.Union( }).annotate({ title: "ReadOnlySandboxPolicy" }), Schema.Struct({ networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), + Schema.suspend( + (): Schema.Codec => + V2CommandExecParams__NetworkAccess, + ).annotate({ default: "restricted" }), ), type: Schema.Literal("externalSandbox").annotate({ title: "ExternalSandboxSandboxPolicyType", @@ -17748,94 +19502,458 @@ export const V2ThreadSettingsUpdatedNotification__SandboxPolicy = Schema.Union( networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), writableRoots: Schema.optionalKey( - Schema.Array(V2ThreadSettingsUpdatedNotification__AbsolutePathBuf).annotate({ - default: [], - }), + Schema.Array(V2CommandExecParams__AbsolutePathBuf).annotate({ default: [] }), ), }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2CommandExecParams__SandboxPolicy" }); -export type V2ThreadSettingsUpdatedNotification__Settings = { - readonly developer_instructions?: string | null; - readonly model: string; - readonly reasoning_effort?: V2ThreadSettingsUpdatedNotification__ReasoningEffort | null; +export type V2ConfigBatchWriteParams__ConfigEdit = { + readonly keyPath: string; + readonly mergeStrategy: V2ConfigBatchWriteParams__MergeStrategy; + readonly value: Schema.Json; }; -export const V2ThreadSettingsUpdatedNotification__Settings = Schema.Struct({ - developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - model: Schema.String, - reasoning_effort: Schema.optionalKey( - Schema.Union([V2ThreadSettingsUpdatedNotification__ReasoningEffort, Schema.Null]), +export const V2ConfigBatchWriteParams__ConfigEdit = Schema.Struct({ + keyPath: Schema.String, + mergeStrategy: V2ConfigBatchWriteParams__MergeStrategy, + value: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ identifier: "V2ConfigBatchWriteParams__ConfigEdit" }); + +export type V2ConfigReadResponse__BrowserUseOriginPolicyConfig = { + readonly access?: V2ConfigReadResponse__AllowDenyRequirement | null; + readonly downloads?: V2ConfigReadResponse__AllowDenyRequirement | null; + readonly full_cdp_access?: V2ConfigReadResponse__AllowDenyRequirement | null; + readonly uploads?: V2ConfigReadResponse__AllowDenyRequirement | null; +}; +export const V2ConfigReadResponse__BrowserUseOriginPolicyConfig = Schema.Struct({ + access: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__AllowDenyRequirement, Schema.Null]), + ), + downloads: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__AllowDenyRequirement, Schema.Null]), + ), + full_cdp_access: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__AllowDenyRequirement, Schema.Null]), + ), + uploads: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__AllowDenyRequirement, Schema.Null]), ), -}).annotate({ description: "Settings for a collaboration mode." }); +}).annotate({ identifier: "V2ConfigReadResponse__BrowserUseOriginPolicyConfig" }); -export type V2ThreadStartedNotification__CommandAction = +export type V2ConfigReadResponse__ComputerUseMacosConfig = { + readonly bundle_ids?: { readonly [x: string]: V2ConfigReadResponse__AllowDenyRequirement } | null; +}; +export const V2ConfigReadResponse__ComputerUseMacosConfig = Schema.Struct({ + bundle_ids: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, V2ConfigReadResponse__AllowDenyRequirement), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ConfigReadResponse__ComputerUseMacosConfig" }); + +export type V2ConfigReadResponse__ComputerUseWindowsExeConfig = { + readonly access: V2ConfigReadResponse__AllowDenyRequirement; + readonly binary_name?: string | null; + readonly product_name: string; + readonly publisher_name: string; +}; +export const V2ConfigReadResponse__ComputerUseWindowsExeConfig = Schema.Struct({ + access: V2ConfigReadResponse__AllowDenyRequirement, + binary_name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + product_name: Schema.String, + publisher_name: Schema.String, +}).annotate({ identifier: "V2ConfigReadResponse__ComputerUseWindowsExeConfig" }); + +export type V2ConfigReadResponse__WebSearchToolConfig = { + readonly allowed_domains?: ReadonlyArray | null; + readonly context_size?: V2ConfigReadResponse__WebSearchContextSize | null; + readonly location?: V2ConfigReadResponse__WebSearchLocation | null; +}; +export const V2ConfigReadResponse__WebSearchToolConfig = Schema.Struct({ + allowed_domains: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + context_size: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__WebSearchContextSize, Schema.Null]), + ), + location: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__WebSearchLocation, Schema.Null]), + ), +}).annotate({ identifier: "V2ConfigReadResponse__WebSearchToolConfig" }); + +export type V2ConfigReadResponse__ConfigLayerSource = + | { readonly file: V2ConfigReadResponse__AbsolutePathBuf; readonly type: "packagedDefaults" } + | { readonly domain: string; readonly key: string; readonly type: "mdm" } + | { readonly file: V2ConfigReadResponse__AbsolutePathBuf; readonly type: "system" } + | { readonly id: string; readonly name: string; readonly type: "enterpriseManaged" } | { - readonly command: string; - readonly name: string; - readonly path: V2ThreadStartedNotification__AbsolutePathBuf; - readonly type: "read"; + readonly file: V2ConfigReadResponse__AbsolutePathBuf; + readonly profile?: string | null; + readonly type: "user"; } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { readonly dotCodexFolder: V2ConfigReadResponse__AbsolutePathBuf; readonly type: "project" } + | { readonly type: "sessionFlags" } | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; + readonly file: V2ConfigReadResponse__AbsolutePathBuf; + readonly type: "legacyManagedConfigTomlFromFile"; } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadStartedNotification__CommandAction = Schema.Union( + | { readonly type: "legacyManagedConfigTomlFromMdm" }; +export const V2ConfigReadResponse__ConfigLayerSource = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2ThreadStartedNotification__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + file: Schema.suspend( + (): Schema.Codec => + V2ConfigReadResponse__AbsolutePathBuf, + ).annotate({ description: "Path to the packaged default configuration file." }), + type: Schema.Literal("packagedDefaults").annotate({ + title: "PackagedDefaultsConfigLayerSourceType", + }), + }).annotate({ + title: "PackagedDefaultsConfigLayerSource", + description: "Default configuration supplied with the installed Codex package.", + }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + domain: Schema.String, + key: Schema.String, + type: Schema.Literal("mdm").annotate({ title: "MdmConfigLayerSourceType" }), + }).annotate({ + title: "MdmConfigLayerSource", + description: "Managed preferences layer delivered by MDM (macOS only).", + }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + file: Schema.suspend( + (): Schema.Codec => + V2ConfigReadResponse__AbsolutePathBuf, + ).annotate({ + description: + "This is the path to the system config.toml file, though it is not guaranteed to exist.", + }), + type: Schema.Literal("system").annotate({ title: "SystemConfigLayerSourceType" }), + }).annotate({ + title: "SystemConfigLayerSource", + description: "Managed config layer from a file (usually `managed_config.toml`).", + }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + id: Schema.String.annotate({ description: "Stable identifier for the delivered layer." }), + name: Schema.String.annotate({ + description: + "Admin-facing name for the delivered layer. This is surfaced in diagnostics so users know which cloud layer needs administrator attention.", + }), + type: Schema.Literal("enterpriseManaged").annotate({ + title: "EnterpriseManagedConfigLayerSourceType", + }), + }).annotate({ + title: "EnterpriseManagedConfigLayerSource", + description: "Enterprise-managed config layer delivered by the cloud config bundle.", + }), + Schema.Struct({ + file: Schema.suspend( + (): Schema.Codec => + V2ConfigReadResponse__AbsolutePathBuf, + ).annotate({ + description: + "This is the path to the user's config.toml file, though it is not guaranteed to exist.", + }), + profile: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("user").annotate({ title: "UserConfigLayerSourceType" }), + }).annotate({ + title: "UserConfigLayerSource", + description: + "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory", + }), + Schema.Struct({ + dotCodexFolder: V2ConfigReadResponse__AbsolutePathBuf, + type: Schema.Literal("project").annotate({ title: "ProjectConfigLayerSourceType" }), + }).annotate({ + title: "ProjectConfigLayerSource", + description: + "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.", + }), + Schema.Struct({ + type: Schema.Literal("sessionFlags").annotate({ title: "SessionFlagsConfigLayerSourceType" }), + }).annotate({ + title: "SessionFlagsConfigLayerSource", + description: "Session-layer overrides supplied via `-c`/`--config`.", + }), + Schema.Struct({ + file: V2ConfigReadResponse__AbsolutePathBuf, + type: Schema.Literal("legacyManagedConfigTomlFromFile").annotate({ + title: "LegacyManagedConfigTomlFromFileConfigLayerSourceType", + }), + }).annotate({ + title: "LegacyManagedConfigTomlFromFileConfigLayerSource", + description: + '`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a "best effort" while we phase out `managed_config.toml` in favor of `requirements.toml`.', + }), + Schema.Struct({ + type: Schema.Literal("legacyManagedConfigTomlFromMdm").annotate({ + title: "LegacyManagedConfigTomlFromMdmConfigLayerSourceType", + }), + }).annotate({ title: "LegacyManagedConfigTomlFromMdmConfigLayerSource" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ConfigReadResponse__ConfigLayerSource" }); -export type V2ThreadStartedNotification__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadStartedNotification__CollabAgentStatus; +export type V2ConfigReadResponse__AppsDefaultConfig = { + readonly approvals_reviewer?: V2ConfigReadResponse__ApprovalsReviewer | null; + readonly default_tools_approval_mode?: V2ConfigReadResponse__AppToolApproval | null; + readonly destructive_enabled?: boolean; + readonly enabled?: boolean; + readonly open_world_enabled?: boolean; }; -export const V2ThreadStartedNotification__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadStartedNotification__CollabAgentStatus, -}); +export const V2ConfigReadResponse__AppsDefaultConfig = Schema.Struct({ + approvals_reviewer: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__ApprovalsReviewer, Schema.Null]), + ), + default_tools_approval_mode: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__AppToolApproval, Schema.Null]), + ), + destructive_enabled: Schema.optionalKey(Schema.Boolean.annotate({ default: true })), + enabled: Schema.optionalKey(Schema.Boolean.annotate({ default: true })), + open_world_enabled: Schema.optionalKey(Schema.Boolean.annotate({ default: true })), +}).annotate({ identifier: "V2ConfigReadResponse__AppsDefaultConfig" }); -export type V2ThreadStartedNotification__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; +export type V2ConfigRequirementsReadResponse__ComputerUseMacosRequirements = { + readonly bundleIds?: { + readonly [x: string]: V2ConfigRequirementsReadResponse__AllowDenyRequirement; + } | null; }; -export const V2ThreadStartedNotification__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadStartedNotification__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +export const V2ConfigRequirementsReadResponse__ComputerUseMacosRequirements = Schema.Struct({ + bundleIds: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, V2ConfigRequirementsReadResponse__AllowDenyRequirement), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__ComputerUseMacosRequirements" }); -export type V2ThreadStartedNotification__CodexErrorInfo = +export type V2ConfigRequirementsReadResponse__ComputerUseWindowsExeRequirement = { + readonly access: V2ConfigRequirementsReadResponse__AllowDenyRequirement; + readonly binaryName?: string | null; + readonly productName: string; + readonly publisherName: string; +}; +export const V2ConfigRequirementsReadResponse__ComputerUseWindowsExeRequirement = Schema.Struct({ + access: V2ConfigRequirementsReadResponse__AllowDenyRequirement, + binaryName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + productName: Schema.String, + publisherName: Schema.String, +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__ComputerUseWindowsExeRequirement" }); + +export type V2ConfigRequirementsReadResponse__BrowserUseOriginPolicy = { + readonly access?: V2ConfigRequirementsReadResponse__AllowDenyRequirement | null; + readonly accessApprovalLifetime?: V2ConfigRequirementsReadResponse__BrowserUseAccessApprovalLifetime | null; + readonly autoReview?: V2ConfigRequirementsReadResponse__AllowDenyRequirement | null; + readonly downloads?: V2ConfigRequirementsReadResponse__AllowDenyRequirement | null; + readonly fullCdpAccess?: V2ConfigRequirementsReadResponse__AllowDenyRequirement | null; + readonly persistentApproval?: boolean | null; + readonly uploads?: V2ConfigRequirementsReadResponse__AllowDenyRequirement | null; +}; +export const V2ConfigRequirementsReadResponse__BrowserUseOriginPolicy = Schema.Struct({ + access: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__AllowDenyRequirement, Schema.Null]), + ), + accessApprovalLifetime: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__BrowserUseAccessApprovalLifetime, Schema.Null]), + ), + autoReview: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__AllowDenyRequirement, Schema.Null]), + ), + downloads: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__AllowDenyRequirement, Schema.Null]), + ), + fullCdpAccess: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__AllowDenyRequirement, Schema.Null]), + ), + persistentApproval: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + uploads: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__AllowDenyRequirement, Schema.Null]), + ), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__BrowserUseOriginPolicy" }); + +export type V2ConfigRequirementsReadResponse__NewThreadModelDefaults = { + readonly model?: string | null; + readonly modelReasoningEffort?: V2ConfigRequirementsReadResponse__ReasoningEffort | null; + readonly serviceTier?: string | null; +}; +export const V2ConfigRequirementsReadResponse__NewThreadModelDefaults = Schema.Struct({ + model: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + modelReasoningEffort: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__ReasoningEffort, Schema.Null]), + ), + serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__NewThreadModelDefaults" }); + +export type V2ConfigRequirementsReadResponse__ApplicationNetworkRequirements = { + readonly domains: { + readonly [x: string]: V2ConfigRequirementsReadResponse__NetworkDomainPermission; + }; + readonly enabled: boolean; +}; +export const V2ConfigRequirementsReadResponse__ApplicationNetworkRequirements = Schema.Struct({ + domains: Schema.Record(Schema.String, V2ConfigRequirementsReadResponse__NetworkDomainPermission), + enabled: Schema.Boolean.annotate({ + description: "When enabled, only explicitly allowed exact domains may be contacted.", + }), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__ApplicationNetworkRequirements" }); + +export type V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup = { + readonly hooks: ReadonlyArray; + readonly matcher?: string | null; +}; +export const V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup = Schema.Struct({ + hooks: Schema.Array(V2ConfigRequirementsReadResponse__ConfiguredHookHandler), + matcher: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup" }); + +export type V2ConfigWarningNotification__TextRange = { + readonly end: V2ConfigWarningNotification__TextPosition; + readonly start: V2ConfigWarningNotification__TextPosition; +}; +export const V2ConfigWarningNotification__TextRange = Schema.Struct({ + end: V2ConfigWarningNotification__TextPosition, + start: V2ConfigWarningNotification__TextPosition, +}).annotate({ identifier: "V2ConfigWarningNotification__TextRange" }); + +export type V2ConfigWriteResponse__ConfigLayerSource = + | { readonly file: V2ConfigWriteResponse__AbsolutePathBuf; readonly type: "packagedDefaults" } + | { readonly domain: string; readonly key: string; readonly type: "mdm" } + | { readonly file: V2ConfigWriteResponse__AbsolutePathBuf; readonly type: "system" } + | { readonly id: string; readonly name: string; readonly type: "enterpriseManaged" } + | { + readonly file: V2ConfigWriteResponse__AbsolutePathBuf; + readonly profile?: string | null; + readonly type: "user"; + } + | { readonly dotCodexFolder: V2ConfigWriteResponse__AbsolutePathBuf; readonly type: "project" } + | { readonly type: "sessionFlags" } + | { + readonly file: V2ConfigWriteResponse__AbsolutePathBuf; + readonly type: "legacyManagedConfigTomlFromFile"; + } + | { readonly type: "legacyManagedConfigTomlFromMdm" }; +export const V2ConfigWriteResponse__ConfigLayerSource = Schema.Union( + [ + Schema.Struct({ + file: Schema.suspend( + (): Schema.Codec => + V2ConfigWriteResponse__AbsolutePathBuf, + ).annotate({ description: "Path to the packaged default configuration file." }), + type: Schema.Literal("packagedDefaults").annotate({ + title: "PackagedDefaultsConfigLayerSourceType", + }), + }).annotate({ + title: "PackagedDefaultsConfigLayerSource", + description: "Default configuration supplied with the installed Codex package.", + }), + Schema.Struct({ + domain: Schema.String, + key: Schema.String, + type: Schema.Literal("mdm").annotate({ title: "MdmConfigLayerSourceType" }), + }).annotate({ + title: "MdmConfigLayerSource", + description: "Managed preferences layer delivered by MDM (macOS only).", + }), + Schema.Struct({ + file: Schema.suspend( + (): Schema.Codec => + V2ConfigWriteResponse__AbsolutePathBuf, + ).annotate({ + description: + "This is the path to the system config.toml file, though it is not guaranteed to exist.", + }), + type: Schema.Literal("system").annotate({ title: "SystemConfigLayerSourceType" }), + }).annotate({ + title: "SystemConfigLayerSource", + description: "Managed config layer from a file (usually `managed_config.toml`).", + }), + Schema.Struct({ + id: Schema.String.annotate({ description: "Stable identifier for the delivered layer." }), + name: Schema.String.annotate({ + description: + "Admin-facing name for the delivered layer. This is surfaced in diagnostics so users know which cloud layer needs administrator attention.", + }), + type: Schema.Literal("enterpriseManaged").annotate({ + title: "EnterpriseManagedConfigLayerSourceType", + }), + }).annotate({ + title: "EnterpriseManagedConfigLayerSource", + description: "Enterprise-managed config layer delivered by the cloud config bundle.", + }), + Schema.Struct({ + file: Schema.suspend( + (): Schema.Codec => + V2ConfigWriteResponse__AbsolutePathBuf, + ).annotate({ + description: + "This is the path to the user's config.toml file, though it is not guaranteed to exist.", + }), + profile: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("user").annotate({ title: "UserConfigLayerSourceType" }), + }).annotate({ + title: "UserConfigLayerSource", + description: + "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory", + }), + Schema.Struct({ + dotCodexFolder: V2ConfigWriteResponse__AbsolutePathBuf, + type: Schema.Literal("project").annotate({ title: "ProjectConfigLayerSourceType" }), + }).annotate({ + title: "ProjectConfigLayerSource", + description: + "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.", + }), + Schema.Struct({ + type: Schema.Literal("sessionFlags").annotate({ title: "SessionFlagsConfigLayerSourceType" }), + }).annotate({ + title: "SessionFlagsConfigLayerSource", + description: "Session-layer overrides supplied via `-c`/`--config`.", + }), + Schema.Struct({ + file: V2ConfigWriteResponse__AbsolutePathBuf, + type: Schema.Literal("legacyManagedConfigTomlFromFile").annotate({ + title: "LegacyManagedConfigTomlFromFileConfigLayerSourceType", + }), + }).annotate({ + title: "LegacyManagedConfigTomlFromFileConfigLayerSource", + description: + '`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a "best effort" while we phase out `managed_config.toml` in favor of `requirements.toml`.', + }), + Schema.Struct({ + type: Schema.Literal("legacyManagedConfigTomlFromMdm").annotate({ + title: "LegacyManagedConfigTomlFromMdmConfigLayerSourceType", + }), + }).annotate({ title: "LegacyManagedConfigTomlFromMdmConfigLayerSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ConfigWriteResponse__ConfigLayerSource" }); + +export type V2ErrorNotification__CodexErrorInfo = | "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" | "serverOverloaded" | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" @@ -17848,17 +19966,21 @@ export type V2ThreadStartedNotification__CodexErrorInfo = | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } | { readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadStartedNotification__NonSteerableTurnKind; + readonly turnKind: V2ErrorNotification__NonSteerableTurnKind; }; }; -export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union( +export const V2ErrorNotification__CodexErrorInfo = Schema.Union( [ Schema.Literals([ "contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", "serverOverloaded", "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", "internalServerError", "unauthorized", "badRequest", @@ -17871,8 +19993,12 @@ export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union( httpStatusCode: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -17883,8 +20009,12 @@ export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union( httpStatusCode: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -17898,8 +20028,12 @@ export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union( httpStatusCode: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -17914,8 +20048,12 @@ export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union( httpStatusCode: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -17926,7 +20064,7 @@ export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union( }), Schema.Struct({ activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadStartedNotification__NonSteerableTurnKind, + turnKind: V2ErrorNotification__NonSteerableTurnKind, }), }).annotate({ title: "ActiveTurnNotSteerableCodexErrorInfo", @@ -17938,314 +20076,11780 @@ export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union( ).annotate({ description: "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ErrorNotification__CodexErrorInfo", }); -export type V2ThreadStartedNotification__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadStartedNotification__PatchChangeKind; - readonly path: string; +export type V2ErrorNotification__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ErrorNotification__MisalignmentSteer | null; }; -export const V2ThreadStartedNotification__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadStartedNotification__PatchChangeKind, - path: Schema.String, -}); +export const V2ErrorNotification__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ErrorNotification__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ErrorNotification__MisalignmentErrorDetails" }); -export type V2ThreadStartedNotification__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { - readonly detail?: V2ThreadStartedNotification__ImageDetail | null; - readonly type: "image"; - readonly url: string; - } - | { - readonly detail?: V2ThreadStartedNotification__ImageDetail | null; - readonly path: string; - readonly type: "localImage"; - } - | { readonly type: "audio"; readonly url: string } - | { readonly path: string; readonly type: "localAudio" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadStartedNotification__UserInput = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2ThreadStartedNotification__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], +export type V2ExperimentalFeatureListResponse__ExperimentalFeature = { + readonly announcement?: string | null; + readonly defaultEnabled: boolean; + readonly description?: string | null; + readonly displayName?: string | null; + readonly enabled: boolean; + readonly name: string; + readonly stage: V2ExperimentalFeatureListResponse__ExperimentalFeatureStage; +}; +export const V2ExperimentalFeatureListResponse__ExperimentalFeature = Schema.Struct({ + announcement: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Announcement copy shown to users when the feature is introduced. Null when this feature is not in beta.", + }), + Schema.Null, + ]), + ), + defaultEnabled: Schema.Boolean.annotate({ + description: "Whether this feature is enabled by default.", + }), + description: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Short summary describing what the feature does. Null when this feature is not in beta.", + }), + Schema.Null, + ]), + ), + displayName: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "User-facing display name shown in the experimental features UI. Null when this feature is not in beta.", + }), + Schema.Null, + ]), + ), + enabled: Schema.Boolean.annotate({ + description: "Whether this feature is currently enabled in the loaded config.", + }), + name: Schema.String.annotate({ + description: "Stable key used in config.toml and CLI flag toggles.", + }), + stage: Schema.suspend( + (): Schema.Codec => + V2ExperimentalFeatureListResponse__ExperimentalFeatureStage, + ).annotate({ description: "Lifecycle stage of this feature flag." }), +}).annotate({ identifier: "V2ExperimentalFeatureListResponse__ExperimentalFeature" }); + +export type V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorCandidate = { + readonly name: string; + readonly sessionCount: number; + readonly source: V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorSource; +}; +export const V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorCandidate = + Schema.Struct({ + name: Schema.String, + sessionCount: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", }), ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null]), - ), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null]), - ), - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), - url: Schema.String, - }).annotate({ title: "AudioUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), - }).annotate({ title: "LocalAudioUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadStartedNotification__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadStartedNotification__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadStartedNotification__ThreadId; - }; - } - | { readonly other: string }; -export const V2ThreadStartedNotification__SubAgentSource = Schema.Union( - [ - Schema.Literals(["review", "compact", "memory_consolidation"]), - Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadStartedNotification__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), - ], - { mode: "oneOf" }, -); + source: V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorSource, + }).annotate({ + identifier: "V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorCandidate", + }); -export type V2ThreadStartResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: V2ThreadStartResponse__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } +export type V2ExternalAgentConfigDetectResponse__MigrationDetails = { + readonly commands?: ReadonlyArray; + readonly hooks?: ReadonlyArray; + readonly mcpServers?: ReadonlyArray; + readonly memory?: ReadonlyArray; + readonly plugins?: ReadonlyArray; + readonly sessions?: ReadonlyArray; + readonly skills?: ReadonlyArray; + readonly subagents?: ReadonlyArray; +}; +export const V2ExternalAgentConfigDetectResponse__MigrationDetails = Schema.Struct({ + commands: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigDetectResponse__CommandMigration).annotate({ default: [] }), + ), + hooks: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigDetectResponse__HookMigration).annotate({ default: [] }), + ), + mcpServers: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigDetectResponse__McpServerMigration).annotate({ default: [] }), + ), + memory: Schema.optionalKey(Schema.Array(Schema.String)), + plugins: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigDetectResponse__PluginsMigration).annotate({ default: [] }), + ), + sessions: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigDetectResponse__SessionMigration).annotate({ default: [] }), + ), + skills: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigDetectResponse__SkillMigration).annotate({ default: [] }), + ), + subagents: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigDetectResponse__SubagentMigration).annotate({ default: [] }), + ), +}).annotate({ identifier: "V2ExternalAgentConfigDetectResponse__MigrationDetails" }); + +export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeFailure = + { + readonly cwd?: string | null; + readonly errorType?: string | null; + readonly failureStage: string; + readonly itemType: V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType; + readonly message: string; + readonly source?: string | null; + readonly subErrorType?: string | null; + }; +export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeFailure = + Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + failureStage: Schema.String, + itemType: + V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType, + message: Schema.String, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeFailure", + }); + +export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeSuccess = + { + readonly cwd?: string | null; + readonly itemType: V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType; + readonly source?: string | null; + readonly target?: string | null; + readonly title?: string | null; + }; +export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeSuccess = + Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + itemType: + V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + title: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Original title for an imported session; null for other item types.", + }), + Schema.Null, + ]), + ), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeSuccess", + }); + +export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorCandidate = + { + readonly name: string; + readonly sessionCount: number; + readonly source: V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorSource; + }; +export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorCandidate = + Schema.Struct({ + name: Schema.String, + sessionCount: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + source: V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorSource, + }).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentImportedConnectorCandidate", + }); + +export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeFailure = + { + readonly cwd?: string | null; + readonly errorType?: string | null; + readonly failureStage: string; + readonly itemType: V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType; + readonly message: string; + readonly source?: string | null; + readonly subErrorType?: string | null; + }; +export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeFailure = + Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + failureStage: Schema.String, + itemType: + V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType, + message: Schema.String, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeFailure", + }); + +export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeSuccess = + { + readonly cwd?: string | null; + readonly itemType: V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType; + readonly source?: string | null; + readonly target?: string | null; + readonly title?: string | null; + }; +export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeSuccess = + Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + itemType: + V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigMigrationItemType, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + title: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Original title for an imported session; null for other item types.", + }), + Schema.Null, + ]), + ), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeSuccess", + }); + +export type V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportItemTypeFailure = + { + readonly cwd?: string | null; + readonly errorType?: string | null; + readonly failureStage: string; + readonly itemType: V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType; + readonly message: string; + readonly source?: string | null; + readonly subErrorType?: string | null; + }; +export const V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportItemTypeFailure = + Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + failureStage: Schema.String, + itemType: V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType, + message: Schema.String, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportItemTypeFailure", + }); + +export type V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportHistoryRecordSuccessParams = + { + readonly cwd?: string | null; + readonly itemType: V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType; + readonly source?: string | null; + readonly target?: string | null; + readonly title?: string | null; + }; +export const V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportHistoryRecordSuccessParams = + Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + itemType: V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + title: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Original title for an imported session, when available.", + }), + Schema.Null, + ]), + ), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportHistoryRecordSuccessParams", + }); + +export type V2ExternalAgentConfigImportParams__MigrationDetails = { + readonly commands?: ReadonlyArray; + readonly hooks?: ReadonlyArray; + readonly mcpServers?: ReadonlyArray; + readonly memory?: ReadonlyArray; + readonly plugins?: ReadonlyArray; + readonly sessions?: ReadonlyArray; + readonly skills?: ReadonlyArray; + readonly subagents?: ReadonlyArray; +}; +export const V2ExternalAgentConfigImportParams__MigrationDetails = Schema.Struct({ + commands: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigImportParams__CommandMigration).annotate({ default: [] }), + ), + hooks: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigImportParams__HookMigration).annotate({ default: [] }), + ), + mcpServers: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigImportParams__McpServerMigration).annotate({ default: [] }), + ), + memory: Schema.optionalKey(Schema.Array(Schema.String)), + plugins: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigImportParams__PluginsMigration).annotate({ default: [] }), + ), + sessions: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigImportParams__SessionMigration).annotate({ default: [] }), + ), + skills: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigImportParams__SkillMigration).annotate({ default: [] }), + ), + subagents: Schema.optionalKey( + Schema.Array(V2ExternalAgentConfigImportParams__SubagentMigration).annotate({ default: [] }), + ), +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__MigrationDetails" }); + +export type V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeFailure = + { + readonly cwd?: string | null; + readonly errorType?: string | null; + readonly failureStage: string; + readonly itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType; + readonly message: string; + readonly source?: string | null; + readonly subErrorType?: string | null; + }; +export const V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeFailure = + Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + errorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + failureStage: Schema.String, + itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType, + message: Schema.String, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + subErrorType: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeFailure", + }); + +export type V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeSuccess = + { + readonly cwd?: string | null; + readonly itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType; + readonly source?: string | null; + readonly target?: string | null; + readonly title?: string | null; + }; +export const V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeSuccess = + Schema.Struct({ + cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType, + source: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + target: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + title: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Original title for an imported session; null for other item types.", + }), + Schema.Null, + ]), + ), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeSuccess", + }); + +export type V2FileChangePatchUpdatedNotification__FileUpdateChange = { + readonly diff: string; + readonly kind: V2FileChangePatchUpdatedNotification__PatchChangeKind; + readonly path: string; +}; +export const V2FileChangePatchUpdatedNotification__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2FileChangePatchUpdatedNotification__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2FileChangePatchUpdatedNotification__FileUpdateChange" }); + +export type V2GetAccountRateLimitsResponse__RateLimitResetCredit = { + readonly description?: string | null; + readonly expiresAt?: number | null; + readonly grantedAt: number; + readonly id: string; + readonly resetType: V2GetAccountRateLimitsResponse__RateLimitResetType; + readonly status: V2GetAccountRateLimitsResponse__RateLimitResetCreditStatus; + readonly title?: string | null; +}; +export const V2GetAccountRateLimitsResponse__RateLimitResetCredit = Schema.Struct({ + description: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Backend-provided display description for this credit, or `null` when unavailable.", + }), + Schema.Null, + ]), + ), + expiresAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Unix timestamp in seconds when the credit expires, or `null` if it does not expire.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + grantedAt: Schema.Number.annotate({ + description: "Unix timestamp in seconds when the credit was granted.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + id: Schema.String.annotate({ description: "Opaque backend identifier for this reset credit." }), + resetType: V2GetAccountRateLimitsResponse__RateLimitResetType, + status: V2GetAccountRateLimitsResponse__RateLimitResetCreditStatus, + title: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Backend-provided display title for this credit, or `null` when unavailable.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2GetAccountRateLimitsResponse__RateLimitResetCredit" }); + +export type V2GetAccountRateLimitsResponse__RateLimitSnapshot = { + readonly credits?: V2GetAccountRateLimitsResponse__CreditsSnapshot | null; + readonly individualLimit?: V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot | null; + readonly limitId?: string | null; + readonly limitName?: string | null; + readonly normalModelSlug?: string | null; + readonly planType?: V2GetAccountRateLimitsResponse__PlanType | null; + readonly primary?: V2GetAccountRateLimitsResponse__RateLimitWindow | null; + readonly rateLimitReachedType?: V2GetAccountRateLimitsResponse__RateLimitReachedType | null; + readonly secondary?: V2GetAccountRateLimitsResponse__RateLimitWindow | null; + readonly spendControlReached?: boolean | null; +}; +export const V2GetAccountRateLimitsResponse__RateLimitSnapshot = Schema.Struct({ + credits: Schema.optionalKey( + Schema.Union([V2GetAccountRateLimitsResponse__CreditsSnapshot, Schema.Null]), + ), + individualLimit: Schema.optionalKey( + Schema.Union([V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot, Schema.Null]), + ), + limitId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + limitName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + normalModelSlug: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Normal model whose display name and reasoning options describe this quota alias.", + }), + Schema.Null, + ]), + ), + planType: Schema.optionalKey( + Schema.Union([V2GetAccountRateLimitsResponse__PlanType, Schema.Null]), + ), + primary: Schema.optionalKey( + Schema.Union([V2GetAccountRateLimitsResponse__RateLimitWindow, Schema.Null]), + ), + rateLimitReachedType: Schema.optionalKey( + Schema.Union([V2GetAccountRateLimitsResponse__RateLimitReachedType, Schema.Null]), + ), + secondary: Schema.optionalKey( + Schema.Union([V2GetAccountRateLimitsResponse__RateLimitWindow, Schema.Null]), + ), + spendControlReached: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: + "Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2GetAccountRateLimitsResponse__RateLimitSnapshot" }); + +export type V2GetAccountResponse__Account = + | { readonly type: "apiKey" } + | { + readonly email: string | null; + readonly planType: V2GetAccountResponse__PlanType; + readonly type: "chatgpt"; + } + | { readonly type: "amazonBedrock"; readonly usesCodexManagedCredentials?: boolean }; +export const V2GetAccountResponse__Account = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("apiKey").annotate({ title: "ApiKeyAccountType" }), + }).annotate({ title: "ApiKeyAccount" }), + Schema.Struct({ + email: Schema.Union([Schema.String, Schema.Null]), + planType: V2GetAccountResponse__PlanType, + type: Schema.Literal("chatgpt").annotate({ title: "ChatgptAccountType" }), + }).annotate({ title: "ChatgptAccount" }), + Schema.Struct({ + type: Schema.Literal("amazonBedrock").annotate({ title: "AmazonBedrockAccountType" }), + usesCodexManagedCredentials: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + }).annotate({ title: "AmazonBedrockAccount" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2GetAccountResponse__Account" }); + +export type V2GetAccountTokenUsageResponse__ThreadUsage = { + readonly estimatedUsageCreditsMicros: number; + readonly estimatedUsageUsdMicros?: number | null; + readonly groups: ReadonlyArray; + readonly threadId: string; +}; +export const V2GetAccountTokenUsageResponse__ThreadUsage = Schema.Struct({ + estimatedUsageCreditsMicros: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + estimatedUsageUsdMicros: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + groups: Schema.Array(V2GetAccountTokenUsageResponse__ThreadUsageBreakdownGroup), + threadId: Schema.String, +}).annotate({ identifier: "V2GetAccountTokenUsageResponse__ThreadUsage" }); + +export type V2GetWorkspaceMessagesResponse__WorkspaceMessage = { + readonly archivedAt?: number | null; + readonly createdAt?: number | null; + readonly messageBody: string; + readonly messageId: string; + readonly messageType: V2GetWorkspaceMessagesResponse__WorkspaceMessageType; +}; +export const V2GetWorkspaceMessagesResponse__WorkspaceMessage = Schema.Struct({ + archivedAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp (in seconds) when the message was archived.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + createdAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp (in seconds) when the message was created.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + messageBody: Schema.String, + messageId: Schema.String, + messageType: V2GetWorkspaceMessagesResponse__WorkspaceMessageType, +}).annotate({ identifier: "V2GetWorkspaceMessagesResponse__WorkspaceMessage" }); + +export type V2HookCompletedNotification__HookOutputEntry = { + readonly kind: V2HookCompletedNotification__HookOutputEntryKind; + readonly text: string; +}; +export const V2HookCompletedNotification__HookOutputEntry = Schema.Struct({ + kind: V2HookCompletedNotification__HookOutputEntryKind, + text: Schema.String, +}).annotate({ identifier: "V2HookCompletedNotification__HookOutputEntry" }); + +export type V2HooksListResponse__HookMetadata = + | { + readonly additionalContextLimit?: number | null; + readonly currentHash: string; + readonly displayOrder: number; + readonly enabled: boolean; + readonly eventName: V2HooksListResponse__HookEventName; + readonly isManaged: boolean; + readonly key: string; + readonly matcher?: string | null; + readonly pluginId?: string | null; + readonly source: V2HooksListResponse__HookSource; + readonly sourcePath: V2HooksListResponse__AbsolutePathBuf; + readonly statusMessage?: string | null; + readonly timeoutSec: number; + readonly trustStatus: V2HooksListResponse__HookTrustStatus; + readonly async?: boolean; + readonly command: string; + readonly handlerType: "command"; + } + | { + readonly additionalContextLimit?: number | null; + readonly currentHash: string; + readonly displayOrder: number; + readonly enabled: boolean; + readonly eventName: V2HooksListResponse__HookEventName; + readonly isManaged: boolean; + readonly key: string; + readonly matcher?: string | null; + readonly pluginId?: string | null; + readonly source: V2HooksListResponse__HookSource; + readonly sourcePath: V2HooksListResponse__AbsolutePathBuf; + readonly statusMessage?: string | null; + readonly timeoutSec: number; + readonly trustStatus: V2HooksListResponse__HookTrustStatus; + readonly handlerType: "mcpTool"; + readonly server: string; + readonly tool: string; + } + | { + readonly additionalContextLimit?: number | null; + readonly currentHash: string; + readonly displayOrder: number; + readonly enabled: boolean; + readonly eventName: V2HooksListResponse__HookEventName; + readonly isManaged: boolean; + readonly key: string; + readonly matcher?: string | null; + readonly pluginId?: string | null; + readonly source: V2HooksListResponse__HookSource; + readonly sourcePath: V2HooksListResponse__AbsolutePathBuf; + readonly statusMessage?: string | null; + readonly timeoutSec: number; + readonly trustStatus: V2HooksListResponse__HookTrustStatus; + readonly handlerType: "prompt"; + } + | { + readonly additionalContextLimit?: number | null; + readonly currentHash: string; + readonly displayOrder: number; + readonly enabled: boolean; + readonly eventName: V2HooksListResponse__HookEventName; + readonly isManaged: boolean; + readonly key: string; + readonly matcher?: string | null; + readonly pluginId?: string | null; + readonly source: V2HooksListResponse__HookSource; + readonly sourcePath: V2HooksListResponse__AbsolutePathBuf; + readonly statusMessage?: string | null; + readonly timeoutSec: number; + readonly trustStatus: V2HooksListResponse__HookTrustStatus; + readonly handlerType: "agent"; + }; +export const V2HooksListResponse__HookMetadata = Schema.Union( + [ + Schema.Struct({ + additionalContextLimit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Configured `additionalContext` spill threshold. `null` uses 2,500 tokens; `0` disables spilling.", + format: "uint", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + currentHash: Schema.String, + displayOrder: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + enabled: Schema.Boolean, + eventName: V2HooksListResponse__HookEventName, + isManaged: Schema.Boolean, + key: Schema.String, + matcher: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + source: V2HooksListResponse__HookSource, + sourcePath: V2HooksListResponse__AbsolutePathBuf, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + timeoutSec: Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + trustStatus: V2HooksListResponse__HookTrustStatus, + async: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + command: Schema.String, + handlerType: Schema.Literal("command"), + }), + Schema.Struct({ + additionalContextLimit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Configured `additionalContext` spill threshold. `null` uses 2,500 tokens; `0` disables spilling.", + format: "uint", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + currentHash: Schema.String, + displayOrder: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + enabled: Schema.Boolean, + eventName: V2HooksListResponse__HookEventName, + isManaged: Schema.Boolean, + key: Schema.String, + matcher: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + source: V2HooksListResponse__HookSource, + sourcePath: V2HooksListResponse__AbsolutePathBuf, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + timeoutSec: Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + trustStatus: V2HooksListResponse__HookTrustStatus, + handlerType: Schema.Literal("mcpTool"), + server: Schema.String, + tool: Schema.String, + }), + Schema.Struct({ + additionalContextLimit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Configured `additionalContext` spill threshold. `null` uses 2,500 tokens; `0` disables spilling.", + format: "uint", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + currentHash: Schema.String, + displayOrder: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + enabled: Schema.Boolean, + eventName: V2HooksListResponse__HookEventName, + isManaged: Schema.Boolean, + key: Schema.String, + matcher: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + source: V2HooksListResponse__HookSource, + sourcePath: V2HooksListResponse__AbsolutePathBuf, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + timeoutSec: Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + trustStatus: V2HooksListResponse__HookTrustStatus, + handlerType: Schema.Literal("prompt"), + }).annotate({ title: "PromptHookMetadata" }), + Schema.Struct({ + additionalContextLimit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Configured `additionalContext` spill threshold. `null` uses 2,500 tokens; `0` disables spilling.", + format: "uint", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + currentHash: Schema.String, + displayOrder: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + enabled: Schema.Boolean, + eventName: V2HooksListResponse__HookEventName, + isManaged: Schema.Boolean, + key: Schema.String, + matcher: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + source: V2HooksListResponse__HookSource, + sourcePath: V2HooksListResponse__AbsolutePathBuf, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + timeoutSec: Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + trustStatus: V2HooksListResponse__HookTrustStatus, + handlerType: Schema.Literal("agent"), + }).annotate({ title: "AgentHookMetadata" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2HooksListResponse__HookMetadata" }); + +export type V2HookStartedNotification__HookOutputEntry = { + readonly kind: V2HookStartedNotification__HookOutputEntryKind; + readonly text: string; +}; +export const V2HookStartedNotification__HookOutputEntry = Schema.Struct({ + kind: V2HookStartedNotification__HookOutputEntryKind, + text: Schema.String, +}).annotate({ identifier: "V2HookStartedNotification__HookOutputEntry" }); + +export type V2ItemCompletedNotification__TextElement = { + readonly byteRange: V2ItemCompletedNotification__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ItemCompletedNotification__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => + V2ItemCompletedNotification__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ItemCompletedNotification__TextElement" }); + +export type V2ItemCompletedNotification__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ItemCompletedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ItemCompletedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ItemCompletedNotification__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ItemCompletedNotification__FunctionCallOutputContentItem", +}); + +export type V2ItemCompletedNotification__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ItemCompletedNotification__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ItemCompletedNotification__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ItemCompletedNotification__MemoryCitation" }); + +export type V2ItemCompletedNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ItemCompletedNotification__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ItemCompletedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ItemCompletedNotification__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemCompletedNotification__CommandAction" }); + +export type V2ItemCompletedNotification__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ItemCompletedNotification__PatchChangeKind; + readonly path: string; +}; +export const V2ItemCompletedNotification__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ItemCompletedNotification__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ItemCompletedNotification__FileUpdateChange" }); + +export type V2ItemCompletedNotification__McpAppUi = { + readonly preferredModelDisplayMode: V2ItemCompletedNotification__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ItemCompletedNotification__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ItemCompletedNotification__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ItemCompletedNotification__McpAppUi", +}); + +export type V2ItemCompletedNotification__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ItemCompletedNotification__CollabAgentStatus; +}; +export const V2ItemCompletedNotification__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ItemCompletedNotification__CollabAgentStatus, +}).annotate({ identifier: "V2ItemCompletedNotification__CollabAgentState" }); + +export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { + readonly kind: "project_roots"; + readonly subpath?: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString | null; + } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { + readonly kind: "unknown"; + readonly path: string; + readonly subpath?: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString | null; + }; +export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath = + Schema.Union( + [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey( + Schema.Union([ + V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, + Schema.Null, + ]), + ), + }).annotate({ title: "KindFileSystemSpecialPath" }), + Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ + title: "TmpdirFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ + title: "SlashTmpFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("unknown"), + path: Schema.String, + subpath: Schema.optionalKey( + Schema.Union([ + V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, + Schema.Null, + ]), + ), + }), + ], + { mode: "oneOf" }, + ).annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath", + }); + +export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReview = { + readonly rationale?: string | null; + readonly riskLevel?: V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel | null; + readonly status: V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus; + readonly userAuthorization?: V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization | null; +}; +export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReview = + Schema.Struct({ + rationale: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + riskLevel: Schema.optionalKey( + Schema.Union([ + V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel, + Schema.Null, + ]), + ), + status: V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus, + userAuthorization: Schema.optionalKey( + Schema.Union([ + V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization, + Schema.Null, + ]), + ), + }).annotate({ + description: + "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReview", + }); + +export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { + readonly kind: "project_roots"; + readonly subpath?: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString | null; + } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { + readonly kind: "unknown"; + readonly path: string; + readonly subpath?: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString | null; + }; +export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath = Schema.Union( + [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey( + Schema.Union([ + V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, + Schema.Null, + ]), + ), + }).annotate({ title: "KindFileSystemSpecialPath" }), + Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ + title: "TmpdirFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ + title: "SlashTmpFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("unknown"), + path: Schema.String, + subpath: Schema.optionalKey( + Schema.Union([ + V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, + Schema.Null, + ]), + ), + }), + ], + { mode: "oneOf" }, +).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath", +}); + +export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReview = { + readonly rationale?: string | null; + readonly riskLevel?: V2ItemGuardianApprovalReviewStartedNotification__GuardianRiskLevel | null; + readonly status: V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus; + readonly userAuthorization?: V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization | null; +}; +export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReview = + Schema.Struct({ + rationale: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + riskLevel: Schema.optionalKey( + Schema.Union([ + V2ItemGuardianApprovalReviewStartedNotification__GuardianRiskLevel, + Schema.Null, + ]), + ), + status: V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus, + userAuthorization: Schema.optionalKey( + Schema.Union([ + V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization, + Schema.Null, + ]), + ), + }).annotate({ + description: + "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + identifier: "V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReview", + }); + +export type V2ItemStartedNotification__TextElement = { + readonly byteRange: V2ItemStartedNotification__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ItemStartedNotification__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ItemStartedNotification__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ItemStartedNotification__TextElement" }); + +export type V2ItemStartedNotification__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ItemStartedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ItemStartedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ItemStartedNotification__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ItemStartedNotification__FunctionCallOutputContentItem", +}); + +export type V2ItemStartedNotification__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ItemStartedNotification__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ItemStartedNotification__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ItemStartedNotification__MemoryCitation" }); + +export type V2ItemStartedNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ItemStartedNotification__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ItemStartedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ItemStartedNotification__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemStartedNotification__CommandAction" }); + +export type V2ItemStartedNotification__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ItemStartedNotification__PatchChangeKind; + readonly path: string; +}; +export const V2ItemStartedNotification__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ItemStartedNotification__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ItemStartedNotification__FileUpdateChange" }); + +export type V2ItemStartedNotification__McpAppUi = { + readonly preferredModelDisplayMode: V2ItemStartedNotification__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ItemStartedNotification__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ItemStartedNotification__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ItemStartedNotification__McpAppUi", +}); + +export type V2ItemStartedNotification__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ItemStartedNotification__CollabAgentStatus; +}; +export const V2ItemStartedNotification__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ItemStartedNotification__CollabAgentStatus, +}).annotate({ identifier: "V2ItemStartedNotification__CollabAgentState" }); + +export type V2ListMcpServerStatusResponse__McpServerStatus = { + readonly authStatus: V2ListMcpServerStatusResponse__McpAuthStatus; + readonly httpOrigin?: string | null; + readonly name: string; + readonly pluginId?: string | null; + readonly resourceTemplates: ReadonlyArray; + readonly resources: ReadonlyArray; + readonly runtimeStatus?: V2ListMcpServerStatusResponse__McpServerConnectionStatus | null; + readonly serverCapabilities?: Schema.Json; + readonly serverInfo?: V2ListMcpServerStatusResponse__McpServerInfo | null; + readonly tools: { readonly [x: string]: V2ListMcpServerStatusResponse__Tool }; + readonly toolsError?: string | null; +}; +export const V2ListMcpServerStatusResponse__McpServerStatus = Schema.Struct({ + authStatus: V2ListMcpServerStatusResponse__McpAuthStatus, + httpOrigin: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "HTTP origin of the effective configured endpoint, including plugin servers. Excludes credentials, path, query, and fragment; null for non-HTTP transports.", + }), + Schema.Null, + ]), + ), + name: Schema.String, + pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + resourceTemplates: Schema.Array(V2ListMcpServerStatusResponse__ResourceTemplate), + resources: Schema.Array(V2ListMcpServerStatusResponse__Resource), + runtimeStatus: Schema.optionalKey( + Schema.Union([V2ListMcpServerStatusResponse__McpServerConnectionStatus, Schema.Null]).annotate({ + description: + "Current thread-runtime connection state; null when unavailable or the configuration changed.", + }), + ), + serverCapabilities: Schema.optionalKey( + Schema.Json.annotate({ + expected: "JSON value", + description: "Capabilities advertised by the initialized MCP server; null when unavailable.", + }), + ), + serverInfo: Schema.optionalKey( + Schema.Union([V2ListMcpServerStatusResponse__McpServerInfo, Schema.Null]), + ), + tools: Schema.Record(Schema.String, V2ListMcpServerStatusResponse__Tool), + toolsError: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Tool discovery failed and no catalog was returned. Null when a catalog is returned, including cached or empty catalogs.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ListMcpServerStatusResponse__McpServerStatus" }); + +export type V2ModelListResponse__ModelAccessPrograms = { + readonly cyber: ReadonlyArray; +}; +export const V2ModelListResponse__ModelAccessPrograms = Schema.Struct({ + cyber: Schema.Array(V2ModelListResponse__CyberAccessProgram).annotate({ + description: "Accepted explicit selections.", + }), +}).annotate({ + description: "Caller-specific explicit access programs advertised by model discovery.", + identifier: "V2ModelListResponse__ModelAccessPrograms", +}); + +export type V2ModelListResponse__ReasoningEffortOption = { + readonly description: string; + readonly reasoningEffort: V2ModelListResponse__ReasoningEffort; +}; +export const V2ModelListResponse__ReasoningEffortOption = Schema.Struct({ + description: Schema.String, + reasoningEffort: V2ModelListResponse__ReasoningEffort, +}).annotate({ identifier: "V2ModelListResponse__ReasoningEffortOption" }); + +export type V2PluginInstalledResponse__MarketplaceLoadErrorInfo = { + readonly marketplacePath: V2PluginInstalledResponse__AbsolutePathBuf; + readonly message: string; +}; +export const V2PluginInstalledResponse__MarketplaceLoadErrorInfo = Schema.Struct({ + marketplacePath: V2PluginInstalledResponse__AbsolutePathBuf, + message: Schema.String, +}).annotate({ identifier: "V2PluginInstalledResponse__MarketplaceLoadErrorInfo" }); + +export type V2PluginInstalledResponse__PluginInterface = { + readonly brandColor?: string | null; + readonly capabilities: ReadonlyArray; + readonly category?: string | null; + readonly composerIcon?: V2PluginInstalledResponse__AbsolutePathBuf | null; + readonly composerIconUrl?: string | null; + readonly defaultPrompt?: ReadonlyArray | null; + readonly developerName?: string | null; + readonly displayName?: string | null; + readonly logo?: V2PluginInstalledResponse__AbsolutePathBuf | null; + readonly logoDark?: V2PluginInstalledResponse__AbsolutePathBuf | null; + readonly logoUrl?: string | null; + readonly logoUrlDark?: string | null; + readonly longDescription?: string | null; + readonly privacyPolicyUrl?: string | null; + readonly screenshotUrls: ReadonlyArray; + readonly screenshots: ReadonlyArray; + readonly shortDescription?: string | null; + readonly termsOfServiceUrl?: string | null; + readonly websiteUrl?: string | null; +}; +export const V2PluginInstalledResponse__PluginInterface = Schema.Struct({ + brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + capabilities: Schema.Array(Schema.String), + category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + composerIcon: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local composer icon path, resolved from the installed plugin package.", + }), + ), + composerIconUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote composer icon URL from the plugin catalog." }), + Schema.Null, + ]), + ), + defaultPrompt: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: + "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + }), + Schema.Null, + ]), + ), + developerName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logo: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local logo path, resolved from the installed plugin package.", + }), + ), + logoDark: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local dark-mode logo path, resolved from the installed plugin package.", + }), + ), + logoUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote logo URL from the plugin catalog." }), + Schema.Null, + ]), + ), + logoUrlDark: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote dark-mode logo URL from the plugin catalog." }), + Schema.Null, + ]), + ), + longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + screenshotUrls: Schema.Array(Schema.String).annotate({ + description: "Remote screenshot URLs from the plugin catalog.", + }), + screenshots: Schema.Array(V2PluginInstalledResponse__AbsolutePathBuf).annotate({ + description: "Local screenshot paths, resolved from the installed plugin package.", + }), + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginInstalledResponse__PluginInterface" }); + +export type V2PluginInstalledResponse__PluginSource = + | { readonly path: V2PluginInstalledResponse__AbsolutePathBuf; readonly type: "local" } + | { + readonly path?: string | null; + readonly refName?: string | null; + readonly sha?: string | null; + readonly type: "git"; + readonly url: string; + } + | { + readonly package: string; + readonly registry?: string | null; + readonly type: "npm"; + readonly version?: string | null; + } + | { readonly type: "remote" }; +export const V2PluginInstalledResponse__PluginSource = Schema.Union( + [ + Schema.Struct({ + path: V2PluginInstalledResponse__AbsolutePathBuf, + type: Schema.Literal("local").annotate({ title: "LocalPluginSourceType" }), + }).annotate({ title: "LocalPluginSource" }), + Schema.Struct({ + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("git").annotate({ title: "GitPluginSourceType" }), + url: Schema.String, + }).annotate({ title: "GitPluginSource" }), + Schema.Struct({ + package: Schema.String, + registry: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional HTTPS registry URL. Authentication stays in the user's npm config.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("npm").annotate({ title: "NpmPluginSourceType" }), + version: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Optional npm version or version range." }), + Schema.Null, + ]), + ), + }).annotate({ title: "NpmPluginSource" }), + Schema.Struct({ + type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), + }).annotate({ + title: "RemotePluginSource", + description: + "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginInstalledResponse__PluginSource" }); + +export type V2PluginInstalledResponse__PluginSharePrincipal = { + readonly name: string; + readonly principalId: string; + readonly principalType: V2PluginInstalledResponse__PluginSharePrincipalType; + readonly role: V2PluginInstalledResponse__PluginSharePrincipalRole; +}; +export const V2PluginInstalledResponse__PluginSharePrincipal = Schema.Struct({ + name: Schema.String, + principalId: Schema.String, + principalType: V2PluginInstalledResponse__PluginSharePrincipalType, + role: V2PluginInstalledResponse__PluginSharePrincipalRole, +}).annotate({ identifier: "V2PluginInstalledResponse__PluginSharePrincipal" }); + +export type V2PluginListResponse__MarketplaceLoadErrorInfo = { + readonly marketplacePath: V2PluginListResponse__AbsolutePathBuf; + readonly message: string; +}; +export const V2PluginListResponse__MarketplaceLoadErrorInfo = Schema.Struct({ + marketplacePath: V2PluginListResponse__AbsolutePathBuf, + message: Schema.String, +}).annotate({ identifier: "V2PluginListResponse__MarketplaceLoadErrorInfo" }); + +export type V2PluginListResponse__PluginInterface = { + readonly brandColor?: string | null; + readonly capabilities: ReadonlyArray; + readonly category?: string | null; + readonly composerIcon?: V2PluginListResponse__AbsolutePathBuf | null; + readonly composerIconUrl?: string | null; + readonly defaultPrompt?: ReadonlyArray | null; + readonly developerName?: string | null; + readonly displayName?: string | null; + readonly logo?: V2PluginListResponse__AbsolutePathBuf | null; + readonly logoDark?: V2PluginListResponse__AbsolutePathBuf | null; + readonly logoUrl?: string | null; + readonly logoUrlDark?: string | null; + readonly longDescription?: string | null; + readonly privacyPolicyUrl?: string | null; + readonly screenshotUrls: ReadonlyArray; + readonly screenshots: ReadonlyArray; + readonly shortDescription?: string | null; + readonly termsOfServiceUrl?: string | null; + readonly websiteUrl?: string | null; +}; +export const V2PluginListResponse__PluginInterface = Schema.Struct({ + brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + capabilities: Schema.Array(Schema.String), + category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + composerIcon: Schema.optionalKey( + Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local composer icon path, resolved from the installed plugin package.", + }), + ), + composerIconUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote composer icon URL from the plugin catalog." }), + Schema.Null, + ]), + ), + defaultPrompt: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: + "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + }), + Schema.Null, + ]), + ), + developerName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logo: Schema.optionalKey( + Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local logo path, resolved from the installed plugin package.", + }), + ), + logoDark: Schema.optionalKey( + Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local dark-mode logo path, resolved from the installed plugin package.", + }), + ), + logoUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote logo URL from the plugin catalog." }), + Schema.Null, + ]), + ), + logoUrlDark: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote dark-mode logo URL from the plugin catalog." }), + Schema.Null, + ]), + ), + longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + screenshotUrls: Schema.Array(Schema.String).annotate({ + description: "Remote screenshot URLs from the plugin catalog.", + }), + screenshots: Schema.Array(V2PluginListResponse__AbsolutePathBuf).annotate({ + description: "Local screenshot paths, resolved from the installed plugin package.", + }), + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginListResponse__PluginInterface" }); + +export type V2PluginListResponse__PluginSource = + | { readonly path: V2PluginListResponse__AbsolutePathBuf; readonly type: "local" } + | { + readonly path?: string | null; + readonly refName?: string | null; + readonly sha?: string | null; + readonly type: "git"; + readonly url: string; + } + | { + readonly package: string; + readonly registry?: string | null; + readonly type: "npm"; + readonly version?: string | null; + } + | { readonly type: "remote" }; +export const V2PluginListResponse__PluginSource = Schema.Union( + [ + Schema.Struct({ + path: V2PluginListResponse__AbsolutePathBuf, + type: Schema.Literal("local").annotate({ title: "LocalPluginSourceType" }), + }).annotate({ title: "LocalPluginSource" }), + Schema.Struct({ + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("git").annotate({ title: "GitPluginSourceType" }), + url: Schema.String, + }).annotate({ title: "GitPluginSource" }), + Schema.Struct({ + package: Schema.String, + registry: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional HTTPS registry URL. Authentication stays in the user's npm config.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("npm").annotate({ title: "NpmPluginSourceType" }), + version: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Optional npm version or version range." }), + Schema.Null, + ]), + ), + }).annotate({ title: "NpmPluginSource" }), + Schema.Struct({ + type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), + }).annotate({ + title: "RemotePluginSource", + description: + "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginListResponse__PluginSource" }); + +export type V2PluginListResponse__PluginSharePrincipal = { + readonly name: string; + readonly principalId: string; + readonly principalType: V2PluginListResponse__PluginSharePrincipalType; + readonly role: V2PluginListResponse__PluginSharePrincipalRole; +}; +export const V2PluginListResponse__PluginSharePrincipal = Schema.Struct({ + name: Schema.String, + principalId: Schema.String, + principalType: V2PluginListResponse__PluginSharePrincipalType, + role: V2PluginListResponse__PluginSharePrincipalRole, +}).annotate({ identifier: "V2PluginListResponse__PluginSharePrincipal" }); + +export type V2PluginReadResponse__AppTemplateSummary = { + readonly canonicalConnectorId?: string | null; + readonly category?: string | null; + readonly description?: string | null; + readonly logoUrl?: string | null; + readonly logoUrlDark?: string | null; + readonly materializedAppIds: ReadonlyArray; + readonly name: string; + readonly reason?: V2PluginReadResponse__AppTemplateUnavailableReason | null; + readonly templateId: string; +}; +export const V2PluginReadResponse__AppTemplateSummary = Schema.Struct({ + canonicalConnectorId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logoUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logoUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + materializedAppIds: Schema.Array(Schema.String), + name: Schema.String, + reason: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__AppTemplateUnavailableReason, Schema.Null]), + ), + templateId: Schema.String, +}).annotate({ identifier: "V2PluginReadResponse__AppTemplateSummary" }); + +export type V2PluginReadResponse__PluginHookSummary = { + readonly eventName: V2PluginReadResponse__HookEventName; + readonly key: string; +}; +export const V2PluginReadResponse__PluginHookSummary = Schema.Struct({ + eventName: V2PluginReadResponse__HookEventName, + key: Schema.String, +}).annotate({ identifier: "V2PluginReadResponse__PluginHookSummary" }); + +export type V2PluginReadResponse__SkillInterface = { + readonly brandColor?: string | null; + readonly defaultPrompt?: string | null; + readonly displayName?: string | null; + readonly iconLarge?: V2PluginReadResponse__AbsolutePathBuf | null; + readonly iconLargeUrl?: string | null; + readonly iconSmall?: V2PluginReadResponse__AbsolutePathBuf | null; + readonly iconSmallUrl?: string | null; + readonly shortDescription?: string | null; +}; +export const V2PluginReadResponse__SkillInterface = Schema.Struct({ + brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + defaultPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconLarge: Schema.optionalKey(Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null])), + iconLargeUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote large icon URL from the plugin catalog." }), + Schema.Null, + ]), + ), + iconSmall: Schema.optionalKey(Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null])), + iconSmallUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote small icon URL from the plugin catalog." }), + Schema.Null, + ]), + ), + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginReadResponse__SkillInterface" }); + +export type V2PluginReadResponse__PluginInterface = { + readonly brandColor?: string | null; + readonly capabilities: ReadonlyArray; + readonly category?: string | null; + readonly composerIcon?: V2PluginReadResponse__AbsolutePathBuf | null; + readonly composerIconUrl?: string | null; + readonly defaultPrompt?: ReadonlyArray | null; + readonly developerName?: string | null; + readonly displayName?: string | null; + readonly logo?: V2PluginReadResponse__AbsolutePathBuf | null; + readonly logoDark?: V2PluginReadResponse__AbsolutePathBuf | null; + readonly logoUrl?: string | null; + readonly logoUrlDark?: string | null; + readonly longDescription?: string | null; + readonly privacyPolicyUrl?: string | null; + readonly screenshotUrls: ReadonlyArray; + readonly screenshots: ReadonlyArray; + readonly shortDescription?: string | null; + readonly termsOfServiceUrl?: string | null; + readonly websiteUrl?: string | null; +}; +export const V2PluginReadResponse__PluginInterface = Schema.Struct({ + brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + capabilities: Schema.Array(Schema.String), + category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + composerIcon: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local composer icon path, resolved from the installed plugin package.", + }), + ), + composerIconUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote composer icon URL from the plugin catalog." }), + Schema.Null, + ]), + ), + defaultPrompt: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: + "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + }), + Schema.Null, + ]), + ), + developerName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logo: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local logo path, resolved from the installed plugin package.", + }), + ), + logoDark: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local dark-mode logo path, resolved from the installed plugin package.", + }), + ), + logoUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote logo URL from the plugin catalog." }), + Schema.Null, + ]), + ), + logoUrlDark: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote dark-mode logo URL from the plugin catalog." }), + Schema.Null, + ]), + ), + longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + screenshotUrls: Schema.Array(Schema.String).annotate({ + description: "Remote screenshot URLs from the plugin catalog.", + }), + screenshots: Schema.Array(V2PluginReadResponse__AbsolutePathBuf).annotate({ + description: "Local screenshot paths, resolved from the installed plugin package.", + }), + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginReadResponse__PluginInterface" }); + +export type V2PluginReadResponse__PluginSource = + | { readonly path: V2PluginReadResponse__AbsolutePathBuf; readonly type: "local" } + | { + readonly path?: string | null; + readonly refName?: string | null; + readonly sha?: string | null; + readonly type: "git"; + readonly url: string; + } + | { + readonly package: string; + readonly registry?: string | null; + readonly type: "npm"; + readonly version?: string | null; + } + | { readonly type: "remote" }; +export const V2PluginReadResponse__PluginSource = Schema.Union( + [ + Schema.Struct({ + path: V2PluginReadResponse__AbsolutePathBuf, + type: Schema.Literal("local").annotate({ title: "LocalPluginSourceType" }), + }).annotate({ title: "LocalPluginSource" }), + Schema.Struct({ + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("git").annotate({ title: "GitPluginSourceType" }), + url: Schema.String, + }).annotate({ title: "GitPluginSource" }), + Schema.Struct({ + package: Schema.String, + registry: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional HTTPS registry URL. Authentication stays in the user's npm config.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("npm").annotate({ title: "NpmPluginSourceType" }), + version: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Optional npm version or version range." }), + Schema.Null, + ]), + ), + }).annotate({ title: "NpmPluginSource" }), + Schema.Struct({ + type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), + }).annotate({ + title: "RemotePluginSource", + description: + "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginReadResponse__PluginSource" }); + +export type V2PluginReadResponse__ScheduledTaskSchedule = + | { + readonly days?: ReadonlyArray | null; + readonly intervalHours: number; + readonly type: "hourly"; + } + | { readonly time: string; readonly type: "daily" } + | { readonly time: string; readonly type: "weekdays" } + | { + readonly days: ReadonlyArray; + readonly time: string; + readonly type: "weekly"; + }; +export const V2PluginReadResponse__ScheduledTaskSchedule = Schema.Union( + [ + Schema.Struct({ + days: Schema.optionalKey( + Schema.Union([Schema.Array(V2PluginReadResponse__ScheduledTaskWeekday), Schema.Null]), + ), + intervalHours: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + type: Schema.Literal("hourly").annotate({ title: "HourlyScheduledTaskScheduleType" }), + }).annotate({ title: "HourlyScheduledTaskSchedule" }), + Schema.Struct({ + time: Schema.String, + type: Schema.Literal("daily").annotate({ title: "DailyScheduledTaskScheduleType" }), + }).annotate({ title: "DailyScheduledTaskSchedule" }), + Schema.Struct({ + time: Schema.String, + type: Schema.Literal("weekdays").annotate({ title: "WeekdaysScheduledTaskScheduleType" }), + }).annotate({ title: "WeekdaysScheduledTaskSchedule" }), + Schema.Struct({ + days: Schema.Array(V2PluginReadResponse__ScheduledTaskWeekday), + time: Schema.String, + type: Schema.Literal("weekly").annotate({ title: "WeeklyScheduledTaskScheduleType" }), + }).annotate({ title: "WeeklyScheduledTaskSchedule" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginReadResponse__ScheduledTaskSchedule" }); + +export type V2PluginReadResponse__PluginSharePrincipal = { + readonly name: string; + readonly principalId: string; + readonly principalType: V2PluginReadResponse__PluginSharePrincipalType; + readonly role: V2PluginReadResponse__PluginSharePrincipalRole; +}; +export const V2PluginReadResponse__PluginSharePrincipal = Schema.Struct({ + name: Schema.String, + principalId: Schema.String, + principalType: V2PluginReadResponse__PluginSharePrincipalType, + role: V2PluginReadResponse__PluginSharePrincipalRole, +}).annotate({ identifier: "V2PluginReadResponse__PluginSharePrincipal" }); + +export type V2PluginShareListResponse__PluginInterface = { + readonly brandColor?: string | null; + readonly capabilities: ReadonlyArray; + readonly category?: string | null; + readonly composerIcon?: V2PluginShareListResponse__AbsolutePathBuf | null; + readonly composerIconUrl?: string | null; + readonly defaultPrompt?: ReadonlyArray | null; + readonly developerName?: string | null; + readonly displayName?: string | null; + readonly logo?: V2PluginShareListResponse__AbsolutePathBuf | null; + readonly logoDark?: V2PluginShareListResponse__AbsolutePathBuf | null; + readonly logoUrl?: string | null; + readonly logoUrlDark?: string | null; + readonly longDescription?: string | null; + readonly privacyPolicyUrl?: string | null; + readonly screenshotUrls: ReadonlyArray; + readonly screenshots: ReadonlyArray; + readonly shortDescription?: string | null; + readonly termsOfServiceUrl?: string | null; + readonly websiteUrl?: string | null; +}; +export const V2PluginShareListResponse__PluginInterface = Schema.Struct({ + brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + capabilities: Schema.Array(Schema.String), + category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + composerIcon: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local composer icon path, resolved from the installed plugin package.", + }), + ), + composerIconUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote composer icon URL from the plugin catalog." }), + Schema.Null, + ]), + ), + defaultPrompt: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: + "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + }), + Schema.Null, + ]), + ), + developerName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logo: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local logo path, resolved from the installed plugin package.", + }), + ), + logoDark: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local dark-mode logo path, resolved from the installed plugin package.", + }), + ), + logoUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote logo URL from the plugin catalog." }), + Schema.Null, + ]), + ), + logoUrlDark: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote dark-mode logo URL from the plugin catalog." }), + Schema.Null, + ]), + ), + longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + screenshotUrls: Schema.Array(Schema.String).annotate({ + description: "Remote screenshot URLs from the plugin catalog.", + }), + screenshots: Schema.Array(V2PluginShareListResponse__AbsolutePathBuf).annotate({ + description: "Local screenshot paths, resolved from the installed plugin package.", + }), + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginShareListResponse__PluginInterface" }); + +export type V2PluginShareListResponse__PluginSource = + | { readonly path: V2PluginShareListResponse__AbsolutePathBuf; readonly type: "local" } + | { + readonly path?: string | null; + readonly refName?: string | null; + readonly sha?: string | null; + readonly type: "git"; + readonly url: string; + } + | { + readonly package: string; + readonly registry?: string | null; + readonly type: "npm"; + readonly version?: string | null; + } + | { readonly type: "remote" }; +export const V2PluginShareListResponse__PluginSource = Schema.Union( + [ + Schema.Struct({ + path: V2PluginShareListResponse__AbsolutePathBuf, + type: Schema.Literal("local").annotate({ title: "LocalPluginSourceType" }), + }).annotate({ title: "LocalPluginSource" }), + Schema.Struct({ + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + sha: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("git").annotate({ title: "GitPluginSourceType" }), + url: Schema.String, + }).annotate({ title: "GitPluginSource" }), + Schema.Struct({ + package: Schema.String, + registry: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional HTTPS registry URL. Authentication stays in the user's npm config.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("npm").annotate({ title: "NpmPluginSourceType" }), + version: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Optional npm version or version range." }), + Schema.Null, + ]), + ), + }).annotate({ title: "NpmPluginSource" }), + Schema.Struct({ + type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), + }).annotate({ + title: "RemotePluginSource", + description: + "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2PluginShareListResponse__PluginSource" }); + +export type V2PluginShareListResponse__PluginSharePrincipal = { + readonly name: string; + readonly principalId: string; + readonly principalType: V2PluginShareListResponse__PluginSharePrincipalType; + readonly role: V2PluginShareListResponse__PluginSharePrincipalRole; +}; +export const V2PluginShareListResponse__PluginSharePrincipal = Schema.Struct({ + name: Schema.String, + principalId: Schema.String, + principalType: V2PluginShareListResponse__PluginSharePrincipalType, + role: V2PluginShareListResponse__PluginSharePrincipalRole, +}).annotate({ identifier: "V2PluginShareListResponse__PluginSharePrincipal" }); + +export type V2PluginShareSaveParams__PluginShareTarget = { + readonly principalId: string; + readonly principalType: V2PluginShareSaveParams__PluginSharePrincipalType; + readonly role: V2PluginShareSaveParams__PluginShareTargetRole; +}; +export const V2PluginShareSaveParams__PluginShareTarget = Schema.Struct({ + principalId: Schema.String, + principalType: V2PluginShareSaveParams__PluginSharePrincipalType, + role: V2PluginShareSaveParams__PluginShareTargetRole, +}).annotate({ identifier: "V2PluginShareSaveParams__PluginShareTarget" }); + +export type V2PluginShareUpdateTargetsParams__PluginShareTarget = { + readonly principalId: string; + readonly principalType: V2PluginShareUpdateTargetsParams__PluginSharePrincipalType; + readonly role: V2PluginShareUpdateTargetsParams__PluginShareTargetRole; +}; +export const V2PluginShareUpdateTargetsParams__PluginShareTarget = Schema.Struct({ + principalId: Schema.String, + principalType: V2PluginShareUpdateTargetsParams__PluginSharePrincipalType, + role: V2PluginShareUpdateTargetsParams__PluginShareTargetRole, +}).annotate({ identifier: "V2PluginShareUpdateTargetsParams__PluginShareTarget" }); + +export type V2PluginShareUpdateTargetsResponse__PluginSharePrincipal = { + readonly name: string; + readonly principalId: string; + readonly principalType: V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType; + readonly role: V2PluginShareUpdateTargetsResponse__PluginSharePrincipalRole; +}; +export const V2PluginShareUpdateTargetsResponse__PluginSharePrincipal = Schema.Struct({ + name: Schema.String, + principalId: Schema.String, + principalType: V2PluginShareUpdateTargetsResponse__PluginSharePrincipalType, + role: V2PluginShareUpdateTargetsResponse__PluginSharePrincipalRole, +}).annotate({ identifier: "V2PluginShareUpdateTargetsResponse__PluginSharePrincipal" }); + +export type V2RawResponseItemCompletedNotification__ContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2RawResponseItemCompletedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2RawResponseItemCompletedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly text: string; readonly type: "output_text" }; +export const V2RawResponseItemCompletedNotification__ContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), + }).annotate({ title: "InputTextContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + file_id: Schema.String, + }).annotate({ title: "FileIdContentItem" }), + ]).annotate({ title: "InputImageContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ title: "InputAudioContentItemType" }), + }).annotate({ title: "InputAudioContentItem" }), + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), + }).annotate({ title: "OutputTextContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2RawResponseItemCompletedNotification__ContentItem" }); + +export type V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2RawResponseItemCompletedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2RawResponseItemCompletedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem", +}); + +export type V2RawResponseItemCompletedNotification__ConfigurationReasoning = { + readonly effort: V2RawResponseItemCompletedNotification__ReasoningEffort; +}; +export const V2RawResponseItemCompletedNotification__ConfigurationReasoning = Schema.Struct({ + effort: V2RawResponseItemCompletedNotification__ReasoningEffort, +}).annotate({ + description: "Reasoning settings interpreted by the backend for the routed model.", + identifier: "V2RawResponseItemCompletedNotification__ConfigurationReasoning", +}); + +export type V2ReviewStartResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ReviewStartResponse__NonSteerableTurnKind; + }; + }; +export const V2ReviewStartResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ReviewStartResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ReviewStartResponse__CodexErrorInfo", +}); + +export type V2ReviewStartResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ReviewStartResponse__MisalignmentSteer | null; +}; +export const V2ReviewStartResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ReviewStartResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ReviewStartResponse__MisalignmentErrorDetails" }); + +export type V2ReviewStartResponse__TextElement = { + readonly byteRange: V2ReviewStartResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ReviewStartResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ReviewStartResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ReviewStartResponse__TextElement" }); + +export type V2ReviewStartResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ReviewStartResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ReviewStartResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ReviewStartResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ReviewStartResponse__FunctionCallOutputContentItem", +}); + +export type V2ReviewStartResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ReviewStartResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ReviewStartResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ReviewStartResponse__MemoryCitation" }); + +export type V2ReviewStartResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ReviewStartResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ReviewStartResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ReviewStartResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ReviewStartResponse__CommandAction" }); + +export type V2ReviewStartResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ReviewStartResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ReviewStartResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ReviewStartResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ReviewStartResponse__FileUpdateChange" }); + +export type V2ReviewStartResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ReviewStartResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ReviewStartResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ReviewStartResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ReviewStartResponse__McpAppUi", +}); + +export type V2ReviewStartResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ReviewStartResponse__CollabAgentStatus; +}; +export const V2ReviewStartResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ReviewStartResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ReviewStartResponse__CollabAgentState" }); + +export type V2SkillsListResponse__SkillDependencies = { + readonly tools: ReadonlyArray; +}; +export const V2SkillsListResponse__SkillDependencies = Schema.Struct({ + tools: Schema.Array(V2SkillsListResponse__SkillToolDependency), +}).annotate({ identifier: "V2SkillsListResponse__SkillDependencies" }); + +export type V2SkillsListResponse__SkillInterface = { + readonly brandColor?: string | null; + readonly defaultPrompt?: string | null; + readonly displayName?: string | null; + readonly iconLarge?: V2SkillsListResponse__AbsolutePathBuf | null; + readonly iconLargeUrl?: string | null; + readonly iconSmall?: V2SkillsListResponse__AbsolutePathBuf | null; + readonly iconSmallUrl?: string | null; + readonly shortDescription?: string | null; +}; +export const V2SkillsListResponse__SkillInterface = Schema.Struct({ + brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + defaultPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconLarge: Schema.optionalKey(Schema.Union([V2SkillsListResponse__AbsolutePathBuf, Schema.Null])), + iconLargeUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote large icon URL from the plugin catalog." }), + Schema.Null, + ]), + ), + iconSmall: Schema.optionalKey(Schema.Union([V2SkillsListResponse__AbsolutePathBuf, Schema.Null])), + iconSmallUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Remote small icon URL from the plugin catalog." }), + Schema.Null, + ]), + ), + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2SkillsListResponse__SkillInterface" }); + +export type V2ThreadForkResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadForkResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadForkResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadForkResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__CommandAction" }); + +export type V2ThreadForkResponse__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { readonly networkAccess?: boolean; readonly type: "readOnly" } + | { + readonly networkAccess?: V2ThreadForkResponse__NetworkAccess; + readonly type: "externalSandbox"; + } + | { + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly type: "workspaceWrite"; + readonly writableRoots?: ReadonlyArray; + }; +export const V2ThreadForkResponse__SandboxPolicy = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("dangerFullAccess").annotate({ + title: "DangerFullAccessSandboxPolicyType", + }), + }).annotate({ title: "DangerFullAccessSandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), + }).annotate({ title: "ReadOnlySandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadForkResponse__NetworkAccess, + ).annotate({ default: "restricted" }), + ), + type: Schema.Literal("externalSandbox").annotate({ + title: "ExternalSandboxSandboxPolicyType", + }), + }).annotate({ title: "ExternalSandboxSandboxPolicy" }), + Schema.Struct({ + excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), + writableRoots: Schema.optionalKey( + Schema.Array(V2ThreadForkResponse__AbsolutePathBuf).annotate({ default: [] }), + ), + }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__SandboxPolicy" }); + +export type V2ThreadForkResponse__ThreadSection = { + readonly appearance?: V2ThreadForkResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadForkResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadForkResponse__ThreadSection", +}); + +export type V2ThreadForkResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadForkResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadForkResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadForkResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadForkResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__SubAgentSource" }); + +export type V2ThreadForkResponse__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadForkResponse__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadForkResponse__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__ThreadStatus" }); + +export type V2ThreadForkResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadForkResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadForkResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadForkResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadForkResponse__CodexErrorInfo", +}); + +export type V2ThreadForkResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadForkResponse__MisalignmentSteer | null; +}; +export const V2ThreadForkResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadForkResponse__MisalignmentErrorDetails" }); + +export type V2ThreadForkResponse__TextElement = { + readonly byteRange: V2ThreadForkResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadForkResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadForkResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadForkResponse__TextElement" }); + +export type V2ThreadForkResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadForkResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadForkResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadForkResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadForkResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadForkResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadForkResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadForkResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadForkResponse__MemoryCitation" }); + +export type V2ThreadForkResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadForkResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadForkResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadForkResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadForkResponse__FileUpdateChange" }); + +export type V2ThreadForkResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadForkResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadForkResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadForkResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadForkResponse__McpAppUi", +}); + +export type V2ThreadForkResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadForkResponse__CollabAgentStatus; +}; +export const V2ThreadForkResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadForkResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadForkResponse__CollabAgentState" }); + +export type V2ThreadGoalGetResponse__ThreadGoal = { + readonly createdAt: number; + readonly objective: string; + readonly status: V2ThreadGoalGetResponse__ThreadGoalStatus; + readonly threadId: string; + readonly timeUsedSeconds: number; + readonly tokenBudget?: number | null; + readonly tokensUsed: number; + readonly updatedAt: number; +}; +export const V2ThreadGoalGetResponse__ThreadGoal = Schema.Struct({ + createdAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + objective: Schema.String, + status: V2ThreadGoalGetResponse__ThreadGoalStatus, + threadId: Schema.String, + timeUsedSeconds: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + tokenBudget: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + tokensUsed: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + updatedAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +}).annotate({ identifier: "V2ThreadGoalGetResponse__ThreadGoal" }); + +export type V2ThreadGoalSetResponse__ThreadGoal = { + readonly createdAt: number; + readonly objective: string; + readonly status: V2ThreadGoalSetResponse__ThreadGoalStatus; + readonly threadId: string; + readonly timeUsedSeconds: number; + readonly tokenBudget?: number | null; + readonly tokensUsed: number; + readonly updatedAt: number; +}; +export const V2ThreadGoalSetResponse__ThreadGoal = Schema.Struct({ + createdAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + objective: Schema.String, + status: V2ThreadGoalSetResponse__ThreadGoalStatus, + threadId: Schema.String, + timeUsedSeconds: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + tokenBudget: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + tokensUsed: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + updatedAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +}).annotate({ identifier: "V2ThreadGoalSetResponse__ThreadGoal" }); + +export type V2ThreadGoalUpdatedNotification__ThreadGoal = { + readonly createdAt: number; + readonly objective: string; + readonly status: V2ThreadGoalUpdatedNotification__ThreadGoalStatus; + readonly threadId: string; + readonly timeUsedSeconds: number; + readonly tokenBudget?: number | null; + readonly tokensUsed: number; + readonly updatedAt: number; +}; +export const V2ThreadGoalUpdatedNotification__ThreadGoal = Schema.Struct({ + createdAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + objective: Schema.String, + status: V2ThreadGoalUpdatedNotification__ThreadGoalStatus, + threadId: Schema.String, + timeUsedSeconds: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + tokenBudget: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + tokensUsed: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + updatedAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), +}).annotate({ identifier: "V2ThreadGoalUpdatedNotification__ThreadGoal" }); + +export type V2ThreadItemsListParams__ThreadItemsListCursor = + | string + | V2ThreadItemsListParams__ThreadItemsListAnchor; +export const V2ThreadItemsListParams__ThreadItemsListCursor = Schema.Union([ + Schema.String, + V2ThreadItemsListParams__ThreadItemsListAnchor, +]).annotate({ + description: "Starting position for an item-history page.", + identifier: "V2ThreadItemsListParams__ThreadItemsListCursor", +}); + +export type V2ThreadItemsListResponse__TextElement = { + readonly byteRange: V2ThreadItemsListResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadItemsListResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadItemsListResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadItemsListResponse__TextElement" }); + +export type V2ThreadItemsListResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadItemsListResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadItemsListResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadItemsListResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadItemsListResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadItemsListResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadItemsListResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadItemsListResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadItemsListResponse__MemoryCitation" }); + +export type V2ThreadItemsListResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadItemsListResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadItemsListResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadItemsListResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadItemsListResponse__CommandAction" }); + +export type V2ThreadItemsListResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadItemsListResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadItemsListResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadItemsListResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadItemsListResponse__FileUpdateChange" }); + +export type V2ThreadItemsListResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadItemsListResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadItemsListResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadItemsListResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadItemsListResponse__McpAppUi", +}); + +export type V2ThreadItemsListResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadItemsListResponse__CollabAgentStatus; +}; +export const V2ThreadItemsListResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadItemsListResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadItemsListResponse__CollabAgentState" }); + +export type V2ThreadListResponse__ThreadSection = { + readonly appearance?: V2ThreadListResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadListResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadListResponse__ThreadSection", +}); + +export type V2ThreadListResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadListResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadListResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadListResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadListResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadListResponse__SubAgentSource" }); + +export type V2ThreadListResponse__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadListResponse__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadListResponse__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadListResponse__ThreadStatus" }); + +export type V2ThreadListResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadListResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadListResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadListResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadListResponse__CodexErrorInfo", +}); + +export type V2ThreadListResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadListResponse__MisalignmentSteer | null; +}; +export const V2ThreadListResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadListResponse__MisalignmentErrorDetails" }); + +export type V2ThreadListResponse__TextElement = { + readonly byteRange: V2ThreadListResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadListResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadListResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadListResponse__TextElement" }); + +export type V2ThreadListResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadListResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadListResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadListResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadListResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadListResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadListResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadListResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadListResponse__MemoryCitation" }); + +export type V2ThreadListResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadListResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadListResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadListResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadListResponse__CommandAction" }); + +export type V2ThreadListResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadListResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadListResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadListResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadListResponse__FileUpdateChange" }); + +export type V2ThreadListResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadListResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadListResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadListResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadListResponse__McpAppUi", +}); + +export type V2ThreadListResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadListResponse__CollabAgentStatus; +}; +export const V2ThreadListResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadListResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadListResponse__CollabAgentState" }); + +export type V2ThreadMetadataUpdateResponse__ThreadSection = { + readonly appearance?: V2ThreadMetadataUpdateResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadMetadataUpdateResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadMetadataUpdateResponse__ThreadSection", +}); + +export type V2ThreadMetadataUpdateResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadMetadataUpdateResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadMetadataUpdateResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadMetadataUpdateResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadMetadataUpdateResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__SubAgentSource" }); + +export type V2ThreadMetadataUpdateResponse__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadMetadataUpdateResponse__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadMetadataUpdateResponse__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__ThreadStatus" }); + +export type V2ThreadMetadataUpdateResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadMetadataUpdateResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadMetadataUpdateResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadMetadataUpdateResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadMetadataUpdateResponse__CodexErrorInfo", +}); + +export type V2ThreadMetadataUpdateResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadMetadataUpdateResponse__MisalignmentSteer | null; +}; +export const V2ThreadMetadataUpdateResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__MisalignmentErrorDetails" }); + +export type V2ThreadMetadataUpdateResponse__TextElement = { + readonly byteRange: V2ThreadMetadataUpdateResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadMetadataUpdateResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__TextElement" }); + +export type V2ThreadMetadataUpdateResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadMetadataUpdateResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadMetadataUpdateResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadMetadataUpdateResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadMetadataUpdateResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadMetadataUpdateResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadMetadataUpdateResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadMetadataUpdateResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__MemoryCitation" }); + +export type V2ThreadMetadataUpdateResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadMetadataUpdateResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadMetadataUpdateResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadMetadataUpdateResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__CommandAction" }); + +export type V2ThreadMetadataUpdateResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadMetadataUpdateResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadMetadataUpdateResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadMetadataUpdateResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__FileUpdateChange" }); + +export type V2ThreadMetadataUpdateResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadMetadataUpdateResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadMetadataUpdateResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadMetadataUpdateResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadMetadataUpdateResponse__McpAppUi", +}); + +export type V2ThreadMetadataUpdateResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadMetadataUpdateResponse__CollabAgentStatus; +}; +export const V2ThreadMetadataUpdateResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadMetadataUpdateResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__CollabAgentState" }); + +export type V2ThreadReadResponse__ThreadSection = { + readonly appearance?: V2ThreadReadResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadReadResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadReadResponse__ThreadSection", +}); + +export type V2ThreadReadResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadReadResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadReadResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadReadResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadReadResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadReadResponse__SubAgentSource" }); + +export type V2ThreadReadResponse__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadReadResponse__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadReadResponse__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadReadResponse__ThreadStatus" }); + +export type V2ThreadReadResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadReadResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadReadResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadReadResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadReadResponse__CodexErrorInfo", +}); + +export type V2ThreadReadResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadReadResponse__MisalignmentSteer | null; +}; +export const V2ThreadReadResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadReadResponse__MisalignmentErrorDetails" }); + +export type V2ThreadReadResponse__TextElement = { + readonly byteRange: V2ThreadReadResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadReadResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadReadResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadReadResponse__TextElement" }); + +export type V2ThreadReadResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadReadResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadReadResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadReadResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadReadResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadReadResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadReadResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadReadResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadReadResponse__MemoryCitation" }); + +export type V2ThreadReadResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadReadResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadReadResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadReadResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadReadResponse__CommandAction" }); + +export type V2ThreadReadResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadReadResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadReadResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadReadResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadReadResponse__FileUpdateChange" }); + +export type V2ThreadReadResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadReadResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadReadResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadReadResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadReadResponse__McpAppUi", +}); + +export type V2ThreadReadResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadReadResponse__CollabAgentStatus; +}; +export const V2ThreadReadResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadReadResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadReadResponse__CollabAgentState" }); + +export type V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeItem = + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly type: "realtimeSessionStarted"; + } + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly role: V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeTranscriptRole; + readonly text: string; + readonly type: "transcriptSegment"; + } + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly item_id: string; + readonly presentation: V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeBemItemPresentation; + readonly turn_id: string; + readonly type: "bemItemPromoted"; + } + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly outcome: V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeSessionOutcome; + readonly type: "realtimeSessionClosed"; + }; +export const V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeItem = Schema.Union( + [ + Schema.Struct({ + id: Schema.String, + realtimeSessionId: Schema.String, + type: Schema.Literal("realtimeSessionStarted").annotate({ + title: "RealtimeSessionStartedThreadRealtimeItemType", + }), + }).annotate({ title: "RealtimeSessionStartedThreadRealtimeItem" }), + Schema.Struct({ + id: Schema.String, + realtimeSessionId: Schema.String, + role: V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeTranscriptRole, + text: Schema.String, + type: Schema.Literal("transcriptSegment").annotate({ + title: "TranscriptSegmentThreadRealtimeItemType", + }), + }).annotate({ title: "TranscriptSegmentThreadRealtimeItem" }), + Schema.Struct({ + id: Schema.String, + realtimeSessionId: Schema.String, + item_id: Schema.String, + presentation: V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeBemItemPresentation, + turn_id: Schema.String, + type: Schema.Literal("bemItemPromoted").annotate({ + title: "BemItemPromotedThreadRealtimeItemType", + }), + }).annotate({ title: "BemItemPromotedThreadRealtimeItem" }), + Schema.Struct({ + id: Schema.String, + realtimeSessionId: Schema.String, + outcome: V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeSessionOutcome, + type: Schema.Literal("realtimeSessionClosed").annotate({ + title: "RealtimeSessionClosedThreadRealtimeItemType", + }), + }).annotate({ title: "RealtimeSessionClosedThreadRealtimeItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: "EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline.", + identifier: "V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeItem", +}); + +export type V2ThreadRealtimeItemStartedNotification__ThreadRealtimeItem = + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly type: "realtimeSessionStarted"; + } + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly role: V2ThreadRealtimeItemStartedNotification__ThreadRealtimeTranscriptRole; + readonly text: string; + readonly type: "transcriptSegment"; + } + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly item_id: string; + readonly presentation: V2ThreadRealtimeItemStartedNotification__ThreadRealtimeBemItemPresentation; + readonly turn_id: string; + readonly type: "bemItemPromoted"; + } + | { + readonly id: string; + readonly realtimeSessionId: string; + readonly outcome: V2ThreadRealtimeItemStartedNotification__ThreadRealtimeSessionOutcome; + readonly type: "realtimeSessionClosed"; + }; +export const V2ThreadRealtimeItemStartedNotification__ThreadRealtimeItem = Schema.Union( + [ + Schema.Struct({ + id: Schema.String, + realtimeSessionId: Schema.String, + type: Schema.Literal("realtimeSessionStarted").annotate({ + title: "RealtimeSessionStartedThreadRealtimeItemType", + }), + }).annotate({ title: "RealtimeSessionStartedThreadRealtimeItem" }), + Schema.Struct({ + id: Schema.String, + realtimeSessionId: Schema.String, + role: V2ThreadRealtimeItemStartedNotification__ThreadRealtimeTranscriptRole, + text: Schema.String, + type: Schema.Literal("transcriptSegment").annotate({ + title: "TranscriptSegmentThreadRealtimeItemType", + }), + }).annotate({ title: "TranscriptSegmentThreadRealtimeItem" }), + Schema.Struct({ + id: Schema.String, + realtimeSessionId: Schema.String, + item_id: Schema.String, + presentation: V2ThreadRealtimeItemStartedNotification__ThreadRealtimeBemItemPresentation, + turn_id: Schema.String, + type: Schema.Literal("bemItemPromoted").annotate({ + title: "BemItemPromotedThreadRealtimeItemType", + }), + }).annotate({ title: "BemItemPromotedThreadRealtimeItem" }), + Schema.Struct({ + id: Schema.String, + realtimeSessionId: Schema.String, + outcome: V2ThreadRealtimeItemStartedNotification__ThreadRealtimeSessionOutcome, + type: Schema.Literal("realtimeSessionClosed").annotate({ + title: "RealtimeSessionClosedThreadRealtimeItemType", + }), + }).annotate({ title: "RealtimeSessionClosedThreadRealtimeItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: "EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline.", + identifier: "V2ThreadRealtimeItemStartedNotification__ThreadRealtimeItem", +}); + +export type V2ThreadResumeParams__ConfigurationReasoning = { + readonly effort: V2ThreadResumeParams__ReasoningEffort; +}; +export const V2ThreadResumeParams__ConfigurationReasoning = Schema.Struct({ + effort: V2ThreadResumeParams__ReasoningEffort, +}).annotate({ + description: "Reasoning settings interpreted by the backend for the routed model.", + identifier: "V2ThreadResumeParams__ConfigurationReasoning", +}); + +export type V2ThreadResumeParams__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadResumeParams__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadResumeParams__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadResumeParams__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadResumeParams__FunctionCallOutputContentItem", +}); + +export type V2ThreadResumeParams__ContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadResumeParams__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadResumeParams__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly text: string; readonly type: "output_text" }; +export const V2ThreadResumeParams__ContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), + }).annotate({ title: "InputTextContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + file_id: Schema.String, + }).annotate({ title: "FileIdContentItem" }), + ]).annotate({ title: "InputImageContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ title: "InputAudioContentItemType" }), + }).annotate({ title: "InputAudioContentItem" }), + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), + }).annotate({ title: "OutputTextContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeParams__ContentItem" }); + +export type V2ThreadResumeResponse__Settings = { + readonly developer_instructions?: string | null; + readonly model: string; + readonly reasoning_effort?: V2ThreadResumeResponse__ReasoningEffort | null; +}; +export const V2ThreadResumeResponse__Settings = Schema.Struct({ + developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + model: Schema.String, + reasoning_effort: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]), + ), +}).annotate({ + description: "Settings for a collaboration mode.", + identifier: "V2ThreadResumeResponse__Settings", +}); + +export type V2ThreadResumeResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadResumeResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadResumeResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadResumeResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeResponse__CommandAction" }); + +export type V2ThreadResumeResponse__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { readonly networkAccess?: boolean; readonly type: "readOnly" } + | { + readonly networkAccess?: V2ThreadResumeResponse__NetworkAccess; + readonly type: "externalSandbox"; + } + | { + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly type: "workspaceWrite"; + readonly writableRoots?: ReadonlyArray; + }; +export const V2ThreadResumeResponse__SandboxPolicy = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("dangerFullAccess").annotate({ + title: "DangerFullAccessSandboxPolicyType", + }), + }).annotate({ title: "DangerFullAccessSandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), + }).annotate({ title: "ReadOnlySandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__NetworkAccess, + ).annotate({ default: "restricted" }), + ), + type: Schema.Literal("externalSandbox").annotate({ + title: "ExternalSandboxSandboxPolicyType", + }), + }).annotate({ title: "ExternalSandboxSandboxPolicy" }), + Schema.Struct({ + excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), + writableRoots: Schema.optionalKey( + Schema.Array(V2ThreadResumeResponse__AbsolutePathBuf).annotate({ default: [] }), + ), + }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeResponse__SandboxPolicy" }); + +export type V2ThreadResumeResponse__ThreadSection = { + readonly appearance?: V2ThreadResumeResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadResumeResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadResumeResponse__ThreadSection", +}); + +export type V2ThreadResumeResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadResumeResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadResumeResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadResumeResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadResumeResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeResponse__SubAgentSource" }); + +export type V2ThreadResumeResponse__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadResumeResponse__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadResumeResponse__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadResumeResponse__ThreadStatus" }); + +export type V2ThreadResumeResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadResumeResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadResumeResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadResumeResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadResumeResponse__CodexErrorInfo", +}); + +export type V2ThreadResumeResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadResumeResponse__MisalignmentSteer | null; +}; +export const V2ThreadResumeResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadResumeResponse__MisalignmentErrorDetails" }); + +export type V2ThreadResumeResponse__TextElement = { + readonly byteRange: V2ThreadResumeResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadResumeResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadResumeResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadResumeResponse__TextElement" }); + +export type V2ThreadResumeResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadResumeResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadResumeResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadResumeResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadResumeResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadResumeResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadResumeResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadResumeResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadResumeResponse__MemoryCitation" }); + +export type V2ThreadResumeResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadResumeResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadResumeResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadResumeResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadResumeResponse__FileUpdateChange" }); + +export type V2ThreadResumeResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadResumeResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadResumeResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadResumeResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadResumeResponse__McpAppUi", +}); + +export type V2ThreadResumeResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadResumeResponse__CollabAgentStatus; +}; +export const V2ThreadResumeResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadResumeResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadResumeResponse__CollabAgentState" }); + +export type V2ThreadRevertResponse__ThreadSection = { + readonly appearance?: V2ThreadRevertResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadRevertResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadRevertResponse__ThreadSection", +}); + +export type V2ThreadRevertResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadRevertResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadRevertResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadRevertResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadRevertResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadRevertResponse__SubAgentSource" }); + +export type V2ThreadRevertResponse__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadRevertResponse__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadRevertResponse__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadRevertResponse__ThreadStatus" }); + +export type V2ThreadRevertResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadRevertResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadRevertResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadRevertResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadRevertResponse__CodexErrorInfo", +}); + +export type V2ThreadRevertResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadRevertResponse__MisalignmentSteer | null; +}; +export const V2ThreadRevertResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadRevertResponse__MisalignmentErrorDetails" }); + +export type V2ThreadRevertResponse__TextElement = { + readonly byteRange: V2ThreadRevertResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadRevertResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadRevertResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadRevertResponse__TextElement" }); + +export type V2ThreadRevertResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadRevertResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadRevertResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadRevertResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadRevertResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadRevertResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadRevertResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadRevertResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadRevertResponse__MemoryCitation" }); + +export type V2ThreadRevertResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadRevertResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadRevertResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadRevertResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadRevertResponse__CommandAction" }); + +export type V2ThreadRevertResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadRevertResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadRevertResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadRevertResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadRevertResponse__FileUpdateChange" }); + +export type V2ThreadRevertResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadRevertResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadRevertResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadRevertResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadRevertResponse__McpAppUi", +}); + +export type V2ThreadRevertResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadRevertResponse__CollabAgentStatus; +}; +export const V2ThreadRevertResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadRevertResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadRevertResponse__CollabAgentState" }); + +export type V2ThreadSectionCreateResponse__ThreadSection = { + readonly appearance?: V2ThreadSectionCreateResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadSectionCreateResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadSectionCreateResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadSectionCreateResponse__ThreadSection", +}); + +export type V2ThreadSectionListResponse__ThreadSection = { + readonly appearance?: V2ThreadSectionListResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadSectionListResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadSectionListResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadSectionListResponse__ThreadSection", +}); + +export type V2ThreadSectionUpdateResponse__ThreadSection = { + readonly appearance?: V2ThreadSectionUpdateResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadSectionUpdateResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadSectionUpdateResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadSectionUpdateResponse__ThreadSection", +}); + +export type V2ThreadSettingsUpdatedNotification__Settings = { + readonly developer_instructions?: string | null; + readonly model: string; + readonly reasoning_effort?: V2ThreadSettingsUpdatedNotification__ReasoningEffort | null; +}; +export const V2ThreadSettingsUpdatedNotification__Settings = Schema.Struct({ + developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + model: Schema.String, + reasoning_effort: Schema.optionalKey( + Schema.Union([V2ThreadSettingsUpdatedNotification__ReasoningEffort, Schema.Null]), + ), +}).annotate({ + description: "Settings for a collaboration mode.", + identifier: "V2ThreadSettingsUpdatedNotification__Settings", +}); + +export type V2ThreadSettingsUpdatedNotification__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { readonly networkAccess?: boolean; readonly type: "readOnly" } + | { + readonly networkAccess?: V2ThreadSettingsUpdatedNotification__NetworkAccess; + readonly type: "externalSandbox"; + } + | { + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly type: "workspaceWrite"; + readonly writableRoots?: ReadonlyArray; + }; +export const V2ThreadSettingsUpdatedNotification__SandboxPolicy = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("dangerFullAccess").annotate({ + title: "DangerFullAccessSandboxPolicyType", + }), + }).annotate({ title: "DangerFullAccessSandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), + }).annotate({ title: "ReadOnlySandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadSettingsUpdatedNotification__NetworkAccess, + ).annotate({ default: "restricted" }), + ), + type: Schema.Literal("externalSandbox").annotate({ + title: "ExternalSandboxSandboxPolicyType", + }), + }).annotate({ title: "ExternalSandboxSandboxPolicy" }), + Schema.Struct({ + excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), + writableRoots: Schema.optionalKey( + Schema.Array(V2ThreadSettingsUpdatedNotification__AbsolutePathBuf).annotate({ + default: [], + }), + ), + }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadSettingsUpdatedNotification__SandboxPolicy" }); + +export type V2ThreadStartedNotification__ThreadSection = { + readonly appearance?: V2ThreadStartedNotification__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadStartedNotification__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadStartedNotification__ThreadSection", +}); + +export type V2ThreadStartedNotification__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadStartedNotification__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadStartedNotification__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadStartedNotification__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadStartedNotification__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartedNotification__SubAgentSource" }); + +export type V2ThreadStartedNotification__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadStartedNotification__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadStartedNotification__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartedNotification__ThreadStatus" }); + +export type V2ThreadStartedNotification__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadStartedNotification__NonSteerableTurnKind; + }; + }; +export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadStartedNotification__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadStartedNotification__CodexErrorInfo", +}); + +export type V2ThreadStartedNotification__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadStartedNotification__MisalignmentSteer | null; +}; +export const V2ThreadStartedNotification__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadStartedNotification__MisalignmentErrorDetails" }); + +export type V2ThreadStartedNotification__TextElement = { + readonly byteRange: V2ThreadStartedNotification__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadStartedNotification__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadStartedNotification__TextElement" }); + +export type V2ThreadStartedNotification__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadStartedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadStartedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadStartedNotification__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadStartedNotification__FunctionCallOutputContentItem", +}); + +export type V2ThreadStartedNotification__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadStartedNotification__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadStartedNotification__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadStartedNotification__MemoryCitation" }); + +export type V2ThreadStartedNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadStartedNotification__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadStartedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadStartedNotification__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartedNotification__CommandAction" }); + +export type V2ThreadStartedNotification__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadStartedNotification__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadStartedNotification__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadStartedNotification__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadStartedNotification__FileUpdateChange" }); + +export type V2ThreadStartedNotification__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadStartedNotification__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadStartedNotification__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadStartedNotification__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadStartedNotification__McpAppUi", +}); + +export type V2ThreadStartedNotification__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadStartedNotification__CollabAgentStatus; +}; +export const V2ThreadStartedNotification__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadStartedNotification__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadStartedNotification__CollabAgentState" }); + +export type V2ThreadStartResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadStartResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadStartResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadStartResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartResponse__CommandAction" }); + +export type V2ThreadStartResponse__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { readonly networkAccess?: boolean; readonly type: "readOnly" } + | { + readonly networkAccess?: V2ThreadStartResponse__NetworkAccess; + readonly type: "externalSandbox"; + } + | { + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly type: "workspaceWrite"; + readonly writableRoots?: ReadonlyArray; + }; +export const V2ThreadStartResponse__SandboxPolicy = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("dangerFullAccess").annotate({ + title: "DangerFullAccessSandboxPolicyType", + }), + }).annotate({ title: "DangerFullAccessSandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), + }).annotate({ title: "ReadOnlySandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__NetworkAccess, + ).annotate({ default: "restricted" }), + ), + type: Schema.Literal("externalSandbox").annotate({ + title: "ExternalSandboxSandboxPolicyType", + }), + }).annotate({ title: "ExternalSandboxSandboxPolicy" }), + Schema.Struct({ + excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), + writableRoots: Schema.optionalKey( + Schema.Array(V2ThreadStartResponse__AbsolutePathBuf).annotate({ default: [] }), + ), + }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartResponse__SandboxPolicy" }); + +export type V2ThreadStartResponse__ThreadSection = { + readonly appearance?: V2ThreadStartResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadStartResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadStartResponse__ThreadSection", +}); + +export type V2ThreadStartResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadStartResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadStartResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadStartResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadStartResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartResponse__SubAgentSource" }); + +export type V2ThreadStartResponse__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadStartResponse__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadStartResponse__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStartResponse__ThreadStatus" }); + +export type V2ThreadStartResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadStartResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadStartResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadStartResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadStartResponse__CodexErrorInfo", +}); + +export type V2ThreadStartResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadStartResponse__MisalignmentSteer | null; +}; +export const V2ThreadStartResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadStartResponse__MisalignmentErrorDetails" }); + +export type V2ThreadStartResponse__TextElement = { + readonly byteRange: V2ThreadStartResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadStartResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadStartResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadStartResponse__TextElement" }); + +export type V2ThreadStartResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadStartResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadStartResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadStartResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadStartResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadStartResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadStartResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadStartResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadStartResponse__MemoryCitation" }); + +export type V2ThreadStartResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadStartResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadStartResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadStartResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadStartResponse__FileUpdateChange" }); + +export type V2ThreadStartResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadStartResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadStartResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadStartResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadStartResponse__McpAppUi", +}); + +export type V2ThreadStartResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadStartResponse__CollabAgentStatus; +}; +export const V2ThreadStartResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadStartResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadStartResponse__CollabAgentState" }); + +export type V2ThreadStatusChangedNotification__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadStatusChangedNotification__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadStatusChangedNotification__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadStatusChangedNotification__ThreadStatus" }); + +export type V2ThreadTokenUsageUpdatedNotification__ThreadTokenUsage = { + readonly last: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown; + readonly modelContextWindow?: number | null; + readonly total: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown; +}; +export const V2ThreadTokenUsageUpdatedNotification__ThreadTokenUsage = Schema.Struct({ + last: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown, + modelContextWindow: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + total: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown, +}).annotate({ identifier: "V2ThreadTokenUsageUpdatedNotification__ThreadTokenUsage" }); + +export type V2ThreadTurnsListResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadTurnsListResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadTurnsListResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadTurnsListResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadTurnsListResponse__CodexErrorInfo", +}); + +export type V2ThreadTurnsListResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadTurnsListResponse__MisalignmentSteer | null; +}; +export const V2ThreadTurnsListResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadTurnsListResponse__MisalignmentErrorDetails" }); + +export type V2ThreadTurnsListResponse__TextElement = { + readonly byteRange: V2ThreadTurnsListResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadTurnsListResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadTurnsListResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadTurnsListResponse__TextElement" }); + +export type V2ThreadTurnsListResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadTurnsListResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadTurnsListResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadTurnsListResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadTurnsListResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadTurnsListResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadTurnsListResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadTurnsListResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadTurnsListResponse__MemoryCitation" }); + +export type V2ThreadTurnsListResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadTurnsListResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadTurnsListResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadTurnsListResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadTurnsListResponse__CommandAction" }); + +export type V2ThreadTurnsListResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadTurnsListResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadTurnsListResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadTurnsListResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadTurnsListResponse__FileUpdateChange" }); + +export type V2ThreadTurnsListResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadTurnsListResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadTurnsListResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadTurnsListResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadTurnsListResponse__McpAppUi", +}); + +export type V2ThreadTurnsListResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadTurnsListResponse__CollabAgentStatus; +}; +export const V2ThreadTurnsListResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadTurnsListResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadTurnsListResponse__CollabAgentState" }); + +export type V2ThreadUnarchiveResponse__ThreadSection = { + readonly appearance?: V2ThreadUnarchiveResponse__ThreadSectionAppearance | null; + readonly id: string; + readonly name: string; +}; +export const V2ThreadUnarchiveResponse__ThreadSection = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Optional appearance synchronized across clients.", + }), + ), + id: Schema.String.annotate({ + description: "Opaque UUIDv7 identity that remains stable when the section is renamed.", + }), + name: Schema.String.annotate({ description: "The current user-visible section name." }), +}).annotate({ + description: "An independently persisted, user-visible thread section.", + identifier: "V2ThreadUnarchiveResponse__ThreadSection", +}); + +export type V2ThreadUnarchiveResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadUnarchiveResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadUnarchiveResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadUnarchiveResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + parent_thread_id: V2ThreadUnarchiveResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadUnarchiveResponse__SubAgentSource" }); + +export type V2ThreadUnarchiveResponse__ThreadStatus = + | { readonly type: "notLoaded" } + | { readonly type: "idle" } + | { readonly type: "systemError" } + | { + readonly activeFlags: ReadonlyArray; + readonly type: "active"; + }; +export const V2ThreadUnarchiveResponse__ThreadStatus = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), + }).annotate({ title: "NotLoadedThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), + }).annotate({ title: "IdleThreadStatus" }), + Schema.Struct({ + type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), + }).annotate({ title: "SystemErrorThreadStatus" }), + Schema.Struct({ + activeFlags: Schema.Array(V2ThreadUnarchiveResponse__ThreadActiveFlag), + type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), + }).annotate({ title: "ActiveThreadStatus" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadUnarchiveResponse__ThreadStatus" }); + +export type V2ThreadUnarchiveResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2ThreadUnarchiveResponse__NonSteerableTurnKind; + }; + }; +export const V2ThreadUnarchiveResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2ThreadUnarchiveResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2ThreadUnarchiveResponse__CodexErrorInfo", +}); + +export type V2ThreadUnarchiveResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2ThreadUnarchiveResponse__MisalignmentSteer | null; +}; +export const V2ThreadUnarchiveResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__MisalignmentErrorDetails" }); + +export type V2ThreadUnarchiveResponse__TextElement = { + readonly byteRange: V2ThreadUnarchiveResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2ThreadUnarchiveResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2ThreadUnarchiveResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__TextElement" }); + +export type V2ThreadUnarchiveResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadUnarchiveResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2ThreadUnarchiveResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2ThreadUnarchiveResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2ThreadUnarchiveResponse__FunctionCallOutputContentItem", +}); + +export type V2ThreadUnarchiveResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2ThreadUnarchiveResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadUnarchiveResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__MemoryCitation" }); + +export type V2ThreadUnarchiveResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadUnarchiveResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadUnarchiveResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadUnarchiveResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadUnarchiveResponse__CommandAction" }); + +export type V2ThreadUnarchiveResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2ThreadUnarchiveResponse__PatchChangeKind; + readonly path: string; +}; +export const V2ThreadUnarchiveResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2ThreadUnarchiveResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2ThreadUnarchiveResponse__FileUpdateChange" }); + +export type V2ThreadUnarchiveResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2ThreadUnarchiveResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2ThreadUnarchiveResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2ThreadUnarchiveResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2ThreadUnarchiveResponse__McpAppUi", +}); + +export type V2ThreadUnarchiveResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadUnarchiveResponse__CollabAgentStatus; +}; +export const V2ThreadUnarchiveResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadUnarchiveResponse__CollabAgentStatus, +}).annotate({ identifier: "V2ThreadUnarchiveResponse__CollabAgentState" }); + +export type V2TurnCompletedNotification__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2TurnCompletedNotification__NonSteerableTurnKind; + }; + }; +export const V2TurnCompletedNotification__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2TurnCompletedNotification__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2TurnCompletedNotification__CodexErrorInfo", +}); + +export type V2TurnCompletedNotification__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2TurnCompletedNotification__MisalignmentSteer | null; +}; +export const V2TurnCompletedNotification__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2TurnCompletedNotification__MisalignmentErrorDetails" }); + +export type V2TurnCompletedNotification__TextElement = { + readonly byteRange: V2TurnCompletedNotification__ByteRange; + readonly placeholder?: string | null; +}; +export const V2TurnCompletedNotification__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => + V2TurnCompletedNotification__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2TurnCompletedNotification__TextElement" }); + +export type V2TurnCompletedNotification__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2TurnCompletedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2TurnCompletedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2TurnCompletedNotification__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2TurnCompletedNotification__FunctionCallOutputContentItem", +}); + +export type V2TurnCompletedNotification__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2TurnCompletedNotification__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2TurnCompletedNotification__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2TurnCompletedNotification__MemoryCitation" }); + +export type V2TurnCompletedNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2TurnCompletedNotification__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2TurnCompletedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2TurnCompletedNotification__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnCompletedNotification__CommandAction" }); + +export type V2TurnCompletedNotification__FileUpdateChange = { + readonly diff: string; + readonly kind: V2TurnCompletedNotification__PatchChangeKind; + readonly path: string; +}; +export const V2TurnCompletedNotification__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2TurnCompletedNotification__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2TurnCompletedNotification__FileUpdateChange" }); + +export type V2TurnCompletedNotification__McpAppUi = { + readonly preferredModelDisplayMode: V2TurnCompletedNotification__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2TurnCompletedNotification__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2TurnCompletedNotification__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2TurnCompletedNotification__McpAppUi", +}); + +export type V2TurnCompletedNotification__CollabAgentState = { + readonly message?: string | null; + readonly status: V2TurnCompletedNotification__CollabAgentStatus; +}; +export const V2TurnCompletedNotification__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2TurnCompletedNotification__CollabAgentStatus, +}).annotate({ identifier: "V2TurnCompletedNotification__CollabAgentState" }); + +export type V2TurnPlanUpdatedNotification__TurnPlanStep = { + readonly status: V2TurnPlanUpdatedNotification__TurnPlanStepStatus; + readonly step: string; +}; +export const V2TurnPlanUpdatedNotification__TurnPlanStep = Schema.Struct({ + status: V2TurnPlanUpdatedNotification__TurnPlanStepStatus, + step: Schema.String, +}).annotate({ identifier: "V2TurnPlanUpdatedNotification__TurnPlanStep" }); + +export type V2TurnStartedNotification__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2TurnStartedNotification__NonSteerableTurnKind; + }; + }; +export const V2TurnStartedNotification__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2TurnStartedNotification__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2TurnStartedNotification__CodexErrorInfo", +}); + +export type V2TurnStartedNotification__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2TurnStartedNotification__MisalignmentSteer | null; +}; +export const V2TurnStartedNotification__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2TurnStartedNotification__MisalignmentErrorDetails" }); + +export type V2TurnStartedNotification__TextElement = { + readonly byteRange: V2TurnStartedNotification__ByteRange; + readonly placeholder?: string | null; +}; +export const V2TurnStartedNotification__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2TurnStartedNotification__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2TurnStartedNotification__TextElement" }); + +export type V2TurnStartedNotification__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2TurnStartedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2TurnStartedNotification__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2TurnStartedNotification__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2TurnStartedNotification__FunctionCallOutputContentItem", +}); + +export type V2TurnStartedNotification__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2TurnStartedNotification__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2TurnStartedNotification__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2TurnStartedNotification__MemoryCitation" }); + +export type V2TurnStartedNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2TurnStartedNotification__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2TurnStartedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2TurnStartedNotification__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnStartedNotification__CommandAction" }); + +export type V2TurnStartedNotification__FileUpdateChange = { + readonly diff: string; + readonly kind: V2TurnStartedNotification__PatchChangeKind; + readonly path: string; +}; +export const V2TurnStartedNotification__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2TurnStartedNotification__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2TurnStartedNotification__FileUpdateChange" }); + +export type V2TurnStartedNotification__McpAppUi = { + readonly preferredModelDisplayMode: V2TurnStartedNotification__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2TurnStartedNotification__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2TurnStartedNotification__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2TurnStartedNotification__McpAppUi", +}); + +export type V2TurnStartedNotification__CollabAgentState = { + readonly message?: string | null; + readonly status: V2TurnStartedNotification__CollabAgentStatus; +}; +export const V2TurnStartedNotification__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2TurnStartedNotification__CollabAgentStatus, +}).annotate({ identifier: "V2TurnStartedNotification__CollabAgentState" }); + +export type V2TurnStartParams__Settings = { + readonly developer_instructions?: string | null; + readonly model: string; + readonly reasoning_effort?: V2TurnStartParams__ReasoningEffort | null; +}; +export const V2TurnStartParams__Settings = Schema.Struct({ + developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + model: Schema.String, + reasoning_effort: Schema.optionalKey( + Schema.Union([V2TurnStartParams__ReasoningEffort, Schema.Null]), + ), +}).annotate({ + description: "Settings for a collaboration mode.", + identifier: "V2TurnStartParams__Settings", +}); + +export type V2TurnStartParams__TextElement = { + readonly byteRange: V2TurnStartParams__ByteRange; + readonly placeholder?: string | null; +}; +export const V2TurnStartParams__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2TurnStartParams__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2TurnStartParams__TextElement" }); + +export type V2TurnStartParams__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2TurnStartParams__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2TurnStartParams__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2TurnStartParams__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2TurnStartParams__FunctionCallOutputContentItem", +}); + +export type V2TurnStartParams__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { readonly networkAccess?: boolean; readonly type: "readOnly" } + | { readonly networkAccess?: V2TurnStartParams__NetworkAccess; readonly type: "externalSandbox" } + | { + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly type: "workspaceWrite"; + readonly writableRoots?: ReadonlyArray; + }; +export const V2TurnStartParams__SandboxPolicy = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("dangerFullAccess").annotate({ + title: "DangerFullAccessSandboxPolicyType", + }), + }).annotate({ title: "DangerFullAccessSandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), + }).annotate({ title: "ReadOnlySandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => V2TurnStartParams__NetworkAccess, + ).annotate({ default: "restricted" }), + ), + type: Schema.Literal("externalSandbox").annotate({ + title: "ExternalSandboxSandboxPolicyType", + }), + }).annotate({ title: "ExternalSandboxSandboxPolicy" }), + Schema.Struct({ + excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), + writableRoots: Schema.optionalKey( + Schema.Array(V2TurnStartParams__AbsolutePathBuf).annotate({ default: [] }), + ), + }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnStartParams__SandboxPolicy" }); + +export type V2TurnStartResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "sessionBudgetExceeded" + | "usageLimitExceeded" + | "rateLimitExceeded" + | "flexUnavailable" + | "serverOverloaded" + | "cyberPolicy" + | "misalignmentPolicyViolation" + | "tooManyDenials" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2TurnStartResponse__NonSteerableTurnKind; + }; + }; +export const V2TurnStartResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "sessionBudgetExceeded", + "usageLimitExceeded", + "rateLimitExceeded", + "flexUnavailable", + "serverOverloaded", + "cyberPolicy", + "misalignmentPolicyViolation", + "tooManyDenials", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", + }), + Schema.Struct({ + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", + description: + "The response SSE stream disconnected in the middle of a turn before completion.", + }), + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", + }), + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2TurnStartResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", + description: + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + identifier: "V2TurnStartResponse__CodexErrorInfo", +}); + +export type V2TurnStartResponse__MisalignmentErrorDetails = { + readonly detailedExplanation?: string | null; + readonly errorType?: string | null; + readonly steer?: V2TurnStartResponse__MisalignmentSteer | null; +}; +export const V2TurnStartResponse__MisalignmentErrorDetails = Schema.Struct({ + detailedExplanation: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "A substantive localized explanation is required before offering continuation.", + }), + Schema.Null, + ]), + ), + errorType: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Open-ended classification; clients must accept categories added by Responses.", + }), + Schema.Null, + ]), + ), + steer: Schema.optionalKey( + Schema.Union([V2TurnStartResponse__MisalignmentSteer, Schema.Null]).annotate({ + description: + "Instruction to submit as the next turn's user input if continuation is confirmed.", + }), + ), +}).annotate({ identifier: "V2TurnStartResponse__MisalignmentErrorDetails" }); + +export type V2TurnStartResponse__TextElement = { + readonly byteRange: V2TurnStartResponse__ByteRange; + readonly placeholder?: string | null; +}; +export const V2TurnStartResponse__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2TurnStartResponse__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2TurnStartResponse__TextElement" }); + +export type V2TurnStartResponse__FunctionCallOutputContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2TurnStartResponse__ImageDetail | null; + readonly type: "input_image"; + readonly image_url: string; + } + | { + readonly detail?: V2TurnStartResponse__ImageDetail | null; + readonly type: "input_image"; + readonly file_id: string; + } + | { readonly audio_url: string; readonly type: "input_audio" } + | { readonly encrypted_content: string; readonly type: "encrypted_content" }; +export const V2TurnStartResponse__FunctionCallOutputContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ + title: "InputTextFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputTextFunctionCallOutputContentItem" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + image_url: Schema.String, + }).annotate({ title: "ImageUrlFunctionCallOutputContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("input_image").annotate({ + title: "InputImageFunctionCallOutputContentItemType", + }), + file_id: Schema.String, + }).annotate({ title: "FileIdFunctionCallOutputContentItem" }), + ]).annotate({ title: "InputImageFunctionCallOutputContentItem" }), + Schema.Struct({ + audio_url: Schema.String, + type: Schema.Literal("input_audio").annotate({ + title: "InputAudioFunctionCallOutputContentItemType", + }), + }).annotate({ title: "InputAudioFunctionCallOutputContentItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + type: Schema.Literal("encrypted_content").annotate({ + title: "EncryptedContentFunctionCallOutputContentItemType", + }), + }).annotate({ title: "EncryptedContentFunctionCallOutputContentItem" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + identifier: "V2TurnStartResponse__FunctionCallOutputContentItem", +}); + +export type V2TurnStartResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2TurnStartResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2TurnStartResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}).annotate({ identifier: "V2TurnStartResponse__MemoryCitation" }); + +export type V2TurnStartResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2TurnStartResponse__LegacyAppPathString; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2TurnStartResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2TurnStartResponse__LegacyAppPathString, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2TurnStartResponse__CommandAction" }); + +export type V2TurnStartResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2TurnStartResponse__PatchChangeKind; + readonly path: string; +}; +export const V2TurnStartResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2TurnStartResponse__PatchChangeKind, + path: Schema.String, +}).annotate({ identifier: "V2TurnStartResponse__FileUpdateChange" }); + +export type V2TurnStartResponse__McpAppUi = { + readonly preferredModelDisplayMode: V2TurnStartResponse__McpAppDisplayMode; + readonly resourceUri: string; +}; +export const V2TurnStartResponse__McpAppUi = Schema.Struct({ + preferredModelDisplayMode: V2TurnStartResponse__McpAppDisplayMode, + resourceUri: Schema.String, +}).annotate({ + description: + "UI resource and display preference for model invocations, captured from the tool descriptor.", + identifier: "V2TurnStartResponse__McpAppUi", +}); + +export type V2TurnStartResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2TurnStartResponse__CollabAgentStatus; +}; +export const V2TurnStartResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2TurnStartResponse__CollabAgentStatus, +}).annotate({ identifier: "V2TurnStartResponse__CollabAgentState" }); + +export type V2TurnSteerParams__TextElement = { + readonly byteRange: V2TurnSteerParams__ByteRange; + readonly placeholder?: string | null; +}; +export const V2TurnSteerParams__TextElement = Schema.Struct({ + byteRange: Schema.suspend( + (): Schema.Codec => V2TurnSteerParams__ByteRange, + ).annotate({ description: "Byte range in the parent `text` buffer that this element occupies." }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2TurnSteerParams__TextElement" }); + +export type ApplyPatchApprovalResponse__ReviewDecision = + | "approved" + | { + readonly approved_execpolicy_amendment: { + readonly proposed_execpolicy_amendment: ReadonlyArray; + }; + } + | "approved_for_session" + | "approved_mcp_policy_amendment" + | { + readonly network_policy_amendment: { + readonly network_policy_amendment: ApplyPatchApprovalResponse__NetworkPolicyAmendment; + }; + } + | { readonly denied: { readonly rejection: string } } + | "timed_out" + | "abort"; +export const ApplyPatchApprovalResponse__ReviewDecision = Schema.Union( + [ + Schema.Literal("approved").annotate({ + description: "User has approved this command and the agent should execute it.", + }), + Schema.Struct({ + approved_execpolicy_amendment: Schema.Struct({ + proposed_execpolicy_amendment: Schema.Array(Schema.String), + }), + }).annotate({ + title: "ApprovedExecpolicyAmendmentReviewDecision", + description: + "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", + }), + Schema.Literal("approved_for_session").annotate({ + description: + "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", + }), + Schema.Literal("approved_mcp_policy_amendment").annotate({ + description: + "User has approved this MCP tool call and wants to amend its policy so matching future calls are automatically approved across sessions.", + }), + Schema.Struct({ + network_policy_amendment: Schema.Struct({ + network_policy_amendment: ApplyPatchApprovalResponse__NetworkPolicyAmendment, + }), + }).annotate({ + title: "NetworkPolicyAmendmentReviewDecision", + description: + "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", + }), + Schema.Struct({ denied: Schema.Struct({ rejection: Schema.String }) }).annotate({ + title: "DeniedReviewDecision", + description: + "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + }), + Schema.Literal("timed_out").annotate({ + description: "Automatic approval review timed out before reaching a decision.", + }), + Schema.Literal("abort").annotate({ + description: + "User has denied this command and the agent should not do anything until the user's next command.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: "User's decision in response to an ExecApprovalRequest.", + identifier: "ApplyPatchApprovalResponse__ReviewDecision", +}); + +export type ClientRequest__ThreadItemsListParams = { + readonly cursor?: ClientRequest__ThreadItemsListCursor | null; + readonly limit?: number | null; + readonly sortDirection?: ClientRequest__SortDirection | null; + readonly threadId: string; + readonly turnId?: string | null; +}; +export const ClientRequest__ThreadItemsListParams = Schema.Struct({ + cursor: Schema.optionalKey( + Schema.Union([ClientRequest__ThreadItemsListCursor, Schema.Null]).annotate({ + description: + "Opaque continuation cursor or an exclusive item anchor in the requested visible turn. An item anchor requires a non-empty `turnId`; ascending (the default) returns items after it, and descending returns items before it. Continue with the returned string cursor.", + }), + ), + limit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ description: "Optional item page size.", format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + sortDirection: Schema.optionalKey( + Schema.Union([ClientRequest__SortDirection, Schema.Null]).annotate({ + description: "Optional item pagination direction; defaults to ascending.", + }), + ), + threadId: Schema.String, + turnId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional turn id to filter by. When omitted, returns items across the thread.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__ThreadItemsListParams" }); + +export type ClientRequest__PluginShareSaveParams = { + readonly discoverability?: ClientRequest__PluginShareDiscoverability | null; + readonly pluginPath: ClientRequest__AbsolutePathBuf; + readonly remotePluginId?: string | null; + readonly shareTargets?: ReadonlyArray | null; +}; +export const ClientRequest__PluginShareSaveParams = Schema.Struct({ + discoverability: Schema.optionalKey( + Schema.Union([ClientRequest__PluginShareDiscoverability, Schema.Null]), + ), + pluginPath: ClientRequest__AbsolutePathBuf, + remotePluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + shareTargets: Schema.optionalKey( + Schema.Union([Schema.Array(ClientRequest__PluginShareTarget), Schema.Null]), + ), +}).annotate({ identifier: "ClientRequest__PluginShareSaveParams" }); + +export type ClientRequest__PluginShareUpdateTargetsParams = { + readonly discoverability: ClientRequest__PluginShareUpdateDiscoverability; + readonly remotePluginId: string; + readonly shareTargets: ReadonlyArray; +}; +export const ClientRequest__PluginShareUpdateTargetsParams = Schema.Struct({ + discoverability: ClientRequest__PluginShareUpdateDiscoverability, + remotePluginId: Schema.String, + shareTargets: Schema.Array(ClientRequest__PluginShareTarget), +}).annotate({ identifier: "ClientRequest__PluginShareUpdateTargetsParams" }); + +export type ClientRequest__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: ClientRequest__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: ClientRequest__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: ClientRequest__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const ClientRequest__UserInput = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(ClientRequest__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ClientRequest__UserInput" }); + +export type ClientRequest__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const ClientRequest__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(ClientRequest__FunctionCallOutputContentItem), +]).annotate({ identifier: "ClientRequest__FunctionCallOutputBody" }); + +export type ClientRequest__CommandExecParams = { + readonly command: ReadonlyArray; + readonly cwd?: string | null; + readonly disableOutputCap?: boolean; + readonly disableTimeout?: boolean; + readonly env?: { readonly [x: string]: string | null } | null; + readonly outputBytesCap?: number | null; + readonly processId?: string | null; + readonly sandboxPolicy?: ClientRequest__SandboxPolicy | null; + readonly size?: ClientRequest__CommandExecTerminalSize | null; + readonly streamStdin?: boolean; + readonly streamStdoutStderr?: boolean; + readonly timeoutMs?: number | null; + readonly tty?: boolean; +}; +export const ClientRequest__CommandExecParams = Schema.Struct({ + command: Schema.Array(Schema.String).annotate({ + description: "Command argv vector. Empty arrays are rejected.", + }), + cwd: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional working directory. Defaults to the server cwd.", + }), + Schema.Null, + ]), + ), + disableOutputCap: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.", + }), + ), + disableTimeout: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.", + }), + ), + env: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, Schema.Union([Schema.String, Schema.Null])).annotate({ + description: + "Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable.", + }), + Schema.Null, + ]), + ), + outputBytesCap: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", + format: "uint", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + processId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", + }), + Schema.Null, + ]), + ), + sandboxPolicy: Schema.optionalKey( + Schema.Union([ClientRequest__SandboxPolicy, Schema.Null]).annotate({ + description: + "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`.", + }), + ), + size: Schema.optionalKey( + Schema.Union([ClientRequest__CommandExecTerminalSize, Schema.Null]).annotate({ + description: "Optional initial PTY size in character cells. Only valid when `tty` is true.", + }), + ), + streamStdin: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Allow follow-up `command/exec/write` requests to write stdin bytes.\n\nRequires a client-supplied `processId`.", + }), + ), + streamStdoutStderr: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Stream stdout/stderr via `command/exec/outputDelta` notifications.\n\nStreamed bytes are not duplicated into the final response and require a client-supplied `processId`.", + }), + ), + timeoutMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + tty: Schema.optionalKey( + Schema.Boolean.annotate({ + description: "Enable PTY mode.\n\nThis implies `streamStdin` and `streamStdoutStderr`.", + }), + ), +}).annotate({ + description: + "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.", + identifier: "ClientRequest__CommandExecParams", +}); + +export type ClientRequest__ExternalAgentConfigMigrationItem = { + readonly cwd?: string | null; + readonly description: string; + readonly details?: ClientRequest__MigrationDetails | null; + readonly itemType: ClientRequest__ExternalAgentConfigMigrationItemType; +}; +export const ClientRequest__ExternalAgentConfigMigrationItem = Schema.Struct({ + cwd: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + }), + Schema.Null, + ]), + ), + description: Schema.String, + details: Schema.optionalKey(Schema.Union([ClientRequest__MigrationDetails, Schema.Null])), + itemType: ClientRequest__ExternalAgentConfigMigrationItemType, +}).annotate({ identifier: "ClientRequest__ExternalAgentConfigMigrationItem" }); + +export type ClientRequest__ExternalAgentConfigImportHistoryRecordTypeResultParams = { + readonly failures: ReadonlyArray; + readonly itemType: ClientRequest__ExternalAgentConfigMigrationItemType; + readonly successes: ReadonlyArray; +}; +export const ClientRequest__ExternalAgentConfigImportHistoryRecordTypeResultParams = Schema.Struct({ + failures: Schema.Array(ClientRequest__ExternalAgentConfigImportItemTypeFailure), + itemType: ClientRequest__ExternalAgentConfigMigrationItemType, + successes: Schema.Array(ClientRequest__ExternalAgentConfigImportHistoryRecordSuccessParams), +}).annotate({ + identifier: "ClientRequest__ExternalAgentConfigImportHistoryRecordTypeResultParams", +}); + +export type ClientRequest__ConfigBatchWriteParams = { + readonly edits: ReadonlyArray; + readonly expectedVersion?: string | null; + readonly filePath?: string | null; + readonly reloadUserConfig?: boolean; +}; +export const ClientRequest__ConfigBatchWriteParams = Schema.Struct({ + edits: Schema.Array(ClientRequest__ConfigEdit), + expectedVersion: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + filePath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + }), + Schema.Null, + ]), + ), + reloadUserConfig: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true, hot-reload updated runtime settings into loaded threads after writing. Session-static model, reasoning-effort, Plan-mode reasoning-effort, and service-tier defaults are not reloaded. The deprecated personality setting is also not reloaded.", + }), + ), +}).annotate({ identifier: "ClientRequest__ConfigBatchWriteParams" }); + +export type CommandExecutionRequestApprovalParams__FileSystemPath = + | { + readonly path: CommandExecutionRequestApprovalParams__LegacyAppPathString; + readonly type: "path"; + } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: CommandExecutionRequestApprovalParams__FileSystemSpecialPath; + }; +export const CommandExecutionRequestApprovalParams__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: CommandExecutionRequestApprovalParams__LegacyAppPathString, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: CommandExecutionRequestApprovalParams__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "CommandExecutionRequestApprovalParams__FileSystemPath" }); + +export type CommandExecutionRequestApprovalResponse__CommandExecutionApprovalDecision = + | "accept" + | "acceptForSession" + | { + readonly acceptWithExecpolicyAmendment: { + readonly execpolicy_amendment: ReadonlyArray; + }; + } + | { + readonly applyNetworkPolicyAmendment: { + readonly network_policy_amendment: CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment; + }; + } + | "decline" + | "cancel"; +export const CommandExecutionRequestApprovalResponse__CommandExecutionApprovalDecision = + Schema.Union( + [ + Schema.Literal("accept").annotate({ description: "User approved the command." }), + Schema.Literal("acceptForSession").annotate({ + description: + "User approved the command and future prompts in the same session-scoped approval cache should run without prompting.", + }), + Schema.Struct({ + acceptWithExecpolicyAmendment: Schema.Struct({ + execpolicy_amendment: Schema.Array(Schema.String), + }), + }).annotate({ + title: "AcceptWithExecpolicyAmendmentCommandExecutionApprovalDecision", + description: + "User approved the command, and wants to apply the proposed execpolicy amendment so future matching commands can run without prompting.", + }), + Schema.Struct({ + applyNetworkPolicyAmendment: Schema.Struct({ + network_policy_amendment: CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment, + }), + }).annotate({ + title: "ApplyNetworkPolicyAmendmentCommandExecutionApprovalDecision", + description: "User chose a persistent network policy rule (allow/deny) for this host.", + }), + Schema.Literal("decline").annotate({ + description: "User denied the command. The agent will continue the turn.", + }), + Schema.Literal("cancel").annotate({ + description: "User denied the command. The turn will also be immediately interrupted.", + }), + ], + { mode: "oneOf" }, + ).annotate({ + identifier: "CommandExecutionRequestApprovalResponse__CommandExecutionApprovalDecision", + }); + +export type ExecCommandApprovalResponse__ReviewDecision = + | "approved" + | { + readonly approved_execpolicy_amendment: { + readonly proposed_execpolicy_amendment: ReadonlyArray; + }; + } + | "approved_for_session" + | "approved_mcp_policy_amendment" + | { + readonly network_policy_amendment: { + readonly network_policy_amendment: ExecCommandApprovalResponse__NetworkPolicyAmendment; + }; + } + | { readonly denied: { readonly rejection: string } } + | "timed_out" + | "abort"; +export const ExecCommandApprovalResponse__ReviewDecision = Schema.Union( + [ + Schema.Literal("approved").annotate({ + description: "User has approved this command and the agent should execute it.", + }), + Schema.Struct({ + approved_execpolicy_amendment: Schema.Struct({ + proposed_execpolicy_amendment: Schema.Array(Schema.String), + }), + }).annotate({ + title: "ApprovedExecpolicyAmendmentReviewDecision", + description: + "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", + }), + Schema.Literal("approved_for_session").annotate({ + description: + "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", + }), + Schema.Literal("approved_mcp_policy_amendment").annotate({ + description: + "User has approved this MCP tool call and wants to amend its policy so matching future calls are automatically approved across sessions.", + }), + Schema.Struct({ + network_policy_amendment: Schema.Struct({ + network_policy_amendment: ExecCommandApprovalResponse__NetworkPolicyAmendment, + }), + }).annotate({ + title: "NetworkPolicyAmendmentReviewDecision", + description: + "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", + }), + Schema.Struct({ denied: Schema.Struct({ rejection: Schema.String }) }).annotate({ + title: "DeniedReviewDecision", + description: + "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + }), + Schema.Literal("timed_out").annotate({ + description: "Automatic approval review timed out before reaching a decision.", + }), + Schema.Literal("abort").annotate({ + description: + "User has denied this command and the agent should not do anything until the user's next command.", + }), + ], + { mode: "oneOf" }, +).annotate({ + description: "User's decision in response to an ExecApprovalRequest.", + identifier: "ExecCommandApprovalResponse__ReviewDecision", +}); + +export type McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema = { + readonly default?: ReadonlyArray | null; + readonly description?: string | null; + readonly items: McpServerElicitationRequestParams__McpElicitationUntitledEnumItems; + readonly maxItems?: number | null; + readonly minItems?: number | null; + readonly title?: string | null; + readonly type: McpServerElicitationRequestParams__McpElicitationArrayType; +}; +export const McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema = + Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + items: McpServerElicitationRequestParams__McpElicitationUntitledEnumItems, + maxItems: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + minItems: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: McpServerElicitationRequestParams__McpElicitationArrayType, + }).annotate({ + identifier: "McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema", + }); + +export type McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema = + | McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema + | McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema; +export const McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema = Schema.Union( + [ + McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema, + McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema, + ], +).annotate({ + identifier: "McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema", +}); + +export type McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema = { + readonly default?: ReadonlyArray | null; + readonly description?: string | null; + readonly items: McpServerElicitationRequestParams__McpElicitationTitledEnumItems; + readonly maxItems?: number | null; + readonly minItems?: number | null; + readonly title?: string | null; + readonly type: McpServerElicitationRequestParams__McpElicitationArrayType; +}; +export const McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema = + Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + items: McpServerElicitationRequestParams__McpElicitationTitledEnumItems, + maxItems: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + minItems: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: McpServerElicitationRequestParams__McpElicitationArrayType, + }).annotate({ + identifier: "McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema", + }); + +export type PermissionsRequestApprovalParams__FileSystemPath = + | { readonly path: PermissionsRequestApprovalParams__LegacyAppPathString; readonly type: "path" } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: PermissionsRequestApprovalParams__FileSystemSpecialPath; + }; +export const PermissionsRequestApprovalParams__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: PermissionsRequestApprovalParams__LegacyAppPathString, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: PermissionsRequestApprovalParams__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "PermissionsRequestApprovalParams__FileSystemPath" }); + +export type PermissionsRequestApprovalResponse__FileSystemPath = + | { + readonly path: PermissionsRequestApprovalResponse__LegacyAppPathString; + readonly type: "path"; + } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: PermissionsRequestApprovalResponse__FileSystemSpecialPath; + }; +export const PermissionsRequestApprovalResponse__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: PermissionsRequestApprovalResponse__LegacyAppPathString, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: PermissionsRequestApprovalResponse__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "PermissionsRequestApprovalResponse__FileSystemPath" }); + +export type ServerNotification__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: ServerNotification__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: ServerNotification__MisalignmentErrorDetails | null; +}; +export const ServerNotification__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([ServerNotification__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([ServerNotification__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "ServerNotification__TurnError" }); + +export type ServerNotification__CollaborationMode = { + readonly mode: ServerNotification__ModeKind; + readonly settings: ServerNotification__Settings; +}; +export const ServerNotification__CollaborationMode = Schema.Struct({ + mode: ServerNotification__ModeKind, + settings: ServerNotification__Settings, +}).annotate({ + description: "Collaboration mode for a Codex session.", + identifier: "ServerNotification__CollaborationMode", +}); + +export type ServerNotification__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: ServerNotification__SubAgentSource }; +export const ServerNotification__SessionSource = Schema.Union( + [ + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: ServerNotification__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__SessionSource" }); + +export type ServerNotification__ThreadStatusChangedNotification = { + readonly status: ServerNotification__ThreadStatus; + readonly threadId: string; +}; +export const ServerNotification__ThreadStatusChangedNotification = Schema.Struct({ + status: ServerNotification__ThreadStatus, + threadId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadStatusChangedNotification" }); + +export type ServerNotification__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: ServerNotification__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: ServerNotification__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: ServerNotification__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const ServerNotification__UserInput = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(ServerNotification__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__UserInput" }); + +export type ServerNotification__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const ServerNotification__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(ServerNotification__FunctionCallOutputContentItem), +]).annotate({ identifier: "ServerNotification__FunctionCallOutputBody" }); + +export type ServerNotification__FileSystemPath = + | { readonly path: ServerNotification__LegacyAppPathString; readonly type: "path" } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { readonly type: "special"; readonly value: ServerNotification__FileSystemSpecialPath }; +export const ServerNotification__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: ServerNotification__LegacyAppPathString, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: ServerNotification__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__FileSystemPath" }); + +export type ServerNotification__FileChangePatchUpdatedNotification = { + readonly changes: ReadonlyArray; + readonly itemId: string; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__FileChangePatchUpdatedNotification = Schema.Struct({ + changes: Schema.Array(ServerNotification__FileUpdateChange), + itemId: Schema.String, + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__FileChangePatchUpdatedNotification" }); + +export type ServerNotification__ThreadGoalUpdatedNotification = { + readonly goal: ServerNotification__ThreadGoal; + readonly threadId: string; + readonly turnId?: string | null; +}; +export const ServerNotification__ThreadGoalUpdatedNotification = Schema.Struct({ + goal: ServerNotification__ThreadGoal, + threadId: Schema.String, + turnId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__ThreadGoalUpdatedNotification" }); + +export type ServerNotification__ThreadTokenUsageUpdatedNotification = { + readonly threadId: string; + readonly tokenUsage: ServerNotification__ThreadTokenUsage; + readonly turnId: string; +}; +export const ServerNotification__ThreadTokenUsageUpdatedNotification = Schema.Struct({ + threadId: Schema.String, + tokenUsage: ServerNotification__ThreadTokenUsage, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__ThreadTokenUsageUpdatedNotification" }); + +export type ServerNotification__HookRunSummary = { + readonly completedAt?: number | null; + readonly displayOrder: number; + readonly durationMs?: number | null; + readonly entries: ReadonlyArray; + readonly eventName: ServerNotification__HookEventName; + readonly executionMode: ServerNotification__HookExecutionMode; + readonly handlerType: ServerNotification__HookHandlerType; + readonly id: string; + readonly scope: ServerNotification__HookScope; + readonly source?: ServerNotification__HookSource; + readonly sourcePath: ServerNotification__AbsolutePathBuf; + readonly startedAt: number; + readonly status: ServerNotification__HookRunStatus; + readonly statusMessage?: string | null; +}; +export const ServerNotification__HookRunSummary = Schema.Struct({ + completedAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + displayOrder: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + entries: Schema.Array(ServerNotification__HookOutputEntry), + eventName: ServerNotification__HookEventName, + executionMode: ServerNotification__HookExecutionMode, + handlerType: ServerNotification__HookHandlerType, + id: Schema.String, + scope: ServerNotification__HookScope, + source: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => ServerNotification__HookSource, + ).annotate({ default: "unknown" }), + ), + sourcePath: ServerNotification__AbsolutePathBuf, + startedAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + status: ServerNotification__HookRunStatus, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__HookRunSummary" }); + +export type ServerNotification__TurnPlanUpdatedNotification = { + readonly explanation?: string | null; + readonly plan: ReadonlyArray; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__TurnPlanUpdatedNotification = Schema.Struct({ + explanation: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + plan: Schema.Array(ServerNotification__TurnPlanStep), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__TurnPlanUpdatedNotification" }); + +export type ServerNotification__AccountRateLimitsUpdatedNotification = { + readonly rateLimits: ServerNotification__RateLimitSnapshot; +}; +export const ServerNotification__AccountRateLimitsUpdatedNotification = Schema.Struct({ + rateLimits: ServerNotification__RateLimitSnapshot, +}).annotate({ + description: + "Sparse rolling rate-limit update.\n\nClients should merge available values into the most recent `account/rateLimits/read` response or refetch that snapshot. Nullable account metadata may be unavailable in a rolling update and does not clear a previously observed value.", + identifier: "ServerNotification__AccountRateLimitsUpdatedNotification", +}); + +export type ServerNotification__AppInfo = { + readonly appMetadata?: ServerNotification__AppMetadata | null; + readonly branding?: ServerNotification__AppBranding | null; + readonly description?: string | null; + readonly distributionChannel?: string | null; + readonly iconAssets?: { readonly [x: string]: string } | null; + readonly iconDarkAssets?: { readonly [x: string]: string } | null; + readonly id: string; + readonly installUrl?: string | null; + readonly isAccessible?: boolean; + readonly isEnabled?: boolean; + readonly labels?: { readonly [x: string]: string } | null; + readonly logoUrl?: string | null; + readonly logoUrlDark?: string | null; + readonly name: string; + readonly pluginDisplayNames?: ReadonlyArray; +}; +export const ServerNotification__AppInfo = Schema.Struct({ + appMetadata: Schema.optionalKey(Schema.Union([ServerNotification__AppMetadata, Schema.Null])), + branding: Schema.optionalKey(Schema.Union([ServerNotification__AppBranding, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + distributionChannel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconAssets: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + iconDarkAssets: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + id: Schema.String, + installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + isAccessible: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + isEnabled: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", + default: true, + }), + ), + labels: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + logoUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logoUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + name: Schema.String, + pluginDisplayNames: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), +}).annotate({ + description: "EXPERIMENTAL - app metadata returned by app-list APIs.", + identifier: "ServerNotification__AppInfo", +}); + +export type ServerNotification__ExternalAgentConfigImportTypeResult = { + readonly failures: ReadonlyArray; + readonly itemType: ServerNotification__ExternalAgentConfigMigrationItemType; + readonly successes: ReadonlyArray; +}; +export const ServerNotification__ExternalAgentConfigImportTypeResult = Schema.Struct({ + failures: Schema.Array(ServerNotification__ExternalAgentConfigImportItemTypeFailure), + itemType: ServerNotification__ExternalAgentConfigMigrationItemType, + successes: Schema.Array(ServerNotification__ExternalAgentConfigImportItemTypeSuccess), +}).annotate({ identifier: "ServerNotification__ExternalAgentConfigImportTypeResult" }); + +export type ServerNotification__ConfigWarningNotification = { + readonly details?: string | null; + readonly path?: string | null; + readonly range?: ServerNotification__TextRange | null; + readonly summary: string; +}; +export const ServerNotification__ConfigWarningNotification = Schema.Struct({ + details: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Optional extra guidance or error details." }), + Schema.Null, + ]), + ), + path: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional path to the config file that triggered the warning.", + }), + Schema.Null, + ]), + ), + range: Schema.optionalKey( + Schema.Union([ServerNotification__TextRange, Schema.Null]).annotate({ + description: "Optional range for the error location inside the config file.", + }), + ), + summary: Schema.String.annotate({ description: "Concise summary of the warning." }), +}).annotate({ identifier: "ServerNotification__ConfigWarningNotification" }); + +export type ServerNotification__FuzzyFileSearchSessionUpdatedNotification = { + readonly files: ReadonlyArray; + readonly query: string; + readonly sessionId: string; +}; +export const ServerNotification__FuzzyFileSearchSessionUpdatedNotification = Schema.Struct({ + files: Schema.Array(ServerNotification__FuzzyFileSearchResult), + query: Schema.String, + sessionId: Schema.String, +}).annotate({ identifier: "ServerNotification__FuzzyFileSearchSessionUpdatedNotification" }); + +export type ServerNotification__ThreadRealtimeItemStartedNotification = { + readonly item: ServerNotification__ThreadRealtimeItem; + readonly threadId: string; +}; +export const ServerNotification__ThreadRealtimeItemStartedNotification = Schema.Struct({ + item: ServerNotification__ThreadRealtimeItem, + threadId: Schema.String, +}).annotate({ + description: "EXPERIMENTAL - a realtime timeline item started before its content streams.", + identifier: "ServerNotification__ThreadRealtimeItemStartedNotification", +}); + +export type ServerNotification__ThreadRealtimeItemCompletedNotification = { + readonly item: ServerNotification__ThreadRealtimeItem; + readonly threadId: string; +}; +export const ServerNotification__ThreadRealtimeItemCompletedNotification = Schema.Struct({ + item: ServerNotification__ThreadRealtimeItem, + threadId: Schema.String, +}).annotate({ + description: "EXPERIMENTAL - a realtime timeline item published after canonical commit.", + identifier: "ServerNotification__ThreadRealtimeItemCompletedNotification", +}); + +export type ServerRequest__FileSystemPath = + | { readonly path: ServerRequest__LegacyAppPathString; readonly type: "path" } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { readonly type: "special"; readonly value: ServerRequest__FileSystemSpecialPath }; +export const ServerRequest__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: ServerRequest__LegacyAppPathString, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: ServerRequest__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerRequest__FileSystemPath" }); + +export type ServerRequest__CommandExecutionRequestApprovalParams = { + readonly approvalId?: string | null; + readonly command?: string | null; + readonly commandActions?: ReadonlyArray | null; + readonly cwd?: ServerRequest__LegacyAppPathString | null; + readonly environmentId?: string | null; + readonly itemId: string; + readonly kind?: ServerRequest__CommandExecutionApprovalKind; + readonly networkApprovalContext?: ServerRequest__NetworkApprovalContext | null; + readonly proposedExecpolicyAmendment?: ReadonlyArray | null; + readonly proposedNetworkPolicyAmendments?: ReadonlyArray | null; + readonly reason?: string | null; + readonly startedAtMs: number; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerRequest__CommandExecutionRequestApprovalParams = Schema.Struct({ + approvalId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Unique identifier for this specific approval callback.\n\nFor regular shell/unified_exec approvals, this is null.\n\nFor zsh-exec-bridge subcommand approvals, multiple callbacks can belong to one parent `itemId`, so `approvalId` is a distinct opaque callback id (a UUID) used to disambiguate routing. Stdin approvals also use a distinct callback id; inspect `kind` to distinguish them.", + }), + Schema.Null, + ]), + ), + command: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "The command to be executed." }), + Schema.Null, + ]), + ), + commandActions: Schema.optionalKey( + Schema.Union([ + Schema.Array(ServerRequest__CommandAction).annotate({ + description: "Best-effort parsed command actions for friendly display.", + }), + Schema.Null, + ]), + ), + cwd: Schema.optionalKey( + Schema.Union([ServerRequest__LegacyAppPathString, Schema.Null]).annotate({ + description: "The command's working directory.", + }), + ), + environmentId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Environment in which the command will run." }), + Schema.Null, + ]), + ), + itemId: Schema.String, + kind: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + ServerRequest__CommandExecutionApprovalKind, + ).annotate({ + description: "Kind of action under review. Defaults to `command` for older servers.", + default: "command", + }), + ), + networkApprovalContext: Schema.optionalKey( + Schema.Union([ServerRequest__NetworkApprovalContext, Schema.Null]).annotate({ + description: "Optional context for a managed-network approval prompt.", + }), + ), + proposedExecpolicyAmendment: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: + "Optional proposed execpolicy amendment to allow similar commands without prompting.", + }), + Schema.Null, + ]), + ), + proposedNetworkPolicyAmendments: Schema.optionalKey( + Schema.Union([ + Schema.Array(ServerRequest__NetworkPolicyAmendment).annotate({ + description: + "Optional proposed network policy amendments (allow/deny host) for future requests.", + }), + Schema.Null, + ]), + ), + reason: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional explanatory reason (e.g. request for network access).", + }), + Schema.Null, + ]), + ), + startedAtMs: Schema.Number.annotate({ + description: "Unix timestamp (in milliseconds) when this approval request started.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerRequest__CommandExecutionRequestApprovalParams" }); + +export type ServerRequest__ToolRequestUserInputParams = { + readonly autoResolutionMs?: number | null; + readonly isBlocking: boolean; + readonly itemId: string; + readonly questions: ReadonlyArray; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerRequest__ToolRequestUserInputParams = Schema.Struct({ + autoResolutionMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "@deprecated Use `isBlocking` to decide whether the request should block.", + format: "uint64", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + isBlocking: Schema.Boolean, + itemId: Schema.String, + questions: Schema.Array(ServerRequest__ToolRequestUserInputQuestion), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ + description: "EXPERIMENTAL. Params sent with a request_user_input event.", + identifier: "ServerRequest__ToolRequestUserInputParams", +}); + +export type ServerRequest__McpElicitationUntitledMultiSelectEnumSchema = { + readonly default?: ReadonlyArray | null; + readonly description?: string | null; + readonly items: ServerRequest__McpElicitationUntitledEnumItems; + readonly maxItems?: number | null; + readonly minItems?: number | null; + readonly title?: string | null; + readonly type: ServerRequest__McpElicitationArrayType; +}; +export const ServerRequest__McpElicitationUntitledMultiSelectEnumSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + items: ServerRequest__McpElicitationUntitledEnumItems, + maxItems: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + minItems: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: ServerRequest__McpElicitationArrayType, +}).annotate({ identifier: "ServerRequest__McpElicitationUntitledMultiSelectEnumSchema" }); + +export type ServerRequest__McpElicitationSingleSelectEnumSchema = + | ServerRequest__McpElicitationUntitledSingleSelectEnumSchema + | ServerRequest__McpElicitationTitledSingleSelectEnumSchema; +export const ServerRequest__McpElicitationSingleSelectEnumSchema = Schema.Union([ + ServerRequest__McpElicitationUntitledSingleSelectEnumSchema, + ServerRequest__McpElicitationTitledSingleSelectEnumSchema, +]).annotate({ identifier: "ServerRequest__McpElicitationSingleSelectEnumSchema" }); + +export type ServerRequest__McpElicitationTitledMultiSelectEnumSchema = { + readonly default?: ReadonlyArray | null; + readonly description?: string | null; + readonly items: ServerRequest__McpElicitationTitledEnumItems; + readonly maxItems?: number | null; + readonly minItems?: number | null; + readonly title?: string | null; + readonly type: ServerRequest__McpElicitationArrayType; +}; +export const ServerRequest__McpElicitationTitledMultiSelectEnumSchema = Schema.Struct({ + default: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + items: ServerRequest__McpElicitationTitledEnumItems, + maxItems: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + minItems: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: ServerRequest__McpElicitationArrayType, +}).annotate({ identifier: "ServerRequest__McpElicitationTitledMultiSelectEnumSchema" }); + +export type V2AppListUpdatedNotification__AppInfo = { + readonly appMetadata?: V2AppListUpdatedNotification__AppMetadata | null; + readonly branding?: V2AppListUpdatedNotification__AppBranding | null; + readonly description?: string | null; + readonly distributionChannel?: string | null; + readonly iconAssets?: { readonly [x: string]: string } | null; + readonly iconDarkAssets?: { readonly [x: string]: string } | null; + readonly id: string; + readonly installUrl?: string | null; + readonly isAccessible?: boolean; + readonly isEnabled?: boolean; + readonly labels?: { readonly [x: string]: string } | null; + readonly logoUrl?: string | null; + readonly logoUrlDark?: string | null; + readonly name: string; + readonly pluginDisplayNames?: ReadonlyArray; +}; +export const V2AppListUpdatedNotification__AppInfo = Schema.Struct({ + appMetadata: Schema.optionalKey( + Schema.Union([V2AppListUpdatedNotification__AppMetadata, Schema.Null]), + ), + branding: Schema.optionalKey( + Schema.Union([V2AppListUpdatedNotification__AppBranding, Schema.Null]), + ), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + distributionChannel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconAssets: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + iconDarkAssets: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + id: Schema.String, + installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + isAccessible: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + isEnabled: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", + default: true, + }), + ), + labels: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + logoUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logoUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + name: Schema.String, + pluginDisplayNames: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), +}).annotate({ + description: "EXPERIMENTAL - app metadata returned by app-list APIs.", + identifier: "V2AppListUpdatedNotification__AppInfo", +}); + +export type V2AppsListResponse__AppInfo = { + readonly appMetadata?: V2AppsListResponse__AppMetadata | null; + readonly branding?: V2AppsListResponse__AppBranding | null; + readonly description?: string | null; + readonly distributionChannel?: string | null; + readonly iconAssets?: { readonly [x: string]: string } | null; + readonly iconDarkAssets?: { readonly [x: string]: string } | null; + readonly id: string; + readonly installUrl?: string | null; + readonly isAccessible?: boolean; + readonly isEnabled?: boolean; + readonly labels?: { readonly [x: string]: string } | null; + readonly logoUrl?: string | null; + readonly logoUrlDark?: string | null; + readonly name: string; + readonly pluginDisplayNames?: ReadonlyArray; +}; +export const V2AppsListResponse__AppInfo = Schema.Struct({ + appMetadata: Schema.optionalKey(Schema.Union([V2AppsListResponse__AppMetadata, Schema.Null])), + branding: Schema.optionalKey(Schema.Union([V2AppsListResponse__AppBranding, Schema.Null])), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + distributionChannel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconAssets: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + iconDarkAssets: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + id: Schema.String, + installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + isAccessible: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + isEnabled: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", + default: true, + }), + ), + labels: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), + logoUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + logoUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + name: Schema.String, + pluginDisplayNames: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), +}).annotate({ + description: "EXPERIMENTAL - app metadata returned by app-list APIs.", + identifier: "V2AppsListResponse__AppInfo", +}); + +export type V2ConfigReadResponse__BrowserUseConfig = { + readonly allow_history_access?: boolean | null; + readonly default_origin_policy?: V2ConfigReadResponse__BrowserUseOriginPolicyConfig | null; + readonly origins?: { + readonly [x: string]: V2ConfigReadResponse__BrowserUseOriginPolicyConfig; + } | null; +}; +export const V2ConfigReadResponse__BrowserUseConfig = Schema.Struct({ + allow_history_access: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + default_origin_policy: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__BrowserUseOriginPolicyConfig, Schema.Null]), + ), + origins: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, V2ConfigReadResponse__BrowserUseOriginPolicyConfig), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ConfigReadResponse__BrowserUseConfig" }); + +export type V2ConfigReadResponse__ComputerUseWindowsConfig = { + readonly aumids?: { readonly [x: string]: V2ConfigReadResponse__AllowDenyRequirement } | null; + readonly exes?: ReadonlyArray | null; +}; +export const V2ConfigReadResponse__ComputerUseWindowsConfig = Schema.Struct({ + aumids: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, V2ConfigReadResponse__AllowDenyRequirement), + Schema.Null, + ]), + ), + exes: Schema.optionalKey( + Schema.Union([Schema.Array(V2ConfigReadResponse__ComputerUseWindowsExeConfig), Schema.Null]), + ), +}).annotate({ identifier: "V2ConfigReadResponse__ComputerUseWindowsConfig" }); + +export type V2ConfigReadResponse__ToolsV2 = { + readonly web_search?: V2ConfigReadResponse__WebSearchToolConfig | null; +}; +export const V2ConfigReadResponse__ToolsV2 = Schema.Struct({ + web_search: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__WebSearchToolConfig, Schema.Null]), + ), +}).annotate({ identifier: "V2ConfigReadResponse__ToolsV2" }); + +export type V2ConfigReadResponse__ConfigLayer = { + readonly config: Schema.Json; + readonly disabledReason?: string | null; + readonly name: V2ConfigReadResponse__ConfigLayerSource; + readonly version: string; +}; +export const V2ConfigReadResponse__ConfigLayer = Schema.Struct({ + config: Schema.Json.annotate({ expected: "JSON value" }), + disabledReason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + name: V2ConfigReadResponse__ConfigLayerSource, + version: Schema.String, +}).annotate({ identifier: "V2ConfigReadResponse__ConfigLayer" }); + +export type V2ConfigReadResponse__ConfigLayerMetadata = { + readonly name: V2ConfigReadResponse__ConfigLayerSource; + readonly version: string; +}; +export const V2ConfigReadResponse__ConfigLayerMetadata = Schema.Struct({ + name: V2ConfigReadResponse__ConfigLayerSource, + version: Schema.String, +}).annotate({ identifier: "V2ConfigReadResponse__ConfigLayerMetadata" }); + +export type V2ConfigRequirementsReadResponse__ComputerUseWindowsRequirements = { + readonly aumids?: { + readonly [x: string]: V2ConfigRequirementsReadResponse__AllowDenyRequirement; + } | null; + readonly exes?: ReadonlyArray | null; +}; +export const V2ConfigRequirementsReadResponse__ComputerUseWindowsRequirements = Schema.Struct({ + aumids: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, V2ConfigRequirementsReadResponse__AllowDenyRequirement), + Schema.Null, + ]), + ), + exes: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ConfigRequirementsReadResponse__ComputerUseWindowsExeRequirement), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__ComputerUseWindowsRequirements" }); + +export type V2ConfigRequirementsReadResponse__BrowserUseRequirements = { + readonly allowGlobalPersistentApproval?: boolean | null; + readonly allowHistoryAccess?: boolean | null; + readonly allowWebmcp?: boolean | null; + readonly defaultOriginPolicy?: V2ConfigRequirementsReadResponse__BrowserUseOriginPolicy | null; + readonly disableAutoReview?: boolean | null; + readonly origins?: { + readonly [x: string]: V2ConfigRequirementsReadResponse__BrowserUseOriginPolicy; + } | null; +}; +export const V2ConfigRequirementsReadResponse__BrowserUseRequirements = Schema.Struct({ + allowGlobalPersistentApproval: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + allowHistoryAccess: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + allowWebmcp: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + defaultOriginPolicy: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__BrowserUseOriginPolicy, Schema.Null]), + ), + disableAutoReview: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + origins: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, V2ConfigRequirementsReadResponse__BrowserUseOriginPolicy), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__BrowserUseRequirements" }); + +export type V2ConfigRequirementsReadResponse__ModelsRequirements = { + readonly newThread?: V2ConfigRequirementsReadResponse__NewThreadModelDefaults | null; +}; +export const V2ConfigRequirementsReadResponse__ModelsRequirements = Schema.Struct({ + newThread: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__NewThreadModelDefaults, Schema.Null]), + ), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__ModelsRequirements" }); + +export type V2ConfigWriteResponse__ConfigLayerMetadata = { + readonly name: V2ConfigWriteResponse__ConfigLayerSource; + readonly version: string; +}; +export const V2ConfigWriteResponse__ConfigLayerMetadata = Schema.Struct({ + name: V2ConfigWriteResponse__ConfigLayerSource, + version: Schema.String, +}).annotate({ identifier: "V2ConfigWriteResponse__ConfigLayerMetadata" }); + +export type V2ErrorNotification__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ErrorNotification__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ErrorNotification__MisalignmentErrorDetails | null; +}; +export const V2ErrorNotification__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ErrorNotification__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ErrorNotification__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ErrorNotification__TurnError" }); + +export type V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem = { + readonly cwd?: string | null; + readonly description: string; + readonly details?: V2ExternalAgentConfigDetectResponse__MigrationDetails | null; + readonly itemType: V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType; +}; +export const V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem = Schema.Struct({ + cwd: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + }), + Schema.Null, + ]), + ), + description: Schema.String, + details: Schema.optionalKey( + Schema.Union([V2ExternalAgentConfigDetectResponse__MigrationDetails, Schema.Null]), + ), + itemType: V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType, +}).annotate({ + identifier: "V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem", +}); + +export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportTypeResult = + { + readonly failures: ReadonlyArray; + readonly itemType: V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType; + readonly successes: ReadonlyArray; + }; +export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportTypeResult = + Schema.Struct({ + failures: Schema.Array( + V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeFailure, + ), + itemType: + V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType, + successes: Schema.Array( + V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeSuccess, + ), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportTypeResult", + }); + +export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportHistory = { + readonly completedAtMs: number; + readonly failures: ReadonlyArray; + readonly importId: string; + readonly providerId?: string | null; + readonly successes: ReadonlyArray; +}; +export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportHistory = + Schema.Struct({ + completedAtMs: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + failures: Schema.Array( + V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeFailure, + ), + importId: Schema.String, + providerId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + successes: Schema.Array( + V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeSuccess, + ), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportHistory", + }); + +export type V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportHistoryRecordTypeResultParams = + { + readonly failures: ReadonlyArray; + readonly itemType: V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType; + readonly successes: ReadonlyArray; + }; +export const V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportHistoryRecordTypeResultParams = + Schema.Struct({ + failures: Schema.Array( + V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportItemTypeFailure, + ), + itemType: V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigMigrationItemType, + successes: Schema.Array( + V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportHistoryRecordSuccessParams, + ), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportHistoryRecordTypeResultParams", + }); + +export type V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem = { + readonly cwd?: string | null; + readonly description: string; + readonly details?: V2ExternalAgentConfigImportParams__MigrationDetails | null; + readonly itemType: V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType; +}; +export const V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem = Schema.Struct({ + cwd: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + }), + Schema.Null, + ]), + ), + description: Schema.String, + details: Schema.optionalKey( + Schema.Union([V2ExternalAgentConfigImportParams__MigrationDetails, Schema.Null]), + ), + itemType: V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType, +}).annotate({ identifier: "V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem" }); + +export type V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportTypeResult = { + readonly failures: ReadonlyArray; + readonly itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType; + readonly successes: ReadonlyArray; +}; +export const V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportTypeResult = + Schema.Struct({ + failures: Schema.Array( + V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeFailure, + ), + itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType, + successes: Schema.Array( + V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeSuccess, + ), + }).annotate({ + identifier: + "V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportTypeResult", + }); + +export type V2GetAccountRateLimitsResponse__RateLimitResetCreditsSummary = { + readonly availableCount: number; + readonly credits?: ReadonlyArray | null; +}; +export const V2GetAccountRateLimitsResponse__RateLimitResetCreditsSummary = Schema.Struct({ + availableCount: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + credits: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2GetAccountRateLimitsResponse__RateLimitResetCredit).annotate({ + description: + "Detail rows for available reset credits, when the backend provides them.\n\n`null` means only `availableCount` is known, while an empty array means details were fetched and no available credits were returned. The backend may cap this list, so its length can be less than `availableCount`.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2GetAccountRateLimitsResponse__RateLimitResetCreditsSummary" }); + +export type V2HookCompletedNotification__HookRunSummary = { + readonly completedAt?: number | null; + readonly displayOrder: number; + readonly durationMs?: number | null; + readonly entries: ReadonlyArray; + readonly eventName: V2HookCompletedNotification__HookEventName; + readonly executionMode: V2HookCompletedNotification__HookExecutionMode; + readonly handlerType: V2HookCompletedNotification__HookHandlerType; + readonly id: string; + readonly scope: V2HookCompletedNotification__HookScope; + readonly source?: V2HookCompletedNotification__HookSource; + readonly sourcePath: V2HookCompletedNotification__AbsolutePathBuf; + readonly startedAt: number; + readonly status: V2HookCompletedNotification__HookRunStatus; + readonly statusMessage?: string | null; +}; +export const V2HookCompletedNotification__HookRunSummary = Schema.Struct({ + completedAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + displayOrder: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + entries: Schema.Array(V2HookCompletedNotification__HookOutputEntry), + eventName: V2HookCompletedNotification__HookEventName, + executionMode: V2HookCompletedNotification__HookExecutionMode, + handlerType: V2HookCompletedNotification__HookHandlerType, + id: Schema.String, + scope: V2HookCompletedNotification__HookScope, + source: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2HookCompletedNotification__HookSource, + ).annotate({ default: "unknown" }), + ), + sourcePath: V2HookCompletedNotification__AbsolutePathBuf, + startedAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + status: V2HookCompletedNotification__HookRunStatus, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2HookCompletedNotification__HookRunSummary" }); + +export type V2HooksListResponse__HooksListEntry = { + readonly cwd: string; + readonly errors: ReadonlyArray; + readonly hooks: ReadonlyArray; + readonly warnings: ReadonlyArray; +}; +export const V2HooksListResponse__HooksListEntry = Schema.Struct({ + cwd: Schema.String, + errors: Schema.Array(V2HooksListResponse__HookErrorInfo), + hooks: Schema.Array(V2HooksListResponse__HookMetadata), + warnings: Schema.Array(Schema.String), +}).annotate({ identifier: "V2HooksListResponse__HooksListEntry" }); + +export type V2HookStartedNotification__HookRunSummary = { + readonly completedAt?: number | null; + readonly displayOrder: number; + readonly durationMs?: number | null; + readonly entries: ReadonlyArray; + readonly eventName: V2HookStartedNotification__HookEventName; + readonly executionMode: V2HookStartedNotification__HookExecutionMode; + readonly handlerType: V2HookStartedNotification__HookHandlerType; + readonly id: string; + readonly scope: V2HookStartedNotification__HookScope; + readonly source?: V2HookStartedNotification__HookSource; + readonly sourcePath: V2HookStartedNotification__AbsolutePathBuf; + readonly startedAt: number; + readonly status: V2HookStartedNotification__HookRunStatus; + readonly statusMessage?: string | null; +}; +export const V2HookStartedNotification__HookRunSummary = Schema.Struct({ + completedAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + displayOrder: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), + ), + entries: Schema.Array(V2HookStartedNotification__HookOutputEntry), + eventName: V2HookStartedNotification__HookEventName, + executionMode: V2HookStartedNotification__HookExecutionMode, + handlerType: V2HookStartedNotification__HookHandlerType, + id: Schema.String, + scope: V2HookStartedNotification__HookScope, + source: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2HookStartedNotification__HookSource, + ).annotate({ default: "unknown" }), + ), + sourcePath: V2HookStartedNotification__AbsolutePathBuf, + startedAt: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + status: V2HookStartedNotification__HookRunStatus, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2HookStartedNotification__HookRunSummary" }); + +export type V2ItemCompletedNotification__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: V2ItemCompletedNotification__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ItemCompletedNotification__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ItemCompletedNotification__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ItemCompletedNotification__UserInput = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ItemCompletedNotification__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null]), + ), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemCompletedNotification__UserInput" }); + +export type V2ItemCompletedNotification__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ItemCompletedNotification__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ItemCompletedNotification__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ItemCompletedNotification__FunctionCallOutputBody" }); + +export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath = + | { + readonly path: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString; + readonly type: "path"; + } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath; + }; +export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath" }); + +export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath = + | { + readonly path: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString; + readonly type: "path"; + } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath; + }; +export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath" }); + +export type V2ItemStartedNotification__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: V2ItemStartedNotification__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ItemStartedNotification__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ItemStartedNotification__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ItemStartedNotification__UserInput = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ItemStartedNotification__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null]), + ), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ItemStartedNotification__UserInput" }); + +export type V2ItemStartedNotification__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ItemStartedNotification__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ItemStartedNotification__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ItemStartedNotification__FunctionCallOutputBody" }); + +export type V2ModelListResponse__Model = { + readonly additionalSpeedTiers?: ReadonlyArray; + readonly availabilityNux?: V2ModelListResponse__ModelAvailabilityNux | null; + readonly availableAccessPrograms?: V2ModelListResponse__ModelAccessPrograms | null; + readonly defaultReasoningEffort: V2ModelListResponse__ReasoningEffort; + readonly defaultServiceTier?: string | null; + readonly description: string; + readonly displayName: string; + readonly hidden: boolean; + readonly id: string; + readonly inputModalities?: ReadonlyArray; + readonly isDefault: boolean; + readonly model: string; + readonly modelSpecialty?: string | null; + readonly multiAgentVersion?: V2ModelListResponse__MultiAgentVersion | null; + readonly serviceTiers?: ReadonlyArray; + readonly supportedReasoningEfforts: ReadonlyArray; + readonly supportsPersonality?: boolean; + readonly upgrade?: string | null; + readonly upgradeInfo?: V2ModelListResponse__ModelUpgradeInfo | null; +}; +export const V2ModelListResponse__Model = Schema.Struct({ + additionalSpeedTiers: Schema.optionalKey( + Schema.Array(Schema.String).annotate({ + description: "Deprecated: use `serviceTiers` instead.", + default: [], + }), + ), + availabilityNux: Schema.optionalKey( + Schema.Union([V2ModelListResponse__ModelAvailabilityNux, Schema.Null]), + ), + availableAccessPrograms: Schema.optionalKey( + Schema.Union([V2ModelListResponse__ModelAccessPrograms, Schema.Null]).annotate({ + description: "Null when the catalog does not provide access-program metadata.", + }), + ), + defaultReasoningEffort: V2ModelListResponse__ReasoningEffort, + defaultServiceTier: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Catalog default service tier id for this model, when one is configured.", + }), + Schema.Null, + ]), + ), + description: Schema.String, + displayName: Schema.String, + hidden: Schema.Boolean, + id: Schema.String, + inputModalities: Schema.optionalKey( + Schema.Array(V2ModelListResponse__InputModality).annotate({ default: ["text", "image"] }), + ), + isDefault: Schema.Boolean, + model: Schema.String, + modelSpecialty: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + multiAgentVersion: Schema.optionalKey( + Schema.Union([V2ModelListResponse__MultiAgentVersion, Schema.Null]).annotate({ + description: "Multi-agent runtime declared by this model, when available.", + }), + ), + serviceTiers: Schema.optionalKey( + Schema.Array(V2ModelListResponse__ModelServiceTier).annotate({ default: [] }), + ), + supportedReasoningEfforts: Schema.Array(V2ModelListResponse__ReasoningEffortOption), + supportsPersonality: Schema.optionalKey( + Schema.Boolean.annotate({ + description: "@deprecated Always false; models no longer support personality selection.", + default: false, + }), + ), + upgrade: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + upgradeInfo: Schema.optionalKey( + Schema.Union([V2ModelListResponse__ModelUpgradeInfo, Schema.Null]), + ), +}).annotate({ identifier: "V2ModelListResponse__Model" }); + +export type V2PluginInstalledResponse__PluginShareContext = { + readonly canPublishToWorkspace?: boolean | null; + readonly creatorAccountUserId?: string | null; + readonly creatorName?: string | null; + readonly discoverability?: V2PluginInstalledResponse__PluginShareDiscoverability | null; + readonly remotePluginId: string; + readonly remoteVersion?: string | null; + readonly sharePrincipals?: ReadonlyArray | null; + readonly shareUrl?: string | null; +}; +export const V2PluginInstalledResponse__PluginShareContext = Schema.Struct({ + canPublishToWorkspace: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + creatorAccountUserId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + creatorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + discoverability: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__PluginShareDiscoverability, Schema.Null]), + ), + remotePluginId: Schema.String, + remoteVersion: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Version of the remote shared plugin release when available.", + }), + Schema.Null, + ]), + ), + sharePrincipals: Schema.optionalKey( + Schema.Union([Schema.Array(V2PluginInstalledResponse__PluginSharePrincipal), Schema.Null]), + ), + shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginInstalledResponse__PluginShareContext" }); + +export type V2PluginListResponse__PluginShareContext = { + readonly canPublishToWorkspace?: boolean | null; + readonly creatorAccountUserId?: string | null; + readonly creatorName?: string | null; + readonly discoverability?: V2PluginListResponse__PluginShareDiscoverability | null; + readonly remotePluginId: string; + readonly remoteVersion?: string | null; + readonly sharePrincipals?: ReadonlyArray | null; + readonly shareUrl?: string | null; +}; +export const V2PluginListResponse__PluginShareContext = Schema.Struct({ + canPublishToWorkspace: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + creatorAccountUserId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + creatorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + discoverability: Schema.optionalKey( + Schema.Union([V2PluginListResponse__PluginShareDiscoverability, Schema.Null]), + ), + remotePluginId: Schema.String, + remoteVersion: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Version of the remote shared plugin release when available.", + }), + Schema.Null, + ]), + ), + sharePrincipals: Schema.optionalKey( + Schema.Union([Schema.Array(V2PluginListResponse__PluginSharePrincipal), Schema.Null]), + ), + shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginListResponse__PluginShareContext" }); + +export type V2PluginReadResponse__SkillSummary = { + readonly description: string; + readonly enabled: boolean; + readonly interface?: V2PluginReadResponse__SkillInterface | null; + readonly name: string; + readonly path?: V2PluginReadResponse__AbsolutePathBuf | null; + readonly shortDescription?: string | null; +}; +export const V2PluginReadResponse__SkillSummary = Schema.Struct({ + description: Schema.String, + enabled: Schema.Boolean, + interface: Schema.optionalKey(Schema.Union([V2PluginReadResponse__SkillInterface, Schema.Null])), + name: Schema.String, + path: Schema.optionalKey(Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null])), + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginReadResponse__SkillSummary" }); + +export type V2PluginReadResponse__ScheduledTaskSummary = { + readonly key: string; + readonly name: string; + readonly prompt: string; + readonly schedule: V2PluginReadResponse__ScheduledTaskSchedule; +}; +export const V2PluginReadResponse__ScheduledTaskSummary = Schema.Struct({ + key: Schema.String, + name: Schema.String, + prompt: Schema.String, + schedule: V2PluginReadResponse__ScheduledTaskSchedule, +}).annotate({ identifier: "V2PluginReadResponse__ScheduledTaskSummary" }); + +export type V2PluginReadResponse__PluginShareContext = { + readonly canPublishToWorkspace?: boolean | null; + readonly creatorAccountUserId?: string | null; + readonly creatorName?: string | null; + readonly discoverability?: V2PluginReadResponse__PluginShareDiscoverability | null; + readonly remotePluginId: string; + readonly remoteVersion?: string | null; + readonly sharePrincipals?: ReadonlyArray | null; + readonly shareUrl?: string | null; +}; +export const V2PluginReadResponse__PluginShareContext = Schema.Struct({ + canPublishToWorkspace: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + creatorAccountUserId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + creatorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + discoverability: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__PluginShareDiscoverability, Schema.Null]), + ), + remotePluginId: Schema.String, + remoteVersion: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Version of the remote shared plugin release when available.", + }), + Schema.Null, + ]), + ), + sharePrincipals: Schema.optionalKey( + Schema.Union([Schema.Array(V2PluginReadResponse__PluginSharePrincipal), Schema.Null]), + ), + shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginReadResponse__PluginShareContext" }); + +export type V2PluginShareListResponse__PluginShareContext = { + readonly canPublishToWorkspace?: boolean | null; + readonly creatorAccountUserId?: string | null; + readonly creatorName?: string | null; + readonly discoverability?: V2PluginShareListResponse__PluginShareDiscoverability | null; + readonly remotePluginId: string; + readonly remoteVersion?: string | null; + readonly sharePrincipals?: ReadonlyArray | null; + readonly shareUrl?: string | null; +}; +export const V2PluginShareListResponse__PluginShareContext = Schema.Struct({ + canPublishToWorkspace: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + creatorAccountUserId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + creatorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + discoverability: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__PluginShareDiscoverability, Schema.Null]), + ), + remotePluginId: Schema.String, + remoteVersion: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Version of the remote shared plugin release when available.", + }), + Schema.Null, + ]), + ), + sharePrincipals: Schema.optionalKey( + Schema.Union([Schema.Array(V2PluginShareListResponse__PluginSharePrincipal), Schema.Null]), + ), + shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2PluginShareListResponse__PluginShareContext" }); + +export type V2RawResponseItemCompletedNotification__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2RawResponseItemCompletedNotification__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2RawResponseItemCompletedNotification__FunctionCallOutputBody" }); + +export type V2ReviewStartResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ReviewStartResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ReviewStartResponse__MisalignmentErrorDetails | null; +}; +export const V2ReviewStartResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ReviewStartResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ReviewStartResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ReviewStartResponse__TurnError" }); + +export type V2ReviewStartResponse__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: V2ReviewStartResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ReviewStartResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ReviewStartResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ReviewStartResponse__UserInput = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ReviewStartResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ReviewStartResponse__UserInput" }); + +export type V2ReviewStartResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ReviewStartResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ReviewStartResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ReviewStartResponse__FunctionCallOutputBody" }); + +export type V2SkillsListResponse__SkillMetadata = { + readonly dependencies?: V2SkillsListResponse__SkillDependencies | null; + readonly description: string; + readonly enabled: boolean; + readonly interface?: V2SkillsListResponse__SkillInterface | null; + readonly name: string; + readonly path: V2SkillsListResponse__AbsolutePathBuf; + readonly pluginId?: string | null; + readonly scope: V2SkillsListResponse__SkillScope; + readonly shortDescription?: string | null; +}; +export const V2SkillsListResponse__SkillMetadata = Schema.Struct({ + dependencies: Schema.optionalKey( + Schema.Union([V2SkillsListResponse__SkillDependencies, Schema.Null]), + ), + description: Schema.String, + enabled: Schema.Boolean, + interface: Schema.optionalKey(Schema.Union([V2SkillsListResponse__SkillInterface, Schema.Null])), + name: Schema.String, + path: V2SkillsListResponse__AbsolutePathBuf, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Owning plugin ID, matching `PluginSummary.id`, when known.", + }), + Schema.Null, + ]), + ), + scope: V2SkillsListResponse__SkillScope, + shortDescription: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2SkillsListResponse__SkillMetadata" }); + +export type V2ThreadForkResponse__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadForkResponse__SubAgentSource }; +export const V2ThreadForkResponse__SessionSource = Schema.Union( + [ + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadForkResponse__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__SessionSource" }); + +export type V2ThreadForkResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadForkResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadForkResponse__MisalignmentErrorDetails | null; +}; +export const V2ThreadForkResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadForkResponse__TurnError" }); + +export type V2ThreadForkResponse__UserInput = | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadStartResponse__CommandAction = Schema.Union( + | { + readonly detail?: V2ThreadForkResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ThreadForkResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadForkResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ThreadForkResponse__UserInput = Schema.Union( [ Schema.Struct({ - command: Schema.String, + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ThreadForkResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ name: Schema.String, - path: V2ThreadStartResponse__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadForkResponse__UserInput" }); + +export type V2ThreadForkResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadForkResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadForkResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadForkResponse__FunctionCallOutputBody" }); + +export type V2ThreadItemsListResponse__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: V2ThreadItemsListResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ThreadItemsListResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadItemsListResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ThreadItemsListResponse__UserInput = Schema.Union( + [ Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ThreadItemsListResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + detail: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null]), + ), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadItemsListResponse__UserInput" }); -export type V2ThreadStartResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadStartResponse__CollabAgentStatus; -}; -export const V2ThreadStartResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadStartResponse__CollabAgentStatus, -}); +export type V2ThreadItemsListResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadItemsListResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadItemsListResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadItemsListResponse__FunctionCallOutputBody" }); -export type V2ThreadStartResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; +export type V2ThreadListResponse__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadListResponse__SubAgentSource }; +export const V2ThreadListResponse__SessionSource = Schema.Union( + [ + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadListResponse__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadListResponse__SessionSource" }); + +export type V2ThreadListResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadListResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadListResponse__MisalignmentErrorDetails | null; }; -export const V2ThreadStartResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadStartResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +export const V2ThreadListResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadListResponse__TurnError" }); -export type V2ThreadStartResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } +export type V2ThreadListResponse__UserInput = | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadStartResponse__NonSteerableTurnKind; - }; - }; -export const V2ThreadStartResponse__CodexErrorInfo = Schema.Union( + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: V2ThreadListResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ThreadListResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadListResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ThreadListResponse__UserInput = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "other", - ]), Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ThreadListResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), + detail: Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadListResponse__UserInput" }); + +export type V2ThreadListResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadListResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadListResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadListResponse__FunctionCallOutputBody" }); + +export type V2ThreadMetadataUpdateResponse__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadMetadataUpdateResponse__SubAgentSource }; +export const V2ThreadMetadataUpdateResponse__SessionSource = Schema.Union( + [ + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadMetadataUpdateResponse__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__SessionSource" }); + +export type V2ThreadMetadataUpdateResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadMetadataUpdateResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadMetadataUpdateResponse__MisalignmentErrorDetails | null; +}; +export const V2ThreadMetadataUpdateResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ description: - "The response SSE stream disconnected in the middle of a turn before completion.", + "Optional public explanation and continuation instruction for a misalignment block.", }), + ), +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__TurnError" }); + +export type V2ThreadMetadataUpdateResponse__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: V2ThreadMetadataUpdateResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ThreadMetadataUpdateResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadMetadataUpdateResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ThreadMetadataUpdateResponse__UserInput = Schema.Union( + [ Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ThreadMetadataUpdateResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null]), ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null]), + ), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadStartResponse__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__UserInput" }); + +export type V2ThreadMetadataUpdateResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadMetadataUpdateResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadMetadataUpdateResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadMetadataUpdateResponse__FunctionCallOutputBody" }); + +export type V2ThreadReadResponse__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadReadResponse__SubAgentSource }; +export const V2ThreadReadResponse__SessionSource = Schema.Union( + [ + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadReadResponse__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", }), ], { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); +).annotate({ identifier: "V2ThreadReadResponse__SessionSource" }); -export type V2ThreadStartResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadStartResponse__PatchChangeKind; - readonly path: string; +export type V2ThreadReadResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadReadResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadReadResponse__MisalignmentErrorDetails | null; }; -export const V2ThreadStartResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadStartResponse__PatchChangeKind, - path: Schema.String, -}); +export const V2ThreadReadResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadReadResponse__TurnError" }); -export type V2ThreadStartResponse__UserInput = +export type V2ThreadReadResponse__UserInput = | { readonly text: string; - readonly text_elements?: ReadonlyArray; + readonly text_elements?: ReadonlyArray; readonly type: "text"; } | { - readonly detail?: V2ThreadStartResponse__ImageDetail | null; + readonly detail?: V2ThreadReadResponse__ImageDetail | null; readonly type: "image"; readonly url: string; } | { - readonly detail?: V2ThreadStartResponse__ImageDetail | null; + readonly detail?: V2ThreadReadResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadReadResponse__ImageDetail | null; readonly path: string; readonly type: "localImage"; } @@ -18253,25 +31857,32 @@ export type V2ThreadStartResponse__UserInput = | { readonly path: string; readonly type: "localAudio" } | { readonly name: string; readonly path: string; readonly type: "skill" } | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadStartResponse__UserInput = Schema.Union( +export const V2ThreadReadResponse__UserInput = Schema.Union( [ Schema.Struct({ text: Schema.String, text_elements: Schema.optionalKey( - Schema.Array(V2ThreadStartResponse__TextElement).annotate({ + Schema.Array(V2ThreadReadResponse__TextElement).annotate({ description: "UI-defined spans within `text` used to render or persist special elements.", default: [], }), ), type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), + detail: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), path: Schema.String, type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), }).annotate({ title: "LocalImageUserInput" }), @@ -18295,275 +31906,359 @@ export const V2ThreadStartResponse__UserInput = Schema.Union( }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadReadResponse__UserInput" }); -export type V2ThreadStartResponse__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadStartResponse__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadStartResponse__ThreadId; - }; - } - | { readonly other: string }; -export const V2ThreadStartResponse__SubAgentSource = Schema.Union( +export type V2ThreadReadResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadReadResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadReadResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadReadResponse__FunctionCallOutputBody" }); + +export type V2ThreadResumeParams__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadResumeParams__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadResumeParams__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadResumeParams__FunctionCallOutputBody" }); + +export type V2ThreadResumeResponse__CollaborationMode = { + readonly mode: V2ThreadResumeResponse__ModeKind; + readonly settings: V2ThreadResumeResponse__Settings; +}; +export const V2ThreadResumeResponse__CollaborationMode = Schema.Struct({ + mode: V2ThreadResumeResponse__ModeKind, + settings: V2ThreadResumeResponse__Settings, +}).annotate({ + description: "Collaboration mode for a Codex session.", + identifier: "V2ThreadResumeResponse__CollaborationMode", +}); + +export type V2ThreadResumeResponse__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadResumeResponse__SubAgentSource }; +export const V2ThreadResumeResponse__SessionSource = Schema.Union( [ - Schema.Literals(["review", "compact", "memory_consolidation"]), - Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadStartResponse__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadResumeResponse__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", + }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadResumeResponse__SessionSource" }); -export type V2ThreadStatusChangedNotification__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } +export type V2ThreadResumeResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadResumeResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadResumeResponse__MisalignmentErrorDetails | null; +}; +export const V2ThreadResumeResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadResumeResponse__TurnError" }); + +export type V2ThreadResumeResponse__UserInput = | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadStatusChangedNotification__ThreadStatus = Schema.Union( + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: V2ThreadResumeResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ThreadResumeResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadResumeResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ThreadResumeResponse__UserInput = Schema.Union( [ Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ThreadResumeResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), + detail: Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null])), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), Schema.Struct({ - activeFlags: Schema.Array(V2ThreadStatusChangedNotification__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadResumeResponse__UserInput" }); -export type V2ThreadTokenUsageUpdatedNotification__ThreadTokenUsage = { - readonly last: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown; - readonly modelContextWindow?: number | null; - readonly total: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown; +export type V2ThreadResumeResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadResumeResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadResumeResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadResumeResponse__FunctionCallOutputBody" }); + +export type V2ThreadRevertResponse__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadRevertResponse__SubAgentSource }; +export const V2ThreadRevertResponse__SessionSource = Schema.Union( + [ + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadRevertResponse__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", + }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadRevertResponse__SessionSource" }); + +export type V2ThreadRevertResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadRevertResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadRevertResponse__MisalignmentErrorDetails | null; }; -export const V2ThreadTokenUsageUpdatedNotification__ThreadTokenUsage = Schema.Struct({ - last: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown, - modelContextWindow: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), +export const V2ThreadRevertResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__CodexErrorInfo, Schema.Null]), ), - total: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown, -}); + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadRevertResponse__TurnError" }); -export type V2ThreadUnarchiveResponse__CommandAction = +export type V2ThreadRevertResponse__UserInput = | { - readonly command: string; - readonly name: string; - readonly path: V2ThreadUnarchiveResponse__AbsolutePathBuf; - readonly type: "read"; + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; + readonly detail?: V2ThreadRevertResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadUnarchiveResponse__CommandAction = Schema.Union( + | { + readonly detail?: V2ThreadRevertResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadRevertResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ThreadRevertResponse__UserInput = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2ThreadUnarchiveResponse__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ThreadRevertResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + detail: Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null])), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadRevertResponse__UserInput" }); -export type V2ThreadUnarchiveResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadUnarchiveResponse__CollabAgentStatus; -}; -export const V2ThreadUnarchiveResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadUnarchiveResponse__CollabAgentStatus, -}); +export type V2ThreadRevertResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadRevertResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadRevertResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadRevertResponse__FunctionCallOutputBody" }); -export type V2ThreadUnarchiveResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; +export type V2ThreadSettingsUpdatedNotification__CollaborationMode = { + readonly mode: V2ThreadSettingsUpdatedNotification__ModeKind; + readonly settings: V2ThreadSettingsUpdatedNotification__Settings; }; -export const V2ThreadUnarchiveResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadUnarchiveResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), +export const V2ThreadSettingsUpdatedNotification__CollaborationMode = Schema.Struct({ + mode: V2ThreadSettingsUpdatedNotification__ModeKind, + settings: V2ThreadSettingsUpdatedNotification__Settings, +}).annotate({ + description: "Collaboration mode for a Codex session.", + identifier: "V2ThreadSettingsUpdatedNotification__CollaborationMode", }); -export type V2ThreadUnarchiveResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } - | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadUnarchiveResponse__NonSteerableTurnKind; - }; - }; -export const V2ThreadUnarchiveResponse__CodexErrorInfo = Schema.Union( +export type V2ThreadStartedNotification__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadStartedNotification__SubAgentSource }; +export const V2ThreadStartedNotification__SessionSource = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), - Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), - Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), - Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadUnarchiveResponse__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadStartedNotification__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", }), ], { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); +).annotate({ identifier: "V2ThreadStartedNotification__SessionSource" }); -export type V2ThreadUnarchiveResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2ThreadUnarchiveResponse__PatchChangeKind; - readonly path: string; +export type V2ThreadStartedNotification__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadStartedNotification__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadStartedNotification__MisalignmentErrorDetails | null; }; -export const V2ThreadUnarchiveResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2ThreadUnarchiveResponse__PatchChangeKind, - path: Schema.String, -}); +export const V2ThreadStartedNotification__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadStartedNotification__TurnError" }); -export type V2ThreadUnarchiveResponse__UserInput = +export type V2ThreadStartedNotification__UserInput = | { readonly text: string; - readonly text_elements?: ReadonlyArray; + readonly text_elements?: ReadonlyArray; readonly type: "text"; } | { - readonly detail?: V2ThreadUnarchiveResponse__ImageDetail | null; + readonly detail?: V2ThreadStartedNotification__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ThreadStartedNotification__ImageDetail | null; readonly type: "image"; - readonly url: string; + readonly fileId: string; } | { - readonly detail?: V2ThreadUnarchiveResponse__ImageDetail | null; + readonly detail?: V2ThreadStartedNotification__ImageDetail | null; readonly path: string; readonly type: "localImage"; } @@ -18571,28 +32266,37 @@ export type V2ThreadUnarchiveResponse__UserInput = | { readonly path: string; readonly type: "localAudio" } | { readonly name: string; readonly path: string; readonly type: "skill" } | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadUnarchiveResponse__UserInput = Schema.Union( +export const V2ThreadStartedNotification__UserInput = Schema.Union( [ Schema.Struct({ text: Schema.String, text_elements: Schema.optionalKey( - Schema.Array(V2ThreadUnarchiveResponse__TextElement).annotate({ + Schema.Array(V2ThreadStartedNotification__TextElement).annotate({ description: "UI-defined spans within `text` used to render or persist special elements.", default: [], }), ), type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ detail: Schema.optionalKey( - Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null]), - ), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null]), ), path: Schema.String, type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), @@ -18617,239 +32321,306 @@ export const V2ThreadUnarchiveResponse__UserInput = Schema.Union( }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartedNotification__UserInput" }); -export type V2ThreadUnarchiveResponse__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" - | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadUnarchiveResponse__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadUnarchiveResponse__ThreadId; - }; - } - | { readonly other: string }; -export const V2ThreadUnarchiveResponse__SubAgentSource = Schema.Union( +export type V2ThreadStartedNotification__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadStartedNotification__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadStartedNotification__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadStartedNotification__FunctionCallOutputBody" }); + +export type V2ThreadStartResponse__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadStartResponse__SubAgentSource }; +export const V2ThreadStartResponse__SessionSource = Schema.Union( [ - Schema.Literals(["review", "compact", "memory_consolidation"]), - Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadUnarchiveResponse__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadUnarchiveResponse__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadStartResponse__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", + }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartResponse__SessionSource" }); -export type V2TurnCompletedNotification__CommandAction = +export type V2ThreadStartResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadStartResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadStartResponse__MisalignmentErrorDetails | null; +}; +export const V2ThreadStartResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadStartResponse__TurnError" }); + +export type V2ThreadStartResponse__UserInput = | { - readonly command: string; - readonly name: string; - readonly path: V2TurnCompletedNotification__AbsolutePathBuf; - readonly type: "read"; + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; + readonly detail?: V2ThreadStartResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; } - | { readonly command: string; readonly type: "unknown" }; -export const V2TurnCompletedNotification__CommandAction = Schema.Union( + | { + readonly detail?: V2ThreadStartResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadStartResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ThreadStartResponse__UserInput = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2TurnCompletedNotification__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ThreadStartResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + detail: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartResponse__UserInput" }); -export type V2TurnCompletedNotification__CollabAgentState = { - readonly message?: string | null; - readonly status: V2TurnCompletedNotification__CollabAgentStatus; -}; -export const V2TurnCompletedNotification__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2TurnCompletedNotification__CollabAgentStatus, -}); +export type V2ThreadStartResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadStartResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadStartResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadStartResponse__FunctionCallOutputBody" }); -export type V2TurnCompletedNotification__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; +export type V2ThreadTurnsListResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadTurnsListResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadTurnsListResponse__MisalignmentErrorDetails | null; }; -export const V2TurnCompletedNotification__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2TurnCompletedNotification__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); +export const V2ThreadTurnsListResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadTurnsListResponse__TurnError" }); -export type V2TurnCompletedNotification__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "rateLimitExceeded" - | "misalignmentPolicyViolation" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } +export type V2ThreadTurnsListResponse__UserInput = | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2TurnCompletedNotification__NonSteerableTurnKind; - }; - }; -export const V2TurnCompletedNotification__CodexErrorInfo = Schema.Union( + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { + readonly detail?: V2ThreadTurnsListResponse__ImageDetail | null; + readonly type: "image"; + readonly url: string; + } + | { + readonly detail?: V2ThreadTurnsListResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadTurnsListResponse__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2ThreadTurnsListResponse__UserInput = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "rateLimitExceeded", - "misalignmentPolicyViolation", - "other", - ]), Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2ThreadTurnsListResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null]), ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null]), ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), + detail: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null]), + ), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2TurnCompletedNotification__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2ThreadTurnsListResponse__UserInput" }); + +export type V2ThreadTurnsListResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadTurnsListResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadTurnsListResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadTurnsListResponse__FunctionCallOutputBody" }); + +export type V2ThreadUnarchiveResponse__SessionSource = + | "cli" + | "vscode" + | "exec" + | "appServer" + | "unknown" + | { readonly custom: string } + | { readonly subAgent: V2ThreadUnarchiveResponse__SubAgentSource }; +export const V2ThreadUnarchiveResponse__SessionSource = Schema.Union( + [ + Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), + Schema.Struct({ subAgent: V2ThreadUnarchiveResponse__SubAgentSource }).annotate({ + title: "SubAgentSessionSource", }), ], { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); +).annotate({ identifier: "V2ThreadUnarchiveResponse__SessionSource" }); -export type V2TurnCompletedNotification__FileUpdateChange = { - readonly diff: string; - readonly kind: V2TurnCompletedNotification__PatchChangeKind; - readonly path: string; +export type V2ThreadUnarchiveResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ThreadUnarchiveResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2ThreadUnarchiveResponse__MisalignmentErrorDetails | null; }; -export const V2TurnCompletedNotification__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2TurnCompletedNotification__PatchChangeKind, - path: Schema.String, -}); +export const V2ThreadUnarchiveResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__TurnError" }); -export type V2TurnCompletedNotification__UserInput = +export type V2ThreadUnarchiveResponse__UserInput = | { readonly text: string; - readonly text_elements?: ReadonlyArray; + readonly text_elements?: ReadonlyArray; readonly type: "text"; } | { - readonly detail?: V2TurnCompletedNotification__ImageDetail | null; + readonly detail?: V2ThreadUnarchiveResponse__ImageDetail | null; readonly type: "image"; readonly url: string; } | { - readonly detail?: V2TurnCompletedNotification__ImageDetail | null; + readonly detail?: V2ThreadUnarchiveResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2ThreadUnarchiveResponse__ImageDetail | null; readonly path: string; readonly type: "localImage"; } @@ -18857,28 +32628,37 @@ export type V2TurnCompletedNotification__UserInput = | { readonly path: string; readonly type: "localAudio" } | { readonly name: string; readonly path: string; readonly type: "skill" } | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2TurnCompletedNotification__UserInput = Schema.Union( +export const V2ThreadUnarchiveResponse__UserInput = Schema.Union( [ Schema.Struct({ text: Schema.String, text_elements: Schema.optionalKey( - Schema.Array(V2TurnCompletedNotification__TextElement).annotate({ + Schema.Array(V2ThreadUnarchiveResponse__TextElement).annotate({ description: "UI-defined spans within `text` used to render or persist special elements.", default: [], }), ), type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ detail: Schema.optionalKey( - Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null]), - ), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null]), + Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null]), ), path: Schema.String, type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), @@ -18903,197 +32683,145 @@ export const V2TurnCompletedNotification__UserInput = Schema.Union( }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadUnarchiveResponse__UserInput" }); -export type V2TurnPlanUpdatedNotification__TurnPlanStep = { - readonly status: V2TurnPlanUpdatedNotification__TurnPlanStepStatus; - readonly step: string; +export type V2ThreadUnarchiveResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadUnarchiveResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadUnarchiveResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2ThreadUnarchiveResponse__FunctionCallOutputBody" }); + +export type V2TurnCompletedNotification__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2TurnCompletedNotification__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2TurnCompletedNotification__MisalignmentErrorDetails | null; }; -export const V2TurnPlanUpdatedNotification__TurnPlanStep = Schema.Struct({ - status: V2TurnPlanUpdatedNotification__TurnPlanStepStatus, - step: Schema.String, -}); +export const V2TurnCompletedNotification__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2TurnCompletedNotification__TurnError" }); -export type V2TurnStartedNotification__CommandAction = +export type V2TurnCompletedNotification__UserInput = | { - readonly command: string; - readonly name: string; - readonly path: V2TurnStartedNotification__AbsolutePathBuf; - readonly type: "read"; + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; + readonly detail?: V2TurnCompletedNotification__ImageDetail | null; + readonly type: "image"; + readonly url: string; } - | { readonly command: string; readonly type: "unknown" }; -export const V2TurnStartedNotification__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2TurnStartedNotification__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - -export type V2TurnStartedNotification__CollabAgentState = { - readonly message?: string | null; - readonly status: V2TurnStartedNotification__CollabAgentStatus; -}; -export const V2TurnStartedNotification__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2TurnStartedNotification__CollabAgentStatus, -}); - -export type V2TurnStartedNotification__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; -}; -export const V2TurnStartedNotification__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2TurnStartedNotification__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); - -export type V2TurnStartedNotification__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2TurnStartedNotification__NonSteerableTurnKind; - }; - }; -export const V2TurnStartedNotification__CodexErrorInfo = Schema.Union( + readonly detail?: V2TurnCompletedNotification__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } + | { + readonly detail?: V2TurnCompletedNotification__ImageDetail | null; + readonly path: string; + readonly type: "localImage"; + } + | { readonly type: "audio"; readonly url: string } + | { readonly path: string; readonly type: "localAudio" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2TurnCompletedNotification__UserInput = Schema.Union( [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "other", - ]), Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2TurnCompletedNotification__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null]), ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null]), ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), + detail: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null]), + ), + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), + type: Schema.Literal("audio").annotate({ title: "AudioUserInputType" }), + url: Schema.String, + }).annotate({ title: "AudioUserInput" }), Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2TurnStartedNotification__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", - description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", - }), + path: Schema.String, + type: Schema.Literal("localAudio").annotate({ title: "LocalAudioUserInputType" }), + }).annotate({ title: "LocalAudioUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); +).annotate({ identifier: "V2TurnCompletedNotification__UserInput" }); -export type V2TurnStartedNotification__FileUpdateChange = { - readonly diff: string; - readonly kind: V2TurnStartedNotification__PatchChangeKind; - readonly path: string; +export type V2TurnCompletedNotification__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2TurnCompletedNotification__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2TurnCompletedNotification__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2TurnCompletedNotification__FunctionCallOutputBody" }); + +export type V2TurnStartedNotification__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2TurnStartedNotification__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2TurnStartedNotification__MisalignmentErrorDetails | null; }; -export const V2TurnStartedNotification__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2TurnStartedNotification__PatchChangeKind, - path: Schema.String, -}); +export const V2TurnStartedNotification__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__MisalignmentErrorDetails, Schema.Null]).annotate({ + description: + "Optional public explanation and continuation instruction for a misalignment block.", + }), + ), +}).annotate({ identifier: "V2TurnStartedNotification__TurnError" }); export type V2TurnStartedNotification__UserInput = | { @@ -19106,6 +32834,11 @@ export type V2TurnStartedNotification__UserInput = readonly type: "image"; readonly url: string; } + | { + readonly detail?: V2TurnStartedNotification__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } | { readonly detail?: V2TurnStartedNotification__ImageDetail | null; readonly path: string; @@ -19127,13 +32860,22 @@ export const V2TurnStartedNotification__UserInput = Schema.Union( ), type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey( - Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null]), - ), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null]), + ), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ detail: Schema.optionalKey( Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null]), @@ -19161,63 +32903,15 @@ export const V2TurnStartedNotification__UserInput = Schema.Union( }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); - -export type V2TurnStartParams__SandboxPolicy = - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } - | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; -export const V2TurnStartParams__SandboxPolicy = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), - writableRoots: Schema.optionalKey( - Schema.Array(V2TurnStartParams__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), - ], - { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnStartedNotification__UserInput" }); -export type V2TurnStartParams__Settings = { - readonly developer_instructions?: string | null; - readonly model: string; - readonly reasoning_effort?: V2TurnStartParams__ReasoningEffort | null; -}; -export const V2TurnStartParams__Settings = Schema.Struct({ - developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - model: Schema.String, - reasoning_effort: Schema.optionalKey( - Schema.Union([V2TurnStartParams__ReasoningEffort, Schema.Null]), - ), -}).annotate({ description: "Settings for a collaboration mode." }); +export type V2TurnStartedNotification__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2TurnStartedNotification__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2TurnStartedNotification__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2TurnStartedNotification__FunctionCallOutputBody" }); export type V2TurnStartParams__UserInput = | { @@ -19230,6 +32924,11 @@ export type V2TurnStartParams__UserInput = readonly type: "image"; readonly url: string; } + | { + readonly detail?: V2TurnStartParams__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } | { readonly detail?: V2TurnStartParams__ImageDetail | null; readonly path: string; @@ -19251,11 +32950,18 @@ export const V2TurnStartParams__UserInput = Schema.Union( ), type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ detail: Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), path: Schema.String, @@ -19281,188 +32987,35 @@ export const V2TurnStartParams__UserInput = Schema.Union( }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); - -export type V2TurnStartResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: V2TurnStartResponse__AbsolutePathBuf; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2TurnStartResponse__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: V2TurnStartResponse__AbsolutePathBuf, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnStartParams__UserInput" }); -export type V2TurnStartResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2TurnStartResponse__CollabAgentStatus; -}; -export const V2TurnStartResponse__CollabAgentState = Schema.Struct({ - message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2TurnStartResponse__CollabAgentStatus, -}); +export type V2TurnStartParams__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2TurnStartParams__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2TurnStartParams__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2TurnStartParams__FunctionCallOutputBody" }); -export type V2TurnStartResponse__MemoryCitation = { - readonly entries: ReadonlyArray; - readonly threadIds: ReadonlyArray; +export type V2TurnStartResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2TurnStartResponse__CodexErrorInfo | null; + readonly message: string; + readonly misalignment?: V2TurnStartResponse__MisalignmentErrorDetails | null; }; -export const V2TurnStartResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2TurnStartResponse__MemoryCitationEntry), - threadIds: Schema.Array(Schema.String), -}); - -export type V2TurnStartResponse__CodexErrorInfo = - | "contextWindowExceeded" - | "sessionBudgetExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "cyberPolicy" - | "internalServerError" - | "unauthorized" - | "badRequest" - | "threadRollbackFailed" - | "sandboxError" - | "other" - | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } - | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } - | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } - | { - readonly activeTurnNotSteerable: { - readonly turnKind: V2TurnStartResponse__NonSteerableTurnKind; - }; - }; -export const V2TurnStartResponse__CodexErrorInfo = Schema.Union( - [ - Schema.Literals([ - "contextWindowExceeded", - "sessionBudgetExceeded", - "usageLimitExceeded", - "serverOverloaded", - "cyberPolicy", - "internalServerError", - "unauthorized", - "badRequest", - "threadRollbackFailed", - "sandboxError", - "other", - ]), - Schema.Struct({ - httpConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), - Schema.Struct({ - responseStreamConnectionFailed: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamConnectionFailedCodexErrorInfo", - description: "Failed to connect to the response SSE stream.", - }), - Schema.Struct({ - responseStreamDisconnected: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseStreamDisconnectedCodexErrorInfo", - description: - "The response SSE stream disconnected in the middle of a turn before completion.", - }), - Schema.Struct({ - responseTooManyFailedAttempts: Schema.Struct({ - httpStatusCode: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - }), - }).annotate({ - title: "ResponseTooManyFailedAttemptsCodexErrorInfo", - description: "Reached the retry limit for responses.", - }), - Schema.Struct({ - activeTurnNotSteerable: Schema.Struct({ - turnKind: V2TurnStartResponse__NonSteerableTurnKind, - }), - }).annotate({ - title: "ActiveTurnNotSteerableCodexErrorInfo", +export const V2TurnStartResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2TurnStartResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, + misalignment: Schema.optionalKey( + Schema.Union([V2TurnStartResponse__MisalignmentErrorDetails, Schema.Null]).annotate({ description: - "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "Optional public explanation and continuation instruction for a misalignment block.", }), - ], - { mode: "oneOf" }, -).annotate({ - description: - "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", -}); - -export type V2TurnStartResponse__FileUpdateChange = { - readonly diff: string; - readonly kind: V2TurnStartResponse__PatchChangeKind; - readonly path: string; -}; -export const V2TurnStartResponse__FileUpdateChange = Schema.Struct({ - diff: Schema.String, - kind: V2TurnStartResponse__PatchChangeKind, - path: Schema.String, -}); + ), +}).annotate({ identifier: "V2TurnStartResponse__TurnError" }); export type V2TurnStartResponse__UserInput = | { @@ -19475,6 +33028,11 @@ export type V2TurnStartResponse__UserInput = readonly type: "image"; readonly url: string; } + | { + readonly detail?: V2TurnStartResponse__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } | { readonly detail?: V2TurnStartResponse__ImageDetail | null; readonly path: string; @@ -19496,11 +33054,18 @@ export const V2TurnStartResponse__UserInput = Schema.Union( ), type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ detail: Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), path: Schema.String, @@ -19526,7 +33091,15 @@ export const V2TurnStartResponse__UserInput = Schema.Union( }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnStartResponse__UserInput" }); + +export type V2TurnStartResponse__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2TurnStartResponse__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2TurnStartResponse__FunctionCallOutputContentItem), +]).annotate({ identifier: "V2TurnStartResponse__FunctionCallOutputBody" }); export type V2TurnSteerParams__UserInput = | { @@ -19539,6 +33112,11 @@ export type V2TurnSteerParams__UserInput = readonly type: "image"; readonly url: string; } + | { + readonly detail?: V2TurnSteerParams__ImageDetail | null; + readonly type: "image"; + readonly fileId: string; + } | { readonly detail?: V2TurnSteerParams__ImageDetail | null; readonly path: string; @@ -19560,11 +33138,18 @@ export const V2TurnSteerParams__UserInput = Schema.Union( ), type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - detail: Schema.optionalKey(Schema.Union([V2TurnSteerParams__ImageDetail, Schema.Null])), - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), + Schema.Union([ + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnSteerParams__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "UrlUserInput" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2TurnSteerParams__ImageDetail, Schema.Null])), + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + fileId: Schema.String, + }).annotate({ title: "FileIdUserInput" }), + ]).annotate({ title: "ImageUserInput" }), Schema.Struct({ detail: Schema.optionalKey(Schema.Union([V2TurnSteerParams__ImageDetail, Schema.Null])), path: Schema.String, @@ -19590,848 +33175,1268 @@ export const V2TurnSteerParams__UserInput = Schema.Union( }).annotate({ title: "MentionUserInput" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnSteerParams__UserInput" }); -export type ApplyPatchApprovalResponse__ReviewDecision = - | "approved" - | { - readonly approved_execpolicy_amendment: { - readonly proposed_execpolicy_amendment: ReadonlyArray; - }; - } - | "approved_for_session" - | { - readonly network_policy_amendment: { - readonly network_policy_amendment: ApplyPatchApprovalResponse__NetworkPolicyAmendment; - }; - } - | "denied" - | "timed_out" - | "abort"; -export const ApplyPatchApprovalResponse__ReviewDecision = Schema.Union( - [ - Schema.Literal("approved").annotate({ - description: "User has approved this command and the agent should execute it.", - }), - Schema.Struct({ - approved_execpolicy_amendment: Schema.Struct({ - proposed_execpolicy_amendment: Schema.Array(Schema.String), - }), - }).annotate({ - title: "ApprovedExecpolicyAmendmentReviewDecision", - description: - "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", - }), - Schema.Literal("approved_for_session").annotate({ - description: - "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", - }), - Schema.Struct({ - network_policy_amendment: Schema.Struct({ - network_policy_amendment: ApplyPatchApprovalResponse__NetworkPolicyAmendment, - }), - }).annotate({ - title: "NetworkPolicyAmendmentReviewDecision", - description: - "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", - }), - Schema.Literal("denied").annotate({ - description: - "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", - }), - Schema.Literal("timed_out").annotate({ - description: "Automatic approval review timed out before reaching a decision.", - }), - Schema.Literal("abort").annotate({ - description: - "User has denied this command and the agent should not do anything until the user's next command.", - }), - ], - { mode: "oneOf" }, -).annotate({ description: "User's decision in response to an ExecApprovalRequest." }); +export type ClientRequest__TurnSteerParams = { + readonly clientUserMessageId?: string | null; + readonly expectedTurnId: string; + readonly input: ReadonlyArray; + readonly threadId: string; +}; +export const ClientRequest__TurnSteerParams = Schema.Struct({ + clientUserMessageId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + expectedTurnId: Schema.String.annotate({ + description: + "Required active turn id precondition. The request fails when it does not match the currently active turn.", + }), + input: Schema.Array(ClientRequest__UserInput), + threadId: Schema.String, +}).annotate({ identifier: "ClientRequest__TurnSteerParams" }); -export type ClientRequest__CommandExecParams = { - readonly command: ReadonlyArray; - readonly cwd?: string | null; - readonly disableOutputCap?: boolean; - readonly disableTimeout?: boolean; - readonly env?: { readonly [x: string]: string | null } | null; - readonly outputBytesCap?: number | null; - readonly processId?: string | null; - readonly sandboxPolicy?: ClientRequest__SandboxPolicy | null; - readonly size?: ClientRequest__CommandExecTerminalSize | null; - readonly streamStdin?: boolean; - readonly streamStdoutStderr?: boolean; - readonly timeoutMs?: number | null; - readonly tty?: boolean; +export type ClientRequest__TurnToolOutput = { + readonly name: string; + readonly namespace?: string | null; + readonly output: ClientRequest__FunctionCallOutputBody; +}; +export const ClientRequest__TurnToolOutput = Schema.Struct({ + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: ClientRequest__FunctionCallOutputBody, +}).annotate({ identifier: "ClientRequest__TurnToolOutput" }); + +export type ClientRequest__ExternalAgentConfigImportParams = { + readonly migrationItems: ReadonlyArray; + readonly migrationSource?: string | null; + readonly providerId?: string | null; + readonly source?: string | null; }; -export const ClientRequest__CommandExecParams = Schema.Struct({ - command: Schema.Array(Schema.String).annotate({ - description: "Command argv vector. Empty arrays are rejected.", - }), - cwd: Schema.optionalKey( +export const ClientRequest__ExternalAgentConfigImportParams = Schema.Struct({ + migrationItems: Schema.Array(ClientRequest__ExternalAgentConfigMigrationItem), + migrationSource: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional working directory. Defaults to the server cwd.", - }), - Schema.Null, - ]), - ), - disableOutputCap: Schema.optionalKey( - Schema.Boolean.annotate({ - description: - "Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.", - }), - ), - disableTimeout: Schema.optionalKey( - Schema.Boolean.annotate({ - description: - "Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.", - }), - ), - env: Schema.optionalKey( - Schema.Union([ - Schema.Record(Schema.String, Schema.Union([Schema.String, Schema.Null])).annotate({ description: - "Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable.", + "Migration-source selector used to produce the migration items. Pass the same value to detection and import; missing or unrecognized values use the default source.", }), Schema.Null, ]), ), - outputBytesCap: Schema.optionalKey( + providerId: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ + Schema.String.annotate({ description: - "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", - format: "uint", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + "Opaque provider identifier supplied by the caller for analytics attribution and import history display. This does not select the migration source.", + }), Schema.Null, ]), ), - processId: Schema.optionalKey( + source: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: - "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", + description: "Optional identifier for the product that initiated the import.", }), Schema.Null, ]), ), - sandboxPolicy: Schema.optionalKey( - Schema.Union([ClientRequest__SandboxPolicy, Schema.Null]).annotate({ - description: - "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`.", - }), +}).annotate({ identifier: "ClientRequest__ExternalAgentConfigImportParams" }); + +export type ClientRequest__ExternalAgentConfigImportHistoryRecordParams = { + readonly itemTypeResults: ReadonlyArray; + readonly providerId: string; +}; +export const ClientRequest__ExternalAgentConfigImportHistoryRecordParams = Schema.Struct({ + itemTypeResults: Schema.Array( + ClientRequest__ExternalAgentConfigImportHistoryRecordTypeResultParams, + ).annotate({ description: "Completed results grouped by imported item type." }), + providerId: Schema.String.annotate({ + description: "Opaque provider identifier for the externally completed import.", + }), +}).annotate({ identifier: "ClientRequest__ExternalAgentConfigImportHistoryRecordParams" }); + +export type CommandExecutionRequestApprovalParams__FileSystemSandboxEntry = { + readonly access: CommandExecutionRequestApprovalParams__FileSystemAccessMode; + readonly path: CommandExecutionRequestApprovalParams__FileSystemPath; +}; +export const CommandExecutionRequestApprovalParams__FileSystemSandboxEntry = Schema.Struct({ + access: CommandExecutionRequestApprovalParams__FileSystemAccessMode, + path: CommandExecutionRequestApprovalParams__FileSystemPath, +}).annotate({ identifier: "CommandExecutionRequestApprovalParams__FileSystemSandboxEntry" }); + +export type McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema = + | McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema + | McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema; +export const McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema = Schema.Union([ + McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema, + McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema, +]).annotate({ + identifier: "McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema", +}); + +export type PermissionsRequestApprovalParams__FileSystemSandboxEntry = { + readonly access: PermissionsRequestApprovalParams__FileSystemAccessMode; + readonly path: PermissionsRequestApprovalParams__FileSystemPath; +}; +export const PermissionsRequestApprovalParams__FileSystemSandboxEntry = Schema.Struct({ + access: PermissionsRequestApprovalParams__FileSystemAccessMode, + path: PermissionsRequestApprovalParams__FileSystemPath, +}).annotate({ identifier: "PermissionsRequestApprovalParams__FileSystemSandboxEntry" }); + +export type PermissionsRequestApprovalResponse__FileSystemSandboxEntry = { + readonly access: PermissionsRequestApprovalResponse__FileSystemAccessMode; + readonly path: PermissionsRequestApprovalResponse__FileSystemPath; +}; +export const PermissionsRequestApprovalResponse__FileSystemSandboxEntry = Schema.Struct({ + access: PermissionsRequestApprovalResponse__FileSystemAccessMode, + path: PermissionsRequestApprovalResponse__FileSystemPath, +}).annotate({ identifier: "PermissionsRequestApprovalResponse__FileSystemSandboxEntry" }); + +export type ServerNotification__ErrorNotification = { + readonly error: ServerNotification__TurnError; + readonly threadId: string; + readonly turnId: string; + readonly willRetry: boolean; +}; +export const ServerNotification__ErrorNotification = Schema.Struct({ + error: ServerNotification__TurnError, + threadId: Schema.String, + turnId: Schema.String, + willRetry: Schema.Boolean, +}).annotate({ identifier: "ServerNotification__ErrorNotification" }); + +export type ServerNotification__ThreadSettings = { + readonly activePermissionProfile?: ServerNotification__ActivePermissionProfile | null; + readonly approvalPolicy: ServerNotification__AskForApproval; + readonly approvalsReviewer: ServerNotification__ApprovalsReviewer; + readonly collaborationMode: ServerNotification__CollaborationMode; + readonly cwd: ServerNotification__AbsolutePathBuf; + readonly disabledPluginIds?: ReadonlyArray; + readonly effort?: ServerNotification__ReasoningEffort | null; + readonly model: string; + readonly modelProvider: string; + readonly personality?: ServerNotification__Personality | null; + readonly sandboxPolicy: ServerNotification__SandboxPolicy; + readonly serviceTier?: string | null; + readonly summary?: ServerNotification__ReasoningSummary | null; +}; +export const ServerNotification__ThreadSettings = Schema.Struct({ + activePermissionProfile: Schema.optionalKey( + Schema.Union([ServerNotification__ActivePermissionProfile, Schema.Null]), ), - size: Schema.optionalKey( - Schema.Union([ClientRequest__CommandExecTerminalSize, Schema.Null]).annotate({ - description: "Optional initial PTY size in character cells. Only valid when `tty` is true.", + approvalPolicy: ServerNotification__AskForApproval, + approvalsReviewer: ServerNotification__ApprovalsReviewer, + collaborationMode: ServerNotification__CollaborationMode, + cwd: ServerNotification__AbsolutePathBuf, + disabledPluginIds: Schema.optionalKey( + Schema.Array(Schema.String).annotate({ + description: "Saved list of disabled plugin IDs. Does not yet filter plugin capabilities.", + default: [], }), ), - streamStdin: Schema.optionalKey( - Schema.Boolean.annotate({ + effort: Schema.optionalKey(Schema.Union([ServerNotification__ReasoningEffort, Schema.Null])), + model: Schema.String, + modelProvider: Schema.String, + personality: Schema.optionalKey( + Schema.Union([ServerNotification__Personality, Schema.Null]).annotate({ description: - "Allow follow-up `command/exec/write` requests to write stdin bytes.\n\nRequires a client-supplied `processId`.", + "@deprecated Reports the saved setting; `friendly` and `pragmatic` no longer select a style.", }), ), - streamStdoutStderr: Schema.optionalKey( - Schema.Boolean.annotate({ + sandboxPolicy: ServerNotification__SandboxPolicy, + serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + summary: Schema.optionalKey(Schema.Union([ServerNotification__ReasoningSummary, Schema.Null])), +}).annotate({ identifier: "ServerNotification__ThreadSettings" }); + +export type ServerNotification__ThreadItem = + | { + readonly clientId?: string | null; + readonly content: ReadonlyArray; + readonly id: string; + readonly type: "userMessage"; + } + | { + readonly fragments: ReadonlyArray; + readonly id: string; + readonly type: "hookPrompt"; + } + | { + readonly delivery?: ServerNotification__AgentMessageDelivery | null; + readonly id: string; + readonly memoryCitation?: ServerNotification__MemoryCitation | null; + readonly phase?: ServerNotification__MessagePhase | null; + readonly questions?: ReadonlyArray | null; + readonly text: string; + readonly type: "agentMessage"; + } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: ServerNotification__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } + | { readonly id: string; readonly text: string; readonly type: "plan" } + | { + readonly content?: ReadonlyArray; + readonly id: string; + readonly summary?: ReadonlyArray; + readonly type: "reasoning"; + } + | { + readonly aggregatedOutput?: string | null; + readonly command: string; + readonly commandActions: ReadonlyArray; + readonly cwd: ServerNotification__LegacyAppPathString; + readonly durationMs?: number | null; + readonly exitCode?: number | null; + readonly id: string; + readonly pluginId?: string | null; + readonly processId?: string | null; + readonly scriptPath?: string | null; + readonly source?: ServerNotification__CommandExecutionSource; + readonly status: ServerNotification__CommandExecutionStatus; + readonly type: "commandExecution"; + } + | { + readonly changes: ReadonlyArray; + readonly id: string; + readonly status: ServerNotification__PatchApplyStatus; + readonly type: "fileChange"; + } + | { + readonly appContext?: ServerNotification__McpToolCallAppContext | null; + readonly arguments: Schema.Json; + readonly durationMs?: number | null; + readonly error?: ServerNotification__McpToolCallError | null; + readonly id: string; + readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: ServerNotification__McpAppUi | null; + readonly pluginId?: string | null; + readonly readOnlyHint?: boolean | null; + readonly result?: ServerNotification__McpToolCallResult | null; + readonly server: string; + readonly status: ServerNotification__McpToolCallStatus; + readonly tool: string; + readonly type: "mcpToolCall"; + } + | { + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; + readonly durationMs?: number | null; + readonly id: string; + readonly namespace?: string | null; + readonly status: ServerNotification__DynamicToolCallStatus; + readonly success?: boolean | null; + readonly tool: string; + readonly type: "dynamicToolCall"; + } + | { + readonly agentsStates: { readonly [x: string]: ServerNotification__CollabAgentState }; + readonly id: string; + readonly model?: string | null; + readonly prompt?: string | null; + readonly reasoningEffort?: ServerNotification__ReasoningEffort | null; + readonly receiverThreadIds: ReadonlyArray; + readonly senderThreadId: string; + readonly status: ServerNotification__CollabAgentToolCallStatus; + readonly tool: ServerNotification__CollabAgentTool; + readonly type: "collabAgentToolCall"; + } + | { + readonly agentPath: string; + readonly agentThreadId: string; + readonly id: string; + readonly kind: ServerNotification__SubAgentActivityKind; + readonly type: "subAgentActivity"; + } + | { + readonly action?: ServerNotification__WebSearchAction | null; + readonly id: string; + readonly query: string; + readonly results?: ReadonlyArray | null; + readonly type: "webSearch"; + } + | { + readonly id: string; + readonly path: ServerNotification__LegacyAppPathString; + readonly type: "imageView"; + } + | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } + | { + readonly failure?: ServerNotification__ImageGenerationFailure | null; + readonly id: string; + readonly result: string; + readonly revisedPrompt?: string | null; + readonly savedPath?: ServerNotification__AbsolutePathBuf | null; + readonly status: string; + readonly transparentBackground?: boolean | null; + readonly type: "imageGeneration"; + } + | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } + | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } + | { readonly id: string; readonly type: "contextCompaction" }; +export const ServerNotification__ThreadItem = Schema.Union( + [ + Schema.Struct({ + clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + content: Schema.Array(ServerNotification__UserInput), + id: Schema.String, + type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), + }).annotate({ title: "UserMessageThreadItem" }), + Schema.Struct({ + fragments: Schema.Array(ServerNotification__HookPromptFragment), + id: Schema.String, + type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), + }).annotate({ title: "HookPromptThreadItem" }), + Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([ServerNotification__AgentMessageDelivery, Schema.Null]), + ), + id: Schema.String, + memoryCitation: Schema.optionalKey( + Schema.Union([ServerNotification__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey(Schema.Union([ServerNotification__MessagePhase, Schema.Null])), + questions: Schema.optionalKey( + Schema.Union([Schema.Array(ServerNotification__AsyncUserInputQuestion), Schema.Null]), + ), + text: Schema.String, + type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), + }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: ServerNotification__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), + Schema.Struct({ + id: Schema.String, + text: Schema.String, + type: Schema.Literal("plan").annotate({ title: "PlanThreadItemType" }), + }).annotate({ + title: "PlanThreadItem", description: - "Stream stdout/stderr via `command/exec/outputDelta` notifications.\n\nStreamed bytes are not duplicated into the final response and require a client-supplied `processId`.", + "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", }), - ), - timeoutMs: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ + Schema.Struct({ + content: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + id: Schema.String, + summary: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + type: Schema.Literal("reasoning").annotate({ title: "ReasoningThreadItemType" }), + }).annotate({ title: "ReasoningThreadItem" }), + Schema.Struct({ + aggregatedOutput: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "The command's output, aggregated from stdout and stderr.", + }), + Schema.Null, + ]), + ), + command: Schema.String.annotate({ description: "The command to be executed." }), + commandActions: Schema.Array(ServerNotification__CommandAction).annotate({ description: - "Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.", - format: "int64", - }).check(Schema.isInt()), - Schema.Null, - ]), - ), - tty: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "Enable PTY mode.\n\nThis implies `streamStdin` and `streamStdoutStderr`.", + "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + }), + cwd: Schema.suspend( + (): Schema.Codec => + ServerNotification__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The duration of the command execution in milliseconds.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + exitCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The command's exit code.", + format: "int32", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), + processId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Identifier for the underlying PTY process (when available).", + }), + Schema.Null, + ]), + ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), + source: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + ServerNotification__CommandExecutionSource, + ).annotate({ default: "agent" }), + ), + status: ServerNotification__CommandExecutionStatus, + type: Schema.Literal("commandExecution").annotate({ + title: "CommandExecutionThreadItemType", + }), + }).annotate({ title: "CommandExecutionThreadItem" }), + Schema.Struct({ + changes: Schema.Array(ServerNotification__FileUpdateChange), + id: Schema.String, + status: ServerNotification__PatchApplyStatus, + type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), + }).annotate({ title: "FileChangeThreadItem" }), + Schema.Struct({ + appContext: Schema.optionalKey( + Schema.Union([ServerNotification__McpToolCallAppContext, Schema.Null]), + ), + arguments: Schema.Json.annotate({ expected: "JSON value" }), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The duration of the MCP tool call in milliseconds.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + error: Schema.optionalKey(Schema.Union([ServerNotification__McpToolCallError, Schema.Null])), + id: Schema.String, + mcpAppResourceUri: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", + }), + Schema.Null, + ]), + ), + mcpAppUi: Schema.optionalKey( + Schema.Union([ServerNotification__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), + pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + result: Schema.optionalKey( + Schema.Union([ServerNotification__McpToolCallResult, Schema.Null]), + ), + server: Schema.String, + status: ServerNotification__McpToolCallStatus, + tool: Schema.String, + type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), + }).annotate({ title: "McpToolCallThreadItem" }), + Schema.Struct({ + arguments: Schema.Json.annotate({ expected: "JSON value" }), + contentItems: Schema.optionalKey( + Schema.Union([ + Schema.Array(ServerNotification__DynamicToolCallOutputContentItem), + Schema.Null, + ]), + ), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The duration of the dynamic tool call in milliseconds.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + id: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: ServerNotification__DynamicToolCallStatus, + success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + tool: Schema.String, + type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), + }).annotate({ title: "DynamicToolCallThreadItem" }), + Schema.Struct({ + agentsStates: Schema.Record(Schema.String, ServerNotification__CollabAgentState).annotate({ + description: "Last known status of the target agents, when available.", + }), + id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Model requested for the spawned agent, when applicable.", + }), + Schema.Null, + ]), + ), + prompt: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Prompt text sent as part of the collab tool call, when available.", + }), + Schema.Null, + ]), + ), + reasoningEffort: Schema.optionalKey( + Schema.Union([ServerNotification__ReasoningEffort, Schema.Null]).annotate({ + description: "Reasoning effort requested for the spawned agent, when applicable.", + }), + ), + receiverThreadIds: Schema.Array(Schema.String).annotate({ + description: + "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + }), + senderThreadId: Schema.String.annotate({ + description: "Thread ID of the agent issuing the collab request.", + }), + status: Schema.suspend( + (): Schema.Codec => + ServerNotification__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + ServerNotification__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), + type: Schema.Literal("collabAgentToolCall").annotate({ + title: "CollabAgentToolCallThreadItemType", + }), + }).annotate({ title: "CollabAgentToolCallThreadItem" }), + Schema.Struct({ + agentPath: Schema.String, + agentThreadId: Schema.String, + id: Schema.String, + kind: ServerNotification__SubAgentActivityKind, + type: Schema.Literal("subAgentActivity").annotate({ + title: "SubAgentActivityThreadItemType", + }), + }).annotate({ title: "SubAgentActivityThreadItem" }), + Schema.Struct({ + action: Schema.optionalKey(Schema.Union([ServerNotification__WebSearchAction, Schema.Null])), + id: Schema.String, + query: Schema.String, + results: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ + description: + "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("webSearch").annotate({ title: "WebSearchThreadItemType" }), + }).annotate({ title: "WebSearchThreadItem" }), + Schema.Struct({ + id: Schema.String, + path: ServerNotification__LegacyAppPathString, + type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), + }).annotate({ title: "ImageViewThreadItem" }), + Schema.Struct({ + durationMs: Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + id: Schema.String, + type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), + }).annotate({ + title: "SleepThreadItem", + description: "Display item emitted by the interruptible `clock.sleep` tool.", }), - ), -}).annotate({ - description: - "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.", -}); + Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([ServerNotification__ImageGenerationFailure, Schema.Null]), + ), + id: Schema.String, + result: Schema.String, + revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([ServerNotification__AbsolutePathBuf, Schema.Null]), + ), + status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), + }).annotate({ title: "ImageGenerationThreadItem" }), + Schema.Struct({ + id: Schema.String, + review: Schema.String, + type: Schema.Literal("enteredReviewMode").annotate({ + title: "EnteredReviewModeThreadItemType", + }), + }).annotate({ title: "EnteredReviewModeThreadItem" }), + Schema.Struct({ + id: Schema.String, + review: Schema.String, + type: Schema.Literal("exitedReviewMode").annotate({ + title: "ExitedReviewModeThreadItemType", + }), + }).annotate({ title: "ExitedReviewModeThreadItem" }), + Schema.Struct({ + id: Schema.String, + type: Schema.Literal("contextCompaction").annotate({ + title: "ContextCompactionThreadItemType", + }), + }).annotate({ title: "ContextCompactionThreadItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "ServerNotification__ThreadItem" }); -export type ClientRequest__FunctionCallOutputBody = - | string - | ReadonlyArray; -export const ClientRequest__FunctionCallOutputBody = Schema.Union([ - Schema.String, - Schema.Array(ClientRequest__FunctionCallOutputContentItem), -]); +export type ServerNotification__FileSystemSandboxEntry = { + readonly access: ServerNotification__FileSystemAccessMode; + readonly path: ServerNotification__FileSystemPath; +}; +export const ServerNotification__FileSystemSandboxEntry = Schema.Struct({ + access: ServerNotification__FileSystemAccessMode, + path: ServerNotification__FileSystemPath, +}).annotate({ identifier: "ServerNotification__FileSystemSandboxEntry" }); -export type ClientRequest__ConfigBatchWriteParams = { - readonly edits: ReadonlyArray; - readonly expectedVersion?: string | null; - readonly filePath?: string | null; - readonly reloadUserConfig?: boolean; +export type ServerNotification__HookStartedNotification = { + readonly run: ServerNotification__HookRunSummary; + readonly threadId: string; + readonly turnId?: string | null; }; -export const ClientRequest__ConfigBatchWriteParams = Schema.Struct({ - edits: Schema.Array(ClientRequest__ConfigEdit), - expectedVersion: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - filePath: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Path to the config file to write; defaults to the user's `config.toml` when omitted.", - }), - Schema.Null, - ]), - ), - reloadUserConfig: Schema.optionalKey( - Schema.Boolean.annotate({ - description: - "When true, hot-reload the updated user config into all loaded threads after writing.", - }), - ), -}); +export const ServerNotification__HookStartedNotification = Schema.Struct({ + run: ServerNotification__HookRunSummary, + threadId: Schema.String, + turnId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__HookStartedNotification" }); -export type ClientRequest__PluginShareSaveParams = { - readonly discoverability?: ClientRequest__PluginShareDiscoverability | null; - readonly pluginPath: ClientRequest__AbsolutePathBuf; - readonly remotePluginId?: string | null; - readonly shareTargets?: ReadonlyArray | null; +export type ServerNotification__HookCompletedNotification = { + readonly run: ServerNotification__HookRunSummary; + readonly threadId: string; + readonly turnId?: string | null; }; -export const ClientRequest__PluginShareSaveParams = Schema.Struct({ - discoverability: Schema.optionalKey( - Schema.Union([ClientRequest__PluginShareDiscoverability, Schema.Null]), - ), - pluginPath: ClientRequest__AbsolutePathBuf, - remotePluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - shareTargets: Schema.optionalKey( - Schema.Union([Schema.Array(ClientRequest__PluginShareTarget), Schema.Null]), - ), -}); +export const ServerNotification__HookCompletedNotification = Schema.Struct({ + run: ServerNotification__HookRunSummary, + threadId: Schema.String, + turnId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "ServerNotification__HookCompletedNotification" }); -export type ClientRequest__PluginShareUpdateTargetsParams = { - readonly discoverability: ClientRequest__PluginShareUpdateDiscoverability; - readonly remotePluginId: string; - readonly shareTargets: ReadonlyArray; +export type ServerNotification__AppListUpdatedNotification = { + readonly data: ReadonlyArray; }; -export const ClientRequest__PluginShareUpdateTargetsParams = Schema.Struct({ - discoverability: ClientRequest__PluginShareUpdateDiscoverability, - remotePluginId: Schema.String, - shareTargets: Schema.Array(ClientRequest__PluginShareTarget), +export const ServerNotification__AppListUpdatedNotification = Schema.Struct({ + data: Schema.Array(ServerNotification__AppInfo), +}).annotate({ + description: "EXPERIMENTAL - notification emitted when the app list changes.", + identifier: "ServerNotification__AppListUpdatedNotification", }); -export type ClientRequest__ExternalAgentConfigMigrationItem = { - readonly cwd?: string | null; - readonly description: string; - readonly details?: ClientRequest__MigrationDetails | null; - readonly itemType: ClientRequest__ExternalAgentConfigMigrationItemType; +export type ServerNotification__ExternalAgentConfigImportProgressNotification = { + readonly importId: string; + readonly itemTypeResults: ReadonlyArray; }; -export const ClientRequest__ExternalAgentConfigMigrationItem = Schema.Struct({ - cwd: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", - }), - Schema.Null, - ]), - ), - description: Schema.String, - details: Schema.optionalKey(Schema.Union([ClientRequest__MigrationDetails, Schema.Null])), - itemType: ClientRequest__ExternalAgentConfigMigrationItemType, -}); +export const ServerNotification__ExternalAgentConfigImportProgressNotification = Schema.Struct({ + importId: Schema.String, + itemTypeResults: Schema.Array(ServerNotification__ExternalAgentConfigImportTypeResult), +}).annotate({ identifier: "ServerNotification__ExternalAgentConfigImportProgressNotification" }); -export type ClientRequest__TurnStartParams = { - readonly approvalPolicy?: ClientRequest__AskForApproval | null; - readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; - readonly clientUserMessageId?: string | null; - readonly cwd?: string | null; - readonly effort?: ClientRequest__ReasoningEffort | null; - readonly input: ReadonlyArray; - readonly model?: string | null; - readonly outputSchema?: unknown; - readonly personality?: ClientRequest__Personality | null; - readonly sandboxPolicy?: ClientRequest__SandboxPolicy | null; - readonly serviceTier?: string | null; - readonly summary?: ClientRequest__ReasoningSummary | null; - readonly threadId: string; +export type ServerNotification__ExternalAgentConfigImportCompletedNotification = { + readonly importId: string; + readonly itemTypeResults: ReadonlyArray; }; -export const ClientRequest__TurnStartParams = Schema.Struct({ - approvalPolicy: Schema.optionalKey( - Schema.Union([ClientRequest__AskForApproval, Schema.Null]).annotate({ - description: "Override the approval policy for this turn and subsequent turns.", - }), - ), - approvalsReviewer: Schema.optionalKey( - Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ - description: - "Override where approval requests are routed for review on this turn and subsequent turns.", - }), - ), - clientUserMessageId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - cwd: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Override the working directory for this turn and subsequent turns.", - }), - Schema.Null, - ]), - ), - effort: Schema.optionalKey( - Schema.Union([ClientRequest__ReasoningEffort, Schema.Null]).annotate({ - description: "Override the reasoning effort for this turn and subsequent turns.", - }), - ), - input: Schema.Array(ClientRequest__UserInput), - model: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Override the model for this turn and subsequent turns.", - }), - Schema.Null, - ]), +export const ServerNotification__ExternalAgentConfigImportCompletedNotification = Schema.Struct({ + importId: Schema.String, + itemTypeResults: Schema.Array(ServerNotification__ExternalAgentConfigImportTypeResult), +}).annotate({ identifier: "ServerNotification__ExternalAgentConfigImportCompletedNotification" }); + +export type ServerRequest__FileSystemSandboxEntry = { + readonly access: ServerRequest__FileSystemAccessMode; + readonly path: ServerRequest__FileSystemPath; +}; +export const ServerRequest__FileSystemSandboxEntry = Schema.Struct({ + access: ServerRequest__FileSystemAccessMode, + path: ServerRequest__FileSystemPath, +}).annotate({ identifier: "ServerRequest__FileSystemSandboxEntry" }); + +export type ServerRequest__McpElicitationMultiSelectEnumSchema = + | ServerRequest__McpElicitationUntitledMultiSelectEnumSchema + | ServerRequest__McpElicitationTitledMultiSelectEnumSchema; +export const ServerRequest__McpElicitationMultiSelectEnumSchema = Schema.Union([ + ServerRequest__McpElicitationUntitledMultiSelectEnumSchema, + ServerRequest__McpElicitationTitledMultiSelectEnumSchema, +]).annotate({ identifier: "ServerRequest__McpElicitationMultiSelectEnumSchema" }); + +export type V2ConfigReadResponse__ComputerUseConfig = { + readonly default_app_access?: V2ConfigReadResponse__AllowDenyRequirement | null; + readonly macos?: V2ConfigReadResponse__ComputerUseMacosConfig | null; + readonly windows?: V2ConfigReadResponse__ComputerUseWindowsConfig | null; +}; +export const V2ConfigReadResponse__ComputerUseConfig = Schema.Struct({ + default_app_access: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__AllowDenyRequirement, Schema.Null]), ), - outputSchema: Schema.optionalKey( - Schema.Unknown.annotate({ - description: - "Optional JSON Schema used to constrain the final assistant message for this turn.", - }), + macos: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__ComputerUseMacosConfig, Schema.Null]), ), - personality: Schema.optionalKey( - Schema.Union([ClientRequest__Personality, Schema.Null]).annotate({ - description: "Override the personality for this turn and subsequent turns.", - }), + windows: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__ComputerUseWindowsConfig, Schema.Null]), ), - sandboxPolicy: Schema.optionalKey( - Schema.Union([ClientRequest__SandboxPolicy, Schema.Null]).annotate({ - description: "Override the sandbox policy for this turn and subsequent turns.", - }), +}).annotate({ identifier: "V2ConfigReadResponse__ComputerUseConfig" }); + +export type V2ConfigRequirementsReadResponse__ComputerUseRequirements = { + readonly allowLockedComputerUse?: boolean | null; + readonly allowPersistentApproval?: boolean | null; + readonly defaultAppAccess?: V2ConfigRequirementsReadResponse__AllowDenyRequirement | null; + readonly macos?: V2ConfigRequirementsReadResponse__ComputerUseMacosRequirements | null; + readonly windows?: V2ConfigRequirementsReadResponse__ComputerUseWindowsRequirements | null; +}; +export const V2ConfigRequirementsReadResponse__ComputerUseRequirements = Schema.Struct({ + allowLockedComputerUse: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + allowPersistentApproval: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + defaultAppAccess: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__AllowDenyRequirement, Schema.Null]), ), - serviceTier: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Override the service tier for this turn and subsequent turns.", - }), - Schema.Null, - ]), + macos: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__ComputerUseMacosRequirements, Schema.Null]), ), - summary: Schema.optionalKey( - Schema.Union([ClientRequest__ReasoningSummary, Schema.Null]).annotate({ - description: "Override the reasoning summary for this turn and subsequent turns.", - }), + windows: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__ComputerUseWindowsRequirements, Schema.Null]), ), - threadId: Schema.String, -}); +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__ComputerUseRequirements" }); -export type ClientRequest__TurnSteerParams = { - readonly clientUserMessageId?: string | null; - readonly expectedTurnId: string; - readonly input: ReadonlyArray; - readonly threadId: string; +export type V2ConfigWriteResponse__OverriddenMetadata = { + readonly effectiveValue: Schema.Json; + readonly message: string; + readonly overridingLayer: V2ConfigWriteResponse__ConfigLayerMetadata; }; -export const ClientRequest__TurnSteerParams = Schema.Struct({ - clientUserMessageId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - expectedTurnId: Schema.String.annotate({ - description: - "Required active turn id precondition. The request fails when it does not match the currently active turn.", - }), - input: Schema.Array(ClientRequest__UserInput), - threadId: Schema.String, -}); +export const V2ConfigWriteResponse__OverriddenMetadata = Schema.Struct({ + effectiveValue: Schema.Json.annotate({ expected: "JSON value" }), + message: Schema.String, + overridingLayer: V2ConfigWriteResponse__ConfigLayerMetadata, +}).annotate({ identifier: "V2ConfigWriteResponse__OverriddenMetadata" }); -export type CommandExecutionRequestApprovalParams__FileSystemPath = +export type V2ItemCompletedNotification__ThreadItem = | { - readonly path: CommandExecutionRequestApprovalParams__LegacyAppPathString; - readonly type: "path"; + readonly clientId?: string | null; + readonly content: ReadonlyArray; + readonly id: string; + readonly type: "userMessage"; } - | { readonly pattern: string; readonly type: "glob_pattern" } | { - readonly type: "special"; - readonly value: CommandExecutionRequestApprovalParams__FileSystemSpecialPath; - }; -export const CommandExecutionRequestApprovalParams__FileSystemPath = Schema.Union( + readonly fragments: ReadonlyArray; + readonly id: string; + readonly type: "hookPrompt"; + } + | { + readonly delivery?: V2ItemCompletedNotification__AgentMessageDelivery | null; + readonly id: string; + readonly memoryCitation?: V2ItemCompletedNotification__MemoryCitation | null; + readonly phase?: V2ItemCompletedNotification__MessagePhase | null; + readonly questions?: ReadonlyArray | null; + readonly text: string; + readonly type: "agentMessage"; + } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ItemCompletedNotification__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } + | { readonly id: string; readonly text: string; readonly type: "plan" } + | { + readonly content?: ReadonlyArray; + readonly id: string; + readonly summary?: ReadonlyArray; + readonly type: "reasoning"; + } + | { + readonly aggregatedOutput?: string | null; + readonly command: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ItemCompletedNotification__LegacyAppPathString; + readonly durationMs?: number | null; + readonly exitCode?: number | null; + readonly id: string; + readonly pluginId?: string | null; + readonly processId?: string | null; + readonly scriptPath?: string | null; + readonly source?: V2ItemCompletedNotification__CommandExecutionSource; + readonly status: V2ItemCompletedNotification__CommandExecutionStatus; + readonly type: "commandExecution"; + } + | { + readonly changes: ReadonlyArray; + readonly id: string; + readonly status: V2ItemCompletedNotification__PatchApplyStatus; + readonly type: "fileChange"; + } + | { + readonly appContext?: V2ItemCompletedNotification__McpToolCallAppContext | null; + readonly arguments: Schema.Json; + readonly durationMs?: number | null; + readonly error?: V2ItemCompletedNotification__McpToolCallError | null; + readonly id: string; + readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ItemCompletedNotification__McpAppUi | null; + readonly pluginId?: string | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ItemCompletedNotification__McpToolCallResult | null; + readonly server: string; + readonly status: V2ItemCompletedNotification__McpToolCallStatus; + readonly tool: string; + readonly type: "mcpToolCall"; + } + | { + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; + readonly durationMs?: number | null; + readonly id: string; + readonly namespace?: string | null; + readonly status: V2ItemCompletedNotification__DynamicToolCallStatus; + readonly success?: boolean | null; + readonly tool: string; + readonly type: "dynamicToolCall"; + } + | { + readonly agentsStates: { + readonly [x: string]: V2ItemCompletedNotification__CollabAgentState; + }; + readonly id: string; + readonly model?: string | null; + readonly prompt?: string | null; + readonly reasoningEffort?: V2ItemCompletedNotification__ReasoningEffort | null; + readonly receiverThreadIds: ReadonlyArray; + readonly senderThreadId: string; + readonly status: V2ItemCompletedNotification__CollabAgentToolCallStatus; + readonly tool: V2ItemCompletedNotification__CollabAgentTool; + readonly type: "collabAgentToolCall"; + } + | { + readonly agentPath: string; + readonly agentThreadId: string; + readonly id: string; + readonly kind: V2ItemCompletedNotification__SubAgentActivityKind; + readonly type: "subAgentActivity"; + } + | { + readonly action?: V2ItemCompletedNotification__WebSearchAction | null; + readonly id: string; + readonly query: string; + readonly results?: ReadonlyArray | null; + readonly type: "webSearch"; + } + | { + readonly id: string; + readonly path: V2ItemCompletedNotification__LegacyAppPathString; + readonly type: "imageView"; + } + | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } + | { + readonly failure?: V2ItemCompletedNotification__ImageGenerationFailure | null; + readonly id: string; + readonly result: string; + readonly revisedPrompt?: string | null; + readonly savedPath?: V2ItemCompletedNotification__AbsolutePathBuf | null; + readonly status: string; + readonly transparentBackground?: boolean | null; + readonly type: "imageGeneration"; + } + | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } + | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } + | { readonly id: string; readonly type: "contextCompaction" }; +export const V2ItemCompletedNotification__ThreadItem = Schema.Union( [ Schema.Struct({ - path: CommandExecutionRequestApprovalParams__LegacyAppPathString, - type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), - }).annotate({ title: "PathFileSystemPath" }), + clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + content: Schema.Array(V2ItemCompletedNotification__UserInput), + id: Schema.String, + type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), + }).annotate({ title: "UserMessageThreadItem" }), + Schema.Struct({ + fragments: Schema.Array(V2ItemCompletedNotification__HookPromptFragment), + id: Schema.String, + type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), + }).annotate({ title: "HookPromptThreadItem" }), + Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__AgentMessageDelivery, Schema.Null]), + ), + id: Schema.String, + memoryCitation: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__MessagePhase, Schema.Null]), + ), + questions: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ItemCompletedNotification__AsyncUserInputQuestion), + Schema.Null, + ]), + ), + text: Schema.String, + type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), + }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ItemCompletedNotification__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), + Schema.Struct({ + id: Schema.String, + text: Schema.String, + type: Schema.Literal("plan").annotate({ title: "PlanThreadItemType" }), + }).annotate({ + title: "PlanThreadItem", + description: + "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + }), + Schema.Struct({ + content: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + id: Schema.String, + summary: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + type: Schema.Literal("reasoning").annotate({ title: "ReasoningThreadItemType" }), + }).annotate({ title: "ReasoningThreadItem" }), + Schema.Struct({ + aggregatedOutput: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "The command's output, aggregated from stdout and stderr.", + }), + Schema.Null, + ]), + ), + command: Schema.String.annotate({ description: "The command to be executed." }), + commandActions: Schema.Array(V2ItemCompletedNotification__CommandAction).annotate({ + description: + "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ItemCompletedNotification__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The duration of the command execution in milliseconds.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + exitCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The command's exit code.", + format: "int32", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), + processId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Identifier for the underlying PTY process (when available).", + }), + Schema.Null, + ]), + ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), + source: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ItemCompletedNotification__CommandExecutionSource, + ).annotate({ default: "agent" }), + ), + status: V2ItemCompletedNotification__CommandExecutionStatus, + type: Schema.Literal("commandExecution").annotate({ + title: "CommandExecutionThreadItemType", + }), + }).annotate({ title: "CommandExecutionThreadItem" }), + Schema.Struct({ + changes: Schema.Array(V2ItemCompletedNotification__FileUpdateChange), + id: Schema.String, + status: V2ItemCompletedNotification__PatchApplyStatus, + type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), + }).annotate({ title: "FileChangeThreadItem" }), + Schema.Struct({ + appContext: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__McpToolCallAppContext, Schema.Null]), + ), + arguments: Schema.Json.annotate({ expected: "JSON value" }), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The duration of the MCP tool call in milliseconds.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + error: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__McpToolCallError, Schema.Null]), + ), + id: Schema.String, + mcpAppResourceUri: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", + }), + Schema.Null, + ]), + ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), + pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + result: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__McpToolCallResult, Schema.Null]), + ), + server: Schema.String, + status: V2ItemCompletedNotification__McpToolCallStatus, + tool: Schema.String, + type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), + }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - pattern: Schema.String, - type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), - }).annotate({ title: "GlobPatternFileSystemPath" }), + arguments: Schema.Json.annotate({ expected: "JSON value" }), + contentItems: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ItemCompletedNotification__DynamicToolCallOutputContentItem), + Schema.Null, + ]), + ), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The duration of the dynamic tool call in milliseconds.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + id: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ItemCompletedNotification__DynamicToolCallStatus, + success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + tool: Schema.String, + type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), + }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), - value: CommandExecutionRequestApprovalParams__FileSystemSpecialPath, - }).annotate({ title: "SpecialFileSystemPath" }), - ], - { mode: "oneOf" }, -); - -export type CommandExecutionRequestApprovalResponse__CommandExecutionApprovalDecision = - | "accept" - | "acceptForSession" - | { - readonly acceptWithExecpolicyAmendment: { - readonly execpolicy_amendment: ReadonlyArray; - }; - } - | { - readonly applyNetworkPolicyAmendment: { - readonly network_policy_amendment: CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment; - }; - } - | "decline" - | "cancel"; -export const CommandExecutionRequestApprovalResponse__CommandExecutionApprovalDecision = - Schema.Union( - [ - Schema.Literal("accept").annotate({ description: "User approved the command." }), - Schema.Literal("acceptForSession").annotate({ - description: - "User approved the command and future prompts in the same session-scoped approval cache should run without prompting.", - }), - Schema.Struct({ - acceptWithExecpolicyAmendment: Schema.Struct({ - execpolicy_amendment: Schema.Array(Schema.String), + agentsStates: Schema.Record( + Schema.String, + V2ItemCompletedNotification__CollabAgentState, + ).annotate({ description: "Last known status of the target agents, when available." }), + id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Model requested for the spawned agent, when applicable.", + }), + Schema.Null, + ]), + ), + prompt: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Prompt text sent as part of the collab tool call, when available.", + }), + Schema.Null, + ]), + ), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__ReasoningEffort, Schema.Null]).annotate({ + description: "Reasoning effort requested for the spawned agent, when applicable.", }), - }).annotate({ - title: "AcceptWithExecpolicyAmendmentCommandExecutionApprovalDecision", + ), + receiverThreadIds: Schema.Array(Schema.String).annotate({ description: - "User approved the command, and wants to apply the proposed execpolicy amendment so future matching commands can run without prompting.", - }), - Schema.Struct({ - applyNetworkPolicyAmendment: Schema.Struct({ - network_policy_amendment: CommandExecutionRequestApprovalResponse__NetworkPolicyAmendment, - }), - }).annotate({ - title: "ApplyNetworkPolicyAmendmentCommandExecutionApprovalDecision", - description: "User chose a persistent network policy rule (allow/deny) for this host.", - }), - Schema.Literal("decline").annotate({ - description: "User denied the command. The agent will continue the turn.", + "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", }), - Schema.Literal("cancel").annotate({ - description: "User denied the command. The turn will also be immediately interrupted.", + senderThreadId: Schema.String.annotate({ + description: "Thread ID of the agent issuing the collab request.", }), - ], - { mode: "oneOf" }, - ); - -export type ExecCommandApprovalResponse__ReviewDecision = - | "approved" - | { - readonly approved_execpolicy_amendment: { - readonly proposed_execpolicy_amendment: ReadonlyArray; - }; - } - | "approved_for_session" - | { - readonly network_policy_amendment: { - readonly network_policy_amendment: ExecCommandApprovalResponse__NetworkPolicyAmendment; - }; - } - | "denied" - | "timed_out" - | "abort"; -export const ExecCommandApprovalResponse__ReviewDecision = Schema.Union( - [ - Schema.Literal("approved").annotate({ - description: "User has approved this command and the agent should execute it.", - }), - Schema.Struct({ - approved_execpolicy_amendment: Schema.Struct({ - proposed_execpolicy_amendment: Schema.Array(Schema.String), + status: Schema.suspend( + (): Schema.Codec => + V2ItemCompletedNotification__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ItemCompletedNotification__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), + type: Schema.Literal("collabAgentToolCall").annotate({ + title: "CollabAgentToolCallThreadItemType", }), - }).annotate({ - title: "ApprovedExecpolicyAmendmentReviewDecision", - description: - "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", - }), - Schema.Literal("approved_for_session").annotate({ - description: - "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", - }), + }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ - network_policy_amendment: Schema.Struct({ - network_policy_amendment: ExecCommandApprovalResponse__NetworkPolicyAmendment, + agentPath: Schema.String, + agentThreadId: Schema.String, + id: Schema.String, + kind: V2ItemCompletedNotification__SubAgentActivityKind, + type: Schema.Literal("subAgentActivity").annotate({ + title: "SubAgentActivityThreadItemType", }), - }).annotate({ - title: "NetworkPolicyAmendmentReviewDecision", - description: - "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", - }), - Schema.Literal("denied").annotate({ - description: - "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", - }), - Schema.Literal("timed_out").annotate({ - description: "Automatic approval review timed out before reaching a decision.", - }), - Schema.Literal("abort").annotate({ - description: - "User has denied this command and the agent should not do anything until the user's next command.", - }), - ], - { mode: "oneOf" }, -).annotate({ description: "User's decision in response to an ExecApprovalRequest." }); - -export type McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema = { - readonly default?: ReadonlyArray | null; - readonly description?: string | null; - readonly items: McpServerElicitationRequestParams__McpElicitationTitledEnumItems; - readonly maxItems?: number | null; - readonly minItems?: number | null; - readonly title?: string | null; - readonly type: McpServerElicitationRequestParams__McpElicitationArrayType; -}; -export const McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema = - Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - items: McpServerElicitationRequestParams__McpElicitationTitledEnumItems, - maxItems: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - minItems: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: McpServerElicitationRequestParams__McpElicitationArrayType, - }); - -export type McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema = { - readonly default?: ReadonlyArray | null; - readonly description?: string | null; - readonly items: McpServerElicitationRequestParams__McpElicitationUntitledEnumItems; - readonly maxItems?: number | null; - readonly minItems?: number | null; - readonly title?: string | null; - readonly type: McpServerElicitationRequestParams__McpElicitationArrayType; -}; -export const McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema = - Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - items: McpServerElicitationRequestParams__McpElicitationUntitledEnumItems, - maxItems: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - minItems: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: McpServerElicitationRequestParams__McpElicitationArrayType, - }); - -export type McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema = - | McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema - | McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema; -export const McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema = Schema.Union( - [ - McpServerElicitationRequestParams__McpElicitationUntitledSingleSelectEnumSchema, - McpServerElicitationRequestParams__McpElicitationTitledSingleSelectEnumSchema, - ], -); - -export type PermissionsRequestApprovalParams__FileSystemPath = - | { readonly path: PermissionsRequestApprovalParams__LegacyAppPathString; readonly type: "path" } - | { readonly pattern: string; readonly type: "glob_pattern" } - | { - readonly type: "special"; - readonly value: PermissionsRequestApprovalParams__FileSystemSpecialPath; - }; -export const PermissionsRequestApprovalParams__FileSystemPath = Schema.Union( - [ - Schema.Struct({ - path: PermissionsRequestApprovalParams__LegacyAppPathString, - type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), - }).annotate({ title: "PathFileSystemPath" }), - Schema.Struct({ - pattern: Schema.String, - type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), - }).annotate({ title: "GlobPatternFileSystemPath" }), - Schema.Struct({ - type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), - value: PermissionsRequestApprovalParams__FileSystemSpecialPath, - }).annotate({ title: "SpecialFileSystemPath" }), - ], - { mode: "oneOf" }, -); - -export type PermissionsRequestApprovalResponse__FileSystemPath = - | { - readonly path: PermissionsRequestApprovalResponse__LegacyAppPathString; - readonly type: "path"; - } - | { readonly pattern: string; readonly type: "glob_pattern" } - | { - readonly type: "special"; - readonly value: PermissionsRequestApprovalResponse__FileSystemSpecialPath; - }; -export const PermissionsRequestApprovalResponse__FileSystemPath = Schema.Union( - [ + }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ - path: PermissionsRequestApprovalResponse__LegacyAppPathString, - type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), - }).annotate({ title: "PathFileSystemPath" }), + action: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__WebSearchAction, Schema.Null]), + ), + id: Schema.String, + query: Schema.String, + results: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ + description: + "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", + }), + Schema.Null, + ]), + ), + type: Schema.Literal("webSearch").annotate({ title: "WebSearchThreadItemType" }), + }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ - pattern: Schema.String, - type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), - }).annotate({ title: "GlobPatternFileSystemPath" }), + id: Schema.String, + path: V2ItemCompletedNotification__LegacyAppPathString, + type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), + }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ - type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), - value: PermissionsRequestApprovalResponse__FileSystemSpecialPath, - }).annotate({ title: "SpecialFileSystemPath" }), - ], - { mode: "oneOf" }, -); - -export type ServerNotification__AppInfo = { - readonly appMetadata?: ServerNotification__AppMetadata | null; - readonly branding?: ServerNotification__AppBranding | null; - readonly description?: string | null; - readonly distributionChannel?: string | null; - readonly iconAssets?: { readonly [x: string]: string } | null; - readonly iconDarkAssets?: { readonly [x: string]: string } | null; - readonly id: string; - readonly installUrl?: string | null; - readonly isAccessible?: boolean; - readonly isEnabled?: boolean; - readonly labels?: { readonly [x: string]: string } | null; - readonly logoUrl?: string | null; - readonly logoUrlDark?: string | null; - readonly name: string; - readonly pluginDisplayNames?: ReadonlyArray; -}; -export const ServerNotification__AppInfo = Schema.Struct({ - appMetadata: Schema.optionalKey(Schema.Union([ServerNotification__AppMetadata, Schema.Null])), - branding: Schema.optionalKey(Schema.Union([ServerNotification__AppBranding, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - distributionChannel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconAssets: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - iconDarkAssets: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - id: Schema.String, - installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - isAccessible: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - isEnabled: Schema.optionalKey( - Schema.Boolean.annotate({ - description: - "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", - default: true, + durationMs: Schema.Number.annotate({ format: "uint64" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + id: Schema.String, + type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), + }).annotate({ + title: "SleepThreadItem", + description: "Display item emitted by the interruptible `clock.sleep` tool.", }), - ), - labels: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - logoUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logoUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - name: Schema.String, - pluginDisplayNames: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), -}).annotate({ description: "EXPERIMENTAL - app metadata returned by app-list APIs." }); - -export type ServerNotification__ExternalAgentConfigImportTypeResult = { - readonly failures: ReadonlyArray; - readonly itemType: ServerNotification__ExternalAgentConfigMigrationItemType; - readonly successes: ReadonlyArray; -}; -export const ServerNotification__ExternalAgentConfigImportTypeResult = Schema.Struct({ - failures: Schema.Array(ServerNotification__ExternalAgentConfigImportItemTypeFailure), - itemType: ServerNotification__ExternalAgentConfigMigrationItemType, - successes: Schema.Array(ServerNotification__ExternalAgentConfigImportItemTypeSuccess), -}); - -export type ServerNotification__FuzzyFileSearchSessionUpdatedNotification = { - readonly files: ReadonlyArray; - readonly query: string; - readonly sessionId: string; -}; -export const ServerNotification__FuzzyFileSearchSessionUpdatedNotification = Schema.Struct({ - files: Schema.Array(ServerNotification__FuzzyFileSearchResult), - query: Schema.String, - sessionId: Schema.String, -}); - -export type ServerNotification__HookRunSummary = { - readonly completedAt?: number | null; - readonly displayOrder: number; - readonly durationMs?: number | null; - readonly entries: ReadonlyArray; - readonly eventName: ServerNotification__HookEventName; - readonly executionMode: ServerNotification__HookExecutionMode; - readonly handlerType: ServerNotification__HookHandlerType; - readonly id: string; - readonly scope: ServerNotification__HookScope; - readonly source?: - | "system" - | "user" - | "project" - | "mdm" - | "sessionFlags" - | "plugin" - | "cloudRequirements" - | "cloudManagedConfig" - | "legacyManagedConfigFile" - | "legacyManagedConfigMdm" - | "unknown"; - readonly sourcePath: ServerNotification__AbsolutePathBuf; - readonly startedAt: number; - readonly status: ServerNotification__HookRunStatus; - readonly statusMessage?: string | null; -}; -export const ServerNotification__HookRunSummary = Schema.Struct({ - completedAt: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - displayOrder: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - durationMs: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - entries: Schema.Array(ServerNotification__HookOutputEntry), - eventName: ServerNotification__HookEventName, - executionMode: ServerNotification__HookExecutionMode, - handlerType: ServerNotification__HookHandlerType, - id: Schema.String, - scope: ServerNotification__HookScope, - source: Schema.optionalKey( - Schema.Literals([ - "system", - "user", - "project", - "mdm", - "sessionFlags", - "plugin", - "cloudRequirements", - "cloudManagedConfig", - "legacyManagedConfigFile", - "legacyManagedConfigMdm", - "unknown", - ]).annotate({ default: "unknown" }), - ), - sourcePath: ServerNotification__AbsolutePathBuf, - startedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - status: ServerNotification__HookRunStatus, - statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type ServerNotification__FileSystemPath = - | { readonly path: ServerNotification__LegacyAppPathString; readonly type: "path" } - | { readonly pattern: string; readonly type: "glob_pattern" } - | { readonly type: "special"; readonly value: ServerNotification__FileSystemSpecialPath }; -export const ServerNotification__FileSystemPath = Schema.Union( - [ Schema.Struct({ - path: ServerNotification__LegacyAppPathString, - type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), - }).annotate({ title: "PathFileSystemPath" }), + failure: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__ImageGenerationFailure, Schema.Null]), + ), + id: Schema.String, + result: Schema.String, + revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__AbsolutePathBuf, Schema.Null]), + ), + status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), + }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ - pattern: Schema.String, - type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), - }).annotate({ title: "GlobPatternFileSystemPath" }), + id: Schema.String, + review: Schema.String, + type: Schema.Literal("enteredReviewMode").annotate({ + title: "EnteredReviewModeThreadItemType", + }), + }).annotate({ title: "EnteredReviewModeThreadItem" }), Schema.Struct({ - type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), - value: ServerNotification__FileSystemSpecialPath, - }).annotate({ title: "SpecialFileSystemPath" }), + id: Schema.String, + review: Schema.String, + type: Schema.Literal("exitedReviewMode").annotate({ + title: "ExitedReviewModeThreadItemType", + }), + }).annotate({ title: "ExitedReviewModeThreadItem" }), + Schema.Struct({ + id: Schema.String, + type: Schema.Literal("contextCompaction").annotate({ + title: "ContextCompactionThreadItemType", + }), + }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type ServerNotification__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: ServerNotification__CodexErrorInfo | null; - readonly message: string; -}; -export const ServerNotification__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([ServerNotification__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); - -export type ServerNotification__FileChangePatchUpdatedNotification = { - readonly changes: ReadonlyArray; - readonly itemId: string; - readonly threadId: string; - readonly turnId: string; -}; -export const ServerNotification__FileChangePatchUpdatedNotification = Schema.Struct({ - changes: Schema.Array(ServerNotification__FileUpdateChange), - itemId: Schema.String, - threadId: Schema.String, - turnId: Schema.String, -}); +).annotate({ identifier: "V2ItemCompletedNotification__ThreadItem" }); -export type ServerNotification__CollaborationMode = { - readonly mode: ServerNotification__ModeKind; - readonly settings: ServerNotification__Settings; +export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry = { + readonly access: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode; + readonly path: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath; }; -export const ServerNotification__CollaborationMode = Schema.Struct({ - mode: ServerNotification__ModeKind, - settings: ServerNotification__Settings, -}).annotate({ description: "Collaboration mode for a Codex session." }); +export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry = + Schema.Struct({ + access: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode, + path: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath, + }).annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry", + }); -export type ServerNotification__AccountRateLimitsUpdatedNotification = { - readonly rateLimits: ServerNotification__RateLimitSnapshot; +export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry = { + readonly access: V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode; + readonly path: V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath; }; -export const ServerNotification__AccountRateLimitsUpdatedNotification = Schema.Struct({ - rateLimits: ServerNotification__RateLimitSnapshot, -}).annotate({ - description: - "Sparse rolling rate-limit update.\n\nClients should merge available values into the most recent `account/rateLimits/read` response or refetch that snapshot. Nullable account metadata may be unavailable in a rolling update and does not clear a previously observed value.", -}); +export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry = + Schema.Struct({ + access: V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode, + path: V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath, + }).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry", + }); -export type ServerNotification__ThreadItem = +export type V2ItemStartedNotification__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ItemStartedNotification__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: ServerNotification__MemoryCitation | null; - readonly phase?: ServerNotification__MessagePhase | null; + readonly memoryCitation?: V2ItemStartedNotification__MemoryCitation | null; + readonly phase?: V2ItemStartedNotification__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ItemStartedNotification__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -20442,133 +34447,138 @@ export type ServerNotification__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ItemStartedNotification__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: ServerNotification__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ItemStartedNotification__CommandExecutionSource; + readonly status: V2ItemStartedNotification__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: ServerNotification__PatchApplyStatus; + readonly status: V2ItemStartedNotification__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: ServerNotification__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ItemStartedNotification__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: ServerNotification__McpToolCallError | null; + readonly error?: V2ItemStartedNotification__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ItemStartedNotification__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: ServerNotification__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ItemStartedNotification__McpToolCallResult | null; readonly server: string; - readonly status: ServerNotification__McpToolCallStatus; + readonly status: V2ItemStartedNotification__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: ServerNotification__DynamicToolCallStatus; + readonly status: V2ItemStartedNotification__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: ServerNotification__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ItemStartedNotification__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: ServerNotification__ReasoningEffort | null; + readonly reasoningEffort?: V2ItemStartedNotification__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ItemStartedNotification__CollabAgentToolCallStatus; + readonly tool: V2ItemStartedNotification__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: ServerNotification__SubAgentActivityKind; + readonly kind: V2ItemStartedNotification__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: ServerNotification__WebSearchAction | null; + readonly action?: V2ItemStartedNotification__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: ServerNotification__LegacyAppPathString; + readonly path: V2ItemStartedNotification__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ItemStartedNotification__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: ServerNotification__AbsolutePathBuf | null; + readonly savedPath?: V2ItemStartedNotification__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const ServerNotification__ThreadItem = Schema.Union( +export const V2ItemStartedNotification__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(ServerNotification__UserInput), + content: Schema.Array(V2ItemStartedNotification__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(ServerNotification__HookPromptFragment), + fragments: Schema.Array(V2ItemStartedNotification__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([ServerNotification__MemoryCitation, Schema.Null]), + Schema.Union([V2ItemStartedNotification__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__MessagePhase, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([ServerNotification__MessagePhase, Schema.Null])), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), + Schema.Array(V2ItemStartedNotification__AsyncUserInputQuestion), Schema.Null, ]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ItemStartedNotification__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -20594,17 +34604,20 @@ export const ServerNotification__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(ServerNotification__CommandAction).annotate({ + commandActions: Schema.Array(V2ItemStartedNotification__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ItemStartedNotification__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -20613,11 +34626,20 @@ export const ServerNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -20626,63 +34648,80 @@ export const ServerNotification__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ItemStartedNotification__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: ServerNotification__CommandExecutionStatus, + status: V2ItemStartedNotification__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(ServerNotification__FileUpdateChange), + changes: Schema.Array(V2ItemStartedNotification__FileUpdateChange), id: Schema.String, - status: ServerNotification__PatchApplyStatus, + status: V2ItemStartedNotification__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([ServerNotification__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ItemStartedNotification__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), - error: Schema.optionalKey(Schema.Union([ServerNotification__McpToolCallError, Schema.Null])), + error: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__McpToolCallError, Schema.Null]), + ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([ServerNotification__McpToolCallResult, Schema.Null]), + Schema.Union([V2ItemStartedNotification__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: ServerNotification__McpToolCallStatus, + status: V2ItemStartedNotification__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(ServerNotification__DynamicToolCallOutputContentItem), + Schema.Array(V2ItemStartedNotification__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -20691,21 +34730,22 @@ export const ServerNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: ServerNotification__DynamicToolCallStatus, + status: V2ItemStartedNotification__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, ServerNotification__CollabAgentState).annotate({ - description: "Last known status of the target agents, when available.", - }), + agentsStates: Schema.Record( + Schema.String, + V2ItemStartedNotification__CollabAgentState, + ).annotate({ description: "Last known status of the target agents, when available." }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -20724,7 +34764,7 @@ export const ServerNotification__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([ServerNotification__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ItemStartedNotification__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -20735,20 +34775,14 @@ export const ServerNotification__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ItemStartedNotification__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ItemStartedNotification__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -20757,18 +34791,20 @@ export const ServerNotification__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: ServerNotification__SubAgentActivityKind, + kind: V2ItemStartedNotification__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ - action: Schema.optionalKey(Schema.Union([ServerNotification__WebSearchAction, Schema.Null])), + action: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__WebSearchAction, Schema.Null]), + ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -20779,13 +34815,17 @@ export const ServerNotification__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: ServerNotification__LegacyAppPathString, + path: V2ItemStartedNotification__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -20793,13 +34833,17 @@ export const ServerNotification__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([ServerNotification__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ItemStartedNotification__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -20824,725 +34868,794 @@ export const ServerNotification__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ItemStartedNotification__ThreadItem" }); -export type ServerNotification__ConfigWarningNotification = { - readonly details?: string | null; - readonly path?: string | null; - readonly range?: ServerNotification__TextRange | null; - readonly summary: string; +export type V2PluginInstalledResponse__PluginSummary = { + readonly authPolicy: V2PluginInstalledResponse__PluginAuthPolicy; + readonly availability?: V2PluginInstalledResponse__PluginAvailability; + readonly disabledReason?: V2PluginInstalledResponse__PluginDisabledReason | null; + readonly eligiblePlanTypes?: ReadonlyArray | null; + readonly enabled: boolean; + readonly id: string; + readonly installPolicy: V2PluginInstalledResponse__PluginInstallPolicy; + readonly installPolicySource?: V2PluginInstalledResponse__PluginInstallPolicySource | null; + readonly installed: boolean; + readonly installedAt?: number | null; + readonly interface?: V2PluginInstalledResponse__PluginInterface | null; + readonly keywords?: ReadonlyArray; + readonly localVersion?: string | null; + readonly mustShowInstallationInterstitial?: boolean | null; + readonly name: string; + readonly remotePluginId?: string | null; + readonly shareContext?: V2PluginInstalledResponse__PluginShareContext | null; + readonly source: V2PluginInstalledResponse__PluginSource; + readonly version?: string | null; }; -export const ServerNotification__ConfigWarningNotification = Schema.Struct({ - details: Schema.optionalKey( +export const V2PluginInstalledResponse__PluginSummary = Schema.Struct({ + authPolicy: V2PluginInstalledResponse__PluginAuthPolicy, + availability: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2PluginInstalledResponse__PluginAvailability, + ).annotate({ + description: "Availability state for installing and using the plugin.", + default: "AVAILABLE", + }), + ), + disabledReason: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__PluginDisabledReason, Schema.Null]).annotate({ + description: "Why the remote plugin is unavailable, when provided by plugin-service.", + }), + ), + eligiblePlanTypes: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Optional extra guidance or error details." }), + Schema.Array(Schema.String).annotate({ + description: "Raw plugin-service plan identifiers eligible to install the plugin.", + }), Schema.Null, ]), ), - path: Schema.optionalKey( + enabled: Schema.Boolean, + id: Schema.String, + installPolicy: V2PluginInstalledResponse__PluginInstallPolicy, + installPolicySource: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__PluginInstallPolicySource, Schema.Null]), + ), + installed: Schema.Boolean, + installedAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Unix timestamp in seconds when the remote plugin was installed, when available.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + interface: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__PluginInterface, Schema.Null]), + ), + keywords: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + localVersion: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional path to the config file that triggered the warning.", + description: "Version of the locally materialized plugin package when available.", }), Schema.Null, ]), ), - range: Schema.optionalKey( - Schema.Union([ServerNotification__TextRange, Schema.Null]).annotate({ - description: "Optional range for the error location inside the config file.", + mustShowInstallationInterstitial: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + name: Schema.String, + remotePluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Backend remote plugin identifier when available." }), + Schema.Null, + ]), + ), + shareContext: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__PluginShareContext, Schema.Null]).annotate({ + description: "Remote sharing context associated with this plugin when available.", }), ), - summary: Schema.String.annotate({ description: "Concise summary of the warning." }), -}); - -export type ServerNotification__ThreadStatusChangedNotification = { - readonly status: ServerNotification__ThreadStatus; - readonly threadId: string; -}; -export const ServerNotification__ThreadStatusChangedNotification = Schema.Struct({ - status: ServerNotification__ThreadStatus, - threadId: Schema.String, -}); - -export type ServerNotification__ThreadGoalUpdatedNotification = { - readonly goal: ServerNotification__ThreadGoal; - readonly threadId: string; - readonly turnId?: string | null; -}; -export const ServerNotification__ThreadGoalUpdatedNotification = Schema.Struct({ - goal: ServerNotification__ThreadGoal, - threadId: Schema.String, - turnId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type ServerNotification__ThreadTokenUsageUpdatedNotification = { - readonly threadId: string; - readonly tokenUsage: ServerNotification__ThreadTokenUsage; - readonly turnId: string; -}; -export const ServerNotification__ThreadTokenUsageUpdatedNotification = Schema.Struct({ - threadId: Schema.String, - tokenUsage: ServerNotification__ThreadTokenUsage, - turnId: Schema.String, -}); - -export type ServerNotification__TurnPlanUpdatedNotification = { - readonly explanation?: string | null; - readonly plan: ReadonlyArray; - readonly threadId: string; - readonly turnId: string; -}; -export const ServerNotification__TurnPlanUpdatedNotification = Schema.Struct({ - explanation: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - plan: Schema.Array(ServerNotification__TurnPlanStep), - threadId: Schema.String, - turnId: Schema.String, -}); - -export type ServerRequest__FileSystemPath = - | { readonly path: ServerRequest__LegacyAppPathString; readonly type: "path" } - | { readonly pattern: string; readonly type: "glob_pattern" } - | { readonly type: "special"; readonly value: ServerRequest__FileSystemSpecialPath }; -export const ServerRequest__FileSystemPath = Schema.Union( - [ - Schema.Struct({ - path: ServerRequest__LegacyAppPathString, - type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), - }).annotate({ title: "PathFileSystemPath" }), - Schema.Struct({ - pattern: Schema.String, - type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), - }).annotate({ title: "GlobPatternFileSystemPath" }), - Schema.Struct({ - type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), - value: ServerRequest__FileSystemSpecialPath, - }).annotate({ title: "SpecialFileSystemPath" }), - ], - { mode: "oneOf" }, -); + source: V2PluginInstalledResponse__PluginSource, + version: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Version advertised by the remote marketplace backend when available.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2PluginInstalledResponse__PluginSummary" }); -export type ServerRequest__McpElicitationTitledMultiSelectEnumSchema = { - readonly default?: ReadonlyArray | null; - readonly description?: string | null; - readonly items: ServerRequest__McpElicitationTitledEnumItems; - readonly maxItems?: number | null; - readonly minItems?: number | null; - readonly title?: string | null; - readonly type: ServerRequest__McpElicitationArrayType; +export type V2PluginListResponse__PluginSummary = { + readonly authPolicy: V2PluginListResponse__PluginAuthPolicy; + readonly availability?: V2PluginListResponse__PluginAvailability; + readonly disabledReason?: V2PluginListResponse__PluginDisabledReason | null; + readonly eligiblePlanTypes?: ReadonlyArray | null; + readonly enabled: boolean; + readonly id: string; + readonly installPolicy: V2PluginListResponse__PluginInstallPolicy; + readonly installPolicySource?: V2PluginListResponse__PluginInstallPolicySource | null; + readonly installed: boolean; + readonly installedAt?: number | null; + readonly interface?: V2PluginListResponse__PluginInterface | null; + readonly keywords?: ReadonlyArray; + readonly localVersion?: string | null; + readonly mustShowInstallationInterstitial?: boolean | null; + readonly name: string; + readonly remotePluginId?: string | null; + readonly shareContext?: V2PluginListResponse__PluginShareContext | null; + readonly source: V2PluginListResponse__PluginSource; + readonly version?: string | null; }; -export const ServerRequest__McpElicitationTitledMultiSelectEnumSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - items: ServerRequest__McpElicitationTitledEnumItems, - maxItems: Schema.optionalKey( +export const V2PluginListResponse__PluginSummary = Schema.Struct({ + authPolicy: V2PluginListResponse__PluginAuthPolicy, + availability: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2PluginListResponse__PluginAvailability, + ).annotate({ + description: "Availability state for installing and using the plugin.", + default: "AVAILABLE", + }), + ), + disabledReason: Schema.optionalKey( + Schema.Union([V2PluginListResponse__PluginDisabledReason, Schema.Null]).annotate({ + description: "Why the remote plugin is unavailable, when provided by plugin-service.", + }), + ), + eligiblePlanTypes: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Array(Schema.String).annotate({ + description: "Raw plugin-service plan identifiers eligible to install the plugin.", + }), Schema.Null, ]), ), - minItems: Schema.optionalKey( + enabled: Schema.Boolean, + id: Schema.String, + installPolicy: V2PluginListResponse__PluginInstallPolicy, + installPolicySource: Schema.optionalKey( + Schema.Union([V2PluginListResponse__PluginInstallPolicySource, Schema.Null]), + ), + installed: Schema.Boolean, + installedAt: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Number.annotate({ + description: + "Unix timestamp in seconds when the remote plugin was installed, when available.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: ServerRequest__McpElicitationArrayType, -}); - -export type ServerRequest__McpElicitationUntitledMultiSelectEnumSchema = { - readonly default?: ReadonlyArray | null; - readonly description?: string | null; - readonly items: ServerRequest__McpElicitationUntitledEnumItems; - readonly maxItems?: number | null; - readonly minItems?: number | null; - readonly title?: string | null; - readonly type: ServerRequest__McpElicitationArrayType; -}; -export const ServerRequest__McpElicitationUntitledMultiSelectEnumSchema = Schema.Struct({ - default: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - items: ServerRequest__McpElicitationUntitledEnumItems, - maxItems: Schema.optionalKey( + interface: Schema.optionalKey(Schema.Union([V2PluginListResponse__PluginInterface, Schema.Null])), + keywords: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + localVersion: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.String.annotate({ + description: "Version of the locally materialized plugin package when available.", + }), Schema.Null, ]), ), - minItems: Schema.optionalKey( + mustShowInstallationInterstitial: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + name: Schema.String, + remotePluginId: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.String.annotate({ description: "Backend remote plugin identifier when available." }), Schema.Null, ]), ), - title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: ServerRequest__McpElicitationArrayType, -}); - -export type ServerRequest__McpElicitationSingleSelectEnumSchema = - | ServerRequest__McpElicitationUntitledSingleSelectEnumSchema - | ServerRequest__McpElicitationTitledSingleSelectEnumSchema; -export const ServerRequest__McpElicitationSingleSelectEnumSchema = Schema.Union([ - ServerRequest__McpElicitationUntitledSingleSelectEnumSchema, - ServerRequest__McpElicitationTitledSingleSelectEnumSchema, -]); + shareContext: Schema.optionalKey( + Schema.Union([V2PluginListResponse__PluginShareContext, Schema.Null]).annotate({ + description: "Remote sharing context associated with this plugin when available.", + }), + ), + source: V2PluginListResponse__PluginSource, + version: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Version advertised by the remote marketplace backend when available.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2PluginListResponse__PluginSummary" }); -export type ServerRequest__CommandExecutionRequestApprovalParams = { - readonly approvalId?: string | null; - readonly command?: string | null; - readonly commandActions?: ReadonlyArray | null; - readonly cwd?: ServerRequest__LegacyAppPathString | null; - readonly environmentId?: string | null; - readonly itemId: string; - readonly networkApprovalContext?: ServerRequest__NetworkApprovalContext | null; - readonly proposedExecpolicyAmendment?: ReadonlyArray | null; - readonly proposedNetworkPolicyAmendments?: ReadonlyArray | null; - readonly reason?: string | null; - readonly startedAtMs: number; - readonly threadId: string; - readonly turnId: string; +export type V2PluginReadResponse__PluginSummary = { + readonly authPolicy: V2PluginReadResponse__PluginAuthPolicy; + readonly availability?: V2PluginReadResponse__PluginAvailability; + readonly disabledReason?: V2PluginReadResponse__PluginDisabledReason | null; + readonly eligiblePlanTypes?: ReadonlyArray | null; + readonly enabled: boolean; + readonly id: string; + readonly installPolicy: V2PluginReadResponse__PluginInstallPolicy; + readonly installPolicySource?: V2PluginReadResponse__PluginInstallPolicySource | null; + readonly installed: boolean; + readonly installedAt?: number | null; + readonly interface?: V2PluginReadResponse__PluginInterface | null; + readonly keywords?: ReadonlyArray; + readonly localVersion?: string | null; + readonly mustShowInstallationInterstitial?: boolean | null; + readonly name: string; + readonly remotePluginId?: string | null; + readonly shareContext?: V2PluginReadResponse__PluginShareContext | null; + readonly source: V2PluginReadResponse__PluginSource; + readonly version?: string | null; }; -export const ServerRequest__CommandExecutionRequestApprovalParams = Schema.Struct({ - approvalId: Schema.optionalKey( +export const V2PluginReadResponse__PluginSummary = Schema.Struct({ + authPolicy: V2PluginReadResponse__PluginAuthPolicy, + availability: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2PluginReadResponse__PluginAvailability, + ).annotate({ + description: "Availability state for installing and using the plugin.", + default: "AVAILABLE", + }), + ), + disabledReason: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__PluginDisabledReason, Schema.Null]).annotate({ + description: "Why the remote plugin is unavailable, when provided by plugin-service.", + }), + ), + eligiblePlanTypes: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ + Schema.Array(Schema.String).annotate({ + description: "Raw plugin-service plan identifiers eligible to install the plugin.", + }), + Schema.Null, + ]), + ), + enabled: Schema.Boolean, + id: Schema.String, + installPolicy: V2PluginReadResponse__PluginInstallPolicy, + installPolicySource: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__PluginInstallPolicySource, Schema.Null]), + ), + installed: Schema.Boolean, + installedAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ description: - "Unique identifier for this specific approval callback.\n\nFor regular shell/unified_exec approvals, this is null.\n\nFor zsh-exec-bridge subcommand approvals, multiple callbacks can belong to one parent `itemId`, so `approvalId` is a distinct opaque callback id (a UUID) used to disambiguate routing.", + "Unix timestamp in seconds when the remote plugin was installed, when available.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + interface: Schema.optionalKey(Schema.Union([V2PluginReadResponse__PluginInterface, Schema.Null])), + keywords: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + localVersion: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Version of the locally materialized plugin package when available.", }), Schema.Null, ]), ), - command: Schema.optionalKey( + mustShowInstallationInterstitial: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + name: Schema.String, + remotePluginId: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "The command to be executed." }), + Schema.String.annotate({ description: "Backend remote plugin identifier when available." }), Schema.Null, ]), ), - commandActions: Schema.optionalKey( + shareContext: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__PluginShareContext, Schema.Null]).annotate({ + description: "Remote sharing context associated with this plugin when available.", + }), + ), + source: V2PluginReadResponse__PluginSource, + version: Schema.optionalKey( Schema.Union([ - Schema.Array(ServerRequest__CommandAction).annotate({ - description: "Best-effort parsed command actions for friendly display.", + Schema.String.annotate({ + description: "Version advertised by the remote marketplace backend when available.", }), Schema.Null, ]), ), - cwd: Schema.optionalKey( - Schema.Union([ServerRequest__LegacyAppPathString, Schema.Null]).annotate({ - description: "The command's working directory.", +}).annotate({ identifier: "V2PluginReadResponse__PluginSummary" }); + +export type V2PluginShareListResponse__PluginSummary = { + readonly authPolicy: V2PluginShareListResponse__PluginAuthPolicy; + readonly availability?: V2PluginShareListResponse__PluginAvailability; + readonly disabledReason?: V2PluginShareListResponse__PluginDisabledReason | null; + readonly eligiblePlanTypes?: ReadonlyArray | null; + readonly enabled: boolean; + readonly id: string; + readonly installPolicy: V2PluginShareListResponse__PluginInstallPolicy; + readonly installPolicySource?: V2PluginShareListResponse__PluginInstallPolicySource | null; + readonly installed: boolean; + readonly installedAt?: number | null; + readonly interface?: V2PluginShareListResponse__PluginInterface | null; + readonly keywords?: ReadonlyArray; + readonly localVersion?: string | null; + readonly mustShowInstallationInterstitial?: boolean | null; + readonly name: string; + readonly remotePluginId?: string | null; + readonly shareContext?: V2PluginShareListResponse__PluginShareContext | null; + readonly source: V2PluginShareListResponse__PluginSource; + readonly version?: string | null; +}; +export const V2PluginShareListResponse__PluginSummary = Schema.Struct({ + authPolicy: V2PluginShareListResponse__PluginAuthPolicy, + availability: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2PluginShareListResponse__PluginAvailability, + ).annotate({ + description: "Availability state for installing and using the plugin.", + default: "AVAILABLE", }), ), - environmentId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Environment in which the command will run." }), - Schema.Null, - ]), - ), - itemId: Schema.String, - networkApprovalContext: Schema.optionalKey( - Schema.Union([ServerRequest__NetworkApprovalContext, Schema.Null]).annotate({ - description: "Optional context for a managed-network approval prompt.", + disabledReason: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__PluginDisabledReason, Schema.Null]).annotate({ + description: "Why the remote plugin is unavailable, when provided by plugin-service.", }), ), - proposedExecpolicyAmendment: Schema.optionalKey( + eligiblePlanTypes: Schema.optionalKey( Schema.Union([ Schema.Array(Schema.String).annotate({ - description: - "Optional proposed execpolicy amendment to allow similar commands without prompting.", + description: "Raw plugin-service plan identifiers eligible to install the plugin.", }), Schema.Null, ]), ), - proposedNetworkPolicyAmendments: Schema.optionalKey( + enabled: Schema.Boolean, + id: Schema.String, + installPolicy: V2PluginShareListResponse__PluginInstallPolicy, + installPolicySource: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__PluginInstallPolicySource, Schema.Null]), + ), + installed: Schema.Boolean, + installedAt: Schema.optionalKey( Schema.Union([ - Schema.Array(ServerRequest__NetworkPolicyAmendment).annotate({ + Schema.Number.annotate({ description: - "Optional proposed network policy amendments (allow/deny host) for future requests.", - }), + "Unix timestamp in seconds when the remote plugin was installed, when available.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), - reason: Schema.optionalKey( + interface: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__PluginInterface, Schema.Null]), + ), + keywords: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + localVersion: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional explanatory reason (e.g. request for network access).", + description: "Version of the locally materialized plugin package when available.", }), Schema.Null, ]), ), - startedAtMs: Schema.Number.annotate({ - description: "Unix timestamp (in milliseconds) when this approval request started.", - format: "int64", - }).check(Schema.isInt()), - threadId: Schema.String, - turnId: Schema.String, -}); - -export type ServerRequest__ToolRequestUserInputParams = { - readonly autoResolutionMs?: number | null; - readonly itemId: string; - readonly questions: ReadonlyArray; - readonly threadId: string; - readonly turnId: string; -}; -export const ServerRequest__ToolRequestUserInputParams = Schema.Struct({ - autoResolutionMs: Schema.optionalKey( + mustShowInstallationInterstitial: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + name: Schema.String, + remotePluginId: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.String.annotate({ description: "Backend remote plugin identifier when available." }), Schema.Null, ]), ), - itemId: Schema.String, - questions: Schema.Array(ServerRequest__ToolRequestUserInputQuestion), - threadId: Schema.String, - turnId: Schema.String, -}).annotate({ description: "EXPERIMENTAL. Params sent with a request_user_input event." }); - -export type V2AppListUpdatedNotification__AppInfo = { - readonly appMetadata?: V2AppListUpdatedNotification__AppMetadata | null; - readonly branding?: V2AppListUpdatedNotification__AppBranding | null; - readonly description?: string | null; - readonly distributionChannel?: string | null; - readonly iconAssets?: { readonly [x: string]: string } | null; - readonly iconDarkAssets?: { readonly [x: string]: string } | null; - readonly id: string; - readonly installUrl?: string | null; - readonly isAccessible?: boolean; - readonly isEnabled?: boolean; - readonly labels?: { readonly [x: string]: string } | null; - readonly logoUrl?: string | null; - readonly logoUrlDark?: string | null; - readonly name: string; - readonly pluginDisplayNames?: ReadonlyArray; -}; -export const V2AppListUpdatedNotification__AppInfo = Schema.Struct({ - appMetadata: Schema.optionalKey( - Schema.Union([V2AppListUpdatedNotification__AppMetadata, Schema.Null]), - ), - branding: Schema.optionalKey( - Schema.Union([V2AppListUpdatedNotification__AppBranding, Schema.Null]), - ), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - distributionChannel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconAssets: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - iconDarkAssets: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - id: Schema.String, - installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - isAccessible: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - isEnabled: Schema.optionalKey( - Schema.Boolean.annotate({ - description: - "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", - default: true, - }), - ), - labels: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - logoUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logoUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - name: Schema.String, - pluginDisplayNames: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), -}).annotate({ description: "EXPERIMENTAL - app metadata returned by app-list APIs." }); - -export type V2AppsListResponse__AppInfo = { - readonly appMetadata?: V2AppsListResponse__AppMetadata | null; - readonly branding?: V2AppsListResponse__AppBranding | null; - readonly description?: string | null; - readonly distributionChannel?: string | null; - readonly iconAssets?: { readonly [x: string]: string } | null; - readonly iconDarkAssets?: { readonly [x: string]: string } | null; - readonly id: string; - readonly installUrl?: string | null; - readonly isAccessible?: boolean; - readonly isEnabled?: boolean; - readonly labels?: { readonly [x: string]: string } | null; - readonly logoUrl?: string | null; - readonly logoUrlDark?: string | null; - readonly name: string; - readonly pluginDisplayNames?: ReadonlyArray; -}; -export const V2AppsListResponse__AppInfo = Schema.Struct({ - appMetadata: Schema.optionalKey(Schema.Union([V2AppsListResponse__AppMetadata, Schema.Null])), - branding: Schema.optionalKey(Schema.Union([V2AppsListResponse__AppBranding, Schema.Null])), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - distributionChannel: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconAssets: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - iconDarkAssets: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - id: Schema.String, - installUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - isAccessible: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - isEnabled: Schema.optionalKey( - Schema.Boolean.annotate({ - description: - "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", - default: true, + shareContext: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__PluginShareContext, Schema.Null]).annotate({ + description: "Remote sharing context associated with this plugin when available.", }), ), - labels: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), - ), - logoUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - logoUrlDark: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - name: Schema.String, - pluginDisplayNames: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), -}).annotate({ description: "EXPERIMENTAL - app metadata returned by app-list APIs." }); - -export type V2ConfigReadResponse__ConfigLayer = { - readonly config: unknown; - readonly disabledReason?: string | null; - readonly name: V2ConfigReadResponse__ConfigLayerSource; - readonly version: string; -}; -export const V2ConfigReadResponse__ConfigLayer = Schema.Struct({ - config: Schema.Unknown, - disabledReason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - name: V2ConfigReadResponse__ConfigLayerSource, - version: Schema.String, -}); - -export type V2ConfigReadResponse__ConfigLayerMetadata = { - readonly name: V2ConfigReadResponse__ConfigLayerSource; - readonly version: string; -}; -export const V2ConfigReadResponse__ConfigLayerMetadata = Schema.Struct({ - name: V2ConfigReadResponse__ConfigLayerSource, - version: Schema.String, -}); - -export type V2ConfigReadResponse__ToolsV2 = { - readonly web_search?: V2ConfigReadResponse__WebSearchToolConfig | null; -}; -export const V2ConfigReadResponse__ToolsV2 = Schema.Struct({ - web_search: Schema.optionalKey( - Schema.Union([V2ConfigReadResponse__WebSearchToolConfig, Schema.Null]), - ), -}); - -export type V2ConfigRequirementsReadResponse__ModelsRequirements = { - readonly newThread?: V2ConfigRequirementsReadResponse__NewThreadModelDefaults | null; -}; -export const V2ConfigRequirementsReadResponse__ModelsRequirements = Schema.Struct({ - newThread: Schema.optionalKey( - Schema.Union([V2ConfigRequirementsReadResponse__NewThreadModelDefaults, Schema.Null]), - ), -}); - -export type V2ConfigWriteResponse__ConfigLayerMetadata = { - readonly name: V2ConfigWriteResponse__ConfigLayerSource; - readonly version: string; -}; -export const V2ConfigWriteResponse__ConfigLayerMetadata = Schema.Struct({ - name: V2ConfigWriteResponse__ConfigLayerSource, - version: Schema.String, -}); - -export type V2ErrorNotification__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ErrorNotification__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ErrorNotification__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ErrorNotification__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); - -export type V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem = { - readonly cwd?: string | null; - readonly description: string; - readonly details?: V2ExternalAgentConfigDetectResponse__MigrationDetails | null; - readonly itemType: V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType; -}; -export const V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem = Schema.Struct({ - cwd: Schema.optionalKey( + source: V2PluginShareListResponse__PluginSource, + version: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: - "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + description: "Version advertised by the remote marketplace backend when available.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "V2PluginShareListResponse__PluginSummary" }); + +export type V2RawResponseItemCompletedNotification__ResponseItem = + | { + readonly content: ReadonlyArray; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly phase?: V2RawResponseItemCompletedNotification__MessagePhase | null; + readonly role: string; + readonly type: "message"; + } + | { + readonly author: string; + readonly content: ReadonlyArray; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly recipient: string; + readonly type: "agent_message"; + } + | { + readonly content?: ReadonlyArray | null; + readonly encrypted_content?: string | null; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly summary: ReadonlyArray; + readonly type: "reasoning"; + } + | { + readonly action: V2RawResponseItemCompletedNotification__LocalShellAction; + readonly call_id?: string | null; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly status: V2RawResponseItemCompletedNotification__LocalShellStatus; + readonly type: "local_shell_call"; + } + | { + readonly arguments: string; + readonly call_id: string; + readonly encrypted_function_args?: ReadonlyArray | null; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly name: string; + readonly namespace?: string | null; + readonly type: "function_call"; + } + | { + readonly arguments: Schema.Json; + readonly call_id?: string | null; + readonly execution: string; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly status?: string | null; + readonly type: "tool_search_call"; + } + | { + readonly call_id?: string | null; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly name?: string | null; + readonly namespace?: string | null; + readonly output: V2RawResponseItemCompletedNotification__FunctionCallOutputBody; + readonly type: "function_call_output"; + } + | { + readonly call_id: string; + readonly id?: string | null; + readonly input: string; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly name: string; + readonly namespace?: string | null; + readonly status?: string | null; + readonly type: "custom_tool_call"; + } + | { + readonly call_id: string; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly name?: string | null; + readonly output: V2RawResponseItemCompletedNotification__FunctionCallOutputBody; + readonly type: "custom_tool_call_output"; + } + | { + readonly call_id?: string | null; + readonly execution: string; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly status: string; + readonly tools: ReadonlyArray; + readonly type: "tool_search_output"; + } + | { + readonly action?: V2RawResponseItemCompletedNotification__ResponsesApiWebSearchAction | null; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly status?: string | null; + readonly type: "web_search_call"; + } + | { + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly result: string; + readonly revised_prompt?: string | null; + readonly status: string; + readonly type: "image_generation_call"; + } + | { + readonly encrypted_content: string; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly type: "compaction"; + } + | { + readonly reasoning: V2RawResponseItemCompletedNotification__ConfigurationReasoning; + readonly type: "configuration_update"; + } + | { readonly type: "compaction_trigger" } + | { + readonly encrypted_content?: string | null; + readonly id?: string | null; + readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; + readonly type: "context_compaction"; + } + | { readonly type: "other" }; +export const V2RawResponseItemCompletedNotification__ResponseItem = Schema.Union( + [ + Schema.Struct({ + content: Schema.Array(V2RawResponseItemCompletedNotification__ContentItem), + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + phase: Schema.optionalKey( + Schema.Union([V2RawResponseItemCompletedNotification__MessagePhase, Schema.Null]), + ), + role: Schema.String, + type: Schema.Literal("message").annotate({ title: "MessageResponseItemType" }), + }).annotate({ title: "MessageResponseItem" }), + Schema.Struct({ + author: Schema.String, + content: Schema.Array(V2RawResponseItemCompletedNotification__AgentMessageInputContent), + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + recipient: Schema.String, + type: Schema.Literal("agent_message").annotate({ title: "AgentMessageResponseItemType" }), + }).annotate({ title: "AgentMessageResponseItem" }), + Schema.Struct({ + content: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2RawResponseItemCompletedNotification__ReasoningItemContent), + Schema.Null, + ]), + ), + encrypted_content: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + summary: Schema.Array(V2RawResponseItemCompletedNotification__ReasoningItemReasoningSummary), + type: Schema.Literal("reasoning").annotate({ title: "ReasoningResponseItemType" }), + }).annotate({ title: "ReasoningResponseItem" }), + Schema.Struct({ + action: V2RawResponseItemCompletedNotification__LocalShellAction, + call_id: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Set when using the Responses API." }), + Schema.Null, + ]), + ), + id: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Legacy id field retained for compatibility with older payloads.", + }), + Schema.Null, + ]), + ), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + status: V2RawResponseItemCompletedNotification__LocalShellStatus, + type: Schema.Literal("local_shell_call").annotate({ + title: "LocalShellCallResponseItemType", + }), + }).annotate({ title: "LocalShellCallResponseItem" }), + Schema.Struct({ + arguments: Schema.String, + call_id: Schema.String, + encrypted_function_args: Schema.optionalKey( + Schema.Union([Schema.Array(Schema.String), Schema.Null]), + ), + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("function_call").annotate({ title: "FunctionCallResponseItemType" }), + }).annotate({ title: "FunctionCallResponseItem" }), + Schema.Struct({ + arguments: Schema.Json.annotate({ expected: "JSON value" }), + call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + execution: Schema.String, + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + status: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("tool_search_call").annotate({ + title: "ToolSearchCallResponseItemType", + }), + }).annotate({ title: "ToolSearchCallResponseItem" }), + Schema.Struct({ + call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2RawResponseItemCompletedNotification__FunctionCallOutputBody, + type: Schema.Literal("function_call_output").annotate({ + title: "FunctionCallOutputResponseItemType", + }), + }).annotate({ title: "FunctionCallOutputResponseItem" }), + Schema.Struct({ + call_id: Schema.String, + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + input: Schema.String, + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("custom_tool_call").annotate({ + title: "CustomToolCallResponseItemType", + }), + }).annotate({ title: "CustomToolCallResponseItem" }), + Schema.Struct({ + call_id: Schema.String, + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2RawResponseItemCompletedNotification__FunctionCallOutputBody, + type: Schema.Literal("custom_tool_call_output").annotate({ + title: "CustomToolCallOutputResponseItemType", }), - Schema.Null, - ]), - ), - description: Schema.String, - details: Schema.optionalKey( - Schema.Union([V2ExternalAgentConfigDetectResponse__MigrationDetails, Schema.Null]), - ), - itemType: V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType, -}); - -export type V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportTypeResult = - { - readonly failures: ReadonlyArray; - readonly itemType: V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType; - readonly successes: ReadonlyArray; - }; -export const V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportTypeResult = - Schema.Struct({ - failures: Schema.Array( - V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeFailure, - ), - itemType: - V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigMigrationItemType, - successes: Schema.Array( - V2ExternalAgentConfigImportCompletedNotification__ExternalAgentConfigImportItemTypeSuccess, - ), - }); - -export type V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportHistory = { - readonly completedAtMs: number; - readonly failures: ReadonlyArray; - readonly importId: string; - readonly successes: ReadonlyArray; -}; -export const V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportHistory = - Schema.Struct({ - completedAtMs: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - failures: Schema.Array( - V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeFailure, - ), - importId: Schema.String, - successes: Schema.Array( - V2ExternalAgentConfigImportHistoriesReadResponse__ExternalAgentConfigImportItemTypeSuccess, - ), - }); - -export type V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem = { - readonly cwd?: string | null; - readonly description: string; - readonly details?: V2ExternalAgentConfigImportParams__MigrationDetails | null; - readonly itemType: V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType; -}; -export const V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem = Schema.Struct({ - cwd: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + }).annotate({ title: "CustomToolCallOutputResponseItem" }), + Schema.Struct({ + call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + execution: Schema.String, + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + status: Schema.String, + tools: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), + type: Schema.Literal("tool_search_output").annotate({ + title: "ToolSearchOutputResponseItemType", }), - Schema.Null, - ]), - ), - description: Schema.String, - details: Schema.optionalKey( - Schema.Union([V2ExternalAgentConfigImportParams__MigrationDetails, Schema.Null]), - ), - itemType: V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType, -}); - -export type V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportTypeResult = { - readonly failures: ReadonlyArray; - readonly itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType; - readonly successes: ReadonlyArray; -}; -export const V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportTypeResult = - Schema.Struct({ - failures: Schema.Array( - V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeFailure, - ), - itemType: V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigMigrationItemType, - successes: Schema.Array( - V2ExternalAgentConfigImportProgressNotification__ExternalAgentConfigImportItemTypeSuccess, - ), - }); - -export type V2GetAccountRateLimitsResponse__RateLimitResetCreditsSummary = { - readonly availableCount: number; - readonly credits?: ReadonlyArray | null; -}; -export const V2GetAccountRateLimitsResponse__RateLimitResetCreditsSummary = Schema.Struct({ - availableCount: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - credits: Schema.optionalKey( - Schema.Union([ - Schema.Array(V2GetAccountRateLimitsResponse__RateLimitResetCredit).annotate({ - description: - "Detail rows for available reset credits, when the backend provides them.\n\n`null` means only `availableCount` is known, while an empty array means details were fetched and no available credits were returned. The backend may cap this list, so its length can be less than `availableCount`.", + }).annotate({ title: "ToolSearchOutputResponseItem" }), + Schema.Struct({ + action: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__ResponsesApiWebSearchAction, + Schema.Null, + ]), + ), + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + status: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("web_search_call").annotate({ title: "WebSearchCallResponseItemType" }), + }).annotate({ title: "WebSearchCallResponseItem" }), + Schema.Struct({ + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + result: Schema.String, + revised_prompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: Schema.String, + type: Schema.Literal("image_generation_call").annotate({ + title: "ImageGenerationCallResponseItemType", }), - Schema.Null, - ]), - ), -}); - -export type V2HookCompletedNotification__HookRunSummary = { - readonly completedAt?: number | null; - readonly displayOrder: number; - readonly durationMs?: number | null; - readonly entries: ReadonlyArray; - readonly eventName: V2HookCompletedNotification__HookEventName; - readonly executionMode: V2HookCompletedNotification__HookExecutionMode; - readonly handlerType: V2HookCompletedNotification__HookHandlerType; - readonly id: string; - readonly scope: V2HookCompletedNotification__HookScope; - readonly source?: - | "system" - | "user" - | "project" - | "mdm" - | "sessionFlags" - | "plugin" - | "cloudRequirements" - | "cloudManagedConfig" - | "legacyManagedConfigFile" - | "legacyManagedConfigMdm" - | "unknown"; - readonly sourcePath: V2HookCompletedNotification__AbsolutePathBuf; - readonly startedAt: number; - readonly status: V2HookCompletedNotification__HookRunStatus; - readonly statusMessage?: string | null; -}; -export const V2HookCompletedNotification__HookRunSummary = Schema.Struct({ - completedAt: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - displayOrder: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - durationMs: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - entries: Schema.Array(V2HookCompletedNotification__HookOutputEntry), - eventName: V2HookCompletedNotification__HookEventName, - executionMode: V2HookCompletedNotification__HookExecutionMode, - handlerType: V2HookCompletedNotification__HookHandlerType, - id: Schema.String, - scope: V2HookCompletedNotification__HookScope, - source: Schema.optionalKey( - Schema.Literals([ - "system", - "user", - "project", - "mdm", - "sessionFlags", - "plugin", - "cloudRequirements", - "cloudManagedConfig", - "legacyManagedConfigFile", - "legacyManagedConfigMdm", - "unknown", - ]).annotate({ default: "unknown" }), - ), - sourcePath: V2HookCompletedNotification__AbsolutePathBuf, - startedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - status: V2HookCompletedNotification__HookRunStatus, - statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2HooksListResponse__HooksListEntry = { - readonly cwd: string; - readonly errors: ReadonlyArray; - readonly hooks: ReadonlyArray; - readonly warnings: ReadonlyArray; -}; -export const V2HooksListResponse__HooksListEntry = Schema.Struct({ - cwd: Schema.String, - errors: Schema.Array(V2HooksListResponse__HookErrorInfo), - hooks: Schema.Array(V2HooksListResponse__HookMetadata), - warnings: Schema.Array(Schema.String), -}); - -export type V2HookStartedNotification__HookRunSummary = { - readonly completedAt?: number | null; - readonly displayOrder: number; - readonly durationMs?: number | null; - readonly entries: ReadonlyArray; - readonly eventName: V2HookStartedNotification__HookEventName; - readonly executionMode: V2HookStartedNotification__HookExecutionMode; - readonly handlerType: V2HookStartedNotification__HookHandlerType; - readonly id: string; - readonly scope: V2HookStartedNotification__HookScope; - readonly source?: - | "system" - | "user" - | "project" - | "mdm" - | "sessionFlags" - | "plugin" - | "cloudRequirements" - | "cloudManagedConfig" - | "legacyManagedConfigFile" - | "legacyManagedConfigMdm" - | "unknown"; - readonly sourcePath: V2HookStartedNotification__AbsolutePathBuf; - readonly startedAt: number; - readonly status: V2HookStartedNotification__HookRunStatus; - readonly statusMessage?: string | null; -}; -export const V2HookStartedNotification__HookRunSummary = Schema.Struct({ - completedAt: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - displayOrder: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - durationMs: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - entries: Schema.Array(V2HookStartedNotification__HookOutputEntry), - eventName: V2HookStartedNotification__HookEventName, - executionMode: V2HookStartedNotification__HookExecutionMode, - handlerType: V2HookStartedNotification__HookHandlerType, - id: Schema.String, - scope: V2HookStartedNotification__HookScope, - source: Schema.optionalKey( - Schema.Literals([ - "system", - "user", - "project", - "mdm", - "sessionFlags", - "plugin", - "cloudRequirements", - "cloudManagedConfig", - "legacyManagedConfigFile", - "legacyManagedConfigMdm", - "unknown", - ]).annotate({ default: "unknown" }), - ), - sourcePath: V2HookStartedNotification__AbsolutePathBuf, - startedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - status: V2HookStartedNotification__HookRunStatus, - statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); + }).annotate({ title: "ImageGenerationCallResponseItem" }), + Schema.Struct({ + encrypted_content: Schema.String, + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + type: Schema.Literal("compaction").annotate({ title: "CompactionResponseItemType" }), + }).annotate({ title: "CompactionResponseItem" }), + Schema.Struct({ + reasoning: V2RawResponseItemCompletedNotification__ConfigurationReasoning, + type: Schema.Literal("configuration_update").annotate({ + title: "ConfigurationUpdateResponseItemType", + }), + }).annotate({ + title: "ConfigurationUpdateResponseItem", + description: "A durable input control interpreted by the backend at its position in history.", + }), + Schema.Struct({ + type: Schema.Literal("compaction_trigger").annotate({ + title: "CompactionTriggerResponseItemType", + }), + }).annotate({ title: "CompactionTriggerResponseItem" }), + Schema.Struct({ + encrypted_content: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + internal_chat_message_metadata_passthrough: Schema.optionalKey( + Schema.Union([ + V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, + Schema.Null, + ]), + ), + type: Schema.Literal("context_compaction").annotate({ + title: "ContextCompactionResponseItemType", + }), + }).annotate({ title: "ContextCompactionResponseItem" }), + Schema.Struct({ + type: Schema.Literal("other").annotate({ title: "OtherResponseItemType" }), + }).annotate({ title: "OtherResponseItem" }), + ], + { mode: "oneOf" }, +).annotate({ identifier: "V2RawResponseItemCompletedNotification__ResponseItem" }); -export type V2ItemCompletedNotification__ThreadItem = +export type V2ReviewStartResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ReviewStartResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ItemCompletedNotification__MemoryCitation | null; - readonly phase?: V2ItemCompletedNotification__MessagePhase | null; + readonly memoryCitation?: V2ReviewStartResponse__MemoryCitation | null; + readonly phase?: V2ReviewStartResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ReviewStartResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -21553,137 +35666,133 @@ export type V2ItemCompletedNotification__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ReviewStartResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ItemCompletedNotification__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ReviewStartResponse__CommandExecutionSource; + readonly status: V2ReviewStartResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ItemCompletedNotification__PatchApplyStatus; + readonly status: V2ReviewStartResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ItemCompletedNotification__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ReviewStartResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ItemCompletedNotification__McpToolCallError | null; + readonly error?: V2ReviewStartResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ReviewStartResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ItemCompletedNotification__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ReviewStartResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ItemCompletedNotification__McpToolCallStatus; + readonly status: V2ReviewStartResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ItemCompletedNotification__DynamicToolCallStatus; + readonly status: V2ReviewStartResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { - readonly [x: string]: V2ItemCompletedNotification__CollabAgentState; - }; + readonly agentsStates: { readonly [x: string]: V2ReviewStartResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ItemCompletedNotification__ReasoningEffort | null; + readonly reasoningEffort?: V2ReviewStartResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ReviewStartResponse__CollabAgentToolCallStatus; + readonly tool: V2ReviewStartResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ItemCompletedNotification__SubAgentActivityKind; + readonly kind: V2ReviewStartResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ItemCompletedNotification__WebSearchAction | null; + readonly action?: V2ReviewStartResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ItemCompletedNotification__LegacyAppPathString; + readonly path: V2ReviewStartResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ReviewStartResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ItemCompletedNotification__AbsolutePathBuf | null; + readonly savedPath?: V2ReviewStartResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ItemCompletedNotification__ThreadItem = Schema.Union( +export const V2ReviewStartResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ItemCompletedNotification__UserInput), + content: Schema.Array(V2ReviewStartResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ItemCompletedNotification__HookPromptFragment), + fragments: Schema.Array(V2ReviewStartResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ReviewStartResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__MemoryCitation, Schema.Null]), - ), - phase: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__MessagePhase, Schema.Null]), + Schema.Union([V2ReviewStartResponse__MemoryCitation, Schema.Null]), ), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__MessagePhase, Schema.Null])), questions: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), - Schema.Null, - ]), + Schema.Union([Schema.Array(V2ReviewStartResponse__AsyncUserInputQuestion), Schema.Null]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ReviewStartResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -21709,17 +35818,20 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ItemCompletedNotification__CommandAction).annotate({ + commandActions: Schema.Array(V2ReviewStartResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ReviewStartResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -21728,11 +35840,20 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -21741,65 +35862,80 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ReviewStartResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ItemCompletedNotification__CommandExecutionStatus, + status: V2ReviewStartResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ItemCompletedNotification__FileUpdateChange), + changes: Schema.Array(V2ReviewStartResponse__FileUpdateChange), id: Schema.String, - status: V2ItemCompletedNotification__PatchApplyStatus, + status: V2ReviewStartResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ReviewStartResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__McpToolCallError, Schema.Null]), + Schema.Union([V2ReviewStartResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ReviewStartResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__McpToolCallResult, Schema.Null]), + Schema.Union([V2ReviewStartResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ItemCompletedNotification__McpToolCallStatus, + status: V2ReviewStartResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ItemCompletedNotification__DynamicToolCallOutputContentItem), + Schema.Array(V2ReviewStartResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -21808,22 +35944,21 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ItemCompletedNotification__DynamicToolCallStatus, + status: V2ReviewStartResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record( - Schema.String, - V2ItemCompletedNotification__CollabAgentState, - ).annotate({ description: "Last known status of the target agents, when available." }), + agentsStates: Schema.Record(Schema.String, V2ReviewStartResponse__CollabAgentState).annotate({ + description: "Last known status of the target agents, when available.", + }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -21842,7 +35977,7 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ReviewStartResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -21853,20 +35988,14 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ReviewStartResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ReviewStartResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -21875,20 +36004,20 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ItemCompletedNotification__SubAgentActivityKind, + kind: V2ReviewStartResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__WebSearchAction, Schema.Null]), + Schema.Union([V2ReviewStartResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -21899,13 +36028,17 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ItemCompletedNotification__LegacyAppPathString, + path: V2ReviewStartResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -21913,13 +36046,17 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ReviewStartResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ReviewStartResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -21944,88 +36081,47 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath = - | { - readonly path: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString; - readonly type: "path"; - } - | { readonly pattern: string; readonly type: "glob_pattern" } - | { - readonly type: "special"; - readonly value: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath; - }; -export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath = Schema.Union( - [ - Schema.Struct({ - path: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, - type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), - }).annotate({ title: "PathFileSystemPath" }), - Schema.Struct({ - pattern: Schema.String, - type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), - }).annotate({ title: "GlobPatternFileSystemPath" }), - Schema.Struct({ - type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), - value: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath, - }).annotate({ title: "SpecialFileSystemPath" }), - ], - { mode: "oneOf" }, -); +).annotate({ identifier: "V2ReviewStartResponse__ThreadItem" }); -export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath = - | { - readonly path: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString; - readonly type: "path"; - } - | { readonly pattern: string; readonly type: "glob_pattern" } - | { - readonly type: "special"; - readonly value: V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath; - }; -export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath = Schema.Union( - [ - Schema.Struct({ - path: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, - type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), - }).annotate({ title: "PathFileSystemPath" }), - Schema.Struct({ - pattern: Schema.String, - type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), - }).annotate({ title: "GlobPatternFileSystemPath" }), - Schema.Struct({ - type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), - value: V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath, - }).annotate({ title: "SpecialFileSystemPath" }), - ], - { mode: "oneOf" }, -); +export type V2SkillsListResponse__SkillsListEntry = { + readonly cwd: string; + readonly errors: ReadonlyArray; + readonly skills: ReadonlyArray; +}; +export const V2SkillsListResponse__SkillsListEntry = Schema.Struct({ + cwd: Schema.String, + errors: Schema.Array(V2SkillsListResponse__SkillErrorInfo), + skills: Schema.Array(V2SkillsListResponse__SkillMetadata), +}).annotate({ identifier: "V2SkillsListResponse__SkillsListEntry" }); -export type V2ItemStartedNotification__ThreadItem = +export type V2ThreadForkResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadForkResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ItemStartedNotification__MemoryCitation | null; - readonly phase?: V2ItemStartedNotification__MessagePhase | null; + readonly memoryCitation?: V2ThreadForkResponse__MemoryCitation | null; + readonly phase?: V2ThreadForkResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadForkResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -22036,135 +36132,133 @@ export type V2ItemStartedNotification__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadForkResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ItemStartedNotification__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadForkResponse__CommandExecutionSource; + readonly status: V2ThreadForkResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ItemStartedNotification__PatchApplyStatus; + readonly status: V2ThreadForkResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ItemStartedNotification__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadForkResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ItemStartedNotification__McpToolCallError | null; + readonly error?: V2ThreadForkResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadForkResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ItemStartedNotification__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadForkResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ItemStartedNotification__McpToolCallStatus; + readonly status: V2ThreadForkResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ItemStartedNotification__DynamicToolCallStatus; + readonly status: V2ThreadForkResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ItemStartedNotification__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadForkResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ItemStartedNotification__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadForkResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadForkResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadForkResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ItemStartedNotification__SubAgentActivityKind; + readonly kind: V2ThreadForkResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ItemStartedNotification__WebSearchAction | null; + readonly action?: V2ThreadForkResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ItemStartedNotification__LegacyAppPathString; + readonly path: V2ThreadForkResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadForkResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ItemStartedNotification__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadForkResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ItemStartedNotification__ThreadItem = Schema.Union( +export const V2ThreadForkResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ItemStartedNotification__UserInput), + content: Schema.Array(V2ThreadForkResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ItemStartedNotification__HookPromptFragment), + fragments: Schema.Array(V2ThreadForkResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__MemoryCitation, Schema.Null]), - ), - phase: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__MessagePhase, Schema.Null]), + Schema.Union([V2ThreadForkResponse__MemoryCitation, Schema.Null]), ), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__MessagePhase, Schema.Null])), questions: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), - Schema.Null, - ]), + Schema.Union([Schema.Array(V2ThreadForkResponse__AsyncUserInputQuestion), Schema.Null]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadForkResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -22190,17 +36284,20 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ItemStartedNotification__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadForkResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadForkResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -22209,11 +36306,20 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -22222,65 +36328,80 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadForkResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ItemStartedNotification__CommandExecutionStatus, + status: V2ThreadForkResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ItemStartedNotification__FileUpdateChange), + changes: Schema.Array(V2ThreadForkResponse__FileUpdateChange), id: Schema.String, - status: V2ItemStartedNotification__PatchApplyStatus, + status: V2ThreadForkResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadForkResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadForkResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadForkResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ItemStartedNotification__McpToolCallStatus, + status: V2ThreadForkResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ItemStartedNotification__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadForkResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -22289,22 +36410,21 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ItemStartedNotification__DynamicToolCallStatus, + status: V2ThreadForkResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record( - Schema.String, - V2ItemStartedNotification__CollabAgentState, - ).annotate({ description: "Last known status of the target agents, when available." }), + agentsStates: Schema.Record(Schema.String, V2ThreadForkResponse__CollabAgentState).annotate({ + description: "Last known status of the target agents, when available.", + }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -22323,7 +36443,7 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadForkResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -22334,20 +36454,14 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadForkResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadForkResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -22356,20 +36470,20 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ItemStartedNotification__SubAgentActivityKind, + kind: V2ThreadForkResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadForkResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -22380,13 +36494,17 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ItemStartedNotification__LegacyAppPathString, + path: V2ThreadForkResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -22394,13 +36512,17 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadForkResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -22425,260 +36547,36 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type V2ModelListResponse__Model = { - readonly additionalSpeedTiers?: ReadonlyArray; - readonly availabilityNux?: V2ModelListResponse__ModelAvailabilityNux | null; - readonly defaultReasoningEffort: V2ModelListResponse__ReasoningEffort; - readonly defaultServiceTier?: string | null; - readonly description: string; - readonly displayName: string; - readonly hidden: boolean; - readonly id: string; - readonly inputModalities?: ReadonlyArray; - readonly isDefault: boolean; - readonly model: string; - readonly serviceTiers?: ReadonlyArray; - readonly supportedReasoningEfforts: ReadonlyArray; - readonly supportsPersonality?: boolean; - readonly upgrade?: string | null; - readonly upgradeInfo?: V2ModelListResponse__ModelUpgradeInfo | null; -}; -export const V2ModelListResponse__Model = Schema.Struct({ - additionalSpeedTiers: Schema.optionalKey( - Schema.Array(Schema.String).annotate({ - description: "Deprecated: use `serviceTiers` instead.", - default: [], - }), - ), - availabilityNux: Schema.optionalKey( - Schema.Union([V2ModelListResponse__ModelAvailabilityNux, Schema.Null]), - ), - defaultReasoningEffort: V2ModelListResponse__ReasoningEffort, - defaultServiceTier: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Catalog default service tier id for this model, when one is configured.", - }), - Schema.Null, - ]), - ), - description: Schema.String, - displayName: Schema.String, - hidden: Schema.Boolean, - id: Schema.String, - inputModalities: Schema.optionalKey( - Schema.Array(V2ModelListResponse__InputModality).annotate({ default: ["text", "image"] }), - ), - isDefault: Schema.Boolean, - model: Schema.String, - serviceTiers: Schema.optionalKey( - Schema.Array(V2ModelListResponse__ModelServiceTier).annotate({ default: [] }), - ), - supportedReasoningEfforts: Schema.Array(V2ModelListResponse__ReasoningEffortOption), - supportsPersonality: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - upgrade: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - upgradeInfo: Schema.optionalKey( - Schema.Union([V2ModelListResponse__ModelUpgradeInfo, Schema.Null]), - ), -}); - -export type V2PluginInstalledResponse__PluginShareContext = { - readonly creatorAccountUserId?: string | null; - readonly creatorName?: string | null; - readonly discoverability?: V2PluginInstalledResponse__PluginShareDiscoverability | null; - readonly remotePluginId: string; - readonly remoteVersion?: string | null; - readonly sharePrincipals?: ReadonlyArray | null; - readonly shareUrl?: string | null; -}; -export const V2PluginInstalledResponse__PluginShareContext = Schema.Struct({ - creatorAccountUserId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - creatorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - discoverability: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__PluginShareDiscoverability, Schema.Null]), - ), - remotePluginId: Schema.String, - remoteVersion: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version of the remote shared plugin release when available.", - }), - Schema.Null, - ]), - ), - sharePrincipals: Schema.optionalKey( - Schema.Union([Schema.Array(V2PluginInstalledResponse__PluginSharePrincipal), Schema.Null]), - ), - shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2PluginListResponse__PluginShareContext = { - readonly creatorAccountUserId?: string | null; - readonly creatorName?: string | null; - readonly discoverability?: V2PluginListResponse__PluginShareDiscoverability | null; - readonly remotePluginId: string; - readonly remoteVersion?: string | null; - readonly sharePrincipals?: ReadonlyArray | null; - readonly shareUrl?: string | null; -}; -export const V2PluginListResponse__PluginShareContext = Schema.Struct({ - creatorAccountUserId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - creatorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - discoverability: Schema.optionalKey( - Schema.Union([V2PluginListResponse__PluginShareDiscoverability, Schema.Null]), - ), - remotePluginId: Schema.String, - remoteVersion: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version of the remote shared plugin release when available.", - }), - Schema.Null, - ]), - ), - sharePrincipals: Schema.optionalKey( - Schema.Union([Schema.Array(V2PluginListResponse__PluginSharePrincipal), Schema.Null]), - ), - shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2PluginReadResponse__SkillSummary = { - readonly description: string; - readonly enabled: boolean; - readonly interface?: V2PluginReadResponse__SkillInterface | null; - readonly name: string; - readonly path?: V2PluginReadResponse__AbsolutePathBuf | null; - readonly shortDescription?: string | null; -}; -export const V2PluginReadResponse__SkillSummary = Schema.Struct({ - description: Schema.String, - enabled: Schema.Boolean, - interface: Schema.optionalKey(Schema.Union([V2PluginReadResponse__SkillInterface, Schema.Null])), - name: Schema.String, - path: Schema.optionalKey(Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null])), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2PluginReadResponse__PluginShareContext = { - readonly creatorAccountUserId?: string | null; - readonly creatorName?: string | null; - readonly discoverability?: V2PluginReadResponse__PluginShareDiscoverability | null; - readonly remotePluginId: string; - readonly remoteVersion?: string | null; - readonly sharePrincipals?: ReadonlyArray | null; - readonly shareUrl?: string | null; -}; -export const V2PluginReadResponse__PluginShareContext = Schema.Struct({ - creatorAccountUserId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - creatorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - discoverability: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__PluginShareDiscoverability, Schema.Null]), - ), - remotePluginId: Schema.String, - remoteVersion: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version of the remote shared plugin release when available.", - }), - Schema.Null, - ]), - ), - sharePrincipals: Schema.optionalKey( - Schema.Union([Schema.Array(V2PluginReadResponse__PluginSharePrincipal), Schema.Null]), - ), - shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2PluginReadResponse__ScheduledTaskSummary = { - readonly key: string; - readonly name: string; - readonly prompt: string; - readonly schedule: V2PluginReadResponse__ScheduledTaskSchedule; -}; -export const V2PluginReadResponse__ScheduledTaskSummary = Schema.Struct({ - key: Schema.String, - name: Schema.String, - prompt: Schema.String, - schedule: V2PluginReadResponse__ScheduledTaskSchedule, -}); - -export type V2PluginShareListResponse__PluginShareContext = { - readonly creatorAccountUserId?: string | null; - readonly creatorName?: string | null; - readonly discoverability?: V2PluginShareListResponse__PluginShareDiscoverability | null; - readonly remotePluginId: string; - readonly remoteVersion?: string | null; - readonly sharePrincipals?: ReadonlyArray | null; - readonly shareUrl?: string | null; -}; -export const V2PluginShareListResponse__PluginShareContext = Schema.Struct({ - creatorAccountUserId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - creatorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - discoverability: Schema.optionalKey( - Schema.Union([V2PluginShareListResponse__PluginShareDiscoverability, Schema.Null]), - ), - remotePluginId: Schema.String, - remoteVersion: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version of the remote shared plugin release when available.", - }), - Schema.Null, - ]), - ), - sharePrincipals: Schema.optionalKey( - Schema.Union([Schema.Array(V2PluginShareListResponse__PluginSharePrincipal), Schema.Null]), - ), - shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2RawResponseItemCompletedNotification__FunctionCallOutputBody = - | string - | ReadonlyArray; -export const V2RawResponseItemCompletedNotification__FunctionCallOutputBody = Schema.Union([ - Schema.String, - Schema.Array(V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem), -]); - -export type V2ReviewStartResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ReviewStartResponse__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ReviewStartResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); +).annotate({ identifier: "V2ThreadForkResponse__ThreadItem" }); -export type V2ReviewStartResponse__ThreadItem = +export type V2ThreadItemsListResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadItemsListResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ReviewStartResponse__MemoryCitation | null; - readonly phase?: V2ReviewStartResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadItemsListResponse__MemoryCitation | null; + readonly phase?: V2ThreadItemsListResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadItemsListResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -22689,133 +36587,138 @@ export type V2ReviewStartResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadItemsListResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ReviewStartResponse__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadItemsListResponse__CommandExecutionSource; + readonly status: V2ThreadItemsListResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ReviewStartResponse__PatchApplyStatus; + readonly status: V2ThreadItemsListResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ReviewStartResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadItemsListResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ReviewStartResponse__McpToolCallError | null; + readonly error?: V2ThreadItemsListResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadItemsListResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ReviewStartResponse__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadItemsListResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ReviewStartResponse__McpToolCallStatus; + readonly status: V2ThreadItemsListResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ReviewStartResponse__DynamicToolCallStatus; + readonly status: V2ThreadItemsListResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ReviewStartResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadItemsListResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ReviewStartResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadItemsListResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadItemsListResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadItemsListResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ReviewStartResponse__SubAgentActivityKind; + readonly kind: V2ThreadItemsListResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ReviewStartResponse__WebSearchAction | null; + readonly action?: V2ThreadItemsListResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ReviewStartResponse__LegacyAppPathString; + readonly path: V2ThreadItemsListResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadItemsListResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ReviewStartResponse__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadItemsListResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ReviewStartResponse__ThreadItem = Schema.Union( +export const V2ThreadItemsListResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ReviewStartResponse__UserInput), + content: Schema.Array(V2ThreadItemsListResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ReviewStartResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadItemsListResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadItemsListResponse__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__MessagePhase, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__MessagePhase, Schema.Null])), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), + Schema.Array(V2ThreadItemsListResponse__AsyncUserInputQuestion), Schema.Null, ]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadItemsListResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -22841,17 +36744,20 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ReviewStartResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadItemsListResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadItemsListResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -22860,11 +36766,20 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -22873,65 +36788,80 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadItemsListResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ReviewStartResponse__CommandExecutionStatus, + status: V2ThreadItemsListResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ReviewStartResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadItemsListResponse__FileUpdateChange), id: Schema.String, - status: V2ReviewStartResponse__PatchApplyStatus, + status: V2ThreadItemsListResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadItemsListResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadItemsListResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadItemsListResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ReviewStartResponse__McpToolCallStatus, + status: V2ThreadItemsListResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ReviewStartResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadItemsListResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -22940,21 +36870,22 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ReviewStartResponse__DynamicToolCallStatus, + status: V2ThreadItemsListResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ReviewStartResponse__CollabAgentState).annotate({ - description: "Last known status of the target agents, when available.", - }), + agentsStates: Schema.Record( + Schema.String, + V2ThreadItemsListResponse__CollabAgentState, + ).annotate({ description: "Last known status of the target agents, when available." }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -22973,7 +36904,7 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadItemsListResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -22984,20 +36915,14 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadItemsListResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadItemsListResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -23006,20 +36931,20 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ReviewStartResponse__SubAgentActivityKind, + kind: V2ThreadItemsListResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadItemsListResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -23030,13 +36955,17 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ReviewStartResponse__LegacyAppPathString, + path: V2ThreadItemsListResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -23044,13 +36973,17 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadItemsListResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadItemsListResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -23075,76 +37008,36 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type V2SkillsListResponse__SkillMetadata = { - readonly dependencies?: V2SkillsListResponse__SkillDependencies | null; - readonly description: string; - readonly enabled: boolean; - readonly interface?: V2SkillsListResponse__SkillInterface | null; - readonly name: string; - readonly path: V2SkillsListResponse__AbsolutePathBuf; - readonly scope: V2SkillsListResponse__SkillScope; - readonly shortDescription?: string | null; -}; -export const V2SkillsListResponse__SkillMetadata = Schema.Struct({ - dependencies: Schema.optionalKey( - Schema.Union([V2SkillsListResponse__SkillDependencies, Schema.Null]), - ), - description: Schema.String, - enabled: Schema.Boolean, - interface: Schema.optionalKey(Schema.Union([V2SkillsListResponse__SkillInterface, Schema.Null])), - name: Schema.String, - path: V2SkillsListResponse__AbsolutePathBuf, - scope: V2SkillsListResponse__SkillScope, - shortDescription: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", - }), - Schema.Null, - ]), - ), -}); - -export type V2ThreadForkResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadForkResponse__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ThreadForkResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); +).annotate({ identifier: "V2ThreadItemsListResponse__ThreadItem" }); -export type V2ThreadForkResponse__ThreadItem = +export type V2ThreadListResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadListResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ThreadForkResponse__MemoryCitation | null; - readonly phase?: V2ThreadForkResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadListResponse__MemoryCitation | null; + readonly phase?: V2ThreadListResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadListResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -23155,133 +37048,133 @@ export type V2ThreadForkResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadListResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadForkResponse__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadListResponse__CommandExecutionSource; + readonly status: V2ThreadListResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadForkResponse__PatchApplyStatus; + readonly status: V2ThreadListResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ThreadForkResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadListResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ThreadForkResponse__McpToolCallError | null; + readonly error?: V2ThreadListResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadListResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ThreadForkResponse__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadListResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadForkResponse__McpToolCallStatus; + readonly status: V2ThreadListResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ThreadForkResponse__DynamicToolCallStatus; + readonly status: V2ThreadListResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadForkResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadListResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadForkResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadListResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadListResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadListResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ThreadForkResponse__SubAgentActivityKind; + readonly kind: V2ThreadListResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ThreadForkResponse__WebSearchAction | null; + readonly action?: V2ThreadListResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ThreadForkResponse__LegacyAppPathString; + readonly path: V2ThreadListResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadListResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ThreadForkResponse__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadListResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadForkResponse__ThreadItem = Schema.Union( +export const V2ThreadListResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ThreadForkResponse__UserInput), + content: Schema.Array(V2ThreadListResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadForkResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadListResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadListResponse__MemoryCitation, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__MessagePhase, Schema.Null])), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadListResponse__MessagePhase, Schema.Null])), questions: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), - Schema.Null, - ]), + Schema.Union([Schema.Array(V2ThreadListResponse__AsyncUserInputQuestion), Schema.Null]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadListResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -23307,17 +37200,20 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadForkResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadListResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadListResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -23326,11 +37222,20 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -23339,65 +37244,80 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadListResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ThreadForkResponse__CommandExecutionStatus, + status: V2ThreadListResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadForkResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadListResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadForkResponse__PatchApplyStatus, + status: V2ThreadListResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadListResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadListResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadListResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadForkResponse__McpToolCallStatus, + status: V2ThreadListResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadForkResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadListResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -23406,19 +37326,19 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadForkResponse__DynamicToolCallStatus, + status: V2ThreadListResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadForkResponse__CollabAgentState).annotate({ + agentsStates: Schema.Record(Schema.String, V2ThreadListResponse__CollabAgentState).annotate({ description: "Last known status of the target agents, when available.", }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), @@ -23439,7 +37359,7 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadListResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -23450,20 +37370,14 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadListResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadListResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -23472,20 +37386,20 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ThreadForkResponse__SubAgentActivityKind, + kind: V2ThreadListResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadListResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -23496,13 +37410,17 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ThreadForkResponse__LegacyAppPathString, + path: V2ThreadListResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -23510,13 +37428,17 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadListResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -23541,45 +37463,36 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadListResponse__ThreadItem" }); -export type V2ThreadListResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadListResponse__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ThreadListResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); - -export type V2ThreadListResponse__ThreadItem = +export type V2ThreadMetadataUpdateResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadMetadataUpdateResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ThreadListResponse__MemoryCitation | null; - readonly phase?: V2ThreadListResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadMetadataUpdateResponse__MemoryCitation | null; + readonly phase?: V2ThreadMetadataUpdateResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadMetadataUpdateResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -23590,133 +37503,140 @@ export type V2ThreadListResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadMetadataUpdateResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadListResponse__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadMetadataUpdateResponse__CommandExecutionSource; + readonly status: V2ThreadMetadataUpdateResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadListResponse__PatchApplyStatus; + readonly status: V2ThreadMetadataUpdateResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ThreadListResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadMetadataUpdateResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ThreadListResponse__McpToolCallError | null; + readonly error?: V2ThreadMetadataUpdateResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadMetadataUpdateResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ThreadListResponse__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadMetadataUpdateResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadListResponse__McpToolCallStatus; + readonly status: V2ThreadMetadataUpdateResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ThreadListResponse__DynamicToolCallStatus; + readonly status: V2ThreadMetadataUpdateResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadListResponse__CollabAgentState }; + readonly agentsStates: { + readonly [x: string]: V2ThreadMetadataUpdateResponse__CollabAgentState; + }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadListResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadMetadataUpdateResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ThreadListResponse__SubAgentActivityKind; + readonly kind: V2ThreadMetadataUpdateResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ThreadListResponse__WebSearchAction | null; + readonly action?: V2ThreadMetadataUpdateResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ThreadListResponse__LegacyAppPathString; + readonly path: V2ThreadMetadataUpdateResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadMetadataUpdateResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ThreadListResponse__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadMetadataUpdateResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadListResponse__ThreadItem = Schema.Union( +export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ThreadListResponse__UserInput), + content: Schema.Array(V2ThreadMetadataUpdateResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadListResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadMetadataUpdateResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__MessagePhase, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadListResponse__MessagePhase, Schema.Null])), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), + Schema.Array(V2ThreadMetadataUpdateResponse__AsyncUserInputQuestion), Schema.Null, ]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadMetadataUpdateResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -23742,17 +37662,20 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadListResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadMetadataUpdateResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -23761,11 +37684,20 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -23774,65 +37706,80 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ThreadListResponse__CommandExecutionStatus, + status: V2ThreadMetadataUpdateResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadListResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadMetadataUpdateResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadListResponse__PatchApplyStatus, + status: V2ThreadMetadataUpdateResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadListResponse__McpToolCallStatus, + status: V2ThreadMetadataUpdateResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadListResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -23841,21 +37788,22 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadListResponse__DynamicToolCallStatus, + status: V2ThreadMetadataUpdateResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadListResponse__CollabAgentState).annotate({ - description: "Last known status of the target agents, when available.", - }), + agentsStates: Schema.Record( + Schema.String, + V2ThreadMetadataUpdateResponse__CollabAgentState, + ).annotate({ description: "Last known status of the target agents, when available." }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -23874,7 +37822,7 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadMetadataUpdateResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -23885,20 +37833,14 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -23907,20 +37849,20 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ThreadListResponse__SubAgentActivityKind, + kind: V2ThreadMetadataUpdateResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -23931,13 +37873,17 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ThreadListResponse__LegacyAppPathString, + path: V2ThreadMetadataUpdateResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -23945,13 +37891,17 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -23976,45 +37926,36 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type V2ThreadMetadataUpdateResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadMetadataUpdateResponse__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ThreadMetadataUpdateResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); +).annotate({ identifier: "V2ThreadMetadataUpdateResponse__ThreadItem" }); -export type V2ThreadMetadataUpdateResponse__ThreadItem = +export type V2ThreadReadResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadReadResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ThreadMetadataUpdateResponse__MemoryCitation | null; - readonly phase?: V2ThreadMetadataUpdateResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadReadResponse__MemoryCitation | null; + readonly phase?: V2ThreadReadResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadReadResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -24025,137 +37966,133 @@ export type V2ThreadMetadataUpdateResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadReadResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadMetadataUpdateResponse__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadReadResponse__CommandExecutionSource; + readonly status: V2ThreadReadResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadMetadataUpdateResponse__PatchApplyStatus; + readonly status: V2ThreadReadResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ThreadMetadataUpdateResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadReadResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ThreadMetadataUpdateResponse__McpToolCallError | null; + readonly error?: V2ThreadReadResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadReadResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ThreadMetadataUpdateResponse__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadReadResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadMetadataUpdateResponse__McpToolCallStatus; + readonly status: V2ThreadReadResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ThreadMetadataUpdateResponse__DynamicToolCallStatus; + readonly status: V2ThreadReadResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { - readonly [x: string]: V2ThreadMetadataUpdateResponse__CollabAgentState; - }; + readonly agentsStates: { readonly [x: string]: V2ThreadReadResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadReadResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadReadResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadReadResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ThreadMetadataUpdateResponse__SubAgentActivityKind; + readonly kind: V2ThreadReadResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ThreadMetadataUpdateResponse__WebSearchAction | null; + readonly action?: V2ThreadReadResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ThreadMetadataUpdateResponse__LegacyAppPathString; + readonly path: V2ThreadReadResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadReadResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ThreadMetadataUpdateResponse__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadReadResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( +export const V2ThreadReadResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ThreadMetadataUpdateResponse__UserInput), + content: Schema.Array(V2ThreadReadResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadMetadataUpdateResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadReadResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__MemoryCitation, Schema.Null]), - ), - phase: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__MessagePhase, Schema.Null]), + Schema.Union([V2ThreadReadResponse__MemoryCitation, Schema.Null]), ), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__MessagePhase, Schema.Null])), questions: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), - Schema.Null, - ]), + Schema.Union([Schema.Array(V2ThreadReadResponse__AsyncUserInputQuestion), Schema.Null]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadReadResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -24181,17 +38118,20 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadMetadataUpdateResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadReadResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadReadResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -24200,11 +38140,20 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -24213,65 +38162,80 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadReadResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ThreadMetadataUpdateResponse__CommandExecutionStatus, + status: V2ThreadReadResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadMetadataUpdateResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadReadResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadMetadataUpdateResponse__PatchApplyStatus, + status: V2ThreadReadResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadReadResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadReadResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadReadResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadMetadataUpdateResponse__McpToolCallStatus, + status: V2ThreadReadResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadReadResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -24280,22 +38244,21 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadMetadataUpdateResponse__DynamicToolCallStatus, + status: V2ThreadReadResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record( - Schema.String, - V2ThreadMetadataUpdateResponse__CollabAgentState, - ).annotate({ description: "Last known status of the target agents, when available." }), + agentsStates: Schema.Record(Schema.String, V2ThreadReadResponse__CollabAgentState).annotate({ + description: "Last known status of the target agents, when available.", + }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -24314,7 +38277,7 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadReadResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -24325,20 +38288,14 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadReadResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadReadResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -24347,20 +38304,20 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ThreadMetadataUpdateResponse__SubAgentActivityKind, + kind: V2ThreadReadResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadReadResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -24371,13 +38328,17 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ThreadMetadataUpdateResponse__LegacyAppPathString, + path: V2ThreadReadResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -24385,13 +38346,17 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadReadResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -24416,45 +38381,36 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type V2ThreadReadResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadReadResponse__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ThreadReadResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); +).annotate({ identifier: "V2ThreadReadResponse__ThreadItem" }); -export type V2ThreadReadResponse__ThreadItem = +export type V2ThreadResumeResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadResumeResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ThreadReadResponse__MemoryCitation | null; - readonly phase?: V2ThreadReadResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadResumeResponse__MemoryCitation | null; + readonly phase?: V2ThreadResumeResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadResumeResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -24465,133 +38421,133 @@ export type V2ThreadReadResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadResumeResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadReadResponse__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadResumeResponse__CommandExecutionSource; + readonly status: V2ThreadResumeResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadReadResponse__PatchApplyStatus; + readonly status: V2ThreadResumeResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ThreadReadResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadResumeResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ThreadReadResponse__McpToolCallError | null; + readonly error?: V2ThreadResumeResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadResumeResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ThreadReadResponse__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadResumeResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadReadResponse__McpToolCallStatus; + readonly status: V2ThreadResumeResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ThreadReadResponse__DynamicToolCallStatus; + readonly status: V2ThreadResumeResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadReadResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadResumeResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadReadResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadResumeResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadResumeResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadResumeResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ThreadReadResponse__SubAgentActivityKind; + readonly kind: V2ThreadResumeResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ThreadReadResponse__WebSearchAction | null; + readonly action?: V2ThreadResumeResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ThreadReadResponse__LegacyAppPathString; + readonly path: V2ThreadResumeResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadResumeResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ThreadReadResponse__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadResumeResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadReadResponse__ThreadItem = Schema.Union( +export const V2ThreadResumeResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ThreadReadResponse__UserInput), + content: Schema.Array(V2ThreadResumeResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadReadResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadResumeResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__MemoryCitation, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__MessagePhase, Schema.Null])), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__MessagePhase, Schema.Null])), questions: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), - Schema.Null, - ]), + Schema.Union([Schema.Array(V2ThreadResumeResponse__AsyncUserInputQuestion), Schema.Null]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadResumeResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -24617,17 +38573,20 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadReadResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadResumeResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -24636,11 +38595,20 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -24649,65 +38617,80 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ThreadReadResponse__CommandExecutionStatus, + status: V2ThreadResumeResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadReadResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadResumeResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadReadResponse__PatchApplyStatus, + status: V2ThreadResumeResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadReadResponse__McpToolCallStatus, + status: V2ThreadResumeResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadReadResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadResumeResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -24716,21 +38699,21 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadReadResponse__DynamicToolCallStatus, + status: V2ThreadResumeResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadReadResponse__CollabAgentState).annotate({ - description: "Last known status of the target agents, when available.", - }), + agentsStates: Schema.Record(Schema.String, V2ThreadResumeResponse__CollabAgentState).annotate( + { description: "Last known status of the target agents, when available." }, + ), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -24749,7 +38732,7 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -24760,20 +38743,14 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -24782,20 +38759,20 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ThreadReadResponse__SubAgentActivityKind, + kind: V2ThreadResumeResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -24806,13 +38783,17 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ThreadReadResponse__LegacyAppPathString, + path: V2ThreadResumeResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -24820,13 +38801,17 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -24851,53 +38836,36 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadResumeResponse__ThreadItem" }); -export type V2ThreadResumeParams__FunctionCallOutputBody = - | string - | ReadonlyArray; -export const V2ThreadResumeParams__FunctionCallOutputBody = Schema.Union([ - Schema.String, - Schema.Array(V2ThreadResumeParams__FunctionCallOutputContentItem), -]); - -export type V2ThreadResumeResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadResumeResponse__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ThreadResumeResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); - -export type V2ThreadResumeResponse__ThreadItem = +export type V2ThreadRevertResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadRevertResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ThreadResumeResponse__MemoryCitation | null; - readonly phase?: V2ThreadResumeResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadRevertResponse__MemoryCitation | null; + readonly phase?: V2ThreadRevertResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadRevertResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -24908,133 +38876,133 @@ export type V2ThreadResumeResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadRevertResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadResumeResponse__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadRevertResponse__CommandExecutionSource; + readonly status: V2ThreadRevertResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadResumeResponse__PatchApplyStatus; + readonly status: V2ThreadRevertResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ThreadResumeResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadRevertResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ThreadResumeResponse__McpToolCallError | null; + readonly error?: V2ThreadRevertResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadRevertResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ThreadResumeResponse__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadRevertResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadResumeResponse__McpToolCallStatus; + readonly status: V2ThreadRevertResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ThreadResumeResponse__DynamicToolCallStatus; + readonly status: V2ThreadRevertResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadResumeResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadRevertResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadResumeResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadRevertResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadRevertResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadRevertResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ThreadResumeResponse__SubAgentActivityKind; + readonly kind: V2ThreadRevertResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ThreadResumeResponse__WebSearchAction | null; + readonly action?: V2ThreadRevertResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ThreadResumeResponse__LegacyAppPathString; + readonly path: V2ThreadRevertResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadRevertResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ThreadResumeResponse__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadRevertResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadResumeResponse__ThreadItem = Schema.Union( +export const V2ThreadRevertResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ThreadResumeResponse__UserInput), + content: Schema.Array(V2ThreadRevertResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadResumeResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadRevertResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadRevertResponse__MemoryCitation, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__MessagePhase, Schema.Null])), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__MessagePhase, Schema.Null])), questions: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), - Schema.Null, - ]), + Schema.Union([Schema.Array(V2ThreadRevertResponse__AsyncUserInputQuestion), Schema.Null]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadRevertResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -25060,17 +39028,20 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadResumeResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadRevertResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadRevertResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -25079,11 +39050,20 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -25092,65 +39072,80 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadRevertResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ThreadResumeResponse__CommandExecutionStatus, + status: V2ThreadRevertResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadResumeResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadRevertResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadResumeResponse__PatchApplyStatus, + status: V2ThreadRevertResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadRevertResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadRevertResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadRevertResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadResumeResponse__McpToolCallStatus, + status: V2ThreadRevertResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadResumeResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadRevertResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -25159,19 +39154,19 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadResumeResponse__DynamicToolCallStatus, + status: V2ThreadRevertResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadResumeResponse__CollabAgentState).annotate( + agentsStates: Schema.Record(Schema.String, V2ThreadRevertResponse__CollabAgentState).annotate( { description: "Last known status of the target agents, when available." }, ), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), @@ -25192,7 +39187,7 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadRevertResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -25203,20 +39198,14 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadRevertResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadRevertResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -25225,20 +39214,20 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ThreadResumeResponse__SubAgentActivityKind, + kind: V2ThreadRevertResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadRevertResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -25249,13 +39238,17 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ThreadResumeResponse__LegacyAppPathString, + path: V2ThreadRevertResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -25263,13 +39256,17 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadRevertResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -25294,45 +39291,83 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadRevertResponse__ThreadItem" }); -export type V2ThreadRollbackResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadRollbackResponse__CodexErrorInfo | null; - readonly message: string; +export type V2ThreadSettingsUpdatedNotification__ThreadSettings = { + readonly activePermissionProfile?: V2ThreadSettingsUpdatedNotification__ActivePermissionProfile | null; + readonly approvalPolicy: V2ThreadSettingsUpdatedNotification__AskForApproval; + readonly approvalsReviewer: V2ThreadSettingsUpdatedNotification__ApprovalsReviewer; + readonly collaborationMode: V2ThreadSettingsUpdatedNotification__CollaborationMode; + readonly cwd: V2ThreadSettingsUpdatedNotification__AbsolutePathBuf; + readonly disabledPluginIds?: ReadonlyArray; + readonly effort?: V2ThreadSettingsUpdatedNotification__ReasoningEffort | null; + readonly model: string; + readonly modelProvider: string; + readonly personality?: V2ThreadSettingsUpdatedNotification__Personality | null; + readonly sandboxPolicy: V2ThreadSettingsUpdatedNotification__SandboxPolicy; + readonly serviceTier?: string | null; + readonly summary?: V2ThreadSettingsUpdatedNotification__ReasoningSummary | null; }; -export const V2ThreadRollbackResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__CodexErrorInfo, Schema.Null]), +export const V2ThreadSettingsUpdatedNotification__ThreadSettings = Schema.Struct({ + activePermissionProfile: Schema.optionalKey( + Schema.Union([V2ThreadSettingsUpdatedNotification__ActivePermissionProfile, Schema.Null]), ), - message: Schema.String, -}); + approvalPolicy: V2ThreadSettingsUpdatedNotification__AskForApproval, + approvalsReviewer: V2ThreadSettingsUpdatedNotification__ApprovalsReviewer, + collaborationMode: V2ThreadSettingsUpdatedNotification__CollaborationMode, + cwd: V2ThreadSettingsUpdatedNotification__AbsolutePathBuf, + disabledPluginIds: Schema.optionalKey( + Schema.Array(Schema.String).annotate({ + description: "Saved list of disabled plugin IDs. Does not yet filter plugin capabilities.", + default: [], + }), + ), + effort: Schema.optionalKey( + Schema.Union([V2ThreadSettingsUpdatedNotification__ReasoningEffort, Schema.Null]), + ), + model: Schema.String, + modelProvider: Schema.String, + personality: Schema.optionalKey( + Schema.Union([V2ThreadSettingsUpdatedNotification__Personality, Schema.Null]).annotate({ + description: + "@deprecated Reports the saved setting; `friendly` and `pragmatic` no longer select a style.", + }), + ), + sandboxPolicy: V2ThreadSettingsUpdatedNotification__SandboxPolicy, + serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + summary: Schema.optionalKey( + Schema.Union([V2ThreadSettingsUpdatedNotification__ReasoningSummary, Schema.Null]), + ), +}).annotate({ identifier: "V2ThreadSettingsUpdatedNotification__ThreadSettings" }); -export type V2ThreadRollbackResponse__ThreadItem = +export type V2ThreadStartedNotification__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadStartedNotification__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ThreadRollbackResponse__MemoryCitation | null; - readonly phase?: V2ThreadRollbackResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadStartedNotification__MemoryCitation | null; + readonly phase?: V2ThreadStartedNotification__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadStartedNotification__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -25343,135 +39378,140 @@ export type V2ThreadRollbackResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadStartedNotification__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadRollbackResponse__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadStartedNotification__CommandExecutionSource; + readonly status: V2ThreadStartedNotification__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadRollbackResponse__PatchApplyStatus; + readonly status: V2ThreadStartedNotification__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ThreadRollbackResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadStartedNotification__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ThreadRollbackResponse__McpToolCallError | null; + readonly error?: V2ThreadStartedNotification__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadStartedNotification__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ThreadRollbackResponse__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadStartedNotification__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadRollbackResponse__McpToolCallStatus; + readonly status: V2ThreadStartedNotification__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ThreadRollbackResponse__DynamicToolCallStatus; + readonly status: V2ThreadStartedNotification__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadRollbackResponse__CollabAgentState }; + readonly agentsStates: { + readonly [x: string]: V2ThreadStartedNotification__CollabAgentState; + }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadRollbackResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadStartedNotification__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadStartedNotification__CollabAgentToolCallStatus; + readonly tool: V2ThreadStartedNotification__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ThreadRollbackResponse__SubAgentActivityKind; + readonly kind: V2ThreadStartedNotification__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ThreadRollbackResponse__WebSearchAction | null; + readonly action?: V2ThreadStartedNotification__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ThreadRollbackResponse__LegacyAppPathString; + readonly path: V2ThreadStartedNotification__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadStartedNotification__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ThreadRollbackResponse__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadStartedNotification__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( +export const V2ThreadStartedNotification__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ThreadRollbackResponse__UserInput), + content: Schema.Array(V2ThreadStartedNotification__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadRollbackResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadStartedNotification__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__MemoryCitation, Schema.Null]), ), phase: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__MessagePhase, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__MessagePhase, Schema.Null]), ), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), + Schema.Array(V2ThreadStartedNotification__AsyncUserInputQuestion), Schema.Null, ]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadStartedNotification__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -25497,17 +39537,20 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadRollbackResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadStartedNotification__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -25516,11 +39559,20 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -25529,65 +39581,80 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), - ), - status: V2ThreadRollbackResponse__CommandExecutionStatus, + Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__CommandExecutionSource, + ).annotate({ default: "agent" }), + ), + status: V2ThreadStartedNotification__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadRollbackResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadStartedNotification__FileUpdateChange), id: Schema.String, - status: V2ThreadRollbackResponse__PatchApplyStatus, + status: V2ThreadStartedNotification__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadRollbackResponse__McpToolCallStatus, + status: V2ThreadStartedNotification__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadRollbackResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadStartedNotification__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -25596,13 +39663,13 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadRollbackResponse__DynamicToolCallStatus, + status: V2ThreadStartedNotification__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), @@ -25610,7 +39677,7 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( Schema.Struct({ agentsStates: Schema.Record( Schema.String, - V2ThreadRollbackResponse__CollabAgentState, + V2ThreadStartedNotification__CollabAgentState, ).annotate({ description: "Last known status of the target agents, when available." }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( @@ -25630,7 +39697,7 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadStartedNotification__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -25641,20 +39708,14 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -25663,20 +39724,20 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ThreadRollbackResponse__SubAgentActivityKind, + kind: V2ThreadStartedNotification__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -25687,13 +39748,17 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ThreadRollbackResponse__LegacyAppPathString, + path: V2ThreadStartedNotification__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -25701,13 +39766,17 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -25732,54 +39801,36 @@ export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartedNotification__ThreadItem" }); -export type V2ThreadSettingsUpdatedNotification__CollaborationMode = { - readonly mode: V2ThreadSettingsUpdatedNotification__ModeKind; - readonly settings: V2ThreadSettingsUpdatedNotification__Settings; -}; -export const V2ThreadSettingsUpdatedNotification__CollaborationMode = Schema.Struct({ - mode: V2ThreadSettingsUpdatedNotification__ModeKind, - settings: V2ThreadSettingsUpdatedNotification__Settings, -}).annotate({ description: "Collaboration mode for a Codex session." }); - -export type V2ThreadStartedNotification__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadStartedNotification__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ThreadStartedNotification__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); - -export type V2ThreadStartedNotification__ThreadItem = +export type V2ThreadStartResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadStartResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ThreadStartedNotification__MemoryCitation | null; - readonly phase?: V2ThreadStartedNotification__MessagePhase | null; + readonly memoryCitation?: V2ThreadStartResponse__MemoryCitation | null; + readonly phase?: V2ThreadStartResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadStartResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -25790,137 +39841,133 @@ export type V2ThreadStartedNotification__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadStartResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadStartedNotification__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadStartResponse__CommandExecutionSource; + readonly status: V2ThreadStartResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadStartedNotification__PatchApplyStatus; + readonly status: V2ThreadStartResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ThreadStartedNotification__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadStartResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ThreadStartedNotification__McpToolCallError | null; + readonly error?: V2ThreadStartResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadStartResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ThreadStartedNotification__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadStartResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadStartedNotification__McpToolCallStatus; + readonly status: V2ThreadStartResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ThreadStartedNotification__DynamicToolCallStatus; + readonly status: V2ThreadStartResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { - readonly [x: string]: V2ThreadStartedNotification__CollabAgentState; - }; + readonly agentsStates: { readonly [x: string]: V2ThreadStartResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadStartedNotification__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadStartResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadStartResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadStartResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ThreadStartedNotification__SubAgentActivityKind; + readonly kind: V2ThreadStartResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ThreadStartedNotification__WebSearchAction | null; + readonly action?: V2ThreadStartResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ThreadStartedNotification__LegacyAppPathString; + readonly path: V2ThreadStartResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadStartResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ThreadStartedNotification__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadStartResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadStartedNotification__ThreadItem = Schema.Union( +export const V2ThreadStartResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ThreadStartedNotification__UserInput), + content: Schema.Array(V2ThreadStartResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadStartedNotification__HookPromptFragment), + fragments: Schema.Array(V2ThreadStartResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__MemoryCitation, Schema.Null]), - ), - phase: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__MessagePhase, Schema.Null]), + Schema.Union([V2ThreadStartResponse__MemoryCitation, Schema.Null]), ), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__MessagePhase, Schema.Null])), questions: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), - Schema.Null, - ]), + Schema.Union([Schema.Array(V2ThreadStartResponse__AsyncUserInputQuestion), Schema.Null]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadStartResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -25946,17 +39993,20 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadStartedNotification__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadStartResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -25965,11 +40015,20 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -25978,65 +40037,80 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ThreadStartedNotification__CommandExecutionStatus, + status: V2ThreadStartResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadStartedNotification__FileUpdateChange), + changes: Schema.Array(V2ThreadStartResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadStartedNotification__PatchApplyStatus, + status: V2ThreadStartResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadStartResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadStartResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadStartResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadStartedNotification__McpToolCallStatus, + status: V2ThreadStartResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadStartedNotification__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadStartResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -26045,22 +40119,21 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadStartedNotification__DynamicToolCallStatus, + status: V2ThreadStartResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record( - Schema.String, - V2ThreadStartedNotification__CollabAgentState, - ).annotate({ description: "Last known status of the target agents, when available." }), + agentsStates: Schema.Record(Schema.String, V2ThreadStartResponse__CollabAgentState).annotate({ + description: "Last known status of the target agents, when available.", + }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -26079,7 +40152,7 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadStartResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -26090,20 +40163,14 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -26112,20 +40179,20 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ThreadStartedNotification__SubAgentActivityKind, + kind: V2ThreadStartResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadStartResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -26136,13 +40203,17 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ThreadStartedNotification__LegacyAppPathString, + path: V2ThreadStartResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -26150,13 +40221,17 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ThreadStartedNotification__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadStartResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -26181,45 +40256,36 @@ export const V2ThreadStartedNotification__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2ThreadStartResponse__ThreadItem" }); -export type V2ThreadStartResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadStartResponse__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ThreadStartResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); - -export type V2ThreadStartResponse__ThreadItem = +export type V2ThreadTurnsListResponse__ThreadItem = | { readonly clientId?: string | null; - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadTurnsListResponse__AgentMessageDelivery | null; readonly id: string; - readonly memoryCitation?: V2ThreadStartResponse__MemoryCitation | null; - readonly phase?: V2ThreadStartResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadTurnsListResponse__MemoryCitation | null; + readonly phase?: V2ThreadTurnsListResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadTurnsListResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -26230,133 +40296,138 @@ export type V2ThreadStartResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly commandActions: ReadonlyArray; + readonly cwd: V2ThreadTurnsListResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadStartResponse__CommandExecutionStatus; + readonly scriptPath?: string | null; + readonly source?: V2ThreadTurnsListResponse__CommandExecutionSource; + readonly status: V2ThreadTurnsListResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadStartResponse__PatchApplyStatus; + readonly status: V2ThreadTurnsListResponse__PatchApplyStatus; readonly type: "fileChange"; } | { - readonly appContext?: V2ThreadStartResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly appContext?: V2ThreadTurnsListResponse__McpToolCallAppContext | null; + readonly arguments: Schema.Json; readonly durationMs?: number | null; - readonly error?: V2ThreadStartResponse__McpToolCallError | null; + readonly error?: V2ThreadTurnsListResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadTurnsListResponse__McpAppUi | null; readonly pluginId?: string | null; - readonly result?: V2ThreadStartResponse__McpToolCallResult | null; + readonly readOnlyHint?: boolean | null; + readonly result?: V2ThreadTurnsListResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadStartResponse__McpToolCallStatus; + readonly status: V2ThreadTurnsListResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly arguments: Schema.Json; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; readonly namespace?: string | null; - readonly status: V2ThreadStartResponse__DynamicToolCallStatus; + readonly status: V2ThreadTurnsListResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadStartResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadTurnsListResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadStartResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadTurnsListResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadTurnsListResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadTurnsListResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { readonly agentPath: string; readonly agentThreadId: string; readonly id: string; - readonly kind: V2ThreadStartResponse__SubAgentActivityKind; + readonly kind: V2ThreadTurnsListResponse__SubAgentActivityKind; readonly type: "subAgentActivity"; } | { - readonly action?: V2ThreadStartResponse__WebSearchAction | null; + readonly action?: V2ThreadTurnsListResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { readonly id: string; - readonly path: V2ThreadStartResponse__LegacyAppPathString; + readonly path: V2ThreadTurnsListResponse__LegacyAppPathString; readonly type: "imageView"; } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadTurnsListResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: V2ThreadStartResponse__AbsolutePathBuf | null; + readonly savedPath?: V2ThreadTurnsListResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadStartResponse__ThreadItem = Schema.Union( +export const V2ThreadTurnsListResponse__ThreadItem = Schema.Union( [ Schema.Struct({ clientId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - content: Schema.Array(V2ThreadStartResponse__UserInput), + content: Schema.Array(V2ThreadTurnsListResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadStartResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadTurnsListResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadTurnsListResponse__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__MessagePhase, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadStartResponse__MessagePhase, Schema.Null])), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), + Schema.Array(V2ThreadTurnsListResponse__AsyncUserInputQuestion), Schema.Null, ]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadTurnsListResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -26382,17 +40453,20 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadStartResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadTurnsListResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadTurnsListResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -26401,11 +40475,20 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -26414,65 +40497,80 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadTurnsListResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), - status: V2ThreadStartResponse__CommandExecutionStatus, + status: V2ThreadTurnsListResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadStartResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadTurnsListResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadStartResponse__PatchApplyStatus, + status: V2ThreadTurnsListResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ appContext: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__McpToolCallAppContext, Schema.Null]), + Schema.Union([V2ThreadTurnsListResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadTurnsListResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadTurnsListResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadStartResponse__McpToolCallStatus, + status: V2ThreadTurnsListResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadStartResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadTurnsListResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -26481,21 +40579,22 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadStartResponse__DynamicToolCallStatus, + status: V2ThreadTurnsListResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadStartResponse__CollabAgentState).annotate({ - description: "Last known status of the target agents, when available.", - }), + agentsStates: Schema.Record( + Schema.String, + V2ThreadTurnsListResponse__CollabAgentState, + ).annotate({ description: "Last known status of the target agents, when available." }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -26514,7 +40613,7 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadTurnsListResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -26525,20 +40624,14 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadTurnsListResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadTurnsListResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -26547,20 +40640,20 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( agentPath: Schema.String, agentThreadId: Schema.String, id: Schema.String, - kind: V2ThreadStartResponse__SubAgentActivityKind, + kind: V2ThreadTurnsListResponse__SubAgentActivityKind, type: Schema.Literal("subAgentActivity").annotate({ title: "SubAgentActivityThreadItemType", }), }).annotate({ title: "SubAgentActivityThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadTurnsListResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -26571,13 +40664,17 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: V2ThreadStartResponse__LegacyAppPathString, + path: V2ThreadTurnsListResponse__LegacyAppPathString, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -26585,13 +40682,17 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), savedPath: Schema.optionalKey( - Schema.Union([V2ThreadStartResponse__AbsolutePathBuf, Schema.Null]), + Schema.Union([V2ThreadTurnsListResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -26616,20 +40717,7 @@ export const V2ThreadStartResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type V2ThreadUnarchiveResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadUnarchiveResponse__CodexErrorInfo | null; - readonly message: string; -}; -export const V2ThreadUnarchiveResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadUnarchiveResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); +).annotate({ identifier: "V2ThreadTurnsListResponse__ThreadItem" }); export type V2ThreadUnarchiveResponse__ThreadItem = | { @@ -26644,17 +40732,21 @@ export type V2ThreadUnarchiveResponse__ThreadItem = readonly type: "hookPrompt"; } | { + readonly delivery?: V2ThreadUnarchiveResponse__AgentMessageDelivery | null; readonly id: string; readonly memoryCitation?: V2ThreadUnarchiveResponse__MemoryCitation | null; readonly phase?: V2ThreadUnarchiveResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2ThreadUnarchiveResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -26666,12 +40758,14 @@ export type V2ThreadUnarchiveResponse__ThreadItem = readonly aggregatedOutput?: string | null; readonly command: string; readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly cwd: V2ThreadUnarchiveResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; + readonly scriptPath?: string | null; + readonly source?: V2ThreadUnarchiveResponse__CommandExecutionSource; readonly status: V2ThreadUnarchiveResponse__CommandExecutionStatus; readonly type: "commandExecution"; } @@ -26683,12 +40777,14 @@ export type V2ThreadUnarchiveResponse__ThreadItem = } | { readonly appContext?: V2ThreadUnarchiveResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly durationMs?: number | null; readonly error?: V2ThreadUnarchiveResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2ThreadUnarchiveResponse__McpAppUi | null; readonly pluginId?: string | null; + readonly readOnlyHint?: boolean | null; readonly result?: V2ThreadUnarchiveResponse__McpToolCallResult | null; readonly server: string; readonly status: V2ThreadUnarchiveResponse__McpToolCallStatus; @@ -26696,7 +40792,7 @@ export type V2ThreadUnarchiveResponse__ThreadItem = readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; @@ -26714,17 +40810,8 @@ export type V2ThreadUnarchiveResponse__ThreadItem = readonly reasoningEffort?: V2ThreadUnarchiveResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2ThreadUnarchiveResponse__CollabAgentToolCallStatus; + readonly tool: V2ThreadUnarchiveResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { @@ -26738,7 +40825,7 @@ export type V2ThreadUnarchiveResponse__ThreadItem = readonly action?: V2ThreadUnarchiveResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { @@ -26748,11 +40835,13 @@ export type V2ThreadUnarchiveResponse__ThreadItem = } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2ThreadUnarchiveResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; readonly savedPath?: V2ThreadUnarchiveResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } @@ -26772,6 +40861,9 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( Schema.Union([V2ThreadUnarchiveResponse__MemoryCitation, Schema.Null]), @@ -26779,21 +40871,24 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( phase: Schema.optionalKey( Schema.Union([V2ThreadUnarchiveResponse__MessagePhase, Schema.Null]), ), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), + Schema.Array(V2ThreadUnarchiveResponse__AsyncUserInputQuestion), Schema.Null, ]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2ThreadUnarchiveResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -26823,13 +40918,16 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -26838,11 +40936,20 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -26851,13 +40958,20 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), status: V2ThreadUnarchiveResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ @@ -26874,13 +40988,13 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( appContext: Schema.optionalKey( Schema.Union([V2ThreadUnarchiveResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -26891,12 +41005,20 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( Schema.Union([V2ThreadUnarchiveResponse__McpToolCallResult, Schema.Null]), ), @@ -26906,7 +41028,7 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ Schema.Array(V2ThreadUnarchiveResponse__DynamicToolCallOutputContentItem), @@ -26918,7 +41040,7 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -26963,20 +41085,14 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -26998,7 +41114,7 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -27014,8 +41130,12 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -27023,6 +41143,9 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -27030,6 +41153,7 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( Schema.Union([V2ThreadUnarchiveResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -27054,20 +41178,7 @@ export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type V2TurnCompletedNotification__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2TurnCompletedNotification__CodexErrorInfo | null; - readonly message: string; -}; -export const V2TurnCompletedNotification__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2TurnCompletedNotification__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); +).annotate({ identifier: "V2ThreadUnarchiveResponse__ThreadItem" }); export type V2TurnCompletedNotification__ThreadItem = | { @@ -27082,17 +41193,21 @@ export type V2TurnCompletedNotification__ThreadItem = readonly type: "hookPrompt"; } | { + readonly delivery?: V2TurnCompletedNotification__AgentMessageDelivery | null; readonly id: string; readonly memoryCitation?: V2TurnCompletedNotification__MemoryCitation | null; readonly phase?: V2TurnCompletedNotification__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2TurnCompletedNotification__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -27104,12 +41219,14 @@ export type V2TurnCompletedNotification__ThreadItem = readonly aggregatedOutput?: string | null; readonly command: string; readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly cwd: V2TurnCompletedNotification__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; + readonly scriptPath?: string | null; + readonly source?: V2TurnCompletedNotification__CommandExecutionSource; readonly status: V2TurnCompletedNotification__CommandExecutionStatus; readonly type: "commandExecution"; } @@ -27121,12 +41238,14 @@ export type V2TurnCompletedNotification__ThreadItem = } | { readonly appContext?: V2TurnCompletedNotification__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly durationMs?: number | null; readonly error?: V2TurnCompletedNotification__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2TurnCompletedNotification__McpAppUi | null; readonly pluginId?: string | null; + readonly readOnlyHint?: boolean | null; readonly result?: V2TurnCompletedNotification__McpToolCallResult | null; readonly server: string; readonly status: V2TurnCompletedNotification__McpToolCallStatus; @@ -27134,7 +41253,7 @@ export type V2TurnCompletedNotification__ThreadItem = readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; @@ -27154,17 +41273,8 @@ export type V2TurnCompletedNotification__ThreadItem = readonly reasoningEffort?: V2TurnCompletedNotification__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2TurnCompletedNotification__CollabAgentToolCallStatus; + readonly tool: V2TurnCompletedNotification__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { @@ -27178,7 +41288,7 @@ export type V2TurnCompletedNotification__ThreadItem = readonly action?: V2TurnCompletedNotification__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { @@ -27188,11 +41298,13 @@ export type V2TurnCompletedNotification__ThreadItem = } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2TurnCompletedNotification__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; readonly savedPath?: V2TurnCompletedNotification__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } @@ -27212,6 +41324,9 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( Schema.Union([V2TurnCompletedNotification__MemoryCitation, Schema.Null]), @@ -27219,21 +41334,24 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( phase: Schema.optionalKey( Schema.Union([V2TurnCompletedNotification__MessagePhase, Schema.Null]), ), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), + Schema.Array(V2TurnCompletedNotification__AsyncUserInputQuestion), Schema.Null, ]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2TurnCompletedNotification__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -27263,13 +41381,16 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2TurnCompletedNotification__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -27278,11 +41399,20 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -27291,13 +41421,20 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2TurnCompletedNotification__CommandExecutionSource, + ).annotate({ default: "agent" }), ), status: V2TurnCompletedNotification__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ @@ -27314,13 +41451,13 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( appContext: Schema.optionalKey( Schema.Union([V2TurnCompletedNotification__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -27331,12 +41468,20 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( Schema.Union([V2TurnCompletedNotification__McpToolCallResult, Schema.Null]), ), @@ -27346,7 +41491,7 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ Schema.Array(V2TurnCompletedNotification__DynamicToolCallOutputContentItem), @@ -27358,7 +41503,7 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -27403,20 +41548,14 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2TurnCompletedNotification__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2TurnCompletedNotification__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -27438,7 +41577,7 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -27454,8 +41593,12 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -27463,6 +41606,9 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2TurnCompletedNotification__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -27470,6 +41616,7 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( Schema.Union([V2TurnCompletedNotification__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -27494,20 +41641,7 @@ export const V2TurnCompletedNotification__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); - -export type V2TurnStartedNotification__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2TurnStartedNotification__CodexErrorInfo | null; - readonly message: string; -}; -export const V2TurnStartedNotification__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2TurnStartedNotification__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); +).annotate({ identifier: "V2TurnCompletedNotification__ThreadItem" }); export type V2TurnStartedNotification__ThreadItem = | { @@ -27522,17 +41656,21 @@ export type V2TurnStartedNotification__ThreadItem = readonly type: "hookPrompt"; } | { + readonly delivery?: V2TurnStartedNotification__AgentMessageDelivery | null; readonly id: string; readonly memoryCitation?: V2TurnStartedNotification__MemoryCitation | null; readonly phase?: V2TurnStartedNotification__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2TurnStartedNotification__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -27544,12 +41682,14 @@ export type V2TurnStartedNotification__ThreadItem = readonly aggregatedOutput?: string | null; readonly command: string; readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly cwd: V2TurnStartedNotification__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; + readonly scriptPath?: string | null; + readonly source?: V2TurnStartedNotification__CommandExecutionSource; readonly status: V2TurnStartedNotification__CommandExecutionStatus; readonly type: "commandExecution"; } @@ -27561,12 +41701,14 @@ export type V2TurnStartedNotification__ThreadItem = } | { readonly appContext?: V2TurnStartedNotification__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly durationMs?: number | null; readonly error?: V2TurnStartedNotification__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2TurnStartedNotification__McpAppUi | null; readonly pluginId?: string | null; + readonly readOnlyHint?: boolean | null; readonly result?: V2TurnStartedNotification__McpToolCallResult | null; readonly server: string; readonly status: V2TurnStartedNotification__McpToolCallStatus; @@ -27574,7 +41716,7 @@ export type V2TurnStartedNotification__ThreadItem = readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; @@ -27592,17 +41734,8 @@ export type V2TurnStartedNotification__ThreadItem = readonly reasoningEffort?: V2TurnStartedNotification__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2TurnStartedNotification__CollabAgentToolCallStatus; + readonly tool: V2TurnStartedNotification__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { @@ -27616,7 +41749,7 @@ export type V2TurnStartedNotification__ThreadItem = readonly action?: V2TurnStartedNotification__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { @@ -27626,11 +41759,13 @@ export type V2TurnStartedNotification__ThreadItem = } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2TurnStartedNotification__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; readonly savedPath?: V2TurnStartedNotification__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } @@ -27650,6 +41785,9 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( Schema.Union([V2TurnStartedNotification__MemoryCitation, Schema.Null]), @@ -27657,21 +41795,24 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( phase: Schema.optionalKey( Schema.Union([V2TurnStartedNotification__MessagePhase, Schema.Null]), ), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), + Schema.Array(V2TurnStartedNotification__AsyncUserInputQuestion), Schema.Null, ]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2TurnStartedNotification__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -27701,13 +41842,16 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2TurnStartedNotification__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -27716,11 +41860,20 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -27729,13 +41882,20 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2TurnStartedNotification__CommandExecutionSource, + ).annotate({ default: "agent" }), ), status: V2TurnStartedNotification__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ @@ -27752,13 +41912,13 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( appContext: Schema.optionalKey( Schema.Union([V2TurnStartedNotification__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -27769,12 +41929,20 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( Schema.Union([V2TurnStartedNotification__McpToolCallResult, Schema.Null]), ), @@ -27784,7 +41952,7 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ Schema.Array(V2TurnStartedNotification__DynamicToolCallOutputContentItem), @@ -27796,7 +41964,7 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -27841,20 +42009,14 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2TurnStartedNotification__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2TurnStartedNotification__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -27876,7 +42038,7 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -27892,8 +42054,12 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -27901,6 +42067,9 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2TurnStartedNotification__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -27908,6 +42077,7 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( Schema.Union([V2TurnStartedNotification__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -27932,20 +42102,18 @@ export const V2TurnStartedNotification__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnStartedNotification__ThreadItem" }); -export type V2TurnStartResponse__TurnError = { - readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2TurnStartResponse__CodexErrorInfo | null; - readonly message: string; +export type V2TurnStartParams__TurnToolOutput = { + readonly name: string; + readonly namespace?: string | null; + readonly output: V2TurnStartParams__FunctionCallOutputBody; }; -export const V2TurnStartResponse__TurnError = Schema.Struct({ - additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - codexErrorInfo: Schema.optionalKey( - Schema.Union([V2TurnStartResponse__CodexErrorInfo, Schema.Null]), - ), - message: Schema.String, -}); +export const V2TurnStartParams__TurnToolOutput = Schema.Struct({ + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2TurnStartParams__FunctionCallOutputBody, +}).annotate({ identifier: "V2TurnStartParams__TurnToolOutput" }); export type V2TurnStartResponse__ThreadItem = | { @@ -27960,17 +42128,21 @@ export type V2TurnStartResponse__ThreadItem = readonly type: "hookPrompt"; } | { + readonly delivery?: V2TurnStartResponse__AgentMessageDelivery | null; readonly id: string; readonly memoryCitation?: V2TurnStartResponse__MemoryCitation | null; readonly phase?: V2TurnStartResponse__MessagePhase | null; + readonly questions?: ReadonlyArray | null; readonly text: string; - readonly delivery?: "async" | null; - readonly questions?: ReadonlyArray<{ - readonly title: string; - readonly options?: ReadonlyArray | null; - }> | null; readonly type: "agentMessage"; } + | { + readonly id: string; + readonly name: string; + readonly namespace?: string | null; + readonly output: V2TurnStartResponse__FunctionCallOutputBody; + readonly type: "functionCallOutput"; + } | { readonly id: string; readonly text: string; readonly type: "plan" } | { readonly content?: ReadonlyArray; @@ -27982,12 +42154,14 @@ export type V2TurnStartResponse__ThreadItem = readonly aggregatedOutput?: string | null; readonly command: string; readonly commandActions: ReadonlyArray; - readonly cwd: string; + readonly cwd: V2TurnStartResponse__LegacyAppPathString; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; + readonly pluginId?: string | null; readonly processId?: string | null; - readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; + readonly scriptPath?: string | null; + readonly source?: V2TurnStartResponse__CommandExecutionSource; readonly status: V2TurnStartResponse__CommandExecutionStatus; readonly type: "commandExecution"; } @@ -27999,12 +42173,14 @@ export type V2TurnStartResponse__ThreadItem = } | { readonly appContext?: V2TurnStartResponse__McpToolCallAppContext | null; - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly durationMs?: number | null; readonly error?: V2TurnStartResponse__McpToolCallError | null; readonly id: string; readonly mcpAppResourceUri?: string | null; + readonly mcpAppUi?: V2TurnStartResponse__McpAppUi | null; readonly pluginId?: string | null; + readonly readOnlyHint?: boolean | null; readonly result?: V2TurnStartResponse__McpToolCallResult | null; readonly server: string; readonly status: V2TurnStartResponse__McpToolCallStatus; @@ -28012,7 +42188,7 @@ export type V2TurnStartResponse__ThreadItem = readonly type: "mcpToolCall"; } | { - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; @@ -28030,17 +42206,8 @@ export type V2TurnStartResponse__ThreadItem = readonly reasoningEffort?: V2TurnStartResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; - readonly status: "inProgress" | "completed" | "failed" | "interrupted"; - readonly tool: - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; + readonly status: V2TurnStartResponse__CollabAgentToolCallStatus; + readonly tool: V2TurnStartResponse__CollabAgentTool; readonly type: "collabAgentToolCall"; } | { @@ -28054,7 +42221,7 @@ export type V2TurnStartResponse__ThreadItem = readonly action?: V2TurnStartResponse__WebSearchAction | null; readonly id: string; readonly query: string; - readonly results?: ReadonlyArray | null; + readonly results?: ReadonlyArray | null; readonly type: "webSearch"; } | { @@ -28064,11 +42231,13 @@ export type V2TurnStartResponse__ThreadItem = } | { readonly durationMs: number; readonly id: string; readonly type: "sleep" } | { + readonly failure?: V2TurnStartResponse__ImageGenerationFailure | null; readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; readonly savedPath?: V2TurnStartResponse__AbsolutePathBuf | null; readonly status: string; + readonly transparentBackground?: boolean | null; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } @@ -28088,26 +42257,29 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ + delivery: Schema.optionalKey( + Schema.Union([V2TurnStartResponse__AgentMessageDelivery, Schema.Null]), + ), id: Schema.String, memoryCitation: Schema.optionalKey( Schema.Union([V2TurnStartResponse__MemoryCitation, Schema.Null]), ), phase: Schema.optionalKey(Schema.Union([V2TurnStartResponse__MessagePhase, Schema.Null])), - text: Schema.String, - delivery: Schema.optionalKey(Schema.Union([Schema.Literal("async"), Schema.Null])), questions: Schema.optionalKey( - Schema.Union([ - Schema.Array( - Schema.Struct({ - title: Schema.String, - options: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), - }), - ), - Schema.Null, - ]), + Schema.Union([Schema.Array(V2TurnStartResponse__AsyncUserInputQuestion), Schema.Null]), ), + text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + name: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + output: V2TurnStartResponse__FunctionCallOutputBody, + type: Schema.Literal("functionCallOutput").annotate({ + title: "FunctionCallOutputThreadItemType", + }), + }).annotate({ title: "FunctionCallOutputThreadItem" }), Schema.Struct({ id: Schema.String, text: Schema.String, @@ -28137,13 +42309,16 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.suspend( + (): Schema.Codec => + V2TurnStartResponse__LegacyAppPathString, + ).annotate({ description: "The command's working directory." }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the command execution in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -28152,11 +42327,20 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The command's exit code.", format: "int32", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), id: Schema.String, + pluginId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Trusted first-party plugin id when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), processId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -28165,13 +42349,20 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( Schema.Null, ]), ), + scriptPath: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Safe plugin-relative path when this command resolves to one plugin script.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( - Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", - ]).annotate({ default: "agent" }), + Schema.suspend( + (): Schema.Codec => + V2TurnStartResponse__CommandExecutionSource, + ).annotate({ default: "agent" }), ), status: V2TurnStartResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ @@ -28188,13 +42379,13 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( appContext: Schema.optionalKey( Schema.Union([V2TurnStartResponse__McpToolCallAppContext, Schema.Null]), ), - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "The duration of the MCP tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -28203,12 +42394,20 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( mcpAppResourceUri: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Deprecated: use `appContext.resourceUri` instead.", + description: + "Legacy compatibility field; prefer `mcpAppUi.resourceUri` when available.", }), Schema.Null, ]), ), + mcpAppUi: Schema.optionalKey( + Schema.Union([V2TurnStartResponse__McpAppUi, Schema.Null]).annotate({ + description: + "Presentation captured from the invoked descriptor; absent in older history.", + }), + ), pluginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + readOnlyHint: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), result: Schema.optionalKey( Schema.Union([V2TurnStartResponse__McpToolCallResult, Schema.Null]), ), @@ -28218,7 +42417,7 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), contentItems: Schema.optionalKey( Schema.Union([ Schema.Array(V2TurnStartResponse__DynamicToolCallOutputContentItem), @@ -28230,7 +42429,7 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( Schema.Number.annotate({ description: "The duration of the dynamic tool call in milliseconds.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -28274,20 +42473,14 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( senderThreadId: Schema.String.annotate({ description: "Thread ID of the agent issuing the collab request.", }), - status: Schema.Literals(["inProgress", "completed", "failed", "interrupted"]).annotate({ - description: "Current status of the collab tool call.", - }), - tool: Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", - ]).annotate({ description: "Name of the collab tool that was invoked." }), + status: Schema.suspend( + (): Schema.Codec => + V2TurnStartResponse__CollabAgentToolCallStatus, + ).annotate({ description: "Current status of the collab tool call." }), + tool: Schema.suspend( + (): Schema.Codec => + V2TurnStartResponse__CollabAgentTool, + ).annotate({ description: "Name of the collab tool that was invoked." }), type: Schema.Literal("collabAgentToolCall").annotate({ title: "CollabAgentToolCallThreadItemType", }), @@ -28307,7 +42500,7 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( query: Schema.String, results: Schema.optionalKey( Schema.Union([ - Schema.Array(Schema.Unknown).annotate({ + Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.", }), @@ -28323,8 +42516,12 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ durationMs: Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), id: Schema.String, type: Schema.Literal("sleep").annotate({ title: "SleepThreadItemType" }), }).annotate({ @@ -28332,6 +42529,9 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( description: "Display item emitted by the interruptible `clock.sleep` tool.", }), Schema.Struct({ + failure: Schema.optionalKey( + Schema.Union([V2TurnStartResponse__ImageGenerationFailure, Schema.Null]), + ), id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -28339,6 +42539,7 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( Schema.Union([V2TurnStartResponse__AbsolutePathBuf, Schema.Null]), ), status: Schema.String, + transparentBackground: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), Schema.Struct({ @@ -28363,200 +42564,275 @@ export const V2TurnStartResponse__ThreadItem = Schema.Union( }).annotate({ title: "ContextCompactionThreadItem" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "V2TurnStartResponse__ThreadItem" }); -export type ClientRequest__ExternalAgentConfigImportParams = { - readonly migrationItems: ReadonlyArray; - readonly migrationSource?: string | null; - readonly source?: string | null; +export type ClientRequest__TurnStartParams = { + readonly approvalPolicy?: ClientRequest__AskForApproval | null; + readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; + readonly clientUserMessageId?: string | null; + readonly cwd?: string | null; + readonly disabledPluginIds?: ReadonlyArray | null; + readonly effort?: ClientRequest__ReasoningEffort | null; + readonly input: ReadonlyArray; + readonly model?: string | null; + readonly outputSchema?: Schema.Json; + readonly personality?: ClientRequest__Personality | null; + readonly sandboxPolicy?: ClientRequest__SandboxPolicy | null; + readonly serviceTier?: string | null; + readonly serviceTierForTurn?: string | null; + readonly summary?: ClientRequest__ReasoningSummary | null; + readonly threadId: string; + readonly toolOutput?: ClientRequest__TurnToolOutput | null; + readonly turnTrigger?: string | null; }; -export const ClientRequest__ExternalAgentConfigImportParams = Schema.Struct({ - migrationItems: Schema.Array(ClientRequest__ExternalAgentConfigMigrationItem), - migrationSource: Schema.optionalKey( +export const ClientRequest__TurnStartParams = Schema.Struct({ + approvalPolicy: Schema.optionalKey( + Schema.Union([ClientRequest__AskForApproval, Schema.Null]).annotate({ + description: "Override the approval policy for this turn and subsequent turns.", + }), + ), + approvalsReviewer: Schema.optionalKey( + Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ + description: + "Override where approval requests are routed for review on this turn and subsequent turns.", + }), + ), + clientUserMessageId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + cwd: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ + description: "Override the working directory for this turn and subsequent turns.", + }), + Schema.Null, + ]), + ), + disabledPluginIds: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ description: - "Migration-source selector used to produce the migration items. Pass the same value to detection and import; missing or unrecognized values use the default source.", + "Replace this thread's disabled plugin IDs. Omitted/null preserves the list; [] clears it.", }), Schema.Null, ]), ), - source: Schema.optionalKey( + effort: Schema.optionalKey( + Schema.Union([ClientRequest__ReasoningEffort, Schema.Null]).annotate({ + description: "Override the reasoning effort for this turn and subsequent turns.", + }), + ), + input: Schema.Array(ClientRequest__UserInput), + model: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional identifier for the product that initiated the import.", + description: "Override the model for this turn and subsequent turns.", }), Schema.Null, ]), ), -}); - -export type CommandExecutionRequestApprovalParams__FileSystemSandboxEntry = { - readonly access: CommandExecutionRequestApprovalParams__FileSystemAccessMode; - readonly path: CommandExecutionRequestApprovalParams__FileSystemPath; -}; -export const CommandExecutionRequestApprovalParams__FileSystemSandboxEntry = Schema.Struct({ - access: CommandExecutionRequestApprovalParams__FileSystemAccessMode, - path: CommandExecutionRequestApprovalParams__FileSystemPath, -}); - -export type McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema = - | McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema - | McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema; -export const McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema = Schema.Union([ - McpServerElicitationRequestParams__McpElicitationUntitledMultiSelectEnumSchema, - McpServerElicitationRequestParams__McpElicitationTitledMultiSelectEnumSchema, -]); - -export type PermissionsRequestApprovalParams__FileSystemSandboxEntry = { - readonly access: PermissionsRequestApprovalParams__FileSystemAccessMode; - readonly path: PermissionsRequestApprovalParams__FileSystemPath; -}; -export const PermissionsRequestApprovalParams__FileSystemSandboxEntry = Schema.Struct({ - access: PermissionsRequestApprovalParams__FileSystemAccessMode, - path: PermissionsRequestApprovalParams__FileSystemPath, -}); - -export type PermissionsRequestApprovalResponse__FileSystemSandboxEntry = { - readonly access: PermissionsRequestApprovalResponse__FileSystemAccessMode; - readonly path: PermissionsRequestApprovalResponse__FileSystemPath; -}; -export const PermissionsRequestApprovalResponse__FileSystemSandboxEntry = Schema.Struct({ - access: PermissionsRequestApprovalResponse__FileSystemAccessMode, - path: PermissionsRequestApprovalResponse__FileSystemPath, -}); - -export type ServerNotification__AppListUpdatedNotification = { - readonly data: ReadonlyArray; -}; -export const ServerNotification__AppListUpdatedNotification = Schema.Struct({ - data: Schema.Array(ServerNotification__AppInfo), -}).annotate({ description: "EXPERIMENTAL - notification emitted when the app list changes." }); - -export type ServerNotification__ExternalAgentConfigImportCompletedNotification = { - readonly importId: string; - readonly itemTypeResults: ReadonlyArray; -}; -export const ServerNotification__ExternalAgentConfigImportCompletedNotification = Schema.Struct({ - importId: Schema.String, - itemTypeResults: Schema.Array(ServerNotification__ExternalAgentConfigImportTypeResult), -}); - -export type ServerNotification__ExternalAgentConfigImportProgressNotification = { - readonly importId: string; - readonly itemTypeResults: ReadonlyArray; -}; -export const ServerNotification__ExternalAgentConfigImportProgressNotification = Schema.Struct({ - importId: Schema.String, - itemTypeResults: Schema.Array(ServerNotification__ExternalAgentConfigImportTypeResult), -}); - -export type ServerNotification__HookCompletedNotification = { - readonly run: ServerNotification__HookRunSummary; - readonly threadId: string; - readonly turnId?: string | null; -}; -export const ServerNotification__HookCompletedNotification = Schema.Struct({ - run: ServerNotification__HookRunSummary, - threadId: Schema.String, - turnId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type ServerNotification__HookStartedNotification = { - readonly run: ServerNotification__HookRunSummary; - readonly threadId: string; - readonly turnId?: string | null; -}; -export const ServerNotification__HookStartedNotification = Schema.Struct({ - run: ServerNotification__HookRunSummary, + outputSchema: Schema.optionalKey( + Schema.Json.annotate({ + expected: "JSON value", + description: + "Optional JSON Schema used to constrain the final assistant message for this turn.", + }), + ), + personality: Schema.optionalKey( + Schema.Union([ClientRequest__Personality, Schema.Null]).annotate({ + description: + "@deprecated `friendly` and `pragmatic` no longer select a style. Changing this does not rewrite the thread's existing instructions.", + }), + ), + sandboxPolicy: Schema.optionalKey( + Schema.Union([ClientRequest__SandboxPolicy, Schema.Null]).annotate({ + description: "Override the sandbox policy for this turn and subsequent turns.", + }), + ), + serviceTier: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Override the service tier for this turn and subsequent turns.", + }), + Schema.Null, + ]), + ), + serviceTierForTurn: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Override the service tier only when this request starts a new turn. Use \"default\" for standard speed. Omitted or null inherits the thread's tier. Does not change the thread's tier or a turn being steered.", + }), + Schema.Null, + ]), + ), + summary: Schema.optionalKey( + Schema.Union([ClientRequest__ReasoningSummary, Schema.Null]).annotate({ + description: "Override the reasoning summary for this turn and subsequent turns.", + }), + ), threadId: Schema.String, - turnId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); + toolOutput: Schema.optionalKey(Schema.Union([ClientRequest__TurnToolOutput, Schema.Null])), + turnTrigger: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional source classification for the caller that starts this turn. Ignored when this request steers an already-active turn.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ClientRequest__TurnStartParams" }); -export type ServerNotification__FileSystemSandboxEntry = { - readonly access: ServerNotification__FileSystemAccessMode; - readonly path: ServerNotification__FileSystemPath; +export type CommandExecutionRequestApprovalParams__AdditionalFileSystemPermissions = { + readonly entries?: ReadonlyArray | null; + readonly globScanMaxDepth?: number | null; + readonly read?: ReadonlyArray | null; + readonly write?: ReadonlyArray | null; }; -export const ServerNotification__FileSystemSandboxEntry = Schema.Struct({ - access: ServerNotification__FileSystemAccessMode, - path: ServerNotification__FileSystemPath, +export const CommandExecutionRequestApprovalParams__AdditionalFileSystemPermissions = Schema.Struct( + { + entries: Schema.optionalKey( + Schema.Union([ + Schema.Array(CommandExecutionRequestApprovalParams__FileSystemSandboxEntry), + Schema.Null, + ]), + ), + globScanMaxDepth: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ), + Schema.Null, + ]), + ), + read: Schema.optionalKey( + Schema.Union([ + Schema.Array(CommandExecutionRequestApprovalParams__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), + write: Schema.optionalKey( + Schema.Union([ + Schema.Array(CommandExecutionRequestApprovalParams__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), + }, +).annotate({ + identifier: "CommandExecutionRequestApprovalParams__AdditionalFileSystemPermissions", }); -export type ServerNotification__ErrorNotification = { - readonly error: ServerNotification__TurnError; - readonly threadId: string; - readonly turnId: string; - readonly willRetry: boolean; -}; -export const ServerNotification__ErrorNotification = Schema.Struct({ - error: ServerNotification__TurnError, - threadId: Schema.String, - turnId: Schema.String, - willRetry: Schema.Boolean, -}); +export type McpServerElicitationRequestParams__McpElicitationEnumSchema = + | McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema + | McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema + | McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema; +export const McpServerElicitationRequestParams__McpElicitationEnumSchema = Schema.Union([ + McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema, + McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema, + McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema, +]).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationEnumSchema" }); -export type ServerNotification__ThreadSettings = { - readonly activePermissionProfile?: ServerNotification__ActivePermissionProfile | null; - readonly approvalPolicy: ServerNotification__AskForApproval; - readonly approvalsReviewer: ServerNotification__ApprovalsReviewer; - readonly collaborationMode: ServerNotification__CollaborationMode; - readonly cwd: ServerNotification__AbsolutePathBuf; - readonly effort?: ServerNotification__ReasoningEffort | null; - readonly model: string; - readonly modelProvider: string; - readonly personality?: ServerNotification__Personality | null; - readonly sandboxPolicy: ServerNotification__SandboxPolicy; - readonly serviceTier?: string | null; - readonly summary?: ServerNotification__ReasoningSummary | null; +export type PermissionsRequestApprovalParams__AdditionalFileSystemPermissions = { + readonly entries?: ReadonlyArray | null; + readonly globScanMaxDepth?: number | null; + readonly read?: ReadonlyArray | null; + readonly write?: ReadonlyArray | null; }; -export const ServerNotification__ThreadSettings = Schema.Struct({ - activePermissionProfile: Schema.optionalKey( - Schema.Union([ServerNotification__ActivePermissionProfile, Schema.Null]), +export const PermissionsRequestApprovalParams__AdditionalFileSystemPermissions = Schema.Struct({ + entries: Schema.optionalKey( + Schema.Union([ + Schema.Array(PermissionsRequestApprovalParams__FileSystemSandboxEntry), + Schema.Null, + ]), + ), + globScanMaxDepth: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ), + Schema.Null, + ]), ), - approvalPolicy: ServerNotification__AskForApproval, - approvalsReviewer: ServerNotification__ApprovalsReviewer, - collaborationMode: ServerNotification__CollaborationMode, - cwd: ServerNotification__AbsolutePathBuf, - effort: Schema.optionalKey(Schema.Union([ServerNotification__ReasoningEffort, Schema.Null])), - model: Schema.String, - modelProvider: Schema.String, - personality: Schema.optionalKey(Schema.Union([ServerNotification__Personality, Schema.Null])), - sandboxPolicy: ServerNotification__SandboxPolicy, - serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - summary: Schema.optionalKey(Schema.Union([ServerNotification__ReasoningSummary, Schema.Null])), -}); + read: Schema.optionalKey( + Schema.Union([ + Schema.Array(PermissionsRequestApprovalParams__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), + write: Schema.optionalKey( + Schema.Union([ + Schema.Array(PermissionsRequestApprovalParams__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "PermissionsRequestApprovalParams__AdditionalFileSystemPermissions" }); -export type ServerNotification__ItemCompletedNotification = { - readonly completedAtMs: number; - readonly item: ServerNotification__ThreadItem; - readonly threadId: string; - readonly turnId: string; +export type PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions = { + readonly entries?: ReadonlyArray | null; + readonly globScanMaxDepth?: number | null; + readonly read?: ReadonlyArray | null; + readonly write?: ReadonlyArray | null; }; -export const ServerNotification__ItemCompletedNotification = Schema.Struct({ - completedAtMs: Schema.Number.annotate({ - description: "Unix timestamp (in milliseconds) when this item lifecycle completed.", - format: "int64", - }).check(Schema.isInt()), - item: ServerNotification__ThreadItem, - threadId: Schema.String, - turnId: Schema.String, -}); +export const PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions = Schema.Struct({ + entries: Schema.optionalKey( + Schema.Union([ + Schema.Array(PermissionsRequestApprovalResponse__FileSystemSandboxEntry), + Schema.Null, + ]), + ), + globScanMaxDepth: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ), + Schema.Null, + ]), + ), + read: Schema.optionalKey( + Schema.Union([ + Schema.Array(PermissionsRequestApprovalResponse__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), + write: Schema.optionalKey( + Schema.Union([ + Schema.Array(PermissionsRequestApprovalResponse__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions" }); -export type ServerNotification__ItemStartedNotification = { - readonly item: ServerNotification__ThreadItem; - readonly startedAtMs: number; +export type ServerNotification__ThreadSettingsUpdatedNotification = { readonly threadId: string; - readonly turnId: string; + readonly threadSettings: ServerNotification__ThreadSettings; }; -export const ServerNotification__ItemStartedNotification = Schema.Struct({ - item: ServerNotification__ThreadItem, - startedAtMs: Schema.Number.annotate({ - description: "Unix timestamp (in milliseconds) when this item lifecycle started.", - format: "int64", - }).check(Schema.isInt()), +export const ServerNotification__ThreadSettingsUpdatedNotification = Schema.Struct({ threadId: Schema.String, - turnId: Schema.String, -}); + threadSettings: ServerNotification__ThreadSettings, +}).annotate({ identifier: "ServerNotification__ThreadSettingsUpdatedNotification" }); export type ServerNotification__Turn = { readonly completedAt?: number | null; @@ -28564,7 +42840,7 @@ export type ServerNotification__Turn = { readonly error?: ServerNotification__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: ServerNotification__TurnItemsView; readonly startedAt?: number | null; readonly status: ServerNotification__TurnStatus; }; @@ -28574,7 +42850,7 @@ export const ServerNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -28583,13 +42859,13 @@ export const ServerNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([ServerNotification__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -28599,7 +42875,9 @@ export const ServerNotification__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => ServerNotification__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -28609,36 +42887,143 @@ export const ServerNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: ServerNotification__TurnStatus, -}); +}).annotate({ identifier: "ServerNotification__Turn" }); -export type ServerRequest__FileSystemSandboxEntry = { - readonly access: ServerRequest__FileSystemAccessMode; - readonly path: ServerRequest__FileSystemPath; +export type ServerNotification__ItemStartedNotification = { + readonly item: ServerNotification__ThreadItem; + readonly startedAtMs: number; + readonly threadId: string; + readonly turnId: string; }; -export const ServerRequest__FileSystemSandboxEntry = Schema.Struct({ - access: ServerRequest__FileSystemAccessMode, - path: ServerRequest__FileSystemPath, -}); +export const ServerNotification__ItemStartedNotification = Schema.Struct({ + item: ServerNotification__ThreadItem, + startedAtMs: Schema.Number.annotate({ + description: "Unix timestamp (in milliseconds) when this item lifecycle started.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__ItemStartedNotification" }); -export type ServerRequest__McpElicitationMultiSelectEnumSchema = - | ServerRequest__McpElicitationUntitledMultiSelectEnumSchema - | ServerRequest__McpElicitationTitledMultiSelectEnumSchema; -export const ServerRequest__McpElicitationMultiSelectEnumSchema = Schema.Union([ - ServerRequest__McpElicitationUntitledMultiSelectEnumSchema, - ServerRequest__McpElicitationTitledMultiSelectEnumSchema, -]); +export type ServerNotification__ItemCompletedNotification = { + readonly completedAtMs: number; + readonly item: ServerNotification__ThreadItem; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__ItemCompletedNotification = Schema.Struct({ + completedAtMs: Schema.Number.annotate({ + description: "Unix timestamp (in milliseconds) when this item lifecycle completed.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + item: ServerNotification__ThreadItem, + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ identifier: "ServerNotification__ItemCompletedNotification" }); + +export type ServerNotification__AdditionalFileSystemPermissions = { + readonly entries?: ReadonlyArray | null; + readonly globScanMaxDepth?: number | null; + readonly read?: ReadonlyArray | null; + readonly write?: ReadonlyArray | null; +}; +export const ServerNotification__AdditionalFileSystemPermissions = Schema.Struct({ + entries: Schema.optionalKey( + Schema.Union([Schema.Array(ServerNotification__FileSystemSandboxEntry), Schema.Null]), + ), + globScanMaxDepth: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ), + Schema.Null, + ]), + ), + read: Schema.optionalKey( + Schema.Union([ + Schema.Array(ServerNotification__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), + write: Schema.optionalKey( + Schema.Union([ + Schema.Array(ServerNotification__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ServerNotification__AdditionalFileSystemPermissions" }); + +export type ServerRequest__AdditionalFileSystemPermissions = { + readonly entries?: ReadonlyArray | null; + readonly globScanMaxDepth?: number | null; + readonly read?: ReadonlyArray | null; + readonly write?: ReadonlyArray | null; +}; +export const ServerRequest__AdditionalFileSystemPermissions = Schema.Struct({ + entries: Schema.optionalKey( + Schema.Union([Schema.Array(ServerRequest__FileSystemSandboxEntry), Schema.Null]), + ), + globScanMaxDepth: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ), + Schema.Null, + ]), + ), + read: Schema.optionalKey( + Schema.Union([ + Schema.Array(ServerRequest__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), + write: Schema.optionalKey( + Schema.Union([ + Schema.Array(ServerRequest__LegacyAppPathString).annotate({ + description: "This will be removed in favor of `entries`.", + }), + Schema.Null, + ]), + ), +}).annotate({ identifier: "ServerRequest__AdditionalFileSystemPermissions" }); + +export type ServerRequest__McpElicitationEnumSchema = + | ServerRequest__McpElicitationSingleSelectEnumSchema + | ServerRequest__McpElicitationMultiSelectEnumSchema + | ServerRequest__McpElicitationLegacyTitledEnumSchema; +export const ServerRequest__McpElicitationEnumSchema = Schema.Union([ + ServerRequest__McpElicitationSingleSelectEnumSchema, + ServerRequest__McpElicitationMultiSelectEnumSchema, + ServerRequest__McpElicitationLegacyTitledEnumSchema, +]).annotate({ identifier: "ServerRequest__McpElicitationEnumSchema" }); export type V2ConfigReadResponse__Config = { readonly analytics?: V2ConfigReadResponse__AnalyticsConfig | null; readonly approval_policy?: V2ConfigReadResponse__AskForApproval | null; readonly approvals_reviewer?: V2ConfigReadResponse__ApprovalsReviewer | null; + readonly browser_use?: V2ConfigReadResponse__BrowserUseConfig | null; readonly compact_prompt?: string | null; - readonly desktop?: { readonly [x: string]: unknown } | null; + readonly computer_use?: V2ConfigReadResponse__ComputerUseConfig | null; + readonly desktop?: { readonly [x: string]: Schema.Json } | null; readonly developer_instructions?: string | null; readonly forced_chatgpt_workspace_id?: V2ConfigReadResponse__ForcedChatgptWorkspaceIds | null; readonly forced_login_method?: V2ConfigReadResponse__ForcedLoginMethod | null; @@ -28657,8 +43042,7 @@ export type V2ConfigReadResponse__Config = { readonly service_tier?: string | null; readonly tools?: V2ConfigReadResponse__ToolsV2 | null; readonly web_search?: V2ConfigReadResponse__WebSearchMode | null; - readonly [x: string]: unknown; -}; +} & { readonly [x: string]: Schema.Json }; export const V2ConfigReadResponse__Config = Schema.StructWithRest( Schema.Struct({ analytics: Schema.optionalKey( @@ -28673,9 +43057,18 @@ export const V2ConfigReadResponse__Config = Schema.StructWithRest( "[UNSTABLE] Optional default for where approval requests are routed for review.", }), ), + browser_use: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__BrowserUseConfig, Schema.Null]), + ), compact_prompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + computer_use: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__ComputerUseConfig, Schema.Null]), + ), desktop: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), + Schema.Null, + ]), ), developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), forced_chatgpt_workspace_id: Schema.optionalKey( @@ -28688,7 +43081,9 @@ export const V2ConfigReadResponse__Config = Schema.StructWithRest( model: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), model_auto_compact_token_limit: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), Schema.Null, ]), ), @@ -28697,7 +43092,9 @@ export const V2ConfigReadResponse__Config = Schema.StructWithRest( ), model_context_window: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), Schema.Null, ]), ), @@ -28724,31 +43121,59 @@ export const V2ConfigReadResponse__Config = Schema.StructWithRest( Schema.Union([V2ConfigReadResponse__WebSearchMode, Schema.Null]), ), }), - [Schema.Record(Schema.String, Schema.Unknown)], -); + [Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" }))], +).annotate({ identifier: "V2ConfigReadResponse__Config" }); export type V2ConfigRequirementsReadResponse__ConfigRequirements = { + readonly additionalDeveloperInstructions?: string | null; readonly allowAppshots?: boolean | null; + readonly allowBrowserAndComputerUse?: boolean | null; + readonly allowLoginShell?: boolean | null; readonly allowManagedHooksOnly?: boolean | null; readonly allowRemoteControl?: boolean | null; readonly allowedApprovalPolicies?: ReadonlyArray | null; + readonly allowedLoginMethods?: ReadonlyArray | null; readonly allowedPermissionProfiles?: { readonly [x: string]: boolean } | null; readonly allowedSandboxModes?: ReadonlyArray | null; readonly allowedWebSearchModes?: ReadonlyArray | null; - readonly allowedWindowsSandboxImplementations?: ReadonlyArray | null; + readonly allowedWindowsSandboxImplementations?: ReadonlyArray | null; + readonly autoReview?: V2ConfigRequirementsReadResponse__AutoReviewRequirements | null; + readonly browserUse?: V2ConfigRequirementsReadResponse__BrowserUseRequirements | null; + readonly chatgptBaseUrl?: string | null; + readonly checkForUpdateOnStartup?: boolean | null; + readonly cliAuthCredentialsStore?: V2ConfigRequirementsReadResponse__CliAuthCredentialsStoreMode | null; readonly computerUse?: V2ConfigRequirementsReadResponse__ComputerUseRequirements | null; readonly defaultPermissions?: string | null; readonly enforceResidency?: V2ConfigRequirementsReadResponse__ResidencyRequirement | null; readonly featureRequirements?: { readonly [x: string]: boolean } | null; + readonly feedback?: V2ConfigRequirementsReadResponse__FeedbackRequirements | null; + readonly inAppBrowser?: V2ConfigRequirementsReadResponse__InAppBrowserRequirements | null; + readonly logDir?: string | null; + readonly modelCatalogJson?: string | null; + readonly modelProvider?: string | null; + readonly modelProviders?: { readonly [x: string]: Schema.Json } | null; readonly models?: V2ConfigRequirementsReadResponse__ModelsRequirements | null; + readonly sqliteHome?: string | null; }; export const V2ConfigRequirementsReadResponse__ConfigRequirements = Schema.Struct({ + additionalDeveloperInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), allowAppshots: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + allowBrowserAndComputerUse: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + allowLoginShell: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), allowManagedHooksOnly: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), allowRemoteControl: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), allowedApprovalPolicies: Schema.optionalKey( Schema.Union([Schema.Array(V2ConfigRequirementsReadResponse__AskForApproval), Schema.Null]), ), + allowedLoginMethods: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ConfigRequirementsReadResponse__ForcedLoginMethod).annotate({ + description: + "Effective login methods after managed, forced-login, and workspace restrictions. An empty list permits no login method. Older servers may omit this field.", + }), + Schema.Null, + ]), + ), allowedPermissionProfiles: Schema.optionalKey( Schema.Union([Schema.Record(Schema.String, Schema.Boolean), Schema.Null]), ), @@ -28760,10 +43185,21 @@ export const V2ConfigRequirementsReadResponse__ConfigRequirements = Schema.Struc ), allowedWindowsSandboxImplementations: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ConfigRequirementsReadResponse__WindowsSandboxSetupMode), + Schema.Array(V2ConfigRequirementsReadResponse__WindowsSandboxImplementation), Schema.Null, ]), ), + autoReview: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__AutoReviewRequirements, Schema.Null]), + ), + browserUse: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__BrowserUseRequirements, Schema.Null]), + ), + chatgptBaseUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + checkForUpdateOnStartup: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + cliAuthCredentialsStore: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__CliAuthCredentialsStoreMode, Schema.Null]), + ), computerUse: Schema.optionalKey( Schema.Union([V2ConfigRequirementsReadResponse__ComputerUseRequirements, Schema.Null]), ), @@ -28774,662 +43210,216 @@ export const V2ConfigRequirementsReadResponse__ConfigRequirements = Schema.Struc featureRequirements: Schema.optionalKey( Schema.Union([Schema.Record(Schema.String, Schema.Boolean), Schema.Null]), ), - models: Schema.optionalKey( - Schema.Union([V2ConfigRequirementsReadResponse__ModelsRequirements, Schema.Null]), - ), -}); - -export type V2ConfigWriteResponse__OverriddenMetadata = { - readonly effectiveValue: unknown; - readonly message: string; - readonly overridingLayer: V2ConfigWriteResponse__ConfigLayerMetadata; -}; -export const V2ConfigWriteResponse__OverriddenMetadata = Schema.Struct({ - effectiveValue: Schema.Unknown, - message: Schema.String, - overridingLayer: V2ConfigWriteResponse__ConfigLayerMetadata, -}); - -export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry = { - readonly access: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode; - readonly path: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath; -}; -export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry = - Schema.Struct({ - access: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode, - path: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath, - }); - -export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry = { - readonly access: V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode; - readonly path: V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath; -}; -export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry = - Schema.Struct({ - access: V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode, - path: V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath, - }); - -export type V2PluginInstalledResponse__PluginSummary = { - readonly authPolicy: V2PluginInstalledResponse__PluginAuthPolicy; - readonly availability?: "DISABLED_BY_ADMIN" | "AVAILABLE"; - readonly enabled: boolean; - readonly id: string; - readonly installPolicy: V2PluginInstalledResponse__PluginInstallPolicy; - readonly installPolicySource?: V2PluginInstalledResponse__PluginInstallPolicySource | null; - readonly installed: boolean; - readonly interface?: V2PluginInstalledResponse__PluginInterface | null; - readonly keywords?: ReadonlyArray; - readonly localVersion?: string | null; - readonly mustShowInstallationInterstitial?: boolean | null; - readonly name: string; - readonly remotePluginId?: string | null; - readonly shareContext?: V2PluginInstalledResponse__PluginShareContext | null; - readonly source: V2PluginInstalledResponse__PluginSource; - readonly version?: string | null; -}; -export const V2PluginInstalledResponse__PluginSummary = Schema.Struct({ - authPolicy: V2PluginInstalledResponse__PluginAuthPolicy, - availability: Schema.optionalKey( - Schema.Literals(["DISABLED_BY_ADMIN", "AVAILABLE"]).annotate({ - description: "Availability state for installing and using the plugin.", - default: "AVAILABLE", - }), - ), - enabled: Schema.Boolean, - id: Schema.String, - installPolicy: V2PluginInstalledResponse__PluginInstallPolicy, - installPolicySource: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__PluginInstallPolicySource, Schema.Null]), + feedback: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__FeedbackRequirements, Schema.Null]), ), - installed: Schema.Boolean, - interface: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__PluginInterface, Schema.Null]), + inAppBrowser: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__InAppBrowserRequirements, Schema.Null]), ), - keywords: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), - localVersion: Schema.optionalKey( + logDir: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + modelCatalogJson: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + modelProvider: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Version of the locally materialized plugin package when available.", + description: "Exact provider selection required by managed policy.", }), Schema.Null, ]), ), - mustShowInstallationInterstitial: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - name: Schema.String, - remotePluginId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Backend remote plugin identifier when available." }), - Schema.Null, - ]), - ), - shareContext: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__PluginShareContext, Schema.Null]).annotate({ - description: "Remote sharing context associated with this plugin when available.", - }), - ), - source: V2PluginInstalledResponse__PluginSource, - version: Schema.optionalKey( + modelProviders: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ - description: "Version advertised by the remote marketplace backend when available.", + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })).annotate({ + description: "Complete required provider definitions, using config.toml field names.", }), Schema.Null, ]), ), -}); + models: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__ModelsRequirements, Schema.Null]), + ), + sqliteHome: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ identifier: "V2ConfigRequirementsReadResponse__ConfigRequirements" }); -export type V2PluginListResponse__PluginSummary = { - readonly authPolicy: V2PluginListResponse__PluginAuthPolicy; - readonly availability?: "DISABLED_BY_ADMIN" | "AVAILABLE"; - readonly enabled: boolean; - readonly id: string; - readonly installPolicy: V2PluginListResponse__PluginInstallPolicy; - readonly installPolicySource?: V2PluginListResponse__PluginInstallPolicySource | null; - readonly installed: boolean; - readonly interface?: V2PluginListResponse__PluginInterface | null; - readonly keywords?: ReadonlyArray; - readonly localVersion?: string | null; - readonly mustShowInstallationInterstitial?: boolean | null; - readonly name: string; - readonly remotePluginId?: string | null; - readonly shareContext?: V2PluginListResponse__PluginShareContext | null; - readonly source: V2PluginListResponse__PluginSource; - readonly version?: string | null; +export type V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions = { + readonly entries?: ReadonlyArray | null; + readonly globScanMaxDepth?: number | null; + readonly read?: ReadonlyArray | null; + readonly write?: ReadonlyArray | null; }; -export const V2PluginListResponse__PluginSummary = Schema.Struct({ - authPolicy: V2PluginListResponse__PluginAuthPolicy, - availability: Schema.optionalKey( - Schema.Literals(["DISABLED_BY_ADMIN", "AVAILABLE"]).annotate({ - description: "Availability state for installing and using the plugin.", - default: "AVAILABLE", - }), - ), - enabled: Schema.Boolean, - id: Schema.String, - installPolicy: V2PluginListResponse__PluginInstallPolicy, - installPolicySource: Schema.optionalKey( - Schema.Union([V2PluginListResponse__PluginInstallPolicySource, Schema.Null]), - ), - installed: Schema.Boolean, - interface: Schema.optionalKey(Schema.Union([V2PluginListResponse__PluginInterface, Schema.Null])), - keywords: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), - localVersion: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version of the locally materialized plugin package when available.", - }), - Schema.Null, - ]), - ), - mustShowInstallationInterstitial: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - name: Schema.String, - remotePluginId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Backend remote plugin identifier when available." }), - Schema.Null, - ]), - ), - shareContext: Schema.optionalKey( - Schema.Union([V2PluginListResponse__PluginShareContext, Schema.Null]).annotate({ - description: "Remote sharing context associated with this plugin when available.", - }), - ), - source: V2PluginListResponse__PluginSource, - version: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version advertised by the remote marketplace backend when available.", - }), - Schema.Null, - ]), - ), -}); +export const V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions = + Schema.Struct({ + entries: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry), + Schema.Null, + ]), + ), + globScanMaxDepth: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ), + Schema.Null, + ]), + ), + read: Schema.optionalKey( + Schema.Union([ + Schema.Array( + V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, + ).annotate({ description: "This will be removed in favor of `entries`." }), + Schema.Null, + ]), + ), + write: Schema.optionalKey( + Schema.Union([ + Schema.Array( + V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, + ).annotate({ description: "This will be removed in favor of `entries`." }), + Schema.Null, + ]), + ), + }).annotate({ + identifier: + "V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions", + }); -export type V2PluginReadResponse__PluginSummary = { - readonly authPolicy: V2PluginReadResponse__PluginAuthPolicy; - readonly availability?: "DISABLED_BY_ADMIN" | "AVAILABLE"; - readonly enabled: boolean; - readonly id: string; - readonly installPolicy: V2PluginReadResponse__PluginInstallPolicy; - readonly installPolicySource?: V2PluginReadResponse__PluginInstallPolicySource | null; - readonly installed: boolean; - readonly interface?: V2PluginReadResponse__PluginInterface | null; - readonly keywords?: ReadonlyArray; - readonly localVersion?: string | null; - readonly mustShowInstallationInterstitial?: boolean | null; +export type V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions = { + readonly entries?: ReadonlyArray | null; + readonly globScanMaxDepth?: number | null; + readonly read?: ReadonlyArray | null; + readonly write?: ReadonlyArray | null; +}; +export const V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions = + Schema.Struct({ + entries: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry), + Schema.Null, + ]), + ), + globScanMaxDepth: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(1).annotate({ + expected: "a value greater than or equal to 1", + }), + ), + Schema.Null, + ]), + ), + read: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString).annotate( + { description: "This will be removed in favor of `entries`." }, + ), + Schema.Null, + ]), + ), + write: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString).annotate( + { description: "This will be removed in favor of `entries`." }, + ), + Schema.Null, + ]), + ), + }).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions", + }); + +export type V2PluginInstalledResponse__PluginMarketplaceEntry = { + readonly interface?: V2PluginInstalledResponse__MarketplaceInterface | null; readonly name: string; - readonly remotePluginId?: string | null; - readonly shareContext?: V2PluginReadResponse__PluginShareContext | null; - readonly source: V2PluginReadResponse__PluginSource; - readonly version?: string | null; + readonly path?: V2PluginInstalledResponse__AbsolutePathBuf | null; + readonly plugins: ReadonlyArray; }; -export const V2PluginReadResponse__PluginSummary = Schema.Struct({ - authPolicy: V2PluginReadResponse__PluginAuthPolicy, - availability: Schema.optionalKey( - Schema.Literals(["DISABLED_BY_ADMIN", "AVAILABLE"]).annotate({ - description: "Availability state for installing and using the plugin.", - default: "AVAILABLE", - }), - ), - enabled: Schema.Boolean, - id: Schema.String, - installPolicy: V2PluginReadResponse__PluginInstallPolicy, - installPolicySource: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__PluginInstallPolicySource, Schema.Null]), - ), - installed: Schema.Boolean, - interface: Schema.optionalKey(Schema.Union([V2PluginReadResponse__PluginInterface, Schema.Null])), - keywords: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), - localVersion: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version of the locally materialized plugin package when available.", - }), - Schema.Null, - ]), +export const V2PluginInstalledResponse__PluginMarketplaceEntry = Schema.Struct({ + interface: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__MarketplaceInterface, Schema.Null]), ), - mustShowInstallationInterstitial: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), name: Schema.String, - remotePluginId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Backend remote plugin identifier when available." }), - Schema.Null, - ]), - ), - shareContext: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__PluginShareContext, Schema.Null]).annotate({ - description: "Remote sharing context associated with this plugin when available.", + path: Schema.optionalKey( + Schema.Union([V2PluginInstalledResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: + "Local marketplace file path when the marketplace is backed by a local file. Remote-only catalog marketplaces do not have a local path.", }), ), - source: V2PluginReadResponse__PluginSource, - version: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version advertised by the remote marketplace backend when available.", - }), - Schema.Null, - ]), - ), -}); + plugins: Schema.Array(V2PluginInstalledResponse__PluginSummary), +}).annotate({ identifier: "V2PluginInstalledResponse__PluginMarketplaceEntry" }); -export type V2PluginShareListResponse__PluginSummary = { - readonly authPolicy: V2PluginShareListResponse__PluginAuthPolicy; - readonly availability?: "DISABLED_BY_ADMIN" | "AVAILABLE"; - readonly enabled: boolean; - readonly id: string; - readonly installPolicy: V2PluginShareListResponse__PluginInstallPolicy; - readonly installPolicySource?: V2PluginShareListResponse__PluginInstallPolicySource | null; - readonly installed: boolean; - readonly interface?: V2PluginShareListResponse__PluginInterface | null; - readonly keywords?: ReadonlyArray; - readonly localVersion?: string | null; - readonly mustShowInstallationInterstitial?: boolean | null; +export type V2PluginListResponse__PluginMarketplaceEntry = { + readonly interface?: V2PluginListResponse__MarketplaceInterface | null; readonly name: string; - readonly remotePluginId?: string | null; - readonly shareContext?: V2PluginShareListResponse__PluginShareContext | null; - readonly source: V2PluginShareListResponse__PluginSource; - readonly version?: string | null; + readonly path?: V2PluginListResponse__AbsolutePathBuf | null; + readonly plugins: ReadonlyArray; }; -export const V2PluginShareListResponse__PluginSummary = Schema.Struct({ - authPolicy: V2PluginShareListResponse__PluginAuthPolicy, - availability: Schema.optionalKey( - Schema.Literals(["DISABLED_BY_ADMIN", "AVAILABLE"]).annotate({ - description: "Availability state for installing and using the plugin.", - default: "AVAILABLE", - }), - ), - enabled: Schema.Boolean, - id: Schema.String, - installPolicy: V2PluginShareListResponse__PluginInstallPolicy, - installPolicySource: Schema.optionalKey( - Schema.Union([V2PluginShareListResponse__PluginInstallPolicySource, Schema.Null]), - ), - installed: Schema.Boolean, +export const V2PluginListResponse__PluginMarketplaceEntry = Schema.Struct({ interface: Schema.optionalKey( - Schema.Union([V2PluginShareListResponse__PluginInterface, Schema.Null]), - ), - keywords: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), - localVersion: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version of the locally materialized plugin package when available.", - }), - Schema.Null, - ]), + Schema.Union([V2PluginListResponse__MarketplaceInterface, Schema.Null]), ), - mustShowInstallationInterstitial: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), name: Schema.String, - remotePluginId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Backend remote plugin identifier when available." }), - Schema.Null, - ]), + path: Schema.optionalKey( + Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: + "Local marketplace file path when the marketplace is backed by a local file. Remote-only catalog marketplaces do not have a local path.", + }), ), - shareContext: Schema.optionalKey( - Schema.Union([V2PluginShareListResponse__PluginShareContext, Schema.Null]).annotate({ - description: "Remote sharing context associated with this plugin when available.", + plugins: Schema.Array(V2PluginListResponse__PluginSummary), +}).annotate({ identifier: "V2PluginListResponse__PluginMarketplaceEntry" }); + +export type V2PluginReadResponse__PluginDetail = { + readonly appTemplates: ReadonlyArray; + readonly apps: ReadonlyArray; + readonly description?: string | null; + readonly hooks: ReadonlyArray; + readonly marketplaceName: string; + readonly marketplacePath?: V2PluginReadResponse__AbsolutePathBuf | null; + readonly mcpServers: ReadonlyArray; + readonly onboardingSkill?: V2PluginReadResponse__SkillSummary | null; + readonly scheduledTasks?: ReadonlyArray | null; + readonly shareUrl?: string | null; + readonly skills: ReadonlyArray; + readonly summary: V2PluginReadResponse__PluginSummary; +}; +export const V2PluginReadResponse__PluginDetail = Schema.Struct({ + appTemplates: Schema.Array(V2PluginReadResponse__AppTemplateSummary), + apps: Schema.Array(V2PluginReadResponse__AppSummary), + description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + hooks: Schema.Array(V2PluginReadResponse__PluginHookSummary), + marketplaceName: Schema.String, + marketplacePath: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]), + ), + mcpServers: Schema.Array(Schema.String), + onboardingSkill: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__SkillSummary, Schema.Null]).annotate({ + description: "The declared onboarding skill, when the plugin and visible skill are enabled.", }), ), - source: V2PluginShareListResponse__PluginSource, - version: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Version advertised by the remote marketplace backend when available.", - }), - Schema.Null, - ]), + scheduledTasks: Schema.optionalKey( + Schema.Union([Schema.Array(V2PluginReadResponse__ScheduledTaskSummary), Schema.Null]), ), -}); + shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + skills: Schema.Array(V2PluginReadResponse__SkillSummary), + summary: V2PluginReadResponse__PluginSummary, +}).annotate({ identifier: "V2PluginReadResponse__PluginDetail" }); -export type V2RawResponseItemCompletedNotification__ResponseItem = - | { - readonly content: ReadonlyArray; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly phase?: V2RawResponseItemCompletedNotification__MessagePhase | null; - readonly role: string; - readonly type: "message"; - } - | { - readonly author: string; - readonly content: ReadonlyArray; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly recipient: string; - readonly type: "agent_message"; - } - | { - readonly content?: ReadonlyArray | null; - readonly encrypted_content?: string | null; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly summary: ReadonlyArray; - readonly type: "reasoning"; - } - | { - readonly action: V2RawResponseItemCompletedNotification__LocalShellAction; - readonly call_id?: string | null; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly status: V2RawResponseItemCompletedNotification__LocalShellStatus; - readonly type: "local_shell_call"; - } - | { - readonly arguments: string; - readonly call_id: string; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly name: string; - readonly namespace?: string | null; - readonly type: "function_call"; - } - | { - readonly arguments: unknown; - readonly call_id?: string | null; - readonly execution: string; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly status?: string | null; - readonly type: "tool_search_call"; - } - | { - readonly call_id: string; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly output: V2RawResponseItemCompletedNotification__FunctionCallOutputBody; - readonly type: "function_call_output"; - } - | { - readonly call_id: string; - readonly id?: string | null; - readonly input: string; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly name: string; - readonly namespace?: string | null; - readonly status?: string | null; - readonly type: "custom_tool_call"; - } - | { - readonly call_id: string; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly name?: string | null; - readonly output: V2RawResponseItemCompletedNotification__FunctionCallOutputBody; - readonly type: "custom_tool_call_output"; - } - | { - readonly call_id?: string | null; - readonly execution: string; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly status: string; - readonly tools: ReadonlyArray; - readonly type: "tool_search_output"; - } - | { - readonly action?: V2RawResponseItemCompletedNotification__ResponsesApiWebSearchAction | null; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly status?: string | null; - readonly type: "web_search_call"; - } - | { - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly result: string; - readonly revised_prompt?: string | null; - readonly status: string; - readonly type: "image_generation_call"; - } - | { - readonly encrypted_content: string; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly type: "compaction"; - } - | { readonly type: "compaction_trigger" } - | { - readonly encrypted_content?: string | null; - readonly id?: string | null; - readonly internal_chat_message_metadata_passthrough?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null; - readonly type: "context_compaction"; - } - | { readonly type: "other" }; -export const V2RawResponseItemCompletedNotification__ResponseItem = Schema.Union( - [ - Schema.Struct({ - content: Schema.Array(V2RawResponseItemCompletedNotification__ContentItem), - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - phase: Schema.optionalKey( - Schema.Union([V2RawResponseItemCompletedNotification__MessagePhase, Schema.Null]), - ), - role: Schema.String, - type: Schema.Literal("message").annotate({ title: "MessageResponseItemType" }), - }).annotate({ title: "MessageResponseItem" }), - Schema.Struct({ - author: Schema.String, - content: Schema.Array(V2RawResponseItemCompletedNotification__AgentMessageInputContent), - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - recipient: Schema.String, - type: Schema.Literal("agent_message").annotate({ title: "AgentMessageResponseItemType" }), - }).annotate({ title: "AgentMessageResponseItem" }), - Schema.Struct({ - content: Schema.optionalKey( - Schema.Union([ - Schema.Array(V2RawResponseItemCompletedNotification__ReasoningItemContent), - Schema.Null, - ]), - ), - encrypted_content: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - summary: Schema.Array(V2RawResponseItemCompletedNotification__ReasoningItemReasoningSummary), - type: Schema.Literal("reasoning").annotate({ title: "ReasoningResponseItemType" }), - }).annotate({ title: "ReasoningResponseItem" }), - Schema.Struct({ - action: V2RawResponseItemCompletedNotification__LocalShellAction, - call_id: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Set when using the Responses API." }), - Schema.Null, - ]), - ), - id: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Legacy id field retained for compatibility with older payloads.", - }), - Schema.Null, - ]), - ), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - status: V2RawResponseItemCompletedNotification__LocalShellStatus, - type: Schema.Literal("local_shell_call").annotate({ - title: "LocalShellCallResponseItemType", - }), - }).annotate({ title: "LocalShellCallResponseItem" }), - Schema.Struct({ - arguments: Schema.String, - call_id: Schema.String, - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - name: Schema.String, - namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("function_call").annotate({ title: "FunctionCallResponseItemType" }), - }).annotate({ title: "FunctionCallResponseItem" }), - Schema.Struct({ - arguments: Schema.Unknown, - call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - execution: Schema.String, - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - status: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("tool_search_call").annotate({ - title: "ToolSearchCallResponseItemType", - }), - }).annotate({ title: "ToolSearchCallResponseItem" }), - Schema.Struct({ - call_id: Schema.String, - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - output: V2RawResponseItemCompletedNotification__FunctionCallOutputBody, - type: Schema.Literal("function_call_output").annotate({ - title: "FunctionCallOutputResponseItemType", - }), - }).annotate({ title: "FunctionCallOutputResponseItem" }), - Schema.Struct({ - call_id: Schema.String, - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - input: Schema.String, - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - name: Schema.String, - namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("custom_tool_call").annotate({ - title: "CustomToolCallResponseItemType", - }), - }).annotate({ title: "CustomToolCallResponseItem" }), - Schema.Struct({ - call_id: Schema.String, - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - output: V2RawResponseItemCompletedNotification__FunctionCallOutputBody, - type: Schema.Literal("custom_tool_call_output").annotate({ - title: "CustomToolCallOutputResponseItemType", - }), - }).annotate({ title: "CustomToolCallOutputResponseItem" }), - Schema.Struct({ - call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - execution: Schema.String, - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - status: Schema.String, - tools: Schema.Array(Schema.Unknown), - type: Schema.Literal("tool_search_output").annotate({ - title: "ToolSearchOutputResponseItemType", - }), - }).annotate({ title: "ToolSearchOutputResponseItem" }), - Schema.Struct({ - action: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__ResponsesApiWebSearchAction, - Schema.Null, - ]), - ), - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - status: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("web_search_call").annotate({ title: "WebSearchCallResponseItemType" }), - }).annotate({ title: "WebSearchCallResponseItem" }), - Schema.Struct({ - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - result: Schema.String, - revised_prompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: Schema.String, - type: Schema.Literal("image_generation_call").annotate({ - title: "ImageGenerationCallResponseItemType", - }), - }).annotate({ title: "ImageGenerationCallResponseItem" }), - Schema.Struct({ - encrypted_content: Schema.String, - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - type: Schema.Literal("compaction").annotate({ title: "CompactionResponseItemType" }), - }).annotate({ title: "CompactionResponseItem" }), - Schema.Struct({ - type: Schema.Literal("compaction_trigger").annotate({ - title: "CompactionTriggerResponseItemType", - }), - }).annotate({ title: "CompactionTriggerResponseItem" }), - Schema.Struct({ - encrypted_content: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - internal_chat_message_metadata_passthrough: Schema.optionalKey( - Schema.Union([ - V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough, - Schema.Null, - ]), - ), - type: Schema.Literal("context_compaction").annotate({ - title: "ContextCompactionResponseItemType", - }), - }).annotate({ title: "ContextCompactionResponseItem" }), - Schema.Struct({ - type: Schema.Literal("other").annotate({ title: "OtherResponseItemType" }), - }).annotate({ title: "OtherResponseItem" }), - ], - { mode: "oneOf" }, -); +export type V2PluginShareListResponse__PluginShareListItem = { + readonly localPluginPath?: V2PluginShareListResponse__AbsolutePathBuf | null; + readonly plugin: V2PluginShareListResponse__PluginSummary; +}; +export const V2PluginShareListResponse__PluginShareListItem = Schema.Struct({ + localPluginPath: Schema.optionalKey( + Schema.Union([V2PluginShareListResponse__AbsolutePathBuf, Schema.Null]), + ), + plugin: V2PluginShareListResponse__PluginSummary, +}).annotate({ identifier: "V2PluginShareListResponse__PluginShareListItem" }); export type V2ReviewStartResponse__Turn = { readonly completedAt?: number | null; @@ -29437,7 +43427,7 @@ export type V2ReviewStartResponse__Turn = { readonly error?: V2ReviewStartResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ReviewStartResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ReviewStartResponse__TurnStatus; }; @@ -29447,7 +43437,7 @@ export const V2ReviewStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29456,13 +43446,13 @@ export const V2ReviewStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ReviewStartResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -29472,7 +43462,10 @@ export const V2ReviewStartResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2ReviewStartResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29482,23 +43475,12 @@ export const V2ReviewStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ReviewStartResponse__TurnStatus, -}); - -export type V2SkillsListResponse__SkillsListEntry = { - readonly cwd: string; - readonly errors: ReadonlyArray; - readonly skills: ReadonlyArray; -}; -export const V2SkillsListResponse__SkillsListEntry = Schema.Struct({ - cwd: Schema.String, - errors: Schema.Array(V2SkillsListResponse__SkillErrorInfo), - skills: Schema.Array(V2SkillsListResponse__SkillMetadata), -}); +}).annotate({ identifier: "V2ReviewStartResponse__Turn" }); export type V2ThreadForkResponse__Turn = { readonly completedAt?: number | null; @@ -29506,7 +43488,7 @@ export type V2ThreadForkResponse__Turn = { readonly error?: V2ThreadForkResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ThreadForkResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ThreadForkResponse__TurnStatus; }; @@ -29516,7 +43498,7 @@ export const V2ThreadForkResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29525,13 +43507,13 @@ export const V2ThreadForkResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ThreadForkResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -29541,7 +43523,9 @@ export const V2ThreadForkResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => V2ThreadForkResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29551,12 +43535,43 @@ export const V2ThreadForkResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ThreadForkResponse__TurnStatus, -}); +}).annotate({ identifier: "V2ThreadForkResponse__Turn" }); + +export type V2ThreadItemsListResponse__ThreadItemEntry = { + readonly completedAtMs?: number | null; + readonly item: V2ThreadItemsListResponse__ThreadItem; + readonly startedAtMs?: number | null; + readonly turnId: string; +}; +export const V2ThreadItemsListResponse__ThreadItemEntry = Schema.Struct({ + completedAtMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Unix timestamp (milliseconds) when the item completed, if recorded by the producer.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + item: V2ThreadItemsListResponse__ThreadItem, + startedAtMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Unix timestamp (milliseconds) when the item started, if recorded by the producer.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + turnId: Schema.String.annotate({ description: "Turn containing this item." }), +}).annotate({ identifier: "V2ThreadItemsListResponse__ThreadItemEntry" }); export type V2ThreadListResponse__Turn = { readonly completedAt?: number | null; @@ -29564,7 +43579,7 @@ export type V2ThreadListResponse__Turn = { readonly error?: V2ThreadListResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ThreadListResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ThreadListResponse__TurnStatus; }; @@ -29574,7 +43589,7 @@ export const V2ThreadListResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29583,13 +43598,13 @@ export const V2ThreadListResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ThreadListResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -29599,7 +43614,9 @@ export const V2ThreadListResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => V2ThreadListResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29609,12 +43626,12 @@ export const V2ThreadListResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ThreadListResponse__TurnStatus, -}); +}).annotate({ identifier: "V2ThreadListResponse__Turn" }); export type V2ThreadMetadataUpdateResponse__Turn = { readonly completedAt?: number | null; @@ -29622,7 +43639,7 @@ export type V2ThreadMetadataUpdateResponse__Turn = { readonly error?: V2ThreadMetadataUpdateResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ThreadMetadataUpdateResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ThreadMetadataUpdateResponse__TurnStatus; }; @@ -29632,7 +43649,7 @@ export const V2ThreadMetadataUpdateResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29641,13 +43658,13 @@ export const V2ThreadMetadataUpdateResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ThreadMetadataUpdateResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -29657,7 +43674,10 @@ export const V2ThreadMetadataUpdateResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29667,12 +43687,12 @@ export const V2ThreadMetadataUpdateResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ThreadMetadataUpdateResponse__TurnStatus, -}); +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__Turn" }); export type V2ThreadReadResponse__Turn = { readonly completedAt?: number | null; @@ -29680,7 +43700,7 @@ export type V2ThreadReadResponse__Turn = { readonly error?: V2ThreadReadResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ThreadReadResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ThreadReadResponse__TurnStatus; }; @@ -29690,7 +43710,7 @@ export const V2ThreadReadResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29699,13 +43719,13 @@ export const V2ThreadReadResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ThreadReadResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -29715,7 +43735,9 @@ export const V2ThreadReadResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => V2ThreadReadResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29725,12 +43747,12 @@ export const V2ThreadReadResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ThreadReadResponse__TurnStatus, -}); +}).annotate({ identifier: "V2ThreadReadResponse__Turn" }); export type V2ThreadResumeResponse__Turn = { readonly completedAt?: number | null; @@ -29738,7 +43760,7 @@ export type V2ThreadResumeResponse__Turn = { readonly error?: V2ThreadResumeResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ThreadResumeResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ThreadResumeResponse__TurnStatus; }; @@ -29748,7 +43770,7 @@ export const V2ThreadResumeResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29757,13 +43779,13 @@ export const V2ThreadResumeResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ThreadResumeResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -29773,7 +43795,10 @@ export const V2ThreadResumeResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29783,30 +43808,30 @@ export const V2ThreadResumeResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ThreadResumeResponse__TurnStatus, -}); +}).annotate({ identifier: "V2ThreadResumeResponse__Turn" }); -export type V2ThreadRollbackResponse__Turn = { +export type V2ThreadRevertResponse__Turn = { readonly completedAt?: number | null; readonly durationMs?: number | null; - readonly error?: V2ThreadRollbackResponse__TurnError | null; + readonly error?: V2ThreadRevertResponse__TurnError | null; readonly id: string; - readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly items: ReadonlyArray; + readonly itemsView?: V2ThreadRevertResponse__TurnItemsView; readonly startedAt?: number | null; - readonly status: V2ThreadRollbackResponse__TurnStatus; + readonly status: V2ThreadRevertResponse__TurnStatus; }; -export const V2ThreadRollbackResponse__Turn = Schema.Struct({ +export const V2ThreadRevertResponse__Turn = Schema.Struct({ completedAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29815,23 +43840,26 @@ export const V2ThreadRollbackResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + Schema.Union([V2ThreadRevertResponse__TurnError, Schema.Null]).annotate({ + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ description: "Identifier for this turn. Codex-generated turn IDs are UUIDv7.", }), - items: Schema.Array(V2ThreadRollbackResponse__ThreadItem).annotate({ + items: Schema.Array(V2ThreadRevertResponse__ThreadItem).annotate({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2ThreadRevertResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29841,49 +43869,12 @@ export const V2ThreadRollbackResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), - status: V2ThreadRollbackResponse__TurnStatus, -}); - -export type V2ThreadSettingsUpdatedNotification__ThreadSettings = { - readonly activePermissionProfile?: V2ThreadSettingsUpdatedNotification__ActivePermissionProfile | null; - readonly approvalPolicy: V2ThreadSettingsUpdatedNotification__AskForApproval; - readonly approvalsReviewer: V2ThreadSettingsUpdatedNotification__ApprovalsReviewer; - readonly collaborationMode: V2ThreadSettingsUpdatedNotification__CollaborationMode; - readonly cwd: V2ThreadSettingsUpdatedNotification__AbsolutePathBuf; - readonly effort?: V2ThreadSettingsUpdatedNotification__ReasoningEffort | null; - readonly model: string; - readonly modelProvider: string; - readonly personality?: V2ThreadSettingsUpdatedNotification__Personality | null; - readonly sandboxPolicy: V2ThreadSettingsUpdatedNotification__SandboxPolicy; - readonly serviceTier?: string | null; - readonly summary?: V2ThreadSettingsUpdatedNotification__ReasoningSummary | null; -}; -export const V2ThreadSettingsUpdatedNotification__ThreadSettings = Schema.Struct({ - activePermissionProfile: Schema.optionalKey( - Schema.Union([V2ThreadSettingsUpdatedNotification__ActivePermissionProfile, Schema.Null]), - ), - approvalPolicy: V2ThreadSettingsUpdatedNotification__AskForApproval, - approvalsReviewer: V2ThreadSettingsUpdatedNotification__ApprovalsReviewer, - collaborationMode: V2ThreadSettingsUpdatedNotification__CollaborationMode, - cwd: V2ThreadSettingsUpdatedNotification__AbsolutePathBuf, - effort: Schema.optionalKey( - Schema.Union([V2ThreadSettingsUpdatedNotification__ReasoningEffort, Schema.Null]), - ), - model: Schema.String, - modelProvider: Schema.String, - personality: Schema.optionalKey( - Schema.Union([V2ThreadSettingsUpdatedNotification__Personality, Schema.Null]), - ), - sandboxPolicy: V2ThreadSettingsUpdatedNotification__SandboxPolicy, - serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - summary: Schema.optionalKey( - Schema.Union([V2ThreadSettingsUpdatedNotification__ReasoningSummary, Schema.Null]), - ), -}); + status: V2ThreadRevertResponse__TurnStatus, +}).annotate({ identifier: "V2ThreadRevertResponse__Turn" }); export type V2ThreadStartedNotification__Turn = { readonly completedAt?: number | null; @@ -29891,7 +43882,7 @@ export type V2ThreadStartedNotification__Turn = { readonly error?: V2ThreadStartedNotification__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ThreadStartedNotification__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ThreadStartedNotification__TurnStatus; }; @@ -29901,7 +43892,7 @@ export const V2ThreadStartedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29910,13 +43901,13 @@ export const V2ThreadStartedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ThreadStartedNotification__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -29926,7 +43917,10 @@ export const V2ThreadStartedNotification__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29936,12 +43930,12 @@ export const V2ThreadStartedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ThreadStartedNotification__TurnStatus, -}); +}).annotate({ identifier: "V2ThreadStartedNotification__Turn" }); export type V2ThreadStartResponse__Turn = { readonly completedAt?: number | null; @@ -29949,7 +43943,7 @@ export type V2ThreadStartResponse__Turn = { readonly error?: V2ThreadStartResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ThreadStartResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ThreadStartResponse__TurnStatus; }; @@ -29959,7 +43953,7 @@ export const V2ThreadStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -29968,13 +43962,13 @@ export const V2ThreadStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ThreadStartResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -29984,7 +43978,10 @@ export const V2ThreadStartResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -29994,12 +43991,73 @@ export const V2ThreadStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ThreadStartResponse__TurnStatus, -}); +}).annotate({ identifier: "V2ThreadStartResponse__Turn" }); + +export type V2ThreadTurnsListResponse__Turn = { + readonly completedAt?: number | null; + readonly durationMs?: number | null; + readonly error?: V2ThreadTurnsListResponse__TurnError | null; + readonly id: string; + readonly items: ReadonlyArray; + readonly itemsView?: V2ThreadTurnsListResponse__TurnItemsView; + readonly startedAt?: number | null; + readonly status: V2ThreadTurnsListResponse__TurnStatus; +}; +export const V2ThreadTurnsListResponse__Turn = Schema.Struct({ + completedAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp (in seconds) when the turn completed.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Duration between turn start and completion in milliseconds, if known.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + error: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListResponse__TurnError, Schema.Null]).annotate({ + description: "Error associated with a failed or interrupted turn.", + }), + ), + id: Schema.String.annotate({ + description: "Identifier for this turn. Codex-generated turn IDs are UUIDv7.", + }), + items: Schema.Array(V2ThreadTurnsListResponse__ThreadItem).annotate({ + description: "Thread items currently included in this turn payload.", + }), + itemsView: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadTurnsListResponse__TurnItemsView, + ).annotate({ + description: "Describes how much of `items` has been loaded for this turn.", + default: "full", + }), + ), + startedAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp (in seconds) when the turn started.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + status: V2ThreadTurnsListResponse__TurnStatus, +}).annotate({ identifier: "V2ThreadTurnsListResponse__Turn" }); export type V2ThreadUnarchiveResponse__Turn = { readonly completedAt?: number | null; @@ -30007,7 +44065,7 @@ export type V2ThreadUnarchiveResponse__Turn = { readonly error?: V2ThreadUnarchiveResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2ThreadUnarchiveResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2ThreadUnarchiveResponse__TurnStatus; }; @@ -30017,7 +44075,7 @@ export const V2ThreadUnarchiveResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -30026,13 +44084,13 @@ export const V2ThreadUnarchiveResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2ThreadUnarchiveResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -30042,7 +44100,10 @@ export const V2ThreadUnarchiveResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -30052,12 +44113,12 @@ export const V2ThreadUnarchiveResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2ThreadUnarchiveResponse__TurnStatus, -}); +}).annotate({ identifier: "V2ThreadUnarchiveResponse__Turn" }); export type V2TurnCompletedNotification__Turn = { readonly completedAt?: number | null; @@ -30065,7 +44126,7 @@ export type V2TurnCompletedNotification__Turn = { readonly error?: V2TurnCompletedNotification__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2TurnCompletedNotification__TurnItemsView; readonly startedAt?: number | null; readonly status: V2TurnCompletedNotification__TurnStatus; }; @@ -30075,7 +44136,7 @@ export const V2TurnCompletedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -30084,13 +44145,13 @@ export const V2TurnCompletedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2TurnCompletedNotification__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -30100,7 +44161,10 @@ export const V2TurnCompletedNotification__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2TurnCompletedNotification__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -30110,12 +44174,12 @@ export const V2TurnCompletedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2TurnCompletedNotification__TurnStatus, -}); +}).annotate({ identifier: "V2TurnCompletedNotification__Turn" }); export type V2TurnStartedNotification__Turn = { readonly completedAt?: number | null; @@ -30123,7 +44187,7 @@ export type V2TurnStartedNotification__Turn = { readonly error?: V2TurnStartedNotification__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2TurnStartedNotification__TurnItemsView; readonly startedAt?: number | null; readonly status: V2TurnStartedNotification__TurnStatus; }; @@ -30133,7 +44197,7 @@ export const V2TurnStartedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -30142,13 +44206,13 @@ export const V2TurnStartedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2TurnStartedNotification__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -30158,7 +44222,10 @@ export const V2TurnStartedNotification__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => + V2TurnStartedNotification__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -30168,12 +44235,12 @@ export const V2TurnStartedNotification__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2TurnStartedNotification__TurnStatus, -}); +}).annotate({ identifier: "V2TurnStartedNotification__Turn" }); export type V2TurnStartResponse__Turn = { readonly completedAt?: number | null; @@ -30181,7 +44248,7 @@ export type V2TurnStartResponse__Turn = { readonly error?: V2TurnStartResponse__TurnError | null; readonly id: string; readonly items: ReadonlyArray; - readonly itemsView?: "notLoaded" | "summary" | "full"; + readonly itemsView?: V2TurnStartResponse__TurnItemsView; readonly startedAt?: number | null; readonly status: V2TurnStartResponse__TurnStatus; }; @@ -30191,7 +44258,7 @@ export const V2TurnStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -30200,13 +44267,13 @@ export const V2TurnStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Duration between turn start and completion in milliseconds, if known.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), error: Schema.optionalKey( Schema.Union([V2TurnStartResponse__TurnError, Schema.Null]).annotate({ - description: "Only populated when the Turn's status is failed.", + description: "Error associated with a failed or interrupted turn.", }), ), id: Schema.String.annotate({ @@ -30216,7 +44283,9 @@ export const V2TurnStartResponse__Turn = Schema.Struct({ description: "Thread items currently included in this turn payload.", }), itemsView: Schema.optionalKey( - Schema.Literals(["notLoaded", "summary", "full"]).annotate({ + Schema.suspend( + (): Schema.Codec => V2TurnStartResponse__TurnItemsView, + ).annotate({ description: "Describes how much of `items` has been loaded for this turn.", default: "full", }), @@ -30226,220 +44295,80 @@ export const V2TurnStartResponse__Turn = Schema.Struct({ Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the turn started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), status: V2TurnStartResponse__TurnStatus, -}); - -export type CommandExecutionRequestApprovalParams__AdditionalFileSystemPermissions = { - readonly entries?: ReadonlyArray | null; - readonly globScanMaxDepth?: number | null; - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; -}; -export const CommandExecutionRequestApprovalParams__AdditionalFileSystemPermissions = Schema.Struct( - { - entries: Schema.optionalKey( - Schema.Union([ - Schema.Array(CommandExecutionRequestApprovalParams__FileSystemSandboxEntry), - Schema.Null, - ]), - ), - globScanMaxDepth: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), - Schema.Null, - ]), - ), - read: Schema.optionalKey( - Schema.Union([ - Schema.Array(CommandExecutionRequestApprovalParams__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), - ), - write: Schema.optionalKey( - Schema.Union([ - Schema.Array(CommandExecutionRequestApprovalParams__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), - ), - }, -); +}).annotate({ identifier: "V2TurnStartResponse__Turn" }); -export type McpServerElicitationRequestParams__McpElicitationEnumSchema = - | McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema - | McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema - | McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema; -export const McpServerElicitationRequestParams__McpElicitationEnumSchema = Schema.Union([ - McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSchema, - McpServerElicitationRequestParams__McpElicitationMultiSelectEnumSchema, - McpServerElicitationRequestParams__McpElicitationLegacyTitledEnumSchema, -]); - -export type PermissionsRequestApprovalParams__AdditionalFileSystemPermissions = { - readonly entries?: ReadonlyArray | null; - readonly globScanMaxDepth?: number | null; - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; -}; -export const PermissionsRequestApprovalParams__AdditionalFileSystemPermissions = Schema.Struct({ - entries: Schema.optionalKey( - Schema.Union([ - Schema.Array(PermissionsRequestApprovalParams__FileSystemSandboxEntry), - Schema.Null, - ]), - ), - globScanMaxDepth: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), - Schema.Null, - ]), - ), - read: Schema.optionalKey( - Schema.Union([ - Schema.Array(PermissionsRequestApprovalParams__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), - ), - write: Schema.optionalKey( - Schema.Union([ - Schema.Array(PermissionsRequestApprovalParams__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), - ), -}); +export type McpServerElicitationRequestParams__McpElicitationPrimitiveSchema = + | McpServerElicitationRequestParams__McpElicitationEnumSchema + | McpServerElicitationRequestParams__McpElicitationStringSchema + | McpServerElicitationRequestParams__McpElicitationNumberSchema + | McpServerElicitationRequestParams__McpElicitationBooleanSchema; +export const McpServerElicitationRequestParams__McpElicitationPrimitiveSchema = Schema.Union([ + McpServerElicitationRequestParams__McpElicitationEnumSchema, + McpServerElicitationRequestParams__McpElicitationStringSchema, + McpServerElicitationRequestParams__McpElicitationNumberSchema, + McpServerElicitationRequestParams__McpElicitationBooleanSchema, +]).annotate({ identifier: "McpServerElicitationRequestParams__McpElicitationPrimitiveSchema" }); -export type PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions = { - readonly entries?: ReadonlyArray | null; - readonly globScanMaxDepth?: number | null; - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; +export type PermissionsRequestApprovalParams__RequestPermissionProfile = { + readonly fileSystem?: PermissionsRequestApprovalParams__AdditionalFileSystemPermissions | null; + readonly network?: PermissionsRequestApprovalParams__AdditionalNetworkPermissions | null; }; -export const PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions = Schema.Struct({ - entries: Schema.optionalKey( - Schema.Union([ - Schema.Array(PermissionsRequestApprovalResponse__FileSystemSandboxEntry), - Schema.Null, - ]), - ), - globScanMaxDepth: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), - Schema.Null, - ]), - ), - read: Schema.optionalKey( - Schema.Union([ - Schema.Array(PermissionsRequestApprovalResponse__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), +export const PermissionsRequestApprovalParams__RequestPermissionProfile = Schema.Struct({ + fileSystem: Schema.optionalKey( + Schema.Union([PermissionsRequestApprovalParams__AdditionalFileSystemPermissions, Schema.Null]), ), - write: Schema.optionalKey( - Schema.Union([ - Schema.Array(PermissionsRequestApprovalResponse__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), + network: Schema.optionalKey( + Schema.Union([PermissionsRequestApprovalParams__AdditionalNetworkPermissions, Schema.Null]), ), -}); +}).annotate({ identifier: "PermissionsRequestApprovalParams__RequestPermissionProfile" }); -export type ServerNotification__AdditionalFileSystemPermissions = { - readonly entries?: ReadonlyArray | null; - readonly globScanMaxDepth?: number | null; - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; +export type PermissionsRequestApprovalResponse__GrantedPermissionProfile = { + readonly fileSystem?: PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions | null; + readonly network?: PermissionsRequestApprovalResponse__AdditionalNetworkPermissions | null; }; -export const ServerNotification__AdditionalFileSystemPermissions = Schema.Struct({ - entries: Schema.optionalKey( - Schema.Union([Schema.Array(ServerNotification__FileSystemSandboxEntry), Schema.Null]), - ), - globScanMaxDepth: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), - Schema.Null, - ]), - ), - read: Schema.optionalKey( +export const PermissionsRequestApprovalResponse__GrantedPermissionProfile = Schema.Struct({ + fileSystem: Schema.optionalKey( Schema.Union([ - Schema.Array(ServerNotification__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), + PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions, Schema.Null, ]), ), - write: Schema.optionalKey( - Schema.Union([ - Schema.Array(ServerNotification__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), + network: Schema.optionalKey( + Schema.Union([PermissionsRequestApprovalResponse__AdditionalNetworkPermissions, Schema.Null]), ), -}); - -export type ServerNotification__ThreadSettingsUpdatedNotification = { - readonly threadId: string; - readonly threadSettings: ServerNotification__ThreadSettings; -}; -export const ServerNotification__ThreadSettingsUpdatedNotification = Schema.Struct({ - threadId: Schema.String, - threadSettings: ServerNotification__ThreadSettings, -}); +}).annotate({ identifier: "PermissionsRequestApprovalResponse__GrantedPermissionProfile" }); export type ServerNotification__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: ServerNotification__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; readonly gitInfo?: ServerNotification__GitInfo | null; + readonly historyMode?: ServerNotification__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: ServerNotification__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: ServerNotification__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: ServerNotification__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; + readonly source: ServerNotification__SessionSource; + readonly status: ServerNotification__ThreadStatus; readonly threadSource?: ServerNotification__ThreadSource | null; readonly turns: ReadonlyArray; readonly updatedAt: number; @@ -30468,11 +44397,10 @@ export const ServerNotification__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => ServerNotification__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -30489,9 +44417,27 @@ export const ServerNotification__Thread = Schema.Struct({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + ServerNotification__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -30501,6 +44447,15 @@ export const ServerNotification__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -30519,47 +44474,51 @@ export const ServerNotification__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([ServerNotification__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([ServerNotification__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: ServerNotification__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => ServerNotification__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(ServerNotification__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => ServerNotification__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( Schema.Union([ServerNotification__ThreadSource, Schema.Null]).annotate({ @@ -30568,273 +44527,140 @@ export const ServerNotification__Thread = Schema.Struct({ ), turns: Schema.Array(ServerNotification__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "ServerNotification__Thread" }); -export type ServerNotification__TurnCompletedNotification = { +export type ServerNotification__TurnStartedNotification = { readonly threadId: string; readonly turn: ServerNotification__Turn; }; -export const ServerNotification__TurnCompletedNotification = Schema.Struct({ +export const ServerNotification__TurnStartedNotification = Schema.Struct({ threadId: Schema.String, turn: ServerNotification__Turn, -}); +}).annotate({ identifier: "ServerNotification__TurnStartedNotification" }); -export type ServerNotification__TurnStartedNotification = { +export type ServerNotification__TurnCompletedNotification = { readonly threadId: string; readonly turn: ServerNotification__Turn; }; -export const ServerNotification__TurnStartedNotification = Schema.Struct({ +export const ServerNotification__TurnCompletedNotification = Schema.Struct({ threadId: Schema.String, turn: ServerNotification__Turn, -}); +}).annotate({ identifier: "ServerNotification__TurnCompletedNotification" }); -export type ServerRequest__AdditionalFileSystemPermissions = { - readonly entries?: ReadonlyArray | null; - readonly globScanMaxDepth?: number | null; - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; +export type ServerNotification__RequestPermissionProfile = { + readonly fileSystem?: ServerNotification__AdditionalFileSystemPermissions | null; + readonly network?: ServerNotification__AdditionalNetworkPermissions | null; }; -export const ServerRequest__AdditionalFileSystemPermissions = Schema.Struct({ - entries: Schema.optionalKey( - Schema.Union([Schema.Array(ServerRequest__FileSystemSandboxEntry), Schema.Null]), +export const ServerNotification__RequestPermissionProfile = Schema.Struct({ + fileSystem: Schema.optionalKey( + Schema.Union([ServerNotification__AdditionalFileSystemPermissions, Schema.Null]), ), - globScanMaxDepth: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), - Schema.Null, - ]), + network: Schema.optionalKey( + Schema.Union([ServerNotification__AdditionalNetworkPermissions, Schema.Null]), ), - read: Schema.optionalKey( - Schema.Union([ - Schema.Array(ServerRequest__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), +}).annotate({ identifier: "ServerNotification__RequestPermissionProfile" }); + +export type ServerRequest__RequestPermissionProfile = { + readonly fileSystem?: ServerRequest__AdditionalFileSystemPermissions | null; + readonly network?: ServerRequest__AdditionalNetworkPermissions | null; +}; +export const ServerRequest__RequestPermissionProfile = Schema.Struct({ + fileSystem: Schema.optionalKey( + Schema.Union([ServerRequest__AdditionalFileSystemPermissions, Schema.Null]), ), - write: Schema.optionalKey( - Schema.Union([ - Schema.Array(ServerRequest__LegacyAppPathString).annotate({ - description: "This will be removed in favor of `entries`.", - }), - Schema.Null, - ]), + network: Schema.optionalKey( + Schema.Union([ServerRequest__AdditionalNetworkPermissions, Schema.Null]), ), -}); +}).annotate({ identifier: "ServerRequest__RequestPermissionProfile" }); -export type ServerRequest__McpElicitationEnumSchema = - | ServerRequest__McpElicitationSingleSelectEnumSchema - | ServerRequest__McpElicitationMultiSelectEnumSchema - | ServerRequest__McpElicitationLegacyTitledEnumSchema; -export const ServerRequest__McpElicitationEnumSchema = Schema.Union([ - ServerRequest__McpElicitationSingleSelectEnumSchema, - ServerRequest__McpElicitationMultiSelectEnumSchema, - ServerRequest__McpElicitationLegacyTitledEnumSchema, -]); +export type ServerRequest__McpElicitationPrimitiveSchema = + | ServerRequest__McpElicitationEnumSchema + | ServerRequest__McpElicitationStringSchema + | ServerRequest__McpElicitationNumberSchema + | ServerRequest__McpElicitationBooleanSchema; +export const ServerRequest__McpElicitationPrimitiveSchema = Schema.Union([ + ServerRequest__McpElicitationEnumSchema, + ServerRequest__McpElicitationStringSchema, + ServerRequest__McpElicitationNumberSchema, + ServerRequest__McpElicitationBooleanSchema, +]).annotate({ identifier: "ServerRequest__McpElicitationPrimitiveSchema" }); -export type V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions = { - readonly entries?: ReadonlyArray | null; - readonly globScanMaxDepth?: number | null; - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; +export type V2ItemGuardianApprovalReviewCompletedNotification__RequestPermissionProfile = { + readonly fileSystem?: V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions | null; + readonly network?: V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions | null; }; -export const V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions = +export const V2ItemGuardianApprovalReviewCompletedNotification__RequestPermissionProfile = Schema.Struct({ - entries: Schema.optionalKey( - Schema.Union([ - Schema.Array(V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry), - Schema.Null, - ]), - ), - globScanMaxDepth: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), - Schema.Null, - ]), - ), - read: Schema.optionalKey( + fileSystem: Schema.optionalKey( Schema.Union([ - Schema.Array( - V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, - ).annotate({ description: "This will be removed in favor of `entries`." }), + V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions, Schema.Null, ]), ), - write: Schema.optionalKey( + network: Schema.optionalKey( Schema.Union([ - Schema.Array( - V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, - ).annotate({ description: "This will be removed in favor of `entries`." }), + V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions, Schema.Null, ]), ), + }).annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__RequestPermissionProfile", }); -export type V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions = { - readonly entries?: ReadonlyArray | null; - readonly globScanMaxDepth?: number | null; - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; +export type V2ItemGuardianApprovalReviewStartedNotification__RequestPermissionProfile = { + readonly fileSystem?: V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions | null; + readonly network?: V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions | null; }; -export const V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions = +export const V2ItemGuardianApprovalReviewStartedNotification__RequestPermissionProfile = Schema.Struct({ - entries: Schema.optionalKey( - Schema.Union([ - Schema.Array(V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry), - Schema.Null, - ]), - ), - globScanMaxDepth: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(1)), - Schema.Null, - ]), - ), - read: Schema.optionalKey( + fileSystem: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString).annotate( - { description: "This will be removed in favor of `entries`." }, - ), + V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions, Schema.Null, ]), ), - write: Schema.optionalKey( + network: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString).annotate( - { description: "This will be removed in favor of `entries`." }, - ), + V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions, Schema.Null, ]), ), + }).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__RequestPermissionProfile", }); -export type V2PluginInstalledResponse__PluginMarketplaceEntry = { - readonly interface?: V2PluginInstalledResponse__MarketplaceInterface | null; - readonly name: string; - readonly path?: V2PluginInstalledResponse__AbsolutePathBuf | null; - readonly plugins: ReadonlyArray; -}; -export const V2PluginInstalledResponse__PluginMarketplaceEntry = Schema.Struct({ - interface: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__MarketplaceInterface, Schema.Null]), - ), - name: Schema.String, - path: Schema.optionalKey( - Schema.Union([V2PluginInstalledResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: - "Local marketplace file path when the marketplace is backed by a local file. Remote-only catalog marketplaces do not have a local path.", - }), - ), - plugins: Schema.Array(V2PluginInstalledResponse__PluginSummary), -}); - -export type V2PluginListResponse__PluginMarketplaceEntry = { - readonly interface?: V2PluginListResponse__MarketplaceInterface | null; - readonly name: string; - readonly path?: V2PluginListResponse__AbsolutePathBuf | null; - readonly plugins: ReadonlyArray; -}; -export const V2PluginListResponse__PluginMarketplaceEntry = Schema.Struct({ - interface: Schema.optionalKey( - Schema.Union([V2PluginListResponse__MarketplaceInterface, Schema.Null]), - ), - name: Schema.String, - path: Schema.optionalKey( - Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ - description: - "Local marketplace file path when the marketplace is backed by a local file. Remote-only catalog marketplaces do not have a local path.", - }), - ), - plugins: Schema.Array(V2PluginListResponse__PluginSummary), -}); - -export type V2PluginReadResponse__PluginDetail = { - readonly appTemplates: ReadonlyArray; - readonly apps: ReadonlyArray; - readonly description?: string | null; - readonly hooks: ReadonlyArray; - readonly marketplaceName: string; - readonly marketplacePath?: V2PluginReadResponse__AbsolutePathBuf | null; - readonly mcpServers: ReadonlyArray; - readonly scheduledTasks?: ReadonlyArray | null; - readonly shareUrl?: string | null; - readonly skills: ReadonlyArray; - readonly summary: V2PluginReadResponse__PluginSummary; -}; -export const V2PluginReadResponse__PluginDetail = Schema.Struct({ - appTemplates: Schema.Array(V2PluginReadResponse__AppTemplateSummary), - apps: Schema.Array(V2PluginReadResponse__AppSummary), - description: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - hooks: Schema.Array(V2PluginReadResponse__PluginHookSummary), - marketplaceName: Schema.String, - marketplacePath: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]), - ), - mcpServers: Schema.Array(Schema.String), - scheduledTasks: Schema.optionalKey( - Schema.Union([Schema.Array(V2PluginReadResponse__ScheduledTaskSummary), Schema.Null]), - ), - shareUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - skills: Schema.Array(V2PluginReadResponse__SkillSummary), - summary: V2PluginReadResponse__PluginSummary, -}); - -export type V2PluginShareListResponse__PluginShareListItem = { - readonly localPluginPath?: V2PluginShareListResponse__AbsolutePathBuf | null; - readonly plugin: V2PluginShareListResponse__PluginSummary; -}; -export const V2PluginShareListResponse__PluginShareListItem = Schema.Struct({ - localPluginPath: Schema.optionalKey( - Schema.Union([V2PluginShareListResponse__AbsolutePathBuf, Schema.Null]), - ), - plugin: V2PluginShareListResponse__PluginSummary, -}); - export type V2ThreadForkResponse__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: V2ThreadForkResponse__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; readonly gitInfo?: V2ThreadForkResponse__GitInfo | null; + readonly historyMode?: V2ThreadForkResponse__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadForkResponse__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: V2ThreadForkResponse__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadForkResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; + readonly source: V2ThreadForkResponse__SessionSource; + readonly status: V2ThreadForkResponse__ThreadStatus; readonly threadSource?: V2ThreadForkResponse__ThreadSource | null; readonly turns: ReadonlyArray; readonly updatedAt: number; @@ -30863,11 +44689,11 @@ export const V2ThreadForkResponse__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadForkResponse__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -30884,9 +44710,27 @@ export const V2ThreadForkResponse__Thread = Schema.Struct({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadForkResponse__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -30896,6 +44740,15 @@ export const V2ThreadForkResponse__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -30914,47 +44767,51 @@ export const V2ThreadForkResponse__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadForkResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => V2ThreadForkResponse__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadForkResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => V2ThreadForkResponse__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( Schema.Union([V2ThreadForkResponse__ThreadSource, Schema.Null]).annotate({ @@ -30963,47 +44820,40 @@ export const V2ThreadForkResponse__Thread = Schema.Struct({ ), turns: Schema.Array(V2ThreadForkResponse__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadForkResponse__Thread" }); export type V2ThreadListResponse__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: V2ThreadListResponse__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; readonly gitInfo?: V2ThreadListResponse__GitInfo | null; + readonly historyMode?: V2ThreadListResponse__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadListResponse__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: V2ThreadListResponse__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadListResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; + readonly source: V2ThreadListResponse__SessionSource; + readonly status: V2ThreadListResponse__ThreadStatus; readonly threadSource?: V2ThreadListResponse__ThreadSource | null; readonly turns: ReadonlyArray; readonly updatedAt: number; @@ -31032,11 +44882,204 @@ export const V2ThreadListResponse__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadListResponse__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), + ephemeral: Schema.Boolean.annotate({ + description: "Whether the thread is ephemeral and should not be materialized on disk.", + }), + forkedFromId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Source thread id when this thread was created by forking another thread.", + }), + Schema.Null, + ]), + ), + gitInfo: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__GitInfo, Schema.Null]).annotate({ + description: "Optional Git metadata captured when the thread was created.", + }), + ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadListResponse__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), + id: Schema.String.annotate({ + description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", + }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), + modelProvider: Schema.String.annotate({ + description: "Model provider used for this thread (for example, 'openai').", + }), + name: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "Optional user-facing thread title." }), + Schema.Null, + ]), + ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), + parentThreadId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "The ID of the parent thread. This will only be set if this thread is a subagent.", + }), + Schema.Null, + ]), + ), + path: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ description: "[UNSTABLE] Path to the thread on disk." }), + Schema.Null, + ]), + ), + preview: Schema.String.annotate({ + description: "Usually the first user message in the thread, if available.", + }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), + recencyAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp (in seconds) used for thread recency ordering.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + sessionId: Schema.String.annotate({ + description: "Session id shared by threads that belong to the same session tree.", + }), + source: Schema.suspend( + (): Schema.Codec => V2ThreadListResponse__SessionSource, + ).annotate({ + description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + }), + status: Schema.suspend( + (): Schema.Codec => V2ThreadListResponse__ThreadStatus, + ).annotate({ description: "Current runtime status for the thread." }), + threadSource: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__ThreadSource, Schema.Null]).annotate({ + description: "Optional analytics source classification for this thread.", + }), + ), + turns: Schema.Array(V2ThreadListResponse__Turn).annotate({ description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + }), + updatedAt: Schema.Number.annotate({ + description: "Unix timestamp (in seconds) when the thread was last updated.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadListResponse__Thread" }); + +export type V2ThreadMetadataUpdateResponse__Thread = { + readonly agentNickname?: string | null; + readonly agentRole?: string | null; + readonly cliVersion: string; + readonly createdAt: number; + readonly cwd: V2ThreadMetadataUpdateResponse__AbsolutePathBuf; + readonly ephemeral: boolean; + readonly forkedFromId?: string | null; + readonly gitInfo?: V2ThreadMetadataUpdateResponse__GitInfo | null; + readonly historyMode?: V2ThreadMetadataUpdateResponse__ThreadHistoryMode; + readonly id: string; + readonly model?: string | null; + readonly modelProvider: string; + readonly name?: string | null; + readonly originator?: string | null; + readonly parentThreadId?: string | null; + readonly path?: string | null; + readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null; + readonly recencyAt?: number | null; + readonly section?: V2ThreadMetadataUpdateResponse__ThreadSection | null; + readonly sectionEnteredAt?: number | null; + readonly sessionId: string; + readonly source: V2ThreadMetadataUpdateResponse__SessionSource; + readonly status: V2ThreadMetadataUpdateResponse__ThreadStatus; + readonly threadSource?: V2ThreadMetadataUpdateResponse__ThreadSource | null; + readonly turns: ReadonlyArray; + readonly updatedAt: number; +}; +export const V2ThreadMetadataUpdateResponse__Thread = Schema.Struct({ + agentNickname: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + }), + Schema.Null, + ]), + ), + agentRole: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + }), + Schema.Null, + ]), + ), + cliVersion: Schema.String.annotate({ + description: "Version of the CLI that created the thread.", }), + createdAt: Schema.Number.annotate({ + description: "Unix timestamp (in seconds) when the thread was created.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -31049,13 +45092,31 @@ export const V2ThreadListResponse__Thread = Schema.Struct({ ]), ), gitInfo: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__GitInfo, Schema.Null]).annotate({ + Schema.Union([V2ThreadMetadataUpdateResponse__GitInfo, Schema.Null]).annotate({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -31065,6 +45126,15 @@ export const V2ThreadListResponse__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31083,101 +45153,100 @@ export const V2ThreadListResponse__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadListResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadListResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => + V2ThreadMetadataUpdateResponse__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__ThreadSource, Schema.Null]).annotate({ + Schema.Union([V2ThreadMetadataUpdateResponse__ThreadSource, Schema.Null]).annotate({ description: "Optional analytics source classification for this thread.", }), ), - turns: Schema.Array(V2ThreadListResponse__Turn).annotate({ + turns: Schema.Array(V2ThreadMetadataUpdateResponse__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadMetadataUpdateResponse__Thread" }); -export type V2ThreadMetadataUpdateResponse__Thread = { +export type V2ThreadReadResponse__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: V2ThreadReadResponse__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; - readonly gitInfo?: V2ThreadMetadataUpdateResponse__GitInfo | null; + readonly gitInfo?: V2ThreadReadResponse__GitInfo | null; + readonly historyMode?: V2ThreadReadResponse__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadReadResponse__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: V2ThreadReadResponse__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadMetadataUpdateResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; - readonly threadSource?: V2ThreadMetadataUpdateResponse__ThreadSource | null; - readonly turns: ReadonlyArray; + readonly source: V2ThreadReadResponse__SessionSource; + readonly status: V2ThreadReadResponse__ThreadStatus; + readonly threadSource?: V2ThreadReadResponse__ThreadSource | null; + readonly turns: ReadonlyArray; readonly updatedAt: number; }; -export const V2ThreadMetadataUpdateResponse__Thread = Schema.Struct({ +export const V2ThreadReadResponse__Thread = Schema.Struct({ agentNickname: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31201,11 +45270,11 @@ export const V2ThreadMetadataUpdateResponse__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadReadResponse__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -31218,13 +45287,31 @@ export const V2ThreadMetadataUpdateResponse__Thread = Schema.Struct({ ]), ), gitInfo: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__GitInfo, Schema.Null]).annotate({ + Schema.Union([V2ThreadReadResponse__GitInfo, Schema.Null]).annotate({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadReadResponse__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -31234,6 +45321,15 @@ export const V2ThreadMetadataUpdateResponse__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31252,101 +45348,98 @@ export const V2ThreadMetadataUpdateResponse__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadMetadataUpdateResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => V2ThreadReadResponse__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadMetadataUpdateResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => V2ThreadReadResponse__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__ThreadSource, Schema.Null]).annotate({ + Schema.Union([V2ThreadReadResponse__ThreadSource, Schema.Null]).annotate({ description: "Optional analytics source classification for this thread.", }), ), - turns: Schema.Array(V2ThreadMetadataUpdateResponse__Turn).annotate({ + turns: Schema.Array(V2ThreadReadResponse__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadReadResponse__Thread" }); -export type V2ThreadReadResponse__Thread = { +export type V2ThreadResumeResponse__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: V2ThreadResumeResponse__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; - readonly gitInfo?: V2ThreadReadResponse__GitInfo | null; + readonly gitInfo?: V2ThreadResumeResponse__GitInfo | null; + readonly historyMode?: V2ThreadResumeResponse__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadResumeResponse__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: V2ThreadResumeResponse__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadReadResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; - readonly threadSource?: V2ThreadReadResponse__ThreadSource | null; - readonly turns: ReadonlyArray; + readonly source: V2ThreadResumeResponse__SessionSource; + readonly status: V2ThreadResumeResponse__ThreadStatus; + readonly threadSource?: V2ThreadResumeResponse__ThreadSource | null; + readonly turns: ReadonlyArray; readonly updatedAt: number; }; -export const V2ThreadReadResponse__Thread = Schema.Struct({ +export const V2ThreadResumeResponse__Thread = Schema.Struct({ agentNickname: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31370,11 +45463,11 @@ export const V2ThreadReadResponse__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -31387,13 +45480,31 @@ export const V2ThreadReadResponse__Thread = Schema.Struct({ ]), ), gitInfo: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__GitInfo, Schema.Null]).annotate({ + Schema.Union([V2ThreadResumeResponse__GitInfo, Schema.Null]).annotate({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -31403,6 +45514,15 @@ export const V2ThreadReadResponse__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31421,101 +45541,99 @@ export const V2ThreadReadResponse__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadReadResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadReadResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => V2ThreadResumeResponse__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__ThreadSource, Schema.Null]).annotate({ + Schema.Union([V2ThreadResumeResponse__ThreadSource, Schema.Null]).annotate({ description: "Optional analytics source classification for this thread.", }), ), - turns: Schema.Array(V2ThreadReadResponse__Turn).annotate({ + turns: Schema.Array(V2ThreadResumeResponse__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadResumeResponse__Thread" }); -export type V2ThreadResumeResponse__Thread = { +export type V2ThreadRevertResponse__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: V2ThreadRevertResponse__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; - readonly gitInfo?: V2ThreadResumeResponse__GitInfo | null; + readonly gitInfo?: V2ThreadRevertResponse__GitInfo | null; + readonly historyMode?: V2ThreadRevertResponse__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadRevertResponse__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: V2ThreadRevertResponse__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadResumeResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; - readonly threadSource?: V2ThreadResumeResponse__ThreadSource | null; - readonly turns: ReadonlyArray; + readonly source: V2ThreadRevertResponse__SessionSource; + readonly status: V2ThreadRevertResponse__ThreadStatus; + readonly threadSource?: V2ThreadRevertResponse__ThreadSource | null; + readonly turns: ReadonlyArray; readonly updatedAt: number; }; -export const V2ThreadResumeResponse__Thread = Schema.Struct({ +export const V2ThreadRevertResponse__Thread = Schema.Struct({ agentNickname: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31539,11 +45657,11 @@ export const V2ThreadResumeResponse__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadRevertResponse__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -31556,13 +45674,31 @@ export const V2ThreadResumeResponse__Thread = Schema.Struct({ ]), ), gitInfo: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__GitInfo, Schema.Null]).annotate({ + Schema.Union([V2ThreadRevertResponse__GitInfo, Schema.Null]).annotate({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadRevertResponse__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -31572,6 +45708,15 @@ export const V2ThreadResumeResponse__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31590,96 +45735,94 @@ export const V2ThreadResumeResponse__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadRevertResponse__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadResumeResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => + V2ThreadRevertResponse__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadResumeResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => V2ThreadRevertResponse__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__ThreadSource, Schema.Null]).annotate({ + Schema.Union([V2ThreadRevertResponse__ThreadSource, Schema.Null]).annotate({ description: "Optional analytics source classification for this thread.", }), ), - turns: Schema.Array(V2ThreadResumeResponse__Turn).annotate({ + turns: Schema.Array(V2ThreadRevertResponse__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadRevertResponse__Thread" }); export type V2ThreadStartedNotification__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: V2ThreadStartedNotification__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; readonly gitInfo?: V2ThreadStartedNotification__GitInfo | null; + readonly historyMode?: V2ThreadStartedNotification__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadStartedNotification__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: V2ThreadStartedNotification__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadStartedNotification__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; + readonly source: V2ThreadStartedNotification__SessionSource; + readonly status: V2ThreadStartedNotification__ThreadStatus; readonly threadSource?: V2ThreadStartedNotification__ThreadSource | null; readonly turns: ReadonlyArray; readonly updatedAt: number; @@ -31708,11 +45851,11 @@ export const V2ThreadStartedNotification__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -31729,9 +45872,27 @@ export const V2ThreadStartedNotification__Thread = Schema.Struct({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -31741,6 +45902,15 @@ export const V2ThreadStartedNotification__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31759,47 +45929,53 @@ export const V2ThreadStartedNotification__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadStartedNotification__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadStartedNotification__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadStartedNotification__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => + V2ThreadStartedNotification__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( Schema.Union([V2ThreadStartedNotification__ThreadSource, Schema.Null]).annotate({ @@ -31808,47 +45984,40 @@ export const V2ThreadStartedNotification__Thread = Schema.Struct({ ), turns: Schema.Array(V2ThreadStartedNotification__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadStartedNotification__Thread" }); export type V2ThreadStartResponse__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: V2ThreadStartResponse__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; readonly gitInfo?: V2ThreadStartResponse__GitInfo | null; + readonly historyMode?: V2ThreadStartResponse__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadStartResponse__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: V2ThreadStartResponse__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadStartResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; + readonly source: V2ThreadStartResponse__SessionSource; + readonly status: V2ThreadStartResponse__ThreadStatus; readonly threadSource?: V2ThreadStartResponse__ThreadSource | null; readonly turns: ReadonlyArray; readonly updatedAt: number; @@ -31877,11 +46046,11 @@ export const V2ThreadStartResponse__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -31898,9 +46067,27 @@ export const V2ThreadStartResponse__Thread = Schema.Struct({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -31910,6 +46097,15 @@ export const V2ThreadStartResponse__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -31928,47 +46124,51 @@ export const V2ThreadStartResponse__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadStartResponse__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadStartResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => V2ThreadStartResponse__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadStartResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => V2ThreadStartResponse__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( Schema.Union([V2ThreadStartResponse__ThreadSource, Schema.Null]).annotate({ @@ -31977,47 +46177,40 @@ export const V2ThreadStartResponse__Thread = Schema.Struct({ ), turns: Schema.Array(V2ThreadStartResponse__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadStartResponse__Thread" }); export type V2ThreadUnarchiveResponse__Thread = { readonly agentNickname?: string | null; readonly agentRole?: string | null; readonly cliVersion: string; readonly createdAt: number; - readonly cwd: string; + readonly cwd: V2ThreadUnarchiveResponse__AbsolutePathBuf; readonly ephemeral: boolean; readonly forkedFromId?: string | null; readonly gitInfo?: V2ThreadUnarchiveResponse__GitInfo | null; + readonly historyMode?: V2ThreadUnarchiveResponse__ThreadHistoryMode; readonly id: string; + readonly model?: string | null; readonly modelProvider: string; readonly name?: string | null; + readonly originator?: string | null; readonly parentThreadId?: string | null; readonly path?: string | null; readonly preview: string; + readonly projectId: string | null; + readonly reasoningEffort?: V2ThreadUnarchiveResponse__ReasoningEffort | null; readonly recencyAt?: number | null; + readonly section?: V2ThreadUnarchiveResponse__ThreadSection | null; + readonly sectionEnteredAt?: number | null; readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadUnarchiveResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; + readonly source: V2ThreadUnarchiveResponse__SessionSource; + readonly status: V2ThreadUnarchiveResponse__ThreadStatus; readonly threadSource?: V2ThreadUnarchiveResponse__ThreadSource | null; readonly turns: ReadonlyArray; readonly updatedAt: number; @@ -32046,11 +46239,11 @@ export const V2ThreadUnarchiveResponse__Thread = Schema.Struct({ createdAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was created.", format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + cwd: Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__AbsolutePathBuf, + ).annotate({ description: "Working directory captured for the thread." }), ephemeral: Schema.Boolean.annotate({ description: "Whether the thread is ephemeral and should not be materialized on disk.", }), @@ -32067,9 +46260,27 @@ export const V2ThreadUnarchiveResponse__Thread = Schema.Struct({ description: "Optional Git metadata captured when the thread was created.", }), ), + historyMode: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__ThreadHistoryMode, + ).annotate({ + description: "Persisted thread history contract selected when this thread was created.", + default: "legacy", + }), + ), id: Schema.String.annotate({ description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", }), + model: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Current configured model when loaded, otherwise the latest persisted model. Null when unavailable. This is not per-turn execution telemetry.", + }), + Schema.Null, + ]), + ), modelProvider: Schema.String.annotate({ description: "Model provider used for this thread (for example, 'openai').", }), @@ -32079,6 +46290,15 @@ export const V2ThreadUnarchiveResponse__Thread = Schema.Struct({ Schema.Null, ]), ), + originator: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Originator recorded when the thread was created, independent of its current client or executor. Null when the recorded originator is unavailable.", + }), + Schema.Null, + ]), + ), parentThreadId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -32097,47 +46317,53 @@ export const V2ThreadUnarchiveResponse__Thread = Schema.Struct({ preview: Schema.String.annotate({ description: "Usually the first user message in the thread, if available.", }), + projectId: Schema.Union([ + Schema.String.annotate({ + description: "Canonical project assignment owned by app-server, if any.", + }), + Schema.Null, + ]), + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__ReasoningEffort, Schema.Null]).annotate({ + description: + "Current configured reasoning effort when loaded, otherwise the latest persisted effort. Null when unset or unavailable. This is not per-turn execution telemetry.", + }), + ), recencyAt: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Unix timestamp (in seconds) used for thread recency ordering.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), + section: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__ThreadSection, Schema.Null]).annotate({ + description: "The independently persisted section selected for this thread, if any.", + }), + ), + sectionEnteredAt: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Unix timestamp in seconds when the thread entered its current section.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), sessionId: Schema.String.annotate({ description: "Session id shared by threads that belong to the same session tree.", }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadUnarchiveResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, + source: Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__SessionSource, ).annotate({ description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadUnarchiveResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, + status: Schema.suspend( + (): Schema.Codec => + V2ThreadUnarchiveResponse__ThreadStatus, ).annotate({ description: "Current runtime status for the thread." }), threadSource: Schema.optionalKey( Schema.Union([V2ThreadUnarchiveResponse__ThreadSource, Schema.Null]).annotate({ @@ -32146,139 +46372,13 @@ export const V2ThreadUnarchiveResponse__Thread = Schema.Struct({ ), turns: Schema.Array(V2ThreadUnarchiveResponse__Turn).annotate({ description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "Only populated on `thread/resume`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", }), updatedAt: Schema.Number.annotate({ description: "Unix timestamp (in seconds) when the thread was last updated.", format: "int64", - }).check(Schema.isInt()), -}); - -export type McpServerElicitationRequestParams__McpElicitationPrimitiveSchema = - | McpServerElicitationRequestParams__McpElicitationEnumSchema - | McpServerElicitationRequestParams__McpElicitationStringSchema - | McpServerElicitationRequestParams__McpElicitationNumberSchema - | McpServerElicitationRequestParams__McpElicitationBooleanSchema; -export const McpServerElicitationRequestParams__McpElicitationPrimitiveSchema = Schema.Union([ - McpServerElicitationRequestParams__McpElicitationEnumSchema, - McpServerElicitationRequestParams__McpElicitationStringSchema, - McpServerElicitationRequestParams__McpElicitationNumberSchema, - McpServerElicitationRequestParams__McpElicitationBooleanSchema, -]); - -export type PermissionsRequestApprovalParams__RequestPermissionProfile = { - readonly fileSystem?: PermissionsRequestApprovalParams__AdditionalFileSystemPermissions | null; - readonly network?: PermissionsRequestApprovalParams__AdditionalNetworkPermissions | null; -}; -export const PermissionsRequestApprovalParams__RequestPermissionProfile = Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalParams__AdditionalFileSystemPermissions, Schema.Null]), - ), - network: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalParams__AdditionalNetworkPermissions, Schema.Null]), - ), -}); - -export type PermissionsRequestApprovalResponse__GrantedPermissionProfile = { - readonly fileSystem?: PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions | null; - readonly network?: PermissionsRequestApprovalResponse__AdditionalNetworkPermissions | null; -}; -export const PermissionsRequestApprovalResponse__GrantedPermissionProfile = Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([ - PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions, - Schema.Null, - ]), - ), - network: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalResponse__AdditionalNetworkPermissions, Schema.Null]), - ), -}); - -export type ServerNotification__RequestPermissionProfile = { - readonly fileSystem?: ServerNotification__AdditionalFileSystemPermissions | null; - readonly network?: ServerNotification__AdditionalNetworkPermissions | null; -}; -export const ServerNotification__RequestPermissionProfile = Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([ServerNotification__AdditionalFileSystemPermissions, Schema.Null]), - ), - network: Schema.optionalKey( - Schema.Union([ServerNotification__AdditionalNetworkPermissions, Schema.Null]), - ), -}); - -export type ServerNotification__ThreadStartedNotification = { - readonly thread: ServerNotification__Thread; -}; -export const ServerNotification__ThreadStartedNotification = Schema.Struct({ - thread: ServerNotification__Thread, -}); - -export type ServerRequest__RequestPermissionProfile = { - readonly fileSystem?: ServerRequest__AdditionalFileSystemPermissions | null; - readonly network?: ServerRequest__AdditionalNetworkPermissions | null; -}; -export const ServerRequest__RequestPermissionProfile = Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([ServerRequest__AdditionalFileSystemPermissions, Schema.Null]), - ), - network: Schema.optionalKey( - Schema.Union([ServerRequest__AdditionalNetworkPermissions, Schema.Null]), - ), -}); - -export type ServerRequest__McpElicitationPrimitiveSchema = - | ServerRequest__McpElicitationEnumSchema - | ServerRequest__McpElicitationStringSchema - | ServerRequest__McpElicitationNumberSchema - | ServerRequest__McpElicitationBooleanSchema; -export const ServerRequest__McpElicitationPrimitiveSchema = Schema.Union([ - ServerRequest__McpElicitationEnumSchema, - ServerRequest__McpElicitationStringSchema, - ServerRequest__McpElicitationNumberSchema, - ServerRequest__McpElicitationBooleanSchema, -]); - -export type V2ItemGuardianApprovalReviewCompletedNotification__RequestPermissionProfile = { - readonly fileSystem?: V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions | null; - readonly network?: V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions | null; -}; -export const V2ItemGuardianApprovalReviewCompletedNotification__RequestPermissionProfile = - Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewCompletedNotification__AdditionalFileSystemPermissions, - Schema.Null, - ]), - ), - network: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions, - Schema.Null, - ]), - ), - }); - -export type V2ItemGuardianApprovalReviewStartedNotification__RequestPermissionProfile = { - readonly fileSystem?: V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions | null; - readonly network?: V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions | null; -}; -export const V2ItemGuardianApprovalReviewStartedNotification__RequestPermissionProfile = - Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewStartedNotification__AdditionalFileSystemPermissions, - Schema.Null, - ]), - ), - network: Schema.optionalKey( - Schema.Union([ - V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions, - Schema.Null, - ]), - ), - }); + }).check(Schema.isInt().annotate({ expected: "an integer" })), +}).annotate({ identifier: "V2ThreadUnarchiveResponse__Thread" }); export type McpServerElicitationRequestParams__McpElicitationSchema = { readonly $schema?: string | null; @@ -32299,12 +46399,20 @@ export const McpServerElicitationRequestParams__McpElicitationSchema = Schema.St }).annotate({ description: "Typed form schema for MCP `elicitation/create` requests.\n\nThis matches the `requestedSchema` shape from the MCP 2025-11-25 `ElicitRequestFormParams` schema.", + identifier: "McpServerElicitationRequestParams__McpElicitationSchema", }); +export type ServerNotification__ThreadStartedNotification = { + readonly thread: ServerNotification__Thread; +}; +export const ServerNotification__ThreadStartedNotification = Schema.Struct({ + thread: ServerNotification__Thread, +}).annotate({ identifier: "ServerNotification__ThreadStartedNotification" }); + export type ServerNotification__GuardianApprovalReviewAction = | { readonly command: string; - readonly cwd: ServerNotification__AbsolutePathBuf; + readonly cwd: ServerNotification__LegacyAppPathString; readonly source: ServerNotification__GuardianCommandSource; readonly type: "command"; } @@ -32316,8 +46424,15 @@ export type ServerNotification__GuardianApprovalReviewAction = readonly type: "execve"; } | { - readonly cwd: ServerNotification__AbsolutePathBuf; - readonly files: ReadonlyArray; + readonly approvalId: string; + readonly cwd: ServerNotification__LegacyAppPathString; + readonly processId: string; + readonly stdin: string; + readonly type: "writeStdin"; + } + | { + readonly cwd: ServerNotification__LegacyAppPathString; + readonly files: ReadonlyArray; readonly type: "applyPatch"; } | { @@ -32344,7 +46459,7 @@ export const ServerNotification__GuardianApprovalReviewAction = Schema.Union( [ Schema.Struct({ command: Schema.String, - cwd: ServerNotification__AbsolutePathBuf, + cwd: ServerNotification__LegacyAppPathString, source: ServerNotification__GuardianCommandSource, type: Schema.Literal("command").annotate({ title: "CommandGuardianApprovalReviewActionType", @@ -32358,8 +46473,20 @@ export const ServerNotification__GuardianApprovalReviewAction = Schema.Union( type: Schema.Literal("execve").annotate({ title: "ExecveGuardianApprovalReviewActionType" }), }).annotate({ title: "ExecveGuardianApprovalReviewAction" }), Schema.Struct({ - cwd: ServerNotification__AbsolutePathBuf, - files: Schema.Array(ServerNotification__AbsolutePathBuf), + approvalId: Schema.String, + cwd: ServerNotification__LegacyAppPathString, + processId: Schema.String, + stdin: Schema.String, + type: Schema.Literal("writeStdin").annotate({ + title: "WriteStdinGuardianApprovalReviewActionType", + }), + }).annotate({ + title: "WriteStdinGuardianApprovalReviewAction", + description: "A child approval for input to an existing command execution item.", + }), + Schema.Struct({ + cwd: ServerNotification__LegacyAppPathString, + files: Schema.Array(ServerNotification__LegacyAppPathString), type: Schema.Literal("applyPatch").annotate({ title: "ApplyPatchGuardianApprovalReviewActionType", }), @@ -32367,8 +46494,12 @@ export const ServerNotification__GuardianApprovalReviewAction = Schema.Union( Schema.Struct({ host: Schema.String, port: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), protocol: ServerNotification__NetworkApprovalProtocol, target: Schema.String, type: Schema.Literal("networkAccess").annotate({ @@ -32394,10 +46525,10 @@ export const ServerNotification__GuardianApprovalReviewAction = Schema.Union( }).annotate({ title: "RequestPermissionsGuardianApprovalReviewAction" }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "ServerNotification__GuardianApprovalReviewAction" }); export type ServerRequest__PermissionsRequestApprovalParams = { - readonly cwd: ServerRequest__AbsolutePathBuf; + readonly cwd: ServerRequest__LegacyAppPathString; readonly environmentId?: string | null; readonly itemId: string; readonly permissions: ServerRequest__RequestPermissionProfile; @@ -32407,7 +46538,7 @@ export type ServerRequest__PermissionsRequestApprovalParams = { readonly turnId: string; }; export const ServerRequest__PermissionsRequestApprovalParams = Schema.Struct({ - cwd: ServerRequest__AbsolutePathBuf, + cwd: ServerRequest__LegacyAppPathString, environmentId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), itemId: Schema.String, permissions: ServerRequest__RequestPermissionProfile, @@ -32415,10 +46546,10 @@ export const ServerRequest__PermissionsRequestApprovalParams = Schema.Struct({ startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this approval request started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), threadId: Schema.String, turnId: Schema.String, -}); +}).annotate({ identifier: "ServerRequest__PermissionsRequestApprovalParams" }); export type ServerRequest__McpElicitationSchema = { readonly $schema?: string | null; @@ -32434,12 +46565,13 @@ export const ServerRequest__McpElicitationSchema = Schema.Struct({ }).annotate({ description: "Typed form schema for MCP `elicitation/create` requests.\n\nThis matches the `requestedSchema` shape from the MCP 2025-11-25 `ElicitRequestFormParams` schema.", + identifier: "ServerRequest__McpElicitationSchema", }); export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewAction = | { readonly command: string; - readonly cwd: V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf; + readonly cwd: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString; readonly source: V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource; readonly type: "command"; } @@ -32451,8 +46583,15 @@ export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalR readonly type: "execve"; } | { - readonly cwd: V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf; - readonly files: ReadonlyArray; + readonly approvalId: string; + readonly cwd: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString; + readonly processId: string; + readonly stdin: string; + readonly type: "writeStdin"; + } + | { + readonly cwd: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString; + readonly files: ReadonlyArray; readonly type: "applyPatch"; } | { @@ -32480,7 +46619,7 @@ export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApproval [ Schema.Struct({ command: Schema.String, - cwd: V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf, + cwd: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, source: V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource, type: Schema.Literal("command").annotate({ title: "CommandGuardianApprovalReviewActionType", @@ -32496,8 +46635,20 @@ export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApproval }), }).annotate({ title: "ExecveGuardianApprovalReviewAction" }), Schema.Struct({ - cwd: V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf, - files: Schema.Array(V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf), + approvalId: Schema.String, + cwd: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, + processId: Schema.String, + stdin: Schema.String, + type: Schema.Literal("writeStdin").annotate({ + title: "WriteStdinGuardianApprovalReviewActionType", + }), + }).annotate({ + title: "WriteStdinGuardianApprovalReviewAction", + description: "A child approval for input to an existing command execution item.", + }), + Schema.Struct({ + cwd: V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString, + files: Schema.Array(V2ItemGuardianApprovalReviewCompletedNotification__LegacyAppPathString), type: Schema.Literal("applyPatch").annotate({ title: "ApplyPatchGuardianApprovalReviewActionType", }), @@ -32505,8 +46656,12 @@ export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApproval Schema.Struct({ host: Schema.String, port: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), protocol: V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol, target: Schema.String, type: Schema.Literal("networkAccess").annotate({ @@ -32532,12 +46687,14 @@ export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApproval }).annotate({ title: "RequestPermissionsGuardianApprovalReviewAction" }), ], { mode: "oneOf" }, - ); + ).annotate({ + identifier: "V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewAction", + }); export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewAction = | { readonly command: string; - readonly cwd: V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf; + readonly cwd: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString; readonly source: V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource; readonly type: "command"; } @@ -32549,8 +46706,15 @@ export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalRev readonly type: "execve"; } | { - readonly cwd: V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf; - readonly files: ReadonlyArray; + readonly approvalId: string; + readonly cwd: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString; + readonly processId: string; + readonly stdin: string; + readonly type: "writeStdin"; + } + | { + readonly cwd: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString; + readonly files: ReadonlyArray; readonly type: "applyPatch"; } | { @@ -32578,7 +46742,7 @@ export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalRe [ Schema.Struct({ command: Schema.String, - cwd: V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf, + cwd: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, source: V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource, type: Schema.Literal("command").annotate({ title: "CommandGuardianApprovalReviewActionType", @@ -32594,8 +46758,20 @@ export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalRe }), }).annotate({ title: "ExecveGuardianApprovalReviewAction" }), Schema.Struct({ - cwd: V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf, - files: Schema.Array(V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf), + approvalId: Schema.String, + cwd: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, + processId: Schema.String, + stdin: Schema.String, + type: Schema.Literal("writeStdin").annotate({ + title: "WriteStdinGuardianApprovalReviewActionType", + }), + }).annotate({ + title: "WriteStdinGuardianApprovalReviewAction", + description: "A child approval for input to an existing command execution item.", + }), + Schema.Struct({ + cwd: V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString, + files: Schema.Array(V2ItemGuardianApprovalReviewStartedNotification__LegacyAppPathString), type: Schema.Literal("applyPatch").annotate({ title: "ApplyPatchGuardianApprovalReviewActionType", }), @@ -32603,8 +46779,12 @@ export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalRe Schema.Struct({ host: Schema.String, port: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), protocol: V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol, target: Schema.String, type: Schema.Literal("networkAccess").annotate({ @@ -32630,12 +46810,12 @@ export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalRe }).annotate({ title: "RequestPermissionsGuardianApprovalReviewAction" }), ], { mode: "oneOf" }, - ); + ).annotate({ + identifier: "V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewAction", + }); -export type ServerNotification__ItemGuardianApprovalReviewCompletedNotification = { +export type ServerNotification__ItemGuardianApprovalReviewStartedNotification = { readonly action: ServerNotification__GuardianApprovalReviewAction; - readonly completedAtMs: number; - readonly decisionSource: ServerNotification__AutoReviewDecisionSource; readonly review: ServerNotification__GuardianApprovalReview; readonly reviewId: string; readonly startedAtMs: number; @@ -32643,24 +46823,19 @@ export type ServerNotification__ItemGuardianApprovalReviewCompletedNotification readonly threadId: string; readonly turnId: string; }; -export const ServerNotification__ItemGuardianApprovalReviewCompletedNotification = Schema.Struct({ +export const ServerNotification__ItemGuardianApprovalReviewStartedNotification = Schema.Struct({ action: ServerNotification__GuardianApprovalReviewAction, - completedAtMs: Schema.Number.annotate({ - description: "Unix timestamp (in milliseconds) when this review completed.", - format: "int64", - }).check(Schema.isInt()), - decisionSource: ServerNotification__AutoReviewDecisionSource, review: ServerNotification__GuardianApprovalReview, reviewId: Schema.String.annotate({ description: "Stable identifier for this review." }), startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this review started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), targetItemId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ description: - "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - stdin reviews, which refer to the existing parent command item and have a separate approval ID in the action payload - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", }), Schema.Null, ]), @@ -32670,10 +46845,13 @@ export const ServerNotification__ItemGuardianApprovalReviewCompletedNotification }).annotate({ description: "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + identifier: "ServerNotification__ItemGuardianApprovalReviewStartedNotification", }); -export type ServerNotification__ItemGuardianApprovalReviewStartedNotification = { +export type ServerNotification__ItemGuardianApprovalReviewCompletedNotification = { readonly action: ServerNotification__GuardianApprovalReviewAction; + readonly completedAtMs: number; + readonly decisionSource: ServerNotification__AutoReviewDecisionSource; readonly review: ServerNotification__GuardianApprovalReview; readonly reviewId: string; readonly startedAtMs: number; @@ -32681,19 +46859,24 @@ export type ServerNotification__ItemGuardianApprovalReviewStartedNotification = readonly threadId: string; readonly turnId: string; }; -export const ServerNotification__ItemGuardianApprovalReviewStartedNotification = Schema.Struct({ +export const ServerNotification__ItemGuardianApprovalReviewCompletedNotification = Schema.Struct({ action: ServerNotification__GuardianApprovalReviewAction, + completedAtMs: Schema.Number.annotate({ + description: "Unix timestamp (in milliseconds) when this review completed.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + decisionSource: ServerNotification__AutoReviewDecisionSource, review: ServerNotification__GuardianApprovalReview, reviewId: Schema.String.annotate({ description: "Stable identifier for this review." }), startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this review started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), targetItemId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ description: - "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - stdin reviews, which refer to the existing parent command item and have a separate approval ID in the action payload - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", }), Schema.Null, ]), @@ -32703,44 +46886,67 @@ export const ServerNotification__ItemGuardianApprovalReviewStartedNotification = }).annotate({ description: "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + identifier: "ServerNotification__ItemGuardianApprovalReviewCompletedNotification", }); export type ServerRequest__McpServerElicitationRequestParams = | { - readonly _meta?: unknown; + readonly serverName: string; + readonly threadId: string; + readonly turnId?: string | null; + readonly _meta?: Schema.Json; readonly message: string; readonly mode: "form"; readonly requestedSchema: ServerRequest__McpElicitationSchema; + } + | { readonly serverName: string; readonly threadId: string; readonly turnId?: string | null; - } - | { - readonly _meta?: unknown; + readonly _meta?: Schema.Json; readonly message: string; readonly mode: "openai/form"; - readonly requestedSchema: unknown; + readonly requestedSchema: Schema.Json; + } + | { readonly serverName: string; readonly threadId: string; readonly turnId?: string | null; + readonly _meta?: Schema.Json; + readonly message: string; + readonly mode: "openaiForm"; + readonly requestedSchema: Schema.Json; } | { - readonly _meta?: unknown; + readonly serverName: string; + readonly threadId: string; + readonly turnId?: string | null; + readonly _meta?: Schema.Json; readonly elicitationId: string; readonly message: string; readonly mode: "url"; readonly url: string; - readonly serverName: string; - readonly threadId: string; - readonly turnId?: string | null; }; export const ServerRequest__McpServerElicitationRequestParams = Schema.Union( [ Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), + serverName: Schema.String, + threadId: Schema.String, + turnId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Active Codex turn when this elicitation was observed, if app-server could correlate one.\n\nThis is nullable because MCP models elicitation as a standalone server-to-client request identified by the MCP server request id. It may be triggered during a turn, but turn context is app-server correlation rather than part of the protocol identity of the elicitation itself.", + }), + Schema.Null, + ]), + ), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), message: Schema.String, mode: Schema.Literal("form"), requestedSchema: ServerRequest__McpElicitationSchema, + }), + Schema.Struct({ serverName: Schema.String, threadId: Schema.String, turnId: Schema.optionalKey( @@ -32752,12 +46958,12 @@ export const ServerRequest__McpServerElicitationRequestParams = Schema.Union( Schema.Null, ]), ), - }), - Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), message: Schema.String, mode: Schema.Literal("openai/form"), - requestedSchema: Schema.Unknown, + requestedSchema: Schema.Json.annotate({ expected: "JSON value" }), + }), + Schema.Struct({ serverName: Schema.String, threadId: Schema.String, turnId: Schema.optionalKey( @@ -32769,13 +46975,12 @@ export const ServerRequest__McpServerElicitationRequestParams = Schema.Union( Schema.Null, ]), ), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + message: Schema.String, + mode: Schema.Literal("openaiForm"), + requestedSchema: Schema.Json.annotate({ expected: "JSON value" }), }), Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - elicitationId: Schema.String, - message: Schema.String, - mode: Schema.Literal("url"), - url: Schema.String, serverName: Schema.String, threadId: Schema.String, turnId: Schema.optionalKey( @@ -32787,10 +46992,15 @@ export const ServerRequest__McpServerElicitationRequestParams = Schema.Union( Schema.Null, ]), ), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + elicitationId: Schema.String, + message: Schema.String, + mode: Schema.Literal("url"), + url: Schema.String, }), ], { mode: "oneOf" }, -); +).annotate({ identifier: "ServerRequest__McpServerElicitationRequestParams" }); export type ApplyPatchApprovalParams = { readonly callId: string; @@ -32832,10 +47042,11 @@ export const ApplyPatchApprovalResponse = Schema.Struct({ decision: ApplyPatchApprovalResponse__ReviewDecision, }).annotate({ title: "ApplyPatchApprovalResponse" }); -export type AttestationGenerateParams = {}; -export const AttestationGenerateParams = Schema.Struct({}).annotate({ - title: "AttestationGenerateParams", -}); +export type AttestationGenerateParams = { readonly [x: string]: Schema.Json }; +export const AttestationGenerateParams = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "AttestationGenerateParams" }); export type AttestationGenerateResponse = { readonly token: string }; export const AttestationGenerateResponse = Schema.Struct({ @@ -32941,6 +47152,26 @@ export type ClientRequest = readonly method: "thread/metadata/update"; readonly params: ClientRequest__ThreadMetadataUpdateParams; } + | { + readonly id: ClientRequest__RequestId; + readonly method: "thread/attachment/add"; + readonly params: ClientRequest__ThreadAttachmentAddParams; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "thread/attachment/list"; + readonly params: ClientRequest__ThreadAttachmentListParams; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "thread/attachment/remove"; + readonly params: ClientRequest__ThreadAttachmentRemoveParams; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "thread/section/move"; + readonly params: ClientRequest__ThreadSectionMoveParams; + } | { readonly id: ClientRequest__RequestId; readonly method: "thread/unarchive"; @@ -32963,14 +47194,34 @@ export type ClientRequest = } | { readonly id: ClientRequest__RequestId; - readonly method: "thread/rollback"; - readonly params: ClientRequest__ThreadRollbackParams; + readonly method: "thread/revert"; + readonly params: ClientRequest__ThreadRevertParams; } | { readonly id: ClientRequest__RequestId; readonly method: "thread/list"; readonly params: ClientRequest__ThreadListParams; } + | { + readonly id: ClientRequest__RequestId; + readonly method: "threadSection/list"; + readonly params: ClientRequest__ThreadSectionListParams; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "threadSection/create"; + readonly params: ClientRequest__ThreadSectionCreateParams; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "threadSection/update"; + readonly params: ClientRequest__ThreadSectionUpdateParams; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "threadSection/delete"; + readonly params: ClientRequest__ThreadSectionDeleteParams; + } | { readonly id: ClientRequest__RequestId; readonly method: "thread/loaded/list"; @@ -32981,6 +47232,16 @@ export type ClientRequest = readonly method: "thread/read"; readonly params: ClientRequest__ThreadReadParams; } + | { + readonly id: ClientRequest__RequestId; + readonly method: "thread/turns/list"; + readonly params: ClientRequest__ThreadTurnsListParams; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "thread/items/list"; + readonly params: ClientRequest__ThreadItemsListParams; + } | { readonly id: ClientRequest__RequestId; readonly method: "thread/inject_items"; @@ -33026,6 +47287,11 @@ export type ClientRequest = readonly method: "plugin/installed"; readonly params: ClientRequest__PluginInstalledParams; } + | { + readonly id: ClientRequest__RequestId; + readonly method: "plugin/reconcile"; + readonly params: ClientRequest__PluginReconcileParams; + } | { readonly id: ClientRequest__RequestId; readonly method: "plugin/read"; @@ -33161,6 +47427,21 @@ export type ClientRequest = readonly method: "model/list"; readonly params: ClientRequest__ModelListParams; } + | { + readonly id: ClientRequest__RequestId; + readonly method: "account/gatewayOAuth/read"; + readonly params?: null; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "account/gatewayOAuth/login"; + readonly params?: null; + } + | { + readonly id: ClientRequest__RequestId; + readonly method: "account/gatewayOAuth/cancel"; + readonly params?: null; + } | { readonly id: ClientRequest__RequestId; readonly method: "modelProvider/capabilities/read"; @@ -33234,7 +47515,7 @@ export type ClientRequest = | { readonly id: ClientRequest__RequestId; readonly method: "account/rateLimits/read"; - readonly params?: null; + readonly params?: ClientRequest__GetAccountRateLimitsParams | null; } | { readonly id: ClientRequest__RequestId; @@ -33244,7 +47525,7 @@ export type ClientRequest = | { readonly id: ClientRequest__RequestId; readonly method: "account/usage/read"; - readonly params?: null; + readonly params?: ClientRequest__GetAccountTokenUsageParams | null; } | { readonly id: ClientRequest__RequestId; @@ -33296,6 +47577,11 @@ export type ClientRequest = readonly method: "externalAgentConfig/import"; readonly params: ClientRequest__ExternalAgentConfigImportParams; } + | { + readonly id: ClientRequest__RequestId; + readonly method: "externalAgentConfig/import/recordHistory"; + readonly params: ClientRequest__ExternalAgentConfigImportHistoryRecordParams; + } | { readonly id: ClientRequest__RequestId; readonly method: "externalAgentConfig/import/readHistories"; @@ -33394,6 +47680,34 @@ export const ClientRequest = Schema.Union( }), params: ClientRequest__ThreadMetadataUpdateParams, }).annotate({ title: "Thread/metadata/updateRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("thread/attachment/add").annotate({ + title: "Thread/attachment/addRequestMethod", + }), + params: ClientRequest__ThreadAttachmentAddParams, + }).annotate({ title: "Thread/attachment/addRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("thread/attachment/list").annotate({ + title: "Thread/attachment/listRequestMethod", + }), + params: ClientRequest__ThreadAttachmentListParams, + }).annotate({ title: "Thread/attachment/listRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("thread/attachment/remove").annotate({ + title: "Thread/attachment/removeRequestMethod", + }), + params: ClientRequest__ThreadAttachmentRemoveParams, + }).annotate({ title: "Thread/attachment/removeRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("thread/section/move").annotate({ + title: "Thread/section/moveRequestMethod", + }), + params: ClientRequest__ThreadSectionMoveParams, + }).annotate({ title: "Thread/section/moveRequest" }), Schema.Struct({ id: ClientRequest__RequestId, method: Schema.Literal("thread/unarchive").annotate({ @@ -33424,14 +47738,42 @@ export const ClientRequest = Schema.Union( }).annotate({ title: "Thread/approveGuardianDeniedActionRequest" }), Schema.Struct({ id: ClientRequest__RequestId, - method: Schema.Literal("thread/rollback").annotate({ title: "Thread/rollbackRequestMethod" }), - params: ClientRequest__ThreadRollbackParams, - }).annotate({ title: "Thread/rollbackRequest" }), + method: Schema.Literal("thread/revert").annotate({ title: "Thread/revertRequestMethod" }), + params: ClientRequest__ThreadRevertParams, + }).annotate({ title: "Thread/revertRequest" }), Schema.Struct({ id: ClientRequest__RequestId, method: Schema.Literal("thread/list").annotate({ title: "Thread/listRequestMethod" }), params: ClientRequest__ThreadListParams, }).annotate({ title: "Thread/listRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("threadSection/list").annotate({ + title: "ThreadSection/listRequestMethod", + }), + params: ClientRequest__ThreadSectionListParams, + }).annotate({ title: "ThreadSection/listRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("threadSection/create").annotate({ + title: "ThreadSection/createRequestMethod", + }), + params: ClientRequest__ThreadSectionCreateParams, + }).annotate({ title: "ThreadSection/createRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("threadSection/update").annotate({ + title: "ThreadSection/updateRequestMethod", + }), + params: ClientRequest__ThreadSectionUpdateParams, + }).annotate({ title: "ThreadSection/updateRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("threadSection/delete").annotate({ + title: "ThreadSection/deleteRequestMethod", + }), + params: ClientRequest__ThreadSectionDeleteParams, + }).annotate({ title: "ThreadSection/deleteRequest" }), Schema.Struct({ id: ClientRequest__RequestId, method: Schema.Literal("thread/loaded/list").annotate({ @@ -33444,6 +47786,20 @@ export const ClientRequest = Schema.Union( method: Schema.Literal("thread/read").annotate({ title: "Thread/readRequestMethod" }), params: ClientRequest__ThreadReadParams, }).annotate({ title: "Thread/readRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("thread/turns/list").annotate({ + title: "Thread/turns/listRequestMethod", + }), + params: ClientRequest__ThreadTurnsListParams, + }).annotate({ title: "Thread/turns/listRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("thread/items/list").annotate({ + title: "Thread/items/listRequestMethod", + }), + params: ClientRequest__ThreadItemsListParams, + }).annotate({ title: "Thread/items/listRequest" }), Schema.Struct({ id: ClientRequest__RequestId, method: Schema.Literal("thread/inject_items").annotate({ @@ -33503,6 +47859,13 @@ export const ClientRequest = Schema.Union( }), params: ClientRequest__PluginInstalledParams, }).annotate({ title: "Plugin/installedRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("plugin/reconcile").annotate({ + title: "Plugin/reconcileRequestMethod", + }), + params: ClientRequest__PluginReconcileParams, + }).annotate({ title: "Plugin/reconcileRequest" }), Schema.Struct({ id: ClientRequest__RequestId, method: Schema.Literal("plugin/read").annotate({ title: "Plugin/readRequestMethod" }), @@ -33658,6 +48021,27 @@ export const ClientRequest = Schema.Union( method: Schema.Literal("model/list").annotate({ title: "Model/listRequestMethod" }), params: ClientRequest__ModelListParams, }).annotate({ title: "Model/listRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("account/gatewayOAuth/read").annotate({ + title: "Account/gatewayOAuth/readRequestMethod", + }), + params: Schema.optionalKey(Schema.Null), + }).annotate({ title: "Account/gatewayOAuth/readRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("account/gatewayOAuth/login").annotate({ + title: "Account/gatewayOAuth/loginRequestMethod", + }), + params: Schema.optionalKey(Schema.Null), + }).annotate({ title: "Account/gatewayOAuth/loginRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("account/gatewayOAuth/cancel").annotate({ + title: "Account/gatewayOAuth/cancelRequestMethod", + }), + params: Schema.optionalKey(Schema.Null), + }).annotate({ title: "Account/gatewayOAuth/cancelRequest" }), Schema.Struct({ id: ClientRequest__RequestId, method: Schema.Literal("modelProvider/capabilities/read").annotate({ @@ -33759,7 +48143,9 @@ export const ClientRequest = Schema.Union( method: Schema.Literal("account/rateLimits/read").annotate({ title: "Account/rateLimits/readRequestMethod", }), - params: Schema.optionalKey(Schema.Null), + params: Schema.optionalKey( + Schema.Union([ClientRequest__GetAccountRateLimitsParams, Schema.Null]), + ), }).annotate({ title: "Account/rateLimits/readRequest" }), Schema.Struct({ id: ClientRequest__RequestId, @@ -33773,7 +48159,9 @@ export const ClientRequest = Schema.Union( method: Schema.Literal("account/usage/read").annotate({ title: "Account/usage/readRequestMethod", }), - params: Schema.optionalKey(Schema.Null), + params: Schema.optionalKey( + Schema.Union([ClientRequest__GetAccountTokenUsageParams, Schema.Null]), + ), }).annotate({ title: "Account/usage/readRequest" }), Schema.Struct({ id: ClientRequest__RequestId, @@ -33852,6 +48240,13 @@ export const ClientRequest = Schema.Union( }), params: ClientRequest__ExternalAgentConfigImportParams, }).annotate({ title: "ExternalAgentConfig/importRequest" }), + Schema.Struct({ + id: ClientRequest__RequestId, + method: Schema.Literal("externalAgentConfig/import/recordHistory").annotate({ + title: "ExternalAgentConfig/import/recordHistoryRequestMethod", + }), + params: ClientRequest__ExternalAgentConfigImportHistoryRecordParams, + }).annotate({ title: "ExternalAgentConfig/import/recordHistoryRequest" }), Schema.Struct({ id: ClientRequest__RequestId, method: Schema.Literal("externalAgentConfig/import/readHistories").annotate({ @@ -33903,39 +48298,6 @@ export const ClientRequest__AdditionalContextEntry = Schema.Struct({ value: Schema.String, }); -export type ClientRequest__ByteRange = { readonly end: number; readonly start: number }; -export const ClientRequest__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type ClientRequest__CapabilityRootLocation = { - readonly environmentId: string; - readonly path: string; - readonly type: "environment"; -}; -export const ClientRequest__CapabilityRootLocation = Schema.Union( - [ - Schema.Struct({ - environmentId: Schema.String, - path: Schema.String.annotate({ - description: "Absolute path for the root in the selected environment.", - }), - type: Schema.Literal("environment").annotate({ - title: "EnvironmentCapabilityRootLocationType", - }), - }).annotate({ - title: "EnvironmentCapabilityRootLocation", - description: "A path owned by an execution environment.", - }), - ], - { mode: "oneOf" }, -).annotate({ description: "Location used to resolve a selected capability root." }); - export type ClientRequest__CodexResponseHandoffMode = "thinking" | "commentary" | "bemTags"; export const ClientRequest__CodexResponseHandoffMode = Schema.Literals([ "thinking", @@ -33952,11 +48314,21 @@ export const ClientRequest__CollaborationMode = Schema.Struct({ settings: ClientRequest__Settings, }).annotate({ description: "Collaboration mode for a Codex session." }); +export type ClientRequest__CyberAccessProgram = "standard" | "daybreakBlue" | "daybreakRed"; +export const ClientRequest__CyberAccessProgram = Schema.Literals([ + "standard", + "daybreakBlue", + "daybreakRed", +]).annotate({ + description: + "Requested cyber treatment for a ChatGPT-authenticated Codex turn. Authorization and model-tier restrictions remain server-owned.", +}); + export type ClientRequest__DynamicToolSpec = | { readonly deferLoading?: boolean; readonly description: string; - readonly inputSchema: unknown; + readonly inputSchema: Schema.Json; readonly name: string; readonly type: "function"; } @@ -33971,7 +48343,7 @@ export const ClientRequest__DynamicToolSpec = Schema.Union( Schema.Struct({ deferLoading: Schema.optionalKey(Schema.Boolean), description: Schema.String, - inputSchema: Schema.Unknown, + inputSchema: Schema.Json.annotate({ expected: "JSON value" }), name: Schema.String, type: Schema.Literal("function").annotate({ title: "FunctionDynamicToolSpecType" }), }).annotate({ title: "FunctionDynamicToolSpec" }), @@ -34000,8 +48372,12 @@ export const ClientRequest__MultiAgentMode = Schema.Union( "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", }); -export type ClientRequest__NetworkAccess = "restricted" | "enabled"; -export const ClientRequest__NetworkAccess = Schema.Literals(["restricted", "enabled"]); +export type ClientRequest__PluginSearchScope = "global" | "workspace" | "personal"; +export const ClientRequest__PluginSearchScope = Schema.Literals([ + "global", + "workspace", + "personal", +]); export type ClientRequest__ProcessTerminalSize = { readonly cols: number; readonly rows: number }; export const ClientRequest__ProcessTerminalSize = Schema.Struct({ @@ -34009,16 +48385,26 @@ export const ClientRequest__ProcessTerminalSize = Schema.Struct({ description: "Terminal width in character cells.", format: "uint16", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), rows: Schema.Number.annotate({ description: "Terminal height in character cells.", format: "uint16", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), }).annotate({ description: "PTY size in character cells for `process/spawn` PTY sessions." }); +export type ClientRequest__ProjectRoot = { readonly path: ClientRequest__AbsolutePathBuf }; +export const ClientRequest__ProjectRoot = Schema.Struct({ path: ClientRequest__AbsolutePathBuf }); + +export type ClientRequest__ProjectSortKey = "position" | "recencyAt"; +export const ClientRequest__ProjectSortKey = Schema.Literals(["position", "recencyAt"]); + export type ClientRequest__RealtimeConversationVersion = "v1" | "v2" | "v3"; export const ClientRequest__RealtimeConversationVersion = Schema.Literals(["v1", "v2", "v3"]); @@ -34113,6 +48499,7 @@ export type ClientRequest__ResponseItem = | { readonly arguments: string; readonly call_id: string; + readonly encrypted_function_args?: ReadonlyArray | null; readonly id?: string | null; readonly internal_chat_message_metadata_passthrough?: ClientRequest__InternalChatMessageMetadataPassthrough | null; readonly name: string; @@ -34120,7 +48507,7 @@ export type ClientRequest__ResponseItem = readonly type: "function_call"; } | { - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly call_id?: string | null; readonly execution: string; readonly id?: string | null; @@ -34129,9 +48516,11 @@ export type ClientRequest__ResponseItem = readonly type: "tool_search_call"; } | { - readonly call_id: string; + readonly call_id?: string | null; readonly id?: string | null; readonly internal_chat_message_metadata_passthrough?: ClientRequest__InternalChatMessageMetadataPassthrough | null; + readonly name?: string | null; + readonly namespace?: string | null; readonly output: ClientRequest__FunctionCallOutputBody; readonly type: "function_call_output"; } @@ -34159,7 +48548,7 @@ export type ClientRequest__ResponseItem = readonly id?: string | null; readonly internal_chat_message_metadata_passthrough?: ClientRequest__InternalChatMessageMetadataPassthrough | null; readonly status: string; - readonly tools: ReadonlyArray; + readonly tools: ReadonlyArray; readonly type: "tool_search_output"; } | { @@ -34183,6 +48572,10 @@ export type ClientRequest__ResponseItem = readonly internal_chat_message_metadata_passthrough?: ClientRequest__InternalChatMessageMetadataPassthrough | null; readonly type: "compaction"; } + | { + readonly reasoning: ClientRequest__ConfigurationReasoning; + readonly type: "configuration_update"; + } | { readonly type: "compaction_trigger" } | { readonly encrypted_content?: string | null; @@ -34252,6 +48645,9 @@ export const ClientRequest__ResponseItem = Schema.Union( Schema.Struct({ arguments: Schema.String, call_id: Schema.String, + encrypted_function_args: Schema.optionalKey( + Schema.Union([Schema.Array(Schema.String), Schema.Null]), + ), id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), internal_chat_message_metadata_passthrough: Schema.optionalKey( Schema.Union([ClientRequest__InternalChatMessageMetadataPassthrough, Schema.Null]), @@ -34261,7 +48657,7 @@ export const ClientRequest__ResponseItem = Schema.Union( type: Schema.Literal("function_call").annotate({ title: "FunctionCallResponseItemType" }), }).annotate({ title: "FunctionCallResponseItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), execution: Schema.String, id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -34274,11 +48670,13 @@ export const ClientRequest__ResponseItem = Schema.Union( }), }).annotate({ title: "ToolSearchCallResponseItem" }), Schema.Struct({ - call_id: Schema.String, + call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), internal_chat_message_metadata_passthrough: Schema.optionalKey( Schema.Union([ClientRequest__InternalChatMessageMetadataPassthrough, Schema.Null]), ), + name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), output: ClientRequest__FunctionCallOutputBody, type: Schema.Literal("function_call_output").annotate({ title: "FunctionCallOutputResponseItemType", @@ -34318,7 +48716,7 @@ export const ClientRequest__ResponseItem = Schema.Union( Schema.Union([ClientRequest__InternalChatMessageMetadataPassthrough, Schema.Null]), ), status: Schema.String, - tools: Schema.Array(Schema.Unknown), + tools: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), type: Schema.Literal("tool_search_output").annotate({ title: "ToolSearchOutputResponseItemType", }), @@ -34354,6 +48752,15 @@ export const ClientRequest__ResponseItem = Schema.Union( ), type: Schema.Literal("compaction").annotate({ title: "CompactionResponseItemType" }), }).annotate({ title: "CompactionResponseItem" }), + Schema.Struct({ + reasoning: ClientRequest__ConfigurationReasoning, + type: Schema.Literal("configuration_update").annotate({ + title: "ConfigurationUpdateResponseItemType", + }), + }).annotate({ + title: "ConfigurationUpdateResponseItem", + description: "A durable input control interpreted by the backend at its position in history.", + }), Schema.Struct({ type: Schema.Literal("compaction_trigger").annotate({ title: "CompactionTriggerResponseItemType", @@ -34378,33 +48785,16 @@ export const ClientRequest__ResponseItem = Schema.Union( export type ClientRequest__SelectedCapabilityRoot = { readonly id: string; - readonly location: { - readonly environmentId: string; - readonly path: string; - readonly type: "environment"; - }; + readonly location: ClientRequest__CapabilityRootLocation; }; export const ClientRequest__SelectedCapabilityRoot = Schema.Struct({ id: Schema.String.annotate({ description: "Stable identifier supplied by the capability selection platform.", }), - location: Schema.Union( - [ - Schema.Struct({ - environmentId: Schema.String, - path: Schema.String.annotate({ - description: "Absolute path for the root in the selected environment.", - }), - type: Schema.Literal("environment").annotate({ - title: "EnvironmentCapabilityRootLocationType", - }), - }).annotate({ - title: "EnvironmentCapabilityRootLocation", - description: "A path owned by an execution environment.", - }), - ], - { mode: "oneOf" }, - ).annotate({ description: "Location used to resolve a selected capability root." }), + location: Schema.suspend( + (): Schema.Codec => + ClientRequest__CapabilityRootLocation, + ).annotate({ description: "Where the selected root can be resolved." }), }).annotate({ description: "A user-selected root that can expose one or more runtime capabilities.", }); @@ -34426,16 +48816,24 @@ export const ClientRequest__ThreadRealtimeAudioChunk = Schema.Struct({ data: Schema.String, itemId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), numChannels: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), sampleRate: Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), samplesPerChannel: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -34454,7 +48852,8 @@ export const ClientRequest__ThreadRealtimeInitialItem = Schema.Struct({ export type ClientRequest__ThreadRealtimeStartTransport = | { readonly type: "websocket" } - | { readonly sdp: string; readonly type: "webrtc" }; + | { readonly sdp: string; readonly type: "webrtc" } + | { readonly callId: string; readonly type: "existingCall" }; export const ClientRequest__ThreadRealtimeStartTransport = Schema.Union( [ Schema.Struct({ @@ -34469,6 +48868,14 @@ export const ClientRequest__ThreadRealtimeStartTransport = Schema.Union( }), type: Schema.Literal("webrtc").annotate({ title: "WebrtcThreadRealtimeStartTransportType" }), }).annotate({ title: "WebrtcThreadRealtimeStartTransport" }), + Schema.Struct({ + callId: Schema.String.annotate({ + description: "Identifier of a realtime call already created and negotiated by the client.", + }), + type: Schema.Literal("existingCall").annotate({ + title: "ExistingCallThreadRealtimeStartTransportType", + }), + }).annotate({ title: "ExistingCallThreadRealtimeStartTransport" }), ], { mode: "oneOf" }, ).annotate({ description: "EXPERIMENTAL - transport used by thread realtime." }); @@ -34487,8 +48894,12 @@ export const ClientRequest__ThreadResumeInitialTurnsPageParams = Schema.Struct({ limit: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Optional turn page size.", format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -34499,6 +48910,13 @@ export const ClientRequest__ThreadResumeInitialTurnsPageParams = Schema.Struct({ ), }); +export type ClientRequest__ThreadSearchSortKey = "created_at" | "updated_at" | "recency_at"; +export const ClientRequest__ThreadSearchSortKey = Schema.Literals([ + "created_at", + "updated_at", + "recency_at", +]); + export type ClientRequest__TurnEnvironmentParams = { readonly cwd: ClientRequest__LegacyAppPathString; readonly environmentId: string; @@ -34524,6 +48942,7 @@ export type CommandExecutionRequestApprovalParams = { readonly cwd?: CommandExecutionRequestApprovalParams__LegacyAppPathString | null; readonly environmentId?: string | null; readonly itemId: string; + readonly kind?: CommandExecutionRequestApprovalParams__CommandExecutionApprovalKind; readonly networkApprovalContext?: CommandExecutionRequestApprovalParams__NetworkApprovalContext | null; readonly proposedExecpolicyAmendment?: ReadonlyArray | null; readonly proposedNetworkPolicyAmendments?: ReadonlyArray | null; @@ -34537,7 +48956,7 @@ export const CommandExecutionRequestApprovalParams = Schema.Struct({ Schema.Union([ Schema.String.annotate({ description: - "Unique identifier for this specific approval callback.\n\nFor regular shell/unified_exec approvals, this is null.\n\nFor zsh-exec-bridge subcommand approvals, multiple callbacks can belong to one parent `itemId`, so `approvalId` is a distinct opaque callback id (a UUID) used to disambiguate routing.", + "Unique identifier for this specific approval callback.\n\nFor regular shell/unified_exec approvals, this is null.\n\nFor zsh-exec-bridge subcommand approvals, multiple callbacks can belong to one parent `itemId`, so `approvalId` is a distinct opaque callback id (a UUID) used to disambiguate routing. Stdin approvals also use a distinct callback id; inspect `kind` to distinguish them.", }), Schema.Null, ]), @@ -34569,6 +48988,15 @@ export const CommandExecutionRequestApprovalParams = Schema.Struct({ ]), ), itemId: Schema.String, + kind: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + CommandExecutionRequestApprovalParams__CommandExecutionApprovalKind, + ).annotate({ + description: "Kind of action under review. Defaults to `command` for older servers.", + default: "command", + }), + ), networkApprovalContext: Schema.optionalKey( Schema.Union([ CommandExecutionRequestApprovalParams__NetworkApprovalContext, @@ -34604,7 +49032,7 @@ export const CommandExecutionRequestApprovalParams = Schema.Struct({ startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this approval request started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), threadId: Schema.String, turnId: Schema.String, }).annotate({ title: "CommandExecutionRequestApprovalParams" }); @@ -34685,7 +49113,7 @@ export const CommandExecutionRequestApprovalResponse = Schema.Struct({ }).annotate({ title: "CommandExecutionRequestApprovalResponse" }); export type DynamicToolCallParams = { - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly callId: string; readonly namespace?: string | null; readonly threadId: string; @@ -34693,7 +49121,7 @@ export type DynamicToolCallParams = { readonly turnId: string; }; export const DynamicToolCallParams = Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), callId: Schema.String, namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), threadId: Schema.String, @@ -34774,7 +49202,7 @@ export const FileChangeRequestApprovalParams = Schema.Struct({ startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this approval request started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), threadId: Schema.String, turnId: Schema.String, }).annotate({ title: "FileChangeRequestApprovalParams" }); @@ -34830,12 +49258,12 @@ export const GetAuthStatusParams = Schema.Struct({ }).annotate({ title: "GetAuthStatusParams" }); export type GetAuthStatusResponse = { - readonly authMethod: unknown | null; + readonly authMethod: Schema.Json | null; readonly authToken: string | null; readonly requiresOpenaiAuth: boolean | null; }; export const GetAuthStatusResponse = Schema.Struct({ - authMethod: Schema.Union([Schema.Unknown, Schema.Null]), + authMethod: Schema.Union([Schema.Json.annotate({ expected: "JSON value" }), Schema.Null]), authToken: Schema.Union([Schema.String, Schema.Null]), requiresOpenaiAuth: Schema.Union([Schema.Boolean, Schema.Null]), }).annotate({ title: "GetAuthStatusResponse" }); @@ -34848,10 +49276,10 @@ export const GetConversationSummaryParams = Schema.Union( { mode: "oneOf" }, ).annotate({ title: "GetConversationSummaryParams" }); -export type GetConversationSummaryResponse = { readonly summary: unknown }; -export const GetConversationSummaryResponse = Schema.Struct({ summary: Schema.Unknown }).annotate({ - title: "GetConversationSummaryResponse", -}); +export type GetConversationSummaryResponse = { readonly summary: Schema.Json }; +export const GetConversationSummaryResponse = Schema.Struct({ + summary: Schema.Json.annotate({ expected: "JSON value" }), +}).annotate({ title: "GetConversationSummaryResponse" }); export type GitDiffToRemoteParams = { readonly cwd: string }; export const GitDiffToRemoteParams = Schema.Struct({ cwd: Schema.String }).annotate({ @@ -34878,12 +49306,14 @@ export const JSONRPCError = Schema.Struct({ export type JSONRPCErrorError = { readonly code: number; - readonly data?: unknown; + readonly data?: Schema.Json; readonly message: string; }; export const JSONRPCErrorError = Schema.Struct({ - code: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - data: Schema.optionalKey(Schema.Unknown), + code: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + data: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), message: Schema.String, }).annotate({ title: "JSONRPCErrorError" }); @@ -34903,10 +49333,10 @@ export const JSONRPCMessage = Schema.Union([ "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.", }); -export type JSONRPCNotification = { readonly method: string; readonly params?: unknown }; +export type JSONRPCNotification = { readonly method: string; readonly params?: Schema.Json }; export const JSONRPCNotification = Schema.Struct({ method: Schema.String, - params: Schema.optionalKey(Schema.Unknown), + params: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), }).annotate({ title: "JSONRPCNotification", description: "A notification which does not expect a response.", @@ -34915,13 +49345,13 @@ export const JSONRPCNotification = Schema.Struct({ export type JSONRPCRequest = { readonly id: JSONRPCRequest__RequestId; readonly method: string; - readonly params?: unknown; + readonly params?: Schema.Json; readonly trace?: JSONRPCRequest__W3cTraceContext | null; }; export const JSONRPCRequest = Schema.Struct({ id: JSONRPCRequest__RequestId, method: Schema.String, - params: Schema.optionalKey(Schema.Unknown), + params: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), trace: Schema.optionalKey( Schema.Union([JSONRPCRequest__W3cTraceContext, Schema.Null]).annotate({ description: "Optional W3C Trace Context for distributed tracing.", @@ -34929,10 +49359,13 @@ export const JSONRPCRequest = Schema.Struct({ ), }).annotate({ title: "JSONRPCRequest", description: "A request that expects a response." }); -export type JSONRPCResponse = { readonly id: JSONRPCResponse__RequestId; readonly result: unknown }; +export type JSONRPCResponse = { + readonly id: JSONRPCResponse__RequestId; + readonly result: Schema.Json; +}; export const JSONRPCResponse = Schema.Struct({ id: JSONRPCResponse__RequestId, - result: Schema.Unknown, + result: Schema.Json.annotate({ expected: "JSON value" }), }).annotate({ title: "JSONRPCResponse", description: "A successful (non-error) response to a request.", @@ -34940,40 +49373,62 @@ export const JSONRPCResponse = Schema.Struct({ export type McpServerElicitationRequestParams = | { - readonly _meta?: unknown; + readonly serverName: string; + readonly threadId: string; + readonly turnId?: string | null; + readonly _meta?: Schema.Json; readonly message: string; readonly mode: "form"; readonly requestedSchema: McpServerElicitationRequestParams__McpElicitationSchema; + } + | { readonly serverName: string; readonly threadId: string; readonly turnId?: string | null; - } - | { - readonly _meta?: unknown; + readonly _meta?: Schema.Json; readonly message: string; readonly mode: "openai/form"; - readonly requestedSchema: unknown; + readonly requestedSchema: Schema.Json; + } + | { readonly serverName: string; readonly threadId: string; readonly turnId?: string | null; + readonly _meta?: Schema.Json; + readonly message: string; + readonly mode: "openaiForm"; + readonly requestedSchema: Schema.Json; } | { - readonly _meta?: unknown; + readonly serverName: string; + readonly threadId: string; + readonly turnId?: string | null; + readonly _meta?: Schema.Json; readonly elicitationId: string; readonly message: string; readonly mode: "url"; readonly url: string; - readonly serverName: string; - readonly threadId: string; - readonly turnId?: string | null; }; export const McpServerElicitationRequestParams = Schema.Union( [ Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), + serverName: Schema.String, + threadId: Schema.String, + turnId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Active Codex turn when this elicitation was observed, if app-server could correlate one.\n\nThis is nullable because MCP models elicitation as a standalone server-to-client request identified by the MCP server request id. It may be triggered during a turn, but turn context is app-server correlation rather than part of the protocol identity of the elicitation itself.", + }), + Schema.Null, + ]), + ), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), message: Schema.String, mode: Schema.Literal("form"), requestedSchema: McpServerElicitationRequestParams__McpElicitationSchema, + }), + Schema.Struct({ serverName: Schema.String, threadId: Schema.String, turnId: Schema.optionalKey( @@ -34985,12 +49440,12 @@ export const McpServerElicitationRequestParams = Schema.Union( Schema.Null, ]), ), - }).annotate({ title: "McpServerElicitationRequestParams" }), - Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), message: Schema.String, mode: Schema.Literal("openai/form"), - requestedSchema: Schema.Unknown, + requestedSchema: Schema.Json.annotate({ expected: "JSON value" }), + }), + Schema.Struct({ serverName: Schema.String, threadId: Schema.String, turnId: Schema.optionalKey( @@ -35002,13 +49457,12 @@ export const McpServerElicitationRequestParams = Schema.Union( Schema.Null, ]), ), - }).annotate({ title: "McpServerElicitationRequestParams" }), - Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - elicitationId: Schema.String, + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), message: Schema.String, - mode: Schema.Literal("url"), - url: Schema.String, + mode: Schema.Literal("openaiForm"), + requestedSchema: Schema.Json.annotate({ expected: "JSON value" }), + }), + Schema.Struct({ serverName: Schema.String, threadId: Schema.String, turnId: Schema.optionalKey( @@ -35020,25 +49474,32 @@ export const McpServerElicitationRequestParams = Schema.Union( Schema.Null, ]), ), - }).annotate({ title: "McpServerElicitationRequestParams" }), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + elicitationId: Schema.String, + message: Schema.String, + mode: Schema.Literal("url"), + url: Schema.String, + }), ], { mode: "oneOf" }, -); +).annotate({ title: "McpServerElicitationRequestParams" }); export type McpServerElicitationRequestResponse = { - readonly _meta?: unknown; + readonly _meta?: Schema.Json; readonly action: McpServerElicitationRequestResponse__McpServerElicitationAction; - readonly content?: unknown; + readonly content?: Schema.Json; }; export const McpServerElicitationRequestResponse = Schema.Struct({ _meta: Schema.optionalKey( - Schema.Unknown.annotate({ + Schema.Json.annotate({ + expected: "JSON value", description: "Optional client metadata for form-mode action handling.", }), ), action: McpServerElicitationRequestResponse__McpServerElicitationAction, content: Schema.optionalKey( - Schema.Unknown.annotate({ + Schema.Json.annotate({ + expected: "JSON value", description: "Structured user input for accepted elicitations, mirroring RMCP `CreateElicitationResult`.\n\nThis is nullable because decline/cancel responses have no content.", }), @@ -35046,7 +49507,7 @@ export const McpServerElicitationRequestResponse = Schema.Struct({ }).annotate({ title: "McpServerElicitationRequestResponse" }); export type PermissionsRequestApprovalParams = { - readonly cwd: PermissionsRequestApprovalParams__AbsolutePathBuf; + readonly cwd: PermissionsRequestApprovalParams__LegacyAppPathString; readonly environmentId?: string | null; readonly itemId: string; readonly permissions: PermissionsRequestApprovalParams__RequestPermissionProfile; @@ -35056,7 +49517,7 @@ export type PermissionsRequestApprovalParams = { readonly turnId: string; }; export const PermissionsRequestApprovalParams = Schema.Struct({ - cwd: PermissionsRequestApprovalParams__AbsolutePathBuf, + cwd: PermissionsRequestApprovalParams__LegacyAppPathString, environmentId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), itemId: Schema.String, permissions: PermissionsRequestApprovalParams__RequestPermissionProfile, @@ -35064,19 +49525,24 @@ export const PermissionsRequestApprovalParams = Schema.Struct({ startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this approval request started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), threadId: Schema.String, turnId: Schema.String, }).annotate({ title: "PermissionsRequestApprovalParams" }); export type PermissionsRequestApprovalResponse = { readonly permissions: PermissionsRequestApprovalResponse__GrantedPermissionProfile; - readonly scope?: "turn" | "session"; + readonly scope?: PermissionsRequestApprovalResponse__PermissionGrantScope; readonly strictAutoReview?: boolean | null; }; export const PermissionsRequestApprovalResponse = Schema.Struct({ permissions: PermissionsRequestApprovalResponse__GrantedPermissionProfile, - scope: Schema.optionalKey(Schema.Literals(["turn", "session"]).annotate({ default: "turn" })), + scope: Schema.optionalKey( + Schema.suspend( + (): Schema.Codec => + PermissionsRequestApprovalResponse__PermissionGrantScope, + ).annotate({ default: "turn" }), + ), strictAutoReview: Schema.optionalKey( Schema.Union([ Schema.Boolean.annotate({ @@ -35088,1571 +49554,1530 @@ export const PermissionsRequestApprovalResponse = Schema.Struct({ ), }).annotate({ title: "PermissionsRequestApprovalResponse" }); -export type PermissionsRequestApprovalResponse__PermissionGrantScope = "turn" | "session"; -export const PermissionsRequestApprovalResponse__PermissionGrantScope = Schema.Literals([ - "turn", - "session", -]); - export type RequestId = string | number; export const RequestId = Schema.Union([ Schema.String, - Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), ]).annotate({ title: "RequestId" }); export type ServerNotification = | { + readonly emittedAtMs?: number; readonly method: "error"; readonly params: ServerNotification__ErrorNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/started"; readonly params: ServerNotification__ThreadStartedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/status/changed"; readonly params: ServerNotification__ThreadStatusChangedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/archived"; readonly params: ServerNotification__ThreadArchivedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/deleted"; readonly params: ServerNotification__ThreadDeletedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/unarchived"; readonly params: ServerNotification__ThreadUnarchivedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/closed"; readonly params: ServerNotification__ThreadClosedNotification; + } + | { readonly emittedAtMs?: number; + readonly method: "thread/reverted"; + readonly params: ServerNotification__ThreadRevertedNotification; } | { + readonly emittedAtMs?: number; readonly method: "skills/changed"; readonly params: ServerNotification__SkillsChangedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/name/updated"; readonly params: ServerNotification__ThreadNameUpdatedNotification; + } + | { readonly emittedAtMs?: number; + readonly method: "thread/attachment/updated"; + readonly params: ServerNotification__ThreadAttachmentUpdatedNotification; } | { + readonly emittedAtMs?: number; readonly method: "thread/goal/updated"; readonly params: ServerNotification__ThreadGoalUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/goal/cleared"; readonly params: ServerNotification__ThreadGoalClearedNotification; + } + | { + readonly emittedAtMs?: number; + readonly method: "thread/queue/changed"; + readonly params: ServerNotification__ThreadQueueChangedNotification; + } + | { + readonly emittedAtMs?: number; + readonly method: "project/changed"; + readonly params: ServerNotification__ProjectChangedNotification; + } + | { readonly emittedAtMs?: number; + readonly method: "thread/project/updated"; + readonly params: ServerNotification__ThreadProjectUpdatedNotification; } | { + readonly emittedAtMs?: number; readonly method: "thread/environment/connected"; readonly params: ServerNotification__EnvironmentConnectionNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/environment/disconnected"; readonly params: ServerNotification__EnvironmentConnectionNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/settings/updated"; readonly params: ServerNotification__ThreadSettingsUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/tokenUsage/updated"; readonly params: ServerNotification__ThreadTokenUsageUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "turn/started"; readonly params: ServerNotification__TurnStartedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "hook/started"; readonly params: ServerNotification__HookStartedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "turn/completed"; readonly params: ServerNotification__TurnCompletedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "hook/completed"; readonly params: ServerNotification__HookCompletedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "turn/diff/updated"; readonly params: ServerNotification__TurnDiffUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "turn/plan/updated"; readonly params: ServerNotification__TurnPlanUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/started"; readonly params: ServerNotification__ItemStartedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/autoApprovalReview/started"; readonly params: ServerNotification__ItemGuardianApprovalReviewStartedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/autoApprovalReview/completed"; readonly params: ServerNotification__ItemGuardianApprovalReviewCompletedNotification; + } + | { readonly emittedAtMs?: number; + readonly method: "autoApprovalReview/strictReviewRequired"; + readonly params: ServerNotification__StrictReviewRequiredNotification; } | { + readonly emittedAtMs?: number; readonly method: "item/completed"; readonly params: ServerNotification__ItemCompletedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/agentMessage/delta"; readonly params: ServerNotification__AgentMessageDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/plan/delta"; readonly params: ServerNotification__PlanDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "command/exec/outputDelta"; readonly params: ServerNotification__CommandExecOutputDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "process/outputDelta"; readonly params: ServerNotification__ProcessOutputDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "process/exited"; readonly params: ServerNotification__ProcessExitedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/commandExecution/outputDelta"; readonly params: ServerNotification__CommandExecutionOutputDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/commandExecution/terminalInteraction"; readonly params: ServerNotification__TerminalInteractionNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/fileChange/outputDelta"; readonly params: ServerNotification__FileChangeOutputDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/fileChange/patchUpdated"; readonly params: ServerNotification__FileChangePatchUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "serverRequest/resolved"; readonly params: ServerNotification__ServerRequestResolvedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/mcpToolCall/progress"; readonly params: ServerNotification__McpToolCallProgressNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "mcpServer/oauthLogin/completed"; readonly params: ServerNotification__McpServerOauthLoginCompletedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "mcpServer/startupStatus/updated"; readonly params: ServerNotification__McpServerStatusUpdatedNotification; + } + | { readonly emittedAtMs?: number; + readonly method: "mcpServer/event/stream/notification"; + readonly params: ServerNotification__McpServerEventStreamNotification; } | { + readonly emittedAtMs?: number; readonly method: "account/updated"; readonly params: ServerNotification__AccountUpdatedNotification; + } + | { readonly emittedAtMs?: number; + readonly method: "account/gatewayOAuth/changed"; + readonly params: ServerNotification__GatewayOAuthChangedNotification; } | { + readonly emittedAtMs?: number; readonly method: "account/rateLimits/updated"; readonly params: ServerNotification__AccountRateLimitsUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "app/list/updated"; readonly params: ServerNotification__AppListUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "remoteControl/status/changed"; readonly params: ServerNotification__RemoteControlStatusChangedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "externalAgentConfig/import/progress"; readonly params: ServerNotification__ExternalAgentConfigImportProgressNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "externalAgentConfig/import/completed"; readonly params: ServerNotification__ExternalAgentConfigImportCompletedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "fs/changed"; readonly params: ServerNotification__FsChangedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/reasoning/summaryTextDelta"; readonly params: ServerNotification__ReasoningSummaryTextDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/reasoning/summaryPartAdded"; readonly params: ServerNotification__ReasoningSummaryPartAddedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "item/reasoning/textDelta"; readonly params: ServerNotification__ReasoningTextDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/compacted"; readonly params: ServerNotification__ContextCompactedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "model/rerouted"; readonly params: ServerNotification__ModelReroutedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "model/verification"; readonly params: ServerNotification__ModelVerificationNotification; + } + | { + readonly emittedAtMs?: number; + readonly method: "modelProvider/authRecoveryStarted"; + readonly params: ServerNotification__AuthRecoveryNotification; + } + | { readonly emittedAtMs?: number; + readonly method: "modelProvider/authRecoveryCompleted"; + readonly params: ServerNotification__AuthRecoveryNotification; } | { + readonly emittedAtMs?: number; readonly method: "turn/moderationMetadata"; readonly params: ServerNotification__TurnModerationMetadataNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "model/safetyBuffering/updated"; readonly params: ServerNotification__ModelSafetyBufferingUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "warning"; readonly params: ServerNotification__WarningNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "guardianWarning"; readonly params: ServerNotification__GuardianWarningNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "deprecationNotice"; readonly params: ServerNotification__DeprecationNoticeNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "configWarning"; readonly params: ServerNotification__ConfigWarningNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "fuzzyFileSearch/sessionUpdated"; readonly params: ServerNotification__FuzzyFileSearchSessionUpdatedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "fuzzyFileSearch/sessionCompleted"; readonly params: ServerNotification__FuzzyFileSearchSessionCompletedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/realtime/started"; readonly params: ServerNotification__ThreadRealtimeStartedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/realtime/itemAdded"; readonly params: ServerNotification__ThreadRealtimeItemAddedNotification; + } + | { + readonly emittedAtMs?: number; + readonly method: "thread/realtime/item/started"; + readonly params: ServerNotification__ThreadRealtimeItemStartedNotification; + } + | { readonly emittedAtMs?: number; + readonly method: "thread/realtime/item/transcript/delta"; + readonly params: ServerNotification__ThreadRealtimeItemTranscriptDeltaNotification; } | { + readonly emittedAtMs?: number; + readonly method: "thread/realtime/item/completed"; + readonly params: ServerNotification__ThreadRealtimeItemCompletedNotification; + } + | { + readonly emittedAtMs?: number; readonly method: "thread/realtime/transcript/delta"; readonly params: ServerNotification__ThreadRealtimeTranscriptDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/realtime/transcript/done"; readonly params: ServerNotification__ThreadRealtimeTranscriptDoneNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/realtime/outputAudio/delta"; readonly params: ServerNotification__ThreadRealtimeOutputAudioDeltaNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/realtime/sdp"; readonly params: ServerNotification__ThreadRealtimeSdpNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/realtime/error"; readonly params: ServerNotification__ThreadRealtimeErrorNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "thread/realtime/closed"; readonly params: ServerNotification__ThreadRealtimeClosedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "windows/worldWritableWarning"; readonly params: ServerNotification__WindowsWorldWritableWarningNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "windowsSandbox/setupCompleted"; readonly params: ServerNotification__WindowsSandboxSetupCompletedNotification; - readonly emittedAtMs?: number; } | { + readonly emittedAtMs?: number; readonly method: "account/login/completed"; readonly params: ServerNotification__AccountLoginCompletedNotification; - readonly emittedAtMs?: number; }; export const ServerNotification = Schema.Union( [ Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("error").annotate({ title: "ErrorNotificationMethod" }), params: ServerNotification__ErrorNotification, + }).annotate({ title: "ErrorNotification", description: "NEW NOTIFICATIONS" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/started").annotate({ title: "Thread/startedNotificationMethod", }), params: ServerNotification__ThreadStartedNotification, + }).annotate({ title: "Thread/startedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/status/changed").annotate({ title: "Thread/status/changedNotificationMethod", }), params: ServerNotification__ThreadStatusChangedNotification, + }).annotate({ title: "Thread/status/changedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/archived").annotate({ title: "Thread/archivedNotificationMethod", }), params: ServerNotification__ThreadArchivedNotification, + }).annotate({ title: "Thread/archivedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/deleted").annotate({ title: "Thread/deletedNotificationMethod", }), params: ServerNotification__ThreadDeletedNotification, + }).annotate({ title: "Thread/deletedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/unarchived").annotate({ title: "Thread/unarchivedNotificationMethod", }), params: ServerNotification__ThreadUnarchivedNotification, + }).annotate({ title: "Thread/unarchivedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/closed").annotate({ title: "Thread/closedNotificationMethod", }), params: ServerNotification__ThreadClosedNotification, + }).annotate({ title: "Thread/closedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + method: Schema.Literal("thread/reverted").annotate({ + title: "Thread/revertedNotificationMethod", + }), + params: ServerNotification__ThreadRevertedNotification, + }).annotate({ title: "Thread/revertedNotification" }), Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("skills/changed").annotate({ title: "Skills/changedNotificationMethod", }), params: ServerNotification__SkillsChangedNotification, + }).annotate({ title: "Skills/changedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/name/updated").annotate({ title: "Thread/name/updatedNotificationMethod", }), params: ServerNotification__ThreadNameUpdatedNotification, + }).annotate({ title: "Thread/name/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + method: Schema.Literal("thread/attachment/updated").annotate({ + title: "Thread/attachment/updatedNotificationMethod", + }), + params: ServerNotification__ThreadAttachmentUpdatedNotification, + }).annotate({ title: "Thread/attachment/updatedNotification" }), Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("thread/goal/updated").annotate({ title: "Thread/goal/updatedNotificationMethod", }), params: ServerNotification__ThreadGoalUpdatedNotification, + }).annotate({ title: "Thread/goal/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/goal/cleared").annotate({ title: "Thread/goal/clearedNotificationMethod", }), params: ServerNotification__ThreadGoalClearedNotification, + }).annotate({ title: "Thread/goal/clearedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + method: Schema.Literal("thread/queue/changed").annotate({ + title: "Thread/queue/changedNotificationMethod", + }), + params: ServerNotification__ThreadQueueChangedNotification, + }).annotate({ title: "Thread/queue/changedNotification" }), + Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), + method: Schema.Literal("project/changed").annotate({ + title: "Project/changedNotificationMethod", + }), + params: ServerNotification__ProjectChangedNotification, + }).annotate({ title: "Project/changedNotification" }), + Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), + method: Schema.Literal("thread/project/updated").annotate({ + title: "Thread/project/updatedNotificationMethod", + }), + params: ServerNotification__ThreadProjectUpdatedNotification, + }).annotate({ title: "Thread/project/updatedNotification" }), Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("thread/environment/connected").annotate({ title: "Thread/environment/connectedNotificationMethod", }), params: ServerNotification__EnvironmentConnectionNotification, + }).annotate({ title: "Thread/environment/connectedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/environment/disconnected").annotate({ title: "Thread/environment/disconnectedNotificationMethod", }), params: ServerNotification__EnvironmentConnectionNotification, + }).annotate({ title: "Thread/environment/disconnectedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/settings/updated").annotate({ title: "Thread/settings/updatedNotificationMethod", }), params: ServerNotification__ThreadSettingsUpdatedNotification, + }).annotate({ title: "Thread/settings/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/tokenUsage/updated").annotate({ title: "Thread/tokenUsage/updatedNotificationMethod", }), params: ServerNotification__ThreadTokenUsageUpdatedNotification, + }).annotate({ title: "Thread/tokenUsage/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("turn/started").annotate({ title: "Turn/startedNotificationMethod" }), params: ServerNotification__TurnStartedNotification, + }).annotate({ title: "Turn/startedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("hook/started").annotate({ title: "Hook/startedNotificationMethod" }), params: ServerNotification__HookStartedNotification, + }).annotate({ title: "Hook/startedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("turn/completed").annotate({ title: "Turn/completedNotificationMethod", }), params: ServerNotification__TurnCompletedNotification, + }).annotate({ title: "Turn/completedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("hook/completed").annotate({ title: "Hook/completedNotificationMethod", }), params: ServerNotification__HookCompletedNotification, + }).annotate({ title: "Hook/completedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("turn/diff/updated").annotate({ title: "Turn/diff/updatedNotificationMethod", }), params: ServerNotification__TurnDiffUpdatedNotification, + }).annotate({ title: "Turn/diff/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("turn/plan/updated").annotate({ title: "Turn/plan/updatedNotificationMethod", }), params: ServerNotification__TurnPlanUpdatedNotification, + }).annotate({ title: "Turn/plan/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/started").annotate({ title: "Item/startedNotificationMethod" }), params: ServerNotification__ItemStartedNotification, + }).annotate({ title: "Item/startedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/autoApprovalReview/started").annotate({ title: "Item/autoApprovalReview/startedNotificationMethod", }), params: ServerNotification__ItemGuardianApprovalReviewStartedNotification, + }).annotate({ title: "Item/autoApprovalReview/startedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/autoApprovalReview/completed").annotate({ title: "Item/autoApprovalReview/completedNotificationMethod", }), params: ServerNotification__ItemGuardianApprovalReviewCompletedNotification, + }).annotate({ title: "Item/autoApprovalReview/completedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + method: Schema.Literal("autoApprovalReview/strictReviewRequired").annotate({ + title: "AutoApprovalReview/strictReviewRequiredNotificationMethod", + }), + params: ServerNotification__StrictReviewRequiredNotification, + }).annotate({ title: "AutoApprovalReview/strictReviewRequiredNotification" }), Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("item/completed").annotate({ title: "Item/completedNotificationMethod", }), params: ServerNotification__ItemCompletedNotification, + }).annotate({ title: "Item/completedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/agentMessage/delta").annotate({ title: "Item/agentMessage/deltaNotificationMethod", }), params: ServerNotification__AgentMessageDeltaNotification, + }).annotate({ title: "Item/agentMessage/deltaNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/plan/delta").annotate({ title: "Item/plan/deltaNotificationMethod", }), params: ServerNotification__PlanDeltaNotification, + }).annotate({ + title: "Item/plan/deltaNotification", + description: "EXPERIMENTAL - proposed plan streaming deltas for plan items.", + }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("command/exec/outputDelta").annotate({ title: "Command/exec/outputDeltaNotificationMethod", }), params: ServerNotification__CommandExecOutputDeltaNotification, + }).annotate({ + title: "Command/exec/outputDeltaNotification", + description: + "Stream base64-encoded stdout/stderr chunks for a running `command/exec` session.", + }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("process/outputDelta").annotate({ title: "Process/outputDeltaNotificationMethod", }), params: ServerNotification__ProcessOutputDeltaNotification, + }).annotate({ + title: "Process/outputDeltaNotification", + description: + "Stream base64-encoded stdout/stderr chunks for a running `process/spawn` session.", + }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("process/exited").annotate({ title: "Process/exitedNotificationMethod", }), params: ServerNotification__ProcessExitedNotification, + }).annotate({ + title: "Process/exitedNotification", + description: "Final exit notification for a `process/spawn` session.", + }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/commandExecution/outputDelta").annotate({ title: "Item/commandExecution/outputDeltaNotificationMethod", }), params: ServerNotification__CommandExecutionOutputDeltaNotification, + }).annotate({ title: "Item/commandExecution/outputDeltaNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", - format: "int64", - }).check(Schema.isInt()), - ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("item/commandExecution/terminalInteraction").annotate({ title: "Item/commandExecution/terminalInteractionNotificationMethod", }), params: ServerNotification__TerminalInteractionNotification, + }).annotate({ title: "Item/commandExecution/terminalInteractionNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/fileChange/outputDelta").annotate({ title: "Item/fileChange/outputDeltaNotificationMethod", }), params: ServerNotification__FileChangeOutputDeltaNotification, + }).annotate({ + title: "Item/fileChange/outputDeltaNotification", + description: "Deprecated legacy apply_patch output stream notification.", + }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/fileChange/patchUpdated").annotate({ title: "Item/fileChange/patchUpdatedNotificationMethod", }), params: ServerNotification__FileChangePatchUpdatedNotification, + }).annotate({ title: "Item/fileChange/patchUpdatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("serverRequest/resolved").annotate({ title: "ServerRequest/resolvedNotificationMethod", }), params: ServerNotification__ServerRequestResolvedNotification, + }).annotate({ title: "ServerRequest/resolvedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/mcpToolCall/progress").annotate({ title: "Item/mcpToolCall/progressNotificationMethod", }), params: ServerNotification__McpToolCallProgressNotification, + }).annotate({ title: "Item/mcpToolCall/progressNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("mcpServer/oauthLogin/completed").annotate({ title: "McpServer/oauthLogin/completedNotificationMethod", }), params: ServerNotification__McpServerOauthLoginCompletedNotification, + }).annotate({ title: "McpServer/oauthLogin/completedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("mcpServer/startupStatus/updated").annotate({ title: "McpServer/startupStatus/updatedNotificationMethod", }), params: ServerNotification__McpServerStatusUpdatedNotification, + }).annotate({ title: "McpServer/startupStatus/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + method: Schema.Literal("mcpServer/event/stream/notification").annotate({ + title: "McpServer/event/stream/notificationNotificationMethod", + }), + params: ServerNotification__McpServerEventStreamNotification, + }).annotate({ title: "McpServer/event/stream/notificationNotification" }), Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("account/updated").annotate({ title: "Account/updatedNotificationMethod", }), params: ServerNotification__AccountUpdatedNotification, + }).annotate({ title: "Account/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + method: Schema.Literal("account/gatewayOAuth/changed").annotate({ + title: "Account/gatewayOAuth/changedNotificationMethod", + }), + params: ServerNotification__GatewayOAuthChangedNotification, + }).annotate({ title: "Account/gatewayOAuth/changedNotification" }), Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("account/rateLimits/updated").annotate({ title: "Account/rateLimits/updatedNotificationMethod", }), params: ServerNotification__AccountRateLimitsUpdatedNotification, + }).annotate({ title: "Account/rateLimits/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("app/list/updated").annotate({ title: "App/list/updatedNotificationMethod", }), params: ServerNotification__AppListUpdatedNotification, + }).annotate({ title: "App/list/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("remoteControl/status/changed").annotate({ title: "RemoteControl/status/changedNotificationMethod", }), params: ServerNotification__RemoteControlStatusChangedNotification, + }).annotate({ title: "RemoteControl/status/changedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("externalAgentConfig/import/progress").annotate({ title: "ExternalAgentConfig/import/progressNotificationMethod", }), params: ServerNotification__ExternalAgentConfigImportProgressNotification, + }).annotate({ title: "ExternalAgentConfig/import/progressNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("externalAgentConfig/import/completed").annotate({ title: "ExternalAgentConfig/import/completedNotificationMethod", }), params: ServerNotification__ExternalAgentConfigImportCompletedNotification, + }).annotate({ title: "ExternalAgentConfig/import/completedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("fs/changed").annotate({ title: "Fs/changedNotificationMethod" }), params: ServerNotification__FsChangedNotification, + }).annotate({ title: "Fs/changedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/reasoning/summaryTextDelta").annotate({ title: "Item/reasoning/summaryTextDeltaNotificationMethod", }), params: ServerNotification__ReasoningSummaryTextDeltaNotification, + }).annotate({ title: "Item/reasoning/summaryTextDeltaNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/reasoning/summaryPartAdded").annotate({ title: "Item/reasoning/summaryPartAddedNotificationMethod", }), params: ServerNotification__ReasoningSummaryPartAddedNotification, + }).annotate({ title: "Item/reasoning/summaryPartAddedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("item/reasoning/textDelta").annotate({ title: "Item/reasoning/textDeltaNotificationMethod", }), params: ServerNotification__ReasoningTextDeltaNotification, + }).annotate({ title: "Item/reasoning/textDeltaNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/compacted").annotate({ title: "Thread/compactedNotificationMethod", }), params: ServerNotification__ContextCompactedNotification, + }).annotate({ + title: "Thread/compactedNotification", + description: "Deprecated: Use `ContextCompaction` item type instead.", + }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("model/rerouted").annotate({ title: "Model/reroutedNotificationMethod", }), params: ServerNotification__ModelReroutedNotification, + }).annotate({ title: "Model/reroutedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("model/verification").annotate({ title: "Model/verificationNotificationMethod", }), params: ServerNotification__ModelVerificationNotification, + }).annotate({ title: "Model/verificationNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + method: Schema.Literal("modelProvider/authRecoveryStarted").annotate({ + title: "ModelProvider/authRecoveryStartedNotificationMethod", + }), + params: ServerNotification__AuthRecoveryNotification, + }).annotate({ title: "ModelProvider/authRecoveryStartedNotification" }), + Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), + method: Schema.Literal("modelProvider/authRecoveryCompleted").annotate({ + title: "ModelProvider/authRecoveryCompletedNotificationMethod", + }), + params: ServerNotification__AuthRecoveryNotification, + }).annotate({ title: "ModelProvider/authRecoveryCompletedNotification" }), Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("turn/moderationMetadata").annotate({ title: "Turn/moderationMetadataNotificationMethod", }), params: ServerNotification__TurnModerationMetadataNotification, + }).annotate({ title: "Turn/moderationMetadataNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("model/safetyBuffering/updated").annotate({ title: "Model/safetyBuffering/updatedNotificationMethod", }), params: ServerNotification__ModelSafetyBufferingUpdatedNotification, + }).annotate({ title: "Model/safetyBuffering/updatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("warning").annotate({ title: "WarningNotificationMethod" }), params: ServerNotification__WarningNotification, + }).annotate({ title: "WarningNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("guardianWarning").annotate({ title: "GuardianWarningNotificationMethod", }), params: ServerNotification__GuardianWarningNotification, + }).annotate({ title: "GuardianWarningNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("deprecationNotice").annotate({ title: "DeprecationNoticeNotificationMethod", }), params: ServerNotification__DeprecationNoticeNotification, + }).annotate({ title: "DeprecationNoticeNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("configWarning").annotate({ title: "ConfigWarningNotificationMethod", }), params: ServerNotification__ConfigWarningNotification, + }).annotate({ title: "ConfigWarningNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("fuzzyFileSearch/sessionUpdated").annotate({ title: "FuzzyFileSearch/sessionUpdatedNotificationMethod", }), params: ServerNotification__FuzzyFileSearchSessionUpdatedNotification, + }).annotate({ title: "FuzzyFileSearch/sessionUpdatedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("fuzzyFileSearch/sessionCompleted").annotate({ title: "FuzzyFileSearch/sessionCompletedNotificationMethod", }), params: ServerNotification__FuzzyFileSearchSessionCompletedNotification, + }).annotate({ title: "FuzzyFileSearch/sessionCompletedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/realtime/started").annotate({ title: "Thread/realtime/startedNotificationMethod", }), params: ServerNotification__ThreadRealtimeStartedNotification, + }).annotate({ title: "Thread/realtime/startedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/realtime/itemAdded").annotate({ title: "Thread/realtime/itemAddedNotificationMethod", }), params: ServerNotification__ThreadRealtimeItemAddedNotification, + }).annotate({ title: "Thread/realtime/itemAddedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + method: Schema.Literal("thread/realtime/item/started").annotate({ + title: "Thread/realtime/item/startedNotificationMethod", + }), + params: ServerNotification__ThreadRealtimeItemStartedNotification, + }).annotate({ title: "Thread/realtime/item/startedNotification" }), + Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), + method: Schema.Literal("thread/realtime/item/transcript/delta").annotate({ + title: "Thread/realtime/item/transcript/deltaNotificationMethod", + }), + params: ServerNotification__ThreadRealtimeItemTranscriptDeltaNotification, + }).annotate({ title: "Thread/realtime/item/transcript/deltaNotification" }), Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), + method: Schema.Literal("thread/realtime/item/completed").annotate({ + title: "Thread/realtime/item/completedNotificationMethod", + }), + params: ServerNotification__ThreadRealtimeItemCompletedNotification, + }).annotate({ title: "Thread/realtime/item/completedNotification" }), + Schema.Struct({ + emittedAtMs: Schema.optionalKey( + Schema.Number.annotate({ + description: + "Unix timestamp (in milliseconds) when app-server emitted this notification.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + ), method: Schema.Literal("thread/realtime/transcript/delta").annotate({ title: "Thread/realtime/transcript/deltaNotificationMethod", }), params: ServerNotification__ThreadRealtimeTranscriptDeltaNotification, + }).annotate({ title: "Thread/realtime/transcript/deltaNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/realtime/transcript/done").annotate({ title: "Thread/realtime/transcript/doneNotificationMethod", }), params: ServerNotification__ThreadRealtimeTranscriptDoneNotification, + }).annotate({ title: "Thread/realtime/transcript/doneNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/realtime/outputAudio/delta").annotate({ title: "Thread/realtime/outputAudio/deltaNotificationMethod", }), params: ServerNotification__ThreadRealtimeOutputAudioDeltaNotification, + }).annotate({ title: "Thread/realtime/outputAudio/deltaNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/realtime/sdp").annotate({ title: "Thread/realtime/sdpNotificationMethod", }), params: ServerNotification__ThreadRealtimeSdpNotification, + }).annotate({ title: "Thread/realtime/sdpNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/realtime/error").annotate({ title: "Thread/realtime/errorNotificationMethod", }), params: ServerNotification__ThreadRealtimeErrorNotification, + }).annotate({ title: "Thread/realtime/errorNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("thread/realtime/closed").annotate({ title: "Thread/realtime/closedNotificationMethod", }), params: ServerNotification__ThreadRealtimeClosedNotification, + }).annotate({ title: "Thread/realtime/closedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("windows/worldWritableWarning").annotate({ title: "Windows/worldWritableWarningNotificationMethod", }), params: ServerNotification__WindowsWorldWritableWarningNotification, + }).annotate({ + title: "Windows/worldWritableWarningNotification", + description: + "Notifies the user of world-writable directories on Windows, which cannot be protected by the sandbox.", + }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("windowsSandbox/setupCompleted").annotate({ title: "WindowsSandbox/setupCompletedNotificationMethod", }), params: ServerNotification__WindowsSandboxSetupCompletedNotification, + }).annotate({ title: "WindowsSandbox/setupCompletedNotification" }), + Schema.Struct({ emittedAtMs: Schema.optionalKey( Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when app-server emitted this notification.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), - Schema.Struct({ method: Schema.Literal("account/login/completed").annotate({ title: "Account/login/completedNotificationMethod", }), params: ServerNotification__AccountLoginCompletedNotification, - emittedAtMs: Schema.optionalKey( - Schema.Number.annotate({ - description: - "Unix timestamp (in milliseconds) when app-server emitted this notification.", - format: "int64", - }).check(Schema.isInt()), - ), - }).annotate({ - title: "ServerNotification", - description: "Notification sent from the server to the client.", - }), + }).annotate({ title: "Account/login/completedNotification" }), ], { mode: "oneOf" }, -); - -export type ServerNotification__ByteRange = { readonly end: number; readonly start: number }; -export const ServerNotification__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), +).annotate({ + title: "ServerNotification", + description: "Notification sent from the server to the client.", }); -export type ServerNotification__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const ServerNotification__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type ServerNotification__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const ServerNotification__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type ServerNotification__CommandExecOutputStream = "stdout" | "stderr"; -export const ServerNotification__CommandExecOutputStream = Schema.Literals([ - "stdout", - "stderr", -]).annotate({ description: "Stream label for `command/exec/outputDelta` notifications." }); - -export type ServerNotification__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const ServerNotification__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type ServerNotification__HookSource = - | "system" - | "user" - | "project" - | "mdm" - | "sessionFlags" - | "plugin" - | "cloudRequirements" - | "cloudManagedConfig" - | "legacyManagedConfigFile" - | "legacyManagedConfigMdm" - | "unknown"; -export const ServerNotification__HookSource = Schema.Literals([ - "system", - "user", - "project", - "mdm", - "sessionFlags", - "plugin", - "cloudRequirements", - "cloudManagedConfig", - "legacyManagedConfigFile", - "legacyManagedConfigMdm", - "unknown", -]); - export type ServerNotification__MultiAgentMode = | "explicitRequestOnly" | "proactive" @@ -36668,44 +51093,24 @@ export const ServerNotification__MultiAgentMode = Schema.Union( "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", }); -export type ServerNotification__NetworkAccess = "restricted" | "enabled"; -export const ServerNotification__NetworkAccess = Schema.Literals(["restricted", "enabled"]); - -export type ServerNotification__ProcessOutputStream = "stdout" | "stderr"; -export const ServerNotification__ProcessOutputStream = Schema.Literals([ - "stdout", - "stderr", -]).annotate({ description: "Stream label for `process/outputDelta` notifications." }); - -export type ServerNotification__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: ServerNotification__SubAgentSource }; -export const ServerNotification__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: ServerNotification__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type ServerNotification__ThreadExtra = {}; -export const ServerNotification__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", +export type ServerNotification__ThreadEnvironment = { + readonly cwd: ServerNotification__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const ServerNotification__ThreadEnvironment = Schema.Struct({ + cwd: ServerNotification__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(ServerNotification__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", }); -export type ServerNotification__ThreadHistoryMode = "legacy" | "paginated"; -export const ServerNotification__ThreadHistoryMode = Schema.Literals(["legacy", "paginated"]); - -export type ServerNotification__TurnItemsView = "notLoaded" | "summary" | "full"; -export const ServerNotification__TurnItemsView = Schema.Literals(["notLoaded", "summary", "full"]); +export type ServerNotification__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const ServerNotification__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); export type ServerRequest = | { @@ -36932,6 +51337,7 @@ export const ServerRequest__CommandExecutionApprovalDecision = Schema.Union( export type ToolRequestUserInputParams = { readonly autoResolutionMs?: number | null; + readonly isBlocking: boolean; readonly itemId: string; readonly questions: ReadonlyArray; readonly threadId: string; @@ -36940,12 +51346,20 @@ export type ToolRequestUserInputParams = { export const ToolRequestUserInputParams = Schema.Struct({ autoResolutionMs: Schema.optionalKey( Schema.Union([ - Schema.Number.annotate({ format: "uint64" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Number.annotate({ + description: "@deprecated Use `isBlocking` to decide whether the request should block.", + format: "uint64", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), + isBlocking: Schema.Boolean, itemId: Schema.String, questions: Schema.Array(ToolRequestUserInputParams__ToolRequestUserInputQuestion), threadId: Schema.String, @@ -36979,16 +51393,16 @@ export const V1InitializeParams = Schema.Struct({ }).annotate({ title: "InitializeParams" }); export type V1InitializeResponse = { - readonly codexHome: string; + readonly codexHome: V1InitializeResponse__AbsolutePathBuf; readonly platformFamily: string; readonly platformOs: string; readonly userAgent: string; }; export const V1InitializeResponse = Schema.Struct({ - codexHome: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + codexHome: Schema.suspend( + (): Schema.Codec => + V1InitializeResponse__AbsolutePathBuf, + ).annotate({ description: "Absolute path to the server's $CODEX_HOME directory." }), platformFamily: Schema.String.annotate({ description: 'Platform family for the running app-server target, for example `"unix"` or `"windows"`.', @@ -37000,20 +51414,18 @@ export const V1InitializeResponse = Schema.Struct({ userAgent: Schema.String, }).annotate({ title: "InitializeResponse" }); -export type V1InitializeResponse__AbsolutePathBuf = string; -export const V1InitializeResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - export type V2AccountLoginCompletedNotification = { readonly error?: string | null; readonly loginId?: string | null; + readonly onboardingEntrypoint?: V2AccountLoginCompletedNotification__DesktopOnboardingEntrypoint | null; readonly success: boolean; }; export const V2AccountLoginCompletedNotification = Schema.Struct({ error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), loginId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + onboardingEntrypoint: Schema.optionalKey( + Schema.Union([V2AccountLoginCompletedNotification__DesktopOnboardingEntrypoint, Schema.Null]), + ), success: Schema.Boolean, }).annotate({ title: "AccountLoginCompletedNotification" }); @@ -37120,8 +51532,12 @@ export const V2AppsListParams = Schema.Struct({ description: "Optional page size; defaults to a reasonable server-side value.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -37159,6 +51575,7 @@ export const V2AppsListResponse = Schema.Struct({ export type V2AppsReadParams = { readonly appIds: ReadonlyArray; readonly includeTools?: boolean; + readonly threadId?: string | null; }; export const V2AppsReadParams = Schema.Struct({ appIds: Schema.Array(Schema.String).annotate({ @@ -37171,6 +51588,14 @@ export const V2AppsReadParams = Schema.Struct({ "When true, include display-only public tool summaries in the returned metadata.", }), ), + threadId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional loaded thread id used to evaluate effective app configuration.", + }), + Schema.Null, + ]), + ), }).annotate({ title: "AppsReadParams", description: "EXPERIMENTAL - read metadata for specific apps/connectors.", @@ -37185,6 +51610,19 @@ export const V2AppsReadResponse = Schema.Struct({ missingAppIds: Schema.Array(Schema.String), }).annotate({ title: "AppsReadResponse", description: "EXPERIMENTAL - app/read response." }); +export type V2AuthRecoveryNotification = { + readonly message: string; + readonly provider: string; + readonly threadId: string; + readonly turnId: string; +}; +export const V2AuthRecoveryNotification = Schema.Struct({ + message: Schema.String, + provider: Schema.String, + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ title: "AuthRecoveryNotification" }); + export type V2CancelLoginAccountParams = { readonly loginId: string }; export const V2CancelLoginAccountParams = Schema.Struct({ loginId: Schema.String }).annotate({ title: "CancelLoginAccountParams", @@ -37201,7 +51639,7 @@ export type V2CommandExecOutputDeltaNotification = { readonly capReached: boolean; readonly deltaBase64: string; readonly processId: string; - readonly stream: "stdout" | "stderr"; + readonly stream: V2CommandExecOutputDeltaNotification__CommandExecOutputStream; }; export const V2CommandExecOutputDeltaNotification = Schema.Struct({ capReached: Schema.Boolean.annotate({ @@ -37213,21 +51651,16 @@ export const V2CommandExecOutputDeltaNotification = Schema.Struct({ description: "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", }), - stream: Schema.Literals(["stdout", "stderr"]).annotate({ - description: "Stream label for `command/exec/outputDelta` notifications.", - }), + stream: Schema.suspend( + (): Schema.Codec => + V2CommandExecOutputDeltaNotification__CommandExecOutputStream, + ).annotate({ description: "Output stream for this chunk." }), }).annotate({ title: "CommandExecOutputDeltaNotification", description: "Base64-encoded output chunk emitted for a streaming `command/exec` request.\n\nThese notifications are connection-scoped. If the originating connection closes, the server terminates the process.", }); -export type V2CommandExecOutputDeltaNotification__CommandExecOutputStream = "stdout" | "stderr"; -export const V2CommandExecOutputDeltaNotification__CommandExecOutputStream = Schema.Literals([ - "stdout", - "stderr", -]).annotate({ description: "Stream label for `command/exec/outputDelta` notifications." }); - export type V2CommandExecParams = { readonly command: ReadonlyArray; readonly cwd?: string | null; @@ -37283,8 +51716,12 @@ export const V2CommandExecParams = Schema.Struct({ "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", format: "uint", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -37326,7 +51763,7 @@ export const V2CommandExecParams = Schema.Struct({ description: "Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), Schema.Null, ]), ), @@ -37341,58 +51778,29 @@ export const V2CommandExecParams = Schema.Struct({ "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.", }); -export type V2CommandExecParams__NetworkAccess = "restricted" | "enabled"; -export const V2CommandExecParams__NetworkAccess = Schema.Literals(["restricted", "enabled"]); - export type V2CommandExecResizeParams = { readonly processId: string; - readonly size: { readonly cols: number; readonly rows: number }; + readonly size: V2CommandExecResizeParams__CommandExecTerminalSize; }; export const V2CommandExecResizeParams = Schema.Struct({ processId: Schema.String.annotate({ description: "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", }), - size: Schema.Struct({ - cols: Schema.Number.annotate({ - description: "Terminal width in character cells.", - format: "uint16", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - rows: Schema.Number.annotate({ - description: "Terminal height in character cells.", - format: "uint16", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - }).annotate({ description: "PTY size in character cells for `command/exec` PTY sessions." }), + size: Schema.suspend( + (): Schema.Codec => + V2CommandExecResizeParams__CommandExecTerminalSize, + ).annotate({ description: "New PTY size in character cells." }), }).annotate({ title: "CommandExecResizeParams", description: "Resize a running PTY-backed `command/exec` session.", }); -export type V2CommandExecResizeParams__CommandExecTerminalSize = { - readonly cols: number; - readonly rows: number; -}; -export const V2CommandExecResizeParams__CommandExecTerminalSize = Schema.Struct({ - cols: Schema.Number.annotate({ - description: "Terminal width in character cells.", - format: "uint16", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - rows: Schema.Number.annotate({ - description: "Terminal height in character cells.", - format: "uint16", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}).annotate({ description: "PTY size in character cells for `command/exec` PTY sessions." }); - -export type V2CommandExecResizeResponse = {}; -export const V2CommandExecResizeResponse = Schema.Struct({}).annotate({ +export type V2CommandExecResizeResponse = { readonly [x: string]: Schema.Json }; +export const V2CommandExecResizeResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "CommandExecResizeResponse", description: "Empty success response for `command/exec/resize`.", }); @@ -37404,7 +51812,7 @@ export type V2CommandExecResponse = { }; export const V2CommandExecResponse = Schema.Struct({ exitCode: Schema.Number.annotate({ description: "Process exit code.", format: "int32" }).check( - Schema.isInt(), + Schema.isInt().annotate({ expected: "an integer" }), ), stderr: Schema.String.annotate({ description: @@ -37430,8 +51838,11 @@ export const V2CommandExecTerminateParams = Schema.Struct({ description: "Terminate a running `command/exec` session.", }); -export type V2CommandExecTerminateResponse = {}; -export const V2CommandExecTerminateResponse = Schema.Struct({}).annotate({ +export type V2CommandExecTerminateResponse = { readonly [x: string]: Schema.Json }; +export const V2CommandExecTerminateResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "CommandExecTerminateResponse", description: "Empty success response for `command/exec/terminate`.", }); @@ -37475,8 +51886,11 @@ export const V2CommandExecWriteParams = Schema.Struct({ description: "Write stdin bytes to a running `command/exec` session, close stdin, or both.", }); -export type V2CommandExecWriteResponse = {}; -export const V2CommandExecWriteResponse = Schema.Struct({}).annotate({ +export type V2CommandExecWriteResponse = { readonly [x: string]: Schema.Json }; +export const V2CommandExecWriteResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "CommandExecWriteResponse", description: "Empty success response for `command/exec/write`.", }); @@ -37502,7 +51916,7 @@ export const V2ConfigBatchWriteParams = Schema.Struct({ reloadUserConfig: Schema.optionalKey( Schema.Boolean.annotate({ description: - "When true, hot-reload the updated user config into all loaded threads after writing.", + "When true, hot-reload updated runtime settings into loaded threads after writing. Session-static model, reasoning-effort, Plan-mode reasoning-effort, and service-tier defaults are not reloaded. The deprecated personality setting is also not reloaded.", }), ), }).annotate({ title: "ConfigBatchWriteParams" }); @@ -37540,6 +51954,8 @@ export type V2ConfigReadResponse__AppConfig = { readonly default_tools_enabled?: boolean | null; readonly destructive_enabled?: boolean | null; readonly enabled?: boolean; + readonly links?: V2ConfigReadResponse__AppLinksConfig | null; + readonly omit_tools_from?: ReadonlyArray | null; readonly open_world_enabled?: boolean | null; readonly tools?: V2ConfigReadResponse__AppToolsConfig | null; }; @@ -37553,10 +51969,36 @@ export const V2ConfigReadResponse__AppConfig = Schema.Struct({ default_tools_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), destructive_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), enabled: Schema.optionalKey(Schema.Boolean.annotate({ default: true })), + links: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__AppLinksConfig, Schema.Null]).annotate({ + description: "Per-account approval settings keyed by link ID.", + }), + ), + omit_tools_from: Schema.optionalKey( + Schema.Union([ + Schema.Array(V2ConfigReadResponse__ToolExposureSurface).annotate({ + description: "Additional model-facing surfaces omitted for this connector's tools.", + }), + Schema.Null, + ]), + ), open_world_enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tools: Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AppToolsConfig, Schema.Null])), }); +export type V2ConfigReadResponse__AppLinkConfig = { + readonly approvals_reviewer?: V2ConfigReadResponse__ApprovalsReviewer | null; + readonly default_tools_approval_mode?: V2ConfigReadResponse__AppToolApproval | null; +}; +export const V2ConfigReadResponse__AppLinkConfig = Schema.Struct({ + approvals_reviewer: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__ApprovalsReviewer, Schema.Null]), + ), + default_tools_approval_mode: Schema.optionalKey( + Schema.Union([V2ConfigReadResponse__AppToolApproval, Schema.Null]), + ), +}).annotate({ description: "Approval settings for a connected account within an app." }); + export type V2ConfigReadResponse__AppsConfig = { readonly _default?: V2ConfigReadResponse__AppsDefaultConfig | null; }; @@ -37589,6 +52031,15 @@ export const V2ConfigRequirementsReadResponse = Schema.Struct({ ), }).annotate({ title: "ConfigRequirementsReadResponse" }); +export type V2ConfigRequirementsReadResponse__ApplicationRequirements = { + readonly network?: V2ConfigRequirementsReadResponse__ApplicationNetworkRequirements | null; +}; +export const V2ConfigRequirementsReadResponse__ApplicationRequirements = Schema.Struct({ + network: Schema.optionalKey( + Schema.Union([V2ConfigRequirementsReadResponse__ApplicationNetworkRequirements, Schema.Null]), + ), +}); + export type V2ConfigRequirementsReadResponse__ApprovalsReviewer = | "user" | "auto_review" @@ -37603,6 +52054,7 @@ export const V2ConfigRequirementsReadResponse__ApprovalsReviewer = Schema.Litera }); export type V2ConfigRequirementsReadResponse__ManagedHooksRequirements = { + readonly Interrupt?: ReadonlyArray; readonly PermissionRequest: ReadonlyArray; readonly PostCompact: ReadonlyArray; readonly PostToolUse: ReadonlyArray; @@ -37618,6 +52070,11 @@ export type V2ConfigRequirementsReadResponse__ManagedHooksRequirements = { readonly windowsManagedDir?: string | null; }; export const V2ConfigRequirementsReadResponse__ManagedHooksRequirements = Schema.Struct({ + Interrupt: Schema.optionalKey( + Schema.Array(V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup).annotate({ + default: [], + }), + ), PermissionRequest: Schema.Array(V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup), PostCompact: Schema.Array(V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup), PostToolUse: Schema.Array(V2ConfigRequirementsReadResponse__ConfiguredHookMatcherGroup), @@ -37698,8 +52155,12 @@ export const V2ConfigRequirementsReadResponse__NetworkRequirements = Schema.Stru httpPort: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -37715,8 +52176,12 @@ export const V2ConfigRequirementsReadResponse__NetworkRequirements = Schema.Stru socksPort: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -37738,7 +52203,7 @@ export type V2ConfigValueWriteParams = { readonly filePath?: string | null; readonly keyPath: string; readonly mergeStrategy: V2ConfigValueWriteParams__MergeStrategy; - readonly value: unknown; + readonly value: Schema.Json; }; export const V2ConfigValueWriteParams = Schema.Struct({ expectedVersion: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -37753,7 +52218,7 @@ export const V2ConfigValueWriteParams = Schema.Struct({ ), keyPath: Schema.String, mergeStrategy: V2ConfigValueWriteParams__MergeStrategy, - value: Schema.Unknown, + value: Schema.Json.annotate({ expected: "JSON value" }), }).annotate({ title: "ConfigValueWriteParams" }); export type V2ConfigWarningNotification = { @@ -37786,16 +52251,16 @@ export const V2ConfigWarningNotification = Schema.Struct({ }).annotate({ title: "ConfigWarningNotification" }); export type V2ConfigWriteResponse = { - readonly filePath: string; + readonly filePath: V2ConfigWriteResponse__AbsolutePathBuf; readonly overriddenMetadata?: V2ConfigWriteResponse__OverriddenMetadata | null; readonly status: V2ConfigWriteResponse__WriteStatus; readonly version: string; }; export const V2ConfigWriteResponse = Schema.Struct({ - filePath: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + filePath: Schema.suspend( + (): Schema.Codec => + V2ConfigWriteResponse__AbsolutePathBuf, + ).annotate({ description: "Canonical path to the config file that was written." }), overriddenMetadata: Schema.optionalKey( Schema.Union([V2ConfigWriteResponse__OverriddenMetadata, Schema.Null]), ), @@ -37916,8 +52381,12 @@ export const V2ExperimentalFeatureListParams = Schema.Struct({ description: "Optional page size; defaults to a reasonable server-side value.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -37949,23 +52418,11 @@ export const V2ExperimentalFeatureListResponse = Schema.Struct({ ), }).annotate({ title: "ExperimentalFeatureListResponse" }); -export type V2ExperimentalFeatureListResponse__ExperimentalFeatureStage = - | "beta" - | "underDevelopment" - | "stable" - | "deprecated" - | "removed"; -export const V2ExperimentalFeatureListResponse__ExperimentalFeatureStage = Schema.Literals([ - "beta", - "underDevelopment", - "stable", - "deprecated", - "removed", -]); - export type V2ExternalAgentConfigDetectParams = { readonly cwds?: ReadonlyArray | null; readonly includeHome?: boolean; + readonly maxSessionAgeDays?: number | null; + readonly maxSessions?: number | null; readonly migrationSource?: string | null; readonly source?: string | null; }; @@ -37983,6 +52440,37 @@ export const V2ExternalAgentConfigDetectParams = Schema.Struct({ description: "If true, include detection under the user's home directory.", }), ), + maxSessionAgeDays: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Maximum age in days for detected sessions. Missing values use the default limit.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + maxSessions: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "Maximum number of sessions to detect. Missing values use the default limit.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), migrationSource: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -38004,9 +52492,15 @@ export const V2ExternalAgentConfigDetectParams = Schema.Struct({ }).annotate({ title: "ExternalAgentConfigDetectParams" }); export type V2ExternalAgentConfigDetectResponse = { + readonly connectors?: ReadonlyArray; readonly items: ReadonlyArray; }; export const V2ExternalAgentConfigDetectResponse = Schema.Struct({ + connectors: Schema.optionalKey( + Schema.Array( + V2ExternalAgentConfigDetectResponse__ExternalAgentDetectedConnectorCandidate, + ).annotate({ default: [] }), + ), items: Schema.Array(V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem), }).annotate({ title: "ExternalAgentConfigDetectResponse" }); @@ -38034,9 +52528,28 @@ export const V2ExternalAgentConfigImportHistoriesReadResponse = Schema.Struct({ ), }).annotate({ title: "ExternalAgentConfigImportHistoriesReadResponse" }); +export type V2ExternalAgentConfigImportHistoryRecordParams = { + readonly itemTypeResults: ReadonlyArray; + readonly providerId: string; +}; +export const V2ExternalAgentConfigImportHistoryRecordParams = Schema.Struct({ + itemTypeResults: Schema.Array( + V2ExternalAgentConfigImportHistoryRecordParams__ExternalAgentConfigImportHistoryRecordTypeResultParams, + ).annotate({ description: "Completed results grouped by imported item type." }), + providerId: Schema.String.annotate({ + description: "Opaque provider identifier for the externally completed import.", + }), +}).annotate({ title: "ExternalAgentConfigImportHistoryRecordParams" }); + +export type V2ExternalAgentConfigImportHistoryRecordResponse = { readonly importId: string }; +export const V2ExternalAgentConfigImportHistoryRecordResponse = Schema.Struct({ + importId: Schema.String, +}).annotate({ title: "ExternalAgentConfigImportHistoryRecordResponse" }); + export type V2ExternalAgentConfigImportParams = { readonly migrationItems: ReadonlyArray; readonly migrationSource?: string | null; + readonly providerId?: string | null; readonly source?: string | null; }; export const V2ExternalAgentConfigImportParams = Schema.Struct({ @@ -38050,6 +52563,15 @@ export const V2ExternalAgentConfigImportParams = Schema.Struct({ Schema.Null, ]), ), + providerId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Opaque provider identifier supplied by the caller for analytics attribution and import history display. This does not select the migration source.", + }), + Schema.Null, + ]), + ), source: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -38095,10 +52617,22 @@ export const V2FeedbackUploadParams = Schema.Struct({ threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }).annotate({ title: "FeedbackUploadParams" }); -export type V2FeedbackUploadResponse = { readonly threadId: string }; -export const V2FeedbackUploadResponse = Schema.Struct({ threadId: Schema.String }).annotate({ - title: "FeedbackUploadResponse", -}); +export type V2FeedbackUploadResponse = { + readonly promptHash?: string | null; + readonly threadId: string; +}; +export const V2FeedbackUploadResponse = Schema.Struct({ + promptHash: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Whitespace-normalized SHA-256 of the session base instructions, matching the uploaded `prompt_hash` tag. Does not include later developer messages. Null when the reported rollout has no prompt metadata.", + }), + Schema.Null, + ]), + ), + threadId: Schema.String, +}).annotate({ title: "FeedbackUploadResponse" }); export type V2FileChangeOutputDeltaNotification = { readonly delta: string; @@ -38147,50 +52681,42 @@ export const V2FsChangedNotification = Schema.Struct({ }); export type V2FsCopyParams = { - readonly destinationPath: string; + readonly destinationPath: V2FsCopyParams__AbsolutePathBuf; readonly recursive?: boolean; - readonly sourcePath: string; + readonly sourcePath: V2FsCopyParams__AbsolutePathBuf; }; export const V2FsCopyParams = Schema.Struct({ - destinationPath: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + destinationPath: Schema.suspend( + (): Schema.Codec => V2FsCopyParams__AbsolutePathBuf, + ).annotate({ description: "Absolute destination path." }), recursive: Schema.optionalKey( Schema.Boolean.annotate({ description: "Required for directory copies; ignored for file copies.", }), ), - sourcePath: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + sourcePath: Schema.suspend( + (): Schema.Codec => V2FsCopyParams__AbsolutePathBuf, + ).annotate({ description: "Absolute source path." }), }).annotate({ title: "FsCopyParams", description: "Copy a file or directory tree on the host filesystem.", }); -export type V2FsCopyParams__AbsolutePathBuf = string; -export const V2FsCopyParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2FsCopyResponse = {}; -export const V2FsCopyResponse = Schema.Struct({}).annotate({ - title: "FsCopyResponse", - description: "Successful response for `fs/copy`.", -}); +export type V2FsCopyResponse = { readonly [x: string]: Schema.Json }; +export const V2FsCopyResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "FsCopyResponse", description: "Successful response for `fs/copy`." }); export type V2FsCreateDirectoryParams = { - readonly path: string; + readonly path: V2FsCreateDirectoryParams__AbsolutePathBuf; readonly recursive?: boolean | null; }; export const V2FsCreateDirectoryParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + path: Schema.suspend( + (): Schema.Codec => + V2FsCreateDirectoryParams__AbsolutePathBuf, + ).annotate({ description: "Absolute directory path to create." }), recursive: Schema.optionalKey( Schema.Union([ Schema.Boolean.annotate({ @@ -38204,35 +52730,26 @@ export const V2FsCreateDirectoryParams = Schema.Struct({ description: "Create a directory on the host filesystem.", }); -export type V2FsCreateDirectoryParams__AbsolutePathBuf = string; -export const V2FsCreateDirectoryParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2FsCreateDirectoryResponse = {}; -export const V2FsCreateDirectoryResponse = Schema.Struct({}).annotate({ +export type V2FsCreateDirectoryResponse = { readonly [x: string]: Schema.Json }; +export const V2FsCreateDirectoryResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "FsCreateDirectoryResponse", description: "Successful response for `fs/createDirectory`.", }); -export type V2FsGetMetadataParams = { readonly path: string }; +export type V2FsGetMetadataParams = { readonly path: V2FsGetMetadataParams__AbsolutePathBuf }; export const V2FsGetMetadataParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + path: Schema.suspend( + (): Schema.Codec => + V2FsGetMetadataParams__AbsolutePathBuf, + ).annotate({ description: "Absolute path to inspect." }), }).annotate({ title: "FsGetMetadataParams", description: "Request metadata for an absolute path.", }); -export type V2FsGetMetadataParams__AbsolutePathBuf = string; -export const V2FsGetMetadataParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - export type V2FsGetMetadataResponse = { readonly createdAtMs: number; readonly isDirectory: boolean; @@ -38244,7 +52761,7 @@ export const V2FsGetMetadataResponse = Schema.Struct({ createdAtMs: Schema.Number.annotate({ description: "File creation time in Unix milliseconds when available, otherwise `0`.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), isDirectory: Schema.Boolean.annotate({ description: "Whether the path resolves to a directory.", }), @@ -38255,29 +52772,23 @@ export const V2FsGetMetadataResponse = Schema.Struct({ modifiedAtMs: Schema.Number.annotate({ description: "File modification time in Unix milliseconds when available, otherwise `0`.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), }).annotate({ title: "FsGetMetadataResponse", description: "Metadata returned by `fs/getMetadata`.", }); -export type V2FsReadDirectoryParams = { readonly path: string }; +export type V2FsReadDirectoryParams = { readonly path: V2FsReadDirectoryParams__AbsolutePathBuf }; export const V2FsReadDirectoryParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + path: Schema.suspend( + (): Schema.Codec => + V2FsReadDirectoryParams__AbsolutePathBuf, + ).annotate({ description: "Absolute directory path to read." }), }).annotate({ title: "FsReadDirectoryParams", description: "List direct child names for a directory.", }); -export type V2FsReadDirectoryParams__AbsolutePathBuf = string; -export const V2FsReadDirectoryParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - export type V2FsReadDirectoryResponse = { readonly entries: ReadonlyArray; }; @@ -38290,20 +52801,13 @@ export const V2FsReadDirectoryResponse = Schema.Struct({ description: "Directory entries returned by `fs/readDirectory`.", }); -export type V2FsReadFileParams = { readonly path: string }; +export type V2FsReadFileParams = { readonly path: V2FsReadFileParams__AbsolutePathBuf }; export const V2FsReadFileParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + path: Schema.suspend( + (): Schema.Codec => V2FsReadFileParams__AbsolutePathBuf, + ).annotate({ description: "Absolute path to read." }), }).annotate({ title: "FsReadFileParams", description: "Read a file from the host filesystem." }); -export type V2FsReadFileParams__AbsolutePathBuf = string; -export const V2FsReadFileParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - export type V2FsReadFileResponse = { readonly dataBase64: string }; export const V2FsReadFileResponse = Schema.Struct({ dataBase64: Schema.String.annotate({ description: "File contents encoded as base64." }), @@ -38314,7 +52818,7 @@ export const V2FsReadFileResponse = Schema.Struct({ export type V2FsRemoveParams = { readonly force?: boolean | null; - readonly path: string; + readonly path: V2FsRemoveParams__AbsolutePathBuf; readonly recursive?: boolean | null; }; export const V2FsRemoveParams = Schema.Struct({ @@ -38326,10 +52830,9 @@ export const V2FsRemoveParams = Schema.Struct({ Schema.Null, ]), ), - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + path: Schema.suspend( + (): Schema.Codec => V2FsRemoveParams__AbsolutePathBuf, + ).annotate({ description: "Absolute path to remove." }), recursive: Schema.optionalKey( Schema.Union([ Schema.Boolean.annotate({ @@ -38343,17 +52846,11 @@ export const V2FsRemoveParams = Schema.Struct({ description: "Remove a file or directory tree from the host filesystem.", }); -export type V2FsRemoveParams__AbsolutePathBuf = string; -export const V2FsRemoveParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2FsRemoveResponse = {}; -export const V2FsRemoveResponse = Schema.Struct({}).annotate({ - title: "FsRemoveResponse", - description: "Successful response for `fs/remove`.", -}); +export type V2FsRemoveResponse = { readonly [x: string]: Schema.Json }; +export const V2FsRemoveResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "FsRemoveResponse", description: "Successful response for `fs/remove`." }); export type V2FsUnwatchParams = { readonly watchId: string }; export const V2FsUnwatchParams = Schema.Struct({ @@ -38365,18 +52862,20 @@ export const V2FsUnwatchParams = Schema.Struct({ description: "Stop filesystem watch notifications for a prior `fs/watch`.", }); -export type V2FsUnwatchResponse = {}; -export const V2FsUnwatchResponse = Schema.Struct({}).annotate({ - title: "FsUnwatchResponse", - description: "Successful response for `fs/unwatch`.", -}); +export type V2FsUnwatchResponse = { readonly [x: string]: Schema.Json }; +export const V2FsUnwatchResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "FsUnwatchResponse", description: "Successful response for `fs/unwatch`." }); -export type V2FsWatchParams = { readonly path: string; readonly watchId: string }; +export type V2FsWatchParams = { + readonly path: V2FsWatchParams__AbsolutePathBuf; + readonly watchId: string; +}; export const V2FsWatchParams = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + path: Schema.suspend( + (): Schema.Codec => V2FsWatchParams__AbsolutePathBuf, + ).annotate({ description: "Absolute file or directory path to watch." }), watchId: Schema.String.annotate({ description: "Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`.", }), @@ -38385,47 +52884,90 @@ export const V2FsWatchParams = Schema.Struct({ description: "Start filesystem watch notifications for an absolute path.", }); -export type V2FsWatchParams__AbsolutePathBuf = string; -export const V2FsWatchParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2FsWatchResponse = { readonly path: string }; +export type V2FsWatchResponse = { readonly path: V2FsWatchResponse__AbsolutePathBuf }; export const V2FsWatchResponse = Schema.Struct({ - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + path: Schema.suspend( + (): Schema.Codec => V2FsWatchResponse__AbsolutePathBuf, + ).annotate({ description: "Canonicalized path associated with the watch." }), }).annotate({ title: "FsWatchResponse", description: "Successful response for `fs/watch`." }); -export type V2FsWatchResponse__AbsolutePathBuf = string; -export const V2FsWatchResponse__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2FsWriteFileParams = { readonly dataBase64: string; readonly path: string }; +export type V2FsWriteFileParams = { + readonly dataBase64: string; + readonly path: V2FsWriteFileParams__AbsolutePathBuf; +}; export const V2FsWriteFileParams = Schema.Struct({ dataBase64: Schema.String.annotate({ description: "File contents encoded as base64." }), - path: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), + path: Schema.suspend( + (): Schema.Codec => V2FsWriteFileParams__AbsolutePathBuf, + ).annotate({ description: "Absolute path to write." }), }).annotate({ title: "FsWriteFileParams", description: "Write a file on the host filesystem." }); -export type V2FsWriteFileParams__AbsolutePathBuf = string; -export const V2FsWriteFileParams__AbsolutePathBuf = Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", -}); - -export type V2FsWriteFileResponse = {}; -export const V2FsWriteFileResponse = Schema.Struct({}).annotate({ +export type V2FsWriteFileResponse = { readonly [x: string]: Schema.Json }; +export const V2FsWriteFileResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "FsWriteFileResponse", description: "Successful response for `fs/writeFile`.", }); +export type V2GatewayOAuthCancelResponse = { readonly [x: string]: Schema.Json }; +export const V2GatewayOAuthCancelResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "GatewayOAuthCancelResponse" }); + +export type V2GatewayOAuthChangedNotification = { + readonly authUrl?: string | null; + readonly error?: string | null; + readonly providerId: string; + readonly status: V2GatewayOAuthChangedNotification__GatewayOAuthStatus; +}; +export const V2GatewayOAuthChangedNotification = Schema.Struct({ + authUrl: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Authorization handoff, sent only to the connection that started login.", + }), + Schema.Null, + ]), + ), + error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + providerId: Schema.String, + status: V2GatewayOAuthChangedNotification__GatewayOAuthStatus, +}).annotate({ title: "GatewayOAuthChangedNotification" }); + +export type V2GatewayOAuthLoginResponse = { readonly [x: string]: Schema.Json }; +export const V2GatewayOAuthLoginResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "GatewayOAuthLoginResponse" }); + +export type V2GatewayOAuthReadResponse = { + readonly error?: string | null; + readonly providerId: string; + readonly providerName: string; + readonly required: boolean; + readonly status?: V2GatewayOAuthReadResponse__GatewayOAuthStatus | null; +}; +export const V2GatewayOAuthReadResponse = Schema.Struct({ + error: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + providerId: Schema.String, + providerName: Schema.String, + required: Schema.Boolean.annotate({ + description: "Whether the selected provider uses gateway OAuth, even when already signed in.", + }), + status: Schema.optionalKey( + Schema.Union([V2GatewayOAuthReadResponse__GatewayOAuthStatus, Schema.Null]).annotate({ + description: "Null when the effective provider does not use gateway OAuth.", + }), + ), +}).annotate({ + title: "GatewayOAuthReadResponse", + description: + "Current effective gateway policy and credential readiness; never contains credentials.", +}); + export type V2GetAccountParams = { readonly refreshToken?: boolean }; export const V2GetAccountParams = Schema.Struct({ refreshToken: Schema.optionalKey( @@ -38437,57 +52979,47 @@ export const V2GetAccountParams = Schema.Struct({ }).annotate({ title: "GetAccountParams" }); export type V2GetAccountRateLimitsResponse = { + readonly accountId?: string | null; + readonly ordinaryUsageAllowed?: boolean | null; readonly rateLimitResetCredits?: V2GetAccountRateLimitsResponse__RateLimitResetCreditsSummary | null; - readonly rateLimits: { - readonly credits?: V2GetAccountRateLimitsResponse__CreditsSnapshot | null; - readonly individualLimit?: V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot | null; - readonly limitId?: string | null; - readonly limitName?: string | null; - readonly planType?: V2GetAccountRateLimitsResponse__PlanType | null; - readonly primary?: V2GetAccountRateLimitsResponse__RateLimitWindow | null; - readonly rateLimitReachedType?: V2GetAccountRateLimitsResponse__RateLimitReachedType | null; - readonly secondary?: V2GetAccountRateLimitsResponse__RateLimitWindow | null; - readonly spendControlReached?: boolean | null; - }; + readonly rateLimitUpsell?: Schema.Json; + readonly rateLimits: V2GetAccountRateLimitsResponse__RateLimitSnapshot; readonly rateLimitsByLimitId?: { readonly [x: string]: V2GetAccountRateLimitsResponse__RateLimitSnapshot; } | null; }; export const V2GetAccountRateLimitsResponse = Schema.Struct({ + accountId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Account associated with this usage snapshot, when supplied by the backend.", + }), + Schema.Null, + ]), + ), + ordinaryUsageAllowed: Schema.optionalKey( + Schema.Union([ + Schema.Boolean.annotate({ + description: + "Backend permission for ordinary included usage, validated against the active account. Null means unavailable; clients must not infer recovery from percentages or reset times.", + }), + Schema.Null, + ]), + ), rateLimitResetCredits: Schema.optionalKey( Schema.Union([V2GetAccountRateLimitsResponse__RateLimitResetCreditsSummary, Schema.Null]), ), - rateLimits: Schema.Struct({ - credits: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__CreditsSnapshot, Schema.Null]), - ), - individualLimit: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__SpendControlLimitSnapshot, Schema.Null]), - ), - limitId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - limitName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - planType: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__PlanType, Schema.Null]), - ), - primary: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__RateLimitWindow, Schema.Null]), - ), - rateLimitReachedType: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__RateLimitReachedType, Schema.Null]), - ), - secondary: Schema.optionalKey( - Schema.Union([V2GetAccountRateLimitsResponse__RateLimitWindow, Schema.Null]), - ), - spendControlReached: Schema.optionalKey( - Schema.Union([ - Schema.Boolean.annotate({ - description: - "Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.", - }), - Schema.Null, - ]), - ), - }).annotate({ + rateLimitUpsell: Schema.optionalKey( + Schema.Json.annotate({ + expected: "JSON value", + description: + "Optional backend-owned banner from the same usage read. Its nested keys retain the backend's snake_case contract; an absent banner leaves the client's existing UI unchanged.", + }), + ), + rateLimits: Schema.suspend( + (): Schema.Codec => + V2GetAccountRateLimitsResponse__RateLimitSnapshot, + ).annotate({ description: "Backward-compatible single-bucket view; mirrors the historical payload.", }), rateLimitsByLimitId: Schema.optionalKey( @@ -38509,9 +53041,21 @@ export const V2GetAccountResponse = Schema.Struct({ requiresOpenaiAuth: Schema.Boolean, }).annotate({ title: "GetAccountResponse" }); +export type V2GetAccountResponse__WorkspaceRouting = { + readonly accountRoutingOverride: V2GetAccountResponse__AccountRoutingOverride; + readonly backendOrigin: string; + readonly chatgptAccountId: string; +}; +export const V2GetAccountResponse__WorkspaceRouting = Schema.Struct({ + accountRoutingOverride: V2GetAccountResponse__AccountRoutingOverride, + backendOrigin: Schema.String, + chatgptAccountId: Schema.String, +}); + export type V2GetAccountTokenUsageResponse = { readonly dailyUsageBuckets?: ReadonlyArray | null; readonly summary: V2GetAccountTokenUsageResponse__AccountTokenUsageSummary; + readonly threadUsage?: V2GetAccountTokenUsageResponse__ThreadUsage | null; }; export const V2GetAccountTokenUsageResponse = Schema.Struct({ dailyUsageBuckets: Schema.optionalKey( @@ -38521,6 +53065,12 @@ export const V2GetAccountTokenUsageResponse = Schema.Struct({ ]), ), summary: V2GetAccountTokenUsageResponse__AccountTokenUsageSummary, + threadUsage: Schema.optionalKey( + Schema.Union([V2GetAccountTokenUsageResponse__ThreadUsage, Schema.Null]).annotate({ + description: + "Estimated usage when a thread was requested and its billing route is available.", + }), + ), }).annotate({ title: "GetAccountTokenUsageResponse" }); export type V2GetWorkspaceMessagesResponse = { @@ -38555,32 +53105,6 @@ export const V2HookCompletedNotification = Schema.Struct({ turnId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }).annotate({ title: "HookCompletedNotification" }); -export type V2HookCompletedNotification__HookSource = - | "system" - | "user" - | "project" - | "mdm" - | "sessionFlags" - | "plugin" - | "cloudRequirements" - | "cloudManagedConfig" - | "legacyManagedConfigFile" - | "legacyManagedConfigMdm" - | "unknown"; -export const V2HookCompletedNotification__HookSource = Schema.Literals([ - "system", - "user", - "project", - "mdm", - "sessionFlags", - "plugin", - "cloudRequirements", - "cloudManagedConfig", - "legacyManagedConfigFile", - "legacyManagedConfigMdm", - "unknown", -]); - export type V2HooksListParams = { readonly cwds?: ReadonlyArray }; export const V2HooksListParams = Schema.Struct({ cwds: Schema.optionalKey( @@ -38608,32 +53132,6 @@ export const V2HookStartedNotification = Schema.Struct({ turnId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }).annotate({ title: "HookStartedNotification" }); -export type V2HookStartedNotification__HookSource = - | "system" - | "user" - | "project" - | "mdm" - | "sessionFlags" - | "plugin" - | "cloudRequirements" - | "cloudManagedConfig" - | "legacyManagedConfigFile" - | "legacyManagedConfigMdm" - | "unknown"; -export const V2HookStartedNotification__HookSource = Schema.Literals([ - "system", - "user", - "project", - "mdm", - "sessionFlags", - "plugin", - "cloudRequirements", - "cloudManagedConfig", - "legacyManagedConfigFile", - "legacyManagedConfigMdm", - "unknown", -]); - export type V2ItemCompletedNotification = { readonly completedAtMs: number; readonly item: V2ItemCompletedNotification__ThreadItem; @@ -38644,71 +53142,12 @@ export const V2ItemCompletedNotification = Schema.Struct({ completedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this item lifecycle completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), item: V2ItemCompletedNotification__ThreadItem, threadId: Schema.String, turnId: Schema.String, }).annotate({ title: "ItemCompletedNotification" }); -export type V2ItemCompletedNotification__ByteRange = { - readonly end: number; - readonly start: number; -}; -export const V2ItemCompletedNotification__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ItemCompletedNotification__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ItemCompletedNotification__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ItemCompletedNotification__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ItemCompletedNotification__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ItemCompletedNotification__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ItemCompletedNotification__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - export type V2ItemGuardianApprovalReviewCompletedNotification = { readonly action: V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewAction; readonly completedAtMs: number; @@ -38725,19 +53164,19 @@ export const V2ItemGuardianApprovalReviewCompletedNotification = Schema.Struct({ completedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this review completed.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), decisionSource: V2ItemGuardianApprovalReviewCompletedNotification__AutoReviewDecisionSource, review: V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReview, reviewId: Schema.String.annotate({ description: "Stable identifier for this review." }), startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this review started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), targetItemId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ description: - "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - stdin reviews, which refer to the existing parent command item and have a separate approval ID in the action payload - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", }), Schema.Null, ]), @@ -38766,12 +53205,12 @@ export const V2ItemGuardianApprovalReviewStartedNotification = Schema.Struct({ startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this review started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), targetItemId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ description: - "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - stdin reviews, which refer to the existing parent command item and have a separate approval ID in the action payload - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", }), Schema.Null, ]), @@ -38795,71 +53234,16 @@ export const V2ItemStartedNotification = Schema.Struct({ startedAtMs: Schema.Number.annotate({ description: "Unix timestamp (in milliseconds) when this item lifecycle started.", format: "int64", - }).check(Schema.isInt()), + }).check(Schema.isInt().annotate({ expected: "an integer" })), threadId: Schema.String, turnId: Schema.String, }).annotate({ title: "ItemStartedNotification" }); -export type V2ItemStartedNotification__ByteRange = { readonly end: number; readonly start: number }; -export const V2ItemStartedNotification__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ItemStartedNotification__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ItemStartedNotification__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ItemStartedNotification__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ItemStartedNotification__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ItemStartedNotification__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ItemStartedNotification__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - export type V2ListMcpServerStatusParams = { readonly cursor?: string | null; readonly detail?: V2ListMcpServerStatusParams__McpServerStatusDetail | null; readonly limit?: number | null; + readonly serverName?: string | null; readonly threadId?: string | null; }; export const V2ListMcpServerStatusParams = Schema.Struct({ @@ -38883,8 +53267,21 @@ export const V2ListMcpServerStatusParams = Schema.Struct({ description: "Optional page size; defaults to a server-defined value.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + serverName: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Limit discovery to one server. With a thread ID, reuse that thread's MCP connection.", + }), Schema.Null, ]), ), @@ -38923,7 +53320,14 @@ export type V2LoginAccountParams = readonly chatgptPlanType?: string | null; readonly type: "chatgptAuthTokens"; } - | { readonly apiKey: string; readonly region: string; readonly type: "amazonBedrock" }; + | { readonly apiKey: string; readonly region: string; readonly type: "amazonBedrock" } + | { + readonly accessKeyId: string; + readonly region: string; + readonly secretAccessKey: string; + readonly sessionToken?: string | null; + readonly type: "amazonBedrockAccessKeys"; + }; export const V2LoginAccountParams = Schema.Union( [ Schema.Struct({ @@ -38978,6 +53382,18 @@ export const V2LoginAccountParams = Schema.Union( title: "AmazonBedrockv2::LoginAccountParams", description: "[UNSTABLE] Managed Amazon Bedrock login is experimental.", }), + Schema.Struct({ + accessKeyId: Schema.String, + region: Schema.String, + secretAccessKey: Schema.String, + sessionToken: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("amazonBedrockAccessKeys").annotate({ + title: "AmazonBedrockAccessKeysv2::LoginAccountParamsType", + }), + }).annotate({ + title: "AmazonBedrockAccessKeysv2::LoginAccountParams", + description: "[UNSTABLE] Managed Amazon Bedrock AWS access key login is experimental.", + }), ], { mode: "oneOf" }, ).annotate({ title: "LoginAccountParams" }); @@ -39032,10 +53448,11 @@ export const V2LoginAccountResponse = Schema.Union( { mode: "oneOf" }, ).annotate({ title: "LoginAccountResponse" }); -export type V2LogoutAccountResponse = {}; -export const V2LogoutAccountResponse = Schema.Struct({}).annotate({ - title: "LogoutAccountResponse", -}); +export type V2LogoutAccountResponse = { readonly [x: string]: Schema.Json }; +export const V2LogoutAccountResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "LogoutAccountResponse" }); export type V2MarketplaceAddParams = { readonly refName?: string | null; @@ -39092,23 +53509,58 @@ export const V2MarketplaceUpgradeResponse = Schema.Struct({ }).annotate({ title: "MarketplaceUpgradeResponse" }); export type V2McpResourceReadParams = { + readonly connectorId?: string | null; + readonly originCallId?: string | null; readonly server: string; + readonly target?: V2McpResourceReadParams__McpResourceReadTarget | null; readonly threadId?: string | null; readonly uri: string; }; export const V2McpResourceReadParams = Schema.Struct({ + connectorId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + originCallId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Originating MCP tool call used to select the resource's app.", + }), + Schema.Null, + ]), + ), server: Schema.String, + target: Schema.optionalKey( + Schema.Union([V2McpResourceReadParams__McpResourceReadTarget, Schema.Null]).annotate({ + description: "Explicit hosted app/account. Omit to retain legacy resource discovery.", + }), + ), threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), uri: Schema.String, }).annotate({ title: "McpResourceReadParams" }); export type V2McpResourceReadResponse = { readonly contents: ReadonlyArray; + readonly originCallId?: string | null; }; export const V2McpResourceReadResponse = Schema.Struct({ contents: Schema.Array(V2McpResourceReadResponse__ResourceContent), + originCallId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Originating call when the server applied app-specific resource scoping.", + }), + Schema.Null, + ]), + ), }).annotate({ title: "McpResourceReadResponse" }); +export type V2McpServerEventStreamNotification = { + readonly notification: V2McpServerEventStreamNotification__McpServerEventNotification; + readonly subscriptionId: string; +}; +export const V2McpServerEventStreamNotification = Schema.Struct({ + notification: V2McpServerEventStreamNotification__McpServerEventNotification, + subscriptionId: Schema.String, +}).annotate({ title: "McpServerEventStreamNotification" }); + export type V2McpServerOauthLoginCompletedNotification = { readonly error?: string | null; readonly name: string; @@ -39123,17 +53575,32 @@ export const V2McpServerOauthLoginCompletedNotification = Schema.Struct({ }).annotate({ title: "McpServerOauthLoginCompletedNotification" }); export type V2McpServerOauthLoginParams = { + readonly clientRegistration?: V2McpServerOauthLoginParams__McpServerOauthClientRegistration | null; readonly name: string; readonly scopes?: ReadonlyArray | null; readonly threadId?: string | null; readonly timeoutSecs?: number | null; }; export const V2McpServerOauthLoginParams = Schema.Struct({ + clientRegistration: Schema.optionalKey( + Schema.Union([ + V2McpServerOauthLoginParams__McpServerOauthClientRegistration, + Schema.Null, + ]).annotate({ + description: + "Registration strategy for this login only; omission selects automatic discovery.", + }), + ), name: Schema.String, scopes: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), timeoutSecs: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), }).annotate({ title: "McpServerOauthLoginParams" }); @@ -39142,10 +53609,11 @@ export const V2McpServerOauthLoginResponse = Schema.Struct({ authorizationUrl: Schema.String, }).annotate({ title: "McpServerOauthLoginResponse" }); -export type V2McpServerRefreshResponse = {}; -export const V2McpServerRefreshResponse = Schema.Struct({}).annotate({ - title: "McpServerRefreshResponse", -}); +export type V2McpServerRefreshResponse = { readonly [x: string]: Schema.Json }; +export const V2McpServerRefreshResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "McpServerRefreshResponse" }); export type V2McpServerStatusUpdatedNotification = { readonly error?: string | null; @@ -39168,31 +53636,31 @@ export const V2McpServerStatusUpdatedNotification = Schema.Struct({ }).annotate({ title: "McpServerStatusUpdatedNotification" }); export type V2McpServerToolCallParams = { - readonly _meta?: unknown; - readonly arguments?: unknown; + readonly _meta?: Schema.Json; + readonly arguments?: Schema.Json; readonly server: string; readonly threadId: string; readonly tool: string; }; export const V2McpServerToolCallParams = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - arguments: Schema.optionalKey(Schema.Unknown), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + arguments: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), server: Schema.String, threadId: Schema.String, tool: Schema.String, }).annotate({ title: "McpServerToolCallParams" }); export type V2McpServerToolCallResponse = { - readonly _meta?: unknown; - readonly content: ReadonlyArray; + readonly _meta?: Schema.Json; + readonly content: ReadonlyArray; readonly isError?: boolean | null; - readonly structuredContent?: unknown; + readonly structuredContent?: Schema.Json; }; export const V2McpServerToolCallResponse = Schema.Struct({ - _meta: Schema.optionalKey(Schema.Unknown), - content: Schema.Array(Schema.Unknown), + _meta: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), + content: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), isError: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), - structuredContent: Schema.optionalKey(Schema.Unknown), + structuredContent: Schema.optionalKey(Schema.Json.annotate({ expected: "JSON value" })), }).annotate({ title: "McpServerToolCallResponse" }); export type V2McpToolCallProgressNotification = { @@ -39236,8 +53704,12 @@ export const V2ModelListParams = Schema.Struct({ description: "Optional page size; defaults to a reasonable server-side value.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -39260,10 +53732,11 @@ export const V2ModelListResponse = Schema.Struct({ ), }).annotate({ title: "ModelListResponse" }); -export type V2ModelProviderCapabilitiesReadParams = {}; -export const V2ModelProviderCapabilitiesReadParams = Schema.Struct({}).annotate({ - title: "ModelProviderCapabilitiesReadParams", -}); +export type V2ModelProviderCapabilitiesReadParams = { readonly [x: string]: Schema.Json }; +export const V2ModelProviderCapabilitiesReadParams = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ModelProviderCapabilitiesReadParams" }); export type V2ModelProviderCapabilitiesReadResponse = { readonly imageGeneration: boolean; @@ -39321,6 +53794,18 @@ export const V2ModelVerificationNotification = Schema.Struct({ verifications: Schema.Array(V2ModelVerificationNotification__ModelVerification), }).annotate({ title: "ModelVerificationNotification" }); +export type V2NullableGetAccountRateLimitsParams = V2NullableGetAccountRateLimitsParams__GetAccountRateLimitsParams | null; +export const V2NullableGetAccountRateLimitsParams = Schema.Union([ + V2NullableGetAccountRateLimitsParams__GetAccountRateLimitsParams, + Schema.Null, +]).annotate({ title: "Nullable_GetAccountRateLimitsParams" }); + +export type V2NullableGetAccountTokenUsageParams = V2NullableGetAccountTokenUsageParams__GetAccountTokenUsageParams | null; +export const V2NullableGetAccountTokenUsageParams = Schema.Union([ + V2NullableGetAccountTokenUsageParams__GetAccountTokenUsageParams, + Schema.Null, +]).annotate({ title: "Nullable_GetAccountTokenUsageParams" }); + export type V2PermissionProfileListParams = { readonly cursor?: string | null; readonly cwd?: string | null; @@ -39349,8 +53834,12 @@ export const V2PermissionProfileListParams = Schema.Struct({ description: "Optional page size; defaults to the full result set.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -39425,18 +53914,21 @@ export const V2PluginInstalledResponse = Schema.Struct({ marketplaces: Schema.Array(V2PluginInstalledResponse__PluginMarketplaceEntry), }).annotate({ title: "PluginInstalledResponse" }); -export type V2PluginInstalledResponse__PluginAvailability = "DISABLED_BY_ADMIN" | "AVAILABLE"; -export const V2PluginInstalledResponse__PluginAvailability = Schema.Literals([ - "DISABLED_BY_ADMIN", - "AVAILABLE", -]); - export type V2PluginInstallParams = { + readonly installAttemptId?: string | null; readonly marketplacePath?: V2PluginInstallParams__AbsolutePathBuf | null; readonly pluginName: string; readonly remoteMarketplaceName?: string | null; }; export const V2PluginInstallParams = Schema.Struct({ + installAttemptId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Client-generated identifier used to correlate one installation attempt.", + }), + Schema.Null, + ]), + ), marketplacePath: Schema.optionalKey( Schema.Union([V2PluginInstallParams__AbsolutePathBuf, Schema.Null]), ), @@ -39455,6 +53947,7 @@ export const V2PluginInstallResponse = Schema.Struct({ export type V2PluginListParams = { readonly cwds?: ReadonlyArray | null; + readonly forceRefetch?: boolean; readonly marketplaceKinds?: ReadonlyArray | null; }; export const V2PluginListParams = Schema.Struct({ @@ -39467,6 +53960,11 @@ export const V2PluginListParams = Schema.Struct({ Schema.Null, ]), ), + forceRefetch: Schema.optionalKey( + Schema.Boolean.annotate({ + description: "Whether the client requests a fresh remote plugin catalog fetch.", + }), + ), marketplaceKinds: Schema.optionalKey( Schema.Union([ Schema.Array(V2PluginListParams__PluginListMarketplaceKind).annotate({ @@ -39491,12 +53989,6 @@ export const V2PluginListResponse = Schema.Struct({ marketplaces: Schema.Array(V2PluginListResponse__PluginMarketplaceEntry), }).annotate({ title: "PluginListResponse" }); -export type V2PluginListResponse__PluginAvailability = "DISABLED_BY_ADMIN" | "AVAILABLE"; -export const V2PluginListResponse__PluginAvailability = Schema.Literals([ - "DISABLED_BY_ADMIN", - "AVAILABLE", -]); - export type V2PluginReadParams = { readonly marketplacePath?: V2PluginReadParams__AbsolutePathBuf | null; readonly pluginName: string; @@ -39515,11 +54007,40 @@ export const V2PluginReadResponse = Schema.Struct({ plugin: V2PluginReadResponse__PluginDetail, }).annotate({ title: "PluginReadResponse" }); -export type V2PluginReadResponse__PluginAvailability = "DISABLED_BY_ADMIN" | "AVAILABLE"; -export const V2PluginReadResponse__PluginAvailability = Schema.Literals([ - "DISABLED_BY_ADMIN", - "AVAILABLE", -]); +export type V2PluginReconcileParams = { readonly reason?: string | null }; +export const V2PluginReconcileParams = Schema.Struct({ + reason: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional client-provided reason recorded with the reconciliation attempt.", + }), + Schema.Null, + ]), + ), +}).annotate({ title: "PluginReconcileParams" }); + +export type V2PluginReconcileResponse = { + readonly changedPlugins: ReadonlyArray; + readonly failedMaterializationRemotePluginIds: ReadonlyArray; + readonly failedRemotePluginIds: ReadonlyArray; +}; +export const V2PluginReconcileResponse = Schema.Struct({ + changedPlugins: Schema.Array(V2PluginReconcileResponse__PluginReconcileChangedPlugin).annotate({ + description: + "Plugins affected by bundle changes, enablement changes, or removals. Installed-state changes compare against the previous cached snapshot, including cached reinstalls. Removal hints survive cache cleanup failures; unchanged plugins are omitted.", + }), + failedMaterializationRemotePluginIds: Schema.Array(Schema.String).annotate({ + description: + "Subset of failures for which the requested bundle could not be materialized. A previously cached version may still be available.", + }), + failedRemotePluginIds: Schema.Array(Schema.String).annotate({ + description: "Backend remote plugin IDs whose bundle or identity update failed.", + }), +}).annotate({ + title: "PluginReconcileResponse", + description: + "Bundle and installed-state changes observed by this pass, not a runtime-readiness acknowledgement or a cumulative diff since the client's last request. Other metadata-only changes are not listed.", +}); export type V2PluginShareCheckoutParams = { readonly remotePluginId: string }; export const V2PluginShareCheckoutParams = Schema.Struct({ @@ -39550,15 +54071,17 @@ export const V2PluginShareDeleteParams = Schema.Struct({ remotePluginId: Schema. title: "PluginShareDeleteParams", }); -export type V2PluginShareDeleteResponse = {}; -export const V2PluginShareDeleteResponse = Schema.Struct({}).annotate({ - title: "PluginShareDeleteResponse", -}); +export type V2PluginShareDeleteResponse = { readonly [x: string]: Schema.Json }; +export const V2PluginShareDeleteResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "PluginShareDeleteResponse" }); -export type V2PluginShareListParams = {}; -export const V2PluginShareListParams = Schema.Struct({}).annotate({ - title: "PluginShareListParams", -}); +export type V2PluginShareListParams = { readonly [x: string]: Schema.Json }; +export const V2PluginShareListParams = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "PluginShareListParams" }); export type V2PluginShareListResponse = { readonly data: ReadonlyArray; @@ -39567,12 +54090,6 @@ export const V2PluginShareListResponse = Schema.Struct({ data: Schema.Array(V2PluginShareListResponse__PluginShareListItem), }).annotate({ title: "PluginShareListResponse" }); -export type V2PluginShareListResponse__PluginAvailability = "DISABLED_BY_ADMIN" | "AVAILABLE"; -export const V2PluginShareListResponse__PluginAvailability = Schema.Literals([ - "DISABLED_BY_ADMIN", - "AVAILABLE", -]); - export type V2PluginShareSaveParams = { readonly discoverability?: V2PluginShareSaveParams__PluginShareDiscoverability | null; readonly pluginPath: V2PluginShareSaveParams__AbsolutePathBuf; @@ -39591,10 +54108,12 @@ export const V2PluginShareSaveParams = Schema.Struct({ }).annotate({ title: "PluginShareSaveParams" }); export type V2PluginShareSaveResponse = { + readonly canPublishToWorkspace?: boolean | null; readonly remotePluginId: string; readonly shareUrl: string; }; export const V2PluginShareSaveResponse = Schema.Struct({ + canPublishToWorkspace: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), remotePluginId: Schema.String, shareUrl: Schema.String, }).annotate({ title: "PluginShareSaveResponse" }); @@ -39640,10 +54159,11 @@ export const V2PluginUninstallParams = Schema.Struct({ pluginId: Schema.String } title: "PluginUninstallParams", }); -export type V2PluginUninstallResponse = {}; -export const V2PluginUninstallResponse = Schema.Struct({}).annotate({ - title: "PluginUninstallResponse", -}); +export type V2PluginUninstallResponse = { readonly [x: string]: Schema.Json }; +export const V2PluginUninstallResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "PluginUninstallResponse" }); export type V2ProcessExitedNotification = { readonly exitCode: number; @@ -39655,7 +54175,7 @@ export type V2ProcessExitedNotification = { }; export const V2ProcessExitedNotification = Schema.Struct({ exitCode: Schema.Number.annotate({ description: "Process exit code.", format: "int32" }).check( - Schema.isInt(), + Schema.isInt().annotate({ expected: "an integer" }), ), processHandle: Schema.String.annotate({ description: "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", @@ -39685,7 +54205,7 @@ export type V2ProcessOutputDeltaNotification = { readonly capReached: boolean; readonly deltaBase64: string; readonly processHandle: string; - readonly stream: "stdout" | "stderr"; + readonly stream: V2ProcessOutputDeltaNotification__ProcessOutputStream; }; export const V2ProcessOutputDeltaNotification = Schema.Struct({ capReached: Schema.Boolean.annotate({ @@ -39696,25 +54216,30 @@ export const V2ProcessOutputDeltaNotification = Schema.Struct({ processHandle: Schema.String.annotate({ description: "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", }), - stream: Schema.Literals(["stdout", "stderr"]).annotate({ - description: "Stream label for `process/outputDelta` notifications.", - }), + stream: Schema.suspend( + (): Schema.Codec => + V2ProcessOutputDeltaNotification__ProcessOutputStream, + ).annotate({ description: "Output stream this chunk belongs to." }), }).annotate({ title: "ProcessOutputDeltaNotification", description: "Base64-encoded output chunk emitted for a streaming `process/spawn` request.", }); -export type V2ProcessOutputDeltaNotification__ProcessOutputStream = "stdout" | "stderr"; -export const V2ProcessOutputDeltaNotification__ProcessOutputStream = Schema.Literals([ - "stdout", - "stderr", -]).annotate({ description: "Stream label for `process/outputDelta` notifications." }); +export type V2ProjectChangedNotification = { + readonly changeType: V2ProjectChangedNotification__ProjectChangeType; + readonly projectId: string; +}; +export const V2ProjectChangedNotification = Schema.Struct({ + changeType: V2ProjectChangedNotification__ProjectChangeType, + projectId: Schema.String, +}).annotate({ title: "ProjectChangedNotification" }); export type V2RawResponseCompletedNotification = { readonly responseId: string; readonly threadId: string; readonly turnId: string; readonly usage?: V2RawResponseCompletedNotification__TokenUsageBreakdown | null; + readonly usageMetadata?: V2RawResponseCompletedNotification__ResponseUsageMetadata | null; }; export const V2RawResponseCompletedNotification = Schema.Struct({ responseId: Schema.String, @@ -39723,6 +54248,9 @@ export const V2RawResponseCompletedNotification = Schema.Struct({ usage: Schema.optionalKey( Schema.Union([V2RawResponseCompletedNotification__TokenUsageBreakdown, Schema.Null]), ), + usageMetadata: Schema.optionalKey( + Schema.Union([V2RawResponseCompletedNotification__ResponseUsageMetadata, Schema.Null]), + ), }).annotate({ title: "RawResponseCompletedNotification", description: @@ -39748,7 +54276,9 @@ export type V2ReasoningSummaryPartAddedNotification = { }; export const V2ReasoningSummaryPartAddedNotification = Schema.Struct({ itemId: Schema.String, - summaryIndex: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + summaryIndex: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), threadId: Schema.String, turnId: Schema.String, }).annotate({ title: "ReasoningSummaryPartAddedNotification" }); @@ -39763,7 +54293,9 @@ export type V2ReasoningSummaryTextDeltaNotification = { export const V2ReasoningSummaryTextDeltaNotification = Schema.Struct({ delta: Schema.String, itemId: Schema.String, - summaryIndex: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + summaryIndex: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), threadId: Schema.String, turnId: Schema.String, }).annotate({ title: "ReasoningSummaryTextDeltaNotification" }); @@ -39776,7 +54308,9 @@ export type V2ReasoningTextDeltaNotification = { readonly turnId: string; }; export const V2ReasoningTextDeltaNotification = Schema.Struct({ - contentIndex: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + contentIndex: Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), delta: Schema.String, itemId: Schema.String, threadId: Schema.String, @@ -39808,7 +54342,7 @@ export const V2ReviewStartParams = Schema.Struct({ delivery: Schema.optionalKey( Schema.Union([V2ReviewStartParams__ReviewDelivery, Schema.Null]).annotate({ description: - "Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`).", + "Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`). Detached delivery is deprecated and emits `deprecationNotice`. Use `thread/start` followed by an inline review for a separate review thread.", }), ), target: V2ReviewStartParams__ReviewTarget, @@ -39827,69 +54361,6 @@ export const V2ReviewStartResponse = Schema.Struct({ turn: V2ReviewStartResponse__Turn, }).annotate({ title: "ReviewStartResponse" }); -export type V2ReviewStartResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2ReviewStartResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ReviewStartResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ReviewStartResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ReviewStartResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ReviewStartResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ReviewStartResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ReviewStartResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2ReviewStartResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ReviewStartResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); - export type V2SendAddCreditsNudgeEmailParams = { readonly creditType: V2SendAddCreditsNudgeEmailParams__AddCreditsNudgeCreditType; }; @@ -39913,8 +54384,11 @@ export const V2ServerRequestResolvedNotification = Schema.Struct({ threadId: Schema.String, }).annotate({ title: "ServerRequestResolvedNotification" }); -export type V2SkillsChangedNotification = {}; -export const V2SkillsChangedNotification = Schema.Struct({}).annotate({ +export type V2SkillsChangedNotification = { readonly [x: string]: Schema.Json }; +export const V2SkillsChangedNotification = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "SkillsChangedNotification", description: "Notification emitted when watched local skill files change.\n\nTreat this as an invalidation signal and re-run `skills/list` with the client's current parameters when refreshed skill metadata is needed.", @@ -39949,10 +54423,11 @@ export const V2SkillsExtraRootsSetParams = Schema.Struct({ extraRoots: Schema.Array(V2SkillsExtraRootsSetParams__AbsolutePathBuf), }).annotate({ title: "SkillsExtraRootsSetParams" }); -export type V2SkillsExtraRootsSetResponse = {}; -export const V2SkillsExtraRootsSetResponse = Schema.Struct({}).annotate({ - title: "SkillsExtraRootsSetResponse", -}); +export type V2SkillsExtraRootsSetResponse = { readonly [x: string]: Schema.Json }; +export const V2SkillsExtraRootsSetResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "SkillsExtraRootsSetResponse" }); export type V2SkillsListParams = { readonly cwds?: ReadonlyArray; @@ -39978,6 +54453,20 @@ export const V2SkillsListResponse = Schema.Struct({ data: Schema.Array(V2SkillsListResponse__SkillsListEntry), }).annotate({ title: "SkillsListResponse" }); +export type V2StrictReviewRequiredNotification = { + readonly startedAtMs: number; + readonly threadId: string; + readonly turnId: string; +}; +export const V2StrictReviewRequiredNotification = Schema.Struct({ + startedAtMs: Schema.Number.annotate({ + description: "Unix timestamp (in milliseconds) when this review started.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + threadId: Schema.String, + turnId: Schema.String, +}).annotate({ title: "StrictReviewRequiredNotification" }); + export type V2TerminalInteractionNotification = { readonly itemId: string; readonly processId: string; @@ -39994,20 +54483,22 @@ export const V2TerminalInteractionNotification = Schema.Struct({ }).annotate({ title: "TerminalInteractionNotification" }); export type V2ThreadApproveGuardianDeniedActionParams = { - readonly event: unknown; + readonly event: Schema.Json; readonly threadId: string; }; export const V2ThreadApproveGuardianDeniedActionParams = Schema.Struct({ - event: Schema.Unknown.annotate({ + event: Schema.Json.annotate({ + expected: "JSON value", description: "Serialized `codex_protocol::protocol::GuardianAssessmentEvent`.", }), threadId: Schema.String, }).annotate({ title: "ThreadApproveGuardianDeniedActionParams" }); -export type V2ThreadApproveGuardianDeniedActionResponse = {}; -export const V2ThreadApproveGuardianDeniedActionResponse = Schema.Struct({}).annotate({ - title: "ThreadApproveGuardianDeniedActionResponse", -}); +export type V2ThreadApproveGuardianDeniedActionResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadApproveGuardianDeniedActionResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ThreadApproveGuardianDeniedActionResponse" }); export type V2ThreadArchivedNotification = { readonly threadId: string }; export const V2ThreadArchivedNotification = Schema.Struct({ threadId: Schema.String }).annotate({ @@ -40019,9 +54510,116 @@ export const V2ThreadArchiveParams = Schema.Struct({ threadId: Schema.String }). title: "ThreadArchiveParams", }); -export type V2ThreadArchiveResponse = {}; -export const V2ThreadArchiveResponse = Schema.Struct({}).annotate({ - title: "ThreadArchiveResponse", +export type V2ThreadArchiveResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadArchiveResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ThreadArchiveResponse" }); + +export type V2ThreadAttachmentAddParams = { + readonly attachmentType: string; + readonly identityKey: string; + readonly payload: Schema.Json; + readonly threadId: string; +}; +export const V2ThreadAttachmentAddParams = Schema.Struct({ + attachmentType: Schema.String, + identityKey: Schema.String, + payload: Schema.Json.annotate({ expected: "JSON value" }), + threadId: Schema.String, +}).annotate({ + title: "ThreadAttachmentAddParams", + description: "Parameters for creating or locating an attachment on its owning thread.", +}); + +export type V2ThreadAttachmentAddResponse = { + readonly attachment: V2ThreadAttachmentAddResponse__ThreadAttachment; + readonly outcome: V2ThreadAttachmentAddResponse__ThreadAttachmentAddOutcome; +}; +export const V2ThreadAttachmentAddResponse = Schema.Struct({ + attachment: V2ThreadAttachmentAddResponse__ThreadAttachment, + outcome: V2ThreadAttachmentAddResponse__ThreadAttachmentAddOutcome, +}).annotate({ + title: "ThreadAttachmentAddResponse", + description: "The created or existing attachment.", +}); + +export type V2ThreadAttachmentListParams = { + readonly cursor?: string | null; + readonly limit?: number | null; + readonly threadId: string; +}; +export const V2ThreadAttachmentListParams = Schema.Struct({ + cursor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + limit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + threadId: Schema.String, +}).annotate({ + title: "ThreadAttachmentListParams", + description: "Parameters for listing attachments from one thread.", +}); + +export type V2ThreadAttachmentListResponse = { + readonly data: ReadonlyArray; + readonly nextCursor?: string | null; +}; +export const V2ThreadAttachmentListResponse = Schema.Struct({ + data: Schema.Array(V2ThreadAttachmentListResponse__ThreadAttachment), + nextCursor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ + title: "ThreadAttachmentListResponse", + description: "One page of attachments associated with the requested thread.", +}); + +export type V2ThreadAttachmentRemoveParams = { + readonly attachmentType: string; + readonly identityKey: string; + readonly threadId: string; +}; +export const V2ThreadAttachmentRemoveParams = Schema.Struct({ + attachmentType: Schema.String, + identityKey: Schema.String, + threadId: Schema.String, +}).annotate({ + title: "ThreadAttachmentRemoveParams", + description: "Parameters for deleting an attachment by its stable thread-local identity.", +}); + +export type V2ThreadAttachmentRemoveResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadAttachmentRemoveResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ + title: "ThreadAttachmentRemoveResponse", + description: "Successful deletion does not return additional attachment data.", +}); + +export type V2ThreadAttachmentUpdatedNotification = { + readonly attachmentId: string; + readonly attachmentType: string; + readonly identityKey: string; + readonly operation: V2ThreadAttachmentUpdatedNotification__ThreadAttachmentOperation; + readonly threadId: string; +}; +export const V2ThreadAttachmentUpdatedNotification = Schema.Struct({ + attachmentId: Schema.String, + attachmentType: Schema.String, + identityKey: Schema.String, + operation: V2ThreadAttachmentUpdatedNotification__ThreadAttachmentOperation, + threadId: Schema.String, +}).annotate({ + title: "ThreadAttachmentUpdatedNotification", + description: "Notification published after a thread attachment is created or deleted.", }); export type V2ThreadClosedNotification = { readonly threadId: string }; @@ -40034,10 +54632,11 @@ export const V2ThreadCompactStartParams = Schema.Struct({ threadId: Schema.Strin title: "ThreadCompactStartParams", }); -export type V2ThreadCompactStartResponse = {}; -export const V2ThreadCompactStartResponse = Schema.Struct({}).annotate({ - title: "ThreadCompactStartResponse", -}); +export type V2ThreadCompactStartResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadCompactStartResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ThreadCompactStartResponse" }); export type V2ThreadDeletedNotification = { readonly threadId: string }; export const V2ThreadDeletedNotification = Schema.Struct({ threadId: Schema.String }).annotate({ @@ -40049,17 +54648,21 @@ export const V2ThreadDeleteParams = Schema.Struct({ threadId: Schema.String }).a title: "ThreadDeleteParams", }); -export type V2ThreadDeleteResponse = {}; -export const V2ThreadDeleteResponse = Schema.Struct({}).annotate({ title: "ThreadDeleteResponse" }); +export type V2ThreadDeleteResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadDeleteResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ThreadDeleteResponse" }); export type V2ThreadForkParams = { readonly approvalPolicy?: V2ThreadForkParams__AskForApproval | null; readonly approvalsReviewer?: V2ThreadForkParams__ApprovalsReviewer | null; readonly baseInstructions?: string | null; - readonly config?: { readonly [x: string]: unknown } | null; + readonly config?: { readonly [x: string]: Schema.Json } | null; readonly cwd?: string | null; readonly developerInstructions?: string | null; readonly ephemeral?: boolean; + readonly excludeTurns?: boolean; readonly lastTurnId?: string | null; readonly model?: string | null; readonly modelProvider?: string | null; @@ -40080,11 +54683,20 @@ export const V2ThreadForkParams = Schema.Struct({ ), baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), config: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), + Schema.Null, + ]), ), cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), ephemeral: Schema.optionalKey(Schema.Boolean), + excludeTurns: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true, return only thread metadata and live fork state without populating `thread.turns`. This is useful when the client plans to call `thread/turns/list` immediately after forking. Full-history hydration is deprecated for paginated threads; use this with `thread/turns/list` and `thread/items/list` instead.", + }), + ), lastTurnId: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -40126,33 +54738,30 @@ export const V2ThreadForkParams__AbsolutePathBuf = Schema.String.annotate({ export type V2ThreadForkResponse = { readonly approvalPolicy: V2ThreadForkResponse__AskForApproval; - readonly approvalsReviewer: "user" | "auto_review" | "guardian_subagent"; + readonly approvalsReviewer: V2ThreadForkResponse__ApprovalsReviewer; readonly cwd: V2ThreadForkResponse__AbsolutePathBuf; + readonly disabledPluginIds?: ReadonlyArray; readonly instructionSources?: ReadonlyArray; readonly model: string; readonly modelProvider: string; readonly reasoningEffort?: V2ThreadForkResponse__ReasoningEffort | null; - readonly sandbox: - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } - | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; + readonly sandbox: V2ThreadForkResponse__SandboxPolicy; readonly serviceTier?: string | null; readonly thread: V2ThreadForkResponse__Thread; }; export const V2ThreadForkResponse = Schema.Struct({ approvalPolicy: V2ThreadForkResponse__AskForApproval, - approvalsReviewer: Schema.Literals(["user", "auto_review", "guardian_subagent"]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", - }), + approvalsReviewer: Schema.suspend( + (): Schema.Codec => + V2ThreadForkResponse__ApprovalsReviewer, + ).annotate({ description: "Reviewer currently used for approval requests on this thread." }), cwd: V2ThreadForkResponse__AbsolutePathBuf, + disabledPluginIds: Schema.optionalKey( + Schema.Array(Schema.String).annotate({ + description: "Saved list of disabled plugin IDs. Does not yet filter plugin capabilities.", + default: [], + }), + ), instructionSources: Schema.optionalKey( Schema.Array(V2ThreadForkResponse__LegacyAppPathString).annotate({ description: @@ -40165,38 +54774,8 @@ export const V2ThreadForkResponse = Schema.Struct({ reasoningEffort: Schema.optionalKey( Schema.Union([V2ThreadForkResponse__ReasoningEffort, Schema.Null]), ), - sandbox: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ - title: "WorkspaceWriteSandboxPolicyType", - }), - writableRoots: Schema.optionalKey( - Schema.Array(V2ThreadForkResponse__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), - ], - { mode: "oneOf" }, + sandbox: Schema.suspend( + (): Schema.Codec => V2ThreadForkResponse__SandboxPolicy, ).annotate({ description: "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", @@ -40208,88 +54787,22 @@ export const V2ThreadForkResponse = Schema.Struct({ export type V2ThreadForkResponse__ActivePermissionProfile = { readonly extends?: string | null; readonly id: string; -}; -export const V2ThreadForkResponse__ActivePermissionProfile = Schema.Struct({ - extends: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", - }), - Schema.Null, - ]), - ), - id: Schema.String.annotate({ - description: - "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", - }), -}); - -export type V2ThreadForkResponse__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const V2ThreadForkResponse__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); - -export type V2ThreadForkResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2ThreadForkResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadForkResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadForkResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadForkResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadForkResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ThreadForkResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadForkResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); +}; +export const V2ThreadForkResponse__ActivePermissionProfile = Schema.Struct({ + extends: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", + }), + Schema.Null, + ]), + ), + id: Schema.String.annotate({ + description: + "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + }), +}); export type V2ThreadForkResponse__MultiAgentMode = | "explicitRequestOnly" @@ -40306,112 +54819,24 @@ export const V2ThreadForkResponse__MultiAgentMode = Schema.Union( "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", }); -export type V2ThreadForkResponse__NetworkAccess = "restricted" | "enabled"; -export const V2ThreadForkResponse__NetworkAccess = Schema.Literals(["restricted", "enabled"]); - -export type V2ThreadForkResponse__SandboxPolicy = - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } - | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; -export const V2ThreadForkResponse__SandboxPolicy = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), - writableRoots: Schema.optionalKey( - Schema.Array(V2ThreadForkResponse__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadForkResponse__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadForkResponse__SubAgentSource }; -export const V2ThreadForkResponse__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadForkResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadForkResponse__ThreadExtra = {}; -export const V2ThreadForkResponse__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", +export type V2ThreadForkResponse__ThreadEnvironment = { + readonly cwd: V2ThreadForkResponse__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const V2ThreadForkResponse__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadForkResponse__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadForkResponse__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", }); -export type V2ThreadForkResponse__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadForkResponse__ThreadHistoryMode = Schema.Literals(["legacy", "paginated"]); - -export type V2ThreadForkResponse__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadForkResponse__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadForkResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadForkResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadForkResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); +export type V2ThreadForkResponse__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadForkResponse__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); export type V2ThreadGoalClearedNotification = { readonly threadId: string }; export const V2ThreadGoalClearedNotification = Schema.Struct({ threadId: Schema.String }).annotate({ @@ -40451,7 +54876,12 @@ export const V2ThreadGoalSetParams = Schema.Struct({ status: Schema.optionalKey(Schema.Union([V2ThreadGoalSetParams__ThreadGoalStatus, Schema.Null])), threadId: Schema.String, tokenBudget: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + Schema.Union([ + Schema.Number.annotate({ format: "int64" }).check( + Schema.isInt().annotate({ expected: "an integer" }), + ), + Schema.Null, + ]), ), }).annotate({ title: "ThreadGoalSetParams" }); @@ -40472,20 +54902,91 @@ export const V2ThreadGoalUpdatedNotification = Schema.Struct({ }).annotate({ title: "ThreadGoalUpdatedNotification" }); export type V2ThreadInjectItemsParams = { - readonly items: ReadonlyArray; + readonly items: ReadonlyArray; readonly threadId: string; }; export const V2ThreadInjectItemsParams = Schema.Struct({ - items: Schema.Array(Schema.Unknown).annotate({ + items: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })).annotate({ description: "Raw Responses API items to append to the thread's model-visible history.", }), threadId: Schema.String, }).annotate({ title: "ThreadInjectItemsParams" }); -export type V2ThreadInjectItemsResponse = {}; -export const V2ThreadInjectItemsResponse = Schema.Struct({}).annotate({ - title: "ThreadInjectItemsResponse", -}); +export type V2ThreadInjectItemsResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadInjectItemsResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ThreadInjectItemsResponse" }); + +export type V2ThreadItemsListParams = { + readonly cursor?: V2ThreadItemsListParams__ThreadItemsListCursor | null; + readonly limit?: number | null; + readonly sortDirection?: V2ThreadItemsListParams__SortDirection | null; + readonly threadId: string; + readonly turnId?: string | null; +}; +export const V2ThreadItemsListParams = Schema.Struct({ + cursor: Schema.optionalKey( + Schema.Union([V2ThreadItemsListParams__ThreadItemsListCursor, Schema.Null]).annotate({ + description: + "Opaque continuation cursor or an exclusive item anchor in the requested visible turn. An item anchor requires a non-empty `turnId`; ascending (the default) returns items after it, and descending returns items before it. Continue with the returned string cursor.", + }), + ), + limit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ description: "Optional item page size.", format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + sortDirection: Schema.optionalKey( + Schema.Union([V2ThreadItemsListParams__SortDirection, Schema.Null]).annotate({ + description: "Optional item pagination direction; defaults to ascending.", + }), + ), + threadId: Schema.String, + turnId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional turn id to filter by. When omitted, returns items across the thread.", + }), + Schema.Null, + ]), + ), +}).annotate({ title: "ThreadItemsListParams" }); + +export type V2ThreadItemsListResponse = { + readonly backwardsCursor?: string | null; + readonly data: ReadonlyArray; + readonly nextCursor?: string | null; +}; +export const V2ThreadItemsListResponse = Schema.Struct({ + backwardsCursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Opaque cursor to pass as `cursor` when reversing `sortDirection`. This is only populated when the page contains at least one item.", + }), + Schema.Null, + ]), + ), + data: Schema.Array(V2ThreadItemsListResponse__ThreadItemEntry), + nextCursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", + }), + Schema.Null, + ]), + ), +}).annotate({ title: "ThreadItemsListResponse" }); export type V2ThreadListParams = { readonly archived?: boolean | null; @@ -40493,7 +54994,9 @@ export type V2ThreadListParams = { readonly cwd?: V2ThreadListParams__ThreadListCwdFilter | null; readonly limit?: number | null; readonly modelProviders?: ReadonlyArray | null; + readonly originators?: ReadonlyArray | null; readonly searchTerm?: string | null; + readonly sectionId?: string | null; readonly sortDirection?: V2ThreadListParams__SortDirection | null; readonly sortKey?: V2ThreadListParams__ThreadSortKey | null; readonly sourceKinds?: ReadonlyArray | null; @@ -40529,8 +55032,12 @@ export const V2ThreadListParams = Schema.Struct({ description: "Optional page size; defaults to a reasonable server-side value.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -40543,6 +55050,15 @@ export const V2ThreadListParams = Schema.Struct({ Schema.Null, ]), ), + originators: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: + "Optional originator allowlist, matching any supplied value exactly. Supported by hosted backends only; the local app-server rejects a nonempty list. Omitted or empty lists leave originators unrestricted.", + }), + Schema.Null, + ]), + ), searchTerm: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -40551,6 +55067,15 @@ export const V2ThreadListParams = Schema.Struct({ Schema.Null, ]), ), + sectionId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Omit to include every section, set to `null` for unsectioned threads, or provide a section ID to return only threads in that section.", + }), + Schema.Null, + ]), + ), sortDirection: Schema.optionalKey( Schema.Union([V2ThreadListParams__SortDirection, Schema.Null]).annotate({ description: "Optional sort direction; defaults to descending (newest first).", @@ -40605,122 +55130,24 @@ export const V2ThreadListResponse = Schema.Struct({ ), }).annotate({ title: "ThreadListResponse" }); -export type V2ThreadListResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2ThreadListResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadListResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadListResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadListResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadListResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ThreadListResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadListResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2ThreadListResponse__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadListResponse__SubAgentSource }; -export const V2ThreadListResponse__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadListResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadListResponse__ThreadExtra = {}; -export const V2ThreadListResponse__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", +export type V2ThreadListResponse__ThreadEnvironment = { + readonly cwd: V2ThreadListResponse__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const V2ThreadListResponse__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadListResponse__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadListResponse__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", }); -export type V2ThreadListResponse__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadListResponse__ThreadHistoryMode = Schema.Literals(["legacy", "paginated"]); - -export type V2ThreadListResponse__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadListResponse__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadListResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadListResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadListResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); +export type V2ThreadListResponse__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadListResponse__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); export type V2ThreadLoadedListParams = { readonly cursor?: string | null; @@ -40741,8 +55168,12 @@ export const V2ThreadLoadedListParams = Schema.Struct({ description: "Optional page size; defaults to no limit.", format: "uint32", }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -40784,276 +55215,89 @@ export const V2ThreadMetadataUpdateParams = Schema.Struct({ threadId: Schema.String, }).annotate({ title: "ThreadMetadataUpdateParams" }); -export type V2ThreadMetadataUpdateResponse = { - readonly thread: V2ThreadMetadataUpdateResponse__Thread; -}; -export const V2ThreadMetadataUpdateResponse = Schema.Struct({ - thread: V2ThreadMetadataUpdateResponse__Thread, -}).annotate({ title: "ThreadMetadataUpdateResponse" }); - -export type V2ThreadMetadataUpdateResponse__ByteRange = { - readonly end: number; - readonly start: number; -}; -export const V2ThreadMetadataUpdateResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadMetadataUpdateResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadMetadataUpdateResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ThreadMetadataUpdateResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadMetadataUpdateResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2ThreadMetadataUpdateResponse__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadMetadataUpdateResponse__SubAgentSource }; -export const V2ThreadMetadataUpdateResponse__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadMetadataUpdateResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadMetadataUpdateResponse__ThreadExtra = {}; -export const V2ThreadMetadataUpdateResponse__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", -}); - -export type V2ThreadMetadataUpdateResponse__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadMetadataUpdateResponse__ThreadHistoryMode = Schema.Literals([ - "legacy", - "paginated", -]); - -export type V2ThreadMetadataUpdateResponse__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadMetadataUpdateResponse__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadMetadataUpdateResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadMetadataUpdateResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadMetadataUpdateResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); - -export type V2ThreadNameUpdatedNotification = { - readonly threadId: string; - readonly threadName?: string | null; -}; -export const V2ThreadNameUpdatedNotification = Schema.Struct({ - threadId: Schema.String, - threadName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}).annotate({ title: "ThreadNameUpdatedNotification" }); - -export type V2ThreadReadParams = { readonly includeTurns?: boolean; readonly threadId: string }; -export const V2ThreadReadParams = Schema.Struct({ - includeTurns: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "When true, include turns and their items from rollout history.", - }), - ), - threadId: Schema.String, -}).annotate({ title: "ThreadReadParams" }); - -export type V2ThreadReadResponse = { readonly thread: V2ThreadReadResponse__Thread }; -export const V2ThreadReadResponse = Schema.Struct({ - thread: V2ThreadReadResponse__Thread, -}).annotate({ title: "ThreadReadResponse" }); - -export type V2ThreadReadResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2ThreadReadResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadReadResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadReadResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadReadResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadReadResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ThreadReadResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadReadResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2ThreadReadResponse__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadReadResponse__SubAgentSource }; -export const V2ThreadReadResponse__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadReadResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadReadResponse__ThreadExtra = {}; -export const V2ThreadReadResponse__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", +export type V2ThreadMetadataUpdateResponse = { + readonly thread: V2ThreadMetadataUpdateResponse__Thread; +}; +export const V2ThreadMetadataUpdateResponse = Schema.Struct({ + thread: V2ThreadMetadataUpdateResponse__Thread, +}).annotate({ title: "ThreadMetadataUpdateResponse" }); + +export type V2ThreadMetadataUpdateResponse__ThreadEnvironment = { + readonly cwd: V2ThreadMetadataUpdateResponse__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const V2ThreadMetadataUpdateResponse__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadMetadataUpdateResponse__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadMetadataUpdateResponse__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", }); -export type V2ThreadReadResponse__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadReadResponse__ThreadHistoryMode = Schema.Literals(["legacy", "paginated"]); +export type V2ThreadMetadataUpdateResponse__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadMetadataUpdateResponse__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); -export type V2ThreadReadResponse__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadReadResponse__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadReadResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, +export type V2ThreadNameUpdatedNotification = { + readonly threadId: string; + readonly threadName?: string | null; +}; +export const V2ThreadNameUpdatedNotification = Schema.Struct({ + threadId: Schema.String, + threadName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}).annotate({ title: "ThreadNameUpdatedNotification" }); + +export type V2ThreadProjectUpdatedNotification = { + readonly projectId: string | null; + readonly threadId: string; +}; +export const V2ThreadProjectUpdatedNotification = Schema.Struct({ + projectId: Schema.Union([Schema.String, Schema.Null]), + threadId: Schema.String, +}).annotate({ title: "ThreadProjectUpdatedNotification" }); + +export type V2ThreadQueueChangedNotification = { readonly threadId: string }; +export const V2ThreadQueueChangedNotification = Schema.Struct({ threadId: Schema.String }).annotate( + { title: "ThreadQueueChangedNotification" }, ); -export type V2ThreadReadResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadReadResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); +export type V2ThreadReadParams = { readonly includeTurns?: boolean; readonly threadId: string }; +export const V2ThreadReadParams = Schema.Struct({ + includeTurns: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true, include turns and their items from rollout history. Full-history hydration is deprecated for paginated threads; prefer a metadata-only read and page with `thread/turns/list` and `thread/items/list`.", + }), + ), + threadId: Schema.String, +}).annotate({ title: "ThreadReadParams" }); + +export type V2ThreadReadResponse = { readonly thread: V2ThreadReadResponse__Thread }; +export const V2ThreadReadResponse = Schema.Struct({ + thread: V2ThreadReadResponse__Thread, +}).annotate({ title: "ThreadReadResponse" }); + +export type V2ThreadReadResponse__ThreadEnvironment = { + readonly cwd: V2ThreadReadResponse__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const V2ThreadReadResponse__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadReadResponse__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadReadResponse__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", +}); + +export type V2ThreadReadResponse__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadReadResponse__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); export type V2ThreadRealtimeClosedNotification = { readonly reason?: string | null; @@ -41080,17 +55324,55 @@ export const V2ThreadRealtimeErrorNotification = Schema.Struct({ }); export type V2ThreadRealtimeItemAddedNotification = { - readonly item: unknown; + readonly item: Schema.Json; readonly threadId: string; }; export const V2ThreadRealtimeItemAddedNotification = Schema.Struct({ - item: Schema.Unknown, + item: Schema.Json.annotate({ expected: "JSON value" }), threadId: Schema.String, }).annotate({ title: "ThreadRealtimeItemAddedNotification", description: "EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.", }); +export type V2ThreadRealtimeItemCompletedNotification = { + readonly item: V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeItem; + readonly threadId: string; +}; +export const V2ThreadRealtimeItemCompletedNotification = Schema.Struct({ + item: V2ThreadRealtimeItemCompletedNotification__ThreadRealtimeItem, + threadId: Schema.String, +}).annotate({ + title: "ThreadRealtimeItemCompletedNotification", + description: "EXPERIMENTAL - a realtime timeline item published after canonical commit.", +}); + +export type V2ThreadRealtimeItemStartedNotification = { + readonly item: V2ThreadRealtimeItemStartedNotification__ThreadRealtimeItem; + readonly threadId: string; +}; +export const V2ThreadRealtimeItemStartedNotification = Schema.Struct({ + item: V2ThreadRealtimeItemStartedNotification__ThreadRealtimeItem, + threadId: Schema.String, +}).annotate({ + title: "ThreadRealtimeItemStartedNotification", + description: "EXPERIMENTAL - a realtime timeline item started before its content streams.", +}); + +export type V2ThreadRealtimeItemTranscriptDeltaNotification = { + readonly delta: string; + readonly itemId: string; + readonly threadId: string; +}; +export const V2ThreadRealtimeItemTranscriptDeltaNotification = Schema.Struct({ + delta: Schema.String, + itemId: Schema.String, + threadId: Schema.String, +}).annotate({ + title: "ThreadRealtimeItemTranscriptDeltaNotification", + description: "EXPERIMENTAL - text appended to an active realtime transcript item.", +}); + export type V2ThreadRealtimeOutputAudioDeltaNotification = { readonly audio: V2ThreadRealtimeOutputAudioDeltaNotification__ThreadRealtimeAudioChunk; readonly threadId: string; @@ -41160,9 +55442,10 @@ export type V2ThreadResumeParams = { readonly approvalPolicy?: V2ThreadResumeParams__AskForApproval | null; readonly approvalsReviewer?: V2ThreadResumeParams__ApprovalsReviewer | null; readonly baseInstructions?: string | null; - readonly config?: { readonly [x: string]: unknown } | null; + readonly config?: { readonly [x: string]: Schema.Json } | null; readonly cwd?: string | null; readonly developerInstructions?: string | null; + readonly excludeTurns?: boolean; readonly model?: string | null; readonly modelProvider?: string | null; readonly personality?: V2ThreadResumeParams__Personality | null; @@ -41182,10 +55465,19 @@ export const V2ThreadResumeParams = Schema.Struct({ ), baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), config: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), + Schema.Null, + ]), ), cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + excludeTurns: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "When true, return only thread metadata and live-resume state without populating `thread.turns`. This is useful when the client plans to call `thread/turns/list` immediately after resuming. Full-history hydration is deprecated for paginated threads; use this with `thread/turns/list` and `thread/items/list` instead.", + }), + ), model: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ @@ -41195,7 +55487,12 @@ export const V2ThreadResumeParams = Schema.Struct({ ]), ), modelProvider: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - personality: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__Personality, Schema.Null])), + personality: Schema.optionalKey( + Schema.Union([V2ThreadResumeParams__Personality, Schema.Null]).annotate({ + description: + "@deprecated `friendly` and `pragmatic` no longer select a style. Changing this does not rewrite the thread's existing instructions.", + }), + ), sandbox: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__SandboxMode, Schema.Null])), serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), threadId: Schema.String, @@ -41247,6 +55544,7 @@ export type V2ThreadResumeParams__ResponseItem = | { readonly arguments: string; readonly call_id: string; + readonly encrypted_function_args?: ReadonlyArray | null; readonly id?: string | null; readonly internal_chat_message_metadata_passthrough?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null; readonly name: string; @@ -41254,7 +55552,7 @@ export type V2ThreadResumeParams__ResponseItem = readonly type: "function_call"; } | { - readonly arguments: unknown; + readonly arguments: Schema.Json; readonly call_id?: string | null; readonly execution: string; readonly id?: string | null; @@ -41263,9 +55561,11 @@ export type V2ThreadResumeParams__ResponseItem = readonly type: "tool_search_call"; } | { - readonly call_id: string; + readonly call_id?: string | null; readonly id?: string | null; readonly internal_chat_message_metadata_passthrough?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null; + readonly name?: string | null; + readonly namespace?: string | null; readonly output: V2ThreadResumeParams__FunctionCallOutputBody; readonly type: "function_call_output"; } @@ -41293,7 +55593,7 @@ export type V2ThreadResumeParams__ResponseItem = readonly id?: string | null; readonly internal_chat_message_metadata_passthrough?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null; readonly status: string; - readonly tools: ReadonlyArray; + readonly tools: ReadonlyArray; readonly type: "tool_search_output"; } | { @@ -41317,6 +55617,10 @@ export type V2ThreadResumeParams__ResponseItem = readonly internal_chat_message_metadata_passthrough?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null; readonly type: "compaction"; } + | { + readonly reasoning: V2ThreadResumeParams__ConfigurationReasoning; + readonly type: "configuration_update"; + } | { readonly type: "compaction_trigger" } | { readonly encrypted_content?: string | null; @@ -41386,6 +55690,9 @@ export const V2ThreadResumeParams__ResponseItem = Schema.Union( Schema.Struct({ arguments: Schema.String, call_id: Schema.String, + encrypted_function_args: Schema.optionalKey( + Schema.Union([Schema.Array(Schema.String), Schema.Null]), + ), id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), internal_chat_message_metadata_passthrough: Schema.optionalKey( Schema.Union([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null]), @@ -41395,7 +55702,7 @@ export const V2ThreadResumeParams__ResponseItem = Schema.Union( type: Schema.Literal("function_call").annotate({ title: "FunctionCallResponseItemType" }), }).annotate({ title: "FunctionCallResponseItem" }), Schema.Struct({ - arguments: Schema.Unknown, + arguments: Schema.Json.annotate({ expected: "JSON value" }), call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), execution: Schema.String, id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -41408,11 +55715,13 @@ export const V2ThreadResumeParams__ResponseItem = Schema.Union( }), }).annotate({ title: "ToolSearchCallResponseItem" }), Schema.Struct({ - call_id: Schema.String, + call_id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), id: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), internal_chat_message_metadata_passthrough: Schema.optionalKey( Schema.Union([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null]), ), + name: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), output: V2ThreadResumeParams__FunctionCallOutputBody, type: Schema.Literal("function_call_output").annotate({ title: "FunctionCallOutputResponseItemType", @@ -41452,7 +55761,7 @@ export const V2ThreadResumeParams__ResponseItem = Schema.Union( Schema.Union([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null]), ), status: Schema.String, - tools: Schema.Array(Schema.Unknown), + tools: Schema.Array(Schema.Json.annotate({ expected: "JSON value" })), type: Schema.Literal("tool_search_output").annotate({ title: "ToolSearchOutputResponseItemType", }), @@ -41488,6 +55797,15 @@ export const V2ThreadResumeParams__ResponseItem = Schema.Union( ), type: Schema.Literal("compaction").annotate({ title: "CompactionResponseItemType" }), }).annotate({ title: "CompactionResponseItem" }), + Schema.Struct({ + reasoning: V2ThreadResumeParams__ConfigurationReasoning, + type: Schema.Literal("configuration_update").annotate({ + title: "ConfigurationUpdateResponseItemType", + }), + }).annotate({ + title: "ConfigurationUpdateResponseItem", + description: "A durable input control interpreted by the backend at its position in history.", + }), Schema.Struct({ type: Schema.Literal("compaction_trigger").annotate({ title: "CompactionTriggerResponseItemType", @@ -41524,8 +55842,12 @@ export const V2ThreadResumeParams__ThreadResumeInitialTurnsPageParams = Schema.S limit: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ description: "Optional turn page size.", format: "uint32" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), @@ -41538,783 +55860,370 @@ export const V2ThreadResumeParams__ThreadResumeInitialTurnsPageParams = Schema.S export type V2ThreadResumeResponse = { readonly approvalPolicy: V2ThreadResumeResponse__AskForApproval; - readonly approvalsReviewer: "user" | "auto_review" | "guardian_subagent"; + readonly approvalsReviewer: V2ThreadResumeResponse__ApprovalsReviewer; + readonly collaborationMode?: V2ThreadResumeResponse__CollaborationMode | null; readonly cwd: V2ThreadResumeResponse__AbsolutePathBuf; + readonly disabledPluginIds?: ReadonlyArray; readonly instructionSources?: ReadonlyArray; + readonly itemsBackwardsCursor?: string | null; readonly model: string; readonly modelProvider: string; readonly reasoningEffort?: V2ThreadResumeResponse__ReasoningEffort | null; - readonly sandbox: - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } - | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; + readonly sandbox: V2ThreadResumeResponse__SandboxPolicy; readonly serviceTier?: string | null; readonly thread: V2ThreadResumeResponse__Thread; + readonly turnsBackwardsCursor?: string | null; }; export const V2ThreadResumeResponse = Schema.Struct({ approvalPolicy: V2ThreadResumeResponse__AskForApproval, - approvalsReviewer: Schema.Literals(["user", "auto_review", "guardian_subagent"]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", - }), - cwd: V2ThreadResumeResponse__AbsolutePathBuf, - instructionSources: Schema.optionalKey( - Schema.Array(V2ThreadResumeResponse__LegacyAppPathString).annotate({ - description: - "Environment-native paths to instruction source files currently loaded for this thread.", - default: [], + approvalsReviewer: Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__ApprovalsReviewer, + ).annotate({ description: "Reviewer currently used for approval requests on this thread." }), + collaborationMode: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__CollaborationMode, Schema.Null]).annotate({ + description: "Effective collaboration mode. Absent when resuming from an older server.", }), ), - model: Schema.String, - modelProvider: Schema.String, - reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]), - ), - sandbox: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ - title: "WorkspaceWriteSandboxPolicyType", - }), - writableRoots: Schema.optionalKey( - Schema.Array(V2ThreadResumeResponse__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), - ], - { mode: "oneOf" }, - ).annotate({ - description: - "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", - }), - serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - thread: V2ThreadResumeResponse__Thread, -}).annotate({ title: "ThreadResumeResponse" }); - -export type V2ThreadResumeResponse__ActivePermissionProfile = { - readonly extends?: string | null; - readonly id: string; -}; -export const V2ThreadResumeResponse__ActivePermissionProfile = Schema.Struct({ - extends: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", - }), - Schema.Null, - ]), - ), - id: Schema.String.annotate({ - description: - "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", - }), -}); - -export type V2ThreadResumeResponse__ApprovalsReviewer = - | "user" - | "auto_review" - | "guardian_subagent"; -export const V2ThreadResumeResponse__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); - -export type V2ThreadResumeResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2ThreadResumeResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadResumeResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadResumeResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadResumeResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadResumeResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ThreadResumeResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadResumeResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2ThreadResumeResponse__MultiAgentMode = - | "explicitRequestOnly" - | "proactive" - | { readonly custom: string }; -export const V2ThreadResumeResponse__MultiAgentMode = Schema.Union( - [ - Schema.Literals(["explicitRequestOnly", "proactive"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomMultiAgentMode" }), - ], - { mode: "oneOf" }, -).annotate({ - description: - "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", -}); - -export type V2ThreadResumeResponse__NetworkAccess = "restricted" | "enabled"; -export const V2ThreadResumeResponse__NetworkAccess = Schema.Literals(["restricted", "enabled"]); - -export type V2ThreadResumeResponse__SandboxPolicy = - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } - | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; -export const V2ThreadResumeResponse__SandboxPolicy = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), - writableRoots: Schema.optionalKey( - Schema.Array(V2ThreadResumeResponse__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadResumeResponse__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadResumeResponse__SubAgentSource }; -export const V2ThreadResumeResponse__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadResumeResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadResumeResponse__ThreadExtra = {}; -export const V2ThreadResumeResponse__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", -}); - -export type V2ThreadResumeResponse__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadResumeResponse__ThreadHistoryMode = Schema.Literals(["legacy", "paginated"]); - -export type V2ThreadResumeResponse__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadResumeResponse__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadResumeResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadResumeResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadResumeResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); - -export type V2ThreadResumeResponse__TurnsPage = { - readonly backwardsCursor?: string | null; - readonly data: ReadonlyArray; - readonly nextCursor?: string | null; -}; -export const V2ThreadResumeResponse__TurnsPage = Schema.Struct({ - backwardsCursor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - data: Schema.Array(V2ThreadResumeResponse__Turn), - nextCursor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2ThreadRollbackParams = { readonly numTurns: number; readonly threadId: string }; -export const V2ThreadRollbackParams = Schema.Struct({ - numTurns: Schema.Number.annotate({ - description: - "The number of turns to drop from the end of the thread. Must be >= 1.\n\nThis only modifies the thread's history and does not revert local file changes that have been made by the agent. Clients are responsible for reverting these changes.", - format: "uint32", - }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - threadId: Schema.String, -}).annotate({ - title: "ThreadRollbackParams", - description: "DEPRECATED: `thread/rollback` will be removed soon.", -}); - -export type V2ThreadRollbackResponse = { - readonly thread: { - readonly agentNickname?: string | null; - readonly agentRole?: string | null; - readonly cliVersion: string; - readonly createdAt: number; - readonly cwd: string; - readonly ephemeral: boolean; - readonly forkedFromId?: string | null; - readonly gitInfo?: V2ThreadRollbackResponse__GitInfo | null; - readonly id: string; - readonly modelProvider: string; - readonly name?: string | null; - readonly parentThreadId?: string | null; - readonly path?: string | null; - readonly preview: string; - readonly recencyAt?: number | null; - readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadRollbackResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; - readonly threadSource?: V2ThreadRollbackResponse__ThreadSource | null; - readonly turns: ReadonlyArray; - readonly updatedAt: number; - }; -}; -export const V2ThreadRollbackResponse = Schema.Struct({ - thread: Schema.Struct({ - agentNickname: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", - }), - Schema.Null, - ]), - ), - agentRole: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", - }), - Schema.Null, - ]), - ), - cliVersion: Schema.String.annotate({ - description: "Version of the CLI that created the thread.", - }), - createdAt: Schema.Number.annotate({ - description: "Unix timestamp (in seconds) when the thread was created.", - format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), - ephemeral: Schema.Boolean.annotate({ - description: "Whether the thread is ephemeral and should not be materialized on disk.", - }), - forkedFromId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: "Source thread id when this thread was created by forking another thread.", - }), - Schema.Null, - ]), - ), - gitInfo: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__GitInfo, Schema.Null]).annotate({ - description: "Optional Git metadata captured when the thread was created.", - }), - ), - id: Schema.String.annotate({ - description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", - }), - modelProvider: Schema.String.annotate({ - description: "Model provider used for this thread (for example, 'openai').", - }), - name: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "Optional user-facing thread title." }), - Schema.Null, - ]), - ), - parentThreadId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "The ID of the parent thread. This will only be set if this thread is a subagent.", - }), - Schema.Null, - ]), - ), - path: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "[UNSTABLE] Path to the thread on disk." }), - Schema.Null, - ]), - ), - preview: Schema.String.annotate({ - description: "Usually the first user message in the thread, if available.", - }), - recencyAt: Schema.optionalKey( - Schema.Union([ - Schema.Number.annotate({ - description: "Unix timestamp (in seconds) used for thread recency ordering.", - format: "int64", - }).check(Schema.isInt()), - Schema.Null, - ]), - ), - sessionId: Schema.String.annotate({ - description: "Session id shared by threads that belong to the same session tree.", - }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadRollbackResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, - ).annotate({ - description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", - }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadRollbackResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, - ).annotate({ description: "Current runtime status for the thread." }), - threadSource: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__ThreadSource, Schema.Null]).annotate({ - description: "Optional analytics source classification for this thread.", - }), - ), - turns: Schema.Array(V2ThreadRollbackResponse__Turn).annotate({ - description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", - }), - updatedAt: Schema.Number.annotate({ - description: "Unix timestamp (in seconds) when the thread was last updated.", - format: "int64", - }).check(Schema.isInt()), - }).annotate({ - description: - "The updated thread after applying the rollback, with `turns` populated.\n\nThe ThreadItems stored in each Turn are lossy since we explicitly do not persist all agent interactions, such as command executions. This is the same behavior as `thread/resume`.", - }), -}).annotate({ title: "ThreadRollbackResponse" }); - -export type V2ThreadRollbackResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2ThreadRollbackResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadRollbackResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadRollbackResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadRollbackResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadRollbackResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ThreadRollbackResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadRollbackResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2ThreadRollbackResponse__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadRollbackResponse__SubAgentSource }; -export const V2ThreadRollbackResponse__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadRollbackResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadRollbackResponse__Thread = { - readonly agentNickname?: string | null; - readonly agentRole?: string | null; - readonly cliVersion: string; - readonly createdAt: number; - readonly cwd: string; - readonly ephemeral: boolean; - readonly forkedFromId?: string | null; - readonly gitInfo?: V2ThreadRollbackResponse__GitInfo | null; - readonly id: string; - readonly modelProvider: string; - readonly name?: string | null; - readonly parentThreadId?: string | null; - readonly path?: string | null; - readonly preview: string; - readonly recencyAt?: number | null; - readonly sessionId: string; - readonly source: - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadRollbackResponse__SubAgentSource }; - readonly status: - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; - readonly threadSource?: V2ThreadRollbackResponse__ThreadSource | null; - readonly turns: ReadonlyArray; - readonly updatedAt: number; -}; -export const V2ThreadRollbackResponse__Thread = Schema.Struct({ - agentNickname: Schema.optionalKey( + cwd: V2ThreadResumeResponse__AbsolutePathBuf, + disabledPluginIds: Schema.optionalKey( + Schema.Array(Schema.String).annotate({ + description: "Saved list of disabled plugin IDs. Does not yet filter plugin capabilities.", + default: [], + }), + ), + instructionSources: Schema.optionalKey( + Schema.Array(V2ThreadResumeResponse__LegacyAppPathString).annotate({ + description: + "Environment-native paths to instruction source files currently loaded for this thread.", + default: [], + }), + ), + itemsBackwardsCursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ description: - "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + 'Opaque cursor for hydrating paginated items backwards.\n\nPass this as `cursor` to `thread/items/list` with `sortDirection: "desc"`. The first page includes the item identified by the cursor.', }), Schema.Null, ]), ), - agentRole: Schema.optionalKey( + model: Schema.String, + modelProvider: Schema.String, + reasoningEffort: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]), + ), + sandbox: Schema.suspend( + (): Schema.Codec => + V2ThreadResumeResponse__SandboxPolicy, + ).annotate({ + description: + "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + }), + serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + thread: V2ThreadResumeResponse__Thread, + turnsBackwardsCursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + description: + 'Opaque cursor for hydrating paginated turns backwards.\n\nPass this as `cursor` to `thread/turns/list` with `sortDirection: "desc"`. The first page includes the turn identified by the cursor.', }), Schema.Null, ]), ), - cliVersion: Schema.String.annotate({ - description: "Version of the CLI that created the thread.", - }), - createdAt: Schema.Number.annotate({ - description: "Unix timestamp (in seconds) when the thread was created.", - format: "int64", - }).check(Schema.isInt()), - cwd: Schema.String.annotate({ - description: - "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", - }), - ephemeral: Schema.Boolean.annotate({ - description: "Whether the thread is ephemeral and should not be materialized on disk.", - }), - forkedFromId: Schema.optionalKey( +}).annotate({ title: "ThreadResumeResponse" }); + +export type V2ThreadResumeResponse__ActivePermissionProfile = { + readonly extends?: string | null; + readonly id: string; +}; +export const V2ThreadResumeResponse__ActivePermissionProfile = Schema.Struct({ + extends: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ - description: "Source thread id when this thread was created by forking another thread.", + description: + "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", }), Schema.Null, ]), ), - gitInfo: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__GitInfo, Schema.Null]).annotate({ - description: "Optional Git metadata captured when the thread was created.", - }), - ), id: Schema.String.annotate({ - description: "Identifier for this thread. Codex-generated thread IDs are UUIDv7.", + description: + "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", }), - modelProvider: Schema.String.annotate({ - description: "Model provider used for this thread (for example, 'openai').", +}); + +export type V2ThreadResumeResponse__MultiAgentMode = + | "explicitRequestOnly" + | "proactive" + | { readonly custom: string }; +export const V2ThreadResumeResponse__MultiAgentMode = Schema.Union( + [ + Schema.Literals(["explicitRequestOnly", "proactive"]), + Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomMultiAgentMode" }), + ], + { mode: "oneOf" }, +).annotate({ + description: + "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", +}); + +export type V2ThreadResumeResponse__ThreadEnvironment = { + readonly cwd: V2ThreadResumeResponse__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const V2ThreadResumeResponse__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadResumeResponse__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadResumeResponse__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", +}); + +export type V2ThreadResumeResponse__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadResumeResponse__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); + +export type V2ThreadResumeResponse__TurnsPage = { + readonly backwardsCursor?: string | null; + readonly data: ReadonlyArray; + readonly nextCursor?: string | null; +}; +export const V2ThreadResumeResponse__TurnsPage = Schema.Struct({ + backwardsCursor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + data: Schema.Array(V2ThreadResumeResponse__Turn), + nextCursor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}); + +export type V2ThreadRevertedNotification = { readonly threadId: string }; +export const V2ThreadRevertedNotification = Schema.Struct({ threadId: Schema.String }).annotate({ + title: "ThreadRevertedNotification", +}); + +export type V2ThreadRevertParams = { readonly beforeTurnId: string; readonly threadId: string }; +export const V2ThreadRevertParams = Schema.Struct({ + beforeTurnId: Schema.String.annotate({ + description: "Turn excluded from the replacement history, together with every later turn.", }), - name: Schema.optionalKey( + threadId: Schema.String, +}).annotate({ + title: "ThreadRevertParams", + description: + "Replace a paginated thread's durable history with the prefix before one turn.\n\nThis only changes persisted conversation history. It does not revert local file changes.", +}); + +export type V2ThreadRevertResponse = { + readonly itemsBackwardsCursor?: string | null; + readonly thread: V2ThreadRevertResponse__Thread; + readonly turnsBackwardsCursor?: string | null; +}; +export const V2ThreadRevertResponse = Schema.Struct({ + itemsBackwardsCursor: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "Optional user-facing thread title." }), + Schema.String.annotate({ + description: + 'Opaque cursor for hydrating paginated items backwards.\n\nPass this as `cursor` to `thread/items/list` with `sortDirection: "desc"`. The first page includes the item identified by the cursor.', + }), Schema.Null, ]), ), - parentThreadId: Schema.optionalKey( + thread: Schema.suspend( + (): Schema.Codec => V2ThreadRevertResponse__Thread, + ).annotate({ + description: + "Updated loaded thread metadata. `turns` is always empty; hydrate retained history through `thread/turns/list`.", + }), + turnsBackwardsCursor: Schema.optionalKey( Schema.Union([ Schema.String.annotate({ description: - "The ID of the parent thread. This will only be set if this thread is a subagent.", + 'Opaque cursor for hydrating paginated turns backwards.\n\nPass this as `cursor` to `thread/turns/list` with `sortDirection: "desc"`. The first page includes the turn identified by the cursor.', }), Schema.Null, ]), ), - path: Schema.optionalKey( +}).annotate({ title: "ThreadRevertResponse" }); + +export type V2ThreadRevertResponse__ThreadEnvironment = { + readonly cwd: V2ThreadRevertResponse__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const V2ThreadRevertResponse__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadRevertResponse__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadRevertResponse__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", +}); + +export type V2ThreadRevertResponse__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadRevertResponse__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); + +export type V2ThreadSectionCreateParams = { + readonly appearance?: V2ThreadSectionCreateParams__ThreadSectionAppearance | null; + readonly name: string; +}; +export const V2ThreadSectionCreateParams = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadSectionCreateParams__ThreadSectionAppearance, Schema.Null]), + ), + name: Schema.String.annotate({ description: "The user-visible name of the section." }), +}).annotate({ + title: "ThreadSectionCreateParams", + description: "Parameters for creating an independently persisted thread section.", +}); + +export type V2ThreadSectionCreateResponse = { + readonly section: V2ThreadSectionCreateResponse__ThreadSection; +}; +export const V2ThreadSectionCreateResponse = Schema.Struct({ + section: V2ThreadSectionCreateResponse__ThreadSection, +}).annotate({ + title: "ThreadSectionCreateResponse", + description: "The independently persisted section created by the server.", +}); + +export type V2ThreadSectionDeleteParams = { readonly sectionId: string }; +export const V2ThreadSectionDeleteParams = Schema.Struct({ + sectionId: Schema.String.annotate({ + description: "The stable, server-generated identity of the section to delete.", + }), +}).annotate({ + title: "ThreadSectionDeleteParams", + description: "Parameters for deleting an independently persisted thread section.", +}); + +export type V2ThreadSectionDeleteResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadSectionDeleteResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ + title: "ThreadSectionDeleteResponse", + description: "Successful deletion does not return additional section data.", +}); + +export type V2ThreadSectionListParams = { + readonly cursor?: string | null; + readonly limit?: number | null; +}; +export const V2ThreadSectionListParams = Schema.Struct({ + cursor: Schema.optionalKey( Schema.Union([ - Schema.String.annotate({ description: "[UNSTABLE] Path to the thread on disk." }), + Schema.String.annotate({ + description: "Opaque pagination cursor returned by a previous call.", + }), Schema.Null, ]), ), - preview: Schema.String.annotate({ - description: "Usually the first user message in the thread, if available.", - }), - recencyAt: Schema.optionalKey( + limit: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ - description: "Unix timestamp (in seconds) used for thread recency ordering.", - format: "int64", - }).check(Schema.isInt()), + description: "Maximum number of sections to return.", + format: "uint32", + }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), Schema.Null, ]), ), - sessionId: Schema.String.annotate({ - description: "Session id shared by threads that belong to the same session tree.", - }), - source: Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadRollbackResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", +}).annotate({ + title: "ThreadSectionListParams", + description: "Parameters for listing independently persisted thread sections.", +}); + +export type V2ThreadSectionListResponse = { + readonly data: ReadonlyArray; + readonly nextCursor?: string | null; +}; +export const V2ThreadSectionListResponse = Schema.Struct({ + data: Schema.Array(V2ThreadSectionListResponse__ThreadSection), + nextCursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Opaque cursor for the next page, or `null` when no sections remain.", }), - ], - { mode: "oneOf" }, - ).annotate({ - description: "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", - }), - status: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadRollbackResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, - ).annotate({ description: "Current runtime status for the thread." }), - threadSource: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__ThreadSource, Schema.Null]).annotate({ - description: "Optional analytics source classification for this thread.", - }), + Schema.Null, + ]), ), - turns: Schema.Array(V2ThreadRollbackResponse__Turn).annotate({ - description: - "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", - }), - updatedAt: Schema.Number.annotate({ - description: "Unix timestamp (in seconds) when the thread was last updated.", - format: "int64", - }).check(Schema.isInt()), +}).annotate({ + title: "ThreadSectionListResponse", + description: "One page of independently persisted thread sections.", }); -export type V2ThreadRollbackResponse__ThreadExtra = {}; -export const V2ThreadRollbackResponse__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", +export type V2ThreadSectionMoveParams = { + readonly beforeThreadId?: string | null; + readonly sectionId: string | null; + readonly threadId: string; +}; +export const V2ThreadSectionMoveParams = Schema.Struct({ + beforeThreadId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Existing thread to insert before; omission or null appends to the section.", + }), + Schema.Null, + ]), + ), + sectionId: Schema.Union([ + Schema.String.annotate({ + description: "Destination section, or `null` to remove the thread from its section.", + }), + Schema.Null, + ]), + threadId: Schema.String.annotate({ + description: "Thread to move into, within, or out of a section.", + }), +}).annotate({ + title: "ThreadSectionMoveParams", + description: "Parameters for moving a thread within a server-owned section ordering.", }); -export type V2ThreadRollbackResponse__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadRollbackResponse__ThreadHistoryMode = Schema.Literals(["legacy", "paginated"]); +export type V2ThreadSectionMoveResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadSectionMoveResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ThreadSectionMoveResponse" }); -export type V2ThreadRollbackResponse__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadRollbackResponse__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadRollbackResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, -); +export type V2ThreadSectionUpdateParams = { + readonly appearance?: V2ThreadSectionUpdateParams__ThreadSectionAppearance | null; + readonly name: string; + readonly sectionId: string; +}; +export const V2ThreadSectionUpdateParams = Schema.Struct({ + appearance: Schema.optionalKey( + Schema.Union([V2ThreadSectionUpdateParams__ThreadSectionAppearance, Schema.Null]).annotate({ + description: "Omit to preserve appearance, use `null` to clear it, or provide a replacement.", + }), + ), + name: Schema.String.annotate({ description: "The updated user-visible name of the section." }), + sectionId: Schema.String.annotate({ + description: "The stable, server-generated identity of the section to update.", + }), +}).annotate({ + title: "ThreadSectionUpdateParams", + description: "Parameters for updating an independently persisted thread section.", +}); -export type V2ThreadRollbackResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadRollbackResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); +export type V2ThreadSectionUpdateResponse = { + readonly section: V2ThreadSectionUpdateResponse__ThreadSection; +}; +export const V2ThreadSectionUpdateResponse = Schema.Struct({ + section: V2ThreadSectionUpdateResponse__ThreadSection, +}).annotate({ + title: "ThreadSectionUpdateResponse", + description: "The independently persisted section after its name is updated.", +}); export type V2ThreadSetNameParams = { readonly name: string; readonly threadId: string }; export const V2ThreadSetNameParams = Schema.Struct({ @@ -42322,10 +56231,11 @@ export const V2ThreadSetNameParams = Schema.Struct({ threadId: Schema.String, }).annotate({ title: "ThreadSetNameParams" }); -export type V2ThreadSetNameResponse = {}; -export const V2ThreadSetNameResponse = Schema.Struct({}).annotate({ - title: "ThreadSetNameResponse", -}); +export type V2ThreadSetNameResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadSetNameResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ThreadSetNameResponse" }); export type V2ThreadSettingsUpdatedNotification = { readonly threadId: string; @@ -42351,159 +56261,64 @@ export const V2ThreadSettingsUpdatedNotification__MultiAgentMode = Schema.Union( "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", }); -export type V2ThreadSettingsUpdatedNotification__NetworkAccess = "restricted" | "enabled"; -export const V2ThreadSettingsUpdatedNotification__NetworkAccess = Schema.Literals([ - "restricted", - "enabled", -]); - -export type V2ThreadShellCommandParams = { readonly command: string; readonly threadId: string }; +export type V2ThreadShellCommandParams = { + readonly command: string; + readonly threadId: string; + readonly timeoutMs?: number | null; +}; export const V2ThreadShellCommandParams = Schema.Struct({ command: Schema.String.annotate({ description: "Shell command string evaluated by the thread's configured shell. Unlike `command/exec`, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.", }), threadId: Schema.String, + timeoutMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Maximum execution time in milliseconds. Defaults to one hour when omitted or null. Must be non-negative; zero requests an immediate timeout, not unlimited execution. Does not affect the immediate RPC acknowledgement.", + format: "int64", + }).check(Schema.isInt().annotate({ expected: "an integer" })), + Schema.Null, + ]), + ), }).annotate({ title: "ThreadShellCommandParams" }); -export type V2ThreadShellCommandResponse = {}; -export const V2ThreadShellCommandResponse = Schema.Struct({}).annotate({ - title: "ThreadShellCommandResponse", -}); +export type V2ThreadShellCommandResponse = { readonly [x: string]: Schema.Json }; +export const V2ThreadShellCommandResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "ThreadShellCommandResponse" }); export type V2ThreadStartedNotification = { readonly thread: V2ThreadStartedNotification__Thread }; export const V2ThreadStartedNotification = Schema.Struct({ thread: V2ThreadStartedNotification__Thread, }).annotate({ title: "ThreadStartedNotification" }); -export type V2ThreadStartedNotification__ByteRange = { - readonly end: number; - readonly start: number; +export type V2ThreadStartedNotification__ThreadEnvironment = { + readonly cwd: V2ThreadStartedNotification__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; }; -export const V2ThreadStartedNotification__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadStartedNotification__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadStartedNotification__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadStartedNotification__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadStartedNotification__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ThreadStartedNotification__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadStartedNotification__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2ThreadStartedNotification__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadStartedNotification__SubAgentSource }; -export const V2ThreadStartedNotification__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadStartedNotification__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadStartedNotification__ThreadExtra = {}; -export const V2ThreadStartedNotification__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", +export const V2ThreadStartedNotification__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadStartedNotification__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadStartedNotification__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", }); -export type V2ThreadStartedNotification__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadStartedNotification__ThreadHistoryMode = Schema.Literals([ - "legacy", - "paginated", -]); - -export type V2ThreadStartedNotification__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadStartedNotification__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadStartedNotification__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadStartedNotification__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadStartedNotification__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); +export type V2ThreadStartedNotification__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadStartedNotification__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); export type V2ThreadStartParams = { readonly approvalPolicy?: V2ThreadStartParams__AskForApproval | null; readonly approvalsReviewer?: V2ThreadStartParams__ApprovalsReviewer | null; readonly baseInstructions?: string | null; - readonly config?: { readonly [x: string]: unknown } | null; + readonly config?: { readonly [x: string]: Schema.Json } | null; readonly cwd?: string | null; readonly developerInstructions?: string | null; readonly ephemeral?: boolean | null; @@ -42528,14 +56343,21 @@ export const V2ThreadStartParams = Schema.Struct({ ), baseInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), config: Schema.optionalKey( - Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null]), + Schema.Union([ + Schema.Record(Schema.String, Schema.Json.annotate({ expected: "JSON value" })), + Schema.Null, + ]), ), cwd: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), developerInstructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), ephemeral: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), model: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), modelProvider: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - personality: Schema.optionalKey(Schema.Union([V2ThreadStartParams__Personality, Schema.Null])), + personality: Schema.optionalKey( + Schema.Union([V2ThreadStartParams__Personality, Schema.Null]).annotate({ + description: "@deprecated `friendly` and `pragmatic` no longer select a style.", + }), + ), sandbox: Schema.optionalKey(Schema.Union([V2ThreadStartParams__SandboxMode, Schema.Null])), serviceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), @@ -42555,34 +56377,11 @@ export const V2ThreadStartParams__AbsolutePathBuf = Schema.String.annotate({ "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", }); -export type V2ThreadStartParams__CapabilityRootLocation = { - readonly environmentId: string; - readonly path: string; - readonly type: "environment"; -}; -export const V2ThreadStartParams__CapabilityRootLocation = Schema.Union( - [ - Schema.Struct({ - environmentId: Schema.String, - path: Schema.String.annotate({ - description: "Absolute path for the root in the selected environment.", - }), - type: Schema.Literal("environment").annotate({ - title: "EnvironmentCapabilityRootLocationType", - }), - }).annotate({ - title: "EnvironmentCapabilityRootLocation", - description: "A path owned by an execution environment.", - }), - ], - { mode: "oneOf" }, -).annotate({ description: "Location used to resolve a selected capability root." }); - export type V2ThreadStartParams__DynamicToolSpec = | { readonly deferLoading?: boolean; readonly description: string; - readonly inputSchema: unknown; + readonly inputSchema: Schema.Json; readonly name: string; readonly type: "function"; } @@ -42597,7 +56396,7 @@ export const V2ThreadStartParams__DynamicToolSpec = Schema.Union( Schema.Struct({ deferLoading: Schema.optionalKey(Schema.Boolean), description: Schema.String, - inputSchema: Schema.Unknown, + inputSchema: Schema.Json.annotate({ expected: "JSON value" }), name: Schema.String, type: Schema.Literal("function").annotate({ title: "FunctionDynamicToolSpecType" }), }).annotate({ title: "FunctionDynamicToolSpec" }), @@ -42628,33 +56427,16 @@ export const V2ThreadStartParams__MultiAgentMode = Schema.Union( export type V2ThreadStartParams__SelectedCapabilityRoot = { readonly id: string; - readonly location: { - readonly environmentId: string; - readonly path: string; - readonly type: "environment"; - }; + readonly location: V2ThreadStartParams__CapabilityRootLocation; }; export const V2ThreadStartParams__SelectedCapabilityRoot = Schema.Struct({ id: Schema.String.annotate({ description: "Stable identifier supplied by the capability selection platform.", }), - location: Schema.Union( - [ - Schema.Struct({ - environmentId: Schema.String, - path: Schema.String.annotate({ - description: "Absolute path for the root in the selected environment.", - }), - type: Schema.Literal("environment").annotate({ - title: "EnvironmentCapabilityRootLocationType", - }), - }).annotate({ - title: "EnvironmentCapabilityRootLocation", - description: "A path owned by an execution environment.", - }), - ], - { mode: "oneOf" }, - ).annotate({ description: "Location used to resolve a selected capability root." }), + location: Schema.suspend( + (): Schema.Codec => + V2ThreadStartParams__CapabilityRootLocation, + ).annotate({ description: "Where the selected root can be resolved." }), }).annotate({ description: "A user-selected root that can expose one or more runtime capabilities.", }); @@ -42682,33 +56464,30 @@ export const V2ThreadStartParams__TurnEnvironmentParams = Schema.Struct({ export type V2ThreadStartResponse = { readonly approvalPolicy: V2ThreadStartResponse__AskForApproval; - readonly approvalsReviewer: "user" | "auto_review" | "guardian_subagent"; + readonly approvalsReviewer: V2ThreadStartResponse__ApprovalsReviewer; readonly cwd: V2ThreadStartResponse__AbsolutePathBuf; + readonly disabledPluginIds?: ReadonlyArray; readonly instructionSources?: ReadonlyArray; readonly model: string; readonly modelProvider: string; readonly reasoningEffort?: V2ThreadStartResponse__ReasoningEffort | null; - readonly sandbox: - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } - | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; + readonly sandbox: V2ThreadStartResponse__SandboxPolicy; readonly serviceTier?: string | null; readonly thread: V2ThreadStartResponse__Thread; }; export const V2ThreadStartResponse = Schema.Struct({ approvalPolicy: V2ThreadStartResponse__AskForApproval, - approvalsReviewer: Schema.Literals(["user", "auto_review", "guardian_subagent"]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", - }), + approvalsReviewer: Schema.suspend( + (): Schema.Codec => + V2ThreadStartResponse__ApprovalsReviewer, + ).annotate({ description: "Reviewer currently used for approval requests on this thread." }), cwd: V2ThreadStartResponse__AbsolutePathBuf, + disabledPluginIds: Schema.optionalKey( + Schema.Array(Schema.String).annotate({ + description: "Saved list of disabled plugin IDs. Does not yet filter plugin capabilities.", + default: [], + }), + ), instructionSources: Schema.optionalKey( Schema.Array(V2ThreadStartResponse__LegacyAppPathString).annotate({ description: @@ -42721,131 +56500,35 @@ export const V2ThreadStartResponse = Schema.Struct({ reasoningEffort: Schema.optionalKey( Schema.Union([V2ThreadStartResponse__ReasoningEffort, Schema.Null]), ), - sandbox: Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ - title: "WorkspaceWriteSandboxPolicyType", - }), - writableRoots: Schema.optionalKey( - Schema.Array(V2ThreadStartResponse__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), - ], - { mode: "oneOf" }, + sandbox: Schema.suspend( + (): Schema.Codec => V2ThreadStartResponse__SandboxPolicy, ).annotate({ - description: - "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", - }), - serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - thread: V2ThreadStartResponse__Thread, -}).annotate({ title: "ThreadStartResponse" }); - -export type V2ThreadStartResponse__ActivePermissionProfile = { - readonly extends?: string | null; - readonly id: string; -}; -export const V2ThreadStartResponse__ActivePermissionProfile = Schema.Struct({ - extends: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", - }), - Schema.Null, - ]), - ), - id: Schema.String.annotate({ - description: - "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", - }), -}); - -export type V2ThreadStartResponse__ApprovalsReviewer = "user" | "auto_review" | "guardian_subagent"; -export const V2ThreadStartResponse__ApprovalsReviewer = Schema.Literals([ - "user", - "auto_review", - "guardian_subagent", -]).annotate({ - description: - "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", -}); - -export type V2ThreadStartResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2ThreadStartResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadStartResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadStartResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadStartResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadStartResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); + description: + "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + }), + serviceTier: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + thread: V2ThreadStartResponse__Thread, +}).annotate({ title: "ThreadStartResponse" }); -export type V2ThreadStartResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadStartResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); +export type V2ThreadStartResponse__ActivePermissionProfile = { + readonly extends?: string | null; + readonly id: string; +}; +export const V2ThreadStartResponse__ActivePermissionProfile = Schema.Struct({ + extends: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Parent profile identifier from the selected permissions profile's `extends` setting, when present.", + }), + Schema.Null, + ]), + ), + id: Schema.String.annotate({ + description: + "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + }), +}); export type V2ThreadStartResponse__MultiAgentMode = | "explicitRequestOnly" @@ -42862,112 +56545,24 @@ export const V2ThreadStartResponse__MultiAgentMode = Schema.Union( "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", }); -export type V2ThreadStartResponse__NetworkAccess = "restricted" | "enabled"; -export const V2ThreadStartResponse__NetworkAccess = Schema.Literals(["restricted", "enabled"]); - -export type V2ThreadStartResponse__SandboxPolicy = - | { readonly type: "dangerFullAccess" } - | { readonly networkAccess?: boolean; readonly type: "readOnly" } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } - | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; -export const V2ThreadStartResponse__SandboxPolicy = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), - Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), - Schema.Struct({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), - writableRoots: Schema.optionalKey( - Schema.Array(V2ThreadStartResponse__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadStartResponse__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadStartResponse__SubAgentSource }; -export const V2ThreadStartResponse__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadStartResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadStartResponse__ThreadExtra = {}; -export const V2ThreadStartResponse__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", +export type V2ThreadStartResponse__ThreadEnvironment = { + readonly cwd: V2ThreadStartResponse__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const V2ThreadStartResponse__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadStartResponse__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadStartResponse__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", }); -export type V2ThreadStartResponse__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadStartResponse__ThreadHistoryMode = Schema.Literals(["legacy", "paginated"]); - -export type V2ThreadStartResponse__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadStartResponse__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadStartResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadStartResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadStartResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); +export type V2ThreadStartResponse__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadStartResponse__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); export type V2ThreadStatusChangedNotification = { readonly status: V2ThreadStatusChangedNotification__ThreadStatus; @@ -42989,6 +56584,74 @@ export const V2ThreadTokenUsageUpdatedNotification = Schema.Struct({ turnId: Schema.String, }).annotate({ title: "ThreadTokenUsageUpdatedNotification" }); +export type V2ThreadTurnsListParams = { + readonly cursor?: string | null; + readonly itemsView?: V2ThreadTurnsListParams__TurnItemsView | null; + readonly limit?: number | null; + readonly sortDirection?: V2ThreadTurnsListParams__SortDirection | null; + readonly threadId: string; +}; +export const V2ThreadTurnsListParams = Schema.Struct({ + cursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Opaque cursor to pass to the next call to continue after the last turn.", + }), + Schema.Null, + ]), + ), + itemsView: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListParams__TurnItemsView, Schema.Null]).annotate({ + description: "How much item detail to include for each returned turn; defaults to summary.", + }), + ), + limit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ description: "Optional turn page size.", format: "uint32" }) + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ + expected: "a value greater than or equal to 0", + }), + ), + Schema.Null, + ]), + ), + sortDirection: Schema.optionalKey( + Schema.Union([V2ThreadTurnsListParams__SortDirection, Schema.Null]).annotate({ + description: "Optional turn pagination direction; defaults to descending.", + }), + ), + threadId: Schema.String, +}).annotate({ title: "ThreadTurnsListParams" }); + +export type V2ThreadTurnsListResponse = { + readonly backwardsCursor?: string | null; + readonly data: ReadonlyArray; + readonly nextCursor?: string | null; +}; +export const V2ThreadTurnsListResponse = Schema.Struct({ + backwardsCursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Opaque cursor to pass as `cursor` when reversing `sortDirection`. This is only populated when the page contains at least one turn. Use it with the opposite `sortDirection` to include the anchor turn again and catch updates to that turn.", + }), + Schema.Null, + ]), + ), + data: Schema.Array(V2ThreadTurnsListResponse__Turn), + nextCursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Opaque cursor to pass to the next call to continue after the last turn. if None, there are no more turns to return.", + }), + Schema.Null, + ]), + ), +}).annotate({ title: "ThreadTurnsListResponse" }); + export type V2ThreadUnarchivedNotification = { readonly threadId: string }; export const V2ThreadUnarchivedNotification = Schema.Struct({ threadId: Schema.String }).annotate({ title: "ThreadUnarchivedNotification", @@ -43004,125 +56667,24 @@ export const V2ThreadUnarchiveResponse = Schema.Struct({ thread: V2ThreadUnarchiveResponse__Thread, }).annotate({ title: "ThreadUnarchiveResponse" }); -export type V2ThreadUnarchiveResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2ThreadUnarchiveResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2ThreadUnarchiveResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2ThreadUnarchiveResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2ThreadUnarchiveResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2ThreadUnarchiveResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2ThreadUnarchiveResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2ThreadUnarchiveResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2ThreadUnarchiveResponse__SessionSource = - | "cli" - | "vscode" - | "exec" - | "appServer" - | "unknown" - | { readonly custom: string } - | { readonly subAgent: V2ThreadUnarchiveResponse__SubAgentSource }; -export const V2ThreadUnarchiveResponse__SessionSource = Schema.Union( - [ - Schema.Literals(["cli", "vscode", "exec", "appServer", "unknown"]), - Schema.Struct({ custom: Schema.String }).annotate({ title: "CustomSessionSource" }), - Schema.Struct({ subAgent: V2ThreadUnarchiveResponse__SubAgentSource }).annotate({ - title: "SubAgentSessionSource", - }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadUnarchiveResponse__ThreadExtra = {}; -export const V2ThreadUnarchiveResponse__ThreadExtra = Schema.Struct({}).annotate({ - description: "Extra app-server data for a thread.", +export type V2ThreadUnarchiveResponse__ThreadEnvironment = { + readonly cwd: V2ThreadUnarchiveResponse__LegacyAppPathString; + readonly environmentId: string; + readonly runtimeWorkspaceRoots: ReadonlyArray; +}; +export const V2ThreadUnarchiveResponse__ThreadEnvironment = Schema.Struct({ + cwd: V2ThreadUnarchiveResponse__LegacyAppPathString, + environmentId: Schema.String, + runtimeWorkspaceRoots: Schema.Array(V2ThreadUnarchiveResponse__LegacyAppPathString), +}).annotate({ + description: "An environment selected by a loaded thread, independent of connection status.", }); -export type V2ThreadUnarchiveResponse__ThreadHistoryMode = "legacy" | "paginated"; -export const V2ThreadUnarchiveResponse__ThreadHistoryMode = Schema.Literals([ - "legacy", - "paginated", -]); - -export type V2ThreadUnarchiveResponse__ThreadStatus = - | { readonly type: "notLoaded" } - | { readonly type: "idle" } - | { readonly type: "systemError" } - | { - readonly activeFlags: ReadonlyArray; - readonly type: "active"; - }; -export const V2ThreadUnarchiveResponse__ThreadStatus = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("notLoaded").annotate({ title: "NotLoadedThreadStatusType" }), - }).annotate({ title: "NotLoadedThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("idle").annotate({ title: "IdleThreadStatusType" }), - }).annotate({ title: "IdleThreadStatus" }), - Schema.Struct({ - type: Schema.Literal("systemError").annotate({ title: "SystemErrorThreadStatusType" }), - }).annotate({ title: "SystemErrorThreadStatus" }), - Schema.Struct({ - activeFlags: Schema.Array(V2ThreadUnarchiveResponse__ThreadActiveFlag), - type: Schema.Literal("active").annotate({ title: "ActiveThreadStatusType" }), - }).annotate({ title: "ActiveThreadStatus" }), - ], - { mode: "oneOf" }, -); - -export type V2ThreadUnarchiveResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2ThreadUnarchiveResponse__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); +export type V2ThreadUnarchiveResponse__ThreadExtra = { readonly [x: string]: Schema.Json }; +export const V2ThreadUnarchiveResponse__ThreadExtra = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ description: "Extra app-server data for a thread." }); export type V2ThreadUnsubscribeParams = { readonly threadId: string }; export const V2ThreadUnsubscribeParams = Schema.Struct({ threadId: Schema.String }).annotate({ @@ -43145,72 +56707,6 @@ export const V2TurnCompletedNotification = Schema.Struct({ turn: V2TurnCompletedNotification__Turn, }).annotate({ title: "TurnCompletedNotification" }); -export type V2TurnCompletedNotification__ByteRange = { - readonly end: number; - readonly start: number; -}; -export const V2TurnCompletedNotification__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2TurnCompletedNotification__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2TurnCompletedNotification__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2TurnCompletedNotification__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2TurnCompletedNotification__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2TurnCompletedNotification__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2TurnCompletedNotification__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2TurnCompletedNotification__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2TurnCompletedNotification__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); - export type V2TurnDiffUpdatedNotification = { readonly diff: string; readonly threadId: string; @@ -43232,18 +56728,19 @@ export const V2TurnInterruptParams = Schema.Struct({ turnId: Schema.String, }).annotate({ title: "TurnInterruptParams" }); -export type V2TurnInterruptResponse = {}; -export const V2TurnInterruptResponse = Schema.Struct({}).annotate({ - title: "TurnInterruptResponse", -}); +export type V2TurnInterruptResponse = { readonly [x: string]: Schema.Json }; +export const V2TurnInterruptResponse = Schema.Record( + Schema.String, + Schema.Json.annotate({ expected: "JSON value" }), +).annotate({ title: "TurnInterruptResponse" }); export type V2TurnModerationMetadataNotification = { - readonly metadata: unknown; + readonly metadata: Schema.Json; readonly threadId: string; readonly turnId: string; }; export const V2TurnModerationMetadataNotification = Schema.Struct({ - metadata: Schema.Unknown, + metadata: Schema.Json.annotate({ expected: "JSON value" }), threadId: Schema.String, turnId: Schema.String, }).annotate({ title: "TurnModerationMetadataNotification" }); @@ -43270,83 +56767,24 @@ export const V2TurnStartedNotification = Schema.Struct({ turn: V2TurnStartedNotification__Turn, }).annotate({ title: "TurnStartedNotification" }); -export type V2TurnStartedNotification__ByteRange = { readonly end: number; readonly start: number }; -export const V2TurnStartedNotification__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2TurnStartedNotification__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2TurnStartedNotification__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2TurnStartedNotification__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2TurnStartedNotification__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2TurnStartedNotification__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2TurnStartedNotification__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2TurnStartedNotification__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2TurnStartedNotification__TurnItemsView = Schema.Literals([ - "notLoaded", - "summary", - "full", -]); - export type V2TurnStartParams = { readonly approvalPolicy?: V2TurnStartParams__AskForApproval | null; readonly approvalsReviewer?: V2TurnStartParams__ApprovalsReviewer | null; readonly clientUserMessageId?: string | null; readonly cwd?: string | null; + readonly disabledPluginIds?: ReadonlyArray | null; readonly effort?: V2TurnStartParams__ReasoningEffort | null; readonly input: ReadonlyArray; readonly model?: string | null; - readonly outputSchema?: unknown; + readonly outputSchema?: Schema.Json; readonly personality?: V2TurnStartParams__Personality | null; readonly sandboxPolicy?: V2TurnStartParams__SandboxPolicy | null; readonly serviceTier?: string | null; + readonly serviceTierForTurn?: string | null; readonly summary?: V2TurnStartParams__ReasoningSummary | null; readonly threadId: string; + readonly toolOutput?: V2TurnStartParams__TurnToolOutput | null; + readonly turnTrigger?: string | null; }; export const V2TurnStartParams = Schema.Struct({ approvalPolicy: Schema.optionalKey( @@ -43369,6 +56807,15 @@ export const V2TurnStartParams = Schema.Struct({ Schema.Null, ]), ), + disabledPluginIds: Schema.optionalKey( + Schema.Union([ + Schema.Array(Schema.String).annotate({ + description: + "Replace this thread's disabled plugin IDs. Omitted/null preserves the list; [] clears it.", + }), + Schema.Null, + ]), + ), effort: Schema.optionalKey( Schema.Union([V2TurnStartParams__ReasoningEffort, Schema.Null]).annotate({ description: "Override the reasoning effort for this turn and subsequent turns.", @@ -43384,14 +56831,16 @@ export const V2TurnStartParams = Schema.Struct({ ]), ), outputSchema: Schema.optionalKey( - Schema.Unknown.annotate({ + Schema.Json.annotate({ + expected: "JSON value", description: "Optional JSON Schema used to constrain the final assistant message for this turn.", }), ), personality: Schema.optionalKey( Schema.Union([V2TurnStartParams__Personality, Schema.Null]).annotate({ - description: "Override the personality for this turn and subsequent turns.", + description: + "@deprecated `friendly` and `pragmatic` no longer select a style. Changing this does not rewrite the thread's existing instructions.", }), ), sandboxPolicy: Schema.optionalKey( @@ -43407,12 +56856,31 @@ export const V2TurnStartParams = Schema.Struct({ Schema.Null, ]), ), + serviceTierForTurn: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Override the service tier only when this request starts a new turn. Use \"default\" for standard speed. Omitted or null inherits the thread's tier. Does not change the thread's tier or a turn being steered.", + }), + Schema.Null, + ]), + ), summary: Schema.optionalKey( Schema.Union([V2TurnStartParams__ReasoningSummary, Schema.Null]).annotate({ description: "Override the reasoning summary for this turn and subsequent turns.", }), ), threadId: Schema.String, + toolOutput: Schema.optionalKey(Schema.Union([V2TurnStartParams__TurnToolOutput, Schema.Null])), + turnTrigger: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional source classification for the caller that starts this turn. Ignored when this request steers an already-active turn.", + }), + Schema.Null, + ]), + ), }).annotate({ title: "TurnStartParams" }); export type V2TurnStartParams__AdditionalContextEntry = { @@ -43424,16 +56892,6 @@ export const V2TurnStartParams__AdditionalContextEntry = Schema.Struct({ value: Schema.String, }); -export type V2TurnStartParams__ByteRange = { readonly end: number; readonly start: number }; -export const V2TurnStartParams__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - export type V2TurnStartParams__CollaborationMode = { readonly mode: V2TurnStartParams__ModeKind; readonly settings: V2TurnStartParams__Settings; @@ -43443,6 +56901,16 @@ export const V2TurnStartParams__CollaborationMode = Schema.Struct({ settings: V2TurnStartParams__Settings, }).annotate({ description: "Collaboration mode for a Codex session." }); +export type V2TurnStartParams__CyberAccessProgram = "standard" | "daybreakBlue" | "daybreakRed"; +export const V2TurnStartParams__CyberAccessProgram = Schema.Literals([ + "standard", + "daybreakBlue", + "daybreakRed", +]).annotate({ + description: + "Requested cyber treatment for a ChatGPT-authenticated Codex turn. Authorization and model-tier restrictions remain server-owned.", +}); + export type V2TurnStartParams__MultiAgentMode = | "explicitRequestOnly" | "proactive" @@ -43458,9 +56926,6 @@ export const V2TurnStartParams__MultiAgentMode = Schema.Union( "Controls the effective multi-agent delegation instructions for a turn. `custom` means the configured mode hint defines the policy instead of a built-in policy.", }); -export type V2TurnStartParams__NetworkAccess = "restricted" | "enabled"; -export const V2TurnStartParams__NetworkAccess = Schema.Literals(["restricted", "enabled"]); - export type V2TurnStartParams__TurnEnvironmentParams = { readonly cwd: V2TurnStartParams__LegacyAppPathString; readonly environmentId: string; @@ -43484,65 +56949,6 @@ export const V2TurnStartResponse = Schema.Struct({ turn: V2TurnStartResponse__Tu title: "TurnStartResponse", }); -export type V2TurnStartResponse__ByteRange = { readonly end: number; readonly start: number }; -export const V2TurnStartResponse__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - -export type V2TurnStartResponse__CollabAgentTool = - | "spawnAgent" - | "sendInput" - | "resumeAgent" - | "wait" - | "closeAgent" - | "sendMessage" - | "followupTask" - | "interruptAgent" - | "listAgents"; -export const V2TurnStartResponse__CollabAgentTool = Schema.Literals([ - "spawnAgent", - "sendInput", - "resumeAgent", - "wait", - "closeAgent", - "sendMessage", - "followupTask", - "interruptAgent", - "listAgents", -]); - -export type V2TurnStartResponse__CollabAgentToolCallStatus = - | "inProgress" - | "completed" - | "failed" - | "interrupted"; -export const V2TurnStartResponse__CollabAgentToolCallStatus = Schema.Literals([ - "inProgress", - "completed", - "failed", - "interrupted", -]); - -export type V2TurnStartResponse__CommandExecutionSource = - | "agent" - | "userShell" - | "unifiedExecStartup" - | "unifiedExecInteraction"; -export const V2TurnStartResponse__CommandExecutionSource = Schema.Literals([ - "agent", - "userShell", - "unifiedExecStartup", - "unifiedExecInteraction", -]); - -export type V2TurnStartResponse__TurnItemsView = "notLoaded" | "summary" | "full"; -export const V2TurnStartResponse__TurnItemsView = Schema.Literals(["notLoaded", "summary", "full"]); - export type V2TurnSteerParams = { readonly clientUserMessageId?: string | null; readonly expectedTurnId: string; @@ -43568,16 +56974,6 @@ export const V2TurnSteerParams__AdditionalContextEntry = Schema.Struct({ value: Schema.String, }); -export type V2TurnSteerParams__ByteRange = { readonly end: number; readonly start: number }; -export const V2TurnSteerParams__ByteRange = Schema.Struct({ - end: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - start: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), -}); - export type V2TurnSteerResponse = { readonly turnId: string }; export const V2TurnSteerResponse = Schema.Struct({ turnId: Schema.String }).annotate({ title: "TurnSteerResponse", @@ -43637,8 +57033,10 @@ export type V2WindowsWorldWritableWarningNotification = { }; export const V2WindowsWorldWritableWarningNotification = Schema.Struct({ extraCount: Schema.Number.annotate({ format: "uint" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), + .check(Schema.isInt().annotate({ expected: "an integer" })) + .check( + Schema.isGreaterThanOrEqualTo(0).annotate({ expected: "a value greater than or equal to 0" }), + ), failedScan: Schema.Boolean, samplePaths: Schema.Array(Schema.String), }).annotate({ title: "WindowsWorldWritableWarningNotification" }); diff --git a/packages/effect-codex-app-server/src/client.test.ts b/packages/effect-codex-app-server/src/client.test.ts index 3830c5fc5f6f..f7eca6207ca7 100644 --- a/packages/effect-codex-app-server/src/client.test.ts +++ b/packages/effect-codex-app-server/src/client.test.ts @@ -95,6 +95,7 @@ it.layer(NodeServices.layer)("effect-codex-app-server client", (it) => { assert.equal(result.skills.data[0]?.skills.length, 0); assert.deepEqual(yield* Ref.get(userInputRequests), [ { + isBlocking: true, itemId: "item-approval-1", threadId: "thread-1", turnId: "turn-1", diff --git a/packages/effect-codex-app-server/src/schema.test.ts b/packages/effect-codex-app-server/src/schema.test.ts index 0c9fc3561002..78bd52547e96 100644 --- a/packages/effect-codex-app-server/src/schema.test.ts +++ b/packages/effect-codex-app-server/src/schema.test.ts @@ -6,7 +6,6 @@ import * as CodexSchema from "./schema.ts"; const isGetAccountResponse = Schema.is(CodexSchema.V2GetAccountResponse); const isThreadReadResponse = Schema.is(CodexSchema.V2ThreadReadResponse); const isThreadResumeResponse = Schema.is(CodexSchema.V2ThreadResumeResponse); -const isThreadRollbackResponse = Schema.is(CodexSchema.V2ThreadRollbackResponse); const isThreadForkResponse = Schema.is(CodexSchema.V2ThreadForkResponse); const isTurnCompletedNotification = Schema.is(CodexSchema.V2TurnCompletedNotification); const decodeThreadResumeResponse = Schema.decodeUnknownSync(CodexSchema.V2ThreadResumeResponse); @@ -76,6 +75,7 @@ it("accepts Codex 0.150 multi-agent values", () => { id: "root-thread", modelProvider: "openai", preview: "", + projectId: null, sessionId: "session-1", source: "cli", status: { type: "idle" }, @@ -112,6 +112,7 @@ it("accepts Codex rate limit errors for thread responses", () => { id: "thread-1", modelProvider: "openai", preview: "", + projectId: null, sessionId: "session-1", source: "cli", status: { type: "idle" }, @@ -141,7 +142,6 @@ it("accepts Codex rate limit errors for thread responses", () => { }), true, ); - assert.equal(isThreadRollbackResponse({ thread: failedThread }), true); }); it("accepts Codex misalignment policy errors for thread responses", () => { @@ -153,6 +153,7 @@ it("accepts Codex misalignment policy errors for thread responses", () => { id: "thread-1", modelProvider: "openai", preview: "", + projectId: null, sessionId: "session-1", source: "cli", status: { type: "idle" }, @@ -180,7 +181,6 @@ it("accepts Codex misalignment policy errors for thread responses", () => { }; assert.equal(isThreadReadResponse({ thread: failedThread }), true); assert.equal(isThreadResumeResponse(resumeLikeResponse), true); - assert.equal(isThreadRollbackResponse({ thread: failedThread }), true); assert.equal(isThreadForkResponse(resumeLikeResponse), true); const decodedResume = decodeThreadResumeResponse(resumeLikeResponse); assert.equal(decodedResume.thread.turns[0]?.error?.codexErrorInfo, "misalignmentPolicyViolation"); @@ -201,13 +201,15 @@ it("accepts Codex misalignment policy errors for thread responses", () => { ); }); -it("accepts Codex 0.150 account plan values", () => { +it("accepts account plan slugs newer than the pinned protocol", () => { const planTypes = [ "self_serve_business_prolite", "ent26", "enterprise_cbp_automation", "edu_plus", "edu_pro", + "promax", + "some_future_plan", ]; for (const planType of planTypes) { diff --git a/packages/effect-codex-app-server/test/fixtures/codex-app-server-mock-peer.ts b/packages/effect-codex-app-server/test/fixtures/codex-app-server-mock-peer.ts index 3f2a213d38c7..59e5eb28faf9 100644 --- a/packages/effect-codex-app-server/test/fixtures/codex-app-server-mock-peer.ts +++ b/packages/effect-codex-app-server/test/fixtures/codex-app-server-mock-peer.ts @@ -84,6 +84,7 @@ const handleMethod = (message: Record) => { case "skills/list": { pendingSkillsListRequestId = message.id as number | string; pendingUserInputRequestId = sendRequest("item/tool/requestUserInput", { + isBlocking: true, itemId: "item-approval-1", threadId: "thread-1", turnId: "turn-1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b40ff329013..bf29a7f32b85 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -126,7 +126,7 @@ importers: version: 7.0.0-dev.20260604.1 vite-plus: specifier: 'catalog:' - version: 0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + version: 0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) apps/desktop: dependencies: @@ -669,6 +669,9 @@ importers: specifier: ^5.0.11 version: 5.0.14(@types/react@19.2.16)(react@19.2.6)(use-sync-external-store@1.6.0(react@19.2.6)) devDependencies: + jsdom: + specifier: 26.1.0 + version: 26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) '@effect/platform-node': specifier: 4.0.0-beta.103 version: 4.0.0-beta.103(bufferutil@4.1.0)(effect@4.0.0-beta.103(patch_hash=af36b7948b6f9c56623074662b51dade5699880c1a7c71245de73e13c3185fb6))(ioredis@5.11.0)(utf-8-validate@6.0.6) @@ -731,7 +734,7 @@ importers: version: '@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0)' vite-plus: specifier: 'catalog:' - version: 0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + version: 0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) infra/relay: dependencies: @@ -10532,6 +10535,137 @@ packages: peerDependencies: '@types/emscripten': '>=1.39.6' + jsdom@26.1.0: + resolution: {integrity: sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==} + engines: {node: '>=18'} + peerDependencies: + canvas: ^3.0.0 + peerDependenciesMeta: + canvas: + optional: true + + + cssstyle@4.6.0: + resolution: {integrity: sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==} + engines: {node: '>=18'} + + + data-urls@5.0.0: + resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} + engines: {node: '>=18'} + + + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} + + + html-encoding-sniffer@4.0.0: + resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==} + engines: {node: '>=18'} + + + is-potential-custom-element-name@1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + + + nwsapi@2.2.28: + resolution: {integrity: sha512-IlVB7OS7qrOsVYlpnFIkETjMwT9jwvmocJmmM+GZU/PAB3uGi9Ezd7vcWhWBUnSc0ya4ppmQITOyP1ez9gg8cg==} + + + rrweb-cssom@0.8.0: + resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} + + + saxes@6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + + + symbol-tree@3.2.4: + resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + + + tough-cookie@5.1.2: + resolution: {integrity: sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==} + engines: {node: '>=16'} + + + w3c-xmlserializer@5.0.0: + resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} + engines: {node: '>=18'} + + + whatwg-encoding@3.1.1: + resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==} + engines: {node: '>=18'} + deprecated: Use @exodus/bytes instead for a more spec-conformant and faster implementation + + + whatwg-mimetype@4.0.0: + resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} + engines: {node: '>=18'} + + + xml-name-validator@5.0.0: + resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} + engines: {node: '>=18'} + + + '@asamuzakjp/css-color@3.2.0': + resolution: {integrity: sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==} + + + xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + + + tldts@6.1.86: + resolution: {integrity: sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==} + hasBin: true + + + iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + + + '@csstools/css-calc@2.1.4': + resolution: {integrity: sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 + + + '@csstools/css-color-parser@3.1.0': + resolution: {integrity: sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.5 + '@csstools/css-tokenizer': ^3.0.4 + + + '@csstools/css-parser-algorithms@3.0.5': + resolution: {integrity: sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-tokenizer': ^3.0.4 + + + '@csstools/css-tokenizer@3.0.4': + resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==} + engines: {node: '>=18'} + + + tldts-core@6.1.86: + resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==} + + + '@csstools/color-helpers@5.1.0': + resolution: {integrity: sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==} + engines: {node: '>=18'} + + snapshots: '@ai-sdk/provider-utils@4.0.49(zod@4.4.3)': @@ -21384,3 +21518,302 @@ snapshots: dependencies: '@types/emscripten': 1.41.5 type-fest: 5.7.0 + + vite-plus@0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0): + dependencies: + '@oxc-project/types': 0.146.0 + '@oxlint/plugins': 1.79.0 + '@vitest/browser': 4.1.11(@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(bufferutil@4.1.0)(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(utf-8-validate@6.0.6)(vitest@4.1.11) + '@vitest/browser-preview': 4.1.11(@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(bufferutil@4.1.0)(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(utf-8-validate@6.0.6)(vitest@4.1.11) + '@vitest/expect': 4.1.11 + '@vitest/mocker': 4.1.11(@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3)) + '@vitest/pretty-format': 4.1.11 + '@vitest/runner': 4.1.11 + '@vitest/snapshot': 4.1.11 + '@vitest/spy': 4.1.11 + '@vitest/utils': 4.1.11 + '@voidzero-dev/vite-plus-core': 0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0) + oxfmt: 0.64.0(vite-plus@0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0)) + oxlint: 1.79.0(oxlint-tsgolint@7.0.2001)(vite-plus@0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0)) + oxlint-tsgolint: 7.0.2001 + vite: '@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0)' + vitest: 4.1.11(@types/node@24.12.4)(@vitest/browser-preview@4.1.11)(@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3)) + optionalDependencies: + '@voidzero-dev/vite-plus-darwin-arm64': 0.3.0 + '@voidzero-dev/vite-plus-darwin-x64': 0.3.0 + '@voidzero-dev/vite-plus-linux-arm64-gnu': 0.3.0 + '@voidzero-dev/vite-plus-linux-arm64-musl': 0.3.0 + '@voidzero-dev/vite-plus-linux-x64-gnu': 0.3.0 + '@voidzero-dev/vite-plus-linux-x64-musl': 0.3.0 + '@voidzero-dev/vite-plus-win32-arm64-msvc': 0.3.0 + '@voidzero-dev/vite-plus-win32-x64-msvc': 0.3.0 + transitivePeerDependencies: + - '@arethetypeswrong/core' + - '@edge-runtime/vm' + - '@opentelemetry/api' + - '@types/node' + - '@vitejs/devtools' + - '@vitest/coverage-istanbul' + - '@vitest/coverage-v8' + - '@vitest/ui' + - bufferutil + - esbuild + - happy-dom + - jiti + - jsdom + - less + - msw + - publint + - sass + - sass-embedded + - stylus + - sugarss + - svelte + - terser + - tsx + - typescript + - unplugin-unused + - unrun + - utf-8-validate + - yaml + + + jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6): + dependencies: + cssstyle: 4.6.0 + data-urls: 5.0.0 + decimal.js: 10.6.0 + html-encoding-sniffer: 4.0.0 + http-proxy-agent: 7.0.2(supports-color@8.1.1) + https-proxy-agent: 7.0.6(supports-color@8.1.1) + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.28 + parse5: 7.3.0 + rrweb-cssom: 0.8.0 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 5.1.2 + w3c-xmlserializer: 5.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 3.1.1 + whatwg-mimetype: 4.0.0 + whatwg-url: 14.2.0 + ws: 8.21.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + xml-name-validator: 5.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + + oxfmt@0.64.0(vite-plus@0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0)): + dependencies: + tinypool: 2.1.0 + optionalDependencies: + '@oxfmt/binding-android-arm-eabi': 0.64.0 + '@oxfmt/binding-android-arm64': 0.64.0 + '@oxfmt/binding-darwin-arm64': 0.64.0 + '@oxfmt/binding-darwin-x64': 0.64.0 + '@oxfmt/binding-freebsd-x64': 0.64.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.64.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.64.0 + '@oxfmt/binding-linux-arm64-gnu': 0.64.0 + '@oxfmt/binding-linux-arm64-musl': 0.64.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.64.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.64.0 + '@oxfmt/binding-linux-riscv64-musl': 0.64.0 + '@oxfmt/binding-linux-s390x-gnu': 0.64.0 + '@oxfmt/binding-linux-x64-gnu': 0.64.0 + '@oxfmt/binding-linux-x64-musl': 0.64.0 + '@oxfmt/binding-openharmony-arm64': 0.64.0 + '@oxfmt/binding-win32-arm64-msvc': 0.64.0 + '@oxfmt/binding-win32-ia32-msvc': 0.64.0 + '@oxfmt/binding-win32-x64-msvc': 0.64.0 + vite-plus: 0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + + + oxlint@1.79.0(oxlint-tsgolint@7.0.2001)(vite-plus@0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0)): + optionalDependencies: + '@oxlint/binding-android-arm-eabi': 1.79.0 + '@oxlint/binding-android-arm64': 1.79.0 + '@oxlint/binding-darwin-arm64': 1.79.0 + '@oxlint/binding-darwin-x64': 1.79.0 + '@oxlint/binding-freebsd-x64': 1.79.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.79.0 + '@oxlint/binding-linux-arm-musleabihf': 1.79.0 + '@oxlint/binding-linux-arm64-gnu': 1.79.0 + '@oxlint/binding-linux-arm64-musl': 1.79.0 + '@oxlint/binding-linux-ppc64-gnu': 1.79.0 + '@oxlint/binding-linux-riscv64-gnu': 1.79.0 + '@oxlint/binding-linux-riscv64-musl': 1.79.0 + '@oxlint/binding-linux-s390x-gnu': 1.79.0 + '@oxlint/binding-linux-x64-gnu': 1.79.0 + '@oxlint/binding-linux-x64-musl': 1.79.0 + '@oxlint/binding-openharmony-arm64': 1.79.0 + '@oxlint/binding-win32-arm64-msvc': 1.79.0 + '@oxlint/binding-win32-ia32-msvc': 1.79.0 + '@oxlint/binding-win32-x64-msvc': 1.79.0 + oxlint-tsgolint: 7.0.2001 + vite-plus: 0.3.0(@types/node@24.12.4)(bufferutil@4.1.0)(esbuild@0.28.1)(jiti@2.7.0)(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + + + vitest@4.1.11(@types/node@24.12.4)(@vitest/browser-preview@4.1.11)(@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(jsdom@26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3)): + dependencies: + '@vitest/expect': 4.1.11 + '@vitest/mocker': 4.1.11(@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3)) + '@vitest/pretty-format': 4.1.11 + '@vitest/runner': 4.1.11 + '@vitest/snapshot': 4.1.11 + '@vitest/spy': 4.1.11 + '@vitest/utils': 4.1.11 + es-module-lexer: 2.1.0 + expect-type: 1.4.0 + magic-string: 0.30.21 + obug: 2.1.3 + pathe: 2.0.3 + picomatch: 4.0.4 + std-env: 4.1.0 + tinybench: 2.9.0 + tinyexec: 1.2.4 + tinyglobby: 0.2.17 + tinyrainbow: 3.1.0 + vite: '@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0)' + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 24.12.4 + '@vitest/browser-preview': 4.1.11(@voidzero-dev/vite-plus-core@0.3.0(@types/node@24.12.4)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(bufferutil@4.1.0)(msw@2.12.11(@types/node@24.12.4)(typescript@6.0.3))(utf-8-validate@6.0.6)(vitest@4.1.11) + jsdom: 26.1.0(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) + transitivePeerDependencies: + - msw + + + cssstyle@4.6.0: + dependencies: + '@asamuzakjp/css-color': 3.2.0 + rrweb-cssom: 0.8.0 + + + data-urls@5.0.0: + dependencies: + whatwg-mimetype: 4.0.0 + whatwg-url: 14.2.0 + + + decimal.js@10.6.0: {} + + + html-encoding-sniffer@4.0.0: + dependencies: + whatwg-encoding: 3.1.1 + + + http-proxy-agent@7.0.2(supports-color@8.1.1): + dependencies: + agent-base: 7.1.4 + debug: 4.4.3(supports-color@8.1.1) + transitivePeerDependencies: + - supports-color + + + https-proxy-agent@7.0.6(supports-color@8.1.1): + dependencies: + agent-base: 7.1.4 + debug: 4.4.3(supports-color@8.1.1) + transitivePeerDependencies: + - supports-color + + + is-potential-custom-element-name@1.0.1: {} + + + nwsapi@2.2.28: {} + + + rrweb-cssom@0.8.0: {} + + + saxes@6.0.0: + dependencies: + xmlchars: 2.2.0 + + + symbol-tree@3.2.4: {} + + + tough-cookie@5.1.2: + dependencies: + tldts: 6.1.86 + + + w3c-xmlserializer@5.0.0: + dependencies: + xml-name-validator: 5.0.0 + + + whatwg-encoding@3.1.1: + dependencies: + iconv-lite: 0.6.3 + + + whatwg-mimetype@4.0.0: {} + + + xml-name-validator@5.0.0: {} + + + '@asamuzakjp/css-color@3.2.0': + dependencies: + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-color-parser': 3.1.0(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 + lru-cache: 10.4.3 + + + debug@4.4.3(supports-color@8.1.1): + dependencies: + ms: 2.1.3 + optionalDependencies: + supports-color: 8.1.1 + + + xmlchars@2.2.0: {} + + + tldts@6.1.86: + dependencies: + tldts-core: 6.1.86 + + + iconv-lite@0.6.3: + dependencies: + safer-buffer: 2.1.2 + + + '@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 + + + '@csstools/css-color-parser@3.1.0(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)': + dependencies: + '@csstools/color-helpers': 5.1.0 + '@csstools/css-calc': 2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4) + '@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4) + '@csstools/css-tokenizer': 3.0.4 + + + '@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4)': + dependencies: + '@csstools/css-tokenizer': 3.0.4 + + + '@csstools/css-tokenizer@3.0.4': {} + + + tldts-core@6.1.86: {} + + + '@csstools/color-helpers@5.1.0': {} +