diff --git a/apps/server/src/guide/topics.ts b/apps/server/src/guide/topics.ts index 55811f55d..a91162d56 100644 --- a/apps/server/src/guide/topics.ts +++ b/apps/server/src/guide/topics.ts @@ -219,6 +219,9 @@ While this computer is asleep or Threadlines is closed, assistants are told it's "continue at reset", "workspace", "chatgpt", + "gateway", + "model provider", + "security notice", ], body: `{place:settings.providers} lists the agents this computer can run (Claude, Codex, Cursor, OpenCode, Pi and others), in use and not in use. Each card has its account and sign-in, its models, how it appears (name and color), and how it launches (command and environment variables). @@ -234,6 +237,12 @@ A Claude sign-in made with Claude's own sign-in (not an API key or a long-lived When a Codex ChatGPT sign-in belongs to more than one workspace (a personal one and a company's, say), the Codex row shows the one in use, and its Account & Sign-in has Workspace: pick another and Switch. Switching first stops that Codex's running chats and holds new ones until it's done. A workspace behind company sign-on opens a sign-in page; Cancel keeps the current workspace. A chat whose data the old workspace keeps in another region may not continue after a switch; start a new thread for it. It needs Codex 0.167 or later. +When Codex's own config points it at a gateway or another model provider instead of OpenAI, the Codex row says Runs on and the provider's name, and Account & Sign-in has a Model provider line. Threadlines only shows it; change it in Codex's config. A ChatGPT sign-in beside it keeps its email, workspace and Sign out. It needs Codex 0.168 or later. + +When OpenAI asks a ChatGPT account to do something about its security, the Codex row says Security notice, and Account & Sign-in shows OpenAI's words with a button that opens the page on OpenAI's site. It needs Codex 0.169 or later. + +When Claude Code refuses to start (a settings file that is not valid JSON, a bad proxy address, a version too old), the chat shows Claude Code's own reason once, with the file and its backup for a broken settings file. Fix what it names, then Retry. + If Codex's sign-in goes stale in a chat before it has started on your message, Threadlines restarts Codex and sends the message again, once, with a note in the chat. If that fails too, the chat asks you to sign in. When a Claude or Codex usage limit stops a thread, the notice above the composer says which limit and when it resets. Its Continue at reset switch sends "Continue where you left off." a minute after the reset, from the computer the thread runs on (a Mac that wakes only briefly for upkeep waits until it's fully awake), or within a few minutes of the limit resetting early because the user spent a limit reset, and {place:threads.continueAfterUsageLimits} turns it on for every limit. If you added another account of the same agent that still has room, the notice offers it by name. Threadlines never switches accounts on its own.`, diff --git a/apps/server/src/provider/Drivers/CodexDriver.ts b/apps/server/src/provider/Drivers/CodexDriver.ts index c006233e2..711dc024d 100644 --- a/apps/server/src/provider/Drivers/CodexDriver.ts +++ b/apps/server/src/provider/Drivers/CodexDriver.ts @@ -45,6 +45,7 @@ import { makeCodexAdapter } from "../Layers/CodexAdapter.ts"; import { freshOrCurrentSnapshot } from "../freshProviderSnapshot.ts"; import { checkCodexProviderStatus, + type CodexSecurityNoticeMemory, type CodexWorkspaceMemory, consumeCodexRateLimitResetCredit, makePendingCodexProvider, @@ -199,11 +200,13 @@ export const CodexDriver: ProviderDriver = { // updates. Pre-provide `ChildProcessSpawner` so the check fits // `makeManagedServerProvider.checkProvider`'s `R = never`. const workspaceMemory: CodexWorkspaceMemory = {}; + const securityNoticeMemory: CodexSecurityNoticeMemory = {}; const checkProvider = checkCodexProviderStatus( effectiveConfig, undefined, processEnv, workspaceMemory, + securityNoticeMemory, ).pipe( Effect.map(stampIdentity), Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), diff --git a/apps/server/src/provider/Layers/ClaudeAdapter.test.ts b/apps/server/src/provider/Layers/ClaudeAdapter.test.ts index 7ac1f3e72..91e19d2bf 100644 --- a/apps/server/src/provider/Layers/ClaudeAdapter.test.ts +++ b/apps/server/src/provider/Layers/ClaudeAdapter.test.ts @@ -2333,6 +2333,284 @@ describe("ClaudeAdapterLive", () => { ); }); + // Claude Code 2.1.321 answers subagent reports that wait together in one + // model call. Every other member gets an empty result of its own, which + // names what queued it and ends nothing. + it.effect("keeps a turn open through the empty results of batched subagent reports", () => { + const harness = makeHarness(); + return Effect.gen(function* () { + const adapter = yield* ClaudeAdapter; + const configuredFiber = yield* Stream.filter( + adapter.streamEvents, + (event) => event.type === "session.configured", + ).pipe(Stream.take(1), Stream.runCollect, Effect.forkChild); + const completedFiber = yield* Stream.filter( + adapter.streamEvents, + (event) => event.type === "turn.completed", + ).pipe(Stream.take(1), Stream.runCollect, Effect.forkChild); + const session = yield* adapter.startSession({ + threadId: THREAD_ID, + provider: ProviderDriverKind.make("claudeAgent"), + runtimeMode: "full-access", + }); + harness.query.emit(claudeInitMessage("2.1.325")); + yield* Fiber.join(configuredFiber); + + // A message with context ahead of it also waits on an empty result of + // its own: a report's must not be counted as that one. + const turn = yield* adapter.sendTurn({ + threadId: session.threadId, + input: "Sol: done\n\nwhat did they find?", + typed: { + text: "what did they find?", + context: "Sol: done", + }, + attachments: [], + }); + const emptyResult = (uuid: string, origin?: object) => + ({ + type: "result", + subtype: "success", + is_error: false, + num_turns: 0, + result: "", + errors: [], + session_id: "sdk-session-batch", + uuid, + ...(origin ? { origin } : {}), + }) as unknown as SDKMessage; + harness.query.emit( + emptyResult("result-notice", { kind: "task-notification", producer: "session-task" }), + ); + harness.query.emit( + emptyResult("result-report", { kind: "peer", from: "a1", handback: true }), + ); + harness.query.emit(emptyResult("result-append")); + harness.query.emit({ + type: "result", + subtype: "success", + is_error: false, + num_turns: 1, + result: "They found two bugs.", + stop_reason: "end_turn", + errors: [], + session_id: "sdk-session-batch", + uuid: "result-turn", + } as unknown as SDKMessage); + + const [completed] = Array.from(yield* Fiber.join(completedFiber)); + assert.equal(completed?.type, "turn.completed"); + if (completed?.type === "turn.completed") { + assert.equal(String(completed.turnId), String(turn.turnId)); + assert.equal(completed.payload.stopReason, "end_turn"); + } + }).pipe( + Effect.provideService(Random.Random, makeDeterministicRandomService()), + Effect.provide(harness.layer), + ); + }); + + it.effect("keeps the last turn's suggestion when a batched report's empty result follows", () => { + const harness = makeHarness(); + return Effect.gen(function* () { + const context = yield* Effect.context(); + const runFork = Effect.runForkWith(context); + const adapter = yield* ClaudeAdapter; + const runtimeEvents: Array = []; + const runtimeEventsFiber = runFork( + Stream.runForEach(adapter.streamEvents, (event) => + Effect.sync(() => { + runtimeEvents.push(event); + }), + ), + ); + + const session = yield* adapter.startSession({ + threadId: THREAD_ID, + provider: ProviderDriverKind.make("claudeAgent"), + runtimeMode: "full-access", + }); + const turn = yield* adapter.sendTurn({ + threadId: session.threadId, + input: "hello", + attachments: [], + }); + harness.query.emit({ + type: "result", + subtype: "success", + is_error: false, + num_turns: 1, + result: "Hi.", + errors: [], + session_id: "sdk-session-batch", + uuid: "result-turn", + } as unknown as SDKMessage); + harness.query.emit({ + type: "result", + subtype: "success", + is_error: false, + num_turns: 0, + result: "", + errors: [], + origin: { kind: "task-notification", producer: "session-task" }, + session_id: "sdk-session-batch", + uuid: "result-notice", + } as unknown as SDKMessage); + harness.query.emit({ + type: "prompt_suggestion", + suggestion: "Run the tests.", + session_id: "sdk-session-batch", + uuid: "prompt-suggestion-1", + } as unknown as SDKMessage); + + yield* Effect.yieldNow; + yield* Effect.yieldNow; + yield* Effect.yieldNow; + runtimeEventsFiber.interruptUnsafe(); + + const suggestion = runtimeEvents.find( + (event) => event.type === "turn.prompt-suggestion.updated", + ); + assert.equal(suggestion?.type, "turn.prompt-suggestion.updated"); + if (suggestion?.type === "turn.prompt-suggestion.updated") { + assert.equal(String(suggestion.turnId), String(turn.turnId)); + } + // The empty result ended no turn of its own. + assert.equal(runtimeEvents.filter((event) => event.type === "turn.completed").length, 1); + }).pipe( + Effect.provideService(Random.Random, makeDeterministicRandomService()), + Effect.provide(harness.layer), + ); + }); + + // Claude Code writes why it refused to start as a result, then exits with + // code 1. The turn fails once, in Claude's words. + it.effect("fails the turn once, with Claude's reason, when Claude refuses to start", () => { + const harness = makeHarness(); + return Effect.gen(function* () { + const context = yield* Effect.context(); + const runFork = Effect.runForkWith(context); + const adapter = yield* ClaudeAdapter; + const runtimeEvents: Array = []; + const runtimeEventsFiber = runFork( + Stream.runForEach(adapter.streamEvents, (event) => + Effect.sync(() => { + runtimeEvents.push(event); + }), + ), + ); + + yield* adapter.startSession({ + threadId: THREAD_ID, + provider: ProviderDriverKind.make("claudeAgent"), + runtimeMode: "full-access", + }); + const turn = yield* adapter.sendTurn({ + threadId: THREAD_ID, + input: "hello", + attachments: [], + }); + const reason = + 'Invalid proxy URL in HTTPS_PROXY: "notaurl" cannot be parsed as a URL.\nFix or unset HTTPS_PROXY and restart Claude Code.'; + harness.query.emit({ + type: "result", + subtype: "error_during_execution", + is_error: true, + num_turns: 0, + startup_failure_reason: "proxy_invalid", + errors: [reason], + session_id: "sdk-session-refused", + uuid: "result-refused", + } as unknown as SDKMessage); + harness.query.fail(new Error("Claude Code process exited with code 1")); + + yield* Effect.yieldNow; + yield* Effect.yieldNow; + yield* Effect.yieldNow; + runtimeEventsFiber.interruptUnsafe(); + + const errors = runtimeEvents.filter((event) => event.type === "runtime.error"); + assert.deepEqual( + errors.map((event) => (event.type === "runtime.error" ? event.payload.message : "")), + [reason], + ); + const completions = runtimeEvents.filter((event) => event.type === "turn.completed"); + assert.equal(completions.length, 1); + const [completed] = completions; + if (completed?.type === "turn.completed") { + assert.equal(String(completed.turnId), String(turn.turnId)); + assert.equal(completed.payload.state, "failed"); + assert.equal(completed.payload.errorMessage, reason); + } + const exited = runtimeEvents.find((event) => event.type === "session.exited"); + assert.equal(exited?.type, "session.exited"); + if (exited?.type === "session.exited") { + assert.equal(exited.payload.exitKind, "error"); + } + assert.equal(yield* adapter.hasSession(THREAD_ID), false); + }).pipe( + Effect.provideService(Random.Random, makeDeterministicRandomService()), + Effect.provide(harness.layer), + ); + }); + + // A session restarted for a setting, or started ahead of its message, has + // no turn to fail: the thread still hears why Claude would not start. + it.effect("tells the thread once when Claude refuses to start with no turn open", () => { + const harness = makeHarness(); + return Effect.gen(function* () { + const context = yield* Effect.context(); + const runFork = Effect.runForkWith(context); + const adapter = yield* ClaudeAdapter; + const runtimeEvents: Array = []; + const runtimeEventsFiber = runFork( + Stream.runForEach(adapter.streamEvents, (event) => + Effect.sync(() => { + runtimeEvents.push(event); + }), + ), + ); + + yield* adapter.startSession({ + threadId: THREAD_ID, + provider: ProviderDriverKind.make("claudeAgent"), + runtimeMode: "full-access", + }); + const reason = "Configuration error in /home/me/.claude.json: JSON Parse error"; + harness.query.emit({ + type: "result", + subtype: "error_during_execution", + is_error: true, + num_turns: 0, + startup_failure_reason: "config_file_invalid", + errors: [reason], + session_id: "sdk-session-refused", + uuid: "result-refused", + } as unknown as SDKMessage); + harness.query.fail(new Error("Claude Code process exited with code 1")); + + yield* Effect.yieldNow; + yield* Effect.yieldNow; + yield* Effect.yieldNow; + runtimeEventsFiber.interruptUnsafe(); + + assert.deepEqual( + runtimeEvents.flatMap((event) => + event.type === "runtime.error" ? [event.payload.message] : [], + ), + [reason], + ); + assert.equal( + runtimeEvents.some((event) => event.type === "turn.completed"), + false, + ); + assert.equal(yield* adapter.hasSession(THREAD_ID), false); + }).pipe( + Effect.provideService(Random.Random, makeDeterministicRandomService()), + Effect.provide(harness.layer), + ); + }); + it.effect("sends a CLI too old to append context the single unmarked message", () => { const harness = makeHarness(); return Effect.gen(function* () { diff --git a/apps/server/src/provider/Layers/ClaudeAdapter.ts b/apps/server/src/provider/Layers/ClaudeAdapter.ts index af0467670..c9008dc37 100644 --- a/apps/server/src/provider/Layers/ClaudeAdapter.ts +++ b/apps/server/src/provider/Layers/ClaudeAdapter.ts @@ -685,6 +685,12 @@ interface ClaudeSessionContext { /** Append-only messages sent whose own empty result has not come back yet. * The CLI answers each with a zero-turn result that ends nothing. */ pendingAppendOnlyResults: number; + /** Set once Claude Code said why it refused to start; it exits right after, + * and that exit must not be reported as a second, vaguer failure. */ + startFailure: ClaudeStartFailure | undefined; + /** Whether this session began a conversation rather than resuming one: only + * such a session, refused at start, is known to hold nothing to restore. */ + readonly startedFresh: boolean; /** The session's goal as Claude recorded it (see ClaudeGoals.ts); null * when it has none. */ goal: ClaudeGoalState | null; @@ -1413,6 +1419,75 @@ function resultDisplayError( return result.errors.find((error) => !error.startsWith("[ede_diagnostic]")); } +/** + * Asks Claude Code to write a refused start as a result before it exits. + * Without it most refusals reach us only as "exited with code 1"; a CLI too + * old to know the variable ignores it. + */ +const CLAUDE_STARTUP_FAILURE_RESULTS_ENVIRONMENT = { CLAUDE_CODE_STARTUP_FAILURE_RESULTS: "1" }; + +/** The CLI's start-failure text is written for a terminal and can run long. */ +const MAX_CLAUDE_START_FAILURE_TEXT = 1_200; + +/** Refused starts kept for the next start to recognize; far more than can be waiting at once. */ +const MAX_REMEMBERED_UNSTARTED_SESSIONS = 256; + +export interface ClaudeStartFailure { + /** Claude Code's reason code, such as `config_file_invalid`. New ones arrive as text. */ + readonly reason: string; + /** Claude Code's own words: what is wrong and how to fix it. */ + readonly message: string; +} + +/** + * Why Claude Code refused to start, read from the result it writes before it + * exits. Undefined for every result that ends a turn Claude ran. + */ +export function claudeStartFailure(result: SDKResultMessage): ClaudeStartFailure | undefined { + if (result.subtype === "success" || result.startup_failure_reason === undefined) { + return undefined; + } + const text = result.errors + .map((error) => error.trim()) + .filter((error) => error !== "" && !error.startsWith("[ede_diagnostic]")) + .join("\n"); + return { + reason: result.startup_failure_reason, + message: + text === "" + ? "Claude Code could not start." + : text.length > MAX_CLAUDE_START_FAILURE_TEXT + ? `${text.slice(0, MAX_CLAUDE_START_FAILURE_TEXT - 1)}…` + : text, + }; +} + +/** The refused starts whose fix is signing in again. */ +function claudeStartFailureCategory(reason: string): ProviderFailureCategory | undefined { + return reason === "gateway_signin_required" || reason === "org_config_refused" + ? "auth" + : undefined; +} + +/** + * Whether a result is the empty one Claude Code writes for a queued subagent + * report or task notice that was answered by another's model call (reports + * that wait together share one call since 2.1.321). Nothing ran for it, so + * it ends no turn: the shared call's own result does. Such a result names + * what queued it in `origin`; a person's message and Threadlines' own sends + * never match. + */ +export function isClaudeSharedCallResult(result: SDKResultMessage): boolean { + return ( + result.subtype === "success" && + !result.is_error && + result.num_turns === 0 && + result.result === "" && + result.origin !== undefined && + result.origin.kind !== "human" + ); +} + /** * Whether a rate-limit report refuses the plan's ordinary usage for one of its * windows (the 5-hour session, a weekly one): rejected, and not carried on by @@ -4152,6 +4227,26 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( >(undefined)); const sessions = new Map(); + /** + * Sessions Claude Code refused to start, by id. A thread keeps the id of + * its session for the next start to resume, and one that never began left + * no transcript: that start begins fresh without warning of lost context. + * Kept in memory only; after a restart the warning shows as it always did. + */ + const sessionsNeverBegan = new Set(); + const rememberSessionNeverBegan = (sessionId: string) => { + if (sessionsNeverBegan.size >= MAX_REMEMBERED_UNSTARTED_SESSIONS) { + sessionsNeverBegan.clear(); + } + sessionsNeverBegan.add(sessionId); + }; + /** + * The refused start each thread was last told about with no turn open, in + * Claude Code's words. A send right after starts Claude again and is refused + * the same way: its turn fails with those words without a second copy of + * the error. Forgotten once Claude starts for the thread. + */ + const startFailuresTold = new Map(); const runtimeEventQueue = yield* Queue.unbounded(); const nowIso = Effect.map(DateTime.now, DateTime.formatIso); @@ -6874,6 +6969,58 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( ); }); + /** + * Fails the open turn on a refused start, in Claude Code's words. The error + * itself is left out when the thread was just told the same thing with no + * turn open (the start a send retries). + */ + const failTurnOnStartFailure = Effect.fn("failTurnOnStartFailure")(function* ( + context: ClaudeSessionContext, + failure: ClaudeStartFailure, + result?: SDKResultMessage, + ) { + const threadId = context.session.threadId; + const failureCategory = claudeStartFailureCategory(failure.reason); + const alreadyTold = startFailuresTold.get(threadId) === failure.message; + startFailuresTold.delete(threadId); + if (!alreadyTold) { + yield* emitRuntimeError(context, failure.message, undefined, failureCategory); + } + yield* completeTurn(context, "failed", failure.message, result, failureCategory); + }); + + /** + * Claude Code refused to start and is about to exit. With a turn open, the + * refusal is how that turn ends. With none (a session started ahead of its + * message, or restarted for a setting), the thread is told once, here. + */ + const handleStartFailure = Effect.fn("handleStartFailure")(function* ( + context: ClaudeSessionContext, + failure: ClaudeStartFailure, + result: SDKResultMessage, + ) { + context.startFailure = failure; + if (context.startedFresh && context.resumeSessionId !== undefined) { + rememberSessionNeverBegan(context.resumeSessionId); + } + yield* Effect.logWarning("claude.session.start-refused", { + threadId: context.session.threadId, + reason: failure.reason, + message: failure.message, + }); + if (context.turnState) { + yield* failTurnOnStartFailure(context, failure, result); + return; + } + yield* emitRuntimeError( + context, + failure.message, + undefined, + claudeStartFailureCategory(failure.reason), + ); + startFailuresTold.set(context.session.threadId, failure.message); + }); + const handleResultMessage = Effect.fn("handleResultMessage")(function* ( context: ClaudeSessionContext, message: SDKMessage, @@ -6886,6 +7033,16 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( context.goalCommandResultsToSkip -= 1; return; } + // Before the append-only count below, which would take it for one of + // its own and then end the user's turn on the real one. + if (isClaudeSharedCallResult(message)) { + return; + } + const startFailure = claudeStartFailure(message); + if (startFailure) { + yield* handleStartFailure(context, startFailure, message); + return; + } // A context message sent ahead of the user's words (shouldQuery: false) // gets a result of its own, with no turn in it; the turn is still to come. if (context.pendingAppendOnlyResults > 0 && message.num_turns === 0 && !message.is_error) { @@ -7229,6 +7386,8 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( switch (message.subtype) { case "init": { + // Claude started: a refusal the thread was told about is behind it. + startFailuresTold.delete(context.session.threadId); const cliVersion = nonEmptyString( (message as { readonly claude_code_version?: unknown }).claude_code_version, ); @@ -8127,6 +8286,28 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( return; } + if (context.startFailure !== undefined) { + // Claude Code already said why it would not start. Its exit adds only + // "exited with code 1", so it is not reported again. + const failure = context.startFailure; + if (context.turnState) { + yield* failTurnOnStartFailure(context, failure); + } + // Whoever asked about the goal hears why, not just that it stopped. + const goalCommand = context.goalCommand; + if (goalCommand !== undefined) { + context.goalCommand = undefined; + yield* Deferred.succeed(goalCommand.reply, { accepted: false, text: failure.message }); + } + yield* stopSessionInternal(context, { + emitExitEvent: true, + exitKind: "error", + exitReason: failure.message, + recoverable: true, + }); + return; + } + if (Exit.isFailure(exit)) { if (isClaudeInterruptedCause(exit.cause)) { if (context.turnState) { @@ -8447,6 +8628,13 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( threadId, detail: `Claude conversation ${requestedResumeState.resume} was not found to resume.`, }); + } else if ( + transcriptResolution?.outcome === "missing" && + sessionsNeverBegan.delete(requestedResumeState.resume) + ) { + // Claude refused to start that session, so it holds nothing to + // restore and a fresh start loses nothing worth a warning. + resumeState = undefined; } else if (transcriptResolution?.outcome === "missing") { yield* Effect.logWarning("claude.resume.transcript-missing", { threadId, @@ -9288,6 +9476,7 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( const sdkEnvironment = { ...withUsualCommandLookup(claudeEnvironment), ...(artifacts ? CLAUDE_ARTIFACT_ENVIRONMENT : CLAUDE_ARTIFACT_OFF_ENVIRONMENT), + ...CLAUDE_STARTUP_FAILURE_RESULTS_ENVIRONMENT, }; // Asked of the very binary, folder and environment the SDK gets below. const guardFailure = claudeGuardFailure( @@ -9623,6 +9812,8 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( planTracker: new Map(), workflowRuns: new ClaudeWorkflowRunTracker(), pendingAppendOnlyResults: 0, + startFailure: undefined, + startedFresh: existingResumeSessionId === undefined, goal: null, goalsTracked: !lockdown, goalCommand: undefined, diff --git a/apps/server/src/provider/Layers/CodexProvider.ts b/apps/server/src/provider/Layers/CodexProvider.ts index 9dbc793a4..1b3e08c20 100644 --- a/apps/server/src/provider/Layers/CodexProvider.ts +++ b/apps/server/src/provider/Layers/CodexProvider.ts @@ -27,6 +27,8 @@ import type { ModelInputModality, ModelUpgradeInfo, ServerProviderModel, + ServerProviderModelProvider, + ServerProviderSecurityNotice, ServerProviderSkill, ServerProviderWorkspace, } from "@threadlines/contracts"; @@ -66,6 +68,14 @@ export interface CodexAppServerProviderSnapshot { readonly accountSessions?: CodexSchema.V2AccountSessionsResponse; readonly rateLimits?: CodexSchema.V2GetAccountRateLimitsResponse; readonly tokenUsage?: CodexSchema.V2GetAccountTokenUsageResponse; + /** Codex's model providers and which one new chats use (`modelProvider/list`). */ + readonly modelProviders?: CodexSchema.V2ModelProviderListResponse; + /** + * What OpenAI asks this account to do about its security + * (`account/securitySetup/read`). Absent when Codex gave no answer; a + * `notice` of null is its answer that there is nothing to do. + */ + readonly securitySetup?: CodexSchema.V2GetAccountSecuritySetupResponse; readonly version: string | undefined; readonly models: ReadonlyArray; readonly skills: ReadonlyArray; @@ -772,7 +782,15 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun } satisfies CodexAppServerProviderSnapshot; } - const [skillsResponse, models, rateLimits, tokenUsage, accountSessions] = yield* Effect.all( + const [ + skillsResponse, + models, + rateLimits, + tokenUsage, + accountSessions, + modelProviders, + securitySetup, + ] = yield* Effect.all( [ client.request("skills/list", { cwds: [input.cwd], @@ -783,6 +801,10 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun accountResponse.account?.type === "chatgpt" ? readCodexAccountSessions(client) : Effect.succeed(undefined), + readCodexModelProviders(client), + accountResponse.account?.type === "chatgpt" + ? readCodexSecuritySetup(client) + : Effect.succeed(undefined), ], { concurrency: "unbounded" }, ); @@ -792,6 +814,8 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun ...(accountSessions ? { accountSessions } : {}), ...(rateLimits ? { rateLimits } : {}), ...(tokenUsage ? { tokenUsage } : {}), + ...(modelProviders ? { modelProviders } : {}), + ...(securitySetup ? { securitySetup } : {}), version, models: appendCustomCodexModels(models, input.customModels ?? []), skills: parseCodexSkillsListResponse(skillsResponse, input.cwd), @@ -817,6 +841,150 @@ export const readCodexAccountSessions = (client: CodexClient.CodexAppServerClien Effect.orElseSucceed(() => undefined), ); +/** + * How long the status check waits for an answer it can do without. A request + * Codex never answers would otherwise hold the whole check until it times out + * and reports nothing at all. + */ +const CODEX_OPTIONAL_READ_TIMEOUT = Duration.seconds(8); + +/** + * Codex's model providers and its default one. Undefined from a Codex without + * the request (before 0.168), on a failure (a kind of provider these bindings + * don't know yet fails to decode), or when it doesn't answer in time. + */ +export const readCodexModelProviders = (client: CodexClient.CodexAppServerClientShape) => + client.request("modelProvider/list", {}).pipe( + Effect.timeoutOption(CODEX_OPTIONAL_READ_TIMEOUT), + Effect.map(Option.getOrUndefined), + Effect.orElseSucceed(() => undefined), + ); + +/** + * OpenAI's security reminder for the signed-in ChatGPT account, asked of its + * servers. Undefined from a Codex without the request (before 0.169), on a + * failure, or when it doesn't answer in time. + */ +export const readCodexSecuritySetup = (client: CodexClient.CodexAppServerClientShape) => + client.request("account/securitySetup/read", undefined).pipe( + Effect.timeoutOption(CODEX_OPTIONAL_READ_TIMEOUT), + Effect.map(Option.getOrUndefined), + Effect.orElseSucceed(() => undefined), + ); + +/** + * Where new Codex chats run, when that is not OpenAI: the default model + * provider of the user's Codex config, such as a company gateway. None for + * OpenAI itself, and none when the account already is the provider (Amazon + * Bedrock and Google Cloud sign in as accounts and are named there). + */ +export function codexModelProviderForCheck( + account: CodexAppServerProviderSnapshot["account"], + providers: CodexAppServerProviderSnapshot["modelProviders"], +): ServerProviderModelProvider | undefined { + if (!providers) return undefined; + const accountType = account.account?.type; + if (accountType === "amazonBedrock" || accountType === "gcp") return undefined; + const provider = providers.data.find((entry) => entry.id === providers.defaultProviderId); + if (!provider || provider.settings.type === "openai") return undefined; + const id = provider.id.trim(); + if (!id) return undefined; + return { id, name: singleLine(provider.name, MAX_MODEL_PROVIDER_NAME) ?? id }; +} + +const MAX_MODEL_PROVIDER_NAME = 60; +const MAX_SECURITY_NOTICE_TITLE = 120; +const MAX_SECURITY_NOTICE_DESCRIPTION = 400; +const MAX_SECURITY_NOTICE_ACTION_LABEL = 40; + +/** Text from outside, as one bounded line: no line breaks or control characters. */ +function singleLine(value: string | null | undefined, maxLength: number): string | undefined { + // oxlint-disable-next-line no-control-regex + const flat = (value ?? "").replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029]+/gu, " "); + const trimmed = flat.replace(/\s+/gu, " ").trim(); + if (!trimmed) return undefined; + return trimmed.length > maxLength ? `${trimmed.slice(0, maxLength - 1).trimEnd()}…` : trimmed; +} + +/** OpenAI's own sites: the only places a security notice's button may lead. */ +const CODEX_SECURITY_NOTICE_HOSTS = ["openai.com", "chatgpt.com"] as const; + +/** + * A security notice's link, kept only when it is an https page on one of + * OpenAI's sites. The address comes from a server, and the row opens it on a + * click, so anything else is dropped rather than shown. + */ +function codexSecurityNoticeUrl(value: string): string | undefined { + let url: URL; + try { + url = new URL(value.trim()); + } catch { + return undefined; + } + if (url.protocol !== "https:" || url.username !== "" || url.password !== "") return undefined; + const host = url.hostname.toLowerCase(); + return CODEX_SECURITY_NOTICE_HOSTS.some((site) => host === site || host.endsWith(`.${site}`)) + ? url.toString() + : undefined; +} + +/** + * The last security notice a status check read and the account it was for, + * kept for the checks that get no answer (OpenAI slow). One per Codex + * instance. It is shown again only to the very same user and workspace: a + * workspace switch, another login or a sign-out forgets it. + */ +export interface CodexSecurityNoticeMemory { + last?: + | { + readonly identity: string; + readonly notice: ServerProviderSecurityNotice; + } + | undefined; +} + +/** + * The security notice for a check: the one it read, when it is for the + * account in use, else the remembered one of the same user and workspace. + */ +export function codexSecurityNoticeForCheck( + account: CodexAppServerProviderSnapshot["account"], + read: CodexAppServerProviderSnapshot["securitySetup"], + memory: CodexSecurityNoticeMemory | undefined, +): ServerProviderSecurityNotice | undefined { + const userId = optionalString(account.userId); + const workspaceId = optionalString(account.workspaceRouting?.chatgptAccountId); + if (account.account?.type !== "chatgpt" || !userId || !workspaceId) { + if (memory) memory.last = undefined; + return undefined; + } + const identity = `${userId}\n${workspaceId}`; + if (read === undefined) { + const last = memory?.last; + if (last?.identity === identity) return last.notice; + if (memory) memory.last = undefined; + return undefined; + } + const raw = read.notice; + const title = singleLine(raw?.title, MAX_SECURITY_NOTICE_TITLE); + // Codex binds a notice to the account that fetched it; one for anyone else + // is not this person's to act on. + if (!raw || !title || raw.userId !== userId || raw.accountId !== workspaceId) { + if (memory) memory.last = undefined; + return undefined; + } + const description = singleLine(raw.description, MAX_SECURITY_NOTICE_DESCRIPTION); + const label = singleLine(raw.action.label, MAX_SECURITY_NOTICE_ACTION_LABEL); + const url = codexSecurityNoticeUrl(raw.action.url); + const notice: ServerProviderSecurityNotice = { + title, + ...(description ? { description } : {}), + ...(label && url ? { action: { label, url } } : {}), + }; + if (memory) memory.last = { identity, notice }; + return notice; +} + /** * The workspaces of the login in use, for the snapshot: the active session's, * with the one it has selected marked current. None when there is no active @@ -973,14 +1141,18 @@ const makePendingCodexProvider = ( }); function accountProbeStatus( - account: CodexAppServerProviderSnapshot["account"], - accountSessions: CodexAppServerProviderSnapshot["accountSessions"], + snapshot: Pick< + CodexAppServerProviderSnapshot, + "account" | "accountSessions" | "modelProviders" | "securitySetup" + >, workspaceMemory: CodexWorkspaceMemory | undefined, + securityNoticeMemory: CodexSecurityNoticeMemory | undefined, ): { readonly status: Exclude; readonly auth: ServerProvider["auth"]; readonly message?: string; } { + const { account, accountSessions } = snapshot; const authLabel = codexAccountAuthLabel(account.account); const authEmail = codexAccountEmail(account.account); const workspaces = codexWorkspacesForCheck( @@ -988,12 +1160,20 @@ function accountProbeStatus( account.account?.type === "chatgpt" ? codexWorkspacesFromSessions(accountSessions) : undefined, workspaceMemory, ); + const modelProvider = codexModelProviderForCheck(account, snapshot.modelProviders); + const securityNotice = codexSecurityNoticeForCheck( + account, + snapshot.securitySetup, + securityNoticeMemory, + ); const auth = { status: account.account ? ("authenticated" as const) : ("unknown" as const), ...(account.account?.type ? { type: account.account?.type } : {}), ...(authLabel ? { label: authLabel } : {}), ...(authEmail ? { email: authEmail } : {}), ...(workspaces ? { workspaces } : {}), + ...(modelProvider ? { modelProvider } : {}), + ...(securityNotice ? { securityNotice } : {}), } satisfies ServerProvider["auth"]; if (account.account) { @@ -1027,6 +1207,8 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu environment: NodeJS.ProcessEnv = process.env, /** The instance's last workspace list, kept through checks that can't read one. */ workspaceMemory?: CodexWorkspaceMemory, + /** The instance's last security notice, kept the same way. */ + securityNoticeMemory?: CodexSecurityNoticeMemory, ): Effect.fn.Return< ServerProviderDraft, ServerSettingsError, @@ -1036,6 +1218,7 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu const emptyModels = emptyCodexModelsFromSettings(codexSettings); if (!codexSettings.enabled) { + if (securityNoticeMemory) securityNoticeMemory.last = undefined; return makeDisabledCodexProvider(codexSettings, checkedAt, environment); } @@ -1051,6 +1234,16 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu Effect.result, ); + // A check that could not read the account can't tell who is signed in now + // (a sign-out may have happened behind it), so the kept security notice goes + // with it. It comes back with OpenAI's next answer. + if ( + securityNoticeMemory && + (Result.isFailure(probeResult) || Option.isNone(probeResult.success)) + ) { + securityNoticeMemory.last = undefined; + } + if (Result.isFailure(probeResult)) { const error = probeResult.failure; const installed = !isCodexAppServerSpawnError(error); @@ -1101,11 +1294,7 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu } const snapshot = probeResult.success.value; - const accountStatus = accountProbeStatus( - snapshot.account, - snapshot.accountSessions, - workspaceMemory, - ); + const accountStatus = accountProbeStatus(snapshot, workspaceMemory, securityNoticeMemory); const accountUsage = normalizeCodexAccountUsage( snapshot.rateLimits, snapshot.tokenUsage, diff --git a/apps/server/src/provider/Layers/ProviderRegistry.test.ts b/apps/server/src/provider/Layers/ProviderRegistry.test.ts index fe5132f0e..a1e58db7e 100644 --- a/apps/server/src/provider/Layers/ProviderRegistry.test.ts +++ b/apps/server/src/provider/Layers/ProviderRegistry.test.ts @@ -40,6 +40,7 @@ import { checkCodexProviderStatus, parseCodexModelListResponse, type CodexAppServerProviderSnapshot, + type CodexSecurityNoticeMemory, type CodexWorkspaceMemory, } from "./CodexProvider.ts"; import { @@ -465,6 +466,183 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsService.layerTest(), T }), ); + it.effect("names the gateway Codex runs on beside the ChatGPT sign-in it still holds", () => + Effect.gen(function* () { + const providers = (defaultProviderId: string) => ({ + canChangeDefault: true, + defaultProviderId, + data: [ + { + id: "acme", + name: " Acme\nGateway ", + canEdit: true, + baseUrl: "https://llm.acme.example/v1", + settings: { + type: "customGateway" as const, + auth: { mode: "environmentVariable" as const, envKey: "ACME_API_KEY" }, + }, + }, + { + id: "openai", + name: "OpenAI", + canEdit: false, + settings: { type: "openai" as const }, + }, + ], + }); + const onGateway = yield* checkCodexProviderStatus(defaultCodexSettings, () => + Effect.succeed(makeCodexProbeSnapshot({ modelProviders: providers("acme") })), + ); + assert.deepStrictEqual(onGateway.auth.modelProvider, { + id: "acme", + name: "Acme Gateway", + }); + // The sign-in is still there to sign out of or switch workspaces on. + assert.strictEqual(onGateway.auth.status, "authenticated"); + assert.strictEqual(onGateway.auth.type, "chatgpt"); + + const onOpenAi = yield* checkCodexProviderStatus(defaultCodexSettings, () => + Effect.succeed(makeCodexProbeSnapshot({ modelProviders: providers("openai") })), + ); + assert.strictEqual(onOpenAi.auth.modelProvider, undefined); + + // No account at all: Codex is ready on the gateway alone. + const gatewayOnly = yield* checkCodexProviderStatus(defaultCodexSettings, () => + Effect.succeed( + makeCodexProbeSnapshot({ + account: { account: null, requiresOpenaiAuth: false }, + modelProviders: providers("acme"), + }), + ), + ); + assert.strictEqual(gatewayOnly.status, "ready"); + assert.strictEqual(gatewayOnly.auth.status, "unknown"); + assert.deepStrictEqual(gatewayOnly.auth.modelProvider, { + id: "acme", + name: "Acme Gateway", + }); + }), + ); + + it.effect("shows OpenAI's security notice only to the account it is for", () => + Effect.gen(function* () { + const securityNoticeMemory: CodexSecurityNoticeMemory = {}; + const check = (snapshot: CodexAppServerProviderSnapshot) => + checkCodexProviderStatus( + defaultCodexSettings, + () => Effect.succeed(snapshot), + process.env, + undefined, + securityNoticeMemory, + ); + const accountIn = (workspaceId: string) => ({ + ...makeCodexProbeSnapshot().account, + userId: "user-1", + workspaceRouting: { + chatgptAccountId: workspaceId, + backendOrigin: "https://chatgpt.com", + accountRoutingOverride: "NO_CONSTRAINT", + }, + }); + const notice = (overrides?: { accountId?: string; url?: string }) => ({ + notice: { + accountId: overrides?.accountId ?? "acct-work", + userId: "user-1", + title: " Turn on\ntwo-step sign-in ", + description: "Your workspace requires it by Dec 1.", + action: { + label: "Set up", + url: overrides?.url ?? "https://chatgpt.com/settings/security", + }, + }, + }); + + const shown = yield* check( + makeCodexProbeSnapshot({ account: accountIn("acct-work"), securitySetup: notice() }), + ); + const expected = { + title: "Turn on two-step sign-in", + description: "Your workspace requires it by Dec 1.", + action: { label: "Set up", url: "https://chatgpt.com/settings/security" }, + }; + assert.deepStrictEqual(shown.auth.securityNotice, expected); + + // A check OpenAI didn't answer keeps it for the same user and workspace. + const slow = yield* check(makeCodexProbeSnapshot({ account: accountIn("acct-work") })); + assert.deepStrictEqual(slow.auth.securityNotice, expected); + + // After a workspace switch an unanswered check shows nothing: the + // notice was the other workspace's. + const switched = yield* check( + makeCodexProbeSnapshot({ account: accountIn("acct-home") }), + ); + assert.strictEqual(switched.auth.securityNotice, undefined); + const back = yield* check(makeCodexProbeSnapshot({ account: accountIn("acct-work") })); + assert.strictEqual(back.auth.securityNotice, undefined); + + // A check that could not read the account at all forgets it too: a + // sign-out may sit behind the failure. + yield* check( + makeCodexProbeSnapshot({ account: accountIn("acct-work"), securitySetup: notice() }), + ); + yield* checkCodexProviderStatus( + defaultCodexSettings, + () => + Effect.fail( + new CodexErrors.CodexAppServerSpawnError({ command: "codex", cause: "missing" }), + ), + process.env, + undefined, + securityNoticeMemory, + ); + const afterFailedCheck = yield* check( + makeCodexProbeSnapshot({ account: accountIn("acct-work") }), + ); + assert.strictEqual(afterFailedCheck.auth.securityNotice, undefined); + + // A notice bound to another account is not this one's to act on. + const foreign = yield* check( + makeCodexProbeSnapshot({ + account: accountIn("acct-work"), + securitySetup: notice({ accountId: "acct-other" }), + }), + ); + assert.strictEqual(foreign.auth.securityNotice, undefined); + + // A link that leaves OpenAI's sites is dropped; the words stay. + for (const url of [ + "https://chatgpt.com.evil.example/settings", + "http://chatgpt.com/settings", + "javascript:alert(1)", + "https://user@chatgpt.com/settings", + ]) { + const unsafe = yield* check( + makeCodexProbeSnapshot({ + account: accountIn("acct-work"), + securitySetup: notice({ url }), + }), + ); + assert.deepStrictEqual(unsafe.auth.securityNotice, { + title: expected.title, + description: expected.description, + }); + } + + // OpenAI's answer that nothing is needed clears it. + const cleared = yield* check( + makeCodexProbeSnapshot({ + account: accountIn("acct-work"), + securitySetup: { notice: null }, + }), + ); + assert.strictEqual(cleared.auth.securityNotice, undefined); + const afterCleared = yield* check( + makeCodexProbeSnapshot({ account: accountIn("acct-work") }), + ); + assert.strictEqual(afterCleared.auth.securityNotice, undefined); + }), + ); + it("maps Codex app-server model metadata into provider models", () => { const response: Parameters[0] = { data: [ diff --git a/apps/web/src/components/settings/ProviderAccountNotes.tsx b/apps/web/src/components/settings/ProviderAccountNotes.tsx new file mode 100644 index 000000000..a068ce3af --- /dev/null +++ b/apps/web/src/components/settings/ProviderAccountNotes.tsx @@ -0,0 +1,82 @@ +/** + * Two read-only lines of a provider's Account & Sign-in, both in the agent's + * own words: the model provider its chats run on when that is not its maker's + * service (a gateway in Codex's config), and a security notice its service + * has for the signed-in account. + * + * @module ProviderAccountNotes + */ +import type { ServerProvider } from "@threadlines/contracts"; +import { ExternalLinkIcon } from "lucide-react"; + +import { openExternalUrl } from "../../lib/externalLinks"; +import { Button } from "../ui/button"; + +/** The short words a provider's row adds when its chats run on a gateway. */ +export function providerRunsOnText(provider: ServerProvider | undefined): string | null { + const name = provider?.auth.modelProvider?.name; + return name ? `Runs on ${name}` : null; +} + +/** Where the agent's chats run, when that is somewhere other than its maker's service. */ +export function ProviderModelProviderRow(props: { + readonly displayName: string; + readonly provider: ServerProvider; +}) { + const modelProvider = props.provider.auth.modelProvider; + if (!modelProvider) return null; + return ( +
+
+ Model provider + + {props.displayName} chats run on this provider. It's set in {props.displayName}'s own + config. + +
+ + {modelProvider.name} + +
+ ); +} + +/** + * A notice's link, opened only when it is an https page. The server already + * keeps it to the provider's own sites; this guards a server that doesn't. + */ +function isHttpsUrl(value: string): boolean { + try { + return new URL(value).protocol === "https:"; + } catch { + return false; + } +} + +/** What the provider's service asks the signed-in person to do about their account. */ +export function ProviderSecurityNoticeRow(props: { readonly provider: ServerProvider }) { + const notice = props.provider.auth.securityNotice; + if (!notice) return null; + const action = notice.action && isHttpsUrl(notice.action.url) ? notice.action : null; + return ( +
+
+ {notice.title} + {notice.description ? ( + {notice.description} + ) : null} +
+ {action ? ( + + ) : null} +
+ ); +} diff --git a/apps/web/src/components/settings/ProviderInstanceCard.test.ts b/apps/web/src/components/settings/ProviderInstanceCard.test.ts index 05dcedf56..7c35dae55 100644 --- a/apps/web/src/components/settings/ProviderInstanceCard.test.ts +++ b/apps/web/src/components/settings/ProviderInstanceCard.test.ts @@ -196,3 +196,44 @@ describe("Claude authentication presentation", () => { }); }); }); + +describe("Codex on a gateway from its own config", () => { + const provider = { + instanceId: ProviderInstanceId.make("codex"), + driver: ProviderDriverKind.make("codex"), + enabled: true, + installed: true, + version: "0.169.0", + status: "ready", + auth: { status: "unknown", modelProvider: { id: "acme", name: "Acme Gateway" } }, + checkedAt: "2026-11-14T00:00:00.000Z", + models: [], + slashCommands: [], + skills: [], + } satisfies ServerProvider; + + it("names the gateway instead of saying a sign-in could not be verified", () => { + expect(getProviderSummary(provider)).toEqual({ + headline: "Runs on Acme Gateway", + detail: null, + }); + expect(providerAuthBadge(provider.auth)).toEqual({ + label: "No sign-in needed", + variant: "secondary", + }); + }); + + it("keeps the account's words when a sign-in sits beside the gateway", () => { + const signedIn = { + ...provider, + auth: { ...provider.auth, status: "authenticated", label: "ChatGPT Pro 5x Subscription" }, + } satisfies ServerProvider; + expect(getProviderSummary(signedIn).headline).toBe( + "Authenticated · ChatGPT Pro 5x Subscription", + ); + expect(providerAuthBadge(signedIn.auth)).toEqual({ + label: "Authenticated", + variant: "success", + }); + }); +}); diff --git a/apps/web/src/components/settings/ProviderInstanceCard.tsx b/apps/web/src/components/settings/ProviderInstanceCard.tsx index d655bf77f..54eff9d23 100644 --- a/apps/web/src/components/settings/ProviderInstanceCard.tsx +++ b/apps/web/src/components/settings/ProviderInstanceCard.tsx @@ -65,6 +65,11 @@ import { import { AddProviderAccountForm } from "./AddProviderAccountForm"; import { Badge } from "../ui/badge"; import { Button } from "../ui/button"; +import { + ProviderModelProviderRow, + ProviderSecurityNoticeRow, + providerRunsOnText, +} from "./ProviderAccountNotes"; import { Checkbox } from "../ui/checkbox"; import { Collapsible, CollapsibleContent } from "../ui/collapsible"; import { DraftInput } from "../ui/draft-input"; @@ -583,7 +588,10 @@ export function providerAuthBadge(input: ServerProvider["auth"] | undefined): { case "unauthenticated": return { label: "Needs sign in", variant: "warning" }; default: - return { label: "Checking", variant: "secondary" }; + // Running on a gateway from its own config, it has no sign-in to check. + return input?.modelProvider + ? { label: "No sign-in needed", variant: "secondary" } + : { label: "Checking", variant: "secondary" }; } } @@ -726,6 +734,10 @@ function ProviderAccountSignInSection(props: { }) { const authBadge = providerAuthBadge(props.liveProvider?.auth); const needsSignIn = authBadge.variant === "warning"; + // Ready on a gateway with no account: signing in is a first sign-in, not a repeat. + const notSignedInOnGateway = + props.liveProvider?.auth.modelProvider !== undefined && + props.liveProvider.auth.status !== "authenticated"; // A saved sign-in close to its end: Sign in again becomes the main action. const signInEndsWarning = useSignInEndsWarning(props.liveProvider); // Antigravity's and Grok's sign-in follow their method: a browser sign-in, @@ -817,7 +829,7 @@ function ProviderAccountSignInSection(props: { ? needsSignIn ? methodStep.label : methodCopy.again - : needsSignIn + : needsSignIn || notSignedInOnGateway ? "Sign in" : "Sign in again" } @@ -878,6 +890,10 @@ function ProviderAccountSignInSection(props: { /> )} + {props.liveProvider?.enabled !== false && props.liveProvider ? ( + + ) : null} + {props.liveProvider?.enabled !== false && props.liveProvider ? ( ) : null} + {props.liveProvider?.enabled !== false && props.liveProvider ? ( + + ) : null} + {signOut && props.liveProvider?.auth.status === "authenticated" ? ( + {/* Ahead of the plan and workspace, which a narrow row cuts off first. */} + {liveProvider?.auth.securityNotice ? ( + · Security notice + ) : null} {authenticatedDetail ? · {authenticatedDetail} : null} {workspaceName ? · {workspaceName} : null} + {runsOnText ? · {runsOnText} : null} {signInEndsWarning ? ( · {signInEndsShortText(signInEndsWarning)} @@ -1690,6 +1717,10 @@ export function ProviderInstanceCard({ ) : ( {summary.headline} + {/* A sign-in with no email (an API key) beside a gateway: the headline names the key. */} + {runsOnText && summary.headline !== runsOnText ? ( + · {runsOnText} + ) : null} {diagnosis ? ( · {isCommunityAgent ? diagnosis : } diff --git a/apps/web/src/components/settings/agentStatus.ts b/apps/web/src/components/settings/agentStatus.ts index d5e92d5d5..7ccb1cbac 100644 --- a/apps/web/src/components/settings/agentStatus.ts +++ b/apps/web/src/components/settings/agentStatus.ts @@ -142,7 +142,10 @@ export function agentStatusLine(input: { return `Not signed in · ${needs}`; case "ready": { const authLabel = snapshot?.auth.label ?? snapshot?.auth.type ?? null; - return authLabel ? `Signed in · ${authLabel}` : "Ready"; + if (authLabel) return `Signed in · ${authLabel}`; + // No sign-in, and none needed: its chats run on a gateway from its own config. + const modelProvider = snapshot?.auth.modelProvider?.name; + return modelProvider ? `Runs on ${modelProvider}` : "Ready"; } case "problem": return status.detail ? `${status.headline}. ${status.detail}` : status.headline; diff --git a/apps/web/src/components/settings/providerStatus.ts b/apps/web/src/components/settings/providerStatus.ts index e130c1e87..a4c2ad0c1 100644 --- a/apps/web/src/components/settings/providerStatus.ts +++ b/apps/web/src/components/settings/providerStatus.ts @@ -105,6 +105,14 @@ export function getProviderSummary(provider: ServerProvider | undefined) { detail: provider.message ?? "The provider failed its startup checks.", }; } + if (provider.auth.modelProvider) { + // Ready on a gateway from the agent's own config: there is no sign-in of + // ours to verify, and saying one "could not be verified" would mislead. + return { + headline: `Runs on ${provider.auth.modelProvider.name}`, + detail: provider.message ?? null, + }; + } return { headline: "Available", detail: provider.message ?? "Installed and ready, but authentication could not be verified.", diff --git a/docs/providers/claude.md b/docs/providers/claude.md index 3c69986a6..8b79d6b2c 100644 --- a/docs/providers/claude.md +++ b/docs/providers/claude.md @@ -66,6 +66,26 @@ turn as usual. Threadlines offers `Sign in` only when the message says the sign-in itself was rejected. A `403` means the service knew the account and refused the request, so signing in again would not help. +## When Claude Code Won't Start + +Sometimes Claude Code refuses to start at all: a settings file that is not valid JSON, a proxy +address it cannot read, a version too old for Anthropic, an organization that blocks the account. +Claude Code says why before it exits, and the chat shows those words once, as the reason the turn +failed. For a broken settings file that includes the file's path and where its backup is. + +- Threadlines does not keep retrying: the same start would fail the same way. Fix what the + message names, then `Retry`. +- Threadlines offers `Sign in` only when the reason is a sign-in that ended (a gateway sign-in, or + an organization that refused the account). +- A Claude Code too old to report its reason still shows `Claude Code process exited with code 1`. + +## Subagent Reports That Arrive Together + +Since Claude Code 2.1.321, reports from background subagents that are waiting at the same moment +are answered in one reply. Claude Code still marks each report as handled on its own. Threadlines +counts only the reply as a turn, so a message you send while reports are landing keeps its own +turn, and the suggested next message stays with the reply it belongs to. + ## Usage Numbers And The Normal Sign-In Threadlines asks Claude Code for the 5h, Weekly and per-model numbers, the same ones its `/usage` diff --git a/docs/providers/codex.md b/docs/providers/codex.md index d208880cb..3beb096ee 100644 --- a/docs/providers/codex.md +++ b/docs/providers/codex.md @@ -73,6 +73,34 @@ It needs Codex 0.167 or later; an older Codex shows no `Workspace` setting. - A chat whose data the old workspace keeps in another region may not continue in the new one. Start a new thread for it. +## Codex On A Gateway Or Another Model Provider + +Codex can send its requests somewhere other than OpenAI: a company gateway, or any provider set as +`model_provider` in Codex's own `config.toml`. When it does, the Codex row says `Runs on` and the +provider's name, and `Account & Sign-in` has a `Model provider` line. It needs Codex 0.168 or +later. + +- Threadlines only reads this. Change the provider in Codex's config, or with Codex in your + terminal. +- A ChatGPT sign-in can sit beside a gateway. Its email, workspace and `Sign out` stay on the row. +- With no account at all the row reads `No sign-in needed`: Codex is ready on the gateway alone. + Threadlines can't check the gateway's key, so a wrong key shows up when a chat fails. +- Codex lists OpenAI's models whatever the provider. If your gateway serves other models, add + their ids under the Codex row's `Models` as custom models. +- Titles and commit messages written by Codex still go to OpenAI, not the gateway. Pick another + agent for them in `Settings` if Codex has no OpenAI sign-in. + +## Security Notices From OpenAI + +OpenAI can ask a ChatGPT account to do something about its security, such as turning on two-step +sign-in. When it does, the Codex row says `Security notice`, and `Account & Sign-in` shows OpenAI's +words with a button to the page. It needs Codex 0.169 or later. + +- The button only opens pages on `openai.com` and `chatgpt.com`. A notice that links anywhere else + shows its words without a button. +- The notice is for the signed-in user and workspace. Switching workspace or signing out clears it. +- It goes away once OpenAI stops sending it, at the next status check. + ## Suggested Next Message After Codex replies to a message you sent, the message box shows a suggestion of what you might diff --git a/packages/contracts/src/server.ts b/packages/contracts/src/server.ts index 8bd6ac7cd..da6eac768 100644 --- a/packages/contracts/src/server.ts +++ b/packages/contracts/src/server.ts @@ -124,6 +124,36 @@ export const ServerProviderWorkspace = Schema.Struct({ }); export type ServerProviderWorkspace = typeof ServerProviderWorkspace.Type; +/** + * The service an agent sends its requests to when that is not its maker's own: + * a gateway the user set up in the agent's configuration (Codex's + * `model_provider`). It says where chats run, not who is signed in: a sign-in + * can sit beside it unused, so the account fields stay as they are. + */ +export const ServerProviderModelProvider = Schema.Struct({ + id: TrimmedNonEmptyString, + name: TrimmedNonEmptyString, +}); +export type ServerProviderModelProvider = typeof ServerProviderModelProvider.Type; + +/** + * Something the provider's own service asks the signed-in person to do about + * their account's security, in its words (Codex's `account/securitySetup/read`). + * `action.url` is always an https page on the provider's own site: the server + * drops any other before it gets here. + */ +export const ServerProviderSecurityNotice = Schema.Struct({ + title: TrimmedNonEmptyString, + description: Schema.optional(TrimmedNonEmptyString), + action: Schema.optional( + Schema.Struct({ + label: TrimmedNonEmptyString, + url: TrimmedNonEmptyString, + }), + ), +}); +export type ServerProviderSecurityNotice = typeof ServerProviderSecurityNotice.Type; + export const ServerProviderAuth = Schema.Struct({ status: ServerProviderAuthStatus, type: Schema.optional(TrimmedNonEmptyString), @@ -134,6 +164,9 @@ export const ServerProviderAuth = Schema.Struct({ signInEnds: Schema.optional(ServerProviderSignInEnds), /** The workspaces this sign-in can switch between (the `switch-workspace` sign-in flow). */ workspaces: Schema.optional(Schema.Array(ServerProviderWorkspace)), + /** Set only when chats run somewhere other than the provider's own service. */ + modelProvider: Schema.optional(ServerProviderModelProvider), + securityNotice: Schema.optional(ServerProviderSecurityNotice), }); export type ServerProviderAuth = typeof ServerProviderAuth.Type; diff --git a/packages/effect-codex-app-server/scripts/generate.ts b/packages/effect-codex-app-server/scripts/generate.ts index 113d16fb6..f4dc65a5d 100644 --- a/packages/effect-codex-app-server/scripts/generate.ts +++ b/packages/effect-codex-app-server/scripts/generate.ts @@ -12,7 +12,7 @@ import * as Schema from "effect/Schema"; import * as Stream from "effect/Stream"; import { ChildProcess, ChildProcessSpawner } from "effect/process"; -const CODEX_PROTOCOL_VERSION = "0.167.0"; +const CODEX_PROTOCOL_VERSION = "0.169.0"; const UPSTREAM_REF = `rust-v${CODEX_PROTOCOL_VERSION}`; const CODEX_SCHEMA_BINARY_ENV = "THREADLINES_CODEX_SCHEMA_BINARY"; /** @@ -611,6 +611,7 @@ function resolveResponseTypeName( "account/gatewayOAuth/read": "GatewayOAuthReadResponse", "account/logout": "LogoutAccountResponse", "account/rateLimits/read": "GetAccountRateLimitsResponse", + "account/securitySetup/read": "GetAccountSecuritySetupResponse", "account/usage/read": "GetAccountTokenUsageResponse", "account/workspaceMessages/read": "GetWorkspaceMessagesResponse", "config/batchWrite": "ConfigWriteResponse", 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 73c327519..c915a46b2 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: rust-v0.167.0 +// Upstream protocol ref: rust-v0.169.0 import * as CodexSchema from "./schema.gen.ts"; @@ -74,6 +74,7 @@ export const CLIENT_REQUEST_METHODS = { "thread/items/read": "thread/items/read", "thread/guardianReview": "thread/guardianReview", "thread/inject_items": "thread/inject_items", + "thread/prepareApprovedPlan": "thread/prepareApprovedPlan", "skills/list": "skills/list", "skills/extraRoots/set": "skills/extraRoots/set", "hooks/list": "hooks/list", @@ -122,6 +123,8 @@ export const CLIENT_REQUEST_METHODS = { "account/gatewayOAuth/read": "account/gatewayOAuth/read", "account/gatewayOAuth/login": "account/gatewayOAuth/login", "account/gatewayOAuth/cancel": "account/gatewayOAuth/cancel", + "modelProvider/list": "modelProvider/list", + "modelProvider/config/write": "modelProvider/config/write", "modelProvider/capabilities/read": "modelProvider/capabilities/read", "experimentalFeature/list": "experimentalFeature/list", "permissionProfile/list": "permissionProfile/list", @@ -156,6 +159,7 @@ export const CLIENT_REQUEST_METHODS = { "accountSession/list": "accountSession/list", "accountSession/switch": "accountSession/switch", "account/logout": "account/logout", + "account/securitySetup/read": "account/securitySetup/read", "account/rateLimits/read": "account/rateLimits/read", "account/rateLimitResetCredit/consume": "account/rateLimitResetCredit/consume", "account/usage/read": "account/usage/read", @@ -374,6 +378,7 @@ export interface ClientRequestParamsByMethod { readonly "thread/items/read": typeof CodexSchema.V2ThreadItemsReadParams.Type; readonly "thread/guardianReview": typeof CodexSchema.V2ThreadGuardianReviewParams.Type; readonly "thread/inject_items": typeof CodexSchema.V2ThreadInjectItemsParams.Type; + readonly "thread/prepareApprovedPlan": typeof CodexSchema.V2ThreadPrepareApprovedPlanParams.Type; readonly "skills/list": typeof CodexSchema.V2SkillsListParams.Type; readonly "skills/extraRoots/set": typeof CodexSchema.V2SkillsExtraRootsSetParams.Type; readonly "hooks/list": typeof CodexSchema.V2HooksListParams.Type; @@ -419,9 +424,11 @@ export interface ClientRequestParamsByMethod { readonly "thread/realtime/listVoices": typeof CodexSchema.V2ThreadRealtimeListVoicesParams.Type; readonly "review/start": typeof CodexSchema.V2ReviewStartParams.Type; readonly "model/list": typeof CodexSchema.V2ModelListParams.Type; - readonly "account/gatewayOAuth/read": undefined; - readonly "account/gatewayOAuth/login": undefined; + readonly "account/gatewayOAuth/read": typeof CodexSchema.V2NullableGatewayOAuthReadParams.Type; + readonly "account/gatewayOAuth/login": typeof CodexSchema.V2NullableGatewayOAuthLoginParams.Type; readonly "account/gatewayOAuth/cancel": undefined; + readonly "modelProvider/list": typeof CodexSchema.V2ModelProviderListParams.Type; + readonly "modelProvider/config/write": typeof CodexSchema.V2ModelProviderConfigWriteParams.Type; readonly "modelProvider/capabilities/read": typeof CodexSchema.V2ModelProviderCapabilitiesReadParams.Type; readonly "experimentalFeature/list": typeof CodexSchema.V2ExperimentalFeatureListParams.Type; readonly "permissionProfile/list": typeof CodexSchema.V2PermissionProfileListParams.Type; @@ -456,6 +463,7 @@ export interface ClientRequestParamsByMethod { readonly "accountSession/list": typeof CodexSchema.V2AccountSessionsListParams.Type; readonly "accountSession/switch": typeof CodexSchema.V2AccountSessionsSwitchParams.Type; readonly "account/logout": undefined; + readonly "account/securitySetup/read": undefined; readonly "account/rateLimits/read": typeof CodexSchema.V2NullableGetAccountRateLimitsParams.Type; readonly "account/rateLimitResetCredit/consume": typeof CodexSchema.V2ConsumeAccountRateLimitResetCreditParams.Type; readonly "account/usage/read": typeof CodexSchema.V2NullableGetAccountTokenUsageParams.Type; @@ -560,6 +568,7 @@ export interface ClientRequestResponsesByMethod { readonly "thread/items/read": typeof CodexSchema.V2ThreadItemsReadResponse.Type; readonly "thread/guardianReview": typeof CodexSchema.V2ThreadGuardianReviewResponse.Type; readonly "thread/inject_items": typeof CodexSchema.V2ThreadInjectItemsResponse.Type; + readonly "thread/prepareApprovedPlan": typeof CodexSchema.V2ThreadPrepareApprovedPlanResponse.Type; readonly "skills/list": typeof CodexSchema.V2SkillsListResponse.Type; readonly "skills/extraRoots/set": typeof CodexSchema.V2SkillsExtraRootsSetResponse.Type; readonly "hooks/list": typeof CodexSchema.V2HooksListResponse.Type; @@ -608,6 +617,8 @@ export interface ClientRequestResponsesByMethod { readonly "account/gatewayOAuth/read": typeof CodexSchema.V2GatewayOAuthReadResponse.Type; readonly "account/gatewayOAuth/login": typeof CodexSchema.V2GatewayOAuthLoginResponse.Type; readonly "account/gatewayOAuth/cancel": typeof CodexSchema.V2GatewayOAuthCancelResponse.Type; + readonly "modelProvider/list": typeof CodexSchema.V2ModelProviderListResponse.Type; + readonly "modelProvider/config/write": typeof CodexSchema.V2ModelProviderConfigWriteResponse.Type; readonly "modelProvider/capabilities/read": typeof CodexSchema.V2ModelProviderCapabilitiesReadResponse.Type; readonly "experimentalFeature/list": typeof CodexSchema.V2ExperimentalFeatureListResponse.Type; readonly "permissionProfile/list": typeof CodexSchema.V2PermissionProfileListResponse.Type; @@ -642,6 +653,7 @@ export interface ClientRequestResponsesByMethod { readonly "accountSession/list": typeof CodexSchema.V2AccountSessionsResponse.Type; readonly "accountSession/switch": typeof CodexSchema.V2AccountSessionsSwitchResponse.Type; readonly "account/logout": typeof CodexSchema.V2LogoutAccountResponse.Type; + readonly "account/securitySetup/read": typeof CodexSchema.V2GetAccountSecuritySetupResponse.Type; readonly "account/rateLimits/read": typeof CodexSchema.V2GetAccountRateLimitsResponse.Type; readonly "account/rateLimitResetCredit/consume": typeof CodexSchema.V2ConsumeAccountRateLimitResetCreditResponse.Type; readonly "account/usage/read": typeof CodexSchema.V2GetAccountTokenUsageResponse.Type; @@ -869,6 +881,7 @@ export const CLIENT_REQUEST_PARAMS = { "thread/items/read": CodexSchema.V2ThreadItemsReadParams, "thread/guardianReview": CodexSchema.V2ThreadGuardianReviewParams, "thread/inject_items": CodexSchema.V2ThreadInjectItemsParams, + "thread/prepareApprovedPlan": CodexSchema.V2ThreadPrepareApprovedPlanParams, "skills/list": CodexSchema.V2SkillsListParams, "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetParams, "hooks/list": CodexSchema.V2HooksListParams, @@ -914,9 +927,11 @@ export const CLIENT_REQUEST_PARAMS = { "thread/realtime/listVoices": CodexSchema.V2ThreadRealtimeListVoicesParams, "review/start": CodexSchema.V2ReviewStartParams, "model/list": CodexSchema.V2ModelListParams, - "account/gatewayOAuth/read": undefined, - "account/gatewayOAuth/login": undefined, + "account/gatewayOAuth/read": CodexSchema.V2NullableGatewayOAuthReadParams, + "account/gatewayOAuth/login": CodexSchema.V2NullableGatewayOAuthLoginParams, "account/gatewayOAuth/cancel": undefined, + "modelProvider/list": CodexSchema.V2ModelProviderListParams, + "modelProvider/config/write": CodexSchema.V2ModelProviderConfigWriteParams, "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadParams, "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListParams, "permissionProfile/list": CodexSchema.V2PermissionProfileListParams, @@ -951,6 +966,7 @@ export const CLIENT_REQUEST_PARAMS = { "accountSession/list": CodexSchema.V2AccountSessionsListParams, "accountSession/switch": CodexSchema.V2AccountSessionsSwitchParams, "account/logout": undefined, + "account/securitySetup/read": undefined, "account/rateLimits/read": CodexSchema.V2NullableGetAccountRateLimitsParams, "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditParams, "account/usage/read": CodexSchema.V2NullableGetAccountTokenUsageParams, @@ -1056,6 +1072,7 @@ export const CLIENT_REQUEST_RESPONSES = { "thread/items/read": CodexSchema.V2ThreadItemsReadResponse, "thread/guardianReview": CodexSchema.V2ThreadGuardianReviewResponse, "thread/inject_items": CodexSchema.V2ThreadInjectItemsResponse, + "thread/prepareApprovedPlan": CodexSchema.V2ThreadPrepareApprovedPlanResponse, "skills/list": CodexSchema.V2SkillsListResponse, "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetResponse, "hooks/list": CodexSchema.V2HooksListResponse, @@ -1104,6 +1121,8 @@ export const CLIENT_REQUEST_RESPONSES = { "account/gatewayOAuth/read": CodexSchema.V2GatewayOAuthReadResponse, "account/gatewayOAuth/login": CodexSchema.V2GatewayOAuthLoginResponse, "account/gatewayOAuth/cancel": CodexSchema.V2GatewayOAuthCancelResponse, + "modelProvider/list": CodexSchema.V2ModelProviderListResponse, + "modelProvider/config/write": CodexSchema.V2ModelProviderConfigWriteResponse, "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadResponse, "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListResponse, "permissionProfile/list": CodexSchema.V2PermissionProfileListResponse, @@ -1139,6 +1158,7 @@ export const CLIENT_REQUEST_RESPONSES = { "accountSession/list": CodexSchema.V2AccountSessionsResponse, "accountSession/switch": CodexSchema.V2AccountSessionsSwitchResponse, "account/logout": CodexSchema.V2LogoutAccountResponse, + "account/securitySetup/read": CodexSchema.V2GetAccountSecuritySetupResponse, "account/rateLimits/read": CodexSchema.V2GetAccountRateLimitsResponse, "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditResponse, "account/usage/read": CodexSchema.V2GetAccountTokenUsageResponse, 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 76fec9b31..1fdd242c6 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: rust-v0.167.0 +// Upstream protocol ref: rust-v0.169.0 import * as CodexSchema from "./schema.gen.ts"; @@ -117,6 +117,7 @@ export const v2 = { GetAccountParams: CodexSchema.V2GetAccountParams, GetAccountRateLimitsResponse: CodexSchema.V2GetAccountRateLimitsResponse, GetAccountResponse: CodexSchema.V2GetAccountResponse, + GetAccountSecuritySetupResponse: CodexSchema.V2GetAccountSecuritySetupResponse, GetAccountTokenUsageResponse: CodexSchema.V2GetAccountTokenUsageResponse, GetWorkspaceMessagesResponse: CodexSchema.V2GetWorkspaceMessagesResponse, GuardianWarningNotification: CodexSchema.V2GuardianWarningNotification, @@ -165,10 +166,16 @@ export const v2 = { ModelListResponse: CodexSchema.V2ModelListResponse, ModelProviderCapabilitiesReadParams: CodexSchema.V2ModelProviderCapabilitiesReadParams, ModelProviderCapabilitiesReadResponse: CodexSchema.V2ModelProviderCapabilitiesReadResponse, + ModelProviderConfigWriteParams: CodexSchema.V2ModelProviderConfigWriteParams, + ModelProviderConfigWriteResponse: CodexSchema.V2ModelProviderConfigWriteResponse, ModelProviderError: CodexSchema.V2ModelProviderError, + ModelProviderListParams: CodexSchema.V2ModelProviderListParams, + ModelProviderListResponse: CodexSchema.V2ModelProviderListResponse, ModelReroutedNotification: CodexSchema.V2ModelReroutedNotification, ModelSafetyBufferingUpdatedNotification: CodexSchema.V2ModelSafetyBufferingUpdatedNotification, ModelVerificationNotification: CodexSchema.V2ModelVerificationNotification, + NullableGatewayOAuthLoginParams: CodexSchema.V2NullableGatewayOAuthLoginParams, + NullableGatewayOAuthReadParams: CodexSchema.V2NullableGatewayOAuthReadParams, NullableGetAccountRateLimitsParams: CodexSchema.V2NullableGetAccountRateLimitsParams, NullableGetAccountTokenUsageParams: CodexSchema.V2NullableGetAccountTokenUsageParams, NullableRemoteControlDisableParams: CodexSchema.V2NullableRemoteControlDisableParams, @@ -325,6 +332,8 @@ export const v2 = { ThreadPredictionRequestParams: CodexSchema.V2ThreadPredictionRequestParams, ThreadPredictionRequestResponse: CodexSchema.V2ThreadPredictionRequestResponse, ThreadPredictionUpdatedNotification: CodexSchema.V2ThreadPredictionUpdatedNotification, + ThreadPrepareApprovedPlanParams: CodexSchema.V2ThreadPrepareApprovedPlanParams, + ThreadPrepareApprovedPlanResponse: CodexSchema.V2ThreadPrepareApprovedPlanResponse, ThreadProjectUpdatedNotification: CodexSchema.V2ThreadProjectUpdatedNotification, ThreadQueueAddParams: CodexSchema.V2ThreadQueueAddParams, ThreadQueueAddResponse: CodexSchema.V2ThreadQueueAddResponse, 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 90d0e34bc..6f3aef40d 100644 --- a/packages/effect-codex-app-server/src/_generated/schema.gen.ts +++ b/packages/effect-codex-app-server/src/_generated/schema.gen.ts @@ -1,5 +1,5 @@ // This file is generated by the effect-codex-app-server package. Do not edit manually. -// Upstream protocol ref: rust-v0.167.0 +// Upstream protocol ref: rust-v0.169.0 import * as Schema from "effect/Schema"; @@ -264,6 +264,9 @@ export const ClientRequest__ThreadReadStateOperation = Schema.Union([Schema.Stru 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__ThreadItemOutputDeferral = { readonly "commandExecution"?: boolean, readonly "mcpToolCall"?: boolean } +export const ClientRequest__ThreadItemOutputDeferral = Schema.Struct({ "commandExecution": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Defer nonempty output from successful commands." })), "mcpToolCall": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Defer nonempty plain-text results from successful MCP tool calls." })) }).annotate({ "identifier": "ClientRequest__ThreadItemOutputDeferral" }) + export type ClientRequest__ThreadItemsReadParams = { readonly "itemIds": ReadonlyArray, readonly "threadId": string, readonly "turnId": string } export const ClientRequest__ThreadItemsReadParams = Schema.Struct({ "itemIds": Schema.Array(Schema.String).annotate({ "description": "Item IDs to retrieve. Supply 1 to 100 IDs." }), "threadId": Schema.String, "turnId": Schema.String }).annotate({ "description": "EXPERIMENTAL - retrieve a bounded set of persisted items from one turn.", "identifier": "ClientRequest__ThreadItemsReadParams" }) @@ -273,6 +276,9 @@ export const ClientRequest__ThreadGuardianReviewParams = Schema.Struct({ "thread export type ClientRequest__ThreadInjectItemsParams = { readonly "items": ReadonlyArray, readonly "threadId": string } 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." }), "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadInjectItemsParams" }) +export type ClientRequest__ThreadPrepareApprovedPlanParams = { readonly "attachmentPath"?: string | null, readonly "markdown": string, readonly "threadId": string } +export const ClientRequest__ThreadPrepareApprovedPlanParams = Schema.Struct({ "attachmentPath": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Absolute path to the optional app-server copy of the plan." }), Schema.Null])), "markdown": Schema.String, "threadId": Schema.String }).annotate({ "description": "Prepare an approved plan for the first turn of a fresh thread.", "identifier": "ClientRequest__ThreadPrepareApprovedPlanParams" }) + 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__SkillsListParams" }) @@ -384,8 +390,23 @@ export const ClientRequest__ReviewDelivery = Schema.Literal("inline").annotate({ export type ClientRequest__ReviewTarget = { readonly "type": "uncommittedChanges" } | { readonly "branch": string, readonly "type": "baseBranch" } | { readonly "sha": string, readonly "title"?: string | null, readonly "type": "commit" } | { readonly "instructions": string, readonly "type": "custom" } export const ClientRequest__ReviewTarget = Schema.Union([Schema.Struct({ "type": Schema.Literal("uncommittedChanges").annotate({ "title": "UncommittedChangesReviewTargetType" }) }).annotate({ "title": "UncommittedChangesReviewTarget", "description": "Review the working tree: staged, unstaged, and untracked files." }), Schema.Struct({ "branch": Schema.String, "type": Schema.Literal("baseBranch").annotate({ "title": "BaseBranchReviewTargetType" }) }).annotate({ "title": "BaseBranchReviewTarget", "description": "Review changes between the current branch and the given base branch." }), Schema.Struct({ "sha": Schema.String, "title": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional human-readable label (e.g., commit subject) for UIs." }), Schema.Null])), "type": Schema.Literal("commit").annotate({ "title": "CommitReviewTargetType" }) }).annotate({ "title": "CommitReviewTarget", "description": "Review the changes introduced by a specific commit." }), Schema.Struct({ "instructions": Schema.String, "type": Schema.Literal("custom").annotate({ "title": "CustomReviewTargetType" }) }).annotate({ "title": "CustomReviewTarget", "description": "Arbitrary instructions, equivalent to the old free-form prompt." })], { mode: "oneOf" }).annotate({ "identifier": "ClientRequest__ReviewTarget" }) -export type ClientRequest__ModelListParams = { readonly "cursor"?: string | null, readonly "includeHidden"?: boolean | null, readonly "limit"?: number | null } -export const ClientRequest__ModelListParams = Schema.Struct({ "cursor": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque pagination cursor returned by a previous call." }), 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])), "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__ModelListParams = { readonly "cursor"?: string | null, readonly "includeHidden"?: boolean | null, readonly "limit"?: number | null, readonly "modelProvider"?: string | null } +export const ClientRequest__ModelListParams = Schema.Struct({ "cursor": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque pagination cursor returned by a previous call." }), 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])), "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])), "modelProvider": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "List models for this configured provider instead of the app-server default." }), Schema.Null])) }).annotate({ "identifier": "ClientRequest__ModelListParams" }) + +export type ClientRequest__GatewayOAuthReadParams = { readonly "modelProvider"?: string | null } +export const ClientRequest__GatewayOAuthReadParams = Schema.Struct({ "modelProvider": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Defaults to the current provider when omitted." }), Schema.Null])) }).annotate({ "description": "Read credential readiness for a configured provider without starting browser login.", "identifier": "ClientRequest__GatewayOAuthReadParams" }) + +export type ClientRequest__GatewayOAuthLoginParams = { readonly "deviceAuth"?: boolean, readonly "modelProvider"?: string | null } +export const ClientRequest__GatewayOAuthLoginParams = Schema.Struct({ "deviceAuth": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Select device authorization when the server advertises support for it." })), "modelProvider": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Defaults to the current provider when omitted." }), Schema.Null])) }).annotate({ "description": "Authorize a configured provider without changing the default or any thread's provider.", "identifier": "ClientRequest__GatewayOAuthLoginParams" }) + +export type ClientRequest__ModelProviderListParams = { readonly [x: string]: Schema.Json } +export const ClientRequest__ModelProviderListParams = Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({ "identifier": "ClientRequest__ModelProviderListParams" }) + +export type ClientRequest__BedrockProviderId = "amazon-bedrock" | "amazon-bedrock-runtime" +export const ClientRequest__BedrockProviderId = Schema.Literals(["amazon-bedrock", "amazon-bedrock-runtime"]).annotate({ "identifier": "ClientRequest__BedrockProviderId" }) + +export type ClientRequest__GcpProviderId = "gcp" +export const ClientRequest__GcpProviderId = Schema.Literal("gcp").annotate({ "identifier": "ClientRequest__GcpProviderId" }) export type ClientRequest__ModelProviderCapabilitiesReadParams = { readonly [x: string]: Schema.Json } export const ClientRequest__ModelProviderCapabilitiesReadParams = Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({ "identifier": "ClientRequest__ModelProviderCapabilitiesReadParams" }) @@ -726,6 +747,9 @@ export const ServerNotification__AgentMessageDelivery = Schema.Literal("async"). 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().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__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const ServerNotification__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "ServerNotification__AgentMessageDisplay" }) + export type ServerNotification__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -1275,6 +1299,9 @@ export const V2ConfigReadResponse__AppToolApproval = Schema.Literals(["auto", "p export type V2ConfigReadResponse__AllowDenyRequirement = "allow" | "deny" export const V2ConfigReadResponse__AllowDenyRequirement = Schema.Literals(["allow", "deny"]).annotate({ "identifier": "V2ConfigReadResponse__AllowDenyRequirement" }) +export type V2ConfigReadResponse__WebSearchProvider = "standalone" | "search_mcp" +export const V2ConfigReadResponse__WebSearchProvider = Schema.Literals(["standalone", "search_mcp"]).annotate({ "description": "Provider preference selected by the resolved model catalog entry.", "identifier": "V2ConfigReadResponse__WebSearchProvider" }) + 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" }) @@ -1533,6 +1560,9 @@ export const V2FsWriteFileParams__AbsolutePathBuf = Schema.String.annotate({ "de export type V2GatewayOAuthChangedNotification__GatewayOAuthStatus = "notReady" | "started" | "succeeded" | "failed" export const V2GatewayOAuthChangedNotification__GatewayOAuthStatus = Schema.Literals(["notReady", "started", "succeeded", "failed"]).annotate({ "identifier": "V2GatewayOAuthChangedNotification__GatewayOAuthStatus" }) +export type V2GatewayOAuthLoginResponse__GatewayOAuthPrompt = { readonly "loginId": string, readonly "userCode": string, readonly "verificationUrl": string } +export const V2GatewayOAuthLoginResponse__GatewayOAuthPrompt = Schema.Struct({ "loginId": Schema.String, "userCode": Schema.String, "verificationUrl": Schema.String }).annotate({ "identifier": "V2GatewayOAuthLoginResponse__GatewayOAuthPrompt" }) + export type V2GatewayOAuthReadResponse__GatewayOAuthStatus = "notReady" | "started" | "succeeded" | "failed" export const V2GatewayOAuthReadResponse__GatewayOAuthStatus = Schema.Literals(["notReady", "started", "succeeded", "failed"]).annotate({ "identifier": "V2GatewayOAuthReadResponse__GatewayOAuthStatus" }) @@ -1563,6 +1593,9 @@ export const V2GetAccountResponse__PlanType = Schema.Union([Schema.Literals(["fr export type V2GetAccountResponse__AccountRoutingOverride = "NO_CONSTRAINT" | "us" | "us_cr" | string export const V2GetAccountResponse__AccountRoutingOverride = Schema.Union([Schema.Literals(["NO_CONSTRAINT", "us", "us_cr"]).annotate({ "description": "Backend routing policy. Wire values match the accounts/check contract." }), Schema.String]).annotate({ "description": "Backend routing policy. Wire values match the accounts/check contract.", "identifier": "V2GetAccountResponse__AccountRoutingOverride" }) +export type V2GetAccountSecuritySetupResponse__AccountSecuritySetupAction = { readonly "label": string, readonly "url": string } +export const V2GetAccountSecuritySetupResponse__AccountSecuritySetupAction = Schema.Struct({ "label": Schema.String, "url": Schema.String }).annotate({ "identifier": "V2GetAccountSecuritySetupResponse__AccountSecuritySetupAction" }) + export type V2GetAccountTokenUsageResponse__AccountTokenUsageDailyBucket = { readonly "startDate": string, readonly "tokens": number } export const V2GetAccountTokenUsageResponse__AccountTokenUsageDailyBucket = Schema.Struct({ "startDate": Schema.String, "tokens": Schema.Number.annotate({ "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })) }).annotate({ "identifier": "V2GetAccountTokenUsageResponse__AccountTokenUsageDailyBucket" }) @@ -1653,6 +1686,9 @@ export const V2ItemCompletedNotification__AgentMessageDelivery = Schema.Literal( 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__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ItemCompletedNotification__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ItemCompletedNotification__AgentMessageDisplay" }) + export type V2ItemCompletedNotification__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -1791,6 +1827,9 @@ export const V2ItemStartedNotification__AgentMessageDelivery = Schema.Literal("a 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__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ItemStartedNotification__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ItemStartedNotification__AgentMessageDisplay" }) + export type V2ItemStartedNotification__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -1932,12 +1971,30 @@ export const V2ModelListResponse__ModelServiceTier = Schema.Struct({ "descriptio 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])) }).annotate({ "identifier": "V2ModelListResponse__ModelUpgradeInfo" }) +export type V2ModelProviderConfigWriteParams__BedrockProviderId = "amazon-bedrock" | "amazon-bedrock-runtime" +export const V2ModelProviderConfigWriteParams__BedrockProviderId = Schema.Literals(["amazon-bedrock", "amazon-bedrock-runtime"]).annotate({ "identifier": "V2ModelProviderConfigWriteParams__BedrockProviderId" }) + +export type V2ModelProviderConfigWriteParams__GcpProviderId = "gcp" +export const V2ModelProviderConfigWriteParams__GcpProviderId = Schema.Literal("gcp").annotate({ "identifier": "V2ModelProviderConfigWriteParams__GcpProviderId" }) + +export type V2ModelProviderConfigWriteResponse__GatewayAuth = { readonly "mode": "none" } | { readonly "envKey": string, readonly "mode": "environmentVariable" } | { readonly "envKey"?: string | null, readonly "mode": "externallyConfigured" } +export const V2ModelProviderConfigWriteResponse__GatewayAuth = Schema.Union([Schema.Struct({ "mode": Schema.Literal("none").annotate({ "title": "NoneGatewayAuthMode" }) }).annotate({ "title": "NoneGatewayAuth" }), Schema.Struct({ "envKey": Schema.String, "mode": Schema.Literal("environmentVariable") }), Schema.Struct({ "envKey": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "mode": Schema.Literal("externallyConfigured").annotate({ "title": "ModeGatewayAuthMode" }) }).annotate({ "title": "ModeGatewayAuth", "description": "Authentication is configured outside the gateway form. Preserve it on edits." })], { mode: "oneOf" }).annotate({ "identifier": "V2ModelProviderConfigWriteResponse__GatewayAuth" }) + +export type V2ModelProviderListResponse__GatewayAuth = { readonly "mode": "none" } | { readonly "envKey": string, readonly "mode": "environmentVariable" } | { readonly "envKey"?: string | null, readonly "mode": "externallyConfigured" } +export const V2ModelProviderListResponse__GatewayAuth = Schema.Union([Schema.Struct({ "mode": Schema.Literal("none").annotate({ "title": "NoneGatewayAuthMode" }) }).annotate({ "title": "NoneGatewayAuth" }), Schema.Struct({ "envKey": Schema.String, "mode": Schema.Literal("environmentVariable") }), Schema.Struct({ "envKey": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "mode": Schema.Literal("externallyConfigured").annotate({ "title": "ModeGatewayAuthMode" }) }).annotate({ "title": "ModeGatewayAuth", "description": "Authentication is configured outside the gateway form. Preserve it on edits." })], { mode: "oneOf" }).annotate({ "identifier": "V2ModelProviderListResponse__GatewayAuth" }) + export type V2ModelReroutedNotification__ModelRerouteReason = "highRiskCyberActivity" export const V2ModelReroutedNotification__ModelRerouteReason = Schema.Literal("highRiskCyberActivity").annotate({ "identifier": "V2ModelReroutedNotification__ModelRerouteReason" }) export type V2ModelVerificationNotification__ModelVerification = "trustedAccessForCyber" export const V2ModelVerificationNotification__ModelVerification = Schema.Literal("trustedAccessForCyber").annotate({ "identifier": "V2ModelVerificationNotification__ModelVerification" }) +export type V2NullableGatewayOAuthLoginParams__GatewayOAuthLoginParams = { readonly "deviceAuth"?: boolean, readonly "modelProvider"?: string | null } +export const V2NullableGatewayOAuthLoginParams__GatewayOAuthLoginParams = Schema.Struct({ "deviceAuth": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Select device authorization when the server advertises support for it." })), "modelProvider": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Defaults to the current provider when omitted." }), Schema.Null])) }).annotate({ "description": "Authorize a configured provider without changing the default or any thread's provider.", "identifier": "V2NullableGatewayOAuthLoginParams__GatewayOAuthLoginParams" }) + +export type V2NullableGatewayOAuthReadParams__GatewayOAuthReadParams = { readonly "modelProvider"?: string | null } +export const V2NullableGatewayOAuthReadParams__GatewayOAuthReadParams = Schema.Struct({ "modelProvider": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Defaults to the current provider when omitted." }), Schema.Null])) }).annotate({ "description": "Read credential readiness for a configured provider without starting browser login.", "identifier": "V2NullableGatewayOAuthReadParams__GatewayOAuthReadParams" }) + 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" }) @@ -2298,6 +2355,9 @@ export const V2ReviewStartResponse__AgentMessageDelivery = Schema.Literal("async export type V2ReviewStartResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ReviewStartResponse__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": "V2ReviewStartResponse__MemoryCitationEntry" }) +export type V2ReviewStartResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ReviewStartResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ReviewStartResponse__AgentMessageDisplay" }) + export type V2ReviewStartResponse__MessagePhase = "commentary" | "partial_answer" | "final_answer" 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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -2508,6 +2568,9 @@ export const V2ThreadForkResponse__AgentMessageDelivery = Schema.Literal("async" export type V2ThreadForkResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ThreadForkResponse__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": "V2ThreadForkResponse__MemoryCitationEntry" }) +export type V2ThreadForkResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadForkResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadForkResponse__AgentMessageDisplay" }) + export type V2ThreadForkResponse__MessagePhase = "commentary" | "partial_answer" | "final_answer" 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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -2601,6 +2664,9 @@ export const V2ThreadGuardianReviewResponse__GuardianUserAuthorization = Schema. 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 V2ThreadItemsListParams__ThreadItemOutputDeferral = { readonly "commandExecution"?: boolean, readonly "mcpToolCall"?: boolean } +export const V2ThreadItemsListParams__ThreadItemOutputDeferral = Schema.Struct({ "commandExecution": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Defer nonempty output from successful commands." })), "mcpToolCall": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Defer nonempty plain-text results from successful MCP tool calls." })) }).annotate({ "identifier": "V2ThreadItemsListParams__ThreadItemOutputDeferral" }) + export type V2ThreadItemsListParams__SortDirection = "asc" | "desc" export const V2ThreadItemsListParams__SortDirection = Schema.Literals(["asc", "desc"]).annotate({ "identifier": "V2ThreadItemsListParams__SortDirection" }) @@ -2619,6 +2685,9 @@ export const V2ThreadItemsListResponse__AgentMessageDelivery = Schema.Literal("a 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__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadItemsListResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadItemsListResponse__AgentMessageDisplay" }) + export type V2ThreadItemsListResponse__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -2700,6 +2769,9 @@ export const V2ThreadItemsReadResponse__AgentMessageDelivery = Schema.Literal("a export type V2ThreadItemsReadResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ThreadItemsReadResponse__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": "V2ThreadItemsReadResponse__MemoryCitationEntry" }) +export type V2ThreadItemsReadResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadItemsReadResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadItemsReadResponse__AgentMessageDisplay" }) + export type V2ThreadItemsReadResponse__MessagePhase = "commentary" | "partial_answer" | "final_answer" export const V2ThreadItemsReadResponse__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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", "identifier": "V2ThreadItemsReadResponse__MessagePhase" }) @@ -2832,6 +2904,9 @@ export const V2ThreadListResponse__AgentMessageDelivery = Schema.Literal("async" 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().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": "V2ThreadListResponse__MemoryCitationEntry" }) +export type V2ThreadListResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadListResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadListResponse__AgentMessageDisplay" }) + export type V2ThreadListResponse__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -2958,6 +3033,9 @@ export const V2ThreadMetadataUpdateResponse__AgentMessageDelivery = Schema.Liter export type V2ThreadMetadataUpdateResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ThreadMetadataUpdateResponse__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": "V2ThreadMetadataUpdateResponse__MemoryCitationEntry" }) +export type V2ThreadMetadataUpdateResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadMetadataUpdateResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadMetadataUpdateResponse__AgentMessageDisplay" }) + export type V2ThreadMetadataUpdateResponse__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -3063,6 +3141,9 @@ export const V2ThreadQueueStartResponse__AgentMessageDelivery = Schema.Literal(" export type V2ThreadQueueStartResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ThreadQueueStartResponse__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": "V2ThreadQueueStartResponse__MemoryCitationEntry" }) +export type V2ThreadQueueStartResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadQueueStartResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadQueueStartResponse__AgentMessageDisplay" }) + export type V2ThreadQueueStartResponse__MessagePhase = "commentary" | "partial_answer" | "final_answer" export const V2ThreadQueueStartResponse__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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", "identifier": "V2ThreadQueueStartResponse__MessagePhase" }) @@ -3204,6 +3285,9 @@ export const V2ThreadReadResponse__AgentMessageDelivery = Schema.Literal("async" 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__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadReadResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadReadResponse__AgentMessageDisplay" }) + export type V2ThreadReadResponse__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -3417,6 +3501,9 @@ export const V2ThreadResumeResponse__AgentMessageDelivery = Schema.Literal("asyn 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().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": "V2ThreadResumeResponse__MemoryCitationEntry" }) +export type V2ThreadResumeResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadResumeResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadResumeResponse__AgentMessageDisplay" }) + export type V2ThreadResumeResponse__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -3567,6 +3654,9 @@ export const V2ThreadRevertResponse__AgentMessageDelivery = Schema.Literal("asyn export type V2ThreadRevertResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ThreadRevertResponse__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": "V2ThreadRevertResponse__MemoryCitationEntry" }) +export type V2ThreadRevertResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadRevertResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadRevertResponse__AgentMessageDisplay" }) + export type V2ThreadRevertResponse__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -3705,6 +3795,9 @@ export const V2ThreadSearchResponse__AgentMessageDelivery = Schema.Literal("asyn export type V2ThreadSearchResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ThreadSearchResponse__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": "V2ThreadSearchResponse__MemoryCitationEntry" }) +export type V2ThreadSearchResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadSearchResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadSearchResponse__AgentMessageDisplay" }) + export type V2ThreadSearchResponse__MessagePhase = "commentary" | "partial_answer" | "final_answer" export const V2ThreadSearchResponse__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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", "identifier": "V2ThreadSearchResponse__MessagePhase" }) @@ -3801,6 +3894,9 @@ export const V2ThreadSettingsUpdatedNotification__ReasoningEffort = Schema.Strin 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__LegacyAppPathString = string +export const V2ThreadSettingsUpdatedNotification__LegacyAppPathString = Schema.String.annotate({ "identifier": "V2ThreadSettingsUpdatedNotification__LegacyAppPathString" }) + export type V2ThreadSettingsUpdatedNotification__MultiAgentMode = "explicitRequestOnly" | "proactive" | { readonly "custom": string } export const V2ThreadSettingsUpdatedNotification__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.", "identifier": "V2ThreadSettingsUpdatedNotification__MultiAgentMode" }) @@ -3825,6 +3921,9 @@ export const V2ThreadSettingsUpdateParams__ModeKind = Schema.Literals(["plan", " export type V2ThreadSettingsUpdateParams__ReasoningEffort = string export const V2ThreadSettingsUpdateParams__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": "V2ThreadSettingsUpdateParams__ReasoningEffort" })) +export type V2ThreadSettingsUpdateParams__LegacyAppPathString = string +export const V2ThreadSettingsUpdateParams__LegacyAppPathString = Schema.String.annotate({ "identifier": "V2ThreadSettingsUpdateParams__LegacyAppPathString" }) + export type V2ThreadSettingsUpdateParams__MultiAgentMode = "explicitRequestOnly" | "proactive" | { readonly "custom": string } export const V2ThreadSettingsUpdateParams__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.", "identifier": "V2ThreadSettingsUpdateParams__MultiAgentMode" }) @@ -3894,6 +3993,9 @@ export const V2ThreadStartedNotification__AgentMessageDelivery = Schema.Literal( export type V2ThreadStartedNotification__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ThreadStartedNotification__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": "V2ThreadStartedNotification__MemoryCitationEntry" }) +export type V2ThreadStartedNotification__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadStartedNotification__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadStartedNotification__AgentMessageDisplay" }) + export type V2ThreadStartedNotification__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -4062,6 +4164,9 @@ export const V2ThreadStartResponse__AgentMessageDelivery = Schema.Literal("async export type V2ThreadStartResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } 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__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadStartResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadStartResponse__AgentMessageDisplay" }) + export type V2ThreadStartResponse__MessagePhase = "commentary" | "partial_answer" | "final_answer" export const V2ThreadStartResponse__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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -4143,6 +4248,9 @@ export const V2ThreadTimelineListResponse__AgentMessageDelivery = Schema.Literal export type V2ThreadTimelineListResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } export const V2ThreadTimelineListResponse__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": "V2ThreadTimelineListResponse__MemoryCitationEntry" }) +export type V2ThreadTimelineListResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadTimelineListResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadTimelineListResponse__AgentMessageDisplay" }) + export type V2ThreadTimelineListResponse__MessagePhase = "commentary" | "partial_answer" | "final_answer" export const V2ThreadTimelineListResponse__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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", "identifier": "V2ThreadTimelineListResponse__MessagePhase" }) @@ -4257,6 +4365,9 @@ export const V2ThreadTurnsListResponse__AgentMessageDelivery = Schema.Literal("a export type V2ThreadTurnsListResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } 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 }).annotate({ "identifier": "V2ThreadTurnsListResponse__MemoryCitationEntry" }) +export type V2ThreadTurnsListResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadTurnsListResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadTurnsListResponse__AgentMessageDisplay" }) + export type V2ThreadTurnsListResponse__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -4383,6 +4494,9 @@ export const V2ThreadUnarchiveResponse__AgentMessageDelivery = Schema.Literal("a export type V2ThreadUnarchiveResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } 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 V2ThreadUnarchiveResponse__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2ThreadUnarchiveResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2ThreadUnarchiveResponse__AgentMessageDisplay" }) + export type V2ThreadUnarchiveResponse__MessagePhase = "commentary" | "partial_answer" | "final_answer" export const V2ThreadUnarchiveResponse__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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -4470,6 +4584,9 @@ export const V2TurnCompletedNotification__AgentMessageDelivery = Schema.Literal( 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().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 V2TurnCompletedNotification__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2TurnCompletedNotification__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2TurnCompletedNotification__AgentMessageDisplay" }) + export type V2TurnCompletedNotification__MessagePhase = "commentary" | "partial_answer" | "final_answer" export const V2TurnCompletedNotification__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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -4551,6 +4668,9 @@ export const V2TurnSettingsUpdateParams__ApprovalsReviewer = Schema.Literals(["u export type V2TurnSettingsUpdateParams__ReasoningEffort = string export const V2TurnSettingsUpdateParams__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": "V2TurnSettingsUpdateParams__ReasoningEffort" })) +export type V2TurnSettingsUpdateParams__LegacyAppPathString = string +export const V2TurnSettingsUpdateParams__LegacyAppPathString = Schema.String.annotate({ "identifier": "V2TurnSettingsUpdateParams__LegacyAppPathString" }) + export type V2TurnSettingsUpdateParams__ReasoningSummary = "auto" | "concise" | "detailed" | "none" export const V2TurnSettingsUpdateParams__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": "V2TurnSettingsUpdateParams__ReasoningSummary" }) @@ -4578,6 +4698,9 @@ export const V2TurnStartedNotification__AgentMessageDelivery = Schema.Literal("a export type V2TurnStartedNotification__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } 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__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2TurnStartedNotification__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2TurnStartedNotification__AgentMessageDisplay" }) + export type V2TurnStartedNotification__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -4713,6 +4836,9 @@ export const V2TurnStartResponse__AgentMessageDelivery = Schema.Literal("async") export type V2TurnStartResponse__MemoryCitationEntry = { readonly "lineEnd": number, readonly "lineStart": number, readonly "note": string, readonly "path": string } 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__AgentMessageDisplay = { readonly "action": string, readonly "blockType"?: string | null, readonly "checkTrustedContacts"?: boolean | null, readonly "cyberTrustedAccess"?: boolean | null } +export const V2TurnStartResponse__AgentMessageDisplay = Schema.Struct({ "action": Schema.String.annotate({ "description": "Unknown actions must be left for the producing client to handle." }), "blockType": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "checkTrustedContacts": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "cyberTrustedAccess": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }).annotate({ "description": "A presentation instruction for Chat to apply to this answer when recovering history.", "identifier": "V2TurnStartResponse__AgentMessageDisplay" }) + export type V2TurnStartResponse__MessagePhase = "commentary" | "partial_answer" | "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("partial_answer").annotate({ "description": "Stable answer text that may be followed by more assistant output or tools." }), Schema.Literal("final_answer").annotate({ "description": "The assistant's declared terminal answer text for the current turn." })], { mode: "oneOf" }).annotate({ "description": "Classifies assistant text as commentary, a partial answer, or a terminal answer.\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" }) @@ -4899,14 +5025,14 @@ export const ClientRequest__ThreadForkParams = Schema.Struct({ "approvalPolicy": export type ClientRequest__ContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: ClientRequest__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: ClientRequest__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "annotations"?: ReadonlyArray | null, readonly "logprobs"?: ReadonlyArray | null, readonly "text": string, readonly "type": "output_text" } export const ClientRequest__ContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextContentItemType" }) }).annotate({ "title": "InputTextContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageContentItemType" }) }).annotate({ "title": "ImageUrlContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageContentItemType" }) }).annotate({ "title": "FileIdContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioContentItemType" }) }).annotate({ "title": "AudioUrlContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioContentItemType" }) }).annotate({ "title": "FileIdContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), Schema.Struct({ "annotations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])), "logprobs": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])), "text": Schema.String, "type": Schema.Literal("output_text").annotate({ "title": "OutputTextContentItemType" }) }).annotate({ "title": "OutputTextContentItem" })], { mode: "oneOf" }).annotate({ "identifier": "ClientRequest__ContentItem" }) -export type ClientRequest__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: ClientRequest__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: ClientRequest__ImageDetail | null, 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([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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": "ClientRequest__FunctionCallOutputContentItem" }) +export type ClientRequest__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: ClientRequest__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: ClientRequest__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } +export const ClientRequest__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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": "ClientRequest__FunctionCallOutputContentItem" }) 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__ThreadSampleParams = { readonly "disableMcp"?: boolean, readonly "effort"?: ClientRequest__ReasoningEffort | null, readonly "expectedTurnId": string, readonly "interruptOnCancel"?: boolean | null, readonly "prompt": string, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "threadId": string, readonly "threadSource"?: ClientRequest__ThreadSource | null, readonly "turnTrigger"?: string | null } -export const ClientRequest__ThreadSampleParams = Schema.Struct({ "disableMcp": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Disable MCP servers when the inherited window uses incremental tools on Responses Lite." })), "effort": Schema.optionalKey(Schema.Union([ClientRequest__ReasoningEffort, Schema.Null]).annotate({ "description": "Applied only when the provider and model support cache-preserving reasoning-effort updates." })), "expectedTurnId": Schema.String.annotate({ "description": "The loaded source's latest completed, failed, or interrupted turn. Stale or active sources are rejected." }), "interruptOnCancel": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Override upstream interruption on cancellation for this sample; otherwise inherit the parent." }), Schema.Null])), "prompt": Schema.String, "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Optional metadata to enrich Codex's ResponsesAPI turn metadata." }), Schema.Null])), "threadId": Schema.String, "threadSource": Schema.optionalKey(Schema.Union([ClientRequest__ThreadSource, Schema.Null])), "turnTrigger": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) }).annotate({ "identifier": "ClientRequest__ThreadSampleParams" }) +export type ClientRequest__ThreadSampleParams = { readonly "allowInProgressTurn"?: boolean, readonly "disableMcp"?: boolean, readonly "effort"?: ClientRequest__ReasoningEffort | null, readonly "expectedTurnId": string, readonly "interruptOnCancel"?: boolean | null, readonly "prompt": string, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "threadId": string, readonly "threadSource"?: ClientRequest__ThreadSource | null, readonly "turnTrigger"?: string | null } +export const ClientRequest__ThreadSampleParams = Schema.Struct({ "allowInProgressTurn": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Allow sampling the latest turn before it finishes." })), "disableMcp": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Disable MCP servers when the inherited window uses incremental tools on Responses Lite." })), "effort": Schema.optionalKey(Schema.Union([ClientRequest__ReasoningEffort, Schema.Null]).annotate({ "description": "Applied only when the provider and model support cache-preserving reasoning-effort updates." })), "expectedTurnId": Schema.String.annotate({ "description": "The loaded source's latest turn, which must be finished (completed, failed, or interrupted) unless `allowInProgressTurn` is true." }), "interruptOnCancel": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Override upstream interruption on cancellation for this sample; otherwise inherit the parent." }), Schema.Null])), "prompt": Schema.String, "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Optional metadata to enrich Codex's ResponsesAPI turn metadata." }), Schema.Null])), "threadId": Schema.String, "threadSource": Schema.optionalKey(Schema.Union([ClientRequest__ThreadSource, Schema.Null])), "turnTrigger": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) }).annotate({ "identifier": "ClientRequest__ThreadSampleParams" }) 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" }) @@ -4932,14 +5058,11 @@ export const ClientRequest__ThreadMetadataUpdateParams = Schema.Struct({ "daybre export type ClientRequest__SandboxPolicy = { readonly "type": "dangerFullAccess" } | { readonly "networkAccess"?: boolean, readonly "type": "readOnly" } | { readonly "networkAccess"?: ClientRequest__NetworkAccess, readonly "type": "externalSandbox" } | { readonly "excludeSlashTmp"?: boolean, readonly "excludeTmpdirEnvVar"?: boolean, readonly "networkAccess"?: boolean, readonly "type": "workspaceWrite", readonly "writableRoots"?: ReadonlyArray } export const ClientRequest__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 => ClientRequest__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(ClientRequest__AbsolutePathBuf).annotate({ "default": [] })) }).annotate({ "title": "WorkspaceWriteSandboxPolicy" })], { mode: "oneOf" }).annotate({ "identifier": "ClientRequest__SandboxPolicy" }) -export type ClientRequest__TurnSettingsUpdateParams = { readonly "approvalsReviewer"?: ClientRequest__ApprovalsReviewer | null, readonly "effort"?: ClientRequest__ReasoningEffort | null, readonly "model"?: string | null, readonly "serviceTier"?: string | null, readonly "summary"?: ClientRequest__ReasoningSummary | null, readonly "threadId": string, readonly "turnId": string } -export const ClientRequest__TurnSettingsUpdateParams = Schema.Struct({ "approvalsReviewer": Schema.optionalKey(Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ "description": "Changes the active turn's reviewer without changing future thread settings. Already captured steps and pending approvals retain their original reviewer." })), "effort": Schema.optionalKey(Schema.Union([ClientRequest__ReasoningEffort, Schema.Null]).annotate({ "description": "Omission or `null` leaves the effort unchanged." })), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omission or `null` leaves the model unchanged." }), Schema.Null])), "serviceTier": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "`null` clears the requested tier; omission leaves it unchanged." }), Schema.Null])), "summary": Schema.optionalKey(Schema.Union([ClientRequest__ReasoningSummary, Schema.Null]).annotate({ "description": "Omission or `null` leaves the summary preference unchanged." })), "threadId": Schema.String, "turnId": Schema.String }).annotate({ "description": "Experimental settings changes for one running turn, not future turns. Unsupported fields are rejected rather than silently ignored. Any live task kind may accept publication. Child sessions and consumers of frozen initial settings are unchanged.", "identifier": "ClientRequest__TurnSettingsUpdateParams" }) - export type ClientRequest__ThreadMemoryModeSetParams = { readonly "mode": ClientRequest__ThreadMemoryMode, readonly "threadId": string } export const ClientRequest__ThreadMemoryModeSetParams = Schema.Struct({ "mode": ClientRequest__ThreadMemoryMode, "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadMemoryModeSetParams" }) -export type ClientRequest__ThreadListParams = { readonly "ancestorThreadId"?: string | null, readonly "archived"?: boolean | null, readonly "attachedToThreadId"?: string | null, readonly "cursor"?: string | null, readonly "cwd"?: ClientRequest__ThreadListCwdFilter | null, readonly "excludedThreadIds"?: ReadonlyArray | null, readonly "limit"?: number | null, readonly "modelProviders"?: ReadonlyArray | null, readonly "originators"?: ReadonlyArray | null, readonly "parentThreadId"?: string | null, readonly "projectId"?: string | 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 ClientRequest__ThreadListParams = Schema.Struct({ "ancestorThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional ancestor thread filter. Returns spawned descendants at any depth, excluding the ancestor itself. Mutually exclusive with `parentThreadId`." }), Schema.Null])), "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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Return only persistent threads attached to this thread, including empty threads. Mutually exclusive with parentThreadId and ancestorThreadId. Omitting this filter keeps attached threads hidden from ordinary listings." }), 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." })), "excludedThreadIds": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String).annotate({ "description": "Thread IDs to exclude before applying the result limit. Up to 100 entries; invalid IDs or a larger list are rejected, never truncated. Send the same exclusions on each page. Omitted, null, or empty means no exclusions." }), 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])), "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])), "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])), "parentThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional direct parent thread filter. Mutually exclusive with `ancestorThreadId`." }), Schema.Null])), "projectId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omit to include every project, set to null for unassigned threads, or provide a project ID to return only threads in that project." }), Schema.Null])), "searchTerm": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional substring filter for the extracted thread title." }), 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([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." }), 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({ "identifier": "ClientRequest__ThreadListParams" }) +export type ClientRequest__ThreadListParams = { readonly "ancestorThreadId"?: string | null, readonly "archived"?: boolean | null, readonly "attachedToThreadId"?: string | null, readonly "currentAccountOnly"?: boolean, readonly "cursor"?: string | null, readonly "cwd"?: ClientRequest__ThreadListCwdFilter | null, readonly "excludedThreadIds"?: ReadonlyArray | null, readonly "includeAttachedThreads"?: boolean, readonly "limit"?: number | null, readonly "modelProviders"?: ReadonlyArray | null, readonly "originators"?: ReadonlyArray | null, readonly "parentThreadId"?: string | null, readonly "projectId"?: string | 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 ClientRequest__ThreadListParams = Schema.Struct({ "ancestorThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional ancestor thread filter. Returns spawned descendants at any depth, excluding the ancestor itself. Mutually exclusive with `parentThreadId`." }), Schema.Null])), "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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Return only persistent threads attached to this thread, including empty threads. Mutually exclusive with parentThreadId and ancestorThreadId. Omitting this filter keeps attached threads hidden from ordinary listings." }), Schema.Null])), "currentAccountOnly": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Show local history visible to the current ChatGPT account. Defaults to false." })), "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." })), "excludedThreadIds": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String).annotate({ "description": "Thread IDs to exclude before applying the result limit. Up to 100 entries; invalid IDs or a larger list are rejected, never truncated. Send the same exclusions on each page. Omitted, null, or empty means no exclusions." }), Schema.Null])), "includeAttachedThreads": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Include persistent threads attached to a parent when searching by title." })), "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])), "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])), "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])), "parentThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional direct parent thread filter. Mutually exclusive with `ancestorThreadId`." }), Schema.Null])), "projectId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omit to include every project, set to null for unassigned threads, or provide a project ID to return only threads in that project." }), Schema.Null])), "searchTerm": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional substring filter for the extracted thread title." }), 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([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." }), 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({ "identifier": "ClientRequest__ThreadListParams" }) export type ClientRequest__ProjectListParams = { readonly "cursor"?: string | null, readonly "limit"?: number | null, readonly "sortDirection"?: ClientRequest__SortDirection | null, readonly "sortKey"?: ClientRequest__ProjectSortKey | null } export const ClientRequest__ProjectListParams = 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])), "sortDirection": Schema.optionalKey(Schema.Union([ClientRequest__SortDirection, Schema.Null]).annotate({ "description": "Requires sortKey. Defaults to asc for position and desc for recencyAt." })), "sortKey": Schema.optionalKey(Schema.Union([ClientRequest__ProjectSortKey, Schema.Null]).annotate({ "description": "Defaults to position. Recency sorting always places empty projects last." })) }).annotate({ "identifier": "ClientRequest__ProjectListParams" }) @@ -4950,8 +5073,8 @@ export const ClientRequest__ThreadSectionCreateParams = Schema.Struct({ "appeara export type ClientRequest__ThreadSectionUpdateParams = { readonly "appearance"?: ClientRequest__ThreadSectionAppearance | null, readonly "name": string, readonly "sectionId": string } 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 ClientRequest__ThreadSearchParams = { readonly "archived"?: boolean | null, readonly "cursor"?: string | null, readonly "limit"?: number | null, readonly "searchTerm": string, readonly "sortDirection"?: ClientRequest__SortDirection | null, readonly "sortKey"?: ClientRequest__ThreadSearchSortKey | null, readonly "sourceKinds"?: ReadonlyArray | null } -export const ClientRequest__ThreadSearchParams = 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])), "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])), "searchTerm": Schema.String.annotate({ "description": "Required substring/full-text query for thread search." }), "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__ThreadSearchSortKey, 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." }), Schema.Null])) }).annotate({ "identifier": "ClientRequest__ThreadSearchParams" }) +export type ClientRequest__ThreadSearchParams = { readonly "archived"?: boolean | null, readonly "currentAccountOnly"?: boolean, readonly "cursor"?: string | null, readonly "includeAttachedThreads"?: boolean, readonly "limit"?: number | null, readonly "searchTerm": string, readonly "sortDirection"?: ClientRequest__SortDirection | null, readonly "sortKey"?: ClientRequest__ThreadSearchSortKey | null, readonly "sourceKinds"?: ReadonlyArray | null } +export const ClientRequest__ThreadSearchParams = 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])), "currentAccountOnly": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Show local history visible to the current ChatGPT account. Defaults to false." })), "cursor": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque pagination cursor returned by a previous call." }), Schema.Null])), "includeAttachedThreads": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Include persistent threads attached to a parent in search results." })), "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])), "searchTerm": Schema.String.annotate({ "description": "Required substring/full-text query for thread search." }), "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__ThreadSearchSortKey, 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." }), Schema.Null])) }).annotate({ "identifier": "ClientRequest__ThreadSearchParams" }) export type ClientRequest__ThreadReadStateUpdateParams = { readonly "expectedRevision": string, readonly "operation": ClientRequest__ThreadReadStateOperation, readonly "threadId": string } export const ClientRequest__ThreadReadStateUpdateParams = Schema.Struct({ "expectedRevision": Schema.String.annotate({ "description": "Revision of the row or transcript actually seen. Conflicts require a fresh user action." }), "operation": ClientRequest__ThreadReadStateOperation, "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadReadStateUpdateParams" }) @@ -4983,6 +5106,9 @@ export const ClientRequest__ThreadRealtimeAppendAudioParams = Schema.Struct({ "a export type ClientRequest__ReviewStartParams = { readonly "delivery"?: ClientRequest__ReviewDelivery | null, readonly "target": ClientRequest__ReviewTarget, readonly "threadId": string } export const ClientRequest__ReviewStartParams = Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([ClientRequest__ReviewDelivery, Schema.Null]).annotate({ "description": "Reviews run inline on the supplied thread. Omit this field or pass `inline`. To review on a separate thread, start a thread first and use its id." })), "target": ClientRequest__ReviewTarget, "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ReviewStartParams" }) +export type ClientRequest__ProviderSettingsPatch = { readonly "baseUrl"?: string | null, readonly "envKey"?: string | null, readonly "name"?: string, readonly "providerId"?: string | null, readonly "type": "customGateway" } | { readonly "profile"?: string | null, readonly "providerId": ClientRequest__BedrockProviderId, readonly "region"?: string | null, readonly "type": "bedrock" } | { readonly "credentialFile"?: string | null, readonly "location"?: string | null, readonly "projectId"?: string | null, readonly "providerId": ClientRequest__GcpProviderId, readonly "type": "gcp" } +export const ClientRequest__ProviderSettingsPatch = Schema.Union([Schema.Struct({ "baseUrl": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "envKey": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "name": Schema.optionalKey(Schema.String), "providerId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omit or pass null to allocate a new custom provider ID." }), Schema.Null])), "type": Schema.Literal("customGateway").annotate({ "title": "CustomGatewayProviderSettingsPatchType" }) }).annotate({ "title": "CustomGatewayProviderSettingsPatch" }), Schema.Struct({ "profile": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "providerId": ClientRequest__BedrockProviderId, "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "type": Schema.Literal("bedrock").annotate({ "title": "BedrockProviderSettingsPatchType" }) }).annotate({ "title": "BedrockProviderSettingsPatch", "description": "AWS configuration fields for built-in Bedrock providers." }), Schema.Struct({ "credentialFile": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "location": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "projectId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "providerId": ClientRequest__GcpProviderId, "type": Schema.Literal("gcp").annotate({ "title": "GcpProviderSettingsPatchType" }) }).annotate({ "title": "GcpProviderSettingsPatch", "description": "GCP configuration fields. Credential-file paths refer to the app-server host." })], { mode: "oneOf" }).annotate({ "description": "Omitted patch fields preserve their values. Explicit null clears a nullable field.", "identifier": "ClientRequest__ProviderSettingsPatch" }) + export type ClientRequest__RemoteControlClientsListParams = { readonly "cursor"?: string | null, readonly "environmentId": string, readonly "limit"?: number | null, readonly "order"?: ClientRequest__RemoteControlClientsListOrder | null } export const ClientRequest__RemoteControlClientsListParams = Schema.Struct({ "cursor": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "environmentId": Schema.String, "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])), "order": Schema.optionalKey(Schema.Union([ClientRequest__RemoteControlClientsListOrder, Schema.Null])) }).annotate({ "identifier": "ClientRequest__RemoteControlClientsListParams" }) @@ -4995,8 +5121,8 @@ export const ClientRequest__McpServerOauthLoginParams = Schema.Struct({ "clientR 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__McpResourceReadParams = { readonly "_meta"?: { readonly [x: string]: Schema.Json } | null, 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({ "_meta": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({ "description": "Additional MCP request metadata. Account and turn routing keys are reserved." }), Schema.Null])), "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" }) @@ -5094,8 +5220,8 @@ export const PermissionsRequestApprovalParams__FileSystemSpecialPath = Schema.Un 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({ "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({ "kind": Schema.Literal("unknown"), "path": Schema.String, "subpath": Schema.optionalKey(Schema.Union([PermissionsRequestApprovalResponse__LegacyAppPathString, Schema.Null])) })], { mode: "oneOf" }).annotate({ "identifier": "PermissionsRequestApprovalResponse__FileSystemSpecialPath" }) -export type ServerNotification__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "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": ServerNotification__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } -export const ServerNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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": 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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 ServerNotification__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const ServerNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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": 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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 ServerNotification__MisalignmentErrorDetails = { readonly "detailedExplanation"?: string | null, readonly "errorType"?: string | null, readonly "reviewTarget"?: string | null, readonly "steer"?: ServerNotification__MisalignmentSteer | null } 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -5130,12 +5256,15 @@ export const ServerNotification__ThreadStatus = Schema.Union([Schema.Struct({ "t export type ServerNotification__TextElement = { readonly "byteRange": ServerNotification__ByteRange, readonly "placeholder"?: string | null } 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 ServerNotification__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: ServerNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: ServerNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } -export const ServerNotification__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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": "ServerNotification__FunctionCallOutputContentItem" }) +export type ServerNotification__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: ServerNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: ServerNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } +export const ServerNotification__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([ServerNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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": "ServerNotification__FunctionCallOutputContentItem" }) 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) }).annotate({ "identifier": "ServerNotification__MemoryCitation" }) +export type ServerNotification__AgentMessageModeration = { readonly "display"?: ServerNotification__AgentMessageDisplay | null, readonly "moderated": boolean } +export const ServerNotification__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([ServerNotification__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "ServerNotification__AgentMessageModeration" }) + 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" }) @@ -5193,8 +5322,8 @@ export const ServerNotification__McpServerEventStreamNotification = Schema.Struc 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__GatewayOAuthChangedNotification = { readonly "authUrl"?: string | null, readonly "error"?: string | null, readonly "loginId"?: 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])), "loginId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Identifies the completed device login attempt." }), 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" }) @@ -5373,8 +5502,8 @@ export const V2ConfigWarningNotification__TextRange = Schema.Struct({ "end": V2C 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" | "modelNotFound" | "policyCapacityUnavailable" | "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": V2ErrorNotification__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } -export const V2ErrorNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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": V2ErrorNotification__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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 V2ErrorNotification__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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": V2ErrorNotification__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } +export const V2ErrorNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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": V2ErrorNotification__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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 V2ErrorNotification__MisalignmentErrorDetails = { readonly "detailedExplanation"?: string | null, readonly "errorType"?: string | null, readonly "reviewTarget"?: string | null, readonly "steer"?: V2ErrorNotification__MisalignmentSteer | null } 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -5433,6 +5562,9 @@ export const V2GetAccountResponse__Account = Schema.Union([Schema.Struct({ "type 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 }).annotate({ "identifier": "V2GetAccountResponse__WorkspaceRouting" }) +export type V2GetAccountSecuritySetupResponse__AccountSecuritySetupNotice = { readonly "accountId": string, readonly "action": V2GetAccountSecuritySetupResponse__AccountSecuritySetupAction, readonly "description": string, readonly "title": string, readonly "userId": string } +export const V2GetAccountSecuritySetupResponse__AccountSecuritySetupNotice = Schema.Struct({ "accountId": Schema.String, "action": V2GetAccountSecuritySetupResponse__AccountSecuritySetupAction, "description": Schema.String, "title": Schema.String, "userId": Schema.String }).annotate({ "identifier": "V2GetAccountSecuritySetupResponse__AccountSecuritySetupNotice" }) + export type V2GetAccountTokenUsageResponse__ThreadUsage = { readonly "estimatedUsageCreditsMicros": number, readonly "estimatedUsageUsdMicros"?: number | null, readonly "groups": ReadonlyArray, readonly "nativeUsageUsdMicros"?: number | null, 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), "nativeUsageUsdMicros": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Native dollar usage, independent of credit estimates. None means unknown, not zero.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "threadId": Schema.String }).annotate({ "identifier": "V2GetAccountTokenUsageResponse__ThreadUsage" }) @@ -5451,12 +5583,15 @@ export const V2HookStartedNotification__HookOutputEntry = Schema.Struct({ "kind" 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 "image_url": string, readonly "detail"?: V2ItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ItemCompletedNotification__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ItemCompletedNotification__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ItemCompletedNotification__AgentMessageModeration" }) + 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" }) @@ -5487,12 +5622,15 @@ export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalRe 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 "image_url": string, readonly "detail"?: V2ItemStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ItemStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ItemStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ItemStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ItemStartedNotification__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ItemStartedNotification__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ItemStartedNotification__AgentMessageModeration" }) + 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" }) @@ -5517,11 +5655,20 @@ export const V2ModelListResponse__ModelAccessPrograms = Schema.Struct({ "cyber": 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 V2ModelProviderConfigWriteParams__ProviderSettingsPatch = { readonly "baseUrl"?: string | null, readonly "envKey"?: string | null, readonly "name"?: string, readonly "providerId"?: string | null, readonly "type": "customGateway" } | { readonly "profile"?: string | null, readonly "providerId": V2ModelProviderConfigWriteParams__BedrockProviderId, readonly "region"?: string | null, readonly "type": "bedrock" } | { readonly "credentialFile"?: string | null, readonly "location"?: string | null, readonly "projectId"?: string | null, readonly "providerId": V2ModelProviderConfigWriteParams__GcpProviderId, readonly "type": "gcp" } +export const V2ModelProviderConfigWriteParams__ProviderSettingsPatch = Schema.Union([Schema.Struct({ "baseUrl": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "envKey": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "name": Schema.optionalKey(Schema.String), "providerId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omit or pass null to allocate a new custom provider ID." }), Schema.Null])), "type": Schema.Literal("customGateway").annotate({ "title": "CustomGatewayProviderSettingsPatchType" }) }).annotate({ "title": "CustomGatewayProviderSettingsPatch" }), Schema.Struct({ "profile": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "providerId": V2ModelProviderConfigWriteParams__BedrockProviderId, "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "type": Schema.Literal("bedrock").annotate({ "title": "BedrockProviderSettingsPatchType" }) }).annotate({ "title": "BedrockProviderSettingsPatch", "description": "AWS configuration fields for built-in Bedrock providers." }), Schema.Struct({ "credentialFile": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "location": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "projectId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "providerId": V2ModelProviderConfigWriteParams__GcpProviderId, "type": Schema.Literal("gcp").annotate({ "title": "GcpProviderSettingsPatchType" }) }).annotate({ "title": "GcpProviderSettingsPatch", "description": "GCP configuration fields. Credential-file paths refer to the app-server host." })], { mode: "oneOf" }).annotate({ "description": "Omitted patch fields preserve their values. Explicit null clears a nullable field.", "identifier": "V2ModelProviderConfigWriteParams__ProviderSettingsPatch" }) + +export type V2ModelProviderConfigWriteResponse__ProviderSettings = { readonly "type": "openai" } | { readonly "auth": V2ModelProviderConfigWriteResponse__GatewayAuth, readonly "type": "customGateway" } | { readonly "profile"?: string | null, readonly "region"?: string | null, readonly "type": "bedrock" } | { readonly "credentialFile"?: string | null, readonly "location"?: string | null, readonly "projectId"?: string | null, readonly "type": "gcp" } +export const V2ModelProviderConfigWriteResponse__ProviderSettings = Schema.Union([Schema.Struct({ "type": Schema.Literal("openai").annotate({ "title": "OpenaiProviderSettingsType" }) }).annotate({ "title": "OpenaiProviderSettings" }), Schema.Struct({ "auth": V2ModelProviderConfigWriteResponse__GatewayAuth, "type": Schema.Literal("customGateway").annotate({ "title": "CustomGatewayProviderSettingsType" }) }).annotate({ "title": "CustomGatewayProviderSettings" }), Schema.Struct({ "profile": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "type": Schema.Literal("bedrock").annotate({ "title": "BedrockProviderSettingsType" }) }).annotate({ "title": "BedrockProviderSettings" }), Schema.Struct({ "credentialFile": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Path on the app-server host, without credential-file contents." }), Schema.Null])), "location": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "projectId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "type": Schema.Literal("gcp").annotate({ "title": "GcpProviderSettingsType" }) }).annotate({ "title": "GcpProviderSettings" })], { mode: "oneOf" }).annotate({ "identifier": "V2ModelProviderConfigWriteResponse__ProviderSettings" }) + +export type V2ModelProviderListResponse__ProviderSettings = { readonly "type": "openai" } | { readonly "auth": V2ModelProviderListResponse__GatewayAuth, readonly "type": "customGateway" } | { readonly "profile"?: string | null, readonly "region"?: string | null, readonly "type": "bedrock" } | { readonly "credentialFile"?: string | null, readonly "location"?: string | null, readonly "projectId"?: string | null, readonly "type": "gcp" } +export const V2ModelProviderListResponse__ProviderSettings = Schema.Union([Schema.Struct({ "type": Schema.Literal("openai").annotate({ "title": "OpenaiProviderSettingsType" }) }).annotate({ "title": "OpenaiProviderSettings" }), Schema.Struct({ "auth": V2ModelProviderListResponse__GatewayAuth, "type": Schema.Literal("customGateway").annotate({ "title": "CustomGatewayProviderSettingsType" }) }).annotate({ "title": "CustomGatewayProviderSettings" }), Schema.Struct({ "profile": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "region": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "type": Schema.Literal("bedrock").annotate({ "title": "BedrockProviderSettingsType" }) }).annotate({ "title": "BedrockProviderSettings" }), Schema.Struct({ "credentialFile": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Path on the app-server host, without credential-file contents." }), Schema.Null])), "location": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "projectId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "type": Schema.Literal("gcp").annotate({ "title": "GcpProviderSettingsType" }) }).annotate({ "title": "GcpProviderSettings" })], { mode: "oneOf" }).annotate({ "identifier": "V2ModelProviderListResponse__ProviderSettings" }) + 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 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 512 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" }) @@ -5533,7 +5680,7 @@ export type V2PluginListResponse__MarketplaceLoadErrorInfo = { readonly "marketp 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 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 512 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" }) @@ -5551,7 +5698,7 @@ export type V2PluginReadResponse__SkillInterface = { readonly "brandColor"?: str 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 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 512 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" }) @@ -5563,7 +5710,7 @@ export type V2PluginReadResponse__PluginSharePrincipal = { readonly "name": stri export const V2PluginReadResponse__PluginSharePrincipal = Schema.Struct({ "name": Schema.String, "principalId": Schema.String, "principalType": V2PluginReadResponse__PluginSharePrincipalType, "role": V2PluginReadResponse__PluginSharePrincipalRole }).annotate({ "identifier": "V2PluginReadResponse__PluginSharePrincipal" }) export type V2PluginSearchResponse__PluginInterface = { readonly "brandColor"?: string | null, readonly "capabilities": ReadonlyArray, readonly "category"?: string | null, readonly "composerIcon"?: V2PluginSearchResponse__AbsolutePathBuf | null, readonly "composerIconUrl"?: string | null, readonly "defaultPrompt"?: ReadonlyArray | null, readonly "developerName"?: string | null, readonly "displayName"?: string | null, readonly "logo"?: V2PluginSearchResponse__AbsolutePathBuf | null, readonly "logoDark"?: V2PluginSearchResponse__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 V2PluginSearchResponse__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([V2PluginSearchResponse__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([V2PluginSearchResponse__AbsolutePathBuf, Schema.Null]).annotate({ "description": "Local logo path, resolved from the installed plugin package." })), "logoDark": Schema.optionalKey(Schema.Union([V2PluginSearchResponse__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(V2PluginSearchResponse__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": "V2PluginSearchResponse__PluginInterface" }) +export const V2PluginSearchResponse__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([V2PluginSearchResponse__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 512 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([V2PluginSearchResponse__AbsolutePathBuf, Schema.Null]).annotate({ "description": "Local logo path, resolved from the installed plugin package." })), "logoDark": Schema.optionalKey(Schema.Union([V2PluginSearchResponse__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(V2PluginSearchResponse__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": "V2PluginSearchResponse__PluginInterface" }) export type V2PluginSearchResponse__PluginSource = { readonly "path": V2PluginSearchResponse__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 V2PluginSearchResponse__PluginSource = Schema.Union([Schema.Struct({ "path": V2PluginSearchResponse__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": "V2PluginSearchResponse__PluginSource" }) @@ -5572,7 +5719,7 @@ export type V2PluginSearchResponse__PluginSharePrincipal = { readonly "name": st export const V2PluginSearchResponse__PluginSharePrincipal = Schema.Struct({ "name": Schema.String, "principalId": Schema.String, "principalType": V2PluginSearchResponse__PluginSharePrincipalType, "role": V2PluginSearchResponse__PluginSharePrincipalRole }).annotate({ "identifier": "V2PluginSearchResponse__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 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 512 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" }) @@ -5616,14 +5763,14 @@ export const V2ProjectUpdateResponse__ProjectRoot = Schema.Struct({ "path": V2Pr export type V2RawResponseItemCompletedNotification__ContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2RawResponseItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2RawResponseItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "annotations"?: ReadonlyArray | null, readonly "logprobs"?: ReadonlyArray | null, 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageContentItemType" }) }).annotate({ "title": "ImageUrlContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageContentItemType" }) }).annotate({ "title": "FileIdContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioContentItemType" }) }).annotate({ "title": "AudioUrlContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioContentItemType" }) }).annotate({ "title": "FileIdContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), Schema.Struct({ "annotations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])), "logprobs": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])), "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 "image_url": string, readonly "detail"?: V2RawResponseItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2RawResponseItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2RawResponseItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2RawResponseItemCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ReviewStartResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ReviewStartResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -5631,12 +5778,15 @@ export const V2ReviewStartResponse__MisalignmentErrorDetails = Schema.Struct({ " 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 "image_url": string, readonly "detail"?: V2ReviewStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ReviewStartResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ReviewStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ReviewStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ReviewStartResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ReviewStartResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ReviewStartResponse__AgentMessageModeration" }) + 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" }) @@ -5682,8 +5832,8 @@ export const V2ThreadForkResponse__SubAgentSource = Schema.Union([Schema.Literal 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadForkResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadForkResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -5691,12 +5841,15 @@ export const V2ThreadForkResponse__MisalignmentErrorDetails = Schema.Struct({ "d 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 "image_url": string, readonly "detail"?: V2ThreadForkResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadForkResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadForkResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadForkResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadForkResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadForkResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadForkResponse__AgentMessageModeration" }) + 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" }) @@ -5724,12 +5877,15 @@ export const V2ThreadItemsListParams__ThreadItemsListCursor = Schema.Union([Sche 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 "image_url": string, readonly "detail"?: V2ThreadItemsListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadItemsListResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadItemsListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadItemsListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadItemsListResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadItemsListResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadItemsListResponse__AgentMessageModeration" }) + 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" }) @@ -5748,12 +5904,15 @@ export const V2ThreadItemsListResponse__ImageGenerationInputImage = Schema.Struc export type V2ThreadItemsReadResponse__TextElement = { readonly "byteRange": V2ThreadItemsReadResponse__ByteRange, readonly "placeholder"?: string | null } export const V2ThreadItemsReadResponse__TextElement = Schema.Struct({ "byteRange": Schema.suspend((): Schema.Codec => V2ThreadItemsReadResponse__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": "V2ThreadItemsReadResponse__TextElement" }) -export type V2ThreadItemsReadResponse__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadItemsReadResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadItemsReadResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } -export const V2ThreadItemsReadResponse__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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": "V2ThreadItemsReadResponse__FunctionCallOutputContentItem" }) +export type V2ThreadItemsReadResponse__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadItemsReadResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadItemsReadResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } +export const V2ThreadItemsReadResponse__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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": "V2ThreadItemsReadResponse__FunctionCallOutputContentItem" }) export type V2ThreadItemsReadResponse__MemoryCitation = { readonly "entries": ReadonlyArray, readonly "threadIds": ReadonlyArray } export const V2ThreadItemsReadResponse__MemoryCitation = Schema.Struct({ "entries": Schema.Array(V2ThreadItemsReadResponse__MemoryCitationEntry), "threadIds": Schema.Array(Schema.String) }).annotate({ "identifier": "V2ThreadItemsReadResponse__MemoryCitation" }) +export type V2ThreadItemsReadResponse__AgentMessageModeration = { readonly "display"?: V2ThreadItemsReadResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadItemsReadResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadItemsReadResponse__AgentMessageModeration" }) + export type V2ThreadItemsReadResponse__CommandAction = { readonly "command": string, readonly "name": string, readonly "path": V2ThreadItemsReadResponse__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 V2ThreadItemsReadResponse__CommandAction = Schema.Union([Schema.Struct({ "command": Schema.String, "name": Schema.String, "path": V2ThreadItemsReadResponse__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": "V2ThreadItemsReadResponse__CommandAction" }) @@ -5787,8 +5946,8 @@ export const V2ThreadListResponse__SubAgentSource = Schema.Union([Schema.Literal 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadListResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadListResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -5796,12 +5955,15 @@ export const V2ThreadListResponse__MisalignmentErrorDetails = Schema.Struct({ "d 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 "image_url": string, readonly "detail"?: V2ThreadListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadListResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadListResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadListResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadListResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadListResponse__AgentMessageModeration" }) + 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" }) @@ -5832,8 +5994,8 @@ export const V2ThreadMetadataUpdateResponse__SubAgentSource = Schema.Union([Sche 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadMetadataUpdateResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadMetadataUpdateResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -5841,12 +6003,15 @@ export const V2ThreadMetadataUpdateResponse__MisalignmentErrorDetails = Schema.S 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 "image_url": string, readonly "detail"?: V2ThreadMetadataUpdateResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadMetadataUpdateResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadMetadataUpdateResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadMetadataUpdateResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadMetadataUpdateResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadMetadataUpdateResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadMetadataUpdateResponse__AgentMessageModeration" }) + 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" }) @@ -5865,8 +6030,8 @@ export const V2ThreadQueueAddResponse__TextElement = Schema.Struct({ "byteRange" export type V2ThreadQueueListResponse__TextElement = { readonly "byteRange": V2ThreadQueueListResponse__ByteRange, readonly "placeholder"?: string | null } export const V2ThreadQueueListResponse__TextElement = Schema.Struct({ "byteRange": Schema.suspend((): Schema.Codec => V2ThreadQueueListResponse__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": "V2ThreadQueueListResponse__TextElement" }) -export type V2ThreadQueueStartResponse__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "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": V2ThreadQueueStartResponse__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadQueueStartResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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": V2ThreadQueueStartResponse__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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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": "V2ThreadQueueStartResponse__CodexErrorInfo" }) +export type V2ThreadQueueStartResponse__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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": V2ThreadQueueStartResponse__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadQueueStartResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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": V2ThreadQueueStartResponse__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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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": "V2ThreadQueueStartResponse__CodexErrorInfo" }) export type V2ThreadQueueStartResponse__MisalignmentErrorDetails = { readonly "detailedExplanation"?: string | null, readonly "errorType"?: string | null, readonly "reviewTarget"?: string | null, readonly "steer"?: V2ThreadQueueStartResponse__MisalignmentSteer | null } export const V2ThreadQueueStartResponse__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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), Schema.Null])), "steer": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__MisalignmentSteer, Schema.Null]).annotate({ "description": "Instruction to submit as the next turn's user input if continuation is confirmed." })) }).annotate({ "identifier": "V2ThreadQueueStartResponse__MisalignmentErrorDetails" }) @@ -5874,12 +6039,15 @@ export const V2ThreadQueueStartResponse__MisalignmentErrorDetails = Schema.Struc export type V2ThreadQueueStartResponse__TextElement = { readonly "byteRange": V2ThreadQueueStartResponse__ByteRange, readonly "placeholder"?: string | null } export const V2ThreadQueueStartResponse__TextElement = Schema.Struct({ "byteRange": Schema.suspend((): Schema.Codec => V2ThreadQueueStartResponse__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": "V2ThreadQueueStartResponse__TextElement" }) -export type V2ThreadQueueStartResponse__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadQueueStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadQueueStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } -export const V2ThreadQueueStartResponse__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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": "V2ThreadQueueStartResponse__FunctionCallOutputContentItem" }) +export type V2ThreadQueueStartResponse__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadQueueStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadQueueStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } +export const V2ThreadQueueStartResponse__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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": "V2ThreadQueueStartResponse__FunctionCallOutputContentItem" }) export type V2ThreadQueueStartResponse__MemoryCitation = { readonly "entries": ReadonlyArray, readonly "threadIds": ReadonlyArray } export const V2ThreadQueueStartResponse__MemoryCitation = Schema.Struct({ "entries": Schema.Array(V2ThreadQueueStartResponse__MemoryCitationEntry), "threadIds": Schema.Array(Schema.String) }).annotate({ "identifier": "V2ThreadQueueStartResponse__MemoryCitation" }) +export type V2ThreadQueueStartResponse__AgentMessageModeration = { readonly "display"?: V2ThreadQueueStartResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadQueueStartResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadQueueStartResponse__AgentMessageModeration" }) + export type V2ThreadQueueStartResponse__CommandAction = { readonly "command": string, readonly "name": string, readonly "path": V2ThreadQueueStartResponse__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 V2ThreadQueueStartResponse__CommandAction = Schema.Union([Schema.Struct({ "command": Schema.String, "name": Schema.String, "path": V2ThreadQueueStartResponse__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": "V2ThreadQueueStartResponse__CommandAction" }) @@ -5922,8 +6090,8 @@ export const V2ThreadReadResponse__SubAgentSource = Schema.Union([Schema.Literal 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadReadResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadReadResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -5931,12 +6099,15 @@ export const V2ThreadReadResponse__MisalignmentErrorDetails = Schema.Struct({ "d 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 "image_url": string, readonly "detail"?: V2ThreadReadResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadReadResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadReadResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadReadResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadReadResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadReadResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadReadResponse__AgentMessageModeration" }) + 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" }) @@ -5967,8 +6138,8 @@ export const V2ThreadRealtimeStartParams__ThreadRealtimeInitialItem = Schema.Str export type V2ThreadResumeParams__ContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadResumeParams__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadResumeParams__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "annotations"?: ReadonlyArray | null, readonly "logprobs"?: ReadonlyArray | null, 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageContentItemType" }) }).annotate({ "title": "ImageUrlContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageContentItemType" }) }).annotate({ "title": "FileIdContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioContentItemType" }) }).annotate({ "title": "AudioUrlContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioContentItemType" }) }).annotate({ "title": "FileIdContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), Schema.Struct({ "annotations": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])), "logprobs": Schema.optionalKey(Schema.Union([Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])), "text": Schema.String, "type": Schema.Literal("output_text").annotate({ "title": "OutputTextContentItemType" }) }).annotate({ "title": "OutputTextContentItem" })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadResumeParams__ContentItem" }) -export type V2ThreadResumeParams__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadResumeParams__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadResumeParams__ImageDetail | null, 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.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadResumeParams__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadResumeParams__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__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" }) @@ -5982,8 +6153,8 @@ export const V2ThreadResumeResponse__Settings = Schema.Struct({ "developer_instr export type V2ThreadResumeResponse__ImageGenerationInputImage = { readonly "path": V2ThreadResumeResponse__AbsolutePathBuf, readonly "sha256": string } export const V2ThreadResumeResponse__ImageGenerationInputImage = Schema.Struct({ "path": V2ThreadResumeResponse__AbsolutePathBuf, "sha256": Schema.String.annotate({ "description": "Lowercase SHA-256 of the file bytes read before image normalization." }) }).annotate({ "description": "A local image file successfully read for this exact image-generation request.", "identifier": "V2ThreadResumeResponse__ImageGenerationInputImage" }) -export type V2ThreadResumeResponse__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadResumeResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadResumeResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -5991,12 +6162,15 @@ export const V2ThreadResumeResponse__MisalignmentErrorDetails = Schema.Struct({ 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 "image_url": string, readonly "detail"?: V2ThreadResumeResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadResumeResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadResumeResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadResumeResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadResumeResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadResumeResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadResumeResponse__AgentMessageModeration" }) + 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" }) @@ -6042,8 +6216,8 @@ export const V2ThreadRevertResponse__SubAgentSource = Schema.Union([Schema.Liter 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadRevertResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadRevertResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -6051,12 +6225,15 @@ export const V2ThreadRevertResponse__MisalignmentErrorDetails = Schema.Struct({ 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 "image_url": string, readonly "detail"?: V2ThreadRevertResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadRevertResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadRevertResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadRevertResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadRevertResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadRevertResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadRevertResponse__AgentMessageModeration" }) + 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" }) @@ -6087,8 +6264,8 @@ export const V2ThreadSearchResponse__SubAgentSource = Schema.Union([Schema.Liter export type V2ThreadSearchResponse__ThreadStatus = { readonly "type": "notLoaded" } | { readonly "type": "idle" } | { readonly "type": "systemError" } | { readonly "activeFlags": ReadonlyArray, readonly "type": "active" } export const V2ThreadSearchResponse__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(V2ThreadSearchResponse__ThreadActiveFlag), "type": Schema.Literal("active").annotate({ "title": "ActiveThreadStatusType" }) }).annotate({ "title": "ActiveThreadStatus" })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadSearchResponse__ThreadStatus" }) -export type V2ThreadSearchResponse__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "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": V2ThreadSearchResponse__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadSearchResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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": V2ThreadSearchResponse__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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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": "V2ThreadSearchResponse__CodexErrorInfo" }) +export type V2ThreadSearchResponse__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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": V2ThreadSearchResponse__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadSearchResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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": V2ThreadSearchResponse__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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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": "V2ThreadSearchResponse__CodexErrorInfo" }) export type V2ThreadSearchResponse__MisalignmentErrorDetails = { readonly "detailedExplanation"?: string | null, readonly "errorType"?: string | null, readonly "reviewTarget"?: string | null, readonly "steer"?: V2ThreadSearchResponse__MisalignmentSteer | null } export const V2ThreadSearchResponse__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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), Schema.Null])), "steer": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__MisalignmentSteer, Schema.Null]).annotate({ "description": "Instruction to submit as the next turn's user input if continuation is confirmed." })) }).annotate({ "identifier": "V2ThreadSearchResponse__MisalignmentErrorDetails" }) @@ -6096,12 +6273,15 @@ export const V2ThreadSearchResponse__MisalignmentErrorDetails = Schema.Struct({ export type V2ThreadSearchResponse__TextElement = { readonly "byteRange": V2ThreadSearchResponse__ByteRange, readonly "placeholder"?: string | null } export const V2ThreadSearchResponse__TextElement = Schema.Struct({ "byteRange": Schema.suspend((): Schema.Codec => V2ThreadSearchResponse__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": "V2ThreadSearchResponse__TextElement" }) -export type V2ThreadSearchResponse__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadSearchResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadSearchResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } -export const V2ThreadSearchResponse__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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": "V2ThreadSearchResponse__FunctionCallOutputContentItem" }) +export type V2ThreadSearchResponse__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadSearchResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadSearchResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } +export const V2ThreadSearchResponse__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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": "V2ThreadSearchResponse__FunctionCallOutputContentItem" }) export type V2ThreadSearchResponse__MemoryCitation = { readonly "entries": ReadonlyArray, readonly "threadIds": ReadonlyArray } export const V2ThreadSearchResponse__MemoryCitation = Schema.Struct({ "entries": Schema.Array(V2ThreadSearchResponse__MemoryCitationEntry), "threadIds": Schema.Array(Schema.String) }).annotate({ "identifier": "V2ThreadSearchResponse__MemoryCitation" }) +export type V2ThreadSearchResponse__AgentMessageModeration = { readonly "display"?: V2ThreadSearchResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadSearchResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadSearchResponse__AgentMessageModeration" }) + export type V2ThreadSearchResponse__FileUpdateChange = { readonly "diff": string, readonly "kind": V2ThreadSearchResponse__PatchChangeKind, readonly "path": string } export const V2ThreadSearchResponse__FileUpdateChange = Schema.Struct({ "diff": Schema.String, "kind": V2ThreadSearchResponse__PatchChangeKind, "path": Schema.String }).annotate({ "identifier": "V2ThreadSearchResponse__FileUpdateChange" }) @@ -6123,12 +6303,18 @@ export const V2ThreadSectionUpdateResponse__ThreadSection = Schema.Struct({ "app 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__ThreadEnvironment = { readonly "cwd": V2ThreadSettingsUpdatedNotification__LegacyAppPathString, readonly "environmentId": string, readonly "runtimeWorkspaceRoots": ReadonlyArray } +export const V2ThreadSettingsUpdatedNotification__ThreadEnvironment = Schema.Struct({ "cwd": V2ThreadSettingsUpdatedNotification__LegacyAppPathString, "environmentId": Schema.String, "runtimeWorkspaceRoots": Schema.Array(V2ThreadSettingsUpdatedNotification__LegacyAppPathString) }).annotate({ "description": "An environment selected by a loaded thread, independent of connection status.", "identifier": "V2ThreadSettingsUpdatedNotification__ThreadEnvironment" }) + 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 V2ThreadSettingsUpdateParams__Settings = { readonly "developer_instructions"?: string | null, readonly "model": string, readonly "reasoning_effort"?: V2ThreadSettingsUpdateParams__ReasoningEffort | null } export const V2ThreadSettingsUpdateParams__Settings = Schema.Struct({ "developer_instructions": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "model": Schema.String, "reasoning_effort": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__ReasoningEffort, Schema.Null])) }).annotate({ "description": "Settings for a collaboration mode.", "identifier": "V2ThreadSettingsUpdateParams__Settings" }) +export type V2ThreadSettingsUpdateParams__TurnEnvironmentParams = { readonly "cwd": V2ThreadSettingsUpdateParams__LegacyAppPathString, readonly "environmentId": string, readonly "runtimeWorkspaceRoots"?: ReadonlyArray | null } +export const V2ThreadSettingsUpdateParams__TurnEnvironmentParams = Schema.Struct({ "cwd": V2ThreadSettingsUpdateParams__LegacyAppPathString, "environmentId": Schema.String, "runtimeWorkspaceRoots": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSettingsUpdateParams__LegacyAppPathString).annotate({ "description": "Environment-native runtime workspace roots. Omitted defaults to `cwd`." }), Schema.Null])) }).annotate({ "identifier": "V2ThreadSettingsUpdateParams__TurnEnvironmentParams" }) + export type V2ThreadSettingsUpdateParams__SandboxPolicy = { readonly "type": "dangerFullAccess" } | { readonly "networkAccess"?: boolean, readonly "type": "readOnly" } | { readonly "networkAccess"?: V2ThreadSettingsUpdateParams__NetworkAccess, readonly "type": "externalSandbox" } | { readonly "excludeSlashTmp"?: boolean, readonly "excludeTmpdirEnvVar"?: boolean, readonly "networkAccess"?: boolean, readonly "type": "workspaceWrite", readonly "writableRoots"?: ReadonlyArray } export const V2ThreadSettingsUpdateParams__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 => V2ThreadSettingsUpdateParams__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(V2ThreadSettingsUpdateParams__AbsolutePathBuf).annotate({ "default": [] })) }).annotate({ "title": "WorkspaceWriteSandboxPolicy" })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadSettingsUpdateParams__SandboxPolicy" }) @@ -6150,8 +6336,8 @@ export const V2ThreadStartedNotification__SubAgentSource = Schema.Union([Schema. 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadStartedNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -6159,12 +6345,15 @@ export const V2ThreadStartedNotification__MisalignmentErrorDetails = Schema.Stru 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 "image_url": string, readonly "detail"?: V2ThreadStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadStartedNotification__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadStartedNotification__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadStartedNotification__AgentMessageModeration" }) + 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" }) @@ -6204,8 +6393,8 @@ export const V2ThreadStartResponse__SubAgentSource = Schema.Union([Schema.Litera 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadStartResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadStartResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -6213,12 +6402,15 @@ export const V2ThreadStartResponse__MisalignmentErrorDetails = Schema.Struct({ " 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 "image_url": string, readonly "detail"?: V2ThreadStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadStartResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadStartResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadStartResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadStartResponse__AgentMessageModeration" }) + 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" }) @@ -6234,12 +6426,15 @@ export const V2ThreadStatusChangedNotification__ThreadStatus = Schema.Union([Sch export type V2ThreadTimelineListResponse__TextElement = { readonly "byteRange": V2ThreadTimelineListResponse__ByteRange, readonly "placeholder"?: string | null } export const V2ThreadTimelineListResponse__TextElement = Schema.Struct({ "byteRange": Schema.suspend((): Schema.Codec => V2ThreadTimelineListResponse__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": "V2ThreadTimelineListResponse__TextElement" }) -export type V2ThreadTimelineListResponse__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadTimelineListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadTimelineListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } -export const V2ThreadTimelineListResponse__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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": "V2ThreadTimelineListResponse__FunctionCallOutputContentItem" }) +export type V2ThreadTimelineListResponse__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadTimelineListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadTimelineListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": string, readonly "type": "input_audio" } | { readonly "encrypted_content": string, readonly "type": "encrypted_content" } +export const V2ThreadTimelineListResponse__FunctionCallOutputContentItem = Schema.Union([Schema.Struct({ "text": Schema.String, "type": Schema.Literal("input_text").annotate({ "title": "InputTextFunctionCallOutputContentItemType" }) }).annotate({ "title": "InputTextFunctionCallOutputContentItem" }), Schema.Union([Schema.Struct({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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": "V2ThreadTimelineListResponse__FunctionCallOutputContentItem" }) export type V2ThreadTimelineListResponse__MemoryCitation = { readonly "entries": ReadonlyArray, readonly "threadIds": ReadonlyArray } export const V2ThreadTimelineListResponse__MemoryCitation = Schema.Struct({ "entries": Schema.Array(V2ThreadTimelineListResponse__MemoryCitationEntry), "threadIds": Schema.Array(Schema.String) }).annotate({ "identifier": "V2ThreadTimelineListResponse__MemoryCitation" }) +export type V2ThreadTimelineListResponse__AgentMessageModeration = { readonly "display"?: V2ThreadTimelineListResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadTimelineListResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadTimelineListResponse__AgentMessageModeration" }) + export type V2ThreadTimelineListResponse__CommandAction = { readonly "command": string, readonly "name": string, readonly "path": V2ThreadTimelineListResponse__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 V2ThreadTimelineListResponse__CommandAction = Schema.Union([Schema.Struct({ "command": Schema.String, "name": Schema.String, "path": V2ThreadTimelineListResponse__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": "V2ThreadTimelineListResponse__CommandAction" }) @@ -6258,8 +6453,8 @@ export const V2ThreadTimelineListResponse__ImageGenerationInputImage = Schema.St export type V2ThreadTimelineListResponse__ThreadRealtimeItem = { readonly "type": "realtimeSessionStarted", readonly "id": string, readonly "realtimeSessionId": string } | { readonly "role": V2ThreadTimelineListResponse__ThreadRealtimeTranscriptRole, readonly "text": string, readonly "type": "transcriptSegment", readonly "id": string, readonly "realtimeSessionId": string } | { readonly "item_id": string, readonly "presentation": V2ThreadTimelineListResponse__ThreadRealtimeBemItemPresentation, readonly "turn_id": string, readonly "type": "bemItemPromoted", readonly "id": string, readonly "realtimeSessionId": string } | { readonly "outcome": V2ThreadTimelineListResponse__ThreadRealtimeSessionOutcome, readonly "type": "realtimeSessionClosed", readonly "id": string, readonly "realtimeSessionId": string } export const V2ThreadTimelineListResponse__ThreadRealtimeItem = Schema.Union([Schema.Struct({ "type": Schema.Literal("realtimeSessionStarted").annotate({ "title": "RealtimeSessionStartedThreadRealtimeItemType" }), "id": Schema.String, "realtimeSessionId": Schema.String }).annotate({ "title": "RealtimeSessionStartedThreadRealtimeItem", "description": "EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline." }), Schema.Struct({ "role": V2ThreadTimelineListResponse__ThreadRealtimeTranscriptRole, "text": Schema.String, "type": Schema.Literal("transcriptSegment").annotate({ "title": "TranscriptSegmentThreadRealtimeItemType" }), "id": Schema.String, "realtimeSessionId": Schema.String }).annotate({ "title": "TranscriptSegmentThreadRealtimeItem", "description": "EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline." }), Schema.Struct({ "item_id": Schema.String, "presentation": V2ThreadTimelineListResponse__ThreadRealtimeBemItemPresentation, "turn_id": Schema.String, "type": Schema.Literal("bemItemPromoted").annotate({ "title": "BemItemPromotedThreadRealtimeItemType" }), "id": Schema.String, "realtimeSessionId": Schema.String }).annotate({ "title": "BemItemPromotedThreadRealtimeItem", "description": "EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline." }), Schema.Struct({ "outcome": V2ThreadTimelineListResponse__ThreadRealtimeSessionOutcome, "type": Schema.Literal("realtimeSessionClosed").annotate({ "title": "RealtimeSessionClosedThreadRealtimeItemType" }), "id": Schema.String, "realtimeSessionId": Schema.String }).annotate({ "title": "RealtimeSessionClosedThreadRealtimeItem", "description": "EXPERIMENTAL - a thread-scoped realtime item in the canonical timeline." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadTimelineListResponse__ThreadRealtimeItem" }) -export type V2ThreadTimelineListResponse__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "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": V2ThreadTimelineListResponse__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadTimelineListResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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": V2ThreadTimelineListResponse__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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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": "V2ThreadTimelineListResponse__CodexErrorInfo" }) +export type V2ThreadTimelineListResponse__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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": V2ThreadTimelineListResponse__NonSteerableTurnKind } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadTimelineListResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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": V2ThreadTimelineListResponse__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.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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": "V2ThreadTimelineListResponse__CodexErrorInfo" }) export type V2ThreadTimelineListResponse__MisalignmentErrorDetails = { readonly "detailedExplanation"?: string | null, readonly "errorType"?: string | null, readonly "reviewTarget"?: string | null, readonly "steer"?: V2ThreadTimelineListResponse__MisalignmentSteer | null } export const V2ThreadTimelineListResponse__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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), Schema.Null])), "steer": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__MisalignmentSteer, Schema.Null]).annotate({ "description": "Instruction to submit as the next turn's user input if continuation is confirmed." })) }).annotate({ "identifier": "V2ThreadTimelineListResponse__MisalignmentErrorDetails" }) @@ -6267,8 +6462,8 @@ export const V2ThreadTimelineListResponse__MisalignmentErrorDetails = Schema.Str 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadTurnsListResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadTurnsListResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -6276,12 +6471,15 @@ export const V2ThreadTurnsListResponse__MisalignmentErrorDetails = Schema.Struct 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 "image_url": string, readonly "detail"?: V2ThreadTurnsListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadTurnsListResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadTurnsListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadTurnsListResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadTurnsListResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadTurnsListResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadTurnsListResponse__AgentMessageModeration" }) + 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" }) @@ -6315,8 +6513,8 @@ export const V2ThreadUnarchiveResponse__SubAgentSource = Schema.Union([Schema.Li 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2ThreadUnarchiveResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2ThreadUnarchiveResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -6324,12 +6522,15 @@ export const V2ThreadUnarchiveResponse__MisalignmentErrorDetails = Schema.Struct 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 "image_url": string, readonly "detail"?: V2ThreadUnarchiveResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadUnarchiveResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2ThreadUnarchiveResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2ThreadUnarchiveResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2ThreadUnarchiveResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2ThreadUnarchiveResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2ThreadUnarchiveResponse__AgentMessageModeration" }) + 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" }) @@ -6339,8 +6540,8 @@ export const V2ThreadUnarchiveResponse__McpAppUi = Schema.Struct({ "preferredMod 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2TurnCompletedNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2TurnCompletedNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -6348,12 +6549,15 @@ export const V2TurnCompletedNotification__MisalignmentErrorDetails = Schema.Stru 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 "image_url": string, readonly "detail"?: V2TurnCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2TurnCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2TurnCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2TurnCompletedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2TurnCompletedNotification__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2TurnCompletedNotification__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2TurnCompletedNotification__AgentMessageModeration" }) + 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" }) @@ -6372,8 +6576,11 @@ export const V2TurnCompletedNotification__ImageGenerationInputImage = Schema.Str 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2TurnStartedNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 V2TurnSettingsUpdateParams__TurnEnvironmentParams = { readonly "cwd": V2TurnSettingsUpdateParams__LegacyAppPathString, readonly "environmentId": string, readonly "runtimeWorkspaceRoots"?: ReadonlyArray | null } +export const V2TurnSettingsUpdateParams__TurnEnvironmentParams = Schema.Struct({ "cwd": V2TurnSettingsUpdateParams__LegacyAppPathString, "environmentId": Schema.String, "runtimeWorkspaceRoots": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnSettingsUpdateParams__LegacyAppPathString).annotate({ "description": "Environment-native runtime workspace roots. Omitted defaults to `cwd`." }), Schema.Null])) }).annotate({ "identifier": "V2TurnSettingsUpdateParams__TurnEnvironmentParams" }) + +export type V2TurnStartedNotification__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2TurnStartedNotification__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -6381,12 +6588,15 @@ export const V2TurnStartedNotification__MisalignmentErrorDetails = Schema.Struct 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 "image_url": string, readonly "detail"?: V2TurnStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2TurnStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2TurnStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2TurnStartedNotification__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2TurnStartedNotification__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2TurnStartedNotification__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2TurnStartedNotification__AgentMessageModeration" }) + 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" }) @@ -6414,14 +6624,14 @@ export const V2TurnStartParams__TurnEnvironmentParams = Schema.Struct({ "cwd": V 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 "image_url": string, readonly "detail"?: V2TurnStartParams__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2TurnStartParams__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2TurnStartParams__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2TurnStartParams__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartParams__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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" | "modelNotFound" | "policyCapacityUnavailable" | "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 } } | string | { readonly [x: string]: Schema.Json } -export const V2TurnStartResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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__CodexErrorInfo = "contextWindowExceeded" | "sessionBudgetExceeded" | "usageLimitExceeded" | "rateLimitExceeded" | "flexUnavailable" | "serverOverloaded" | "modelNotFound" | "policyCapacityUnavailable" | "cyberPolicy" | "misalignmentPolicyViolation" | "tooManyDenials" | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | "other" | "inferenceHookDenied" | { 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 } } | string | { readonly [x: string]: Schema.Json } +export const V2TurnStartResponse__CodexErrorInfo = Schema.Union([Schema.Literals(["contextWindowExceeded", "sessionBudgetExceeded", "usageLimitExceeded", "rateLimitExceeded", "flexUnavailable", "serverOverloaded", "modelNotFound", "policyCapacityUnavailable", "cyberPolicy", "misalignmentPolicyViolation", "tooManyDenials", "internalServerError", "unauthorized", "badRequest", "threadRollbackFailed", "sandboxError", "other"]), Schema.Literal("inferenceHookDenied").annotate({ "description": "The workspace's inference hook explicitly denied this request." }), 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`." }), Schema.Union([Schema.String, Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))])]).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 "reviewTarget"?: 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])), "reviewTarget": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque server-issued block target. Presence alone does not enable target-based continuation." }), 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" }) @@ -6429,12 +6639,15 @@ export const V2TurnStartResponse__MisalignmentErrorDetails = Schema.Struct({ "de 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 "image_url": string, readonly "detail"?: V2TurnStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2TurnStartResponse__ImageDetail | null, readonly "type": "input_image" } | { 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), 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__FunctionCallOutputContentItem = { readonly "text": string, readonly "type": "input_text" } | { readonly "image_url": string, readonly "detail"?: V2TurnStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "file_id": string, readonly "detail"?: V2TurnStartResponse__ImageDetail | null, readonly "type": "input_image" } | { readonly "audio_url": string, readonly "type": "input_audio" } | { readonly "file_id": 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({ "image_url": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "ImageUrlFunctionCallOutputContentItem" }), Schema.Struct({ "file_id": Schema.String, "detail": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageDetail, Schema.Null])), "type": Schema.Literal("input_image").annotate({ "title": "InputImageFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem" })]), Schema.Union([Schema.Struct({ "audio_url": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "AudioUrlFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." }), Schema.Struct({ "file_id": Schema.String, "type": Schema.Literal("input_audio").annotate({ "title": "InputAudioFunctionCallOutputContentItemType" }) }).annotate({ "title": "FileIdFunctionCallOutputContentItem", "description": "Inline audio data or an uploaded file loaded by the Responses API." })]), 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__AgentMessageModeration = { readonly "display"?: V2TurnStartResponse__AgentMessageDisplay | null, readonly "moderated": boolean } +export const V2TurnStartResponse__AgentMessageModeration = Schema.Struct({ "display": Schema.optionalKey(Schema.Union([V2TurnStartResponse__AgentMessageDisplay, Schema.Null])), "moderated": Schema.Boolean }).annotate({ "identifier": "V2TurnStartResponse__AgentMessageModeration" }) + 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" }) @@ -6462,6 +6675,9 @@ export const V2UserVerificationRpcError__UserVerificationErrorDetails = Schema.U 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__TurnSettingsUpdateParams = { readonly "approvalsReviewer"?: ClientRequest__ApprovalsReviewer | null, readonly "effort"?: ClientRequest__ReasoningEffort | null, readonly "environments"?: ReadonlyArray | null, readonly "model"?: string | null, readonly "serviceTier"?: string | null, readonly "summary"?: ClientRequest__ReasoningSummary | null, readonly "threadId": string, readonly "turnId": string } +export const ClientRequest__TurnSettingsUpdateParams = Schema.Struct({ "approvalsReviewer": Schema.optionalKey(Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ "description": "Changes the active turn's reviewer without changing future thread settings. Already captured steps and pending approvals retain their original reviewer." })), "effort": Schema.optionalKey(Schema.Union([ClientRequest__ReasoningEffort, Schema.Null]).annotate({ "description": "Omission or `null` leaves the effort unchanged." })), "environments": Schema.optionalKey(Schema.Union([Schema.Array(ClientRequest__TurnEnvironmentParams).annotate({ "description": "Replace the environments for subsequent steps of this turn, not future turns. Omitted/null preserves the selection; [] clears it. An already-started step is unchanged." }), Schema.Null])), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omission or `null` leaves the model unchanged." }), Schema.Null])), "serviceTier": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "`null` clears the requested tier; omission leaves it unchanged." }), Schema.Null])), "summary": Schema.optionalKey(Schema.Union([ClientRequest__ReasoningSummary, Schema.Null]).annotate({ "description": "Omission or `null` leaves the summary preference unchanged." })), "threadId": Schema.String, "turnId": Schema.String }).annotate({ "description": "Experimental settings changes for one running turn, not future turns. Unsupported fields are rejected rather than silently ignored. Any live task kind may accept publication. Child sessions and consumers of frozen initial settings are unchanged.", "identifier": "ClientRequest__TurnSettingsUpdateParams" }) + export type ClientRequest__ProjectCreateParams = { readonly "idempotencyKey": string, readonly "metadata"?: { readonly [x: string]: string } | null, readonly "name": string, readonly "roots": ReadonlyArray } export const ClientRequest__ProjectCreateParams = Schema.Struct({ "idempotencyKey": Schema.String, "metadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null])), "name": Schema.String, "roots": Schema.Array(ClientRequest__ProjectRoot) }).annotate({ "identifier": "ClientRequest__ProjectCreateParams" }) @@ -6486,8 +6702,8 @@ export const ClientRequest__UserInput = Schema.Union([Schema.Struct({ "text": Sc 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 "permissionProfile"?: string | 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])), "permissionProfile": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional active permissions profile id for this command.\n\nDefaults to the user's configured permissions when omitted. Cannot be combined with `sandboxPolicy`." }), 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__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__ThreadItemsListParams = { readonly "cursor"?: ClientRequest__ThreadItemsListCursor | null, readonly "deferOutput"?: ClientRequest__ThreadItemOutputDeferral | 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." })), "deferOutput": Schema.optionalKey(Schema.Union([ClientRequest__ThreadItemOutputDeferral, Schema.Null]).annotate({ "description": "For a single turn, choose which saved outputs to fetch separately by item ID." })), "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" }) @@ -6498,6 +6714,9 @@ export const ClientRequest__PluginShareUpdateTargetsParams = Schema.Struct({ "di export type ClientRequest__ThreadRealtimeStartParams = { readonly "backendReasoningStatus"?: boolean, readonly "clientManagedHandoffs"?: boolean | null, readonly "codexResponseHandoffChannelPrefixes"?: { readonly [x: string]: ReadonlyArray } | null, readonly "codexResponseHandoffMode"?: ClientRequest__CodexResponseHandoffMode | null, readonly "codexResponseItemPrefix"?: string | null, readonly "codexResponsesAsItems"?: boolean | null, readonly "delegationAckFiller"?: boolean | null, readonly "flushTranscriptTailOnSessionEnd"?: boolean | null, readonly "includeStartupContext"?: boolean | null, readonly "initialItems"?: ReadonlyArray | null, readonly "model"?: string | null, readonly "outputModality": ClientRequest__RealtimeOutputModality, readonly "prompt"?: string | null, readonly "realtimeEndInstructions"?: string | null, readonly "realtimeSessionId"?: string | null, readonly "realtimeStartInstructions"?: string | null, readonly "threadId": string, readonly "transport"?: ClientRequest__ThreadRealtimeStartTransport | null, readonly "version"?: ClientRequest__RealtimeConversationVersion | null, readonly "voice"?: ClientRequest__RealtimeVoice | null, readonly "voiceSessionId"?: string | null } export const ClientRequest__ThreadRealtimeStartParams = Schema.Struct({ "backendReasoningStatus": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Relays public reasoning summaries as quiet context for realtime V3 delegations. Defaults to false." })), "clientManagedHandoffs": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Leaves Codex response handoffs to the client's explicit append calls instead of forwarding them automatically. Defaults to false." }), Schema.Null])), "codexResponseHandoffChannelPrefixes": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.Array(Schema.String)).annotate({ "description": "Overrides BEM channel prefixes by `analysis`, `commentary`, or `final`. Omitted channels retain their default uppercase bracketed prefixes." }), Schema.Null])), "codexResponseHandoffMode": Schema.optionalKey(Schema.Union([ClientRequest__CodexResponseHandoffMode, Schema.Null]).annotate({ "description": "Selects how automatic Codex responses are routed in Frameless Bidi sessions. Omitted values default to `thinking`. Realtime V1 and V2 ignore this setting." })), "codexResponseItemPrefix": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional prefix added to automatic Codex response items when `codexResponsesAsItems` is true." }), Schema.Null])), "codexResponsesAsItems": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Sends automatic Codex responses as realtime conversation items instead of handoff appends." }), Schema.Null])), "delegationAckFiller": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Controls whether a realtime V3 delegation produces an acknowledgement filler. Omitted values preserve the Realtime API's default behavior." }), Schema.Null])), "flushTranscriptTailOnSessionEnd": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Routes any transcript tail remaining at session end through Codex. Defaults to false. TODO: Remove this rollout knob once transcript-tail flushing is always enabled." }), Schema.Null])), "includeStartupContext": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Set to false to start without Codex's startup context. Omitted or null includes it." }), Schema.Null])), "initialItems": Schema.optionalKey(Schema.Union([Schema.Array(ClientRequest__ThreadRealtimeInitialItem).annotate({ "description": "Adds complete role-bearing text items to the initial Frameless Bidi session history. This is only supported by realtime V3 and is sent during session startup. Requests are limited to 128 items and 8,192 estimated text tokens in total." }), Schema.Null])), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Overrides the configured realtime model for this session only." }), Schema.Null])), "outputModality": Schema.suspend((): Schema.Codec => ClientRequest__RealtimeOutputModality).annotate({ "description": "Selects text or audio output for the realtime session. Transport and voice stay independent so clients can choose how they connect separately from what the model emits." }), "prompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "realtimeEndInstructions": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Developer instructions given to the backing Codex model when this realtime session ends." }), Schema.Null])), "realtimeSessionId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "realtimeStartInstructions": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Developer instructions given to the backing Codex model when this realtime session starts." }), Schema.Null])), "threadId": Schema.String, "transport": Schema.optionalKey(Schema.Union([ClientRequest__ThreadRealtimeStartTransport, Schema.Null])), "version": Schema.optionalKey(Schema.Union([ClientRequest__RealtimeConversationVersion, Schema.Null]).annotate({ "description": "Overrides the configured realtime protocol version for this session only." })), "voice": Schema.optionalKey(Schema.Union([ClientRequest__RealtimeVoice, Schema.Null])), "voiceSessionId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Client-generated identifier for the product voice session. This is distinct from `realtimeSessionId`." }), Schema.Null])) }).annotate({ "description": "EXPERIMENTAL - start a thread-scoped realtime session.", "identifier": "ClientRequest__ThreadRealtimeStartParams" }) +export type ClientRequest__ModelProviderConfigWriteParams = { readonly "settings": ClientRequest__ProviderSettingsPatch } +export const ClientRequest__ModelProviderConfigWriteParams = Schema.Struct({ "settings": ClientRequest__ProviderSettingsPatch }).annotate({ "identifier": "ClientRequest__ModelProviderConfigWriteParams" }) + 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" }) @@ -6717,6 +6936,12 @@ export const V2ItemStartedNotification__FunctionCallOutputBody = Schema.Union([S 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 V2ModelProviderConfigWriteResponse__ModelProviderSummary = { readonly "baseUrl"?: string | null, readonly "canEdit": boolean, readonly "id": string, readonly "name": string, readonly "settings": V2ModelProviderConfigWriteResponse__ProviderSettings } +export const V2ModelProviderConfigWriteResponse__ModelProviderSummary = Schema.Struct({ "baseUrl": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Null when the endpoint is absent or cannot be safely displayed." }), Schema.Null])), "canEdit": Schema.Boolean.annotate({ "description": "Whether a supported configuration field can be edited in the active user layer." }), "id": Schema.String, "name": Schema.String, "settings": V2ModelProviderConfigWriteResponse__ProviderSettings }).annotate({ "identifier": "V2ModelProviderConfigWriteResponse__ModelProviderSummary" }) + +export type V2ModelProviderListResponse__ModelProviderSummary = { readonly "baseUrl"?: string | null, readonly "canEdit": boolean, readonly "id": string, readonly "name": string, readonly "settings": V2ModelProviderListResponse__ProviderSettings } +export const V2ModelProviderListResponse__ModelProviderSummary = Schema.Struct({ "baseUrl": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Null when the endpoint is absent or cannot be safely displayed." }), Schema.Null])), "canEdit": Schema.Boolean.annotate({ "description": "Whether a supported configuration field can be edited in the active user layer." }), "id": Schema.String, "name": Schema.String, "settings": V2ModelProviderListResponse__ProviderSettings }).annotate({ "identifier": "V2ModelProviderListResponse__ModelProviderSummary" }) + 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" }) @@ -6999,14 +7224,14 @@ export const ClientRequest__ResponseItem = Schema.Union([Schema.Struct({ "id": S export type ClientRequest__TurnToolOutput = { readonly "name": string, readonly "namespace"?: string | null, readonly "output": ClientRequest__FunctionCallOutputBody, readonly "retain"?: boolean } export const ClientRequest__TurnToolOutput = Schema.Struct({ "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": ClientRequest__FunctionCallOutputBody, "retain": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Requests retention of this output in the thread's model history." })) }).annotate({ "identifier": "ClientRequest__TurnToolOutput" }) -export type ClientRequest__ThreadSettingsUpdateParams = { readonly "approvalPolicy"?: ClientRequest__AskForApproval | null, readonly "approvalsReviewer"?: ClientRequest__ApprovalsReviewer | null, readonly "collaborationMode"?: ClientRequest__CollaborationMode | null, readonly "cwd"?: string | null, readonly "disabledPluginIds"?: ReadonlyArray | null, readonly "effort"?: ClientRequest__ReasoningEffort | null, readonly "model"?: string | null, readonly "multiAgentMode"?: ClientRequest__MultiAgentMode | null, readonly "permissions"?: string | null, readonly "personality"?: ClientRequest__Personality | null, readonly "sandboxPolicy"?: ClientRequest__SandboxPolicy | null, readonly "serviceTier"?: string | null, readonly "summary"?: ClientRequest__ReasoningSummary | null, readonly "threadId": string } -export const ClientRequest__ThreadSettingsUpdateParams = Schema.Struct({ "approvalPolicy": Schema.optionalKey(Schema.Union([ClientRequest__AskForApproval, Schema.Null]).annotate({ "description": "Override the approval policy for subsequent turns." })), "approvalsReviewer": Schema.optionalKey(Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ "description": "Override where approval requests are routed for subsequent turns." })), "collaborationMode": Schema.optionalKey(Schema.Union([ClientRequest__CollaborationMode, Schema.Null]).annotate({ "description": "EXPERIMENTAL - Set a pre-set collaboration mode for subsequent turns.\n\nFor `collaboration_mode.settings.developer_instructions`, `null` means \"use the built-in instructions for the selected mode\"." })), "cwd": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the working directory for subsequent turns." }), 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([ClientRequest__ReasoningEffort, Schema.Null]).annotate({ "description": "Override the reasoning effort for subsequent turns." })), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the model for subsequent turns." }), Schema.Null])), "multiAgentMode": Schema.optionalKey(Schema.Union([ClientRequest__MultiAgentMode, Schema.Null]).annotate({ "description": "@deprecated Ignored. Use `effort: \"ultra\"` for proactive multi-agent behavior." })), "permissions": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Select a named permissions profile id for subsequent turns. Cannot be combined with `sandboxPolicy`." }), 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." })), "sandboxPolicy": Schema.optionalKey(Schema.Union([ClientRequest__SandboxPolicy, Schema.Null]).annotate({ "description": "Override the sandbox policy for subsequent turns." })), "serviceTier": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the service tier for subsequent turns. `null` clears the current service tier; omission leaves it unchanged." }), Schema.Null])), "summary": Schema.optionalKey(Schema.Union([ClientRequest__ReasoningSummary, Schema.Null]).annotate({ "description": "Override the reasoning summary for subsequent turns." })), "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadSettingsUpdateParams" }) +export type ClientRequest__ThreadSettingsUpdateParams = { readonly "approvalPolicy"?: ClientRequest__AskForApproval | null, readonly "approvalsReviewer"?: ClientRequest__ApprovalsReviewer | null, readonly "collaborationMode"?: ClientRequest__CollaborationMode | null, readonly "cwd"?: string | null, readonly "disabledPluginIds"?: ReadonlyArray | null, readonly "effort"?: ClientRequest__ReasoningEffort | null, readonly "environments"?: ReadonlyArray | null, readonly "model"?: string | null, readonly "multiAgentMode"?: ClientRequest__MultiAgentMode | null, readonly "permissions"?: string | null, readonly "personality"?: ClientRequest__Personality | null, readonly "sandboxPolicy"?: ClientRequest__SandboxPolicy | null, readonly "serviceTier"?: string | null, readonly "summary"?: ClientRequest__ReasoningSummary | null, readonly "threadId": string } +export const ClientRequest__ThreadSettingsUpdateParams = Schema.Struct({ "approvalPolicy": Schema.optionalKey(Schema.Union([ClientRequest__AskForApproval, Schema.Null]).annotate({ "description": "Override the approval policy for subsequent turns." })), "approvalsReviewer": Schema.optionalKey(Schema.Union([ClientRequest__ApprovalsReviewer, Schema.Null]).annotate({ "description": "Override where approval requests are routed for subsequent turns." })), "collaborationMode": Schema.optionalKey(Schema.Union([ClientRequest__CollaborationMode, Schema.Null]).annotate({ "description": "EXPERIMENTAL - Set a pre-set collaboration mode for subsequent turns.\n\nFor `collaboration_mode.settings.developer_instructions`, `null` means \"use the built-in instructions for the selected mode\"." })), "cwd": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the working directory for subsequent turns." }), 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([ClientRequest__ReasoningEffort, Schema.Null]).annotate({ "description": "Override the reasoning effort for subsequent turns." })), "environments": Schema.optionalKey(Schema.Union([Schema.Array(ClientRequest__TurnEnvironmentParams).annotate({ "description": "Replace the environments for future turns without changing the running turn. Omitted/null preserves the selection unless `cwd` is also provided, which selects the default environments for that directory. [] clears the selection." }), Schema.Null])), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the model for subsequent turns." }), Schema.Null])), "multiAgentMode": Schema.optionalKey(Schema.Union([ClientRequest__MultiAgentMode, Schema.Null]).annotate({ "description": "@deprecated Ignored. Use `effort: \"ultra\"` for proactive multi-agent behavior." })), "permissions": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Select a named permissions profile id for subsequent turns. Cannot be combined with `sandboxPolicy`." }), 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." })), "sandboxPolicy": Schema.optionalKey(Schema.Union([ClientRequest__SandboxPolicy, Schema.Null]).annotate({ "description": "Override the sandbox policy for subsequent turns." })), "serviceTier": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the service tier for subsequent turns. `null` clears the current service tier; omission leaves it unchanged." }), Schema.Null])), "summary": Schema.optionalKey(Schema.Union([ClientRequest__ReasoningSummary, Schema.Null]).annotate({ "description": "Override the reasoning summary for subsequent turns." })), "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadSettingsUpdateParams" }) -export type ClientRequest__ThreadQueueAddParams = { readonly "clientUserMessageId": string, readonly "input": ReadonlyArray, readonly "threadId": string } -export const ClientRequest__ThreadQueueAddParams = Schema.Struct({ "clientUserMessageId": Schema.String, "input": Schema.Array(ClientRequest__UserInput), "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadQueueAddParams" }) +export type ClientRequest__ThreadQueueAddParams = { readonly "clientUserMessageId": string, readonly "input": ReadonlyArray, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "threadId": string } +export const ClientRequest__ThreadQueueAddParams = Schema.Struct({ "clientUserMessageId": Schema.String, "input": Schema.Array(ClientRequest__UserInput), "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "ResponsesAPI metadata captured from the client submitting this input." }), Schema.Null])), "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadQueueAddParams" }) -export type ClientRequest__ThreadQueueUpdateParams = { readonly "input": ReadonlyArray, readonly "queuedSubmissionId": string, readonly "threadId": string } -export const ClientRequest__ThreadQueueUpdateParams = Schema.Struct({ "input": Schema.Array(ClientRequest__UserInput), "queuedSubmissionId": Schema.String, "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadQueueUpdateParams" }) +export type ClientRequest__ThreadQueueUpdateParams = { readonly "input": ReadonlyArray, readonly "queuedSubmissionId": string, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "threadId": string } +export const ClientRequest__ThreadQueueUpdateParams = Schema.Struct({ "input": Schema.Array(ClientRequest__UserInput), "queuedSubmissionId": Schema.String, "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Non-empty metadata replaces the input's metadata; omission or an empty map preserves it." }), Schema.Null])), "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__ThreadQueueUpdateParams" }) export type ClientRequest__TurnSteerParams = { readonly "additionalContext"?: { readonly [x: string]: ClientRequest__AdditionalContextEntry } | null, readonly "clientUserMessageId"?: string | null, readonly "expectedTurnId": string, readonly "input": ReadonlyArray, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "responsesapiClientMetadataPatch"?: { readonly [x: string]: string } | null, readonly "threadId": string } export const ClientRequest__TurnSteerParams = Schema.Struct({ "additionalContext": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, ClientRequest__AdditionalContextEntry).annotate({ "description": "Optional client-provided context fragments keyed by an opaque source identifier." }), Schema.Null])), "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), "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Optional metadata to enrich Codex's ResponsesAPI turn metadata. Replaces unprotected client-provided entries when supplied; an empty map clears them.\n\nEntries are flattened into the JSON string sent as `client_metadata[\"x-codex-turn-metadata\"]` on ResponsesAPI HTTP and websocket requests.\n\nThey are not sent as top-level ResponsesAPI `client_metadata` keys, and reserved keys such as `session_id`, `thread_id`, `turn_id`, and `window_id` cannot be overridden." }), Schema.Null])), "responsesapiClientMetadataPatch": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Merge entries into the ResponsesAPI turn metadata without removing existing entries. Applied after `responsesapiClientMetadata` if both are provided; reserved keys remain protected." }), Schema.Null])), "threadId": Schema.String }).annotate({ "identifier": "ClientRequest__TurnSteerParams" }) @@ -7035,11 +7260,11 @@ export const ServerNotification__ErrorNotification = Schema.Struct({ "error": Se 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 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 "multiAgentMode"?: ServerNotification__MultiAgentMode, 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])), "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": [] })), "effort": Schema.optionalKey(Schema.Union([ServerNotification__ReasoningEffort, Schema.Null])), "model": Schema.String, "modelProvider": Schema.String, "multiAgentMode": Schema.optionalKey(Schema.suspend((): Schema.Codec => ServerNotification__MultiAgentMode).annotate({ "description": "@deprecated Always `explicitRequestOnly`. Use `effort` for Ultra behavior.", "default": "explicitRequestOnly" })), "personality": Schema.optionalKey(Schema.Union([ServerNotification__Personality, Schema.Null]).annotate({ "description": "@deprecated Reports the saved setting; `friendly` and `pragmatic` no longer select a style." })), "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__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 "environments"?: ReadonlyArray | null, readonly "model": string, readonly "modelProvider": string, readonly "multiAgentMode"?: ServerNotification__MultiAgentMode, 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])), "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": [] })), "effort": Schema.optionalKey(Schema.Union([ServerNotification__ReasoningEffort, Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(ServerNotification__ThreadEnvironment).annotate({ "description": "Environments configured for future turns, in priority order, primary first. `null` means the server does not expose the selection; [] means none are selected." }), Schema.Null])), "model": Schema.String, "modelProvider": Schema.String, "multiAgentMode": Schema.optionalKey(Schema.suspend((): Schema.Codec => ServerNotification__MultiAgentMode).annotate({ "description": "@deprecated Always `explicitRequestOnly`. Use `effort` for Ultra behavior.", "default": "explicitRequestOnly" })), "personality": Schema.optionalKey(Schema.Union([ServerNotification__Personality, Schema.Null]).annotate({ "description": "@deprecated Reports the saved setting; `friendly` and `pragmatic` no longer select a style." })), "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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": ServerNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": ServerNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": ServerNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: ServerNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: ServerNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": ServerNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: ServerNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: ServerNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: ServerNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: ServerNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(ServerNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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": "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(ServerNotification__FileUpdateChange), "id": Schema.String, "status": ServerNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": ServerNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([ServerNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": ServerNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([ServerNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(ServerNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([ServerNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(ServerNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "ServerNotification__ThreadItem" }) +export type ServerNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: ServerNotification__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: ServerNotification__MemoryCitation | null, readonly "moderation"?: ServerNotification__AgentMessageModeration | null, readonly "phase"?: ServerNotification__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": ServerNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": ServerNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": ServerNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: ServerNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: ServerNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": ServerNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: ServerNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: ServerNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: ServerNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: ServerNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(ServerNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([ServerNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([ServerNotification__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([ServerNotification__AgentMessageModeration, 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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": "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(ServerNotification__FileUpdateChange), "id": Schema.String, "status": ServerNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": ServerNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([ServerNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": ServerNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([ServerNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(ServerNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([ServerNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(ServerNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "ServerNotification__ThreadItem" }) export type ServerNotification__HookStartedNotification = { readonly "run": ServerNotification__HookRunSummary, readonly "threadId": string, readonly "turnId"?: string | null } 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" }) @@ -7071,8 +7296,8 @@ export const V2ConfigRequirementsReadResponse__ComputerUseRequirements = Schema. export type V2ConfigWriteResponse__OverriddenMetadata = { readonly "effectiveValue": Schema.Json, readonly "message": string, readonly "overridingLayer": V2ConfigWriteResponse__ConfigLayerMetadata } 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 V2ItemCompletedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ItemCompletedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ItemCompletedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ItemCompletedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ItemCompletedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ItemCompletedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ItemCompletedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ItemCompletedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ItemCompletedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ItemCompletedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ItemCompletedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ItemCompletedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ItemCompletedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ItemCompletedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ItemCompletedNotification__FileUpdateChange), "id": Schema.String, "status": V2ItemCompletedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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." })), "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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ItemCompletedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ItemCompletedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ItemCompletedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ItemCompletedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ItemCompletedNotification__ThreadItem" }) +export type V2ItemCompletedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ItemCompletedNotification__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ItemCompletedNotification__MemoryCitation | null, readonly "moderation"?: V2ItemCompletedNotification__AgentMessageModeration | null, readonly "phase"?: V2ItemCompletedNotification__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ItemCompletedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ItemCompletedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ItemCompletedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ItemCompletedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ItemCompletedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ItemCompletedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ItemCompletedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ItemCompletedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ItemCompletedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ItemCompletedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ItemCompletedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ItemCompletedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ItemCompletedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__AgentMessageModeration, 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ItemCompletedNotification__FileUpdateChange), "id": Schema.String, "status": V2ItemCompletedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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." })), "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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ItemCompletedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ItemCompletedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ItemCompletedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ItemCompletedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ItemCompletedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ItemCompletedNotification__ThreadItem" }) export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry = { readonly "access": V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode, readonly "path": V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath } export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry = Schema.Struct({ "access": V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode, "path": V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath }).annotate({ "identifier": "V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry" }) @@ -7080,8 +7305,8 @@ export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandbo export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry = { readonly "access": V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode, readonly "path": V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath } export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry = Schema.Struct({ "access": V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode, "path": V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath }).annotate({ "identifier": "V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry" }) -export type V2ItemStartedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ItemStartedNotification__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ItemStartedNotification__MemoryCitation | null, readonly "phase"?: V2ItemStartedNotification__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ItemStartedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ItemStartedNotification__CommandExecutionSource, readonly "status": V2ItemStartedNotification__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ItemStartedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ItemStartedNotification__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ItemStartedNotification__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ItemStartedNotification__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ItemStartedNotification__McpToolCallResult | null, readonly "server": string, readonly "status": V2ItemStartedNotification__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ItemStartedNotification__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ItemStartedNotification__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ItemStartedNotification__CollabAgentToolCallStatus, readonly "tool": V2ItemStartedNotification__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ItemStartedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ItemStartedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ItemStartedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ItemStartedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ItemStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ItemStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ItemStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ItemStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ItemStartedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ItemStartedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ItemStartedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ItemStartedNotification__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ItemStartedNotification__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ItemStartedNotification__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ItemStartedNotification__FileUpdateChange), "id": Schema.String, "status": V2ItemStartedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__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([V2ItemStartedNotification__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([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([V2ItemStartedNotification__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ItemStartedNotification__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ItemStartedNotification__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": V2ItemStartedNotification__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ItemStartedNotification__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ItemStartedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ItemStartedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ItemStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ItemStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ItemStartedNotification__ThreadItem" }) +export type V2ItemStartedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ItemStartedNotification__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ItemStartedNotification__MemoryCitation | null, readonly "moderation"?: V2ItemStartedNotification__AgentMessageModeration | null, readonly "phase"?: V2ItemStartedNotification__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ItemStartedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ItemStartedNotification__CommandExecutionSource, readonly "status": V2ItemStartedNotification__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ItemStartedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ItemStartedNotification__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ItemStartedNotification__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ItemStartedNotification__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ItemStartedNotification__McpToolCallResult | null, readonly "server": string, readonly "status": V2ItemStartedNotification__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ItemStartedNotification__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ItemStartedNotification__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ItemStartedNotification__CollabAgentToolCallStatus, readonly "tool": V2ItemStartedNotification__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ItemStartedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ItemStartedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ItemStartedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ItemStartedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ItemStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ItemStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ItemStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ItemStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ItemStartedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ItemStartedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ItemStartedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ItemStartedNotification__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ItemStartedNotification__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ItemStartedNotification__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ItemStartedNotification__FileUpdateChange), "id": Schema.String, "status": V2ItemStartedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__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([V2ItemStartedNotification__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([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([V2ItemStartedNotification__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ItemStartedNotification__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ItemStartedNotification__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": V2ItemStartedNotification__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ItemStartedNotification__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ItemStartedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ItemStartedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ItemStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ItemStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ItemStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ItemStartedNotification__ThreadItem" }) 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 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.Array(Schema.String).annotate({ "description": "Raw plugin-service plan identifiers eligible to install the plugin." }), Schema.Null])), "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": "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([V2PluginInstalledResponse__PluginShareContext, Schema.Null]).annotate({ "description": "Remote sharing context associated with this plugin when available." })), "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" }) @@ -7101,83 +7326,83 @@ export const V2PluginShareListResponse__PluginSummary = Schema.Struct({ "authPol export type V2RawResponseItemCompletedNotification__ResponseItem = { readonly "id"?: string | null, readonly "role": string, readonly "tools": ReadonlyArray, readonly "type": "additional_tools" } | { readonly "content": ReadonlyArray, readonly "encrypted_content"?: string | null, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null, readonly "phase"?: V2RawResponseItemCompletedNotification__MessagePhase | null, readonly "role": string, readonly "status"?: string | null, 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 "encrypted_content"?: 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_content"?: string | null, 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 "status"?: string | null, readonly "type": "function_call" } | { readonly "arguments": Schema.Json, readonly "call_id"?: string | null, readonly "encrypted_content"?: 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 "encrypted_content"?: string | null, 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 "encrypted_content"?: string | null, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2RawResponseItemCompletedNotification__InternalChatMessageMetadataPassthrough | null, readonly "status"?: string | null, readonly "type": "web_search_call" } | { readonly "encrypted_content"?: string | null, 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({ "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "role": Schema.String, "tools": Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), "type": Schema.Literal("additional_tools").annotate({ "title": "AdditionalToolsResponseItemType" }) }).annotate({ "title": "AdditionalToolsResponseItem" }), Schema.Struct({ "content": Schema.Array(V2RawResponseItemCompletedNotification__ContentItem), "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])), "phase": Schema.optionalKey(Schema.Union([V2RawResponseItemCompletedNotification__MessagePhase, Schema.Null])), "role": Schema.String, "status": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "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])), "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, 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_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "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])), "status": 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])), "encrypted_content": 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, "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "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.Json.annotate({ "expected": "JSON value" })), "type": Schema.Literal("tool_search_output").annotate({ "title": "ToolSearchOutputResponseItemType" }) }).annotate({ "title": "ToolSearchOutputResponseItem" }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2RawResponseItemCompletedNotification__ResponsesApiWebSearchAction, 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])), "status": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "type": Schema.Literal("web_search_call").annotate({ "title": "WebSearchCallResponseItemType" }) }).annotate({ "title": "WebSearchCallResponseItem" }), 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])), "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({ "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 V2ReviewStartResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ReviewStartResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ReviewStartResponse__MemoryCitation | null, readonly "phase"?: V2ReviewStartResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ReviewStartResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ReviewStartResponse__CommandExecutionSource, readonly "status": V2ReviewStartResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ReviewStartResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ReviewStartResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ReviewStartResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ReviewStartResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ReviewStartResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ReviewStartResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ReviewStartResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ReviewStartResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ReviewStartResponse__CollabAgentToolCallStatus, readonly "tool": V2ReviewStartResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ReviewStartResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ReviewStartResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ReviewStartResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ReviewStartResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ReviewStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ReviewStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ReviewStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ReviewStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ReviewStartResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ReviewStartResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ReviewStartResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ReviewStartResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ReviewStartResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ReviewStartResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ReviewStartResponse__FileUpdateChange), "id": Schema.String, "status": V2ReviewStartResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__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([V2ReviewStartResponse__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([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([V2ReviewStartResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ReviewStartResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ReviewStartResponse__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": V2ReviewStartResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ReviewStartResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ReviewStartResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ReviewStartResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ReviewStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ReviewStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ReviewStartResponse__ThreadItem" }) +export type V2ReviewStartResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ReviewStartResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ReviewStartResponse__MemoryCitation | null, readonly "moderation"?: V2ReviewStartResponse__AgentMessageModeration | null, readonly "phase"?: V2ReviewStartResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ReviewStartResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ReviewStartResponse__CommandExecutionSource, readonly "status": V2ReviewStartResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ReviewStartResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ReviewStartResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ReviewStartResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ReviewStartResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ReviewStartResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ReviewStartResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ReviewStartResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ReviewStartResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ReviewStartResponse__CollabAgentToolCallStatus, readonly "tool": V2ReviewStartResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ReviewStartResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ReviewStartResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ReviewStartResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ReviewStartResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ReviewStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ReviewStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ReviewStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ReviewStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ReviewStartResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ReviewStartResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ReviewStartResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ReviewStartResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ReviewStartResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ReviewStartResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ReviewStartResponse__FileUpdateChange), "id": Schema.String, "status": V2ReviewStartResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__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([V2ReviewStartResponse__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([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([V2ReviewStartResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ReviewStartResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ReviewStartResponse__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": V2ReviewStartResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ReviewStartResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ReviewStartResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ReviewStartResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ReviewStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ReviewStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ReviewStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ReviewStartResponse__ThreadItem" }) 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 V2ThreadForkResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadForkResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadForkResponse__MemoryCitation | null, readonly "phase"?: V2ThreadForkResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadForkResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadForkResponse__CommandExecutionSource, readonly "status": V2ThreadForkResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadForkResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadForkResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadForkResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadForkResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadForkResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadForkResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadForkResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadForkResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadForkResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadForkResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadForkResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadForkResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadForkResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadForkResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadForkResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadForkResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadForkResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadForkResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadForkResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadForkResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadForkResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadForkResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadForkResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadForkResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadForkResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadForkResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__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([V2ThreadForkResponse__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([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([V2ThreadForkResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadForkResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadForkResponse__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": V2ThreadForkResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadForkResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadForkResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadForkResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadForkResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadForkResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadForkResponse__ThreadItem" }) +export type V2ThreadForkResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadForkResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadForkResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadForkResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadForkResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadForkResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadForkResponse__CommandExecutionSource, readonly "status": V2ThreadForkResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadForkResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadForkResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadForkResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadForkResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadForkResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadForkResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadForkResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadForkResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadForkResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadForkResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadForkResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadForkResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadForkResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadForkResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadForkResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadForkResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadForkResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadForkResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadForkResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadForkResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadForkResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadForkResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadForkResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadForkResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadForkResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadForkResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__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([V2ThreadForkResponse__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([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([V2ThreadForkResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadForkResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadForkResponse__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": V2ThreadForkResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadForkResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadForkResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadForkResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadForkResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadForkResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadForkResponse__ThreadItem" }) -export type V2ThreadItemsListResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadItemsListResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadItemsListResponse__MemoryCitation | null, readonly "phase"?: V2ThreadItemsListResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadItemsListResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadItemsListResponse__CommandExecutionSource, readonly "status": V2ThreadItemsListResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadItemsListResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadItemsListResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadItemsListResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadItemsListResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadItemsListResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadItemsListResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadItemsListResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadItemsListResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadItemsListResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadItemsListResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadItemsListResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadItemsListResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadItemsListResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadItemsListResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadItemsListResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadItemsListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadItemsListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadItemsListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadItemsListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadItemsListResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadItemsListResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadItemsListResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadItemsListResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadItemsListResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadItemsListResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadItemsListResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadItemsListResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__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([V2ThreadItemsListResponse__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([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([V2ThreadItemsListResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadItemsListResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadItemsListResponse__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": V2ThreadItemsListResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadItemsListResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadItemsListResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadItemsListResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadItemsListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadItemsListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadItemsListResponse__ThreadItem" }) +export type V2ThreadItemsListResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadItemsListResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadItemsListResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadItemsListResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadItemsListResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadItemsListResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadItemsListResponse__CommandExecutionSource, readonly "status": V2ThreadItemsListResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadItemsListResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadItemsListResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadItemsListResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadItemsListResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadItemsListResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadItemsListResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadItemsListResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadItemsListResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadItemsListResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadItemsListResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadItemsListResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadItemsListResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadItemsListResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadItemsListResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadItemsListResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadItemsListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadItemsListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadItemsListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadItemsListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadItemsListResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadItemsListResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadItemsListResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadItemsListResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadItemsListResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadItemsListResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadItemsListResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadItemsListResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__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([V2ThreadItemsListResponse__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([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([V2ThreadItemsListResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadItemsListResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadItemsListResponse__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": V2ThreadItemsListResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadItemsListResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadItemsListResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadItemsListResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadItemsListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadItemsListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadItemsListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadItemsListResponse__ThreadItem" }) -export type V2ThreadItemsReadResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadItemsReadResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadItemsReadResponse__MemoryCitation | null, readonly "phase"?: V2ThreadItemsReadResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadItemsReadResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadItemsReadResponse__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"?: V2ThreadItemsReadResponse__CommandExecutionSource, readonly "status": V2ThreadItemsReadResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadItemsReadResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadItemsReadResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadItemsReadResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadItemsReadResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadItemsReadResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadItemsReadResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadItemsReadResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadItemsReadResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadItemsReadResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadItemsReadResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadItemsReadResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadItemsReadResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadItemsReadResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadItemsReadResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadItemsReadResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadItemsReadResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadItemsReadResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadItemsReadResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadItemsReadResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadItemsReadResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadItemsReadResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadItemsReadResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadItemsReadResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadItemsReadResponse__FunctionCallOutputBody, "type": Schema.Literal("functionCallOutput").annotate({ "title": "FunctionCallOutputThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadItemsReadResponse__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 => V2ThreadItemsReadResponse__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 => V2ThreadItemsReadResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadItemsReadResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadItemsReadResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadItemsReadResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__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([V2ThreadItemsReadResponse__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([V2ThreadItemsReadResponse__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([V2ThreadItemsReadResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadItemsReadResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadItemsReadResponse__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": V2ThreadItemsReadResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadItemsReadResponse__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([V2ThreadItemsReadResponse__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 => V2ThreadItemsReadResponse__CollabAgentToolCallStatus).annotate({ "description": "Current status of the collab tool call." }), "tool": Schema.suspend((): Schema.Codec => V2ThreadItemsReadResponse__CollabAgentTool).annotate({ "description": "Name of the collab tool that was invoked." }), "type": Schema.Literal("collabAgentToolCall").annotate({ "title": "CollabAgentToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadItemsReadResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadItemsReadResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadItemsReadResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadItemsReadResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadItemsReadResponse__ThreadItem" }) +export type V2ThreadItemsReadResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadItemsReadResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadItemsReadResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadItemsReadResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadItemsReadResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadItemsReadResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadItemsReadResponse__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"?: V2ThreadItemsReadResponse__CommandExecutionSource, readonly "status": V2ThreadItemsReadResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadItemsReadResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadItemsReadResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadItemsReadResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadItemsReadResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadItemsReadResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadItemsReadResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadItemsReadResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadItemsReadResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadItemsReadResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadItemsReadResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadItemsReadResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadItemsReadResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadItemsReadResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadItemsReadResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadItemsReadResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadItemsReadResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadItemsReadResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadItemsReadResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadItemsReadResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadItemsReadResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadItemsReadResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadItemsReadResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadItemsReadResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadItemsReadResponse__FunctionCallOutputBody, "type": Schema.Literal("functionCallOutput").annotate({ "title": "FunctionCallOutputThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadItemsReadResponse__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 => V2ThreadItemsReadResponse__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 => V2ThreadItemsReadResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadItemsReadResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadItemsReadResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadItemsReadResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__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([V2ThreadItemsReadResponse__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([V2ThreadItemsReadResponse__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([V2ThreadItemsReadResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadItemsReadResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadItemsReadResponse__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": V2ThreadItemsReadResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadItemsReadResponse__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([V2ThreadItemsReadResponse__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 => V2ThreadItemsReadResponse__CollabAgentToolCallStatus).annotate({ "description": "Current status of the collab tool call." }), "tool": Schema.suspend((): Schema.Codec => V2ThreadItemsReadResponse__CollabAgentTool).annotate({ "description": "Name of the collab tool that was invoked." }), "type": Schema.Literal("collabAgentToolCall").annotate({ "title": "CollabAgentToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadItemsReadResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadItemsReadResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadItemsReadResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadItemsReadResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadItemsReadResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadItemsReadResponse__ThreadItem" }) -export type V2ThreadListResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadListResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadListResponse__MemoryCitation | null, readonly "phase"?: V2ThreadListResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadListResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadListResponse__CommandExecutionSource, readonly "status": V2ThreadListResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadListResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadListResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadListResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadListResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadListResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadListResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadListResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadListResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadListResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadListResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadListResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadListResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadListResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadListResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadListResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadListResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadListResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadListResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadListResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadListResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadListResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadListResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadListResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadListResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadListResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadListResponse__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([V2ThreadListResponse__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([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([V2ThreadListResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadListResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadListResponse__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": V2ThreadListResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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." }), "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([V2ThreadListResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadListResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadListResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadListResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadListResponse__ThreadItem" }) +export type V2ThreadListResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadListResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadListResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadListResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadListResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadListResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadListResponse__CommandExecutionSource, readonly "status": V2ThreadListResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadListResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadListResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadListResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadListResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadListResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadListResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadListResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadListResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadListResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadListResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadListResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadListResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadListResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadListResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadListResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadListResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadListResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadListResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadListResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadListResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadListResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadListResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadListResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadListResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadListResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadListResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadListResponse__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([V2ThreadListResponse__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([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([V2ThreadListResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadListResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadListResponse__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": V2ThreadListResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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." }), "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([V2ThreadListResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadListResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadListResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadListResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadListResponse__ThreadItem" }) -export type V2ThreadMetadataUpdateResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadMetadataUpdateResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadMetadataUpdateResponse__MemoryCitation | null, readonly "phase"?: V2ThreadMetadataUpdateResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadMetadataUpdateResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadMetadataUpdateResponse__CommandExecutionSource, readonly "status": V2ThreadMetadataUpdateResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadMetadataUpdateResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadMetadataUpdateResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadMetadataUpdateResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadMetadataUpdateResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadMetadataUpdateResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadMetadataUpdateResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadMetadataUpdateResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadMetadataUpdateResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadMetadataUpdateResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadMetadataUpdateResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadMetadataUpdateResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadMetadataUpdateResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadMetadataUpdateResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadMetadataUpdateResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadMetadataUpdateResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadMetadataUpdateResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadMetadataUpdateResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadMetadataUpdateResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadMetadataUpdateResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadMetadataUpdateResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadMetadataUpdateResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadMetadataUpdateResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__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([V2ThreadMetadataUpdateResponse__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([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([V2ThreadMetadataUpdateResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadMetadataUpdateResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadMetadataUpdateResponse__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": V2ThreadMetadataUpdateResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadMetadataUpdateResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadMetadataUpdateResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadMetadataUpdateResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadMetadataUpdateResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadMetadataUpdateResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadMetadataUpdateResponse__ThreadItem" }) +export type V2ThreadMetadataUpdateResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadMetadataUpdateResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadMetadataUpdateResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadMetadataUpdateResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadMetadataUpdateResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadMetadataUpdateResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadMetadataUpdateResponse__CommandExecutionSource, readonly "status": V2ThreadMetadataUpdateResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadMetadataUpdateResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadMetadataUpdateResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadMetadataUpdateResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadMetadataUpdateResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadMetadataUpdateResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadMetadataUpdateResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadMetadataUpdateResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadMetadataUpdateResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadMetadataUpdateResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadMetadataUpdateResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadMetadataUpdateResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadMetadataUpdateResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadMetadataUpdateResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadMetadataUpdateResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadMetadataUpdateResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadMetadataUpdateResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadMetadataUpdateResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadMetadataUpdateResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadMetadataUpdateResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadMetadataUpdateResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadMetadataUpdateResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadMetadataUpdateResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadMetadataUpdateResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__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([V2ThreadMetadataUpdateResponse__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([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([V2ThreadMetadataUpdateResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadMetadataUpdateResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadMetadataUpdateResponse__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": V2ThreadMetadataUpdateResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadMetadataUpdateResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadMetadataUpdateResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadMetadataUpdateResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadMetadataUpdateResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadMetadataUpdateResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadMetadataUpdateResponse__ThreadItem" }) -export type V2ThreadQueueAddResponse__QueuedSubmission = { readonly "clientUserMessageId": string, readonly "id": string, readonly "input": ReadonlyArray } -export const V2ThreadQueueAddResponse__QueuedSubmission = Schema.Struct({ "clientUserMessageId": Schema.String, "id": Schema.String, "input": Schema.Array(V2ThreadQueueAddResponse__UserInput) }).annotate({ "identifier": "V2ThreadQueueAddResponse__QueuedSubmission" }) +export type V2ThreadQueueAddResponse__QueuedSubmission = { readonly "clientUserMessageId": string, readonly "id": string, readonly "input": ReadonlyArray, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null } +export const V2ThreadQueueAddResponse__QueuedSubmission = Schema.Struct({ "clientUserMessageId": Schema.String, "id": Schema.String, "input": Schema.Array(V2ThreadQueueAddResponse__UserInput), "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Metadata retained with this input, including across reconnect and restoration." }), Schema.Null])) }).annotate({ "identifier": "V2ThreadQueueAddResponse__QueuedSubmission" }) -export type V2ThreadQueueListResponse__QueuedSubmission = { readonly "clientUserMessageId": string, readonly "id": string, readonly "input": ReadonlyArray } -export const V2ThreadQueueListResponse__QueuedSubmission = Schema.Struct({ "clientUserMessageId": Schema.String, "id": Schema.String, "input": Schema.Array(V2ThreadQueueListResponse__UserInput) }).annotate({ "identifier": "V2ThreadQueueListResponse__QueuedSubmission" }) +export type V2ThreadQueueListResponse__QueuedSubmission = { readonly "clientUserMessageId": string, readonly "id": string, readonly "input": ReadonlyArray, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null } +export const V2ThreadQueueListResponse__QueuedSubmission = Schema.Struct({ "clientUserMessageId": Schema.String, "id": Schema.String, "input": Schema.Array(V2ThreadQueueListResponse__UserInput), "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Metadata retained with this input, including across reconnect and restoration." }), Schema.Null])) }).annotate({ "identifier": "V2ThreadQueueListResponse__QueuedSubmission" }) -export type V2ThreadQueueStartResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadQueueStartResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadQueueStartResponse__MemoryCitation | null, readonly "phase"?: V2ThreadQueueStartResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadQueueStartResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadQueueStartResponse__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"?: V2ThreadQueueStartResponse__CommandExecutionSource, readonly "status": V2ThreadQueueStartResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadQueueStartResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadQueueStartResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadQueueStartResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadQueueStartResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadQueueStartResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadQueueStartResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadQueueStartResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadQueueStartResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadQueueStartResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadQueueStartResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadQueueStartResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadQueueStartResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadQueueStartResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadQueueStartResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadQueueStartResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadQueueStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadQueueStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadQueueStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadQueueStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadQueueStartResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadQueueStartResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadQueueStartResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadQueueStartResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadQueueStartResponse__FunctionCallOutputBody, "type": Schema.Literal("functionCallOutput").annotate({ "title": "FunctionCallOutputThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadQueueStartResponse__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 => V2ThreadQueueStartResponse__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 => V2ThreadQueueStartResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadQueueStartResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadQueueStartResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadQueueStartResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__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([V2ThreadQueueStartResponse__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([V2ThreadQueueStartResponse__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([V2ThreadQueueStartResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadQueueStartResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadQueueStartResponse__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": V2ThreadQueueStartResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadQueueStartResponse__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([V2ThreadQueueStartResponse__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 => V2ThreadQueueStartResponse__CollabAgentToolCallStatus).annotate({ "description": "Current status of the collab tool call." }), "tool": Schema.suspend((): Schema.Codec => V2ThreadQueueStartResponse__CollabAgentTool).annotate({ "description": "Name of the collab tool that was invoked." }), "type": Schema.Literal("collabAgentToolCall").annotate({ "title": "CollabAgentToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadQueueStartResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadQueueStartResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadQueueStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadQueueStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadQueueStartResponse__ThreadItem" }) +export type V2ThreadQueueStartResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadQueueStartResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadQueueStartResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadQueueStartResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadQueueStartResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadQueueStartResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadQueueStartResponse__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"?: V2ThreadQueueStartResponse__CommandExecutionSource, readonly "status": V2ThreadQueueStartResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadQueueStartResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadQueueStartResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadQueueStartResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadQueueStartResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadQueueStartResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadQueueStartResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadQueueStartResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadQueueStartResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadQueueStartResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadQueueStartResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadQueueStartResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadQueueStartResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadQueueStartResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadQueueStartResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadQueueStartResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadQueueStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadQueueStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadQueueStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadQueueStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadQueueStartResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadQueueStartResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadQueueStartResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadQueueStartResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadQueueStartResponse__FunctionCallOutputBody, "type": Schema.Literal("functionCallOutput").annotate({ "title": "FunctionCallOutputThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadQueueStartResponse__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 => V2ThreadQueueStartResponse__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 => V2ThreadQueueStartResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadQueueStartResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadQueueStartResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadQueueStartResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__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([V2ThreadQueueStartResponse__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([V2ThreadQueueStartResponse__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([V2ThreadQueueStartResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadQueueStartResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadQueueStartResponse__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": V2ThreadQueueStartResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadQueueStartResponse__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([V2ThreadQueueStartResponse__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 => V2ThreadQueueStartResponse__CollabAgentToolCallStatus).annotate({ "description": "Current status of the collab tool call." }), "tool": Schema.suspend((): Schema.Codec => V2ThreadQueueStartResponse__CollabAgentTool).annotate({ "description": "Name of the collab tool that was invoked." }), "type": Schema.Literal("collabAgentToolCall").annotate({ "title": "CollabAgentToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadQueueStartResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadQueueStartResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadQueueStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadQueueStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadQueueStartResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadQueueStartResponse__ThreadItem" }) -export type V2ThreadQueueUpdateResponse__QueuedSubmission = { readonly "clientUserMessageId": string, readonly "id": string, readonly "input": ReadonlyArray } -export const V2ThreadQueueUpdateResponse__QueuedSubmission = Schema.Struct({ "clientUserMessageId": Schema.String, "id": Schema.String, "input": Schema.Array(V2ThreadQueueUpdateResponse__UserInput) }).annotate({ "identifier": "V2ThreadQueueUpdateResponse__QueuedSubmission" }) +export type V2ThreadQueueUpdateResponse__QueuedSubmission = { readonly "clientUserMessageId": string, readonly "id": string, readonly "input": ReadonlyArray, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null } +export const V2ThreadQueueUpdateResponse__QueuedSubmission = Schema.Struct({ "clientUserMessageId": Schema.String, "id": Schema.String, "input": Schema.Array(V2ThreadQueueUpdateResponse__UserInput), "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Metadata retained with this input, including across reconnect and restoration." }), Schema.Null])) }).annotate({ "identifier": "V2ThreadQueueUpdateResponse__QueuedSubmission" }) -export type V2ThreadReadResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadReadResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadReadResponse__MemoryCitation | null, readonly "phase"?: V2ThreadReadResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadReadResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadReadResponse__CommandExecutionSource, readonly "status": V2ThreadReadResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadReadResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadReadResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadReadResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadReadResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadReadResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadReadResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadReadResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadReadResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadReadResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadReadResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadReadResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadReadResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadReadResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadReadResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadReadResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadReadResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadReadResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadReadResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadReadResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadReadResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadReadResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadReadResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadReadResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadReadResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadReadResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadReadResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__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([V2ThreadReadResponse__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([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([V2ThreadReadResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadReadResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadReadResponse__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": V2ThreadReadResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadReadResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadReadResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadReadResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadReadResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadReadResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadReadResponse__ThreadItem" }) +export type V2ThreadReadResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadReadResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadReadResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadReadResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadReadResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadReadResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadReadResponse__CommandExecutionSource, readonly "status": V2ThreadReadResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadReadResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadReadResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadReadResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadReadResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadReadResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadReadResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadReadResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadReadResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadReadResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadReadResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadReadResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadReadResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadReadResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadReadResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadReadResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadReadResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadReadResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadReadResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadReadResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadReadResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadReadResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadReadResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadReadResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadReadResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadReadResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadReadResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__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([V2ThreadReadResponse__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([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([V2ThreadReadResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadReadResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadReadResponse__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": V2ThreadReadResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadReadResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadReadResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadReadResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadReadResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadReadResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadReadResponse__ThreadItem" }) export type V2ThreadResumeParams__ResponseItem = { readonly "id"?: string | null, readonly "role": string, readonly "tools": ReadonlyArray, readonly "type": "additional_tools" } | { readonly "content": ReadonlyArray, readonly "encrypted_content"?: string | null, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "phase"?: V2ThreadResumeParams__MessagePhase | null, readonly "role": string, readonly "status"?: string | null, readonly "type": "message" } | { readonly "author": string, readonly "content": ReadonlyArray, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__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"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "summary": ReadonlyArray, readonly "type": "reasoning" } | { readonly "action": V2ThreadResumeParams__LocalShellAction, readonly "call_id"?: string | null, readonly "encrypted_content"?: string | null, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "status": V2ThreadResumeParams__LocalShellStatus, readonly "type": "local_shell_call" } | { readonly "arguments": string, readonly "call_id": string, readonly "encrypted_content"?: string | null, readonly "encrypted_function_args"?: ReadonlyArray | null, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "name": string, readonly "namespace"?: string | null, readonly "status"?: string | null, readonly "type": "function_call" } | { readonly "arguments": Schema.Json, readonly "call_id"?: string | null, readonly "encrypted_content"?: string | null, readonly "execution": string, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__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"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "name"?: string | null, readonly "namespace"?: string | null, readonly "output": V2ThreadResumeParams__FunctionCallOutputBody, readonly "type": "function_call_output" } | { readonly "call_id": string, readonly "encrypted_content"?: string | null, readonly "id"?: string | null, readonly "input": string, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__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"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "name"?: string | null, readonly "output": V2ThreadResumeParams__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"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "status": string, readonly "tools": ReadonlyArray, readonly "type": "tool_search_output" } | { readonly "action"?: V2ThreadResumeParams__ResponsesApiWebSearchAction | null, readonly "encrypted_content"?: string | null, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "status"?: string | null, readonly "type": "web_search_call" } | { readonly "encrypted_content"?: string | null, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__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"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "type": "compaction" } | { readonly "reasoning": V2ThreadResumeParams__ConfigurationReasoning, readonly "type": "configuration_update" } | { readonly "type": "compaction_trigger" } | { readonly "encrypted_content"?: string | null, readonly "id"?: string | null, readonly "internal_chat_message_metadata_passthrough"?: V2ThreadResumeParams__InternalChatMessageMetadataPassthrough | null, readonly "type": "context_compaction" } | { readonly "type": "other" } export const V2ThreadResumeParams__ResponseItem = Schema.Union([Schema.Struct({ "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "role": Schema.String, "tools": Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), "type": Schema.Literal("additional_tools").annotate({ "title": "AdditionalToolsResponseItemType" }) }).annotate({ "title": "AdditionalToolsResponseItem" }), Schema.Struct({ "content": Schema.Array(V2ThreadResumeParams__ContentItem), "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([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__MessagePhase, Schema.Null])), "role": Schema.String, "status": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "type": Schema.Literal("message").annotate({ "title": "MessageResponseItemType" }) }).annotate({ "title": "MessageResponseItem" }), Schema.Struct({ "author": Schema.String, "content": Schema.Array(V2ThreadResumeParams__AgentMessageInputContent), "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "internal_chat_message_metadata_passthrough": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__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(V2ThreadResumeParams__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([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null])), "summary": Schema.Array(V2ThreadResumeParams__ReasoningItemReasoningSummary), "type": Schema.Literal("reasoning").annotate({ "title": "ReasoningResponseItemType" }) }).annotate({ "title": "ReasoningResponseItem" }), Schema.Struct({ "action": V2ThreadResumeParams__LocalShellAction, "call_id": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Set when using the Responses API." }), Schema.Null])), "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, 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([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null])), "status": V2ThreadResumeParams__LocalShellStatus, "type": Schema.Literal("local_shell_call").annotate({ "title": "LocalShellCallResponseItemType" }) }).annotate({ "title": "LocalShellCallResponseItem" }), Schema.Struct({ "arguments": Schema.String, "call_id": Schema.String, "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "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])), "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "status": 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])), "encrypted_content": 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([V2ThreadResumeParams__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([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" }) }).annotate({ "title": "FunctionCallOutputResponseItem" }), Schema.Struct({ "call_id": Schema.String, "encrypted_content": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "input": Schema.String, "internal_chat_message_metadata_passthrough": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__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([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null])), "name": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadResumeParams__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([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null])), "status": Schema.String, "tools": Schema.Array(Schema.Json.annotate({ "expected": "JSON value" })), "type": Schema.Literal("tool_search_output").annotate({ "title": "ToolSearchOutputResponseItemType" }) }).annotate({ "title": "ToolSearchOutputResponseItem" }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ResponsesApiWebSearchAction, 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([V2ThreadResumeParams__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({ "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([V2ThreadResumeParams__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([V2ThreadResumeParams__InternalChatMessageMetadataPassthrough, Schema.Null])), "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" }) }).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([V2ThreadResumeParams__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": "V2ThreadResumeParams__ResponseItem" }) -export type V2ThreadResumeResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadResumeResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadResumeResponse__MemoryCitation | null, readonly "phase"?: V2ThreadResumeResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadResumeResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadResumeResponse__CommandExecutionSource, readonly "status": V2ThreadResumeResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadResumeResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadResumeResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadResumeResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadResumeResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadResumeResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadResumeResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadResumeResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadResumeResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadResumeResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadResumeResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadResumeResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadResumeResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadResumeResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadResumeResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadResumeResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadResumeResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadResumeResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadResumeResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadResumeResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadResumeResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadResumeResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadResumeResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadResumeResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadResumeResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadResumeResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadResumeResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__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([V2ThreadResumeResponse__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([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([V2ThreadResumeResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadResumeResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadResumeResponse__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": V2ThreadResumeResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadResumeResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadResumeResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadResumeResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadResumeResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadResumeResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadResumeResponse__ThreadItem" }) +export type V2ThreadResumeResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadResumeResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadResumeResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadResumeResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadResumeResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadResumeResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadResumeResponse__CommandExecutionSource, readonly "status": V2ThreadResumeResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadResumeResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadResumeResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadResumeResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadResumeResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadResumeResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadResumeResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadResumeResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadResumeResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadResumeResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadResumeResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadResumeResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadResumeResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadResumeResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadResumeResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadResumeResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadResumeResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadResumeResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadResumeResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadResumeResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadResumeResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadResumeResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadResumeResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadResumeResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadResumeResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadResumeResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadResumeResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__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([V2ThreadResumeResponse__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([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([V2ThreadResumeResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadResumeResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadResumeResponse__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": V2ThreadResumeResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadResumeResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadResumeResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadResumeResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadResumeResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadResumeResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadResumeResponse__ThreadItem" }) -export type V2ThreadRevertResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadRevertResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadRevertResponse__MemoryCitation | null, readonly "phase"?: V2ThreadRevertResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadRevertResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadRevertResponse__CommandExecutionSource, readonly "status": V2ThreadRevertResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadRevertResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadRevertResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadRevertResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadRevertResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadRevertResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadRevertResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadRevertResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadRevertResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadRevertResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadRevertResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadRevertResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadRevertResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadRevertResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadRevertResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadRevertResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadRevertResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadRevertResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadRevertResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadRevertResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadRevertResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadRevertResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadRevertResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadRevertResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadRevertResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadRevertResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadRevertResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadRevertResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__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([V2ThreadRevertResponse__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([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([V2ThreadRevertResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadRevertResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadRevertResponse__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": V2ThreadRevertResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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." }), "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([V2ThreadRevertResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadRevertResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadRevertResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadRevertResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadRevertResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadRevertResponse__ThreadItem" }) +export type V2ThreadRevertResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadRevertResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadRevertResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadRevertResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadRevertResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadRevertResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadRevertResponse__CommandExecutionSource, readonly "status": V2ThreadRevertResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadRevertResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadRevertResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadRevertResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadRevertResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadRevertResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadRevertResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadRevertResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadRevertResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadRevertResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadRevertResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadRevertResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadRevertResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadRevertResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadRevertResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadRevertResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadRevertResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadRevertResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadRevertResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadRevertResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadRevertResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadRevertResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadRevertResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadRevertResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadRevertResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadRevertResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadRevertResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadRevertResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__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([V2ThreadRevertResponse__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([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([V2ThreadRevertResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadRevertResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadRevertResponse__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": V2ThreadRevertResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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." }), "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([V2ThreadRevertResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadRevertResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadRevertResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadRevertResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadRevertResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadRevertResponse__ThreadItem" }) -export type V2ThreadSearchResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadSearchResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadSearchResponse__MemoryCitation | null, readonly "phase"?: V2ThreadSearchResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadSearchResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadSearchResponse__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"?: V2ThreadSearchResponse__CommandExecutionSource, readonly "status": V2ThreadSearchResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadSearchResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadSearchResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadSearchResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadSearchResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadSearchResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadSearchResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadSearchResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadSearchResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadSearchResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadSearchResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadSearchResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadSearchResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadSearchResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadSearchResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadSearchResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadSearchResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadSearchResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadSearchResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadSearchResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadSearchResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadSearchResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadSearchResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSearchResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadSearchResponse__FunctionCallOutputBody, "type": Schema.Literal("functionCallOutput").annotate({ "title": "FunctionCallOutputThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadSearchResponse__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 => V2ThreadSearchResponse__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 => V2ThreadSearchResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadSearchResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadSearchResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadSearchResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__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([V2ThreadSearchResponse__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([V2ThreadSearchResponse__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([V2ThreadSearchResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadSearchResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSearchResponse__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": V2ThreadSearchResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadSearchResponse__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([V2ThreadSearchResponse__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 => V2ThreadSearchResponse__CollabAgentToolCallStatus).annotate({ "description": "Current status of the collab tool call." }), "tool": Schema.suspend((): Schema.Codec => V2ThreadSearchResponse__CollabAgentTool).annotate({ "description": "Name of the collab tool that was invoked." }), "type": Schema.Literal("collabAgentToolCall").annotate({ "title": "CollabAgentToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadSearchResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadSearchResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadSearchResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadSearchResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadSearchResponse__ThreadItem" }) +export type V2ThreadSearchResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadSearchResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadSearchResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadSearchResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadSearchResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadSearchResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadSearchResponse__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"?: V2ThreadSearchResponse__CommandExecutionSource, readonly "status": V2ThreadSearchResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadSearchResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadSearchResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadSearchResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadSearchResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadSearchResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadSearchResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadSearchResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadSearchResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadSearchResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadSearchResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadSearchResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadSearchResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadSearchResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadSearchResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadSearchResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadSearchResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadSearchResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadSearchResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadSearchResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadSearchResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadSearchResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadSearchResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSearchResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadSearchResponse__FunctionCallOutputBody, "type": Schema.Literal("functionCallOutput").annotate({ "title": "FunctionCallOutputThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadSearchResponse__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 => V2ThreadSearchResponse__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 => V2ThreadSearchResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadSearchResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadSearchResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadSearchResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__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([V2ThreadSearchResponse__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([V2ThreadSearchResponse__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([V2ThreadSearchResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadSearchResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSearchResponse__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": V2ThreadSearchResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadSearchResponse__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([V2ThreadSearchResponse__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 => V2ThreadSearchResponse__CollabAgentToolCallStatus).annotate({ "description": "Current status of the collab tool call." }), "tool": Schema.suspend((): Schema.Codec => V2ThreadSearchResponse__CollabAgentTool).annotate({ "description": "Name of the collab tool that was invoked." }), "type": Schema.Literal("collabAgentToolCall").annotate({ "title": "CollabAgentToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadSearchResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadSearchResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadSearchResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadSearchResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadSearchResponse__ThreadItem" }) -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 "multiAgentMode"?: V2ThreadSettingsUpdatedNotification__MultiAgentMode, 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, "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, "multiAgentMode": Schema.optionalKey(Schema.suspend((): Schema.Codec => V2ThreadSettingsUpdatedNotification__MultiAgentMode).annotate({ "description": "@deprecated Always `explicitRequestOnly`. Use `effort` for Ultra behavior.", "default": "explicitRequestOnly" })), "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 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 "environments"?: ReadonlyArray | null, readonly "model": string, readonly "modelProvider": string, readonly "multiAgentMode"?: V2ThreadSettingsUpdatedNotification__MultiAgentMode, 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, "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])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSettingsUpdatedNotification__ThreadEnvironment).annotate({ "description": "Environments configured for future turns, in priority order, primary first. `null` means the server does not expose the selection; [] means none are selected." }), Schema.Null])), "model": Schema.String, "modelProvider": Schema.String, "multiAgentMode": Schema.optionalKey(Schema.suspend((): Schema.Codec => V2ThreadSettingsUpdatedNotification__MultiAgentMode).annotate({ "description": "@deprecated Always `explicitRequestOnly`. Use `effort` for Ultra behavior.", "default": "explicitRequestOnly" })), "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 V2ThreadStartedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadStartedNotification__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadStartedNotification__MemoryCitation | null, readonly "phase"?: V2ThreadStartedNotification__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadStartedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadStartedNotification__CommandExecutionSource, readonly "status": V2ThreadStartedNotification__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadStartedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadStartedNotification__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadStartedNotification__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadStartedNotification__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadStartedNotification__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadStartedNotification__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadStartedNotification__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadStartedNotification__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadStartedNotification__CollabAgentToolCallStatus, readonly "tool": V2ThreadStartedNotification__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadStartedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadStartedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadStartedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadStartedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadStartedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadStartedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadStartedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartedNotification__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadStartedNotification__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadStartedNotification__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadStartedNotification__FileUpdateChange), "id": Schema.String, "status": V2ThreadStartedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__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([V2ThreadStartedNotification__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([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([V2ThreadStartedNotification__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadStartedNotification__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartedNotification__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": V2ThreadStartedNotification__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, 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(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([V2ThreadStartedNotification__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadStartedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadStartedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadStartedNotification__ThreadItem" }) +export type V2ThreadStartedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadStartedNotification__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadStartedNotification__MemoryCitation | null, readonly "moderation"?: V2ThreadStartedNotification__AgentMessageModeration | null, readonly "phase"?: V2ThreadStartedNotification__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadStartedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadStartedNotification__CommandExecutionSource, readonly "status": V2ThreadStartedNotification__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadStartedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadStartedNotification__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadStartedNotification__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadStartedNotification__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadStartedNotification__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadStartedNotification__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadStartedNotification__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadStartedNotification__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadStartedNotification__CollabAgentToolCallStatus, readonly "tool": V2ThreadStartedNotification__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadStartedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadStartedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadStartedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadStartedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadStartedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadStartedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadStartedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartedNotification__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadStartedNotification__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadStartedNotification__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadStartedNotification__FileUpdateChange), "id": Schema.String, "status": V2ThreadStartedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__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([V2ThreadStartedNotification__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([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([V2ThreadStartedNotification__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadStartedNotification__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartedNotification__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": V2ThreadStartedNotification__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, 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(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([V2ThreadStartedNotification__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadStartedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadStartedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadStartedNotification__ThreadItem" }) -export type V2ThreadStartResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadStartResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadStartResponse__MemoryCitation | null, readonly "phase"?: V2ThreadStartResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadStartResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadStartResponse__CommandExecutionSource, readonly "status": V2ThreadStartResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadStartResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadStartResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadStartResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadStartResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadStartResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadStartResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadStartResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadStartResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadStartResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadStartResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadStartResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadStartResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadStartResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadStartResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadStartResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadStartResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadStartResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadStartResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadStartResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadStartResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadStartResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__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([V2ThreadStartResponse__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([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([V2ThreadStartResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadStartResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartResponse__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": V2ThreadStartResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadStartResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadStartResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadStartResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadStartResponse__ThreadItem" }) +export type V2ThreadStartResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadStartResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadStartResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadStartResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadStartResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadStartResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadStartResponse__CommandExecutionSource, readonly "status": V2ThreadStartResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadStartResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadStartResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadStartResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadStartResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadStartResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadStartResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | 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 "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadStartResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadStartResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadStartResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadStartResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadStartResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadStartResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadStartResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadStartResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadStartResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadStartResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadStartResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadStartResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadStartResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadStartResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadStartResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__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([V2ThreadStartResponse__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([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([V2ThreadStartResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadStartResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartResponse__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": V2ThreadStartResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadStartResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadStartResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadStartResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadStartResponse__ThreadItem" }) -export type V2ThreadTimelineListResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadTimelineListResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadTimelineListResponse__MemoryCitation | null, readonly "phase"?: V2ThreadTimelineListResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadTimelineListResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadTimelineListResponse__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"?: V2ThreadTimelineListResponse__CommandExecutionSource, readonly "status": V2ThreadTimelineListResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadTimelineListResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadTimelineListResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadTimelineListResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadTimelineListResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadTimelineListResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadTimelineListResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadTimelineListResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadTimelineListResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadTimelineListResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadTimelineListResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadTimelineListResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadTimelineListResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadTimelineListResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadTimelineListResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadTimelineListResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadTimelineListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadTimelineListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadTimelineListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadTimelineListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadTimelineListResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadTimelineListResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadTimelineListResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadTimelineListResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadTimelineListResponse__FunctionCallOutputBody, "type": Schema.Literal("functionCallOutput").annotate({ "title": "FunctionCallOutputThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadTimelineListResponse__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 => V2ThreadTimelineListResponse__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 => V2ThreadTimelineListResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadTimelineListResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadTimelineListResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadTimelineListResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__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([V2ThreadTimelineListResponse__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([V2ThreadTimelineListResponse__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([V2ThreadTimelineListResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadTimelineListResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadTimelineListResponse__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": V2ThreadTimelineListResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadTimelineListResponse__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([V2ThreadTimelineListResponse__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 => V2ThreadTimelineListResponse__CollabAgentToolCallStatus).annotate({ "description": "Current status of the collab tool call." }), "tool": Schema.suspend((): Schema.Codec => V2ThreadTimelineListResponse__CollabAgentTool).annotate({ "description": "Name of the collab tool that was invoked." }), "type": Schema.Literal("collabAgentToolCall").annotate({ "title": "CollabAgentToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadTimelineListResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadTimelineListResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadTimelineListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadTimelineListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadTimelineListResponse__ThreadItem" }) +export type V2ThreadTimelineListResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadTimelineListResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadTimelineListResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadTimelineListResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadTimelineListResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadTimelineListResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadTimelineListResponse__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"?: V2ThreadTimelineListResponse__CommandExecutionSource, readonly "status": V2ThreadTimelineListResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadTimelineListResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadTimelineListResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadTimelineListResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadTimelineListResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadTimelineListResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadTimelineListResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadTimelineListResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadTimelineListResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadTimelineListResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadTimelineListResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadTimelineListResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadTimelineListResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadTimelineListResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadTimelineListResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadTimelineListResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadTimelineListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadTimelineListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadTimelineListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadTimelineListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadTimelineListResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadTimelineListResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadTimelineListResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadTimelineListResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2ThreadTimelineListResponse__FunctionCallOutputBody, "type": Schema.Literal("functionCallOutput").annotate({ "title": "FunctionCallOutputThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadTimelineListResponse__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 => V2ThreadTimelineListResponse__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 => V2ThreadTimelineListResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadTimelineListResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadTimelineListResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadTimelineListResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__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([V2ThreadTimelineListResponse__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([V2ThreadTimelineListResponse__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([V2ThreadTimelineListResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadTimelineListResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadTimelineListResponse__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": V2ThreadTimelineListResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadTimelineListResponse__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([V2ThreadTimelineListResponse__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 => V2ThreadTimelineListResponse__CollabAgentToolCallStatus).annotate({ "description": "Current status of the collab tool call." }), "tool": Schema.suspend((): Schema.Codec => V2ThreadTimelineListResponse__CollabAgentTool).annotate({ "description": "Name of the collab tool that was invoked." }), "type": Schema.Literal("collabAgentToolCall").annotate({ "title": "CollabAgentToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadTimelineListResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadTimelineListResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadTimelineListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadTimelineListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(Schema.Union([V2ThreadTimelineListResponse__AbsolutePathBuf, Schema.Null])), "status": Schema.String, "transparentBackground": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "type": Schema.Literal("imageGeneration").annotate({ "title": "ImageGenerationThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadTimelineListResponse__ThreadItem" }) -export type V2ThreadTurnsListResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadTurnsListResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadTurnsListResponse__MemoryCitation | null, readonly "phase"?: V2ThreadTurnsListResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadTurnsListResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadTurnsListResponse__CommandExecutionSource, readonly "status": V2ThreadTurnsListResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadTurnsListResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadTurnsListResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadTurnsListResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadTurnsListResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadTurnsListResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadTurnsListResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadTurnsListResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadTurnsListResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadTurnsListResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadTurnsListResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadTurnsListResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadTurnsListResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadTurnsListResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadTurnsListResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadTurnsListResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadTurnsListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadTurnsListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadTurnsListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadTurnsListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadTurnsListResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadTurnsListResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadTurnsListResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadTurnsListResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadTurnsListResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadTurnsListResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadTurnsListResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadTurnsListResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__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([V2ThreadTurnsListResponse__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([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([V2ThreadTurnsListResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadTurnsListResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadTurnsListResponse__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": V2ThreadTurnsListResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadTurnsListResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadTurnsListResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadTurnsListResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadTurnsListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadTurnsListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadTurnsListResponse__ThreadItem" }) +export type V2ThreadTurnsListResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadTurnsListResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadTurnsListResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadTurnsListResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadTurnsListResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadTurnsListResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": 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 "scriptPath"?: string | null, readonly "source"?: V2ThreadTurnsListResponse__CommandExecutionSource, readonly "status": V2ThreadTurnsListResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadTurnsListResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadTurnsListResponse__McpToolCallAppContext | null, readonly "arguments": Schema.Json, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadTurnsListResponse__McpToolCallError | null, readonly "id": string, readonly "mcpAppResourceUri"?: string | null, readonly "mcpAppUi"?: V2ThreadTurnsListResponse__McpAppUi | null, readonly "pluginId"?: string | null, readonly "readOnlyHint"?: boolean | null, readonly "result"?: V2ThreadTurnsListResponse__McpToolCallResult | null, readonly "server": string, readonly "status": V2ThreadTurnsListResponse__McpToolCallStatus, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadTurnsListResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadTurnsListResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadTurnsListResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadTurnsListResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadTurnsListResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadTurnsListResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadTurnsListResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadTurnsListResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadTurnsListResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadTurnsListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadTurnsListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadTurnsListResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadTurnsListResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadTurnsListResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadTurnsListResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadTurnsListResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadTurnsListResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(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.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().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 => V2ThreadTurnsListResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadTurnsListResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadTurnsListResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadTurnsListResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__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([V2ThreadTurnsListResponse__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([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([V2ThreadTurnsListResponse__McpToolCallResult, Schema.Null])), "server": Schema.String, "status": V2ThreadTurnsListResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadTurnsListResponse__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": V2ThreadTurnsListResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "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([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([V2ThreadTurnsListResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadTurnsListResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadTurnsListResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadTurnsListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadTurnsListResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadTurnsListResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadTurnsListResponse__ThreadItem" }) -export type V2ThreadUnarchiveResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadUnarchiveResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadUnarchiveResponse__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"?: V2ThreadUnarchiveResponse__CommandExecutionSource, readonly "status": V2ThreadUnarchiveResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadUnarchiveResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadUnarchiveResponse__McpToolCallAppContext | null, 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, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadUnarchiveResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadUnarchiveResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadUnarchiveResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadUnarchiveResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadUnarchiveResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadUnarchiveResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadUnarchiveResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadUnarchiveResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadUnarchiveResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadUnarchiveResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadUnarchiveResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadUnarchiveResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadUnarchiveResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadUnarchiveResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadUnarchiveResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadUnarchiveResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadUnarchiveResponse__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 => 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().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 => V2ThreadUnarchiveResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadUnarchiveResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadUnarchiveResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadUnarchiveResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__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([V2ThreadUnarchiveResponse__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([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])), "server": Schema.String, "status": V2ThreadUnarchiveResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadUnarchiveResponse__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": V2ThreadUnarchiveResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadUnarchiveResponse__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([V2ThreadUnarchiveResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadUnarchiveResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadUnarchiveResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadUnarchiveResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadUnarchiveResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadUnarchiveResponse__ThreadItem" }) +export type V2ThreadUnarchiveResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2ThreadUnarchiveResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2ThreadUnarchiveResponse__MemoryCitation | null, readonly "moderation"?: V2ThreadUnarchiveResponse__AgentMessageModeration | null, readonly "phase"?: V2ThreadUnarchiveResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2ThreadUnarchiveResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2ThreadUnarchiveResponse__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"?: V2ThreadUnarchiveResponse__CommandExecutionSource, readonly "status": V2ThreadUnarchiveResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2ThreadUnarchiveResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2ThreadUnarchiveResponse__McpToolCallAppContext | null, 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, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2ThreadUnarchiveResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2ThreadUnarchiveResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2ThreadUnarchiveResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2ThreadUnarchiveResponse__CollabAgentToolCallStatus, readonly "tool": V2ThreadUnarchiveResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2ThreadUnarchiveResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2ThreadUnarchiveResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2ThreadUnarchiveResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2ThreadUnarchiveResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2ThreadUnarchiveResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadUnarchiveResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2ThreadUnarchiveResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2ThreadUnarchiveResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2ThreadUnarchiveResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2ThreadUnarchiveResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2ThreadUnarchiveResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadUnarchiveResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2ThreadUnarchiveResponse__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 => 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().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 => V2ThreadUnarchiveResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2ThreadUnarchiveResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2ThreadUnarchiveResponse__FileUpdateChange), "id": Schema.String, "status": V2ThreadUnarchiveResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__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([V2ThreadUnarchiveResponse__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([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])), "server": Schema.String, "status": V2ThreadUnarchiveResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadUnarchiveResponse__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": V2ThreadUnarchiveResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2ThreadUnarchiveResponse__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([V2ThreadUnarchiveResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2ThreadUnarchiveResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2ThreadUnarchiveResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadUnarchiveResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2ThreadUnarchiveResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2ThreadUnarchiveResponse__ThreadItem" }) -export type V2TurnCompletedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2TurnCompletedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2TurnCompletedNotification__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"?: V2TurnCompletedNotification__CommandExecutionSource, readonly "status": V2TurnCompletedNotification__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2TurnCompletedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2TurnCompletedNotification__McpToolCallAppContext | null, 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, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2TurnCompletedNotification__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2TurnCompletedNotification__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2TurnCompletedNotification__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2TurnCompletedNotification__CollabAgentToolCallStatus, readonly "tool": V2TurnCompletedNotification__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2TurnCompletedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2TurnCompletedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2TurnCompletedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2TurnCompletedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2TurnCompletedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnCompletedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2TurnCompletedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnCompletedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2TurnCompletedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2TurnCompletedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2TurnCompletedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnCompletedNotification__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2TurnCompletedNotification__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 => 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().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 => V2TurnCompletedNotification__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2TurnCompletedNotification__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2TurnCompletedNotification__FileUpdateChange), "id": Schema.String, "status": V2TurnCompletedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__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([V2TurnCompletedNotification__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([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])), "server": Schema.String, "status": V2TurnCompletedNotification__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnCompletedNotification__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": V2TurnCompletedNotification__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2TurnCompletedNotification__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([V2TurnCompletedNotification__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2TurnCompletedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2TurnCompletedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnCompletedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnCompletedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2TurnCompletedNotification__ThreadItem" }) +export type V2TurnCompletedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2TurnCompletedNotification__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2TurnCompletedNotification__MemoryCitation | null, readonly "moderation"?: V2TurnCompletedNotification__AgentMessageModeration | null, readonly "phase"?: V2TurnCompletedNotification__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2TurnCompletedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2TurnCompletedNotification__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"?: V2TurnCompletedNotification__CommandExecutionSource, readonly "status": V2TurnCompletedNotification__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2TurnCompletedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2TurnCompletedNotification__McpToolCallAppContext | null, 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, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2TurnCompletedNotification__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2TurnCompletedNotification__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2TurnCompletedNotification__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2TurnCompletedNotification__CollabAgentToolCallStatus, readonly "tool": V2TurnCompletedNotification__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2TurnCompletedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2TurnCompletedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2TurnCompletedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2TurnCompletedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2TurnCompletedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnCompletedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2TurnCompletedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnCompletedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2TurnCompletedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2TurnCompletedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2TurnCompletedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnCompletedNotification__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2TurnCompletedNotification__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 => 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().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 => V2TurnCompletedNotification__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2TurnCompletedNotification__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2TurnCompletedNotification__FileUpdateChange), "id": Schema.String, "status": V2TurnCompletedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__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([V2TurnCompletedNotification__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([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])), "server": Schema.String, "status": V2TurnCompletedNotification__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnCompletedNotification__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": V2TurnCompletedNotification__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2TurnCompletedNotification__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([V2TurnCompletedNotification__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2TurnCompletedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2TurnCompletedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnCompletedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnCompletedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnCompletedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2TurnCompletedNotification__ThreadItem" }) -export type V2TurnStartedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2TurnStartedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2TurnStartedNotification__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"?: V2TurnStartedNotification__CommandExecutionSource, readonly "status": V2TurnStartedNotification__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2TurnStartedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2TurnStartedNotification__McpToolCallAppContext | null, 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, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2TurnStartedNotification__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2TurnStartedNotification__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2TurnStartedNotification__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2TurnStartedNotification__CollabAgentToolCallStatus, readonly "tool": V2TurnStartedNotification__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2TurnStartedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2TurnStartedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2TurnStartedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2TurnStartedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2TurnStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2TurnStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2TurnStartedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2TurnStartedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2TurnStartedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__MemoryCitation, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnStartedNotification__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2TurnStartedNotification__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 => 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().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 => V2TurnStartedNotification__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2TurnStartedNotification__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2TurnStartedNotification__FileUpdateChange), "id": Schema.String, "status": V2TurnStartedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__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([V2TurnStartedNotification__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([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])), "server": Schema.String, "status": V2TurnStartedNotification__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnStartedNotification__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": V2TurnStartedNotification__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2TurnStartedNotification__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([V2TurnStartedNotification__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2TurnStartedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2TurnStartedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2TurnStartedNotification__ThreadItem" }) +export type V2TurnStartedNotification__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2TurnStartedNotification__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2TurnStartedNotification__MemoryCitation | null, readonly "moderation"?: V2TurnStartedNotification__AgentMessageModeration | null, readonly "phase"?: V2TurnStartedNotification__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2TurnStartedNotification__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2TurnStartedNotification__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"?: V2TurnStartedNotification__CommandExecutionSource, readonly "status": V2TurnStartedNotification__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2TurnStartedNotification__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2TurnStartedNotification__McpToolCallAppContext | null, 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, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2TurnStartedNotification__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2TurnStartedNotification__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2TurnStartedNotification__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2TurnStartedNotification__CollabAgentToolCallStatus, readonly "tool": V2TurnStartedNotification__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2TurnStartedNotification__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2TurnStartedNotification__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2TurnStartedNotification__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2TurnStartedNotification__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2TurnStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2TurnStartedNotification__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnStartedNotification__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2TurnStartedNotification__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2TurnStartedNotification__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2TurnStartedNotification__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnStartedNotification__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2TurnStartedNotification__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 => 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().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 => V2TurnStartedNotification__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2TurnStartedNotification__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2TurnStartedNotification__FileUpdateChange), "id": Schema.String, "status": V2TurnStartedNotification__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__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([V2TurnStartedNotification__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([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])), "server": Schema.String, "status": V2TurnStartedNotification__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnStartedNotification__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": V2TurnStartedNotification__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2TurnStartedNotification__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([V2TurnStartedNotification__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2TurnStartedNotification__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2TurnStartedNotification__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnStartedNotification__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnStartedNotification__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2TurnStartedNotification__ThreadItem" }) export type V2TurnStartParams__TurnToolOutput = { readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2TurnStartParams__FunctionCallOutputBody, readonly "retain"?: boolean } export const V2TurnStartParams__TurnToolOutput = Schema.Struct({ "name": Schema.String, "namespace": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "output": V2TurnStartParams__FunctionCallOutputBody, "retain": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Requests retention of this output in the thread's model history." })) }).annotate({ "identifier": "V2TurnStartParams__TurnToolOutput" }) -export type V2TurnStartResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { 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 "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2TurnStartResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2TurnStartResponse__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"?: V2TurnStartResponse__CommandExecutionSource, readonly "status": V2TurnStartResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2TurnStartResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2TurnStartResponse__McpToolCallAppContext | null, 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, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2TurnStartResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2TurnStartResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2TurnStartResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2TurnStartResponse__CollabAgentToolCallStatus, readonly "tool": V2TurnStartResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2TurnStartResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2TurnStartResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2TurnStartResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2TurnStartResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2TurnStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2TurnStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } -export const V2TurnStartResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2TurnStartResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2TurnStartResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnStartResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2TurnStartResponse__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 => 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().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 => V2TurnStartResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2TurnStartResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2TurnStartResponse__FileUpdateChange), "id": Schema.String, "status": V2TurnStartResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2TurnStartResponse__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([V2TurnStartResponse__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([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])), "server": Schema.String, "status": V2TurnStartResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnStartResponse__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": V2TurnStartResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2TurnStartResponse__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([V2TurnStartResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2TurnStartResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2TurnStartResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2TurnStartResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2TurnStartResponse__ThreadItem" }) +export type V2TurnStartResponse__ThreadItem = { readonly "clientId"?: string | null, readonly "content": ReadonlyArray, readonly "id": string, readonly "type": "userMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fragments": ReadonlyArray, readonly "id": string, readonly "type": "hookPrompt", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "delivery"?: V2TurnStartResponse__AgentMessageDelivery | null, readonly "id": string, readonly "memoryCitation"?: V2TurnStartResponse__MemoryCitation | null, readonly "moderation"?: V2TurnStartResponse__AgentMessageModeration | null, readonly "phase"?: V2TurnStartResponse__MessagePhase | null, readonly "questions"?: ReadonlyArray | null, readonly "text": string, readonly "type": "agentMessage", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "name": string, readonly "namespace"?: string | null, readonly "output": V2TurnStartResponse__FunctionCallOutputBody, readonly "type": "functionCallOutput", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "text": string, readonly "type": "plan", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "content"?: ReadonlyArray, readonly "id": string, readonly "summary"?: ReadonlyArray, readonly "type": "reasoning", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "aggregatedOutput"?: string | null, readonly "command": string, readonly "commandActions": ReadonlyArray, readonly "cwd": V2TurnStartResponse__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"?: V2TurnStartResponse__CommandExecutionSource, readonly "status": V2TurnStartResponse__CommandExecutionStatus, readonly "type": "commandExecution", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "changes": ReadonlyArray, readonly "id": string, readonly "status": V2TurnStartResponse__PatchApplyStatus, readonly "type": "fileChange", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "appContext"?: V2TurnStartResponse__McpToolCallAppContext | null, 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, readonly "tool": string, readonly "type": "mcpToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "arguments": Schema.Json, readonly "contentItems"?: ReadonlyArray | null, readonly "durationMs"?: number | null, readonly "id": string, readonly "namespace"?: string | null, readonly "status": V2TurnStartResponse__DynamicToolCallStatus, readonly "success"?: boolean | null, readonly "tool": string, readonly "type": "dynamicToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentsStates": { readonly [x: string]: V2TurnStartResponse__CollabAgentState }, readonly "id": string, readonly "model"?: string | null, readonly "prompt"?: string | null, readonly "reasoningEffort"?: V2TurnStartResponse__ReasoningEffort | null, readonly "receiverThreadIds": ReadonlyArray, readonly "senderThreadId": string, readonly "status": V2TurnStartResponse__CollabAgentToolCallStatus, readonly "tool": V2TurnStartResponse__CollabAgentTool, readonly "type": "collabAgentToolCall", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "agentPath": string, readonly "agentThreadId": string, readonly "id": string, readonly "kind": V2TurnStartResponse__SubAgentActivityKind, readonly "model"?: string | null, readonly "reasoningEffort"?: V2TurnStartResponse__ReasoningEffort | null, readonly "type": "subAgentActivity", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "action"?: V2TurnStartResponse__WebSearchAction | null, readonly "id": string, readonly "query": string, readonly "results"?: ReadonlyArray | null, readonly "type": "webSearch", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "path": V2TurnStartResponse__LegacyAppPathString, readonly "type": "imageView", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "durationMs": number, readonly "id": string, readonly "type": "sleep", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "fileId": string, readonly "failure"?: V2TurnStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "result": string, readonly "failure"?: V2TurnStartResponse__ImageGenerationFailure | null, readonly "generationId"?: string | null, readonly "id": string, readonly "inputImages"?: ReadonlyArray, readonly "revisedPrompt"?: string | null, readonly "savedPath"?: V2TurnStartResponse__AbsolutePathBuf | null, readonly "status": string, readonly "transparentBackground"?: boolean | null, readonly "type": "imageGeneration", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "enteredReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "review": string, readonly "type": "exitedReviewMode", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } | { readonly "id": string, readonly "type": "contextCompaction", readonly "completedAtMs"?: number | null, readonly "startedAtMs"?: number | null } +export const V2TurnStartResponse__ThreadItem = Schema.Union([Schema.Struct({ "clientId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "content": Schema.Array(V2TurnStartResponse__UserInput), "id": Schema.String, "type": Schema.Literal("userMessage").annotate({ "title": "UserMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "UserMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "fragments": Schema.Array(V2TurnStartResponse__HookPromptFragment), "id": Schema.String, "type": Schema.Literal("hookPrompt").annotate({ "title": "HookPromptThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "HookPromptThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "delivery": Schema.optionalKey(Schema.Union([V2TurnStartResponse__AgentMessageDelivery, Schema.Null])), "id": Schema.String, "memoryCitation": Schema.optionalKey(Schema.Union([V2TurnStartResponse__MemoryCitation, Schema.Null])), "moderation": Schema.optionalKey(Schema.Union([V2TurnStartResponse__AgentMessageModeration, Schema.Null])), "phase": Schema.optionalKey(Schema.Union([V2TurnStartResponse__MessagePhase, Schema.Null])), "questions": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnStartResponse__AsyncUserInputQuestion), Schema.Null])), "text": Schema.String, "type": Schema.Literal("agentMessage").annotate({ "title": "AgentMessageThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "AgentMessageThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FunctionCallOutputThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "text": Schema.String, "type": Schema.Literal("plan").annotate({ "title": "PlanThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ReasoningThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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(V2TurnStartResponse__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 => 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().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 => V2TurnStartResponse__CommandExecutionSource).annotate({ "default": "agent" })), "status": V2TurnStartResponse__CommandExecutionStatus, "type": Schema.Literal("commandExecution").annotate({ "title": "CommandExecutionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CommandExecutionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "changes": Schema.Array(V2TurnStartResponse__FileUpdateChange), "id": Schema.String, "status": V2TurnStartResponse__PatchApplyStatus, "type": Schema.Literal("fileChange").annotate({ "title": "FileChangeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileChangeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "appContext": Schema.optionalKey(Schema.Union([V2TurnStartResponse__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([V2TurnStartResponse__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([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])), "server": Schema.String, "status": V2TurnStartResponse__McpToolCallStatus, "tool": Schema.String, "type": Schema.Literal("mcpToolCall").annotate({ "title": "McpToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "McpToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "arguments": Schema.Json.annotate({ "expected": "JSON value" }), "contentItems": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnStartResponse__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": V2TurnStartResponse__DynamicToolCallStatus, "success": Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), "tool": Schema.String, "type": Schema.Literal("dynamicToolCall").annotate({ "title": "DynamicToolCallThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "DynamicToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentsStates": Schema.Record(Schema.String, V2TurnStartResponse__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([V2TurnStartResponse__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 => 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "CollabAgentToolCallThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "agentPath": Schema.String, "agentThreadId": Schema.String, "id": Schema.String, "kind": V2TurnStartResponse__SubAgentActivityKind, "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Resolved model at sub-agent creation; absent from older records and other activities." }), Schema.Null])), "reasoningEffort": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ReasoningEffort, Schema.Null]).annotate({ "description": "Resolved reasoning effort at sub-agent creation, when known." })), "type": Schema.Literal("subAgentActivity").annotate({ "title": "SubAgentActivityThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SubAgentActivityThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "action": Schema.optionalKey(Schema.Union([V2TurnStartResponse__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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "WebSearchThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "path": V2TurnStartResponse__LegacyAppPathString, "type": Schema.Literal("imageView").annotate({ "title": "ImageViewThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ImageViewThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), 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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "SleepThreadItem", "description": "Display item emitted by the interruptible `clock.sleep` tool." }), Schema.Struct({ "fileId": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "FileIdThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "result": Schema.String, "failure": Schema.optionalKey(Schema.Union([V2TurnStartResponse__ImageGenerationFailure, Schema.Null])), "generationId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Image generation identifier for the generated image, when provided by the image backend." }), Schema.Null])), "id": Schema.String, "inputImages": Schema.optionalKey(Schema.Array(V2TurnStartResponse__ImageGenerationInputImage).annotate({ "description": "Observed local inputs for a completed generation, absent on older items." })), "revisedPrompt": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "savedPath": Schema.optionalKey(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" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ResultThreadItem", "description": "Either inline generated-image data or its durable attachment-store identity.\n\n`File` must remain first so rollouts written during the migration, which contain both an empty `result` and a `fileId`, retain the file reference when deserialized." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("enteredReviewMode").annotate({ "title": "EnteredReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "EnteredReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "review": Schema.String, "type": Schema.Literal("exitedReviewMode").annotate({ "title": "ExitedReviewModeThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ExitedReviewModeThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." }), Schema.Struct({ "id": Schema.String, "type": Schema.Literal("contextCompaction").annotate({ "title": "ContextCompactionThreadItemType" }), "completedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item completed, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "startedAtMs": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Unix timestamp in milliseconds when the item started, if recorded.", "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])) }).annotate({ "title": "ContextCompactionThreadItem", "description": "A thread item and its recorded lifecycle times. The payload stays flat on the wire." })], { mode: "oneOf" }).annotate({ "identifier": "V2TurnStartResponse__ThreadItem" }) 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 "history"?: ReadonlyArray | null, readonly "initialTurnsPage"?: ClientRequest__ThreadResumeInitialTurnsPageParams | null, readonly "model"?: string | null, readonly "modelProvider"?: string | null, readonly "path"?: string | null, readonly "permissions"?: string | null, readonly "personality"?: ClientRequest__Personality | null, readonly "runtimeWorkspaceRoots"?: ReadonlyArray | null, readonly "sandbox"?: ClientRequest__SandboxMode | null, readonly "serviceTier"?: string | null, readonly "threadId": 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({ "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.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." })), "history": Schema.optionalKey(Schema.Union([Schema.Array(ClientRequest__ResponseItem).annotate({ "description": "[UNSTABLE] FOR CODEX CLOUD - DO NOT USE. If specified, the thread will be resumed with the provided history instead of loaded from disk." }), Schema.Null])), "initialTurnsPage": Schema.optionalKey(Schema.Union([ClientRequest__ThreadResumeInitialTurnsPageParams, Schema.Null]).annotate({ "description": "When present, include a `thread/turns/list` page in the resume response so clients can bootstrap recent turns without a second request." })), "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])), "path": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "[UNSTABLE] Specify the rollout path to resume from. If specified for a non-running thread, the thread_id param will be ignored. If thread_id identifies a running thread, the path must match the active rollout path." }), Schema.Null])), "permissions": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Named profile id for the resumed thread. Cannot be combined with `sandbox`." }), 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." })), "runtimeWorkspaceRoots": Schema.optionalKey(Schema.Union([Schema.Array(ClientRequest__AbsolutePathBuf).annotate({ "description": "Replace the thread's runtime workspace roots. Paths must be absolute." }), Schema.Null])), "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" }) @@ -7209,8 +7434,8 @@ export const ServerNotification__Turn = Schema.Struct({ "completedAt": Schema.op export type ServerNotification__ItemStartedNotification = { readonly "item": ServerNotification__ThreadItem, readonly "startedAtMs": number, readonly "threadId": string, readonly "turnId": string } 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 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__ItemCompletedNotification = { readonly "completedAtMs": number, readonly "contentTokenCount"?: number | null, 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" })), "contentTokenCount": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Native content tokens for the completed assistant message, including a sampled footer. Null when unavailable. Completion telemetry is not part of the stored thread item.", "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])), "item": ServerNotification__ThreadItem, "threadId": Schema.String, "turnId": Schema.String }).annotate({ "identifier": "ServerNotification__ItemCompletedNotification" }) 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" }) @@ -7218,8 +7443,8 @@ export const ServerRequest__AdditionalFileSystemPermissions = Schema.Struct({ "e 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 "apps"?: V2ConfigReadResponse__AppsConfig | null, readonly "browser_use"?: V2ConfigReadResponse__BrowserUseConfig | null, readonly "compact_prompt"?: string | 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, readonly "instructions"?: string | null, readonly "model"?: string | null, readonly "model_auto_compact_token_limit"?: number | null, readonly "model_auto_compact_token_limit_scope"?: V2ConfigReadResponse__AutoCompactTokenLimitScope | null, readonly "model_context_window"?: number | null, readonly "model_provider"?: string | null, readonly "model_reasoning_effort"?: V2ConfigReadResponse__ReasoningEffort | null, readonly "model_reasoning_summary"?: V2ConfigReadResponse__ReasoningSummary | null, readonly "model_verbosity"?: V2ConfigReadResponse__Verbosity | null, readonly "review_model"?: string | null, readonly "sandbox_mode"?: V2ConfigReadResponse__SandboxMode | null, readonly "sandbox_workspace_write"?: V2ConfigReadResponse__SandboxWorkspaceWrite | null, readonly "service_tier"?: string | null, readonly "tools"?: V2ConfigReadResponse__ToolsV2 | null, readonly "web_search"?: V2ConfigReadResponse__WebSearchMode | null } & { readonly [x: string]: Schema.Json } -export const V2ConfigReadResponse__Config = Schema.StructWithRest(Schema.Struct({ "analytics": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AnalyticsConfig, Schema.Null])), "approval_policy": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AskForApproval, Schema.Null])), "approvals_reviewer": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ApprovalsReviewer, Schema.Null]).annotate({ "description": "[UNSTABLE] Optional default for where approval requests are routed for review." })), "apps": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AppsConfig, Schema.Null])), "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.Json.annotate({ "expected": "JSON value" })), Schema.Null])), "developer_instructions": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "forced_chatgpt_workspace_id": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ForcedChatgptWorkspaceIds, Schema.Null])), "forced_login_method": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ForcedLoginMethod, Schema.Null])), "instructions": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "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().annotate({ "expected": "an integer" })), Schema.Null])), "model_auto_compact_token_limit_scope": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AutoCompactTokenLimitScope, Schema.Null])), "model_context_window": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "model_provider": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "model_reasoning_effort": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ReasoningEffort, Schema.Null])), "model_reasoning_summary": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ReasoningSummary, Schema.Null])), "model_verbosity": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__Verbosity, Schema.Null])), "review_model": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "sandbox_mode": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__SandboxMode, Schema.Null])), "sandbox_workspace_write": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__SandboxWorkspaceWrite, Schema.Null])), "service_tier": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "tools": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ToolsV2, Schema.Null])), "web_search": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__WebSearchMode, Schema.Null])) }), [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]).annotate({ "identifier": "V2ConfigReadResponse__Config" }) +export type V2ConfigReadResponse__Config = { readonly "analytics"?: V2ConfigReadResponse__AnalyticsConfig | null, readonly "approval_policy"?: V2ConfigReadResponse__AskForApproval | null, readonly "approvals_reviewer"?: V2ConfigReadResponse__ApprovalsReviewer | null, readonly "apps"?: V2ConfigReadResponse__AppsConfig | null, readonly "browser_use"?: V2ConfigReadResponse__BrowserUseConfig | null, readonly "client_search_provider"?: V2ConfigReadResponse__WebSearchProvider | null, readonly "compact_prompt"?: string | 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, readonly "instructions"?: string | null, readonly "model"?: string | null, readonly "model_auto_compact_token_limit"?: number | null, readonly "model_auto_compact_token_limit_scope"?: V2ConfigReadResponse__AutoCompactTokenLimitScope | null, readonly "model_context_window"?: number | null, readonly "model_provider"?: string | null, readonly "model_reasoning_effort"?: V2ConfigReadResponse__ReasoningEffort | null, readonly "model_reasoning_summary"?: V2ConfigReadResponse__ReasoningSummary | null, readonly "model_verbosity"?: V2ConfigReadResponse__Verbosity | null, readonly "review_model"?: string | null, readonly "sandbox_mode"?: V2ConfigReadResponse__SandboxMode | null, readonly "sandbox_workspace_write"?: V2ConfigReadResponse__SandboxWorkspaceWrite | null, readonly "service_tier"?: string | null, readonly "tools"?: V2ConfigReadResponse__ToolsV2 | null, readonly "web_search"?: V2ConfigReadResponse__WebSearchMode | null } & { readonly [x: string]: Schema.Json } +export const V2ConfigReadResponse__Config = Schema.StructWithRest(Schema.Struct({ "analytics": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AnalyticsConfig, Schema.Null])), "approval_policy": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AskForApproval, Schema.Null])), "approvals_reviewer": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ApprovalsReviewer, Schema.Null]).annotate({ "description": "[UNSTABLE] Optional default for where approval requests are routed for review." })), "apps": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AppsConfig, Schema.Null])), "browser_use": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__BrowserUseConfig, Schema.Null])), "client_search_provider": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__WebSearchProvider, Schema.Null]).annotate({ "description": "Effective tools.client_search_provider hint. Model-selected providers take precedence." })), "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.Json.annotate({ "expected": "JSON value" })), Schema.Null])), "developer_instructions": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "forced_chatgpt_workspace_id": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ForcedChatgptWorkspaceIds, Schema.Null])), "forced_login_method": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ForcedLoginMethod, Schema.Null])), "instructions": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "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().annotate({ "expected": "an integer" })), Schema.Null])), "model_auto_compact_token_limit_scope": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__AutoCompactTokenLimitScope, Schema.Null])), "model_context_window": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "model_provider": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "model_reasoning_effort": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ReasoningEffort, Schema.Null])), "model_reasoning_summary": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ReasoningSummary, Schema.Null])), "model_verbosity": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__Verbosity, Schema.Null])), "review_model": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "sandbox_mode": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__SandboxMode, Schema.Null])), "sandbox_workspace_write": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__SandboxWorkspaceWrite, Schema.Null])), "service_tier": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "tools": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__ToolsV2, Schema.Null])), "web_search": Schema.optionalKey(Schema.Union([V2ConfigReadResponse__WebSearchMode, Schema.Null])) }), [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 "allowedApprovalsReviewers"?: 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 "application"?: V2ConfigRequirementsReadResponse__ApplicationRequirements | 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 "hooks"?: V2ConfigRequirementsReadResponse__ManagedHooksRequirements | 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 "network"?: V2ConfigRequirementsReadResponse__NetworkRequirements | null, readonly "otel"?: V2ConfigRequirementsReadResponse__OtelRequirements | 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])), "allowedApprovalsReviewers": Schema.optionalKey(Schema.Union([Schema.Array(V2ConfigRequirementsReadResponse__ApprovalsReviewer), 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])), "allowedSandboxModes": Schema.optionalKey(Schema.Union([Schema.Array(V2ConfigRequirementsReadResponse__SandboxMode), Schema.Null])), "allowedWebSearchModes": Schema.optionalKey(Schema.Union([Schema.Array(V2ConfigRequirementsReadResponse__WebSearchMode), Schema.Null])), "allowedWindowsSandboxImplementations": Schema.optionalKey(Schema.Union([Schema.Array(V2ConfigRequirementsReadResponse__WindowsSandboxImplementation), Schema.Null])), "application": Schema.optionalKey(Schema.Union([V2ConfigRequirementsReadResponse__ApplicationRequirements, 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])), "defaultPermissions": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "enforceResidency": Schema.optionalKey(Schema.Union([V2ConfigRequirementsReadResponse__ResidencyRequirement, Schema.Null])), "featureRequirements": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.Boolean), Schema.Null])), "feedback": Schema.optionalKey(Schema.Union([V2ConfigRequirementsReadResponse__FeedbackRequirements, Schema.Null])), "hooks": Schema.optionalKey(Schema.Union([V2ConfigRequirementsReadResponse__ManagedHooksRequirements, Schema.Null])), "inAppBrowser": Schema.optionalKey(Schema.Union([V2ConfigRequirementsReadResponse__InAppBrowserRequirements, Schema.Null])), "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": "Exact provider selection required by managed policy." }), Schema.Null])), "modelProviders": Schema.optionalKey(Schema.Union([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])), "network": Schema.optionalKey(Schema.Union([V2ConfigRequirementsReadResponse__NetworkRequirements, Schema.Null])), "otel": Schema.optionalKey(Schema.Union([V2ConfigRequirementsReadResponse__OtelRequirements, Schema.Null])), "sqliteHome": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) }).annotate({ "identifier": "V2ConfigRequirementsReadResponse__ConfigRequirements" }) @@ -7251,11 +7476,11 @@ export const V2ReviewStartResponse__Turn = Schema.Struct({ "completedAt": Schema export type V2ThreadForkResponse__Turn = { readonly "completedAt"?: number | null, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadForkResponse__TurnError | null, readonly "id": string, readonly "items": ReadonlyArray, readonly "itemsView"?: V2ThreadForkResponse__TurnItemsView, readonly "rootTurnId"?: string | null, readonly "startedAt"?: number | null, readonly "status": V2ThreadForkResponse__TurnStatus } export const V2ThreadForkResponse__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([V2ThreadForkResponse__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(V2ThreadForkResponse__ThreadItem).annotate({ "description": "Thread items currently included in this turn payload." }), "itemsView": Schema.optionalKey(Schema.suspend((): Schema.Codec => V2ThreadForkResponse__TurnItemsView).annotate({ "description": "Describes how much of `items` has been loaded for this turn.", "default": "full" })), "rootTurnId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "ID of the first turn in the chain of work that led to this turn. Pass this as `rootTurnId` when starting work on behalf of this turn. May be null in older history or a `review/start` response." }), Schema.Null])), "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": 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 V2ThreadItemsListResponse__ThreadItemEntry = { readonly "completedAtMs"?: number | null, readonly "item": V2ThreadItemsListResponse__ThreadItem, readonly "outputDeferred"?: boolean, 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, "outputDeferred": Schema.optionalKey(Schema.Boolean.annotate({ "description": "The saved output was omitted. Fetch the complete item with `thread/items/read`." })), "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 V2ThreadItemsReadResponse__ThreadItemEntry = { readonly "completedAtMs"?: number | null, readonly "item": V2ThreadItemsReadResponse__ThreadItem, readonly "startedAtMs"?: number | null, readonly "turnId": string } -export const V2ThreadItemsReadResponse__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": V2ThreadItemsReadResponse__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": "V2ThreadItemsReadResponse__ThreadItemEntry" }) +export type V2ThreadItemsReadResponse__ThreadItemEntry = { readonly "completedAtMs"?: number | null, readonly "item": V2ThreadItemsReadResponse__ThreadItem, readonly "outputDeferred"?: boolean, readonly "startedAtMs"?: number | null, readonly "turnId": string } +export const V2ThreadItemsReadResponse__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": V2ThreadItemsReadResponse__ThreadItem, "outputDeferred": Schema.optionalKey(Schema.Boolean.annotate({ "description": "The saved output was omitted. Fetch the complete item with `thread/items/read`." })), "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": "V2ThreadItemsReadResponse__ThreadItemEntry" }) export type V2ThreadListResponse__Turn = { readonly "completedAt"?: number | null, readonly "durationMs"?: number | null, readonly "error"?: V2ThreadListResponse__TurnError | null, readonly "id": string, readonly "items": ReadonlyArray, readonly "itemsView"?: V2ThreadListResponse__TurnItemsView, readonly "rootTurnId"?: string | null, readonly "startedAt"?: number | null, readonly "status": V2ThreadListResponse__TurnStatus } export const V2ThreadListResponse__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([V2ThreadListResponse__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(V2ThreadListResponse__ThreadItem).annotate({ "description": "Thread items currently included in this turn payload." }), "itemsView": Schema.optionalKey(Schema.suspend((): Schema.Codec => V2ThreadListResponse__TurnItemsView).annotate({ "description": "Describes how much of `items` has been loaded for this turn.", "default": "full" })), "rootTurnId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "ID of the first turn in the chain of work that led to this turn. Pass this as `rootTurnId` when starting work on behalf of this turn. May be null in older history or a `review/start` response." }), Schema.Null])), "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": V2ThreadListResponse__TurnStatus }).annotate({ "identifier": "V2ThreadListResponse__Turn" }) @@ -7317,8 +7542,8 @@ export const PermissionsRequestApprovalResponse__GrantedPermissionProfile = Sche 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])) }).annotate({ "identifier": "ServerNotification__RequestPermissionProfile" }) -export type ServerNotification__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": ServerNotification__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: ServerNotification__ThreadExtra | null, 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": ServerNotification__SessionSource, readonly "status": ServerNotification__ThreadStatus, readonly "threadSource"?: ServerNotification__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const ServerNotification__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => ServerNotification__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(ServerNotification__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([ServerNotification__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([ServerNotification__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => ServerNotification__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(ServerNotification__Turn).annotate({ "description": "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": "ServerNotification__Thread" }) +export type ServerNotification__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": ServerNotification__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: ServerNotification__ThreadExtra | null, 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": ServerNotification__SessionSource, readonly "status": ServerNotification__ThreadStatus, readonly "threadSource"?: ServerNotification__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const ServerNotification__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => ServerNotification__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(ServerNotification__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([ServerNotification__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([ServerNotification__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => ServerNotification__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(ServerNotification__Turn).annotate({ "description": "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": "ServerNotification__Thread" }) export type ServerNotification__TurnStartedNotification = { readonly "threadId": string, readonly "turn": ServerNotification__Turn } export const ServerNotification__TurnStartedNotification = Schema.Struct({ "threadId": Schema.String, "turn": ServerNotification__Turn }).annotate({ "identifier": "ServerNotification__TurnStartedNotification" }) @@ -7341,38 +7566,38 @@ export const V2ItemGuardianApprovalReviewCompletedNotification__RequestPermissio 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])) }).annotate({ "identifier": "V2ItemGuardianApprovalReviewStartedNotification__RequestPermissionProfile" }) -export type V2ThreadForkResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadForkResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadForkResponse__ThreadExtra | null, 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": V2ThreadForkResponse__SessionSource, readonly "status": V2ThreadForkResponse__ThreadStatus, readonly "threadSource"?: V2ThreadForkResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadForkResponse__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadForkResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadForkResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadForkResponse__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadForkResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadForkResponse__Turn).annotate({ "description": "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": "V2ThreadForkResponse__Thread" }) +export type V2ThreadForkResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadForkResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadForkResponse__ThreadExtra | null, 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": V2ThreadForkResponse__SessionSource, readonly "status": V2ThreadForkResponse__ThreadStatus, readonly "threadSource"?: V2ThreadForkResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadForkResponse__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadForkResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadForkResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadForkResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadForkResponse__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadForkResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadForkResponse__Turn).annotate({ "description": "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": "V2ThreadForkResponse__Thread" }) -export type V2ThreadListResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadListResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadListResponse__ThreadExtra | null, 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": V2ThreadListResponse__SessionSource, readonly "status": V2ThreadListResponse__ThreadStatus, readonly "threadSource"?: V2ThreadListResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadListResponse__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadListResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadListResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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": "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 V2ThreadListResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadListResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadListResponse__ThreadExtra | null, 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": V2ThreadListResponse__SessionSource, readonly "status": V2ThreadListResponse__ThreadStatus, readonly "threadSource"?: V2ThreadListResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadListResponse__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadListResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadListResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadListResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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": "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 "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadMetadataUpdateResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadMetadataUpdateResponse__ThreadExtra | null, 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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadMetadataUpdateResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadMetadataUpdateResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadMetadataUpdateResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadMetadataUpdateResponse__Turn).annotate({ "description": "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": "V2ThreadMetadataUpdateResponse__Thread" }) +export type V2ThreadMetadataUpdateResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadMetadataUpdateResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadMetadataUpdateResponse__ThreadExtra | null, 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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadMetadataUpdateResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadMetadataUpdateResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadMetadataUpdateResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadMetadataUpdateResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadMetadataUpdateResponse__Turn).annotate({ "description": "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": "V2ThreadMetadataUpdateResponse__Thread" }) -export type V2ThreadReadResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadReadResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadReadResponse__ThreadExtra | null, readonly "forkedFromId"?: string | 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": V2ThreadReadResponse__SessionSource, readonly "status": V2ThreadReadResponse__ThreadStatus, readonly "threadSource"?: V2ThreadReadResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadReadResponse__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadReadResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadReadResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadReadResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadReadResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadReadResponse__Turn).annotate({ "description": "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": "V2ThreadReadResponse__Thread" }) +export type V2ThreadReadResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadReadResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadReadResponse__ThreadExtra | null, readonly "forkedFromId"?: string | 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": V2ThreadReadResponse__SessionSource, readonly "status": V2ThreadReadResponse__ThreadStatus, readonly "threadSource"?: V2ThreadReadResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadReadResponse__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadReadResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadReadResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadReadResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadReadResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadReadResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadReadResponse__Turn).annotate({ "description": "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": "V2ThreadReadResponse__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])) }).annotate({ "identifier": "V2ThreadResumeResponse__TurnsPage" }) -export type V2ThreadResumeResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadResumeResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadResumeResponse__ThreadExtra | null, readonly "forkedFromId"?: string | 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": V2ThreadResumeResponse__SessionSource, readonly "status": V2ThreadResumeResponse__ThreadStatus, readonly "threadSource"?: V2ThreadResumeResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadResumeResponse__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadResumeResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadResumeResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadResumeResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadResumeResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadResumeResponse__Turn).annotate({ "description": "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": "V2ThreadResumeResponse__Thread" }) +export type V2ThreadResumeResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadResumeResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadResumeResponse__ThreadExtra | null, readonly "forkedFromId"?: string | 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": V2ThreadResumeResponse__SessionSource, readonly "status": V2ThreadResumeResponse__ThreadStatus, readonly "threadSource"?: V2ThreadResumeResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadResumeResponse__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadResumeResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadResumeResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadResumeResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadResumeResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadResumeResponse__Turn).annotate({ "description": "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": "V2ThreadResumeResponse__Thread" }) -export type V2ThreadRevertResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadRevertResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadRevertResponse__ThreadExtra | null, readonly "forkedFromId"?: string | 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": V2ThreadRevertResponse__SessionSource, readonly "status": V2ThreadRevertResponse__ThreadStatus, readonly "threadSource"?: V2ThreadRevertResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadRevertResponse__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadRevertResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadRevertResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadRevertResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadRevertResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadRevertResponse__Turn).annotate({ "description": "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": "V2ThreadRevertResponse__Thread" }) +export type V2ThreadRevertResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadRevertResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadRevertResponse__ThreadExtra | null, readonly "forkedFromId"?: string | 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": V2ThreadRevertResponse__SessionSource, readonly "status": V2ThreadRevertResponse__ThreadStatus, readonly "threadSource"?: V2ThreadRevertResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadRevertResponse__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadRevertResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadRevertResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadRevertResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadRevertResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadRevertResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadRevertResponse__Turn).annotate({ "description": "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": "V2ThreadRevertResponse__Thread" }) -export type V2ThreadSearchResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadSearchResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadSearchResponse__ThreadExtra | null, readonly "forkedFromId"?: string | null, readonly "gitInfo"?: V2ThreadSearchResponse__GitInfo | null, readonly "historyMode"?: V2ThreadSearchResponse__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"?: V2ThreadSearchResponse__ReasoningEffort | null, readonly "recencyAt"?: number | null, readonly "section"?: V2ThreadSearchResponse__ThreadSection | null, readonly "sectionEnteredAt"?: number | null, readonly "sessionId": string, readonly "source": V2ThreadSearchResponse__SessionSource, readonly "status": V2ThreadSearchResponse__ThreadStatus, readonly "threadSource"?: V2ThreadSearchResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadSearchResponse__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadSearchResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSearchResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadSearchResponse__GitInfo, Schema.Null]).annotate({ "description": "Optional Git metadata captured when the thread was created." })), "historyMode": Schema.optionalKey(Schema.suspend((): Schema.Codec => V2ThreadSearchResponse__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([V2ThreadSearchResponse__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([V2ThreadSearchResponse__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 => V2ThreadSearchResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadSearchResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadSearchResponse__Turn).annotate({ "description": "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": "V2ThreadSearchResponse__Thread" }) +export type V2ThreadSearchResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadSearchResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadSearchResponse__ThreadExtra | null, readonly "forkedFromId"?: string | null, readonly "gitInfo"?: V2ThreadSearchResponse__GitInfo | null, readonly "historyMode"?: V2ThreadSearchResponse__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"?: V2ThreadSearchResponse__ReasoningEffort | null, readonly "recencyAt"?: number | null, readonly "section"?: V2ThreadSearchResponse__ThreadSection | null, readonly "sectionEnteredAt"?: number | null, readonly "sessionId": string, readonly "source": V2ThreadSearchResponse__SessionSource, readonly "status": V2ThreadSearchResponse__ThreadStatus, readonly "threadSource"?: V2ThreadSearchResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadSearchResponse__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadSearchResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSearchResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadSearchResponse__GitInfo, Schema.Null]).annotate({ "description": "Optional Git metadata captured when the thread was created." })), "historyMode": Schema.optionalKey(Schema.suspend((): Schema.Codec => V2ThreadSearchResponse__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([V2ThreadSearchResponse__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([V2ThreadSearchResponse__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 => V2ThreadSearchResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "status": Schema.suspend((): Schema.Codec => V2ThreadSearchResponse__ThreadStatus).annotate({ "description": "Current runtime status for the thread." }), "threadSource": Schema.optionalKey(Schema.Union([V2ThreadSearchResponse__ThreadSource, Schema.Null]).annotate({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadSearchResponse__Turn).annotate({ "description": "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": "V2ThreadSearchResponse__Thread" }) -export type V2ThreadStartedNotification__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadStartedNotification__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadStartedNotification__ThreadExtra | null, 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": V2ThreadStartedNotification__SessionSource, readonly "status": V2ThreadStartedNotification__ThreadStatus, readonly "threadSource"?: V2ThreadStartedNotification__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadStartedNotification__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadStartedNotification__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartedNotification__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadStartedNotification__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadStartedNotification__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadStartedNotification__Turn).annotate({ "description": "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": "V2ThreadStartedNotification__Thread" }) +export type V2ThreadStartedNotification__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadStartedNotification__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadStartedNotification__ThreadExtra | null, 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": V2ThreadStartedNotification__SessionSource, readonly "status": V2ThreadStartedNotification__ThreadStatus, readonly "threadSource"?: V2ThreadStartedNotification__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadStartedNotification__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadStartedNotification__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartedNotification__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadStartedNotification__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadStartedNotification__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadStartedNotification__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadStartedNotification__Turn).annotate({ "description": "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": "V2ThreadStartedNotification__Thread" }) -export type V2ThreadStartResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadStartResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadStartResponse__ThreadExtra | null, 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": V2ThreadStartResponse__SessionSource, readonly "status": V2ThreadStartResponse__ThreadStatus, readonly "threadSource"?: V2ThreadStartResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadStartResponse__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadStartResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadStartResponse__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadStartResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadStartResponse__Turn).annotate({ "description": "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": "V2ThreadStartResponse__Thread" }) +export type V2ThreadStartResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadStartResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadStartResponse__ThreadExtra | null, 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": V2ThreadStartResponse__SessionSource, readonly "status": V2ThreadStartResponse__ThreadStatus, readonly "threadSource"?: V2ThreadStartResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadStartResponse__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadStartResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadStartResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadStartResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadStartResponse__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadStartResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadStartResponse__Turn).annotate({ "description": "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": "V2ThreadStartResponse__Thread" }) -export type V2ThreadUnarchiveResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadUnarchiveResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadUnarchiveResponse__ThreadExtra | null, 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": V2ThreadUnarchiveResponse__SessionSource, readonly "status": V2ThreadUnarchiveResponse__ThreadStatus, readonly "threadSource"?: V2ThreadUnarchiveResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } -export const V2ThreadUnarchiveResponse__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])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadUnarchiveResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadUnarchiveResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadUnarchiveResponse__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadUnarchiveResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadUnarchiveResponse__Turn).annotate({ "description": "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": "V2ThreadUnarchiveResponse__Thread" }) +export type V2ThreadUnarchiveResponse__Thread = { readonly "agentNickname"?: string | null, readonly "agentRole"?: string | null, readonly "attachedToThreadId"?: string | null, readonly "canAcceptDirectInput"?: boolean | null, readonly "cliVersion": string, readonly "createdAt": number, readonly "cwd": V2ThreadUnarchiveResponse__AbsolutePathBuf, readonly "daybreakEnabled"?: boolean | null, readonly "environments"?: ReadonlyArray | null, readonly "ephemeral": boolean, readonly "extra"?: V2ThreadUnarchiveResponse__ThreadExtra | null, 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": V2ThreadUnarchiveResponse__SessionSource, readonly "status": V2ThreadUnarchiveResponse__ThreadStatus, readonly "threadSource"?: V2ThreadUnarchiveResponse__ThreadSource | null, readonly "turns": ReadonlyArray, readonly "updatedAt": number } +export const V2ThreadUnarchiveResponse__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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Parent that owns this persisted attached thread, independent of fork or spawn lineage." }), Schema.Null])), "canAcceptDirectInput": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread." }), 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 => V2ThreadUnarchiveResponse__AbsolutePathBuf).annotate({ "description": "Working directory captured for the thread." }), "daybreakEnabled": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Saved Daybreak choice, independent of turn execution. Null if unset." }), Schema.Null])), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadUnarchiveResponse__ThreadEnvironment).annotate({ "description": "Current environments for a loaded thread, in priority order, primary first. `null` means the thread is not loaded or the server does not expose its selection. An empty list means no environments are selected. This does not report connection status." }), Schema.Null])), "ephemeral": Schema.Boolean.annotate({ "description": "Whether the thread is ephemeral and should not be materialized on disk." }), "extra": Schema.optionalKey(Schema.Union([V2ThreadUnarchiveResponse__ThreadExtra, Schema.Null]).annotate({ "description": "Optional implementation-specific thread data." })), "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([V2ThreadUnarchiveResponse__GitInfo, Schema.Null]).annotate({ "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')." }), "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([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().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.suspend((): Schema.Codec => V2ThreadUnarchiveResponse__SessionSource).annotate({ "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." }), "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({ "description": "Optional analytics source classification for this thread." })), "turns": Schema.Array(V2ThreadUnarchiveResponse__Turn).annotate({ "description": "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": "V2ThreadUnarchiveResponse__Thread" }) export type McpServerElicitationRequestParams__McpElicitationSchema = { readonly "$schema"?: string | null, readonly "properties": { readonly [x: string]: McpServerElicitationRequestParams__McpElicitationPrimitiveSchema }, readonly "required"?: ReadonlyArray | null, readonly "type": McpServerElicitationRequestParams__McpElicitationObjectType } export const McpServerElicitationRequestParams__McpElicitationSchema = Schema.Struct({ "$schema": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "properties": Schema.Record(Schema.String, McpServerElicitationRequestParams__McpElicitationPrimitiveSchema), "required": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), "type": McpServerElicitationRequestParams__McpElicitationObjectType }).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" }) @@ -7431,8 +7656,8 @@ export const ChatgptAuthTokensRefreshResponse = Schema.Struct({ "accessToken": S export type ClientNotification = { readonly "method": "initialized" } export const ClientNotification = Schema.Union([Schema.Struct({ "method": Schema.Literal("initialized").annotate({ "title": "InitializedNotificationMethod" }) }).annotate({ "title": "InitializedNotification" })], { mode: "oneOf" }).annotate({ "title": "ClientNotification" }) -export type ClientRequest = { readonly "id": ClientRequest__RequestId, readonly "method": "initialize", readonly "params": ClientRequest__InitializeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "server/diagnostics", readonly "params": ClientRequest__ServerDiagnosticsParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/status", readonly "params": ClientRequest__UserVerificationStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/enroll", readonly "params": ClientRequest__UserVerificationEnrollParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/delete", readonly "params": ClientRequest__UserVerificationDeleteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/verify", readonly "params": ClientRequest__UserVerificationVerifyParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/cancel", readonly "params": ClientRequest__UserVerificationCancelParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/start", readonly "params": ClientRequest__ThreadStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/resume", readonly "params": ClientRequest__ThreadResumeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/fork", readonly "params": ClientRequest__ThreadForkParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/sample", readonly "params": ClientRequest__ThreadSampleParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/sample/cancel", readonly "params": ClientRequest__ThreadSampleCancelParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/archive", readonly "params": ClientRequest__ThreadArchiveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/delete", readonly "params": ClientRequest__ThreadDeleteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/unsubscribe", readonly "params": ClientRequest__ThreadUnsubscribeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/increment_elicitation", readonly "params": ClientRequest__ThreadIncrementElicitationParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/decrement_elicitation", readonly "params": ClientRequest__ThreadDecrementElicitationParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/name/set", readonly "params": ClientRequest__ThreadSetNameParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/prediction/request", readonly "params": ClientRequest__ThreadPredictionRequestParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/goal/set", readonly "params": ClientRequest__ThreadGoalSetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/goal/get", readonly "params": ClientRequest__ThreadGoalGetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/goal/clear", readonly "params": ClientRequest__ThreadGoalClearParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/add", readonly "params": ClientRequest__ThreadQueueAddParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/list", readonly "params": ClientRequest__ThreadQueueListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/update", readonly "params": ClientRequest__ThreadQueueUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/delete", readonly "params": ClientRequest__ThreadQueueDeleteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/reorder", readonly "params": ClientRequest__ThreadQueueReorderParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/start", readonly "params": ClientRequest__ThreadQueueStartParams } | { readonly "id": ClientRequest__RequestId, 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/attachmentOwner/list", readonly "params": ClientRequest__ThreadAttachmentOwnerListParams } | { 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/settings/update", readonly "params": ClientRequest__ThreadSettingsUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/memoryMode/set", readonly "params": ClientRequest__ThreadMemoryModeSetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/memory/read", readonly "params": ClientRequest__ThreadMemoryReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "memory/status", readonly "params": ClientRequest__MemoryStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "memory/reset", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "rollout/compress", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/unarchive", readonly "params": ClientRequest__ThreadUnarchiveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/compact/start", readonly "params": ClientRequest__ThreadCompactStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/shellCommand", readonly "params": ClientRequest__ThreadShellCommandParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/approveGuardianDeniedAction", readonly "params": ClientRequest__ThreadApproveGuardianDeniedActionParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/backgroundTerminals/clean", readonly "params": ClientRequest__ThreadBackgroundTerminalsCleanParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/backgroundTerminals/list", readonly "params": ClientRequest__ThreadBackgroundTerminalsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/backgroundTerminals/terminate", readonly "params": ClientRequest__ThreadBackgroundTerminalsTerminateParams } | { readonly "id": ClientRequest__RequestId, 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": "project/list", readonly "params": ClientRequest__ProjectListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/read", readonly "params": ClientRequest__ProjectReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/create", readonly "params": ClientRequest__ProjectCreateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/import", readonly "params": ClientRequest__ProjectImportParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/update", readonly "params": ClientRequest__ProjectUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/move", readonly "params": ClientRequest__ProjectMoveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/delete", readonly "params": ClientRequest__ProjectDeleteParams } | { 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/search", readonly "params": ClientRequest__ThreadSearchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/searchOccurrences", readonly "params": ClientRequest__ThreadSearchOccurrencesParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/loaded/list", readonly "params": ClientRequest__ThreadLoadedListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/read", readonly "params": ClientRequest__ThreadReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/readState/update", readonly "params": ClientRequest__ThreadReadStateUpdateParams } | { 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/items/read", readonly "params": ClientRequest__ThreadItemsReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/guardianReview", readonly "params": ClientRequest__ThreadGuardianReviewParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/inject_items", readonly "params": ClientRequest__ThreadInjectItemsParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "skills/list", readonly "params": ClientRequest__SkillsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "skills/extraRoots/set", readonly "params": ClientRequest__SkillsExtraRootsSetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "hooks/list", readonly "params": ClientRequest__HooksListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "marketplace/add", readonly "params": ClientRequest__MarketplaceAddParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "marketplace/remove", readonly "params": ClientRequest__MarketplaceRemoveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "marketplace/upgrade", readonly "params": ClientRequest__MarketplaceUpgradeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/list", readonly "params": ClientRequest__PluginListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/search", readonly "params": ClientRequest__PluginSearchParams } | { readonly "id": ClientRequest__RequestId, 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", readonly "params": ClientRequest__PluginReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/skill/read", readonly "params": ClientRequest__PluginSkillReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/save", readonly "params": ClientRequest__PluginShareSaveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/updateTargets", readonly "params": ClientRequest__PluginShareUpdateTargetsParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/list", readonly "params": ClientRequest__PluginShareListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/checkout", readonly "params": ClientRequest__PluginShareCheckoutParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/delete", readonly "params": ClientRequest__PluginShareDeleteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "app/read", readonly "params": ClientRequest__AppsReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "app/list", readonly "params": ClientRequest__AppsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "app/installed", readonly "params": ClientRequest__AppsInstalledParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/readFile", readonly "params": ClientRequest__FsReadFileParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/writeFile", readonly "params": ClientRequest__FsWriteFileParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/createDirectory", readonly "params": ClientRequest__FsCreateDirectoryParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/getMetadata", readonly "params": ClientRequest__FsGetMetadataParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/readDirectory", readonly "params": ClientRequest__FsReadDirectoryParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/remove", readonly "params": ClientRequest__FsRemoveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/copy", readonly "params": ClientRequest__FsCopyParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/watch", readonly "params": ClientRequest__FsWatchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/unwatch", readonly "params": ClientRequest__FsUnwatchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "skills/config/write", readonly "params": ClientRequest__SkillsConfigWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/install", readonly "params": ClientRequest__PluginInstallParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/uninstall", readonly "params": ClientRequest__PluginUninstallParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "turn/start", readonly "params": ClientRequest__TurnStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "turn/settings/update", readonly "params": ClientRequest__TurnSettingsUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "turn/steer", readonly "params": ClientRequest__TurnSteerParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "turn/interrupt", readonly "params": ClientRequest__TurnInterruptParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/start", readonly "params": ClientRequest__ThreadRealtimeStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/appendAudio", readonly "params": ClientRequest__ThreadRealtimeAppendAudioParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/appendText", readonly "params": ClientRequest__ThreadRealtimeAppendTextParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/appendSpeech", readonly "params": ClientRequest__ThreadRealtimeAppendSpeechParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/stop", readonly "params": ClientRequest__ThreadRealtimeStopParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/timeline/list", readonly "params": ClientRequest__ThreadTimelineListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/listVoices", readonly "params": ClientRequest__ThreadRealtimeListVoicesParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "review/start", readonly "params": ClientRequest__ReviewStartParams } | { readonly "id": ClientRequest__RequestId, 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", readonly "params": ClientRequest__ModelProviderCapabilitiesReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "experimentalFeature/list", readonly "params": ClientRequest__ExperimentalFeatureListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "permissionProfile/list", readonly "params": ClientRequest__PermissionProfileListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "experimentalFeature/enablement/set", readonly "params": ClientRequest__ExperimentalFeatureEnablementSetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/enable", readonly "params"?: ClientRequest__RemoteControlEnableParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/disable", readonly "params"?: ClientRequest__RemoteControlDisableParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/status/read", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/pairing/start", readonly "params": ClientRequest__RemoteControlPairingStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/pairing/status", readonly "params": ClientRequest__RemoteControlPairingStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/client/list", readonly "params": ClientRequest__RemoteControlClientsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/client/revoke", readonly "params": ClientRequest__RemoteControlClientsRevokeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "collaborationMode/list", readonly "params": ClientRequest__CollaborationModeListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mock/experimentalMethod", readonly "params": ClientRequest__MockExperimentalMethodParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "environment/add", readonly "params": ClientRequest__EnvironmentAddParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "environment/info", readonly "params": ClientRequest__EnvironmentInfoParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "environment/status", readonly "params": ClientRequest__EnvironmentStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/oauth/login", readonly "params": ClientRequest__McpServerOauthLoginParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "config/mcpServer/reload", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServerStatus/list", readonly "params": ClientRequest__ListMcpServerStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/resource/read", readonly "params": ClientRequest__McpResourceReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/event/stream/start", readonly "params": ClientRequest__McpServerEventStreamStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/event/stream/stop", readonly "params": ClientRequest__McpServerEventStreamStopParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/tool/call", readonly "params": ClientRequest__McpServerToolCallParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "windowsSandbox/setupStart", readonly "params": ClientRequest__WindowsSandboxSetupStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "windowsSandbox/readiness", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/login/start", readonly "params": ClientRequest__LoginAccountParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/bedrock/discover", readonly "params": ClientRequest__BedrockDiscoverParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/bedrock/setup", readonly "params": ClientRequest__BedrockSetupParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/gcp/setup", readonly "params": ClientRequest__GcpSetupParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/bedrock/checkGovCloudRequirements", readonly "params": ClientRequest__BedrockCheckGovCloudRequirementsParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/login/cancel", readonly "params": ClientRequest__CancelLoginAccountParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "accountSession/list", readonly "params": ClientRequest__AccountSessionsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "accountSession/switch", readonly "params": ClientRequest__AccountSessionsSwitchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/logout", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/rateLimits/read", readonly "params"?: ClientRequest__GetAccountRateLimitsParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/rateLimitResetCredit/consume", readonly "params": ClientRequest__ConsumeAccountRateLimitResetCreditParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/usage/read", readonly "params"?: ClientRequest__GetAccountTokenUsageParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/workspaceMessages/read", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/sendAddCreditsNudgeEmail", readonly "params": ClientRequest__SendAddCreditsNudgeEmailParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "feedback/upload", readonly "params": ClientRequest__FeedbackUploadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "feedback/save", readonly "params": ClientRequest__FeedbackSaveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "command/exec", readonly "params": ClientRequest__CommandExecParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "command/exec/write", readonly "params": ClientRequest__CommandExecWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "command/exec/terminate", readonly "params": ClientRequest__CommandExecTerminateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "command/exec/resize", readonly "params": ClientRequest__CommandExecResizeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "process/spawn", readonly "params": ClientRequest__ProcessSpawnParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "process/writeStdin", readonly "params": ClientRequest__ProcessWriteStdinParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "process/kill", readonly "params": ClientRequest__ProcessKillParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "process/resizePty", readonly "params": ClientRequest__ProcessResizePtyParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "config/read", readonly "params": ClientRequest__ConfigReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "externalAgentConfig/detect", readonly "params": ClientRequest__ExternalAgentConfigDetectParams } | { readonly "id": ClientRequest__RequestId, 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", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "config/value/write", readonly "params": ClientRequest__ConfigValueWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "config/batchWrite", readonly "params": ClientRequest__ConfigBatchWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "configRequirements/read", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/read", readonly "params": ClientRequest__GetAccountParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fuzzyFileSearch", readonly "params": ClientRequest__FuzzyFileSearchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fuzzyFileSearch/sessionStart", readonly "params": ClientRequest__FuzzyFileSearchSessionStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fuzzyFileSearch/sessionUpdate", readonly "params": ClientRequest__FuzzyFileSearchSessionUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fuzzyFileSearch/sessionStop", readonly "params": ClientRequest__FuzzyFileSearchSessionStopParams } -export const ClientRequest = Schema.Union([Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("initialize").annotate({ "title": "InitializeRequestMethod" }), "params": ClientRequest__InitializeParams }).annotate({ "title": "InitializeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("server/diagnostics").annotate({ "title": "Server/diagnosticsRequestMethod" }), "params": ClientRequest__ServerDiagnosticsParams }).annotate({ "title": "Server/diagnosticsRequest", "description": "Read content-free, process-local diagnostics." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/status").annotate({ "title": "UserVerification/statusRequestMethod" }), "params": ClientRequest__UserVerificationStatusParams }).annotate({ "title": "UserVerification/statusRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/enroll").annotate({ "title": "UserVerification/enrollRequestMethod" }), "params": ClientRequest__UserVerificationEnrollParams }).annotate({ "title": "UserVerification/enrollRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/delete").annotate({ "title": "UserVerification/deleteRequestMethod" }), "params": ClientRequest__UserVerificationDeleteParams }).annotate({ "title": "UserVerification/deleteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/verify").annotate({ "title": "UserVerification/verifyRequestMethod" }), "params": ClientRequest__UserVerificationVerifyParams }).annotate({ "title": "UserVerification/verifyRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/cancel").annotate({ "title": "UserVerification/cancelRequestMethod" }), "params": ClientRequest__UserVerificationCancelParams }).annotate({ "title": "UserVerification/cancelRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/start").annotate({ "title": "Thread/startRequestMethod" }), "params": ClientRequest__ThreadStartParams }).annotate({ "title": "Thread/startRequest", "description": "NEW APIs" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/resume").annotate({ "title": "Thread/resumeRequestMethod" }), "params": ClientRequest__ThreadResumeParams }).annotate({ "title": "Thread/resumeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/fork").annotate({ "title": "Thread/forkRequestMethod" }), "params": ClientRequest__ThreadForkParams }).annotate({ "title": "Thread/forkRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/sample").annotate({ "title": "Thread/sampleRequestMethod" }), "params": ClientRequest__ThreadSampleParams }).annotate({ "title": "Thread/sampleRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/sample/cancel").annotate({ "title": "Thread/sample/cancelRequestMethod" }), "params": ClientRequest__ThreadSampleCancelParams }).annotate({ "title": "Thread/sample/cancelRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/archive").annotate({ "title": "Thread/archiveRequestMethod" }), "params": ClientRequest__ThreadArchiveParams }).annotate({ "title": "Thread/archiveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/delete").annotate({ "title": "Thread/deleteRequestMethod" }), "params": ClientRequest__ThreadDeleteParams }).annotate({ "title": "Thread/deleteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/unsubscribe").annotate({ "title": "Thread/unsubscribeRequestMethod" }), "params": ClientRequest__ThreadUnsubscribeParams }).annotate({ "title": "Thread/unsubscribeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/increment_elicitation").annotate({ "title": "Thread/incrementElicitationRequestMethod" }), "params": ClientRequest__ThreadIncrementElicitationParams }).annotate({ "title": "Thread/incrementElicitationRequest", "description": "Increment the thread-local out-of-band elicitation counter.\n\nThis is used by external helpers to pause timeout accounting while a user approval or other elicitation is pending outside the app-server request flow." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/decrement_elicitation").annotate({ "title": "Thread/decrementElicitationRequestMethod" }), "params": ClientRequest__ThreadDecrementElicitationParams }).annotate({ "title": "Thread/decrementElicitationRequest", "description": "Decrement the thread-local out-of-band elicitation counter.\n\nWhen the count reaches zero, timeout accounting resumes for the thread." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/name/set").annotate({ "title": "Thread/name/setRequestMethod" }), "params": ClientRequest__ThreadSetNameParams }).annotate({ "title": "Thread/name/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/prediction/request").annotate({ "title": "Thread/prediction/requestRequestMethod" }), "params": ClientRequest__ThreadPredictionRequestParams }).annotate({ "title": "Thread/prediction/requestRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/goal/set").annotate({ "title": "Thread/goal/setRequestMethod" }), "params": ClientRequest__ThreadGoalSetParams }).annotate({ "title": "Thread/goal/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/goal/get").annotate({ "title": "Thread/goal/getRequestMethod" }), "params": ClientRequest__ThreadGoalGetParams }).annotate({ "title": "Thread/goal/getRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/goal/clear").annotate({ "title": "Thread/goal/clearRequestMethod" }), "params": ClientRequest__ThreadGoalClearParams }).annotate({ "title": "Thread/goal/clearRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/add").annotate({ "title": "Thread/queue/addRequestMethod" }), "params": ClientRequest__ThreadQueueAddParams }).annotate({ "title": "Thread/queue/addRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/list").annotate({ "title": "Thread/queue/listRequestMethod" }), "params": ClientRequest__ThreadQueueListParams }).annotate({ "title": "Thread/queue/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/update").annotate({ "title": "Thread/queue/updateRequestMethod" }), "params": ClientRequest__ThreadQueueUpdateParams }).annotate({ "title": "Thread/queue/updateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/delete").annotate({ "title": "Thread/queue/deleteRequestMethod" }), "params": ClientRequest__ThreadQueueDeleteParams }).annotate({ "title": "Thread/queue/deleteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/reorder").annotate({ "title": "Thread/queue/reorderRequestMethod" }), "params": ClientRequest__ThreadQueueReorderParams }).annotate({ "title": "Thread/queue/reorderRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/start").annotate({ "title": "Thread/queue/startRequestMethod" }), "params": ClientRequest__ThreadQueueStartParams }).annotate({ "title": "Thread/queue/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/metadata/update").annotate({ "title": "Thread/metadata/updateRequestMethod" }), "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/attachmentOwner/list").annotate({ "title": "Thread/attachmentOwner/listRequestMethod" }), "params": ClientRequest__ThreadAttachmentOwnerListParams }).annotate({ "title": "Thread/attachmentOwner/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/settings/update").annotate({ "title": "Thread/settings/updateRequestMethod" }), "params": ClientRequest__ThreadSettingsUpdateParams }).annotate({ "title": "Thread/settings/updateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/memoryMode/set").annotate({ "title": "Thread/memoryMode/setRequestMethod" }), "params": ClientRequest__ThreadMemoryModeSetParams }).annotate({ "title": "Thread/memoryMode/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/memory/read").annotate({ "title": "Thread/memory/readRequestMethod" }), "params": ClientRequest__ThreadMemoryReadParams }).annotate({ "title": "Thread/memory/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("memory/status").annotate({ "title": "Memory/statusRequestMethod" }), "params": ClientRequest__MemoryStatusParams }).annotate({ "title": "Memory/statusRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("memory/reset").annotate({ "title": "Memory/resetRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Memory/resetRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("rollout/compress").annotate({ "title": "Rollout/compressRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Rollout/compressRequest", "description": "Start a best-effort background compression pass for cold local rollouts." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/unarchive").annotate({ "title": "Thread/unarchiveRequestMethod" }), "params": ClientRequest__ThreadUnarchiveParams }).annotate({ "title": "Thread/unarchiveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/compact/start").annotate({ "title": "Thread/compact/startRequestMethod" }), "params": ClientRequest__ThreadCompactStartParams }).annotate({ "title": "Thread/compact/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/shellCommand").annotate({ "title": "Thread/shellCommandRequestMethod" }), "params": ClientRequest__ThreadShellCommandParams }).annotate({ "title": "Thread/shellCommandRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/approveGuardianDeniedAction").annotate({ "title": "Thread/approveGuardianDeniedActionRequestMethod" }), "params": ClientRequest__ThreadApproveGuardianDeniedActionParams }).annotate({ "title": "Thread/approveGuardianDeniedActionRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/backgroundTerminals/clean").annotate({ "title": "Thread/backgroundTerminals/cleanRequestMethod" }), "params": ClientRequest__ThreadBackgroundTerminalsCleanParams }).annotate({ "title": "Thread/backgroundTerminals/cleanRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/backgroundTerminals/list").annotate({ "title": "Thread/backgroundTerminals/listRequestMethod" }), "params": ClientRequest__ThreadBackgroundTerminalsListParams }).annotate({ "title": "Thread/backgroundTerminals/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/backgroundTerminals/terminate").annotate({ "title": "Thread/backgroundTerminals/terminateRequestMethod" }), "params": ClientRequest__ThreadBackgroundTerminalsTerminateParams }).annotate({ "title": "Thread/backgroundTerminals/terminateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "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("project/list").annotate({ "title": "Project/listRequestMethod" }), "params": ClientRequest__ProjectListParams }).annotate({ "title": "Project/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/read").annotate({ "title": "Project/readRequestMethod" }), "params": ClientRequest__ProjectReadParams }).annotate({ "title": "Project/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/create").annotate({ "title": "Project/createRequestMethod" }), "params": ClientRequest__ProjectCreateParams }).annotate({ "title": "Project/createRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/import").annotate({ "title": "Project/importRequestMethod" }), "params": ClientRequest__ProjectImportParams }).annotate({ "title": "Project/importRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/update").annotate({ "title": "Project/updateRequestMethod" }), "params": ClientRequest__ProjectUpdateParams }).annotate({ "title": "Project/updateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/move").annotate({ "title": "Project/moveRequestMethod" }), "params": ClientRequest__ProjectMoveParams }).annotate({ "title": "Project/moveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/delete").annotate({ "title": "Project/deleteRequestMethod" }), "params": ClientRequest__ProjectDeleteParams }).annotate({ "title": "Project/deleteRequest" }), 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/search").annotate({ "title": "Thread/searchRequestMethod" }), "params": ClientRequest__ThreadSearchParams }).annotate({ "title": "Thread/searchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/searchOccurrences").annotate({ "title": "Thread/searchOccurrencesRequestMethod" }), "params": ClientRequest__ThreadSearchOccurrencesParams }).annotate({ "title": "Thread/searchOccurrencesRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/loaded/list").annotate({ "title": "Thread/loaded/listRequestMethod" }), "params": ClientRequest__ThreadLoadedListParams }).annotate({ "title": "Thread/loaded/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "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/readState/update").annotate({ "title": "Thread/readState/updateRequestMethod" }), "params": ClientRequest__ThreadReadStateUpdateParams }).annotate({ "title": "Thread/readState/updateRequest" }), 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/items/read").annotate({ "title": "Thread/items/readRequestMethod" }), "params": ClientRequest__ThreadItemsReadParams }).annotate({ "title": "Thread/items/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/guardianReview").annotate({ "title": "Thread/guardianReviewRequestMethod" }), "params": ClientRequest__ThreadGuardianReviewParams }).annotate({ "title": "Thread/guardianReviewRequest", "description": "Review the idle thread's final injected exec_command without executing it." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/inject_items").annotate({ "title": "Thread/injectItemsRequestMethod" }), "params": ClientRequest__ThreadInjectItemsParams }).annotate({ "title": "Thread/injectItemsRequest", "description": "Append raw Responses API items to the thread history without starting a user turn." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("skills/list").annotate({ "title": "Skills/listRequestMethod" }), "params": ClientRequest__SkillsListParams }).annotate({ "title": "Skills/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("skills/extraRoots/set").annotate({ "title": "Skills/extraRoots/setRequestMethod" }), "params": ClientRequest__SkillsExtraRootsSetParams }).annotate({ "title": "Skills/extraRoots/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("hooks/list").annotate({ "title": "Hooks/listRequestMethod" }), "params": ClientRequest__HooksListParams }).annotate({ "title": "Hooks/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("marketplace/add").annotate({ "title": "Marketplace/addRequestMethod" }), "params": ClientRequest__MarketplaceAddParams }).annotate({ "title": "Marketplace/addRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("marketplace/remove").annotate({ "title": "Marketplace/removeRequestMethod" }), "params": ClientRequest__MarketplaceRemoveParams }).annotate({ "title": "Marketplace/removeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("marketplace/upgrade").annotate({ "title": "Marketplace/upgradeRequestMethod" }), "params": ClientRequest__MarketplaceUpgradeParams }).annotate({ "title": "Marketplace/upgradeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/list").annotate({ "title": "Plugin/listRequestMethod" }), "params": ClientRequest__PluginListParams }).annotate({ "title": "Plugin/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/search").annotate({ "title": "Plugin/searchRequestMethod" }), "params": ClientRequest__PluginSearchParams }).annotate({ "title": "Plugin/searchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/installed").annotate({ "title": "Plugin/installedRequestMethod" }), "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" }), "params": ClientRequest__PluginReadParams }).annotate({ "title": "Plugin/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/skill/read").annotate({ "title": "Plugin/skill/readRequestMethod" }), "params": ClientRequest__PluginSkillReadParams }).annotate({ "title": "Plugin/skill/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/save").annotate({ "title": "Plugin/share/saveRequestMethod" }), "params": ClientRequest__PluginShareSaveParams }).annotate({ "title": "Plugin/share/saveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/updateTargets").annotate({ "title": "Plugin/share/updateTargetsRequestMethod" }), "params": ClientRequest__PluginShareUpdateTargetsParams }).annotate({ "title": "Plugin/share/updateTargetsRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/list").annotate({ "title": "Plugin/share/listRequestMethod" }), "params": ClientRequest__PluginShareListParams }).annotate({ "title": "Plugin/share/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/checkout").annotate({ "title": "Plugin/share/checkoutRequestMethod" }), "params": ClientRequest__PluginShareCheckoutParams }).annotate({ "title": "Plugin/share/checkoutRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/delete").annotate({ "title": "Plugin/share/deleteRequestMethod" }), "params": ClientRequest__PluginShareDeleteParams }).annotate({ "title": "Plugin/share/deleteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("app/read").annotate({ "title": "App/readRequestMethod" }), "params": ClientRequest__AppsReadParams }).annotate({ "title": "App/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("app/list").annotate({ "title": "App/listRequestMethod" }), "params": ClientRequest__AppsListParams }).annotate({ "title": "App/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("app/installed").annotate({ "title": "App/installedRequestMethod" }), "params": ClientRequest__AppsInstalledParams }).annotate({ "title": "App/installedRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/readFile").annotate({ "title": "Fs/readFileRequestMethod" }), "params": ClientRequest__FsReadFileParams }).annotate({ "title": "Fs/readFileRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/writeFile").annotate({ "title": "Fs/writeFileRequestMethod" }), "params": ClientRequest__FsWriteFileParams }).annotate({ "title": "Fs/writeFileRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/createDirectory").annotate({ "title": "Fs/createDirectoryRequestMethod" }), "params": ClientRequest__FsCreateDirectoryParams }).annotate({ "title": "Fs/createDirectoryRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/getMetadata").annotate({ "title": "Fs/getMetadataRequestMethod" }), "params": ClientRequest__FsGetMetadataParams }).annotate({ "title": "Fs/getMetadataRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/readDirectory").annotate({ "title": "Fs/readDirectoryRequestMethod" }), "params": ClientRequest__FsReadDirectoryParams }).annotate({ "title": "Fs/readDirectoryRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/remove").annotate({ "title": "Fs/removeRequestMethod" }), "params": ClientRequest__FsRemoveParams }).annotate({ "title": "Fs/removeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/copy").annotate({ "title": "Fs/copyRequestMethod" }), "params": ClientRequest__FsCopyParams }).annotate({ "title": "Fs/copyRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/watch").annotate({ "title": "Fs/watchRequestMethod" }), "params": ClientRequest__FsWatchParams }).annotate({ "title": "Fs/watchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/unwatch").annotate({ "title": "Fs/unwatchRequestMethod" }), "params": ClientRequest__FsUnwatchParams }).annotate({ "title": "Fs/unwatchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("skills/config/write").annotate({ "title": "Skills/config/writeRequestMethod" }), "params": ClientRequest__SkillsConfigWriteParams }).annotate({ "title": "Skills/config/writeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/install").annotate({ "title": "Plugin/installRequestMethod" }), "params": ClientRequest__PluginInstallParams }).annotate({ "title": "Plugin/installRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/uninstall").annotate({ "title": "Plugin/uninstallRequestMethod" }), "params": ClientRequest__PluginUninstallParams }).annotate({ "title": "Plugin/uninstallRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("turn/start").annotate({ "title": "Turn/startRequestMethod" }), "params": ClientRequest__TurnStartParams }).annotate({ "title": "Turn/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("turn/settings/update").annotate({ "title": "Turn/settings/updateRequestMethod" }), "params": ClientRequest__TurnSettingsUpdateParams }).annotate({ "title": "Turn/settings/updateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("turn/steer").annotate({ "title": "Turn/steerRequestMethod" }), "params": ClientRequest__TurnSteerParams }).annotate({ "title": "Turn/steerRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("turn/interrupt").annotate({ "title": "Turn/interruptRequestMethod" }), "params": ClientRequest__TurnInterruptParams }).annotate({ "title": "Turn/interruptRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/start").annotate({ "title": "Thread/realtime/startRequestMethod" }), "params": ClientRequest__ThreadRealtimeStartParams }).annotate({ "title": "Thread/realtime/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/appendAudio").annotate({ "title": "Thread/realtime/appendAudioRequestMethod" }), "params": ClientRequest__ThreadRealtimeAppendAudioParams }).annotate({ "title": "Thread/realtime/appendAudioRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/appendText").annotate({ "title": "Thread/realtime/appendTextRequestMethod" }), "params": ClientRequest__ThreadRealtimeAppendTextParams }).annotate({ "title": "Thread/realtime/appendTextRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/appendSpeech").annotate({ "title": "Thread/realtime/appendSpeechRequestMethod" }), "params": ClientRequest__ThreadRealtimeAppendSpeechParams }).annotate({ "title": "Thread/realtime/appendSpeechRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/stop").annotate({ "title": "Thread/realtime/stopRequestMethod" }), "params": ClientRequest__ThreadRealtimeStopParams }).annotate({ "title": "Thread/realtime/stopRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/timeline/list").annotate({ "title": "Thread/timeline/listRequestMethod" }), "params": ClientRequest__ThreadTimelineListParams }).annotate({ "title": "Thread/timeline/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/listVoices").annotate({ "title": "Thread/realtime/listVoicesRequestMethod" }), "params": ClientRequest__ThreadRealtimeListVoicesParams }).annotate({ "title": "Thread/realtime/listVoicesRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("review/start").annotate({ "title": "Review/startRequestMethod" }), "params": ClientRequest__ReviewStartParams }).annotate({ "title": "Review/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "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({ "title": "ModelProvider/capabilities/readRequestMethod" }), "params": ClientRequest__ModelProviderCapabilitiesReadParams }).annotate({ "title": "ModelProvider/capabilities/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("experimentalFeature/list").annotate({ "title": "ExperimentalFeature/listRequestMethod" }), "params": ClientRequest__ExperimentalFeatureListParams }).annotate({ "title": "ExperimentalFeature/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("permissionProfile/list").annotate({ "title": "PermissionProfile/listRequestMethod" }), "params": ClientRequest__PermissionProfileListParams }).annotate({ "title": "PermissionProfile/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("experimentalFeature/enablement/set").annotate({ "title": "ExperimentalFeature/enablement/setRequestMethod" }), "params": ClientRequest__ExperimentalFeatureEnablementSetParams }).annotate({ "title": "ExperimentalFeature/enablement/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/enable").annotate({ "title": "RemoteControl/enableRequestMethod" }), "params": Schema.optionalKey(Schema.Union([ClientRequest__RemoteControlEnableParams, Schema.Null])) }).annotate({ "title": "RemoteControl/enableRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/disable").annotate({ "title": "RemoteControl/disableRequestMethod" }), "params": Schema.optionalKey(Schema.Union([ClientRequest__RemoteControlDisableParams, Schema.Null])) }).annotate({ "title": "RemoteControl/disableRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/status/read").annotate({ "title": "RemoteControl/status/readRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "RemoteControl/status/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/pairing/start").annotate({ "title": "RemoteControl/pairing/startRequestMethod" }), "params": ClientRequest__RemoteControlPairingStartParams }).annotate({ "title": "RemoteControl/pairing/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/pairing/status").annotate({ "title": "RemoteControl/pairing/statusRequestMethod" }), "params": ClientRequest__RemoteControlPairingStatusParams }).annotate({ "title": "RemoteControl/pairing/statusRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/client/list").annotate({ "title": "RemoteControl/client/listRequestMethod" }), "params": ClientRequest__RemoteControlClientsListParams }).annotate({ "title": "RemoteControl/client/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/client/revoke").annotate({ "title": "RemoteControl/client/revokeRequestMethod" }), "params": ClientRequest__RemoteControlClientsRevokeParams }).annotate({ "title": "RemoteControl/client/revokeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("collaborationMode/list").annotate({ "title": "CollaborationMode/listRequestMethod" }), "params": ClientRequest__CollaborationModeListParams }).annotate({ "title": "CollaborationMode/listRequest", "description": "Lists collaboration mode presets." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mock/experimentalMethod").annotate({ "title": "Mock/experimentalMethodRequestMethod" }), "params": ClientRequest__MockExperimentalMethodParams }).annotate({ "title": "Mock/experimentalMethodRequest", "description": "Test-only method used to validate experimental gating." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("environment/add").annotate({ "title": "Environment/addRequestMethod" }), "params": ClientRequest__EnvironmentAddParams }).annotate({ "title": "Environment/addRequest", "description": "Adds or replaces a remote environment by id for later selection." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("environment/info").annotate({ "title": "Environment/infoRequestMethod" }), "params": ClientRequest__EnvironmentInfoParams }).annotate({ "title": "Environment/infoRequest", "description": "Reads information from a configured execution environment." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("environment/status").annotate({ "title": "Environment/statusRequestMethod" }), "params": ClientRequest__EnvironmentStatusParams }).annotate({ "title": "Environment/statusRequest", "description": "Reads the current status of a configured execution environment." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/oauth/login").annotate({ "title": "McpServer/oauth/loginRequestMethod" }), "params": ClientRequest__McpServerOauthLoginParams }).annotate({ "title": "McpServer/oauth/loginRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("config/mcpServer/reload").annotate({ "title": "Config/mcpServer/reloadRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Config/mcpServer/reloadRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServerStatus/list").annotate({ "title": "McpServerStatus/listRequestMethod" }), "params": ClientRequest__ListMcpServerStatusParams }).annotate({ "title": "McpServerStatus/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/resource/read").annotate({ "title": "McpServer/resource/readRequestMethod" }), "params": ClientRequest__McpResourceReadParams }).annotate({ "title": "McpServer/resource/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/event/stream/start").annotate({ "title": "McpServer/event/stream/startRequestMethod" }), "params": ClientRequest__McpServerEventStreamStartParams }).annotate({ "title": "McpServer/event/stream/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/event/stream/stop").annotate({ "title": "McpServer/event/stream/stopRequestMethod" }), "params": ClientRequest__McpServerEventStreamStopParams }).annotate({ "title": "McpServer/event/stream/stopRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/tool/call").annotate({ "title": "McpServer/tool/callRequestMethod" }), "params": ClientRequest__McpServerToolCallParams }).annotate({ "title": "McpServer/tool/callRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("windowsSandbox/setupStart").annotate({ "title": "WindowsSandbox/setupStartRequestMethod" }), "params": ClientRequest__WindowsSandboxSetupStartParams }).annotate({ "title": "WindowsSandbox/setupStartRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("windowsSandbox/readiness").annotate({ "title": "WindowsSandbox/readinessRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "WindowsSandbox/readinessRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/login/start").annotate({ "title": "Account/login/startRequestMethod" }), "params": ClientRequest__LoginAccountParams }).annotate({ "title": "Account/login/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/bedrock/discover").annotate({ "title": "Account/bedrock/discoverRequestMethod" }), "params": ClientRequest__BedrockDiscoverParams }).annotate({ "title": "Account/bedrock/discoverRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/bedrock/setup").annotate({ "title": "Account/bedrock/setupRequestMethod" }), "params": ClientRequest__BedrockSetupParams }).annotate({ "title": "Account/bedrock/setupRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/gcp/setup").annotate({ "title": "Account/gcp/setupRequestMethod" }), "params": ClientRequest__GcpSetupParams }).annotate({ "title": "Account/gcp/setupRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/bedrock/checkGovCloudRequirements").annotate({ "title": "Account/bedrock/checkGovCloudRequirementsRequestMethod" }), "params": ClientRequest__BedrockCheckGovCloudRequirementsParams }).annotate({ "title": "Account/bedrock/checkGovCloudRequirementsRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/login/cancel").annotate({ "title": "Account/login/cancelRequestMethod" }), "params": ClientRequest__CancelLoginAccountParams }).annotate({ "title": "Account/login/cancelRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("accountSession/list").annotate({ "title": "AccountSession/listRequestMethod" }), "params": ClientRequest__AccountSessionsListParams }).annotate({ "title": "AccountSession/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("accountSession/switch").annotate({ "title": "AccountSession/switchRequestMethod" }), "params": ClientRequest__AccountSessionsSwitchParams }).annotate({ "title": "AccountSession/switchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/logout").annotate({ "title": "Account/logoutRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Account/logoutRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/rateLimits/read").annotate({ "title": "Account/rateLimits/readRequestMethod" }), "params": Schema.optionalKey(Schema.Union([ClientRequest__GetAccountRateLimitsParams, Schema.Null])) }).annotate({ "title": "Account/rateLimits/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/rateLimitResetCredit/consume").annotate({ "title": "Account/rateLimitResetCredit/consumeRequestMethod" }), "params": ClientRequest__ConsumeAccountRateLimitResetCreditParams }).annotate({ "title": "Account/rateLimitResetCredit/consumeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/usage/read").annotate({ "title": "Account/usage/readRequestMethod" }), "params": Schema.optionalKey(Schema.Union([ClientRequest__GetAccountTokenUsageParams, Schema.Null])) }).annotate({ "title": "Account/usage/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/workspaceMessages/read").annotate({ "title": "Account/workspaceMessages/readRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Account/workspaceMessages/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/sendAddCreditsNudgeEmail").annotate({ "title": "Account/sendAddCreditsNudgeEmailRequestMethod" }), "params": ClientRequest__SendAddCreditsNudgeEmailParams }).annotate({ "title": "Account/sendAddCreditsNudgeEmailRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("feedback/upload").annotate({ "title": "Feedback/uploadRequestMethod" }), "params": ClientRequest__FeedbackUploadParams }).annotate({ "title": "Feedback/uploadRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("feedback/save").annotate({ "title": "Feedback/saveRequestMethod" }), "params": ClientRequest__FeedbackSaveParams }).annotate({ "title": "Feedback/saveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("command/exec").annotate({ "title": "Command/execRequestMethod" }), "params": ClientRequest__CommandExecParams }).annotate({ "title": "Command/execRequest", "description": "Execute a standalone command (argv vector) under the server's sandbox." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("command/exec/write").annotate({ "title": "Command/exec/writeRequestMethod" }), "params": ClientRequest__CommandExecWriteParams }).annotate({ "title": "Command/exec/writeRequest", "description": "Write stdin bytes to a running `command/exec` session or close stdin." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("command/exec/terminate").annotate({ "title": "Command/exec/terminateRequestMethod" }), "params": ClientRequest__CommandExecTerminateParams }).annotate({ "title": "Command/exec/terminateRequest", "description": "Terminate a running `command/exec` session by client-supplied `processId`." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("command/exec/resize").annotate({ "title": "Command/exec/resizeRequestMethod" }), "params": ClientRequest__CommandExecResizeParams }).annotate({ "title": "Command/exec/resizeRequest", "description": "Resize a running PTY-backed `command/exec` session by client-supplied `processId`." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("process/spawn").annotate({ "title": "Process/spawnRequestMethod" }), "params": ClientRequest__ProcessSpawnParams }).annotate({ "title": "Process/spawnRequest", "description": "Spawn a standalone process (argv vector) without a Codex sandbox." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("process/writeStdin").annotate({ "title": "Process/writeStdinRequestMethod" }), "params": ClientRequest__ProcessWriteStdinParams }).annotate({ "title": "Process/writeStdinRequest", "description": "Write stdin bytes to a running `process/spawn` session or close stdin." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("process/kill").annotate({ "title": "Process/killRequestMethod" }), "params": ClientRequest__ProcessKillParams }).annotate({ "title": "Process/killRequest", "description": "Terminate a running `process/spawn` session by client-supplied `processHandle`." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("process/resizePty").annotate({ "title": "Process/resizePtyRequestMethod" }), "params": ClientRequest__ProcessResizePtyParams }).annotate({ "title": "Process/resizePtyRequest", "description": "Resize a running PTY-backed `process/spawn` session by client-supplied `processHandle`." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("config/read").annotate({ "title": "Config/readRequestMethod" }), "params": ClientRequest__ConfigReadParams }).annotate({ "title": "Config/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("externalAgentConfig/detect").annotate({ "title": "ExternalAgentConfig/detectRequestMethod" }), "params": ClientRequest__ExternalAgentConfigDetectParams }).annotate({ "title": "ExternalAgentConfig/detectRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("externalAgentConfig/import").annotate({ "title": "ExternalAgentConfig/importRequestMethod" }), "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({ "title": "ExternalAgentConfig/import/readHistoriesRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "ExternalAgentConfig/import/readHistoriesRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("config/value/write").annotate({ "title": "Config/value/writeRequestMethod" }), "params": ClientRequest__ConfigValueWriteParams }).annotate({ "title": "Config/value/writeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("config/batchWrite").annotate({ "title": "Config/batchWriteRequestMethod" }), "params": ClientRequest__ConfigBatchWriteParams }).annotate({ "title": "Config/batchWriteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("configRequirements/read").annotate({ "title": "ConfigRequirements/readRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "ConfigRequirements/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/read").annotate({ "title": "Account/readRequestMethod" }), "params": ClientRequest__GetAccountParams }).annotate({ "title": "Account/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fuzzyFileSearch").annotate({ "title": "FuzzyFileSearchRequestMethod" }), "params": ClientRequest__FuzzyFileSearchParams }).annotate({ "title": "FuzzyFileSearchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fuzzyFileSearch/sessionStart").annotate({ "title": "FuzzyFileSearch/sessionStartRequestMethod" }), "params": ClientRequest__FuzzyFileSearchSessionStartParams }).annotate({ "title": "FuzzyFileSearch/sessionStartRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fuzzyFileSearch/sessionUpdate").annotate({ "title": "FuzzyFileSearch/sessionUpdateRequestMethod" }), "params": ClientRequest__FuzzyFileSearchSessionUpdateParams }).annotate({ "title": "FuzzyFileSearch/sessionUpdateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fuzzyFileSearch/sessionStop").annotate({ "title": "FuzzyFileSearch/sessionStopRequestMethod" }), "params": ClientRequest__FuzzyFileSearchSessionStopParams }).annotate({ "title": "FuzzyFileSearch/sessionStopRequest" })], { mode: "oneOf" }).annotate({ "title": "ClientRequest", "description": "Request from the client to the server." }) +export type ClientRequest = { readonly "id": ClientRequest__RequestId, readonly "method": "initialize", readonly "params": ClientRequest__InitializeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "server/diagnostics", readonly "params": ClientRequest__ServerDiagnosticsParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/status", readonly "params": ClientRequest__UserVerificationStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/enroll", readonly "params": ClientRequest__UserVerificationEnrollParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/delete", readonly "params": ClientRequest__UserVerificationDeleteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/verify", readonly "params": ClientRequest__UserVerificationVerifyParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "userVerification/cancel", readonly "params": ClientRequest__UserVerificationCancelParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/start", readonly "params": ClientRequest__ThreadStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/resume", readonly "params": ClientRequest__ThreadResumeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/fork", readonly "params": ClientRequest__ThreadForkParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/sample", readonly "params": ClientRequest__ThreadSampleParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/sample/cancel", readonly "params": ClientRequest__ThreadSampleCancelParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/archive", readonly "params": ClientRequest__ThreadArchiveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/delete", readonly "params": ClientRequest__ThreadDeleteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/unsubscribe", readonly "params": ClientRequest__ThreadUnsubscribeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/increment_elicitation", readonly "params": ClientRequest__ThreadIncrementElicitationParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/decrement_elicitation", readonly "params": ClientRequest__ThreadDecrementElicitationParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/name/set", readonly "params": ClientRequest__ThreadSetNameParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/prediction/request", readonly "params": ClientRequest__ThreadPredictionRequestParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/goal/set", readonly "params": ClientRequest__ThreadGoalSetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/goal/get", readonly "params": ClientRequest__ThreadGoalGetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/goal/clear", readonly "params": ClientRequest__ThreadGoalClearParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/add", readonly "params": ClientRequest__ThreadQueueAddParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/list", readonly "params": ClientRequest__ThreadQueueListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/update", readonly "params": ClientRequest__ThreadQueueUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/delete", readonly "params": ClientRequest__ThreadQueueDeleteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/reorder", readonly "params": ClientRequest__ThreadQueueReorderParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/queue/start", readonly "params": ClientRequest__ThreadQueueStartParams } | { readonly "id": ClientRequest__RequestId, 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/attachmentOwner/list", readonly "params": ClientRequest__ThreadAttachmentOwnerListParams } | { 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/settings/update", readonly "params": ClientRequest__ThreadSettingsUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/memoryMode/set", readonly "params": ClientRequest__ThreadMemoryModeSetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/memory/read", readonly "params": ClientRequest__ThreadMemoryReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "memory/status", readonly "params": ClientRequest__MemoryStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "memory/reset", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "rollout/compress", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/unarchive", readonly "params": ClientRequest__ThreadUnarchiveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/compact/start", readonly "params": ClientRequest__ThreadCompactStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/shellCommand", readonly "params": ClientRequest__ThreadShellCommandParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/approveGuardianDeniedAction", readonly "params": ClientRequest__ThreadApproveGuardianDeniedActionParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/backgroundTerminals/clean", readonly "params": ClientRequest__ThreadBackgroundTerminalsCleanParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/backgroundTerminals/list", readonly "params": ClientRequest__ThreadBackgroundTerminalsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/backgroundTerminals/terminate", readonly "params": ClientRequest__ThreadBackgroundTerminalsTerminateParams } | { readonly "id": ClientRequest__RequestId, 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": "project/list", readonly "params": ClientRequest__ProjectListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/read", readonly "params": ClientRequest__ProjectReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/create", readonly "params": ClientRequest__ProjectCreateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/import", readonly "params": ClientRequest__ProjectImportParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/update", readonly "params": ClientRequest__ProjectUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/move", readonly "params": ClientRequest__ProjectMoveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "project/delete", readonly "params": ClientRequest__ProjectDeleteParams } | { 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/search", readonly "params": ClientRequest__ThreadSearchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/searchOccurrences", readonly "params": ClientRequest__ThreadSearchOccurrencesParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/loaded/list", readonly "params": ClientRequest__ThreadLoadedListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/read", readonly "params": ClientRequest__ThreadReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/readState/update", readonly "params": ClientRequest__ThreadReadStateUpdateParams } | { 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/items/read", readonly "params": ClientRequest__ThreadItemsReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/guardianReview", readonly "params": ClientRequest__ThreadGuardianReviewParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/inject_items", readonly "params": ClientRequest__ThreadInjectItemsParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/prepareApprovedPlan", readonly "params": ClientRequest__ThreadPrepareApprovedPlanParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "skills/list", readonly "params": ClientRequest__SkillsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "skills/extraRoots/set", readonly "params": ClientRequest__SkillsExtraRootsSetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "hooks/list", readonly "params": ClientRequest__HooksListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "marketplace/add", readonly "params": ClientRequest__MarketplaceAddParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "marketplace/remove", readonly "params": ClientRequest__MarketplaceRemoveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "marketplace/upgrade", readonly "params": ClientRequest__MarketplaceUpgradeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/list", readonly "params": ClientRequest__PluginListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/search", readonly "params": ClientRequest__PluginSearchParams } | { readonly "id": ClientRequest__RequestId, 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", readonly "params": ClientRequest__PluginReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/skill/read", readonly "params": ClientRequest__PluginSkillReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/save", readonly "params": ClientRequest__PluginShareSaveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/updateTargets", readonly "params": ClientRequest__PluginShareUpdateTargetsParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/list", readonly "params": ClientRequest__PluginShareListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/checkout", readonly "params": ClientRequest__PluginShareCheckoutParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/share/delete", readonly "params": ClientRequest__PluginShareDeleteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "app/read", readonly "params": ClientRequest__AppsReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "app/list", readonly "params": ClientRequest__AppsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "app/installed", readonly "params": ClientRequest__AppsInstalledParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/readFile", readonly "params": ClientRequest__FsReadFileParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/writeFile", readonly "params": ClientRequest__FsWriteFileParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/createDirectory", readonly "params": ClientRequest__FsCreateDirectoryParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/getMetadata", readonly "params": ClientRequest__FsGetMetadataParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/readDirectory", readonly "params": ClientRequest__FsReadDirectoryParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/remove", readonly "params": ClientRequest__FsRemoveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/copy", readonly "params": ClientRequest__FsCopyParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/watch", readonly "params": ClientRequest__FsWatchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fs/unwatch", readonly "params": ClientRequest__FsUnwatchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "skills/config/write", readonly "params": ClientRequest__SkillsConfigWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/install", readonly "params": ClientRequest__PluginInstallParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "plugin/uninstall", readonly "params": ClientRequest__PluginUninstallParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "turn/start", readonly "params": ClientRequest__TurnStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "turn/settings/update", readonly "params": ClientRequest__TurnSettingsUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "turn/steer", readonly "params": ClientRequest__TurnSteerParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "turn/interrupt", readonly "params": ClientRequest__TurnInterruptParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/start", readonly "params": ClientRequest__ThreadRealtimeStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/appendAudio", readonly "params": ClientRequest__ThreadRealtimeAppendAudioParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/appendText", readonly "params": ClientRequest__ThreadRealtimeAppendTextParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/appendSpeech", readonly "params": ClientRequest__ThreadRealtimeAppendSpeechParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/stop", readonly "params": ClientRequest__ThreadRealtimeStopParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/timeline/list", readonly "params": ClientRequest__ThreadTimelineListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "thread/realtime/listVoices", readonly "params": ClientRequest__ThreadRealtimeListVoicesParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "review/start", readonly "params": ClientRequest__ReviewStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "model/list", readonly "params": ClientRequest__ModelListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/gatewayOAuth/read", readonly "params"?: ClientRequest__GatewayOAuthReadParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/gatewayOAuth/login", readonly "params"?: ClientRequest__GatewayOAuthLoginParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/gatewayOAuth/cancel", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "modelProvider/list", readonly "params": ClientRequest__ModelProviderListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "modelProvider/config/write", readonly "params": ClientRequest__ModelProviderConfigWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "modelProvider/capabilities/read", readonly "params": ClientRequest__ModelProviderCapabilitiesReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "experimentalFeature/list", readonly "params": ClientRequest__ExperimentalFeatureListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "permissionProfile/list", readonly "params": ClientRequest__PermissionProfileListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "experimentalFeature/enablement/set", readonly "params": ClientRequest__ExperimentalFeatureEnablementSetParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/enable", readonly "params"?: ClientRequest__RemoteControlEnableParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/disable", readonly "params"?: ClientRequest__RemoteControlDisableParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/status/read", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/pairing/start", readonly "params": ClientRequest__RemoteControlPairingStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/pairing/status", readonly "params": ClientRequest__RemoteControlPairingStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/client/list", readonly "params": ClientRequest__RemoteControlClientsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "remoteControl/client/revoke", readonly "params": ClientRequest__RemoteControlClientsRevokeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "collaborationMode/list", readonly "params": ClientRequest__CollaborationModeListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mock/experimentalMethod", readonly "params": ClientRequest__MockExperimentalMethodParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "environment/add", readonly "params": ClientRequest__EnvironmentAddParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "environment/info", readonly "params": ClientRequest__EnvironmentInfoParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "environment/status", readonly "params": ClientRequest__EnvironmentStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/oauth/login", readonly "params": ClientRequest__McpServerOauthLoginParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "config/mcpServer/reload", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServerStatus/list", readonly "params": ClientRequest__ListMcpServerStatusParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/resource/read", readonly "params": ClientRequest__McpResourceReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/event/stream/start", readonly "params": ClientRequest__McpServerEventStreamStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/event/stream/stop", readonly "params": ClientRequest__McpServerEventStreamStopParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "mcpServer/tool/call", readonly "params": ClientRequest__McpServerToolCallParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "windowsSandbox/setupStart", readonly "params": ClientRequest__WindowsSandboxSetupStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "windowsSandbox/readiness", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/login/start", readonly "params": ClientRequest__LoginAccountParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/bedrock/discover", readonly "params": ClientRequest__BedrockDiscoverParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/bedrock/setup", readonly "params": ClientRequest__BedrockSetupParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/gcp/setup", readonly "params": ClientRequest__GcpSetupParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/bedrock/checkGovCloudRequirements", readonly "params": ClientRequest__BedrockCheckGovCloudRequirementsParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/login/cancel", readonly "params": ClientRequest__CancelLoginAccountParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "accountSession/list", readonly "params": ClientRequest__AccountSessionsListParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "accountSession/switch", readonly "params": ClientRequest__AccountSessionsSwitchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/logout", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/securitySetup/read", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/rateLimits/read", readonly "params"?: ClientRequest__GetAccountRateLimitsParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/rateLimitResetCredit/consume", readonly "params": ClientRequest__ConsumeAccountRateLimitResetCreditParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/usage/read", readonly "params"?: ClientRequest__GetAccountTokenUsageParams | null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/workspaceMessages/read", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/sendAddCreditsNudgeEmail", readonly "params": ClientRequest__SendAddCreditsNudgeEmailParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "feedback/upload", readonly "params": ClientRequest__FeedbackUploadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "feedback/save", readonly "params": ClientRequest__FeedbackSaveParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "command/exec", readonly "params": ClientRequest__CommandExecParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "command/exec/write", readonly "params": ClientRequest__CommandExecWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "command/exec/terminate", readonly "params": ClientRequest__CommandExecTerminateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "command/exec/resize", readonly "params": ClientRequest__CommandExecResizeParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "process/spawn", readonly "params": ClientRequest__ProcessSpawnParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "process/writeStdin", readonly "params": ClientRequest__ProcessWriteStdinParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "process/kill", readonly "params": ClientRequest__ProcessKillParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "process/resizePty", readonly "params": ClientRequest__ProcessResizePtyParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "config/read", readonly "params": ClientRequest__ConfigReadParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "externalAgentConfig/detect", readonly "params": ClientRequest__ExternalAgentConfigDetectParams } | { readonly "id": ClientRequest__RequestId, 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", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "config/value/write", readonly "params": ClientRequest__ConfigValueWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "config/batchWrite", readonly "params": ClientRequest__ConfigBatchWriteParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "configRequirements/read", readonly "params"?: null } | { readonly "id": ClientRequest__RequestId, readonly "method": "account/read", readonly "params": ClientRequest__GetAccountParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fuzzyFileSearch", readonly "params": ClientRequest__FuzzyFileSearchParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fuzzyFileSearch/sessionStart", readonly "params": ClientRequest__FuzzyFileSearchSessionStartParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fuzzyFileSearch/sessionUpdate", readonly "params": ClientRequest__FuzzyFileSearchSessionUpdateParams } | { readonly "id": ClientRequest__RequestId, readonly "method": "fuzzyFileSearch/sessionStop", readonly "params": ClientRequest__FuzzyFileSearchSessionStopParams } +export const ClientRequest = Schema.Union([Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("initialize").annotate({ "title": "InitializeRequestMethod" }), "params": ClientRequest__InitializeParams }).annotate({ "title": "InitializeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("server/diagnostics").annotate({ "title": "Server/diagnosticsRequestMethod" }), "params": ClientRequest__ServerDiagnosticsParams }).annotate({ "title": "Server/diagnosticsRequest", "description": "Read content-free, process-local diagnostics." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/status").annotate({ "title": "UserVerification/statusRequestMethod" }), "params": ClientRequest__UserVerificationStatusParams }).annotate({ "title": "UserVerification/statusRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/enroll").annotate({ "title": "UserVerification/enrollRequestMethod" }), "params": ClientRequest__UserVerificationEnrollParams }).annotate({ "title": "UserVerification/enrollRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/delete").annotate({ "title": "UserVerification/deleteRequestMethod" }), "params": ClientRequest__UserVerificationDeleteParams }).annotate({ "title": "UserVerification/deleteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/verify").annotate({ "title": "UserVerification/verifyRequestMethod" }), "params": ClientRequest__UserVerificationVerifyParams }).annotate({ "title": "UserVerification/verifyRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("userVerification/cancel").annotate({ "title": "UserVerification/cancelRequestMethod" }), "params": ClientRequest__UserVerificationCancelParams }).annotate({ "title": "UserVerification/cancelRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/start").annotate({ "title": "Thread/startRequestMethod" }), "params": ClientRequest__ThreadStartParams }).annotate({ "title": "Thread/startRequest", "description": "NEW APIs" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/resume").annotate({ "title": "Thread/resumeRequestMethod" }), "params": ClientRequest__ThreadResumeParams }).annotate({ "title": "Thread/resumeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/fork").annotate({ "title": "Thread/forkRequestMethod" }), "params": ClientRequest__ThreadForkParams }).annotate({ "title": "Thread/forkRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/sample").annotate({ "title": "Thread/sampleRequestMethod" }), "params": ClientRequest__ThreadSampleParams }).annotate({ "title": "Thread/sampleRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/sample/cancel").annotate({ "title": "Thread/sample/cancelRequestMethod" }), "params": ClientRequest__ThreadSampleCancelParams }).annotate({ "title": "Thread/sample/cancelRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/archive").annotate({ "title": "Thread/archiveRequestMethod" }), "params": ClientRequest__ThreadArchiveParams }).annotate({ "title": "Thread/archiveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/delete").annotate({ "title": "Thread/deleteRequestMethod" }), "params": ClientRequest__ThreadDeleteParams }).annotate({ "title": "Thread/deleteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/unsubscribe").annotate({ "title": "Thread/unsubscribeRequestMethod" }), "params": ClientRequest__ThreadUnsubscribeParams }).annotate({ "title": "Thread/unsubscribeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/increment_elicitation").annotate({ "title": "Thread/incrementElicitationRequestMethod" }), "params": ClientRequest__ThreadIncrementElicitationParams }).annotate({ "title": "Thread/incrementElicitationRequest", "description": "Increment the thread-local out-of-band elicitation counter.\n\nThis is used by external helpers to pause timeout accounting while a user approval or other elicitation is pending outside the app-server request flow." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/decrement_elicitation").annotate({ "title": "Thread/decrementElicitationRequestMethod" }), "params": ClientRequest__ThreadDecrementElicitationParams }).annotate({ "title": "Thread/decrementElicitationRequest", "description": "Decrement the thread-local out-of-band elicitation counter.\n\nWhen the count reaches zero, timeout accounting resumes for the thread." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/name/set").annotate({ "title": "Thread/name/setRequestMethod" }), "params": ClientRequest__ThreadSetNameParams }).annotate({ "title": "Thread/name/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/prediction/request").annotate({ "title": "Thread/prediction/requestRequestMethod" }), "params": ClientRequest__ThreadPredictionRequestParams }).annotate({ "title": "Thread/prediction/requestRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/goal/set").annotate({ "title": "Thread/goal/setRequestMethod" }), "params": ClientRequest__ThreadGoalSetParams }).annotate({ "title": "Thread/goal/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/goal/get").annotate({ "title": "Thread/goal/getRequestMethod" }), "params": ClientRequest__ThreadGoalGetParams }).annotate({ "title": "Thread/goal/getRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/goal/clear").annotate({ "title": "Thread/goal/clearRequestMethod" }), "params": ClientRequest__ThreadGoalClearParams }).annotate({ "title": "Thread/goal/clearRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/add").annotate({ "title": "Thread/queue/addRequestMethod" }), "params": ClientRequest__ThreadQueueAddParams }).annotate({ "title": "Thread/queue/addRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/list").annotate({ "title": "Thread/queue/listRequestMethod" }), "params": ClientRequest__ThreadQueueListParams }).annotate({ "title": "Thread/queue/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/update").annotate({ "title": "Thread/queue/updateRequestMethod" }), "params": ClientRequest__ThreadQueueUpdateParams }).annotate({ "title": "Thread/queue/updateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/delete").annotate({ "title": "Thread/queue/deleteRequestMethod" }), "params": ClientRequest__ThreadQueueDeleteParams }).annotate({ "title": "Thread/queue/deleteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/reorder").annotate({ "title": "Thread/queue/reorderRequestMethod" }), "params": ClientRequest__ThreadQueueReorderParams }).annotate({ "title": "Thread/queue/reorderRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/queue/start").annotate({ "title": "Thread/queue/startRequestMethod" }), "params": ClientRequest__ThreadQueueStartParams }).annotate({ "title": "Thread/queue/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/metadata/update").annotate({ "title": "Thread/metadata/updateRequestMethod" }), "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/attachmentOwner/list").annotate({ "title": "Thread/attachmentOwner/listRequestMethod" }), "params": ClientRequest__ThreadAttachmentOwnerListParams }).annotate({ "title": "Thread/attachmentOwner/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/settings/update").annotate({ "title": "Thread/settings/updateRequestMethod" }), "params": ClientRequest__ThreadSettingsUpdateParams }).annotate({ "title": "Thread/settings/updateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/memoryMode/set").annotate({ "title": "Thread/memoryMode/setRequestMethod" }), "params": ClientRequest__ThreadMemoryModeSetParams }).annotate({ "title": "Thread/memoryMode/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/memory/read").annotate({ "title": "Thread/memory/readRequestMethod" }), "params": ClientRequest__ThreadMemoryReadParams }).annotate({ "title": "Thread/memory/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("memory/status").annotate({ "title": "Memory/statusRequestMethod" }), "params": ClientRequest__MemoryStatusParams }).annotate({ "title": "Memory/statusRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("memory/reset").annotate({ "title": "Memory/resetRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Memory/resetRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("rollout/compress").annotate({ "title": "Rollout/compressRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Rollout/compressRequest", "description": "Start a best-effort background compression pass for cold local rollouts." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/unarchive").annotate({ "title": "Thread/unarchiveRequestMethod" }), "params": ClientRequest__ThreadUnarchiveParams }).annotate({ "title": "Thread/unarchiveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/compact/start").annotate({ "title": "Thread/compact/startRequestMethod" }), "params": ClientRequest__ThreadCompactStartParams }).annotate({ "title": "Thread/compact/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/shellCommand").annotate({ "title": "Thread/shellCommandRequestMethod" }), "params": ClientRequest__ThreadShellCommandParams }).annotate({ "title": "Thread/shellCommandRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/approveGuardianDeniedAction").annotate({ "title": "Thread/approveGuardianDeniedActionRequestMethod" }), "params": ClientRequest__ThreadApproveGuardianDeniedActionParams }).annotate({ "title": "Thread/approveGuardianDeniedActionRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/backgroundTerminals/clean").annotate({ "title": "Thread/backgroundTerminals/cleanRequestMethod" }), "params": ClientRequest__ThreadBackgroundTerminalsCleanParams }).annotate({ "title": "Thread/backgroundTerminals/cleanRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/backgroundTerminals/list").annotate({ "title": "Thread/backgroundTerminals/listRequestMethod" }), "params": ClientRequest__ThreadBackgroundTerminalsListParams }).annotate({ "title": "Thread/backgroundTerminals/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/backgroundTerminals/terminate").annotate({ "title": "Thread/backgroundTerminals/terminateRequestMethod" }), "params": ClientRequest__ThreadBackgroundTerminalsTerminateParams }).annotate({ "title": "Thread/backgroundTerminals/terminateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "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("project/list").annotate({ "title": "Project/listRequestMethod" }), "params": ClientRequest__ProjectListParams }).annotate({ "title": "Project/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/read").annotate({ "title": "Project/readRequestMethod" }), "params": ClientRequest__ProjectReadParams }).annotate({ "title": "Project/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/create").annotate({ "title": "Project/createRequestMethod" }), "params": ClientRequest__ProjectCreateParams }).annotate({ "title": "Project/createRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/import").annotate({ "title": "Project/importRequestMethod" }), "params": ClientRequest__ProjectImportParams }).annotate({ "title": "Project/importRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/update").annotate({ "title": "Project/updateRequestMethod" }), "params": ClientRequest__ProjectUpdateParams }).annotate({ "title": "Project/updateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/move").annotate({ "title": "Project/moveRequestMethod" }), "params": ClientRequest__ProjectMoveParams }).annotate({ "title": "Project/moveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("project/delete").annotate({ "title": "Project/deleteRequestMethod" }), "params": ClientRequest__ProjectDeleteParams }).annotate({ "title": "Project/deleteRequest" }), 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/search").annotate({ "title": "Thread/searchRequestMethod" }), "params": ClientRequest__ThreadSearchParams }).annotate({ "title": "Thread/searchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/searchOccurrences").annotate({ "title": "Thread/searchOccurrencesRequestMethod" }), "params": ClientRequest__ThreadSearchOccurrencesParams }).annotate({ "title": "Thread/searchOccurrencesRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/loaded/list").annotate({ "title": "Thread/loaded/listRequestMethod" }), "params": ClientRequest__ThreadLoadedListParams }).annotate({ "title": "Thread/loaded/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "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/readState/update").annotate({ "title": "Thread/readState/updateRequestMethod" }), "params": ClientRequest__ThreadReadStateUpdateParams }).annotate({ "title": "Thread/readState/updateRequest" }), 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/items/read").annotate({ "title": "Thread/items/readRequestMethod" }), "params": ClientRequest__ThreadItemsReadParams }).annotate({ "title": "Thread/items/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/guardianReview").annotate({ "title": "Thread/guardianReviewRequestMethod" }), "params": ClientRequest__ThreadGuardianReviewParams }).annotate({ "title": "Thread/guardianReviewRequest", "description": "Review the idle thread's final injected exec_command without executing it." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/inject_items").annotate({ "title": "Thread/injectItemsRequestMethod" }), "params": ClientRequest__ThreadInjectItemsParams }).annotate({ "title": "Thread/injectItemsRequest", "description": "Append raw Responses API items to the thread history without starting a user turn." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/prepareApprovedPlan").annotate({ "title": "Thread/prepareApprovedPlanRequestMethod" }), "params": ClientRequest__ThreadPrepareApprovedPlanParams }).annotate({ "title": "Thread/prepareApprovedPlanRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("skills/list").annotate({ "title": "Skills/listRequestMethod" }), "params": ClientRequest__SkillsListParams }).annotate({ "title": "Skills/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("skills/extraRoots/set").annotate({ "title": "Skills/extraRoots/setRequestMethod" }), "params": ClientRequest__SkillsExtraRootsSetParams }).annotate({ "title": "Skills/extraRoots/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("hooks/list").annotate({ "title": "Hooks/listRequestMethod" }), "params": ClientRequest__HooksListParams }).annotate({ "title": "Hooks/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("marketplace/add").annotate({ "title": "Marketplace/addRequestMethod" }), "params": ClientRequest__MarketplaceAddParams }).annotate({ "title": "Marketplace/addRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("marketplace/remove").annotate({ "title": "Marketplace/removeRequestMethod" }), "params": ClientRequest__MarketplaceRemoveParams }).annotate({ "title": "Marketplace/removeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("marketplace/upgrade").annotate({ "title": "Marketplace/upgradeRequestMethod" }), "params": ClientRequest__MarketplaceUpgradeParams }).annotate({ "title": "Marketplace/upgradeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/list").annotate({ "title": "Plugin/listRequestMethod" }), "params": ClientRequest__PluginListParams }).annotate({ "title": "Plugin/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/search").annotate({ "title": "Plugin/searchRequestMethod" }), "params": ClientRequest__PluginSearchParams }).annotate({ "title": "Plugin/searchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/installed").annotate({ "title": "Plugin/installedRequestMethod" }), "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" }), "params": ClientRequest__PluginReadParams }).annotate({ "title": "Plugin/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/skill/read").annotate({ "title": "Plugin/skill/readRequestMethod" }), "params": ClientRequest__PluginSkillReadParams }).annotate({ "title": "Plugin/skill/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/save").annotate({ "title": "Plugin/share/saveRequestMethod" }), "params": ClientRequest__PluginShareSaveParams }).annotate({ "title": "Plugin/share/saveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/updateTargets").annotate({ "title": "Plugin/share/updateTargetsRequestMethod" }), "params": ClientRequest__PluginShareUpdateTargetsParams }).annotate({ "title": "Plugin/share/updateTargetsRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/list").annotate({ "title": "Plugin/share/listRequestMethod" }), "params": ClientRequest__PluginShareListParams }).annotate({ "title": "Plugin/share/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/checkout").annotate({ "title": "Plugin/share/checkoutRequestMethod" }), "params": ClientRequest__PluginShareCheckoutParams }).annotate({ "title": "Plugin/share/checkoutRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/share/delete").annotate({ "title": "Plugin/share/deleteRequestMethod" }), "params": ClientRequest__PluginShareDeleteParams }).annotate({ "title": "Plugin/share/deleteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("app/read").annotate({ "title": "App/readRequestMethod" }), "params": ClientRequest__AppsReadParams }).annotate({ "title": "App/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("app/list").annotate({ "title": "App/listRequestMethod" }), "params": ClientRequest__AppsListParams }).annotate({ "title": "App/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("app/installed").annotate({ "title": "App/installedRequestMethod" }), "params": ClientRequest__AppsInstalledParams }).annotate({ "title": "App/installedRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/readFile").annotate({ "title": "Fs/readFileRequestMethod" }), "params": ClientRequest__FsReadFileParams }).annotate({ "title": "Fs/readFileRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/writeFile").annotate({ "title": "Fs/writeFileRequestMethod" }), "params": ClientRequest__FsWriteFileParams }).annotate({ "title": "Fs/writeFileRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/createDirectory").annotate({ "title": "Fs/createDirectoryRequestMethod" }), "params": ClientRequest__FsCreateDirectoryParams }).annotate({ "title": "Fs/createDirectoryRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/getMetadata").annotate({ "title": "Fs/getMetadataRequestMethod" }), "params": ClientRequest__FsGetMetadataParams }).annotate({ "title": "Fs/getMetadataRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/readDirectory").annotate({ "title": "Fs/readDirectoryRequestMethod" }), "params": ClientRequest__FsReadDirectoryParams }).annotate({ "title": "Fs/readDirectoryRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/remove").annotate({ "title": "Fs/removeRequestMethod" }), "params": ClientRequest__FsRemoveParams }).annotate({ "title": "Fs/removeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/copy").annotate({ "title": "Fs/copyRequestMethod" }), "params": ClientRequest__FsCopyParams }).annotate({ "title": "Fs/copyRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/watch").annotate({ "title": "Fs/watchRequestMethod" }), "params": ClientRequest__FsWatchParams }).annotate({ "title": "Fs/watchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fs/unwatch").annotate({ "title": "Fs/unwatchRequestMethod" }), "params": ClientRequest__FsUnwatchParams }).annotate({ "title": "Fs/unwatchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("skills/config/write").annotate({ "title": "Skills/config/writeRequestMethod" }), "params": ClientRequest__SkillsConfigWriteParams }).annotate({ "title": "Skills/config/writeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/install").annotate({ "title": "Plugin/installRequestMethod" }), "params": ClientRequest__PluginInstallParams }).annotate({ "title": "Plugin/installRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("plugin/uninstall").annotate({ "title": "Plugin/uninstallRequestMethod" }), "params": ClientRequest__PluginUninstallParams }).annotate({ "title": "Plugin/uninstallRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("turn/start").annotate({ "title": "Turn/startRequestMethod" }), "params": ClientRequest__TurnStartParams }).annotate({ "title": "Turn/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("turn/settings/update").annotate({ "title": "Turn/settings/updateRequestMethod" }), "params": ClientRequest__TurnSettingsUpdateParams }).annotate({ "title": "Turn/settings/updateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("turn/steer").annotate({ "title": "Turn/steerRequestMethod" }), "params": ClientRequest__TurnSteerParams }).annotate({ "title": "Turn/steerRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("turn/interrupt").annotate({ "title": "Turn/interruptRequestMethod" }), "params": ClientRequest__TurnInterruptParams }).annotate({ "title": "Turn/interruptRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/start").annotate({ "title": "Thread/realtime/startRequestMethod" }), "params": ClientRequest__ThreadRealtimeStartParams }).annotate({ "title": "Thread/realtime/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/appendAudio").annotate({ "title": "Thread/realtime/appendAudioRequestMethod" }), "params": ClientRequest__ThreadRealtimeAppendAudioParams }).annotate({ "title": "Thread/realtime/appendAudioRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/appendText").annotate({ "title": "Thread/realtime/appendTextRequestMethod" }), "params": ClientRequest__ThreadRealtimeAppendTextParams }).annotate({ "title": "Thread/realtime/appendTextRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/appendSpeech").annotate({ "title": "Thread/realtime/appendSpeechRequestMethod" }), "params": ClientRequest__ThreadRealtimeAppendSpeechParams }).annotate({ "title": "Thread/realtime/appendSpeechRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/stop").annotate({ "title": "Thread/realtime/stopRequestMethod" }), "params": ClientRequest__ThreadRealtimeStopParams }).annotate({ "title": "Thread/realtime/stopRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/timeline/list").annotate({ "title": "Thread/timeline/listRequestMethod" }), "params": ClientRequest__ThreadTimelineListParams }).annotate({ "title": "Thread/timeline/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("thread/realtime/listVoices").annotate({ "title": "Thread/realtime/listVoicesRequestMethod" }), "params": ClientRequest__ThreadRealtimeListVoicesParams }).annotate({ "title": "Thread/realtime/listVoicesRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("review/start").annotate({ "title": "Review/startRequestMethod" }), "params": ClientRequest__ReviewStartParams }).annotate({ "title": "Review/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "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.Union([ClientRequest__GatewayOAuthReadParams, 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.Union([ClientRequest__GatewayOAuthLoginParams, 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/list").annotate({ "title": "ModelProvider/listRequestMethod" }), "params": ClientRequest__ModelProviderListParams }).annotate({ "title": "ModelProvider/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("modelProvider/config/write").annotate({ "title": "ModelProvider/config/writeRequestMethod" }), "params": ClientRequest__ModelProviderConfigWriteParams }).annotate({ "title": "ModelProvider/config/writeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("modelProvider/capabilities/read").annotate({ "title": "ModelProvider/capabilities/readRequestMethod" }), "params": ClientRequest__ModelProviderCapabilitiesReadParams }).annotate({ "title": "ModelProvider/capabilities/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("experimentalFeature/list").annotate({ "title": "ExperimentalFeature/listRequestMethod" }), "params": ClientRequest__ExperimentalFeatureListParams }).annotate({ "title": "ExperimentalFeature/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("permissionProfile/list").annotate({ "title": "PermissionProfile/listRequestMethod" }), "params": ClientRequest__PermissionProfileListParams }).annotate({ "title": "PermissionProfile/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("experimentalFeature/enablement/set").annotate({ "title": "ExperimentalFeature/enablement/setRequestMethod" }), "params": ClientRequest__ExperimentalFeatureEnablementSetParams }).annotate({ "title": "ExperimentalFeature/enablement/setRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/enable").annotate({ "title": "RemoteControl/enableRequestMethod" }), "params": Schema.optionalKey(Schema.Union([ClientRequest__RemoteControlEnableParams, Schema.Null])) }).annotate({ "title": "RemoteControl/enableRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/disable").annotate({ "title": "RemoteControl/disableRequestMethod" }), "params": Schema.optionalKey(Schema.Union([ClientRequest__RemoteControlDisableParams, Schema.Null])) }).annotate({ "title": "RemoteControl/disableRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/status/read").annotate({ "title": "RemoteControl/status/readRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "RemoteControl/status/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/pairing/start").annotate({ "title": "RemoteControl/pairing/startRequestMethod" }), "params": ClientRequest__RemoteControlPairingStartParams }).annotate({ "title": "RemoteControl/pairing/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/pairing/status").annotate({ "title": "RemoteControl/pairing/statusRequestMethod" }), "params": ClientRequest__RemoteControlPairingStatusParams }).annotate({ "title": "RemoteControl/pairing/statusRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/client/list").annotate({ "title": "RemoteControl/client/listRequestMethod" }), "params": ClientRequest__RemoteControlClientsListParams }).annotate({ "title": "RemoteControl/client/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("remoteControl/client/revoke").annotate({ "title": "RemoteControl/client/revokeRequestMethod" }), "params": ClientRequest__RemoteControlClientsRevokeParams }).annotate({ "title": "RemoteControl/client/revokeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("collaborationMode/list").annotate({ "title": "CollaborationMode/listRequestMethod" }), "params": ClientRequest__CollaborationModeListParams }).annotate({ "title": "CollaborationMode/listRequest", "description": "Lists collaboration mode presets." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mock/experimentalMethod").annotate({ "title": "Mock/experimentalMethodRequestMethod" }), "params": ClientRequest__MockExperimentalMethodParams }).annotate({ "title": "Mock/experimentalMethodRequest", "description": "Test-only method used to validate experimental gating." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("environment/add").annotate({ "title": "Environment/addRequestMethod" }), "params": ClientRequest__EnvironmentAddParams }).annotate({ "title": "Environment/addRequest", "description": "Adds or replaces a remote environment by id for later selection." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("environment/info").annotate({ "title": "Environment/infoRequestMethod" }), "params": ClientRequest__EnvironmentInfoParams }).annotate({ "title": "Environment/infoRequest", "description": "Reads information from a configured execution environment." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("environment/status").annotate({ "title": "Environment/statusRequestMethod" }), "params": ClientRequest__EnvironmentStatusParams }).annotate({ "title": "Environment/statusRequest", "description": "Reads the current status of a configured execution environment." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/oauth/login").annotate({ "title": "McpServer/oauth/loginRequestMethod" }), "params": ClientRequest__McpServerOauthLoginParams }).annotate({ "title": "McpServer/oauth/loginRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("config/mcpServer/reload").annotate({ "title": "Config/mcpServer/reloadRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Config/mcpServer/reloadRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServerStatus/list").annotate({ "title": "McpServerStatus/listRequestMethod" }), "params": ClientRequest__ListMcpServerStatusParams }).annotate({ "title": "McpServerStatus/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/resource/read").annotate({ "title": "McpServer/resource/readRequestMethod" }), "params": ClientRequest__McpResourceReadParams }).annotate({ "title": "McpServer/resource/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/event/stream/start").annotate({ "title": "McpServer/event/stream/startRequestMethod" }), "params": ClientRequest__McpServerEventStreamStartParams }).annotate({ "title": "McpServer/event/stream/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/event/stream/stop").annotate({ "title": "McpServer/event/stream/stopRequestMethod" }), "params": ClientRequest__McpServerEventStreamStopParams }).annotate({ "title": "McpServer/event/stream/stopRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("mcpServer/tool/call").annotate({ "title": "McpServer/tool/callRequestMethod" }), "params": ClientRequest__McpServerToolCallParams }).annotate({ "title": "McpServer/tool/callRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("windowsSandbox/setupStart").annotate({ "title": "WindowsSandbox/setupStartRequestMethod" }), "params": ClientRequest__WindowsSandboxSetupStartParams }).annotate({ "title": "WindowsSandbox/setupStartRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("windowsSandbox/readiness").annotate({ "title": "WindowsSandbox/readinessRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "WindowsSandbox/readinessRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/login/start").annotate({ "title": "Account/login/startRequestMethod" }), "params": ClientRequest__LoginAccountParams }).annotate({ "title": "Account/login/startRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/bedrock/discover").annotate({ "title": "Account/bedrock/discoverRequestMethod" }), "params": ClientRequest__BedrockDiscoverParams }).annotate({ "title": "Account/bedrock/discoverRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/bedrock/setup").annotate({ "title": "Account/bedrock/setupRequestMethod" }), "params": ClientRequest__BedrockSetupParams }).annotate({ "title": "Account/bedrock/setupRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/gcp/setup").annotate({ "title": "Account/gcp/setupRequestMethod" }), "params": ClientRequest__GcpSetupParams }).annotate({ "title": "Account/gcp/setupRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/bedrock/checkGovCloudRequirements").annotate({ "title": "Account/bedrock/checkGovCloudRequirementsRequestMethod" }), "params": ClientRequest__BedrockCheckGovCloudRequirementsParams }).annotate({ "title": "Account/bedrock/checkGovCloudRequirementsRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/login/cancel").annotate({ "title": "Account/login/cancelRequestMethod" }), "params": ClientRequest__CancelLoginAccountParams }).annotate({ "title": "Account/login/cancelRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("accountSession/list").annotate({ "title": "AccountSession/listRequestMethod" }), "params": ClientRequest__AccountSessionsListParams }).annotate({ "title": "AccountSession/listRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("accountSession/switch").annotate({ "title": "AccountSession/switchRequestMethod" }), "params": ClientRequest__AccountSessionsSwitchParams }).annotate({ "title": "AccountSession/switchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/logout").annotate({ "title": "Account/logoutRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Account/logoutRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/securitySetup/read").annotate({ "title": "Account/securitySetup/readRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Account/securitySetup/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/rateLimits/read").annotate({ "title": "Account/rateLimits/readRequestMethod" }), "params": Schema.optionalKey(Schema.Union([ClientRequest__GetAccountRateLimitsParams, Schema.Null])) }).annotate({ "title": "Account/rateLimits/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/rateLimitResetCredit/consume").annotate({ "title": "Account/rateLimitResetCredit/consumeRequestMethod" }), "params": ClientRequest__ConsumeAccountRateLimitResetCreditParams }).annotate({ "title": "Account/rateLimitResetCredit/consumeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/usage/read").annotate({ "title": "Account/usage/readRequestMethod" }), "params": Schema.optionalKey(Schema.Union([ClientRequest__GetAccountTokenUsageParams, Schema.Null])) }).annotate({ "title": "Account/usage/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/workspaceMessages/read").annotate({ "title": "Account/workspaceMessages/readRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "Account/workspaceMessages/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/sendAddCreditsNudgeEmail").annotate({ "title": "Account/sendAddCreditsNudgeEmailRequestMethod" }), "params": ClientRequest__SendAddCreditsNudgeEmailParams }).annotate({ "title": "Account/sendAddCreditsNudgeEmailRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("feedback/upload").annotate({ "title": "Feedback/uploadRequestMethod" }), "params": ClientRequest__FeedbackUploadParams }).annotate({ "title": "Feedback/uploadRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("feedback/save").annotate({ "title": "Feedback/saveRequestMethod" }), "params": ClientRequest__FeedbackSaveParams }).annotate({ "title": "Feedback/saveRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("command/exec").annotate({ "title": "Command/execRequestMethod" }), "params": ClientRequest__CommandExecParams }).annotate({ "title": "Command/execRequest", "description": "Execute a standalone command (argv vector) under the server's sandbox." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("command/exec/write").annotate({ "title": "Command/exec/writeRequestMethod" }), "params": ClientRequest__CommandExecWriteParams }).annotate({ "title": "Command/exec/writeRequest", "description": "Write stdin bytes to a running `command/exec` session or close stdin." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("command/exec/terminate").annotate({ "title": "Command/exec/terminateRequestMethod" }), "params": ClientRequest__CommandExecTerminateParams }).annotate({ "title": "Command/exec/terminateRequest", "description": "Terminate a running `command/exec` session by client-supplied `processId`." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("command/exec/resize").annotate({ "title": "Command/exec/resizeRequestMethod" }), "params": ClientRequest__CommandExecResizeParams }).annotate({ "title": "Command/exec/resizeRequest", "description": "Resize a running PTY-backed `command/exec` session by client-supplied `processId`." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("process/spawn").annotate({ "title": "Process/spawnRequestMethod" }), "params": ClientRequest__ProcessSpawnParams }).annotate({ "title": "Process/spawnRequest", "description": "Spawn a standalone process (argv vector) without a Codex sandbox." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("process/writeStdin").annotate({ "title": "Process/writeStdinRequestMethod" }), "params": ClientRequest__ProcessWriteStdinParams }).annotate({ "title": "Process/writeStdinRequest", "description": "Write stdin bytes to a running `process/spawn` session or close stdin." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("process/kill").annotate({ "title": "Process/killRequestMethod" }), "params": ClientRequest__ProcessKillParams }).annotate({ "title": "Process/killRequest", "description": "Terminate a running `process/spawn` session by client-supplied `processHandle`." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("process/resizePty").annotate({ "title": "Process/resizePtyRequestMethod" }), "params": ClientRequest__ProcessResizePtyParams }).annotate({ "title": "Process/resizePtyRequest", "description": "Resize a running PTY-backed `process/spawn` session by client-supplied `processHandle`." }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("config/read").annotate({ "title": "Config/readRequestMethod" }), "params": ClientRequest__ConfigReadParams }).annotate({ "title": "Config/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("externalAgentConfig/detect").annotate({ "title": "ExternalAgentConfig/detectRequestMethod" }), "params": ClientRequest__ExternalAgentConfigDetectParams }).annotate({ "title": "ExternalAgentConfig/detectRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("externalAgentConfig/import").annotate({ "title": "ExternalAgentConfig/importRequestMethod" }), "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({ "title": "ExternalAgentConfig/import/readHistoriesRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "ExternalAgentConfig/import/readHistoriesRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("config/value/write").annotate({ "title": "Config/value/writeRequestMethod" }), "params": ClientRequest__ConfigValueWriteParams }).annotate({ "title": "Config/value/writeRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("config/batchWrite").annotate({ "title": "Config/batchWriteRequestMethod" }), "params": ClientRequest__ConfigBatchWriteParams }).annotate({ "title": "Config/batchWriteRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("configRequirements/read").annotate({ "title": "ConfigRequirements/readRequestMethod" }), "params": Schema.optionalKey(Schema.Null) }).annotate({ "title": "ConfigRequirements/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("account/read").annotate({ "title": "Account/readRequestMethod" }), "params": ClientRequest__GetAccountParams }).annotate({ "title": "Account/readRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fuzzyFileSearch").annotate({ "title": "FuzzyFileSearchRequestMethod" }), "params": ClientRequest__FuzzyFileSearchParams }).annotate({ "title": "FuzzyFileSearchRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fuzzyFileSearch/sessionStart").annotate({ "title": "FuzzyFileSearch/sessionStartRequestMethod" }), "params": ClientRequest__FuzzyFileSearchSessionStartParams }).annotate({ "title": "FuzzyFileSearch/sessionStartRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fuzzyFileSearch/sessionUpdate").annotate({ "title": "FuzzyFileSearch/sessionUpdateRequestMethod" }), "params": ClientRequest__FuzzyFileSearchSessionUpdateParams }).annotate({ "title": "FuzzyFileSearch/sessionUpdateRequest" }), Schema.Struct({ "id": ClientRequest__RequestId, "method": Schema.Literal("fuzzyFileSearch/sessionStop").annotate({ "title": "FuzzyFileSearch/sessionStopRequestMethod" }), "params": ClientRequest__FuzzyFileSearchSessionStopParams }).annotate({ "title": "FuzzyFileSearch/sessionStopRequest" })], { mode: "oneOf" }).annotate({ "title": "ClientRequest", "description": "Request from the client to the server." }) export type CommandExecutionRequestApprovalParams = { readonly "additionalPermissions"?: CommandExecutionRequestApprovalParams__AdditionalPermissionProfile | null, readonly "approvalId"?: string | null, readonly "availableDecisions"?: ReadonlyArray | null, readonly "command"?: string | null, readonly "commandActions"?: ReadonlyArray | null, 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, readonly "reason"?: string | null, readonly "startedAtMs": number, readonly "threadId": string, readonly "turnId": string } export const CommandExecutionRequestApprovalParams = Schema.Struct({ "additionalPermissions": Schema.optionalKey(Schema.Union([CommandExecutionRequestApprovalParams__AdditionalPermissionProfile, Schema.Null]).annotate({ "description": "Optional additional permissions requested for this command." })), "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])), "availableDecisions": Schema.optionalKey(Schema.Union([Schema.Array(CommandExecutionRequestApprovalParams__CommandExecutionApprovalDecision).annotate({ "description": "Ordered list of decisions the client may present for this prompt." }), 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(CommandExecutionRequestApprovalParams__CommandAction).annotate({ "description": "Best-effort parsed command actions for friendly display." }), Schema.Null])), "cwd": Schema.optionalKey(Schema.Union([CommandExecutionRequestApprovalParams__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 => CommandExecutionRequestApprovalParams__CommandExecutionApprovalKind).annotate({ "description": "Kind of action under review. Defaults to `command` for older servers.", "default": "command" })), "networkApprovalContext": Schema.optionalKey(Schema.Union([CommandExecutionRequestApprovalParams__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(CommandExecutionRequestApprovalParams__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({ "title": "CommandExecutionRequestApprovalParams" }) @@ -7854,14 +8079,14 @@ export const V2FsWriteFileResponse = Schema.Record(Schema.String, Schema.Json.an 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 V2GatewayOAuthChangedNotification = { readonly "authUrl"?: string | null, readonly "error"?: string | null, readonly "loginId"?: 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])), "loginId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Identifies the completed device login attempt." }), 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 V2GatewayOAuthLoginResponse = { readonly "prompt"?: V2GatewayOAuthLoginResponse__GatewayOAuthPrompt | null } +export const V2GatewayOAuthLoginResponse = Schema.Struct({ "prompt": Schema.optionalKey(Schema.Union([V2GatewayOAuthLoginResponse__GatewayOAuthPrompt, Schema.Null])) }).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 V2GatewayOAuthReadResponse = { readonly "error"?: string | null, readonly "providerId": string, readonly "providerName": string, readonly "required": boolean, readonly "status"?: V2GatewayOAuthReadResponse__GatewayOAuthStatus | null, readonly "supportsDeviceAuth"?: boolean } +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." })), "supportsDeviceAuth": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Whether the administrator configured a device authorization endpoint.", "default": false })) }).annotate({ "title": "GatewayOAuthReadResponse", "description": "Current effective gateway policy and credential readiness; never contains credentials." }) export type V2GcpSetupParams = { readonly "credentialFile"?: string | null, readonly "location"?: string | null, readonly "projectId": string } export const V2GcpSetupParams = Schema.Struct({ "credentialFile": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Absolute path to a credential file on the app-server host. Omit or pass `null` to clear the active user configuration's override and use ADC. If another configuration layer would still supply a credential file, setup fails without saving changes." }), Schema.Null])), "location": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Vertex AI location. Omission or null selects `global`." }), Schema.Null])), "projectId": Schema.String }).annotate({ "title": "GcpSetupParams" }) @@ -7875,8 +8100,11 @@ export const V2GetAccountParams = Schema.Struct({ "refreshToken": Schema.optiona export type V2GetAccountRateLimitsResponse = { readonly "accountId"?: string | null, readonly "ordinaryUsageAllowed"?: boolean | null, readonly "rateLimitResetCredits"?: V2GetAccountRateLimitsResponse__RateLimitResetCreditsSummary | 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])), "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(Schema.Union([Schema.Record(Schema.String, V2GetAccountRateLimitsResponse__RateLimitSnapshot).annotate({ "description": "Multi-bucket view keyed by metered `limit_id` (for example, `codex`)." }), Schema.Null])) }).annotate({ "title": "GetAccountRateLimitsResponse" }) -export type V2GetAccountResponse = { readonly "account"?: V2GetAccountResponse__Account | null, readonly "requiresOpenaiAuth": boolean, readonly "workspaceRouting"?: V2GetAccountResponse__WorkspaceRouting | null } -export const V2GetAccountResponse = Schema.Struct({ "account": Schema.optionalKey(Schema.Union([V2GetAccountResponse__Account, Schema.Null])), "requiresOpenaiAuth": Schema.Boolean, "workspaceRouting": Schema.optionalKey(Schema.Union([V2GetAccountResponse__WorkspaceRouting, Schema.Null])) }).annotate({ "title": "GetAccountResponse" }) +export type V2GetAccountResponse = { readonly "account"?: V2GetAccountResponse__Account | null, readonly "requiresOpenaiAuth": boolean, readonly "userId"?: string | null, readonly "workspaceRouting"?: V2GetAccountResponse__WorkspaceRouting | null } +export const V2GetAccountResponse = Schema.Struct({ "account": Schema.optionalKey(Schema.Union([V2GetAccountResponse__Account, Schema.Null])), "requiresOpenaiAuth": Schema.Boolean, "userId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "ChatGPT user ID belonging to this account response, when available." }), Schema.Null])), "workspaceRouting": Schema.optionalKey(Schema.Union([V2GetAccountResponse__WorkspaceRouting, Schema.Null])) }).annotate({ "title": "GetAccountResponse" }) + +export type V2GetAccountSecuritySetupResponse = { readonly "notice"?: V2GetAccountSecuritySetupResponse__AccountSecuritySetupNotice | null } +export const V2GetAccountSecuritySetupResponse = Schema.Struct({ "notice": Schema.optionalKey(Schema.Union([V2GetAccountSecuritySetupResponse__AccountSecuritySetupNotice, Schema.Null])) }).annotate({ "title": "GetAccountSecuritySetupResponse", "description": "Optional security reminder bound to the account that fetched it. Unavailable or ineligible accounts return no notice; this read never changes account security." }) export type V2GetAccountTokenUsageResponse = { readonly "dailyUsageBuckets"?: ReadonlyArray | null, readonly "summary": V2GetAccountTokenUsageResponse__AccountTokenUsageSummary, readonly "threadUsage"?: V2GetAccountTokenUsageResponse__ThreadUsage | null } export const V2GetAccountTokenUsageResponse = Schema.Struct({ "dailyUsageBuckets": Schema.optionalKey(Schema.Union([Schema.Array(V2GetAccountTokenUsageResponse__AccountTokenUsageDailyBucket), Schema.Null])), "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" }) @@ -7899,8 +8127,8 @@ export const V2HooksListResponse = Schema.Struct({ "data": Schema.Array(V2HooksL export type V2HookStartedNotification = { readonly "run": V2HookStartedNotification__HookRunSummary, readonly "threadId": string, readonly "turnId"?: string | null } export const V2HookStartedNotification = Schema.Struct({ "run": V2HookStartedNotification__HookRunSummary, "threadId": Schema.String, "turnId": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) }).annotate({ "title": "HookStartedNotification" }) -export type V2ItemCompletedNotification = { readonly "completedAtMs": number, readonly "item": V2ItemCompletedNotification__ThreadItem, readonly "threadId": string, readonly "turnId": string } -export const V2ItemCompletedNotification = 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": V2ItemCompletedNotification__ThreadItem, "threadId": Schema.String, "turnId": Schema.String }).annotate({ "title": "ItemCompletedNotification" }) +export type V2ItemCompletedNotification = { readonly "completedAtMs": number, readonly "contentTokenCount"?: number | null, readonly "item": V2ItemCompletedNotification__ThreadItem, readonly "threadId": string, readonly "turnId": string } +export const V2ItemCompletedNotification = 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" })), "contentTokenCount": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "description": "Native content tokens for the completed assistant message, including a sampled footer. Null when unavailable. Completion telemetry is not part of the stored thread item.", "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])), "item": V2ItemCompletedNotification__ThreadItem, "threadId": Schema.String, "turnId": Schema.String }).annotate({ "title": "ItemCompletedNotification" }) export type V2ItemGuardianApprovalReviewCompletedNotification = { readonly "action": V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewAction, readonly "completedAtMs": number, readonly "decisionSource": V2ItemGuardianApprovalReviewCompletedNotification__AutoReviewDecisionSource, readonly "review": V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReview, readonly "reviewId": string, readonly "startedAtMs": number, readonly "targetItemId"?: string | null, readonly "threadId": string, readonly "turnId": string } export const V2ItemGuardianApprovalReviewCompletedNotification = Schema.Struct({ "action": V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewAction, "completedAtMs": Schema.Number.annotate({ "description": "Unix timestamp (in milliseconds) when this review completed.", "format": "int64" }).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().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) - 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])), "threadId": Schema.String, "turnId": Schema.String }).annotate({ "title": "ItemGuardianApprovalReviewCompletedNotification", "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon." }) @@ -7944,8 +8172,8 @@ export const V2MarketplaceUpgradeParams = Schema.Struct({ "marketplaceName": Sch export type V2MarketplaceUpgradeResponse = { readonly "errors": ReadonlyArray, readonly "selectedMarketplaces": ReadonlyArray, readonly "upgradedRoots": ReadonlyArray } export const V2MarketplaceUpgradeResponse = Schema.Struct({ "errors": Schema.Array(V2MarketplaceUpgradeResponse__MarketplaceUpgradeErrorInfo), "selectedMarketplaces": Schema.Array(Schema.String), "upgradedRoots": Schema.Array(V2MarketplaceUpgradeResponse__AbsolutePathBuf) }).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 V2McpResourceReadParams = { readonly "_meta"?: { readonly [x: string]: Schema.Json } | null, 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({ "_meta": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({ "description": "Additional MCP request metadata. Account and turn routing keys are reserved." }), Schema.Null])), "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" }) @@ -8004,8 +8232,8 @@ export const V2MockExperimentalMethodParams = Schema.Struct({ "value": Schema.op export type V2MockExperimentalMethodResponse = { readonly "echoed"?: string | null } export const V2MockExperimentalMethodResponse = Schema.Struct({ "echoed": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Echoes the input `value`." }), Schema.Null])) }).annotate({ "title": "MockExperimentalMethodResponse" }) -export type V2ModelListParams = { readonly "cursor"?: string | null, readonly "includeHidden"?: boolean | null, readonly "limit"?: number | null } -export const V2ModelListParams = Schema.Struct({ "cursor": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque pagination cursor returned by a previous call." }), 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])), "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({ "title": "ModelListParams" }) +export type V2ModelListParams = { readonly "cursor"?: string | null, readonly "includeHidden"?: boolean | null, readonly "limit"?: number | null, readonly "modelProvider"?: string | null } +export const V2ModelListParams = Schema.Struct({ "cursor": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque pagination cursor returned by a previous call." }), 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])), "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])), "modelProvider": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "List models for this configured provider instead of the app-server default." }), Schema.Null])) }).annotate({ "title": "ModelListParams" }) export type V2ModelListResponse = { readonly "data": ReadonlyArray, readonly "nextCursor"?: string | null } export const V2ModelListResponse = Schema.Struct({ "data": Schema.Array(V2ModelListResponse__Model), "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": "ModelListResponse" }) @@ -8016,9 +8244,21 @@ export const V2ModelProviderCapabilitiesReadParams = Schema.Record(Schema.String export type V2ModelProviderCapabilitiesReadResponse = { readonly "imageGeneration": boolean, readonly "webSearch": boolean } export const V2ModelProviderCapabilitiesReadResponse = Schema.Struct({ "imageGeneration": Schema.Boolean, "webSearch": Schema.Boolean }).annotate({ "title": "ModelProviderCapabilitiesReadResponse" }) +export type V2ModelProviderConfigWriteParams = { readonly "settings": V2ModelProviderConfigWriteParams__ProviderSettingsPatch } +export const V2ModelProviderConfigWriteParams = Schema.Struct({ "settings": V2ModelProviderConfigWriteParams__ProviderSettingsPatch }).annotate({ "title": "ModelProviderConfigWriteParams" }) + +export type V2ModelProviderConfigWriteResponse = { readonly "provider": V2ModelProviderConfigWriteResponse__ModelProviderSummary } +export const V2ModelProviderConfigWriteResponse = Schema.Struct({ "provider": V2ModelProviderConfigWriteResponse__ModelProviderSummary }).annotate({ "title": "ModelProviderConfigWriteResponse" }) + export type V2ModelProviderError = { readonly "currentModelProvider": string, readonly "modelProvider": string, readonly "type": "modelProviderMismatch" } | { readonly "modelProvider": string, readonly "type": "modelProviderNotConfigured" } | { readonly "modelProvider": string, readonly "requiredModelProvider": string, readonly "type": "modelProviderPolicyConflict" } export const V2ModelProviderError = Schema.Union([Schema.Struct({ "currentModelProvider": Schema.String, "modelProvider": Schema.String, "type": Schema.Literal("modelProviderMismatch").annotate({ "title": "ModelProviderMismatchv2::ModelProviderErrorType" }) }).annotate({ "title": "ModelProviderMismatchv2::ModelProviderError" }), Schema.Struct({ "modelProvider": Schema.String, "type": Schema.Literal("modelProviderNotConfigured").annotate({ "title": "ModelProviderNotConfiguredv2::ModelProviderErrorType" }) }).annotate({ "title": "ModelProviderNotConfiguredv2::ModelProviderError" }), Schema.Struct({ "modelProvider": Schema.String, "requiredModelProvider": Schema.String, "type": Schema.Literal("modelProviderPolicyConflict").annotate({ "title": "ModelProviderPolicyConflictv2::ModelProviderErrorType" }) }).annotate({ "title": "ModelProviderPolicyConflictv2::ModelProviderError" })], { mode: "oneOf" }).annotate({ "title": "ModelProviderError", "description": "Structured JSON-RPC error data. Unknown errors must retain the client's normal fallback." }) +export type V2ModelProviderListParams = { readonly [x: string]: Schema.Json } +export const V2ModelProviderListParams = Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({ "title": "ModelProviderListParams" }) + +export type V2ModelProviderListResponse = { readonly "canChangeDefault": boolean, readonly "data": ReadonlyArray, readonly "defaultProviderId": string } +export const V2ModelProviderListResponse = Schema.Struct({ "canChangeDefault": Schema.Boolean, "data": Schema.Array(V2ModelProviderListResponse__ModelProviderSummary), "defaultProviderId": Schema.String }).annotate({ "title": "ModelProviderListResponse" }) + export type V2ModelReroutedNotification = { readonly "fromModel": string, readonly "reason": V2ModelReroutedNotification__ModelRerouteReason, readonly "threadId": string, readonly "toModel": string, readonly "turnId": string } export const V2ModelReroutedNotification = Schema.Struct({ "fromModel": Schema.String, "reason": V2ModelReroutedNotification__ModelRerouteReason, "threadId": Schema.String, "toModel": Schema.String, "turnId": Schema.String }).annotate({ "title": "ModelReroutedNotification" }) @@ -8028,6 +8268,12 @@ export const V2ModelSafetyBufferingUpdatedNotification = Schema.Struct({ "faster export type V2ModelVerificationNotification = { readonly "threadId": string, readonly "turnId": string, readonly "verifications": ReadonlyArray } export const V2ModelVerificationNotification = Schema.Struct({ "threadId": Schema.String, "turnId": Schema.String, "verifications": Schema.Array(V2ModelVerificationNotification__ModelVerification) }).annotate({ "title": "ModelVerificationNotification" }) +export type V2NullableGatewayOAuthLoginParams = V2NullableGatewayOAuthLoginParams__GatewayOAuthLoginParams | null +export const V2NullableGatewayOAuthLoginParams = Schema.Union([V2NullableGatewayOAuthLoginParams__GatewayOAuthLoginParams, Schema.Null]).annotate({ "title": "Nullable_GatewayOAuthLoginParams" }) + +export type V2NullableGatewayOAuthReadParams = V2NullableGatewayOAuthReadParams__GatewayOAuthReadParams | null +export const V2NullableGatewayOAuthReadParams = Schema.Union([V2NullableGatewayOAuthReadParams__GatewayOAuthReadParams, Schema.Null]).annotate({ "title": "Nullable_GatewayOAuthReadParams" }) + export type V2NullableGetAccountRateLimitsParams = V2NullableGetAccountRateLimitsParams__GetAccountRateLimitsParams | null export const V2NullableGetAccountRateLimitsParams = Schema.Union([V2NullableGetAccountRateLimitsParams__GetAccountRateLimitsParams, Schema.Null]).annotate({ "title": "Nullable_GetAccountRateLimitsParams" }) @@ -8422,7 +8668,7 @@ export type V2ThreadGuardianReviewParams = { readonly "threadId": string } export const V2ThreadGuardianReviewParams = Schema.Struct({ "threadId": Schema.String }).annotate({ "title": "ThreadGuardianReviewParams", "description": "Calling `thread/guardianReview` subscribes the connection to the thread. The subscription remains after the review completes, keeping the thread loaded until the client calls `thread/unsubscribe` or disconnects." }) export type V2ThreadGuardianReviewResponse = { readonly "assessment"?: V2ThreadGuardianReviewResponse__ThreadGuardianAssessment | null, readonly "callId": string } -export const V2ThreadGuardianReviewResponse = Schema.Struct({ "assessment": Schema.optionalKey(Schema.Union([V2ThreadGuardianReviewResponse__ThreadGuardianAssessment, Schema.Null]).annotate({ "description": "Null when exec policy skips approval." })), "callId": Schema.String }).annotate({ "title": "ThreadGuardianReviewResponse" }) +export const V2ThreadGuardianReviewResponse = Schema.Struct({ "assessment": Schema.optionalKey(Schema.Union([V2ThreadGuardianReviewResponse__ThreadGuardianAssessment, Schema.Null]).annotate({ "description": "Null when current policy or a remembered approval skips review." })), "callId": Schema.String }).annotate({ "title": "ThreadGuardianReviewResponse" }) export type V2ThreadIncrementElicitationParams = { readonly "threadId": string } export const V2ThreadIncrementElicitationParams = Schema.Struct({ "threadId": Schema.String.annotate({ "description": "Thread whose out-of-band elicitation counter should be incremented." }) }).annotate({ "title": "ThreadIncrementElicitationParams", "description": "Parameters for `thread/increment_elicitation`." }) @@ -8436,8 +8682,8 @@ export const V2ThreadInjectItemsParams = Schema.Struct({ "items": Schema.Array(S 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 V2ThreadItemsListParams = { readonly "cursor"?: V2ThreadItemsListParams__ThreadItemsListCursor | null, readonly "deferOutput"?: V2ThreadItemsListParams__ThreadItemOutputDeferral | 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." })), "deferOutput": Schema.optionalKey(Schema.Union([V2ThreadItemsListParams__ThreadItemOutputDeferral, Schema.Null]).annotate({ "description": "For a single turn, choose which saved outputs to fetch separately by item ID." })), "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" }) @@ -8448,8 +8694,8 @@ export const V2ThreadItemsReadParams = Schema.Struct({ "itemIds": Schema.Array(S export type V2ThreadItemsReadResponse = { readonly "data": ReadonlyArray } export const V2ThreadItemsReadResponse = Schema.Struct({ "data": Schema.Array(V2ThreadItemsReadResponse__ThreadItemEntry) }).annotate({ "title": "ThreadItemsReadResponse", "description": "EXPERIMENTAL - persisted items returned in canonical stored order." }) -export type V2ThreadListParams = { readonly "ancestorThreadId"?: string | null, readonly "archived"?: boolean | null, readonly "attachedToThreadId"?: string | null, readonly "cursor"?: string | null, readonly "cwd"?: V2ThreadListParams__ThreadListCwdFilter | null, readonly "excludedThreadIds"?: ReadonlyArray | null, readonly "limit"?: number | null, readonly "modelProviders"?: ReadonlyArray | null, readonly "originators"?: ReadonlyArray | null, readonly "parentThreadId"?: string | null, readonly "projectId"?: string | null, readonly "searchTerm"?: string | null, readonly "sectionId"?: string | null, readonly "sortDirection"?: V2ThreadListParams__SortDirection | null, readonly "sortKey"?: V2ThreadListParams__ThreadSortKey | null, readonly "sourceKinds"?: ReadonlyArray | null, readonly "useStateDbOnly"?: boolean } -export const V2ThreadListParams = Schema.Struct({ "ancestorThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional ancestor thread filter. Returns spawned descendants at any depth, excluding the ancestor itself. Mutually exclusive with `parentThreadId`." }), Schema.Null])), "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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Return only persistent threads attached to this thread, including empty threads. Mutually exclusive with parentThreadId and ancestorThreadId. Omitting this filter keeps attached threads hidden from ordinary listings." }), 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([V2ThreadListParams__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." })), "excludedThreadIds": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String).annotate({ "description": "Thread IDs to exclude before applying the result limit. Up to 100 entries; invalid IDs or a larger list are rejected, never truncated. Send the same exclusions on each page. Omitted, null, or empty means no exclusions." }), 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])), "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])), "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])), "parentThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional direct parent thread filter. Mutually exclusive with `ancestorThreadId`." }), Schema.Null])), "projectId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omit to include every project, set to null for unassigned threads, or provide a project ID to return only threads in that project." }), Schema.Null])), "searchTerm": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional substring filter for the extracted thread title." }), 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)." })), "sortKey": Schema.optionalKey(Schema.Union([V2ThreadListParams__ThreadSortKey, Schema.Null]).annotate({ "description": "Optional sort key; defaults to created_at." })), "sourceKinds": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadListParams__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])), "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": "ThreadListParams" }) +export type V2ThreadListParams = { readonly "ancestorThreadId"?: string | null, readonly "archived"?: boolean | null, readonly "attachedToThreadId"?: string | null, readonly "currentAccountOnly"?: boolean, readonly "cursor"?: string | null, readonly "cwd"?: V2ThreadListParams__ThreadListCwdFilter | null, readonly "excludedThreadIds"?: ReadonlyArray | null, readonly "includeAttachedThreads"?: boolean, readonly "limit"?: number | null, readonly "modelProviders"?: ReadonlyArray | null, readonly "originators"?: ReadonlyArray | null, readonly "parentThreadId"?: string | null, readonly "projectId"?: string | null, readonly "searchTerm"?: string | null, readonly "sectionId"?: string | null, readonly "sortDirection"?: V2ThreadListParams__SortDirection | null, readonly "sortKey"?: V2ThreadListParams__ThreadSortKey | null, readonly "sourceKinds"?: ReadonlyArray | null, readonly "useStateDbOnly"?: boolean } +export const V2ThreadListParams = Schema.Struct({ "ancestorThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional ancestor thread filter. Returns spawned descendants at any depth, excluding the ancestor itself. Mutually exclusive with `parentThreadId`." }), Schema.Null])), "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])), "attachedToThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Return only persistent threads attached to this thread, including empty threads. Mutually exclusive with parentThreadId and ancestorThreadId. Omitting this filter keeps attached threads hidden from ordinary listings." }), Schema.Null])), "currentAccountOnly": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Show local history visible to the current ChatGPT account. Defaults to false." })), "cursor": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque pagination cursor returned by a previous call." }), Schema.Null])), "cwd": Schema.optionalKey(Schema.Union([V2ThreadListParams__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." })), "excludedThreadIds": Schema.optionalKey(Schema.Union([Schema.Array(Schema.String).annotate({ "description": "Thread IDs to exclude before applying the result limit. Up to 100 entries; invalid IDs or a larger list are rejected, never truncated. Send the same exclusions on each page. Omitted, null, or empty means no exclusions." }), Schema.Null])), "includeAttachedThreads": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Include persistent threads attached to a parent when searching by title." })), "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])), "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])), "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])), "parentThreadId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional direct parent thread filter. Mutually exclusive with `ancestorThreadId`." }), Schema.Null])), "projectId": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omit to include every project, set to null for unassigned threads, or provide a project ID to return only threads in that project." }), Schema.Null])), "searchTerm": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Optional substring filter for the extracted thread title." }), 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)." })), "sortKey": Schema.optionalKey(Schema.Union([V2ThreadListParams__ThreadSortKey, Schema.Null]).annotate({ "description": "Optional sort key; defaults to created_at." })), "sourceKinds": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadListParams__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])), "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": "ThreadListParams" }) export type V2ThreadListResponse = { readonly "backwardsCursor"?: string | null, readonly "data": ReadonlyArray, readonly "nextCursor"?: string | null, readonly "readStates"?: { readonly [x: string]: V2ThreadListResponse__ThreadReadState } | null } export const V2ThreadListResponse = 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 thread. Use it with the opposite `sortDirection`; for timestamp sorts it anchors at the start of the page timestamp so same-second updates are not skipped." }), Schema.Null])), "data": Schema.Array(V2ThreadListResponse__Thread), "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])), "readStates": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, V2ThreadListResponse__ThreadReadState).annotate({ "description": "Local receipts for eligible threads on this page, keyed by thread ID. Null means durable read state is unavailable; an absent key means that row is ineligible." }), Schema.Null])) }).annotate({ "title": "ThreadListResponse" }) @@ -8490,11 +8736,17 @@ export const V2ThreadPredictionRequestResponse = Schema.Record(Schema.String, Sc export type V2ThreadPredictionUpdatedNotification = { readonly "result": V2ThreadPredictionUpdatedNotification__ThreadPredictionResult, readonly "sourceTurnId": string, readonly "threadId": string } export const V2ThreadPredictionUpdatedNotification = Schema.Struct({ "result": V2ThreadPredictionUpdatedNotification__ThreadPredictionResult, "sourceTurnId": Schema.String, "threadId": Schema.String }).annotate({ "title": "ThreadPredictionUpdatedNotification" }) +export type V2ThreadPrepareApprovedPlanParams = { readonly "attachmentPath"?: string | null, readonly "markdown": string, readonly "threadId": string } +export const V2ThreadPrepareApprovedPlanParams = Schema.Struct({ "attachmentPath": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Absolute path to the optional app-server copy of the plan." }), Schema.Null])), "markdown": Schema.String, "threadId": Schema.String }).annotate({ "title": "ThreadPrepareApprovedPlanParams", "description": "Prepare an approved plan for the first turn of a fresh thread." }) + +export type V2ThreadPrepareApprovedPlanResponse = { readonly "prompt": string } +export const V2ThreadPrepareApprovedPlanResponse = Schema.Struct({ "prompt": Schema.String.annotate({ "description": "Initial user prompt. If no attachment is readable, the plan is already in the thread's context." }) }).annotate({ "title": "ThreadPrepareApprovedPlanResponse" }) + 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 V2ThreadQueueAddParams = { readonly "clientUserMessageId": string, readonly "input": ReadonlyArray, readonly "threadId": string } -export const V2ThreadQueueAddParams = Schema.Struct({ "clientUserMessageId": Schema.String, "input": Schema.Array(V2ThreadQueueAddParams__UserInput), "threadId": Schema.String }).annotate({ "title": "ThreadQueueAddParams" }) +export type V2ThreadQueueAddParams = { readonly "clientUserMessageId": string, readonly "input": ReadonlyArray, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "threadId": string } +export const V2ThreadQueueAddParams = Schema.Struct({ "clientUserMessageId": Schema.String, "input": Schema.Array(V2ThreadQueueAddParams__UserInput), "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "ResponsesAPI metadata captured from the client submitting this input." }), Schema.Null])), "threadId": Schema.String }).annotate({ "title": "ThreadQueueAddParams" }) export type V2ThreadQueueAddResponse = { readonly "queuedSubmission": V2ThreadQueueAddResponse__QueuedSubmission } export const V2ThreadQueueAddResponse = Schema.Struct({ "queuedSubmission": V2ThreadQueueAddResponse__QueuedSubmission }).annotate({ "title": "ThreadQueueAddResponse" }) @@ -8526,8 +8778,8 @@ export const V2ThreadQueueStartParams = Schema.Struct({ "queuedSubmissionId": Sc export type V2ThreadQueueStartResponse = { readonly "turn": V2ThreadQueueStartResponse__Turn } export const V2ThreadQueueStartResponse = Schema.Struct({ "turn": V2ThreadQueueStartResponse__Turn }).annotate({ "title": "ThreadQueueStartResponse" }) -export type V2ThreadQueueUpdateParams = { readonly "input": ReadonlyArray, readonly "queuedSubmissionId": string, readonly "threadId": string } -export const V2ThreadQueueUpdateParams = Schema.Struct({ "input": Schema.Array(V2ThreadQueueUpdateParams__UserInput), "queuedSubmissionId": Schema.String, "threadId": Schema.String }).annotate({ "title": "ThreadQueueUpdateParams" }) +export type V2ThreadQueueUpdateParams = { readonly "input": ReadonlyArray, readonly "queuedSubmissionId": string, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "threadId": string } +export const V2ThreadQueueUpdateParams = Schema.Struct({ "input": Schema.Array(V2ThreadQueueUpdateParams__UserInput), "queuedSubmissionId": Schema.String, "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Non-empty metadata replaces the input's metadata; omission or an empty map preserves it." }), Schema.Null])), "threadId": Schema.String }).annotate({ "title": "ThreadQueueUpdateParams" }) export type V2ThreadQueueUpdateResponse = { readonly "queuedSubmission": V2ThreadQueueUpdateResponse__QueuedSubmission } export const V2ThreadQueueUpdateResponse = Schema.Struct({ "queuedSubmission": V2ThreadQueueUpdateResponse__QueuedSubmission }).annotate({ "title": "ThreadQueueUpdateResponse" }) @@ -8637,8 +8889,8 @@ export const V2ThreadSampleCancelParams = Schema.Struct({ "requestId": V2ThreadS export type V2ThreadSampleCancelResponse = { readonly [x: string]: Schema.Json } export const V2ThreadSampleCancelResponse = Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({ "title": "ThreadSampleCancelResponse" }) -export type V2ThreadSampleParams = { readonly "disableMcp"?: boolean, readonly "effort"?: V2ThreadSampleParams__ReasoningEffort | null, readonly "expectedTurnId": string, readonly "interruptOnCancel"?: boolean | null, readonly "prompt": string, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "threadId": string, readonly "threadSource"?: V2ThreadSampleParams__ThreadSource | null, readonly "turnTrigger"?: string | null } -export const V2ThreadSampleParams = Schema.Struct({ "disableMcp": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Disable MCP servers when the inherited window uses incremental tools on Responses Lite." })), "effort": Schema.optionalKey(Schema.Union([V2ThreadSampleParams__ReasoningEffort, Schema.Null]).annotate({ "description": "Applied only when the provider and model support cache-preserving reasoning-effort updates." })), "expectedTurnId": Schema.String.annotate({ "description": "The loaded source's latest completed, failed, or interrupted turn. Stale or active sources are rejected." }), "interruptOnCancel": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Override upstream interruption on cancellation for this sample; otherwise inherit the parent." }), Schema.Null])), "prompt": Schema.String, "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Optional metadata to enrich Codex's ResponsesAPI turn metadata." }), Schema.Null])), "threadId": Schema.String, "threadSource": Schema.optionalKey(Schema.Union([V2ThreadSampleParams__ThreadSource, Schema.Null])), "turnTrigger": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) }).annotate({ "title": "ThreadSampleParams" }) +export type V2ThreadSampleParams = { readonly "allowInProgressTurn"?: boolean, readonly "disableMcp"?: boolean, readonly "effort"?: V2ThreadSampleParams__ReasoningEffort | null, readonly "expectedTurnId": string, readonly "interruptOnCancel"?: boolean | null, readonly "prompt": string, readonly "responsesapiClientMetadata"?: { readonly [x: string]: string } | null, readonly "threadId": string, readonly "threadSource"?: V2ThreadSampleParams__ThreadSource | null, readonly "turnTrigger"?: string | null } +export const V2ThreadSampleParams = Schema.Struct({ "allowInProgressTurn": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Allow sampling the latest turn before it finishes." })), "disableMcp": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Disable MCP servers when the inherited window uses incremental tools on Responses Lite." })), "effort": Schema.optionalKey(Schema.Union([V2ThreadSampleParams__ReasoningEffort, Schema.Null]).annotate({ "description": "Applied only when the provider and model support cache-preserving reasoning-effort updates." })), "expectedTurnId": Schema.String.annotate({ "description": "The loaded source's latest turn, which must be finished (completed, failed, or interrupted) unless `allowInProgressTurn` is true." }), "interruptOnCancel": Schema.optionalKey(Schema.Union([Schema.Boolean.annotate({ "description": "Override upstream interruption on cancellation for this sample; otherwise inherit the parent." }), Schema.Null])), "prompt": Schema.String, "responsesapiClientMetadata": Schema.optionalKey(Schema.Union([Schema.Record(Schema.String, Schema.String).annotate({ "description": "Optional metadata to enrich Codex's ResponsesAPI turn metadata." }), Schema.Null])), "threadId": Schema.String, "threadSource": Schema.optionalKey(Schema.Union([V2ThreadSampleParams__ThreadSource, Schema.Null])), "turnTrigger": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) }).annotate({ "title": "ThreadSampleParams" }) export type V2ThreadSampleResponse = { readonly "cachedInputTokens"?: number | null, readonly "inputTokens"?: number | null, readonly "outputTokens"?: number | null, readonly "responseId": string, readonly "sourceTurnId": string, readonly "text"?: string | null } export const V2ThreadSampleResponse = Schema.Struct({ "cachedInputTokens": Schema.optionalKey(Schema.Union([Schema.Number.annotate({ "format": "int64" }).check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])), "inputTokens": 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])), "responseId": Schema.String, "sourceTurnId": Schema.String, "text": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Assistant text from the response, or null if it attempted a tool call or completed without text." }), Schema.Null])) }).annotate({ "title": "ThreadSampleResponse" }) @@ -8649,8 +8901,8 @@ export const V2ThreadSearchOccurrencesParams = Schema.Struct({ "cursor": Schema. export type V2ThreadSearchOccurrencesResponse = { readonly "data": ReadonlyArray, readonly "nextCursor"?: string | null } export const V2ThreadSearchOccurrencesResponse = Schema.Struct({ "data": Schema.Array(V2ThreadSearchOccurrencesResponse__ThreadSearchOccurrence).annotate({ "description": "Occurrences in chronological message order." }), "nextCursor": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque cursor to continue after the last returned occurrence." }), Schema.Null])) }).annotate({ "title": "ThreadSearchOccurrencesResponse" }) -export type V2ThreadSearchParams = { readonly "archived"?: boolean | null, readonly "cursor"?: string | null, readonly "limit"?: number | null, readonly "searchTerm": string, readonly "sortDirection"?: V2ThreadSearchParams__SortDirection | null, readonly "sortKey"?: V2ThreadSearchParams__ThreadSearchSortKey | null, readonly "sourceKinds"?: ReadonlyArray | null } -export const V2ThreadSearchParams = 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])), "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])), "searchTerm": Schema.String.annotate({ "description": "Required substring/full-text query for thread search." }), "sortDirection": Schema.optionalKey(Schema.Union([V2ThreadSearchParams__SortDirection, Schema.Null]).annotate({ "description": "Optional sort direction; defaults to descending (newest first)." })), "sortKey": Schema.optionalKey(Schema.Union([V2ThreadSearchParams__ThreadSearchSortKey, Schema.Null]).annotate({ "description": "Optional sort key; defaults to created_at." })), "sourceKinds": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSearchParams__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])) }).annotate({ "title": "ThreadSearchParams" }) +export type V2ThreadSearchParams = { readonly "archived"?: boolean | null, readonly "currentAccountOnly"?: boolean, readonly "cursor"?: string | null, readonly "includeAttachedThreads"?: boolean, readonly "limit"?: number | null, readonly "searchTerm": string, readonly "sortDirection"?: V2ThreadSearchParams__SortDirection | null, readonly "sortKey"?: V2ThreadSearchParams__ThreadSearchSortKey | null, readonly "sourceKinds"?: ReadonlyArray | null } +export const V2ThreadSearchParams = 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])), "currentAccountOnly": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Show local history visible to the current ChatGPT account. Defaults to false." })), "cursor": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Opaque pagination cursor returned by a previous call." }), Schema.Null])), "includeAttachedThreads": Schema.optionalKey(Schema.Boolean.annotate({ "description": "Include persistent threads attached to a parent in search results." })), "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])), "searchTerm": Schema.String.annotate({ "description": "Required substring/full-text query for thread search." }), "sortDirection": Schema.optionalKey(Schema.Union([V2ThreadSearchParams__SortDirection, Schema.Null]).annotate({ "description": "Optional sort direction; defaults to descending (newest first)." })), "sortKey": Schema.optionalKey(Schema.Union([V2ThreadSearchParams__ThreadSearchSortKey, Schema.Null]).annotate({ "description": "Optional sort key; defaults to created_at." })), "sourceKinds": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSearchParams__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])) }).annotate({ "title": "ThreadSearchParams" }) export type V2ThreadSearchResponse = { readonly "backwardsCursor"?: string | null, readonly "data": ReadonlyArray, readonly "nextCursor"?: string | null } export const V2ThreadSearchResponse = 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 thread. Use it with the opposite `sortDirection`; for timestamp sorts it anchors at the start of the page timestamp so same-second updates are not skipped." }), Schema.Null])), "data": Schema.Array(V2ThreadSearchResponse__ThreadSearchResult), "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": "ThreadSearchResponse" }) @@ -8697,8 +8949,8 @@ export const V2ThreadSetNameResponse = Schema.Record(Schema.String, Schema.Json. export type V2ThreadSettingsUpdatedNotification = { readonly "threadId": string, readonly "threadSettings": V2ThreadSettingsUpdatedNotification__ThreadSettings } export const V2ThreadSettingsUpdatedNotification = Schema.Struct({ "threadId": Schema.String, "threadSettings": V2ThreadSettingsUpdatedNotification__ThreadSettings }).annotate({ "title": "ThreadSettingsUpdatedNotification" }) -export type V2ThreadSettingsUpdateParams = { readonly "approvalPolicy"?: V2ThreadSettingsUpdateParams__AskForApproval | null, readonly "approvalsReviewer"?: V2ThreadSettingsUpdateParams__ApprovalsReviewer | null, readonly "collaborationMode"?: V2ThreadSettingsUpdateParams__CollaborationMode | null, readonly "cwd"?: string | null, readonly "disabledPluginIds"?: ReadonlyArray | null, readonly "effort"?: V2ThreadSettingsUpdateParams__ReasoningEffort | null, readonly "model"?: string | null, readonly "multiAgentMode"?: V2ThreadSettingsUpdateParams__MultiAgentMode | null, readonly "permissions"?: string | null, readonly "personality"?: V2ThreadSettingsUpdateParams__Personality | null, readonly "sandboxPolicy"?: V2ThreadSettingsUpdateParams__SandboxPolicy | null, readonly "serviceTier"?: string | null, readonly "summary"?: V2ThreadSettingsUpdateParams__ReasoningSummary | null, readonly "threadId": string } -export const V2ThreadSettingsUpdateParams = Schema.Struct({ "approvalPolicy": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__AskForApproval, Schema.Null]).annotate({ "description": "Override the approval policy for subsequent turns." })), "approvalsReviewer": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__ApprovalsReviewer, Schema.Null]).annotate({ "description": "Override where approval requests are routed for subsequent turns." })), "collaborationMode": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__CollaborationMode, Schema.Null]).annotate({ "description": "EXPERIMENTAL - Set a pre-set collaboration mode for subsequent turns.\n\nFor `collaboration_mode.settings.developer_instructions`, `null` means \"use the built-in instructions for the selected mode\"." })), "cwd": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the working directory for subsequent turns." }), 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([V2ThreadSettingsUpdateParams__ReasoningEffort, Schema.Null]).annotate({ "description": "Override the reasoning effort for subsequent turns." })), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the model for subsequent turns." }), Schema.Null])), "multiAgentMode": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__MultiAgentMode, Schema.Null]).annotate({ "description": "@deprecated Ignored. Use `effort: \"ultra\"` for proactive multi-agent behavior." })), "permissions": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Select a named permissions profile id for subsequent turns. Cannot be combined with `sandboxPolicy`." }), Schema.Null])), "personality": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__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([V2ThreadSettingsUpdateParams__SandboxPolicy, Schema.Null]).annotate({ "description": "Override the sandbox policy for subsequent turns." })), "serviceTier": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the service tier for subsequent turns. `null` clears the current service tier; omission leaves it unchanged." }), Schema.Null])), "summary": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__ReasoningSummary, Schema.Null]).annotate({ "description": "Override the reasoning summary for subsequent turns." })), "threadId": Schema.String }).annotate({ "title": "ThreadSettingsUpdateParams" }) +export type V2ThreadSettingsUpdateParams = { readonly "approvalPolicy"?: V2ThreadSettingsUpdateParams__AskForApproval | null, readonly "approvalsReviewer"?: V2ThreadSettingsUpdateParams__ApprovalsReviewer | null, readonly "collaborationMode"?: V2ThreadSettingsUpdateParams__CollaborationMode | null, readonly "cwd"?: string | null, readonly "disabledPluginIds"?: ReadonlyArray | null, readonly "effort"?: V2ThreadSettingsUpdateParams__ReasoningEffort | null, readonly "environments"?: ReadonlyArray | null, readonly "model"?: string | null, readonly "multiAgentMode"?: V2ThreadSettingsUpdateParams__MultiAgentMode | null, readonly "permissions"?: string | null, readonly "personality"?: V2ThreadSettingsUpdateParams__Personality | null, readonly "sandboxPolicy"?: V2ThreadSettingsUpdateParams__SandboxPolicy | null, readonly "serviceTier"?: string | null, readonly "summary"?: V2ThreadSettingsUpdateParams__ReasoningSummary | null, readonly "threadId": string } +export const V2ThreadSettingsUpdateParams = Schema.Struct({ "approvalPolicy": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__AskForApproval, Schema.Null]).annotate({ "description": "Override the approval policy for subsequent turns." })), "approvalsReviewer": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__ApprovalsReviewer, Schema.Null]).annotate({ "description": "Override where approval requests are routed for subsequent turns." })), "collaborationMode": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__CollaborationMode, Schema.Null]).annotate({ "description": "EXPERIMENTAL - Set a pre-set collaboration mode for subsequent turns.\n\nFor `collaboration_mode.settings.developer_instructions`, `null` means \"use the built-in instructions for the selected mode\"." })), "cwd": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the working directory for subsequent turns." }), 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([V2ThreadSettingsUpdateParams__ReasoningEffort, Schema.Null]).annotate({ "description": "Override the reasoning effort for subsequent turns." })), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2ThreadSettingsUpdateParams__TurnEnvironmentParams).annotate({ "description": "Replace the environments for future turns without changing the running turn. Omitted/null preserves the selection unless `cwd` is also provided, which selects the default environments for that directory. [] clears the selection." }), Schema.Null])), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the model for subsequent turns." }), Schema.Null])), "multiAgentMode": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__MultiAgentMode, Schema.Null]).annotate({ "description": "@deprecated Ignored. Use `effort: \"ultra\"` for proactive multi-agent behavior." })), "permissions": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Select a named permissions profile id for subsequent turns. Cannot be combined with `sandboxPolicy`." }), Schema.Null])), "personality": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__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([V2ThreadSettingsUpdateParams__SandboxPolicy, Schema.Null]).annotate({ "description": "Override the sandbox policy for subsequent turns." })), "serviceTier": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Override the service tier for subsequent turns. `null` clears the current service tier; omission leaves it unchanged." }), Schema.Null])), "summary": Schema.optionalKey(Schema.Union([V2ThreadSettingsUpdateParams__ReasoningSummary, Schema.Null]).annotate({ "description": "Override the reasoning summary for subsequent turns." })), "threadId": Schema.String }).annotate({ "title": "ThreadSettingsUpdateParams" }) export type V2ThreadSettingsUpdateResponse = { readonly [x: string]: Schema.Json } export const V2ThreadSettingsUpdateResponse = Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({ "title": "ThreadSettingsUpdateResponse" }) @@ -8769,8 +9021,8 @@ export const V2TurnModerationMetadataNotification = Schema.Struct({ "metadata": export type V2TurnPlanUpdatedNotification = { readonly "explanation"?: string | null, readonly "plan": ReadonlyArray, readonly "threadId": string, readonly "turnId": string } export const V2TurnPlanUpdatedNotification = Schema.Struct({ "explanation": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), "plan": Schema.Array(V2TurnPlanUpdatedNotification__TurnPlanStep), "threadId": Schema.String, "turnId": Schema.String }).annotate({ "title": "TurnPlanUpdatedNotification" }) -export type V2TurnSettingsUpdateParams = { readonly "approvalsReviewer"?: V2TurnSettingsUpdateParams__ApprovalsReviewer | null, readonly "effort"?: V2TurnSettingsUpdateParams__ReasoningEffort | null, readonly "model"?: string | null, readonly "serviceTier"?: string | null, readonly "summary"?: V2TurnSettingsUpdateParams__ReasoningSummary | null, readonly "threadId": string, readonly "turnId": string } -export const V2TurnSettingsUpdateParams = Schema.Struct({ "approvalsReviewer": Schema.optionalKey(Schema.Union([V2TurnSettingsUpdateParams__ApprovalsReviewer, Schema.Null]).annotate({ "description": "Changes the active turn's reviewer without changing future thread settings. Already captured steps and pending approvals retain their original reviewer." })), "effort": Schema.optionalKey(Schema.Union([V2TurnSettingsUpdateParams__ReasoningEffort, Schema.Null]).annotate({ "description": "Omission or `null` leaves the effort unchanged." })), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omission or `null` leaves the model unchanged." }), Schema.Null])), "serviceTier": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "`null` clears the requested tier; omission leaves it unchanged." }), Schema.Null])), "summary": Schema.optionalKey(Schema.Union([V2TurnSettingsUpdateParams__ReasoningSummary, Schema.Null]).annotate({ "description": "Omission or `null` leaves the summary preference unchanged." })), "threadId": Schema.String, "turnId": Schema.String }).annotate({ "title": "TurnSettingsUpdateParams", "description": "Experimental settings changes for one running turn, not future turns. Unsupported fields are rejected rather than silently ignored. Any live task kind may accept publication. Child sessions and consumers of frozen initial settings are unchanged." }) +export type V2TurnSettingsUpdateParams = { readonly "approvalsReviewer"?: V2TurnSettingsUpdateParams__ApprovalsReviewer | null, readonly "effort"?: V2TurnSettingsUpdateParams__ReasoningEffort | null, readonly "environments"?: ReadonlyArray | null, readonly "model"?: string | null, readonly "serviceTier"?: string | null, readonly "summary"?: V2TurnSettingsUpdateParams__ReasoningSummary | null, readonly "threadId": string, readonly "turnId": string } +export const V2TurnSettingsUpdateParams = Schema.Struct({ "approvalsReviewer": Schema.optionalKey(Schema.Union([V2TurnSettingsUpdateParams__ApprovalsReviewer, Schema.Null]).annotate({ "description": "Changes the active turn's reviewer without changing future thread settings. Already captured steps and pending approvals retain their original reviewer." })), "effort": Schema.optionalKey(Schema.Union([V2TurnSettingsUpdateParams__ReasoningEffort, Schema.Null]).annotate({ "description": "Omission or `null` leaves the effort unchanged." })), "environments": Schema.optionalKey(Schema.Union([Schema.Array(V2TurnSettingsUpdateParams__TurnEnvironmentParams).annotate({ "description": "Replace the environments for subsequent steps of this turn, not future turns. Omitted/null preserves the selection; [] clears it. An already-started step is unchanged." }), Schema.Null])), "model": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "Omission or `null` leaves the model unchanged." }), Schema.Null])), "serviceTier": Schema.optionalKey(Schema.Union([Schema.String.annotate({ "description": "`null` clears the requested tier; omission leaves it unchanged." }), Schema.Null])), "summary": Schema.optionalKey(Schema.Union([V2TurnSettingsUpdateParams__ReasoningSummary, Schema.Null]).annotate({ "description": "Omission or `null` leaves the summary preference unchanged." })), "threadId": Schema.String, "turnId": Schema.String }).annotate({ "title": "TurnSettingsUpdateParams", "description": "Experimental settings changes for one running turn, not future turns. Unsupported fields are rejected rather than silently ignored. Any live task kind may accept publication. Child sessions and consumers of frozen initial settings are unchanged." }) export type V2TurnSettingsUpdateResponse = { readonly "status": V2TurnSettingsUpdateResponse__TurnSettingsUpdateStatus } export const V2TurnSettingsUpdateResponse = Schema.Struct({ "status": V2TurnSettingsUpdateResponse__TurnSettingsUpdateStatus }).annotate({ "title": "TurnSettingsUpdateResponse" }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4ac76ec1c..50ee6ce5b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,8 +7,8 @@ settings: catalogs: default: '@anthropic-ai/claude-agent-sdk': - specifier: ^0.3.319 - version: 0.3.319 + specifier: ^0.3.322 + version: 0.3.322 '@anthropic-ai/sdk': specifier: ^1.6.0 version: 1.6.0 @@ -208,7 +208,7 @@ importers: dependencies: '@anthropic-ai/claude-agent-sdk': specifier: 'catalog:' - version: 0.3.319(@anthropic-ai/sdk@1.6.0(zod@4.6.7))(@modelcontextprotocol/sdk@1.32.2(zod@4.6.7))(zod@4.6.7) + version: 0.3.322(@anthropic-ai/sdk@1.6.0(zod@4.6.7))(@modelcontextprotocol/sdk@1.32.2(zod@4.6.7))(zod@4.6.7) '@anthropic-ai/sdk': specifier: 'catalog:' version: 1.6.0(zod@4.6.7) @@ -722,7 +722,7 @@ importers: dependencies: '@anthropic-ai/claude-agent-sdk': specifier: 'catalog:' - version: 0.3.319(@anthropic-ai/sdk@1.6.0(zod@4.6.7))(@modelcontextprotocol/sdk@1.32.2(zod@4.6.7))(zod@4.6.7) + version: 0.3.322(@anthropic-ai/sdk@1.6.0(zod@4.6.7))(@modelcontextprotocol/sdk@1.32.2(zod@4.6.7))(zod@4.6.7) '@anthropic-ai/sdk': specifier: 'catalog:' version: 1.6.0(zod@4.6.7) @@ -766,52 +766,52 @@ importers: packages: - '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.319': - resolution: {integrity: sha512-rNiAbMbRhgOM2CELsDTIq7q++sFVIZukTkgeswcncGbcX8STIgtf0XaZzKdRXtKK+v9ez+mQn8P4pb2Ka17wGA==} + '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.322': + resolution: {integrity: sha512-LoKkldW2zkLfaOLQD44mL1Ot4Aup8dBIo356LEeO3v2vF7JVNhMllQIXhhGpbYRz57QaYsGvOe0Kb4SbssHwcg==} cpu: [arm64] os: [darwin] - '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.319': - resolution: {integrity: sha512-jM730Fl+cFotDnjF9cStIf+Xe57YdfDB3TXaSVVv8uVAXW4xoWFwIj2eDvmsciEEe5UMkKzjVqXu9kR21OrXng==} + '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.322': + resolution: {integrity: sha512-rTvLS9G1OzjMIaSXrJglQtmRtVcaRmMbJQC+ND02+atCA463ac7Ty/Wc6tyzBGk8zFFGKWnfAhKtLZTNg91eMg==} cpu: [x64] os: [darwin] - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.319': - resolution: {integrity: sha512-8KDZQJAS2CEb5aGAvuXkpyHMc9TOM/zYTw2iKmbbVi4im0atw93EtJPapYyp0g/lQI/Xk8jMYdWU6Zlv9EWjLw==} + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.322': + resolution: {integrity: sha512-zvgvVA/Mxpu1QttICZ1DGDlmgGo62HdVgKg6WbDGDQ3dgxtRC/kpCIepjtGEL8O1iO5NRxQ4mv8okLwCFcyrLQ==} cpu: [arm64] os: [linux] libc: [musl] - '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.319': - resolution: {integrity: sha512-g2tpMsHLMQahI4bk5CIcMHAB/RwzxoPGmL5Q5G5MDir5WTrl71vulWbtLQISUPm/yFPRG97tdzZnCa5Uq1v/dw==} + '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.322': + resolution: {integrity: sha512-H1v33+MxB5JMPlnJLZffiOQ+6muxyA7tgHPyYQ+So4TH7uRhaPcjv2X03CUo5U9gXleO6u+X8ngNNDRFtfUaSg==} cpu: [arm64] os: [linux] libc: [glibc] - '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.319': - resolution: {integrity: sha512-XkKYj3c1jVFjLATrZr4YTsmS5AIb5s2iphF9X670EcVQqDCCGIKKTVNLLg9mg1e7D+2xX8FU0XNlOJatWfpBeA==} + '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.322': + resolution: {integrity: sha512-jprUZMcQ3XcpoxwKRQ0fi3qAM1zYcytmNGhlD0gWDknbbSu8di5jLU7231ihJrCr4gbbtDu3FiFUd6w9EBEjfw==} cpu: [x64] os: [linux] libc: [musl] - '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.319': - resolution: {integrity: sha512-uBAZA8x0hd5gVifyL5Lo73dVmi9xZeJ6jro2NO0al6yyWaw/6UL9xbsVh9lOhLFOmYIdSbQ2j4zAfnvG/t5F3Q==} + '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.322': + resolution: {integrity: sha512-M/i7uV5wQf1kvjiPJr2KF5PeA9BpftUpMTtwE+DpQ0Tj+scthQXSMsEhDvau/Rh/MfFOc+UHED4tltignmA5+Q==} cpu: [x64] os: [linux] libc: [glibc] - '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.319': - resolution: {integrity: sha512-YoP0lYHJCziENFCotHQq9qd/gaJrwUNkAcnZyVjXxg1OPmtKuyw31aG60s4cWXRDXXGm/m1siNSQaGGfAYBvrw==} + '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.322': + resolution: {integrity: sha512-o5sPmBKT4NOglODC45wSTFmjD1AQIboC9NdGFQFOTa8kMF3bok+YqpB0DF81RmMDf3iR5tieonZvOXdYm1TDjQ==} cpu: [arm64] os: [win32] - '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.319': - resolution: {integrity: sha512-UC27x+8gfCS2OjNGJWrueP0gLOOKsLEsJ/kg0p6aa8GToZcJYjJ8KeAapHHRYMUAIB6Sarqe49Itm5P1wswCcQ==} + '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.322': + resolution: {integrity: sha512-gONOkYx76of3p73opgWAT9gqpV7PRL8+az3vKoWXLc4xaDW6vhZF7fixpCnLDeUmPWxjXhnQxf30WGpKneTzNw==} cpu: [x64] os: [win32] - '@anthropic-ai/claude-agent-sdk@0.3.319': - resolution: {integrity: sha512-7X+sh4uZv/u4OL4I4cQvMr9N3NM6FDiuyk829hFylgbrnNwVyiGElWEDWGuO26zwMIxmgpKdPoDILoFIHh1uwA==} + '@anthropic-ai/claude-agent-sdk@0.3.322': + resolution: {integrity: sha512-r88ij7R3SPV2j3BtFuavgrbWZNE8SVVS42AOQ1KxlS+QnSwNNnUhmVXV3Es2dniZySBYX8ENebL43ffhiB0azw==} engines: {node: '>=18.14.0'} peerDependencies: '@anthropic-ai/sdk': '>=0.93.0' @@ -6998,44 +6998,44 @@ ignoredOptionalDependencies: snapshots: - '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.319': + '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.322': optional: true - '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.319': + '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.322': optional: true - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.319': + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.322': optional: true - '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.319': + '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.322': optional: true - '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.319': + '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.322': optional: true - '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.319': + '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.322': optional: true - '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.319': + '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.322': optional: true - '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.319': + '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.322': optional: true - '@anthropic-ai/claude-agent-sdk@0.3.319(@anthropic-ai/sdk@1.6.0(zod@4.6.7))(@modelcontextprotocol/sdk@1.32.2(zod@4.6.7))(zod@4.6.7)': + '@anthropic-ai/claude-agent-sdk@0.3.322(@anthropic-ai/sdk@1.6.0(zod@4.6.7))(@modelcontextprotocol/sdk@1.32.2(zod@4.6.7))(zod@4.6.7)': dependencies: '@anthropic-ai/sdk': 1.6.0(zod@4.6.7) '@modelcontextprotocol/sdk': 1.32.2(zod@4.6.7) zod: 4.6.7 optionalDependencies: - '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.319 - '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.319 - '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.319 - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.319 - '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.319 - '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.319 - '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.319 - '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.319 + '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.322 + '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.322 + '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.322 + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.322 + '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.322 + '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.322 + '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.322 + '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.322 '@anthropic-ai/sdk@0.129.0(zod@4.6.7)': dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 927e151fc..2516f0b40 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,7 +5,7 @@ packages: - scripts catalog: - "@anthropic-ai/claude-agent-sdk": ^0.3.319 + "@anthropic-ai/claude-agent-sdk": ^0.3.322 "@anthropic-ai/sdk": ^1.6.0 "@effect/atom-react": 4.1.2 "@effect/openapi-generator": 4.1.2