diff --git a/.cursor/.gitignore b/.cursor/.gitignore new file mode 100644 index 00000000000..8bf7cc27a18 --- /dev/null +++ b/.cursor/.gitignore @@ -0,0 +1 @@ +plans/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2683172e646..5289c4ee17d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: quality: name: Format, Lint, Typecheck, Test, Browser Test, Build runs-on: ubuntu-24.04 - timeout-minutes: 10 + timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@v6 diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 9a81c17365d..0be83f96dcf 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@t3tools/desktop", - "version": "0.0.20", + "version": "0.0.21", "private": true, "type": "module", "main": "dist-electron/main.cjs", diff --git a/apps/desktop/src/clientPersistence.test.ts b/apps/desktop/src/clientPersistence.test.ts index 19f9b09f9fd..192d7ac1064 100644 --- a/apps/desktop/src/clientPersistence.test.ts +++ b/apps/desktop/src/clientPersistence.test.ts @@ -49,6 +49,7 @@ function makeSecretStorage(available: boolean): DesktopSecretStorage { } const clientSettings: ClientSettings = { + autoOpenPlanSidebar: false, confirmThreadArchive: true, confirmThreadDelete: false, diffWordWrap: true, diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index 92b86ec6d7f..5cf6a8fd152 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -75,6 +75,7 @@ import { } from "./updateMachine.ts"; import { isArm64HostRunningIntelBuild, resolveDesktopRuntimeInfo } from "./runtimeArch.ts"; import { resolveDesktopAppBranding } from "./appBranding.ts"; +import { bindFirstRevealTrigger, type RevealSubscription } from "./windowReveal.ts"; syncShellEnvironment(); @@ -2026,16 +2027,17 @@ function createWindow(): BrowserWindow { emitUpdateState(); }); - let initialRevealScheduled = false; - const revealInitialWindow = () => { - if (initialRevealScheduled) { - return; - } - initialRevealScheduled = true; - revealWindow(window); - }; - - window.once("ready-to-show", revealInitialWindow); + // On Linux/Wayland with `show: false`, Electron's `ready-to-show` only + // fires after `show()` is called, deadlocking the standard "wait for + // ready, then show" pattern. Add `did-finish-load` as a Linux-only + // fallback so the window still surfaces once the renderer has loaded + // the page. Other platforms keep the no-flash `ready-to-show` path, + // since `did-finish-load` typically fires before the first paint there. + const revealSubscribers: RevealSubscription[] = [(fire) => window.once("ready-to-show", fire)]; + if (process.platform === "linux") { + revealSubscribers.push((fire) => window.webContents.once("did-finish-load", fire)); + } + bindFirstRevealTrigger(revealSubscribers, () => revealWindow(window)); if (isDevelopment) { void window.loadURL(resolveDesktopDevServerUrl()); diff --git a/apps/desktop/src/windowReveal.test.ts b/apps/desktop/src/windowReveal.test.ts new file mode 100644 index 00000000000..88285fec0cb --- /dev/null +++ b/apps/desktop/src/windowReveal.test.ts @@ -0,0 +1,74 @@ +import { EventEmitter } from "node:events"; + +import { describe, expect, it, vi } from "vitest"; + +import { bindFirstRevealTrigger } from "./windowReveal.ts"; + +describe("bindFirstRevealTrigger", () => { + it("reveals when the first trigger fires", () => { + const window = new EventEmitter(); + const webContents = new EventEmitter(); + const reveal = vi.fn(); + + bindFirstRevealTrigger( + [ + (fire) => window.once("ready-to-show", fire), + (fire) => webContents.once("did-finish-load", fire), + ], + reveal, + ); + + window.emit("ready-to-show"); + + expect(reveal).toHaveBeenCalledTimes(1); + }); + + it("reveals when only the fallback trigger fires (Wayland deadlock case)", () => { + const window = new EventEmitter(); + const webContents = new EventEmitter(); + const reveal = vi.fn(); + + bindFirstRevealTrigger( + [ + (fire) => window.once("ready-to-show", fire), + (fire) => webContents.once("did-finish-load", fire), + ], + reveal, + ); + + webContents.emit("did-finish-load"); + + expect(reveal).toHaveBeenCalledTimes(1); + }); + + it("only reveals once when multiple triggers fire", () => { + const window = new EventEmitter(); + const webContents = new EventEmitter(); + const reveal = vi.fn(); + + bindFirstRevealTrigger( + [ + (fire) => window.once("ready-to-show", fire), + (fire) => webContents.once("did-finish-load", fire), + ], + reveal, + ); + + webContents.emit("did-finish-load"); + window.emit("ready-to-show"); + + expect(reveal).toHaveBeenCalledTimes(1); + }); + + it("subscribers using `once` ignore re-emitted events after reveal", () => { + const window = new EventEmitter(); + const reveal = vi.fn(); + + bindFirstRevealTrigger([(fire) => window.once("ready-to-show", fire)], reveal); + + window.emit("ready-to-show"); + window.emit("ready-to-show"); + + expect(reveal).toHaveBeenCalledTimes(1); + }); +}); diff --git a/apps/desktop/src/windowReveal.ts b/apps/desktop/src/windowReveal.ts new file mode 100644 index 00000000000..8faf65aeb15 --- /dev/null +++ b/apps/desktop/src/windowReveal.ts @@ -0,0 +1,28 @@ +export type RevealSubscription = (listener: () => void) => void; + +/** + * Wire a reveal callback to fire exactly once, on whichever of the provided + * event subscribers fires first. Each subscriber is responsible for binding + * its own event source. + * + * Used by the desktop main window's first-paint reveal logic. The standard + * Electron pattern is to wait for `ready-to-show` before calling `show()`, + * but on Linux/Wayland with `show: false`, `ready-to-show` only fires after + * `show()` is called, deadlocking that pattern. Subscribing to both + * `ready-to-show` and `did-finish-load` (or any other "renderer is alive" + * signal) lets the window surface reliably across platforms. + */ +export function bindFirstRevealTrigger( + subscribers: readonly RevealSubscription[], + reveal: () => void, +): void { + let revealed = false; + const fire = () => { + if (revealed) return; + revealed = true; + reveal(); + }; + for (const subscribe of subscribers) { + subscribe(fire); + } +} diff --git a/apps/server/package.json b/apps/server/package.json index 4e727bb8996..d9d84166b99 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -1,6 +1,6 @@ { "name": "t3", - "version": "0.0.20", + "version": "0.0.21", "license": "MIT", "repository": { "type": "git", diff --git a/apps/server/src/atomicWrite.ts b/apps/server/src/atomicWrite.ts new file mode 100644 index 00000000000..431b2f4a01c --- /dev/null +++ b/apps/server/src/atomicWrite.ts @@ -0,0 +1,25 @@ +import { Effect, FileSystem, Path } from "effect"; +import * as Random from "effect/Random"; + +export const writeFileStringAtomically = (input: { + readonly filePath: string; + readonly contents: string; +}) => + Effect.scoped( + Effect.gen(function* () { + const fs = yield* FileSystem.FileSystem; + const path = yield* Path.Path; + const tempFileId = yield* Random.nextUUIDv4; + const targetDirectory = path.dirname(input.filePath); + + yield* fs.makeDirectory(targetDirectory, { recursive: true }); + const tempDirectory = yield* fs.makeTempDirectoryScoped({ + directory: targetDirectory, + prefix: `${path.basename(input.filePath)}.`, + }); + const tempPath = path.join(tempDirectory, `${tempFileId}.tmp`); + + yield* fs.writeFileString(tempPath, input.contents); + yield* fs.rename(tempPath, input.filePath); + }), + ); diff --git a/apps/server/src/keybindings.ts b/apps/server/src/keybindings.ts index 362f5dda32f..9a29378a8a2 100644 --- a/apps/server/src/keybindings.ts +++ b/apps/server/src/keybindings.ts @@ -46,6 +46,7 @@ import { } from "effect"; import * as Semaphore from "effect/Semaphore"; import { ServerConfig } from "./config.ts"; +import { writeFileStringAtomically } from "./atomicWrite.ts"; import { fromLenientJson } from "@t3tools/shared/schemaJson"; type WhenToken = @@ -677,14 +678,17 @@ const makeKeybindings = Effect.gen(function* () { }); const writeConfigAtomically = (rules: readonly KeybindingRule[]) => { - const tempPath = `${keybindingsConfigPath}.${process.pid}.${Date.now()}.tmp`; - return Schema.encodeEffect(KeybindingsConfigPrettyJson)(rules).pipe( Effect.map((encoded) => `${encoded}\n`), - Effect.tap(() => fs.makeDirectory(path.dirname(keybindingsConfigPath), { recursive: true })), - Effect.tap((encoded) => fs.writeFileString(tempPath, encoded)), - Effect.flatMap(() => fs.rename(tempPath, keybindingsConfigPath)), - Effect.ensuring(fs.remove(tempPath, { force: true }).pipe(Effect.ignore({ log: true }))), + Effect.flatMap((encoded) => + writeFileStringAtomically({ + filePath: keybindingsConfigPath, + contents: encoded, + }).pipe( + Effect.provideService(FileSystem.FileSystem, fs), + Effect.provideService(Path.Path, path), + ), + ), Effect.mapError( (cause) => new KeybindingsConfigError({ diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts index c9d0c9ea124..ce796de7842 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts @@ -141,6 +141,12 @@ describe("ProviderCommandReactor", () => { (input.runtimeMode === "approval-required" || input.runtimeMode === "full-access") ? input.runtimeMode : "full-access", + ...(typeof input === "object" && + input !== null && + "cwd" in input && + typeof input.cwd === "string" + ? { cwd: input.cwd } + : {}), ...(modelSelection.model !== undefined ? { model: modelSelection.model } : {}), threadId, resumeCursor: resumeCursor ?? { opaque: `resume-${sessionIndex}` }, diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts index 0ce1adcc602..8a24c9538a0 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts @@ -345,6 +345,7 @@ const make = Effect.gen(function* () { thread.session && thread.session.status !== "stopped" && activeSession ? thread.id : null; if (existingSessionThreadId) { const runtimeModeChanged = thread.runtimeMode !== thread.session?.runtimeMode; + const cwdChanged = effectiveCwd !== activeSession?.cwd; const sessionModelSwitch = currentProvider === undefined ? "in-session" @@ -363,6 +364,7 @@ const make = Effect.gen(function* () { if ( !runtimeModeChanged && + !cwdChanged && !shouldRestartForModelChange && !shouldRestartForModelSelectionChange ) { @@ -380,6 +382,9 @@ const make = Effect.gen(function* () { currentRuntimeMode: thread.session?.runtimeMode, desiredRuntimeMode: thread.runtimeMode, runtimeModeChanged, + previousCwd: activeSession?.cwd, + desiredCwd: effectiveCwd, + cwdChanged, modelChanged, shouldRestartForModelChange, shouldRestartForModelSelectionChange, @@ -394,6 +399,7 @@ const make = Effect.gen(function* () { restartedSessionThreadId: restartedSession.threadId, provider: restartedSession.provider, runtimeMode: restartedSession.runtimeMode, + cwd: restartedSession.cwd, }); yield* bindSessionToThread(restartedSession); return restartedSession.threadId; diff --git a/apps/server/src/processRunner.test.ts b/apps/server/src/processRunner.test.ts index 15ad4daf09b..af4ff528ee0 100644 --- a/apps/server/src/processRunner.test.ts +++ b/apps/server/src/processRunner.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { runProcess } from "./processRunner.ts"; +import { isWindowsCommandNotFound, runProcess } from "./processRunner.ts"; describe("runProcess", () => { it("fails when output exceeds max buffer in default mode", async () => { @@ -21,3 +21,21 @@ describe("runProcess", () => { expect(result.stderrTruncated).toBe(false); }); }); + +describe("isWindowsCommandNotFound", () => { + it("matches the localized German cmd.exe error text", () => { + const originalPlatform = process.platform; + Object.defineProperty(process, "platform", { value: "win32", configurable: true }); + + try { + expect( + isWindowsCommandNotFound( + 1, + "wird nicht als interner oder externer Befehl, betriebsfahiges Programm oder Batch-Datei erkannt", + ), + ).toBe(true); + } finally { + Object.defineProperty(process, "platform", { value: originalPlatform, configurable: true }); + } + }); +}); diff --git a/apps/server/src/processRunner.ts b/apps/server/src/processRunner.ts index 5402612887d..03b164fc241 100644 --- a/apps/server/src/processRunner.ts +++ b/apps/server/src/processRunner.ts @@ -37,10 +37,23 @@ function normalizeSpawnError(command: string, args: readonly string[], error: un return new Error(`Failed to run ${commandLabel(command, args)}: ${error.message}`); } +const WINDOWS_COMMAND_NOT_FOUND_PATTERNS = [ + /is not recognized as an internal or external command/i, + /n.o . reconhecido como um comando interno/i, + /non . riconosciuto come comando interno o esterno/i, + /n.est pas reconnu en tant que commande interne/i, + /no se reconoce como un comando interno o externo/i, + /wird nicht als interner oder externer befehl/i, +] as const; + +function hasWindowsCommandNotFoundMessage(output: string): boolean { + return WINDOWS_COMMAND_NOT_FOUND_PATTERNS.some((pattern) => pattern.test(output)); +} + export function isWindowsCommandNotFound(code: number | null, stderr: string): boolean { if (process.platform !== "win32") return false; if (code === 9009) return true; - return /is not recognized as an internal or external command/i.test(stderr); + return hasWindowsCommandNotFoundMessage(stderr); } function normalizeExitError( diff --git a/apps/server/src/project/Layers/ProjectFaviconResolver.ts b/apps/server/src/project/Layers/ProjectFaviconResolver.ts index 061b6f5288b..91a412ed5cb 100644 --- a/apps/server/src/project/Layers/ProjectFaviconResolver.ts +++ b/apps/server/src/project/Layers/ProjectFaviconResolver.ts @@ -27,6 +27,7 @@ const FAVICON_CANDIDATES = [ "assets/icon.png", "assets/logo.svg", "assets/logo.png", + ".idea/icon.svg", ] as const; // Files that may contain a or icon metadata declaration. diff --git a/apps/server/src/provider/Layers/ClaudeAdapter.ts b/apps/server/src/provider/Layers/ClaudeAdapter.ts index 7e53f978817..3b32646ec40 100644 --- a/apps/server/src/provider/Layers/ClaudeAdapter.ts +++ b/apps/server/src/provider/Layers/ClaudeAdapter.ts @@ -262,6 +262,18 @@ function isSyntheticClaudeThreadId(value: string): boolean { return value.startsWith("claude-thread-"); } +function hasDurableClaudeSessionId(message: SDKMessage): boolean { + if (message.type !== "system") { + return true; + } + + return ( + message.subtype !== "hook_started" && + message.subtype !== "hook_progress" && + message.subtype !== "hook_response" + ); +} + function toMessage(cause: unknown, fallback: string): string { if (cause instanceof Error && cause.message.length > 0) { return cause.message; @@ -1325,6 +1337,9 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( if (typeof message.session_id !== "string" || message.session_id.length === 0) { return; } + if (!hasDurableClaudeSessionId(message)) { + return; + } const nextThreadId = message.session_id; context.resumeSessionId = message.session_id; yield* updateResumeCursor(context); @@ -2992,6 +3007,31 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( ...(Object.keys(extraArgs).length > 0 ? { extraArgs } : {}), }; + yield* Effect.annotateCurrentSpan({ + "provider.kind": PROVIDER, + "provider.thread_id": threadId, + "provider.runtime_mode": input.runtimeMode, + "claude.resume.source": + existingResumeSessionId !== undefined ? "resume-session" : "generated-session", + "claude.resume.thread_id": resumeState?.threadId ?? "", + "claude.resume.session_id": existingResumeSessionId ?? "", + "claude.resume.session_at": resumeState?.resumeSessionAt ?? "", + "claude.resume.turn_count": resumeState?.turnCount ?? -1, + "claude.query.cwd": input.cwd ?? "", + "claude.query.model": apiModelId ?? "", + "claude.query.effort": effectiveEffort ?? "", + "claude.query.permission_mode": permissionMode ?? "", + "claude.query.allow_dangerously_skip_permissions": permissionMode === "bypassPermissions", + "claude.query.resume": existingResumeSessionId ?? "", + "claude.query.session_id": newSessionId ?? "", + "claude.query.include_partial_messages": true, + "claude.query.additional_directories": input.cwd ? [input.cwd] : [], + "claude.query.setting_sources": [...CLAUDE_SETTING_SOURCES], + "claude.query.settings_keys": Object.keys(settings).sort(), + "claude.query.extra_args_count": Object.keys(extraArgs).length, + "claude.query.path_to_executable": claudeBinaryPath, + }); + const queryRuntime = yield* Effect.try({ try: () => createQuery({ diff --git a/apps/server/src/provider/Layers/ClaudeProvider.ts b/apps/server/src/provider/Layers/ClaudeProvider.ts index 27ae2b7cb65..d50f9761730 100644 --- a/apps/server/src/provider/Layers/ClaudeProvider.ts +++ b/apps/server/src/provider/Layers/ClaudeProvider.ts @@ -22,6 +22,7 @@ type ClaudeSlashCommand = { import { buildServerProvider, + AUTH_PROBE_TIMEOUT_MS, DEFAULT_TIMEOUT_MS, detailFromResult, extractAuthBoolean, @@ -46,6 +47,10 @@ const DEFAULT_CLAUDE_MODEL_CAPABILITIES: ModelCapabilities = { }; const PROVIDER = "claudeAgent" as const; +const CLAUDE_PRESENTATION = { + displayName: "Claude", + showInteractionModeToggle: true, +} as const; const MINIMUM_CLAUDE_OPUS_4_7_VERSION = "2.1.111"; const BUILT_IN_MODELS: ReadonlyArray = [ { @@ -600,6 +605,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( if (!claudeSettings.enabled) { return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: false, checkedAt, models: allModels, @@ -622,6 +628,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( const error = versionProbe.failure; return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: claudeSettings.enabled, checkedAt, models: allModels, @@ -640,6 +647,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( if (Option.isNone(versionProbe.success)) { return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: claudeSettings.enabled, checkedAt, models: allModels, @@ -660,6 +668,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( const detail = detailFromResult(version); return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: claudeSettings.enabled, checkedAt, models: allModels, @@ -696,7 +705,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( // ── Auth check + subscription detection ──────────────────────────── const authProbe = yield* runClaudeCommand(["auth", "status"]).pipe( - Effect.timeoutOption(DEFAULT_TIMEOUT_MS), + Effect.timeoutOption(AUTH_PROBE_TIMEOUT_MS), Effect.result, ); @@ -724,6 +733,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( const error = authProbe.failure; return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: claudeSettings.enabled, checkedAt, models, @@ -744,6 +754,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( if (Option.isNone(authProbe.success)) { return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: claudeSettings.enabled, checkedAt, models, @@ -762,6 +773,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( const authMetadata = claudeAuthMetadata({ subscriptionType, authMethod }); return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: claudeSettings.enabled, checkedAt, models, @@ -795,6 +807,7 @@ const makePendingClaudeProvider = (claudeSettings: ClaudeSettings): ServerProvid if (!claudeSettings.enabled) { return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: false, checkedAt, models, @@ -810,6 +823,7 @@ const makePendingClaudeProvider = (claudeSettings: ClaudeSettings): ServerProvid return buildServerProvider({ provider: PROVIDER, + presentation: CLAUDE_PRESENTATION, enabled: true, checkedAt, models, diff --git a/apps/server/src/provider/Layers/CodexProvider.ts b/apps/server/src/provider/Layers/CodexProvider.ts index f6e5976f220..4dee22bdd3c 100644 --- a/apps/server/src/provider/Layers/CodexProvider.ts +++ b/apps/server/src/provider/Layers/CodexProvider.ts @@ -29,6 +29,7 @@ import { makeManagedServerProvider } from "../makeManagedServerProvider.ts"; import { buildServerProvider } from "../providerSnapshot.ts"; import { CodexProvider } from "../Services/CodexProvider.ts"; import { ServerConfig } from "../../config.ts"; +import { expandHomePath } from "../../pathExpansion.ts"; import { ServerSettingsService } from "../../serverSettings.ts"; import packageJson from "../../../package.json" with { type: "json" }; @@ -63,7 +64,9 @@ function codexAccountAuthLabel(account: CodexSchema.V2GetAccountResponse["accoun case "plus": return "ChatGPT Plus Subscription"; case "pro": - return "ChatGPT Pro Subscription"; + return "ChatGPT Pro 20x Subscription"; + case "prolite": + return "ChatGPT Pro 5x Subscription"; case "team": return "ChatGPT Team Subscription"; case "self_serve_business_usage_based": @@ -221,7 +224,7 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun command: input.binaryPath, args: ["app-server"], cwd: input.cwd, - ...(input.homePath ? { env: { CODEX_HOME: input.homePath } } : {}), + ...(input.homePath ? { env: { CODEX_HOME: expandHomePath(input.homePath) } } : {}), }), ); const client = yield* Effect.service(CodexClient.CodexAppServerClient).pipe( diff --git a/apps/server/src/provider/Layers/CodexSessionRuntime.ts b/apps/server/src/provider/Layers/CodexSessionRuntime.ts index 29b22e16f80..e45e1825ee2 100644 --- a/apps/server/src/provider/Layers/CodexSessionRuntime.ts +++ b/apps/server/src/provider/Layers/CodexSessionRuntime.ts @@ -30,6 +30,7 @@ import { CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS, CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS, } from "../CodexDeveloperInstructions.ts"; +import { expandHomePath } from "../../pathExpansion.ts"; const PROVIDER = "codex" as const; @@ -468,6 +469,7 @@ function readNotificationThreadId(notification: CodexServerNotification): string case "item/commandExecution/outputDelta": case "item/commandExecution/terminalInteraction": case "item/fileChange/outputDelta": + case "item/fileChange/patchUpdated": case "serverRequest/resolved": case "item/mcpToolCall/progress": case "item/reasoning/summaryTextDelta": @@ -476,7 +478,8 @@ function readNotificationThreadId(notification: CodexServerNotification): string case "thread/compacted": case "thread/realtime/started": case "thread/realtime/itemAdded": - case "thread/realtime/transcriptUpdated": + case "thread/realtime/transcript/delta": + case "thread/realtime/transcript/done": case "thread/realtime/outputAudio/delta": case "thread/realtime/sdp": case "thread/realtime/error": @@ -530,6 +533,7 @@ function readRouteFields(notification: CodexServerNotification): { case "item/commandExecution/outputDelta": case "item/commandExecution/terminalInteraction": case "item/fileChange/outputDelta": + case "item/fileChange/patchUpdated": case "item/reasoning/summaryTextDelta": case "item/reasoning/summaryPartAdded": case "item/reasoning/textDelta": @@ -680,7 +684,9 @@ export const makeCodexSessionRuntime = ( .spawn( ChildProcess.make(options.binaryPath, ["app-server"], { cwd: options.cwd, - ...(options.homePath ? { env: { ...process.env, CODEX_HOME: options.homePath } } : {}), + ...(options.homePath + ? { env: { ...process.env, CODEX_HOME: expandHomePath(options.homePath) } } + : {}), shell: process.platform === "win32", }), ) diff --git a/apps/server/src/provider/Layers/ProviderRegistry.test.ts b/apps/server/src/provider/Layers/ProviderRegistry.test.ts index f6eef168b72..e29d1ae1957 100644 --- a/apps/server/src/provider/Layers/ProviderRegistry.test.ts +++ b/apps/server/src/provider/Layers/ProviderRegistry.test.ts @@ -185,7 +185,7 @@ it.layer( assert.strictEqual(status.version, "1.0.0"); assert.strictEqual(status.auth.status, "authenticated"); assert.strictEqual(status.auth.type, "chatgpt"); - assert.strictEqual(status.auth.label, "ChatGPT Pro Subscription"); + assert.strictEqual(status.auth.label, "ChatGPT Pro 20x Subscription"); assert.deepStrictEqual(status.models, [ { slug: "gpt-live-codex", diff --git a/apps/server/src/provider/Layers/ProviderService.test.ts b/apps/server/src/provider/Layers/ProviderService.test.ts index 1194206ebd2..9bb40596a06 100644 --- a/apps/server/src/provider/Layers/ProviderService.test.ts +++ b/apps/server/src/provider/Layers/ProviderService.test.ts @@ -937,6 +937,7 @@ routing.layer("ProviderServiceLive routing", (it) => { const session = yield* provider.startSession(asThreadId("thread-1"), { provider: "codex", threadId: asThreadId("thread-1"), + cwd: "/tmp/project-send-turn", runtimeMode: "full-access", }); yield* provider.sendTurn({ @@ -962,7 +963,7 @@ routing.layer("ProviderServiceLive routing", (it) => { lastError: string | null; lastRuntimeEvent: string | null; }; - assert.equal(runtimePayload.cwd, process.cwd()); + assert.equal(runtimePayload.cwd, "/tmp/project-send-turn"); assert.equal(runtimePayload.model, null); assert.equal(runtimePayload.activeTurnId, `turn-${String(session.threadId)}`); assert.equal(runtimePayload.lastError, null); diff --git a/apps/server/src/provider/Layers/ProviderService.ts b/apps/server/src/provider/Layers/ProviderService.ts index a38a24655fe..94630d3bca9 100644 --- a/apps/server/src/provider/Layers/ProviderService.ts +++ b/apps/server/src/provider/Layers/ProviderService.ts @@ -374,9 +374,31 @@ const makeProviderService = Effect.fn("makeProviderService")(function* ( (persistedBinding?.provider === input.provider ? persistedBinding.resumeCursor : undefined); + const effectiveCwd = + input.cwd ?? + (persistedBinding?.provider === input.provider + ? readPersistedCwd(persistedBinding.runtimePayload) + : undefined); + yield* Effect.annotateCurrentSpan({ + "provider.resume_cursor.source": + input.resumeCursor !== undefined + ? "request" + : effectiveResumeCursor !== undefined && persistedBinding?.provider === input.provider + ? "persisted" + : "none", + "provider.resume_cursor.present": effectiveResumeCursor !== undefined, + "provider.cwd.source": + input.cwd !== undefined + ? "request" + : effectiveCwd !== undefined && persistedBinding?.provider === input.provider + ? "persisted" + : "none", + "provider.cwd.effective": effectiveCwd ?? "", + }); const adapter = yield* registry.getByProvider(input.provider); const session = yield* adapter.startSession({ ...input, + ...(effectiveCwd !== undefined ? { cwd: effectiveCwd } : {}), ...(effectiveResumeCursor !== undefined ? { resumeCursor: effectiveResumeCursor } : {}), }); @@ -398,7 +420,7 @@ const makeProviderService = Effect.fn("makeProviderService")(function* ( provider: session.provider, runtimeMode: input.runtimeMode, hasResumeCursor: session.resumeCursor !== undefined, - hasCwd: typeof input.cwd === "string" && input.cwd.trim().length > 0, + hasCwd: typeof effectiveCwd === "string" && effectiveCwd.trim().length > 0, hasModel: typeof input.modelSelection?.model === "string" && input.modelSelection.model.trim().length > 0, diff --git a/apps/server/src/provider/opencodeRuntime.ts b/apps/server/src/provider/opencodeRuntime.ts index 9f10738dbfb..41ec5102c3c 100644 --- a/apps/server/src/provider/opencodeRuntime.ts +++ b/apps/server/src/provider/opencodeRuntime.ts @@ -36,7 +36,6 @@ import { NetService } from "@t3tools/shared/Net"; const OPENCODE_SERVER_READY_PREFIX = "opencode server listening"; const DEFAULT_OPENCODE_SERVER_TIMEOUT_MS = 5_000; const DEFAULT_HOSTNAME = "127.0.0.1"; - export interface OpenCodeServerProcess { readonly url: string; readonly exitCode: Effect.Effect; diff --git a/apps/server/src/provider/providerSnapshot.ts b/apps/server/src/provider/providerSnapshot.ts index bbc94473194..82a3f418803 100644 --- a/apps/server/src/provider/providerSnapshot.ts +++ b/apps/server/src/provider/providerSnapshot.ts @@ -11,6 +11,8 @@ import { Effect, Stream } from "effect"; import { normalizeModelSlug } from "@t3tools/shared/model"; export const DEFAULT_TIMEOUT_MS = 4_000; +// Auth status checks involve disk/network lookups and can be slow on first run (especially Windows) +export const AUTH_PROBE_TIMEOUT_MS = 10_000; export interface CommandResult { readonly stdout: string; @@ -26,6 +28,12 @@ export interface ProviderProbeResult { readonly message?: string; } +export interface ServerProviderPresentation { + readonly displayName: string; + readonly badgeLabel?: string; + readonly showInteractionModeToggle?: boolean; +} + export function nonEmptyTrimmed(value: string | undefined): string | undefined { if (!value) return undefined; const trimmed = value.trim(); @@ -105,8 +113,52 @@ export function providerModelsFromSettings( return [...resolvedBuiltInModels, ...customEntries]; } +export function buildSelectOptionDescriptor(input: { + readonly id: string; + readonly label: string; + readonly options: + | ReadonlyArray<{ value: string; label: string; isDefault?: boolean | undefined }> + | undefined; + readonly description?: string; + readonly promptInjectedValues?: ReadonlyArray; +}) { + const options = (input.options ?? []).map((option) => + option.isDefault + ? { id: option.value, label: option.label, isDefault: true } + : { id: option.value, label: option.label }, + ); + const currentValue = options.find((option) => option.isDefault)?.id; + return { + id: input.id, + label: input.label, + type: "select" as const, + options, + ...(currentValue ? { currentValue } : {}), + ...(input.description ? { description: input.description } : {}), + ...(input.promptInjectedValues && input.promptInjectedValues.length > 0 + ? { promptInjectedValues: [...input.promptInjectedValues] } + : {}), + }; +} + +export function buildBooleanOptionDescriptor(input: { + readonly id: string; + readonly label: string; + readonly currentValue?: boolean; + readonly description?: string; +}) { + return { + id: input.id, + label: input.label, + type: "boolean" as const, + ...(input.description ? { description: input.description } : {}), + ...(typeof input.currentValue === "boolean" ? { currentValue: input.currentValue } : {}), + }; +} + export function buildServerProvider(input: { provider: ServerProvider["provider"]; + presentation?: ServerProviderPresentation; enabled: boolean; checkedAt: string; models: ReadonlyArray; @@ -116,6 +168,11 @@ export function buildServerProvider(input: { }): ServerProvider { return { provider: input.provider, + ...(input.presentation?.displayName ? { displayName: input.presentation.displayName } : {}), + ...(input.presentation?.badgeLabel ? { badgeLabel: input.presentation.badgeLabel } : {}), + ...(typeof input.presentation?.showInteractionModeToggle === "boolean" + ? { showInteractionModeToggle: input.presentation.showInteractionModeToggle } + : {}), enabled: input.enabled, installed: input.probe.installed, version: input.probe.version, diff --git a/apps/server/src/provider/providerStatusCache.ts b/apps/server/src/provider/providerStatusCache.ts index 0299822425c..6ba5a4d5bb2 100644 --- a/apps/server/src/provider/providerStatusCache.ts +++ b/apps/server/src/provider/providerStatusCache.ts @@ -1,6 +1,8 @@ import * as nodePath from "node:path"; import { type ServerProvider, ServerProvider as ServerProviderSchema } from "@t3tools/contracts"; -import { Cause, Effect, FileSystem, Path, Schema } from "effect"; +import { Cause, Effect, FileSystem, Schema } from "effect"; + +import { writeFileStringAtomically } from "../atomicWrite.ts"; export const PROVIDER_CACHE_IDS = [ "codex", @@ -96,22 +98,8 @@ export const readProviderStatusCache = (filePath: string) => export const writeProviderStatusCache = (input: { readonly filePath: string; readonly provider: ServerProvider; -}) => { - const tempPath = `${input.filePath}.${process.pid}.${Date.now()}.tmp`; - return Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - const path = yield* Path.Path; - const encoded = `${JSON.stringify(input.provider, null, 2)}\n`; - - yield* fs.makeDirectory(path.dirname(input.filePath), { recursive: true }); - yield* fs.writeFileString(tempPath, encoded); - yield* fs.rename(tempPath, input.filePath); - }).pipe( - Effect.ensuring( - Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - yield* fs.remove(tempPath, { force: true }).pipe(Effect.ignore({ log: true })); - }), - ), - ); -}; +}) => + writeFileStringAtomically({ + filePath: input.filePath, + contents: `${JSON.stringify(input.provider, null, 2)}\n`, + }); diff --git a/apps/server/src/serverRuntimeState.ts b/apps/server/src/serverRuntimeState.ts index 569e4ac1179..4b300f29c2c 100644 --- a/apps/server/src/serverRuntimeState.ts +++ b/apps/server/src/serverRuntimeState.ts @@ -1,5 +1,6 @@ -import { Effect, FileSystem, Option, Path, Schema } from "effect"; +import { Effect, FileSystem, Option, Schema } from "effect"; +import { writeFileStringAtomically } from "./atomicWrite.ts"; import { type ServerConfigShape } from "./config.ts"; import { formatHostForUrl, isWildcardHost } from "./startupAccess.ts"; @@ -42,15 +43,9 @@ export const persistServerRuntimeState = (input: { readonly path: string; readonly state: PersistedServerRuntimeState; }) => - Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - const pathService = yield* Path.Path; - const tempPath = `${input.path}.${process.pid}.${Date.now()}.tmp`; - return yield* fs.makeDirectory(pathService.dirname(input.path), { recursive: true }).pipe( - Effect.flatMap(() => fs.writeFileString(tempPath, `${JSON.stringify(input.state)}\n`)), - Effect.flatMap(() => fs.rename(tempPath, input.path)), - Effect.ensuring(fs.remove(tempPath, { force: true }).pipe(Effect.ignore({ log: true }))), - ); + writeFileStringAtomically({ + filePath: input.path, + contents: `${JSON.stringify(input.state)}\n`, }); export const clearPersistedServerRuntimeState = (path: string) => diff --git a/apps/server/src/serverSettings.ts b/apps/server/src/serverSettings.ts index 5d4076a570e..acda7be294f 100644 --- a/apps/server/src/serverSettings.ts +++ b/apps/server/src/serverSettings.ts @@ -39,6 +39,7 @@ import { Cause, } from "effect"; import * as Semaphore from "effect/Semaphore"; +import { writeFileStringAtomically } from "./atomicWrite.ts"; import { ServerConfig } from "./config.ts"; import { type DeepPartial, deepMerge } from "@t3tools/shared/Struct"; import { fromLenientJson } from "@t3tools/shared/schemaJson"; @@ -242,14 +243,14 @@ const makeServerSettings = Effect.gen(function* () { const getSettingsFromCache = Cache.get(settingsCache, cacheKey); const writeSettingsAtomically = (settings: ServerSettings) => { - const tempPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`; const sparseSettings = stripDefaultServerSettings(settings, DEFAULT_SERVER_SETTINGS) ?? {}; - return Effect.succeed(`${JSON.stringify(sparseSettings, null, 2)}\n`).pipe( - Effect.tap(() => fs.makeDirectory(pathService.dirname(settingsPath), { recursive: true })), - Effect.tap((encoded) => fs.writeFileString(tempPath, encoded)), - Effect.flatMap(() => fs.rename(tempPath, settingsPath)), - Effect.ensuring(fs.remove(tempPath, { force: true }).pipe(Effect.ignore({ log: true }))), + return writeFileStringAtomically({ + filePath: settingsPath, + contents: `${JSON.stringify(sparseSettings, null, 2)}\n`, + }).pipe( + Effect.provideService(FileSystem.FileSystem, fs), + Effect.provideService(Path.Path, pathService), Effect.mapError( (cause) => new ServerSettingsError({ diff --git a/apps/web/package.json b/apps/web/package.json index 23b9b2b3936..66e1f6d017d 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "@t3tools/web", - "version": "0.0.20", + "version": "0.0.21", "private": true, "type": "module", "scripts": { diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx index 996fca4b391..828e6e122ba 100644 --- a/apps/web/src/components/BranchToolbarBranchSelector.tsx +++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx @@ -42,7 +42,7 @@ import { ComboboxStatus, ComboboxTrigger, } from "./ui/combobox"; -import { toastManager } from "./ui/toast"; +import { stackedThreadToast, toastManager } from "./ui/toast"; interface BranchToolbarBranchSelectorProps { environmentId: EnvironmentId; @@ -351,11 +351,13 @@ export function BranchToolbarBranchSelector({ setThreadBranch(nextBranchName, selectionTarget.nextWorktreePath); } catch (error) { setOptimisticBranch(previousBranch); - toastManager.add({ - type: "error", - title: "Failed to checkout branch.", - description: toBranchActionErrorMessage(error), - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to checkout branch.", + description: toBranchActionErrorMessage(error), + }), + ); } }); }; @@ -381,11 +383,13 @@ export function BranchToolbarBranchSelector({ setThreadBranch(createBranchResult.branch, activeWorktreePath); } catch (error) { setOptimisticBranch(previousBranch); - toastManager.add({ - type: "error", - title: "Failed to create and checkout branch.", - description: toBranchActionErrorMessage(error), - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to create and checkout branch.", + description: toBranchActionErrorMessage(error), + }), + ); } }); }; diff --git a/apps/web/src/components/ChatMarkdown.tsx b/apps/web/src/components/ChatMarkdown.tsx index 5b1d40399a7..76a12e7f0e4 100644 --- a/apps/web/src/components/ChatMarkdown.tsx +++ b/apps/web/src/components/ChatMarkdown.tsx @@ -20,7 +20,7 @@ import { defaultUrlTransform } from "react-markdown"; import remarkGfm from "remark-gfm"; import { VscodeEntryIcon } from "./chat/VscodeEntryIcon"; import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; -import { toastManager } from "./ui/toast"; +import { stackedThreadToast, toastManager } from "./ui/toast"; import { openInPreferredEditor } from "../editorPreferences"; import { resolveDiffThemeName, type DiffThemeName } from "../lib/diffRendering"; import { fnv1a32 } from "../lib/diffRendering"; @@ -355,21 +355,25 @@ const MarkdownFileLink = memo(function MarkdownFileLink({ } void openInPreferredEditor(api, targetPath).catch((error) => { - toastManager.add({ - type: "error", - title: "Unable to open file", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Unable to open file", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); }); }, [targetPath]); const handleCopy = useCallback((value: string, title: string) => { if (typeof window === "undefined" || !navigator.clipboard?.writeText) { - toastManager.add({ - type: "error", - title: `Failed to copy ${title.toLowerCase()}`, - description: "Clipboard API unavailable.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: `Failed to copy ${title.toLowerCase()}`, + description: "Clipboard API unavailable.", + }), + ); return; } @@ -382,11 +386,13 @@ const MarkdownFileLink = memo(function MarkdownFileLink({ }); }, (error) => { - toastManager.add({ - type: "error", - title: `Failed to copy ${title.toLowerCase()}`, - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: `Failed to copy ${title.toLowerCase()}`, + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); }, ); }, []); diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsx index 029ec1f5e47..a9f9f8007cf 100644 --- a/apps/web/src/components/CommandPalette.tsx +++ b/apps/web/src/components/CommandPalette.tsx @@ -102,7 +102,7 @@ import { } from "./ui/command"; import { Button } from "./ui/button"; import { Kbd, KbdGroup } from "./ui/kbd"; -import { toastManager } from "./ui/toast"; +import { stackedThreadToast, toastManager } from "./ui/toast"; import { ComposerHandleContext, useComposerHandleContext } from "../composerHandleContext"; import type { ChatComposerHandle } from "./chat/ChatComposer"; @@ -607,11 +607,13 @@ function OpenCommandPaletteDialog() { const environmentId = defaultAddProjectEnvironmentId; if (!environmentId) { - toastManager.add({ - type: "error", - title: "Unable to browse projects", - description: "No environment is available.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Unable to browse projects", + description: "No environment is available.", + }), + ); return; } @@ -726,20 +728,24 @@ function OpenCommandPaletteDialog() { if (!api) return; if (isUnsupportedWindowsProjectPath(rawCwd.trim(), browseEnvironmentPlatform)) { - toastManager.add({ - type: "error", - title: "Failed to add project", - description: "Windows-style paths are only supported on Windows.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to add project", + description: "Windows-style paths are only supported on Windows.", + }), + ); return; } if (isExplicitRelativeProjectPath(rawCwd.trim()) && !currentProjectCwdForBrowse) { - toastManager.add({ - type: "error", - title: "Failed to add project", - description: "Relative paths require an active project.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to add project", + description: "Relative paths require an active project.", + }), + ); return; } @@ -792,11 +798,13 @@ function OpenCommandPaletteDialog() { }).catch(() => undefined); setOpen(false); } catch (error) { - toastManager.add({ - type: "error", - title: "Failed to add project", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to add project", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); } }, [ @@ -936,11 +944,13 @@ function OpenCommandPaletteDialog() { } void item.run().catch((error: unknown) => { - toastManager.add({ - type: "error", - title: "Unable to run command", - description: error instanceof Error ? error.message : "An unexpected error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Unable to run command", + description: error instanceof Error ? error.message : "An unexpected error occurred.", + }), + ); }); } diff --git a/apps/web/src/components/GitActionsControl.browser.tsx b/apps/web/src/components/GitActionsControl.browser.tsx index bb77ee36800..24af3bed146 100644 --- a/apps/web/src/components/GitActionsControl.browser.tsx +++ b/apps/web/src/components/GitActionsControl.browser.tsx @@ -90,6 +90,7 @@ vi.mock("~/components/ui/toast", () => ({ promise: toastPromiseSpy, update: toastUpdateSpy, }, + stackedThreadToast: vi.fn((options: unknown) => options), })); vi.mock("~/editorPreferences", () => ({ diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index aed0a5c1d0e..31342d8406b 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -40,7 +40,7 @@ import { Menu, MenuItem, MenuPopup, MenuTrigger } from "~/components/ui/menu"; import { Popover, PopoverPopup, PopoverTrigger } from "~/components/ui/popover"; import { ScrollArea } from "~/components/ui/scroll-area"; import { Textarea } from "~/components/ui/textarea"; -import { toastManager, type ThreadToastData } from "~/components/ui/toast"; +import { stackedThreadToast, toastManager, type ThreadToastData } from "~/components/ui/toast"; import { openInPreferredEditor } from "~/editorPreferences"; import { gitInitMutationOptions, @@ -488,12 +488,14 @@ export default function GitActionsControl({ return; } void api.shell.openExternal(prUrl).catch((err: unknown) => { - toastManager.add({ - type: "error", - title: "Unable to open PR link", - description: err instanceof Error ? err.message : "An error occurred.", - data: threadToastData, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Unable to open PR link", + description: err instanceof Error ? err.message : "An error occurred.", + ...(threadToastData !== undefined ? { data: threadToastData } : {}), + }), + ); }); }, [gitStatusForActions, threadToastData]); @@ -684,33 +686,44 @@ export default function GitActionsControl({ }; } - const successToastBase = { - type: "success", - title: result.toast.title, - description: result.toast.description, - timeout: 0, - data: { - ...scopedToastData, - dismissAfterVisibleMs: 10_000, - }, - } as const; + const successToastData = { + ...scopedToastData, + dismissAfterVisibleMs: 10_000, + }; if (toastActionProps) { + toastManager.update( + resolvedProgressToastId, + stackedThreadToast({ + type: "success", + title: result.toast.title, + description: result.toast.description, + timeout: 0, + actionProps: toastActionProps, + actionVariant: "outline", + data: successToastData, + }), + ); + } else { toastManager.update(resolvedProgressToastId, { - ...successToastBase, - actionProps: toastActionProps, + type: "success", + title: result.toast.title, + description: result.toast.description, + timeout: 0, + data: successToastData, }); - } else { - toastManager.update(resolvedProgressToastId, successToastBase); } } catch (err) { activeGitActionProgressRef.current = null; - toastManager.update(resolvedProgressToastId, { - type: "error", - title: "Action failed", - description: err instanceof Error ? err.message : "An error occurred.", - data: scopedToastData, - }); + toastManager.update( + resolvedProgressToastId, + stackedThreadToast({ + type: "error", + title: "Action failed", + description: err instanceof Error ? err.message : "An error occurred.", + ...(scopedToastData !== undefined ? { data: scopedToastData } : {}), + }), + ); } }, ); @@ -767,7 +780,10 @@ export default function GitActionsControl({ } if (quickAction.kind === "run_pull") { const promise = pullMutation.mutateAsync(); - toastManager.promise(promise, { + void toastManager.promise< + Awaited>, + ThreadToastData + >(promise, { loading: { title: "Pulling...", data: threadToastData }, success: (result) => ({ title: result.status === "pulled" ? "Pulled" : "Already up to date", @@ -846,12 +862,14 @@ export default function GitActionsControl({ } const target = resolvePathLinkTarget(filePath, gitCwd); void openInPreferredEditor(api, target).catch((error) => { - toastManager.add({ - type: "error", - title: "Unable to open file", - description: error instanceof Error ? error.message : "An error occurred.", - data: threadToastData, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Unable to open file", + description: error instanceof Error ? error.message : "An error occurred.", + ...(threadToastData !== undefined ? { data: threadToastData } : {}), + }), + ); }); }, [gitCwd, threadToastData], diff --git a/apps/web/src/components/PlanSidebar.tsx b/apps/web/src/components/PlanSidebar.tsx index 00b9da2b0c8..afd4bb2e0bc 100644 --- a/apps/web/src/components/PlanSidebar.tsx +++ b/apps/web/src/components/PlanSidebar.tsx @@ -26,7 +26,7 @@ import { } from "../proposedPlan"; import { Menu, MenuItem, MenuPopup, MenuTrigger } from "./ui/menu"; import { readEnvironmentApi } from "~/environmentApi"; -import { toastManager } from "./ui/toast"; +import { stackedThreadToast, toastManager } from "./ui/toast"; import { useCopyToClipboard } from "~/hooks/useCopyToClipboard"; function stepStatusIcon(status: string): React.ReactNode { @@ -112,11 +112,13 @@ const PlanSidebar = memo(function PlanSidebar({ }); }) .catch((error) => { - toastManager.add({ - type: "error", - title: "Could not save plan", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not save plan", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); }) .then( () => setIsSavingToWorkspace(false), diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index a83a902d59b..586c7ed1df8 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -94,7 +94,7 @@ import { resolveThreadRouteRef, resolveThreadRouteTarget, } from "../threadRoutes"; -import { toastManager } from "./ui/toast"; +import { stackedThreadToast, toastManager } from "./ui/toast"; import { formatRelativeTimeLabel } from "../timestampFormat"; import { SettingsSidebarNav } from "./settings/SettingsSidebarNav"; import { Kbd } from "./ui/kbd"; @@ -950,11 +950,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec }); }, onError: (error) => { - toastManager.add({ - type: "error", - title: "Failed to copy thread ID", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to copy thread ID", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); }, }); const { copyToClipboard: copyPathToClipboard } = useCopyToClipboard<{ @@ -968,11 +970,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec }); }, onError: (error) => { - toastManager.add({ - type: "error", - title: "Failed to copy path", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to copy path", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); }, }); const openPrLink = useCallback((event: React.MouseEvent, prUrl: string) => { @@ -989,11 +993,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec } void api.shell.openExternal(prUrl).catch((error) => { - toastManager.add({ - type: "error", - title: "Unable to open PR link", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Unable to open PR link", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); }); }, []); const sidebarThreads = useStore( @@ -1299,72 +1305,73 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec const memberProjectRef = scopeProjectRef(member.environmentId, member.id); const memberThreadCount = memberThreadCountByPhysicalKey.get(member.physicalProjectKey) ?? 0; if (memberThreadCount > 0) { - const warningToastId = toastManager.add({ - type: "warning", - title: "Project is not empty", - description: "Delete all threads in this project before removing it.", - data: { - actionLayout: "stacked-end", + const warningToastId = toastManager.add( + stackedThreadToast({ + type: "warning", + title: "Project is not empty", + description: "Delete all threads in this project before removing it.", actionVariant: "destructive", - }, - actionProps: { - children: "Delete anyway", - onClick: () => { - void (async () => { - toastManager.close(warningToastId); - await new Promise((resolve) => { - window.setTimeout(resolve, 180); - }); - - const latestProjectThreads = selectSidebarThreadsForProjectRefs( - useStore.getState(), - [memberProjectRef], - ); - const confirmed = await api.dialogs.confirm( - latestProjectThreads.length > 0 - ? [ - `Remove project "${member.name}" and delete its ${latestProjectThreads.length} thread${ - latestProjectThreads.length === 1 ? "" : "s" - }?`, - `Path: ${member.cwd}`, - ...(member.environmentLabel - ? [`Environment: ${member.environmentLabel}`] - : []), - "This permanently clears conversation history for those threads.", - "This removes only this project entry.", - "This action cannot be undone.", - ].join("\n") - : [ - `Remove project "${member.name}"?`, - `Path: ${member.cwd}`, - ...(member.environmentLabel - ? [`Environment: ${member.environmentLabel}`] - : []), - "This removes only this project entry.", - ].join("\n"), - ); - if (!confirmed) { - return; - } + actionProps: { + children: "Delete anyway", + onClick: () => { + void (async () => { + toastManager.close(warningToastId); + await new Promise((resolve) => { + window.setTimeout(resolve, 180); + }); + + const latestProjectThreads = selectSidebarThreadsForProjectRefs( + useStore.getState(), + [memberProjectRef], + ); + const confirmed = await api.dialogs.confirm( + latestProjectThreads.length > 0 + ? [ + `Remove project "${member.name}" and delete its ${latestProjectThreads.length} thread${ + latestProjectThreads.length === 1 ? "" : "s" + }?`, + `Path: ${member.cwd}`, + ...(member.environmentLabel + ? [`Environment: ${member.environmentLabel}`] + : []), + "This permanently clears conversation history for those threads.", + "This removes only this project entry.", + "This action cannot be undone.", + ].join("\n") + : [ + `Remove project "${member.name}"?`, + `Path: ${member.cwd}`, + ...(member.environmentLabel + ? [`Environment: ${member.environmentLabel}`] + : []), + "This removes only this project entry.", + ].join("\n"), + ); + if (!confirmed) { + return; + } - await removeProject(member, { force: true }); - })().catch((error) => { - const message = - error instanceof Error ? error.message : "Unknown error removing project."; - console.error("Failed to remove project", { - projectId: member.id, - environmentId: member.environmentId, - error, - }); - toastManager.add({ - type: "error", - title: `Failed to remove "${member.name}"`, - description: message, + await removeProject(member, { force: true }); + })().catch((error) => { + const message = + error instanceof Error ? error.message : "Unknown error removing project."; + console.error("Failed to remove project", { + projectId: member.id, + environmentId: member.environmentId, + error, + }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: `Failed to remove "${member.name}"`, + description: message, + }), + ); }); - }); + }, }, - }, - }); + }), + ); return; } @@ -1388,11 +1395,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec environmentId: member.environmentId, error, }); - toastManager.add({ - type: "error", - title: `Failed to remove "${member.name}"`, - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: `Failed to remove "${member.name}"`, + description: message, + }), + ); } }, [memberThreadCountByPhysicalKey, removeProject], @@ -1705,11 +1714,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec try { await archiveThread(threadRef); } catch (error) { - toastManager.add({ - type: "error", - title: "Failed to archive thread", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to archive thread", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); } }, [archiveThread], @@ -1757,11 +1768,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec title: trimmed, }); } catch (error) { - toastManager.add({ - type: "error", - title: "Failed to rename thread", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to rename thread", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); } finishRename(); }, @@ -1794,11 +1807,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec const api = readEnvironmentApi(projectRenameTarget.environmentId); if (!api) { - toastManager.add({ - type: "error", - title: "Failed to rename project", - description: "Project API unavailable.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to rename project", + description: "Project API unavailable.", + }), + ); return; } @@ -1811,11 +1826,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec }); closeProjectRenameDialog(); } catch (error) { - toastManager.add({ - type: "error", - title: "Failed to rename project", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to rename project", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); } }, [closeProjectRenameDialog, projectRenameTarget, projectRenameTitle]); @@ -1885,11 +1902,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec } if (clicked === "copy-path") { if (!threadWorkspacePath) { - toastManager.add({ - type: "error", - title: "Path unavailable", - description: "This thread does not have a workspace path to copy.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Path unavailable", + description: "This thread does not have a workspace path to copy.", + }), + ); return; } copyPathToClipboard(threadWorkspacePath, { path: threadWorkspacePath }); @@ -3223,18 +3242,22 @@ export default function Sidebar() { if (!shouldToastDesktopUpdateActionResult(result)) return; const actionError = getDesktopUpdateActionError(result); if (!actionError) return; - toastManager.add({ - type: "error", - title: "Could not download update", - description: actionError, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not download update", + description: actionError, + }), + ); }) .catch((error) => { - toastManager.add({ - type: "error", - title: "Could not start update download", - description: error instanceof Error ? error.message : "An unexpected error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not start update download", + description: error instanceof Error ? error.message : "An unexpected error occurred.", + }), + ); }); return; } @@ -3250,18 +3273,22 @@ export default function Sidebar() { if (!shouldToastDesktopUpdateActionResult(result)) return; const actionError = getDesktopUpdateActionError(result); if (!actionError) return; - toastManager.add({ - type: "error", - title: "Could not install update", - description: actionError, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not install update", + description: actionError, + }), + ); }) .catch((error) => { - toastManager.add({ - type: "error", - title: "Could not install update", - description: error instanceof Error ? error.message : "An unexpected error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not install update", + description: error instanceof Error ? error.message : "An unexpected error occurred.", + }), + ); }); } }, [desktopUpdateButtonAction, desktopUpdateButtonDisabled, desktopUpdateState]); diff --git a/apps/web/src/components/WebSocketConnectionSurface.tsx b/apps/web/src/components/WebSocketConnectionSurface.tsx index 7b350e98496..e0bb560980a 100644 --- a/apps/web/src/components/WebSocketConnectionSurface.tsx +++ b/apps/web/src/components/WebSocketConnectionSurface.tsx @@ -10,7 +10,7 @@ import { useWsConnectionStatus, WS_RECONNECT_MAX_ATTEMPTS, } from "../rpc/wsConnectionState"; -import { toastManager } from "./ui/toast"; +import { stackedThreadToast, toastManager } from "./ui/toast"; import { getPrimaryEnvironmentConnection } from "../environments/runtime"; const FORCED_WS_RECONNECT_DEBOUNCE_MS = 5_000; @@ -75,13 +75,34 @@ function describeRecoveredToast( return "Connection restored."; } -function describeSlowRpcAckToast(requests: ReadonlyArray): ReactNode { +function describeSlowRpcAckToast(requests: ReadonlyArray): string { const count = requests.length; const thresholdSeconds = Math.round((requests[0]?.thresholdMs ?? 0) / 1000); return `${count} request${count === 1 ? "" : "s"} waiting longer than ${thresholdSeconds}s.`; } +function SlowRpcAckRequestDetails({ requests }: { requests: ReadonlyArray }) { + return ( + + {requests.map((req) => ( + + {req.tag} + + {req.requestId} + + + Started {formatConnectionMoment(req.startedAt) ?? req.startedAt} + + + ))} + + ); +} + export function shouldAutoReconnect( status: WsConnectionStatus, trigger: WsAutoReconnectTrigger, @@ -138,15 +159,18 @@ export function WebSocketConnectionCoordinator() { console.warn("Automatic WebSocket reconnect failed", { error }); return; } - toastManager.add({ - type: "error", - title: "Reconnect failed", - description: error instanceof Error ? error.message : "Unable to restart the WebSocket.", - data: { - dismissAfterVisibleMs: 8_000, - hideCopyButton: true, - }, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Reconnect failed", + description: + error instanceof Error ? error.message : "Unable to restart the WebSocket.", + data: { + dismissAfterVisibleMs: 8_000, + hideCopyButton: true, + }, + }), + ); }); }); const syncBrowserOnlineStatus = useEffectEvent(() => { @@ -253,45 +277,45 @@ export function WebSocketConnectionCoordinator() { if (shouldShowReconnectToast || shouldShowOfflineToast || shouldShowExhaustedToast) { const toastPayload = shouldShowOfflineToast - ? { - description: describeOfflineToast(), - timeout: 0, - title: "Offline", - type: "warning" as const, + ? stackedThreadToast({ data: { hideCopyButton: true, }, - } + description: describeOfflineToast(), + timeout: 0, + title: "Offline", + type: "warning", + }) : shouldShowExhaustedToast - ? { + ? stackedThreadToast({ actionProps: { children: "Retry", onClick: triggerManualReconnect, }, - description: describeExhaustedToast(), - timeout: 0, - title: "Disconnected from T3 Server", - type: "error" as const, data: { hideCopyButton: true, }, - } - : { + description: describeExhaustedToast(), + timeout: 0, + title: "Disconnected from T3 Server", + type: "error", + }) + : stackedThreadToast({ actionProps: { children: "Retry now", onClick: triggerManualReconnect, }, + data: { + hideCopyButton: true, + }, description: status.nextRetryAt === null ? `Reconnecting... ${formatReconnectAttemptLabel(status)}` : `Reconnecting in ${formatRetryCountdown(status.nextRetryAt, nowMs)}... ${formatReconnectAttemptLabel(status)}`, timeout: 0, title: buildReconnectTitle(status), - type: "loading" as const, - data: { - hideCopyButton: true, - }, - }; + type: "loading", + }); if (toastIdRef.current) { toastManager.update(toastIdRef.current, toastPayload); @@ -369,6 +393,11 @@ export function SlowRpcAckToastCoordinator() { } const nextToast = { + data: { + expandableContent: , + expandableDescriptionTrigger: true, + expandableLabels: { collapse: "Hide requests", expand: "Show requests" }, + }, description: describeSlowRpcAckToast(slowRequests), timeout: 0, title: "Some requests are slow", diff --git a/apps/web/src/components/chat/ProposedPlanCard.tsx b/apps/web/src/components/chat/ProposedPlanCard.tsx index a36cb097cbe..e53ee93b913 100644 --- a/apps/web/src/components/chat/ProposedPlanCard.tsx +++ b/apps/web/src/components/chat/ProposedPlanCard.tsx @@ -24,7 +24,7 @@ import { DialogPopup, DialogTitle, } from "../ui/dialog"; -import { toastManager } from "../ui/toast"; +import { stackedThreadToast, toastManager } from "../ui/toast"; import { readEnvironmentApi } from "~/environmentApi"; import { useCopyToClipboard } from "~/hooks/useCopyToClipboard"; @@ -45,11 +45,13 @@ export const ProposedPlanCard = memo(function ProposedPlanCard({ const [isSavingToWorkspace, setIsSavingToWorkspace] = useState(false); const { copyToClipboard, isCopied } = useCopyToClipboard({ onError: (error) => { - toastManager.add({ - type: "error", - title: "Could not copy plan", - description: error instanceof Error ? error.message : "An error occurred while copying.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not copy plan", + description: error instanceof Error ? error.message : "An error occurred while copying.", + }), + ); }, }); const savePathInputId = useId(); @@ -73,11 +75,13 @@ export const ProposedPlanCard = memo(function ProposedPlanCard({ const openSaveDialog = () => { if (!workspaceRoot) { - toastManager.add({ - type: "error", - title: "Workspace path is unavailable", - description: "This thread does not have a workspace path to save into.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Workspace path is unavailable", + description: "This thread does not have a workspace path to save into.", + }), + ); return; } setSavePath((existing) => (existing.length > 0 ? existing : downloadFilename)); @@ -114,11 +118,13 @@ export const ProposedPlanCard = memo(function ProposedPlanCard({ }); }) .catch((error) => { - toastManager.add({ - type: "error", - title: "Could not save plan", - description: error instanceof Error ? error.message : "An error occurred while saving.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not save plan", + description: error instanceof Error ? error.message : "An error occurred while saving.", + }), + ); }) .then( () => { diff --git a/apps/web/src/components/chat/ProviderStatusBanner.tsx b/apps/web/src/components/chat/ProviderStatusBanner.tsx index e709e75da37..5eaacafe052 100644 --- a/apps/web/src/components/chat/ProviderStatusBanner.tsx +++ b/apps/web/src/components/chat/ProviderStatusBanner.tsx @@ -1,7 +1,8 @@ -import { PROVIDER_DISPLAY_NAMES, type ServerProvider } from "@t3tools/contracts"; +import { type ServerProvider } from "@t3tools/contracts"; import { memo } from "react"; import { Alert, AlertDescription, AlertTitle } from "../ui/alert"; import { CircleAlertIcon } from "lucide-react"; +import { formatProviderKindLabel } from "../../providerModels"; export const ProviderStatusBanner = memo(function ProviderStatusBanner({ status, @@ -12,7 +13,7 @@ export const ProviderStatusBanner = memo(function ProviderStatusBanner({ return null; } - const providerLabel = PROVIDER_DISPLAY_NAMES[status.provider] ?? status.provider; + const providerLabel = status.displayName?.trim() || formatProviderKindLabel(status.provider); const defaultMessage = status.status === "error" ? `${providerLabel} provider is unavailable.` diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsx index ab31fe7e173..880c4376e2c 100644 --- a/apps/web/src/components/settings/ConnectionsSettings.tsx +++ b/apps/web/src/components/settings/ConnectionsSettings.tsx @@ -41,7 +41,7 @@ import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover"; import { QRCodeSvg } from "../ui/qr-code"; import { Spinner } from "../ui/spinner"; import { Switch } from "../ui/switch"; -import { toastManager } from "../ui/toast"; +import { stackedThreadToast, toastManager } from "../ui/toast"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { Button } from "../ui/button"; import { Textarea } from "../ui/textarea"; @@ -302,11 +302,13 @@ const PairingLinkListRow = memo(function PairingLinkListRow({ }, onError: (error) => { setIsRevealDialogOpen(true); - toastManager.add({ - type: "error", - title: canCopyToClipboard ? "Could not copy pairing URL" : "Clipboard copy unavailable", - description: canCopyToClipboard ? error.message : "Showing the full value instead.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: canCopyToClipboard ? "Could not copy pairing URL" : "Clipboard copy unavailable", + description: canCopyToClipboard ? error.message : "Showing the full value instead.", + }), + ); }, }); @@ -535,11 +537,13 @@ const AuthorizedClientsHeaderAction = memo(function AuthorizedClientsHeaderActio setDialogOpen(false); } catch (error) { const message = error instanceof Error ? error.message : "Failed to create pairing URL."; - toastManager.add({ - type: "error", - title: "Could not create pairing URL", - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not create pairing URL", + description: message, + }), + ); } finally { setIsCreatingPairingLink(false); } @@ -828,11 +832,13 @@ export function ConnectionsSettings() { error instanceof Error ? error.message : "Failed to update network exposure."; setPendingDesktopServerExposureMode(null); setDesktopServerExposureError(message); - toastManager.add({ - type: "error", - title: "Could not update network access", - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not update network access", + description: message, + }), + ); setIsUpdatingDesktopServerExposure(false); } }, @@ -853,11 +859,13 @@ export function ConnectionsSettings() { } catch (error) { const message = error instanceof Error ? error.message : "Failed to revoke pairing link."; setDesktopAccessManagementError(message); - toastManager.add({ - type: "error", - title: "Could not revoke pairing link", - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not revoke pairing link", + description: message, + }), + ); } finally { setRevokingDesktopPairingLinkId(null); } @@ -872,11 +880,13 @@ export function ConnectionsSettings() { } catch (error) { const message = error instanceof Error ? error.message : "Failed to revoke client access."; setDesktopAccessManagementError(message); - toastManager.add({ - type: "error", - title: "Could not revoke client access", - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not revoke client access", + description: message, + }), + ); } finally { setRevokingDesktopClientSessionId(null); } @@ -897,11 +907,13 @@ export function ConnectionsSettings() { } catch (error) { const message = error instanceof Error ? error.message : "Failed to revoke other clients."; setDesktopAccessManagementError(message); - toastManager.add({ - type: "error", - title: "Could not revoke other clients", - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not revoke other clients", + description: message, + }), + ); } finally { setIsRevokingOtherDesktopClients(false); } @@ -933,11 +945,13 @@ export function ConnectionsSettings() { } catch (error) { const message = error instanceof Error ? error.message : "Failed to add backend."; setSavedBackendError(message); - toastManager.add({ - type: "error", - title: "Could not add backend", - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not add backend", + description: message, + }), + ); } finally { setIsAddingSavedBackend(false); } @@ -957,11 +971,13 @@ export function ConnectionsSettings() { } catch (error) { const message = error instanceof Error ? error.message : "Failed to reconnect backend."; setSavedBackendError(message); - toastManager.add({ - type: "error", - title: "Could not reconnect backend", - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not reconnect backend", + description: message, + }), + ); } finally { setReconnectingSavedEnvironmentId(null); } @@ -975,11 +991,13 @@ export function ConnectionsSettings() { } catch (error) { const message = error instanceof Error ? error.message : "Failed to remove backend."; setSavedBackendError(message); - toastManager.add({ - type: "error", - title: "Could not remove backend", - description: message, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not remove backend", + description: message, + }), + ); } finally { setRemovingSavedEnvironmentId(null); } diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx index 184f5f81686..10dca18abd5 100644 --- a/apps/web/src/components/settings/SettingsPanels.tsx +++ b/apps/web/src/components/settings/SettingsPanels.tsx @@ -11,7 +11,6 @@ import { import { useQueryClient } from "@tanstack/react-query"; import { type ReactNode, useCallback, useMemo, useRef, useState } from "react"; import { - PROVIDER_DISPLAY_NAMES, type DesktopUpdateChannel, type ModelSelection, type ScopedThreadRef, @@ -21,8 +20,7 @@ import { } from "@t3tools/contracts"; import { scopeThreadRef } from "@t3tools/client-runtime"; import { DEFAULT_UNIFIED_SETTINGS } from "@t3tools/contracts/settings"; -import { normalizeModelSlug } from "@t3tools/shared/model"; -import { createModelSelection } from "@t3tools/shared/model"; +import { createModelSelection, normalizeModelSlug } from "@t3tools/shared/model"; import { Equal } from "effect"; import { APP_VERSION } from "../../branding"; import { @@ -69,7 +67,7 @@ import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from ".. import { Input } from "../ui/input"; import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select"; import { Switch } from "../ui/switch"; -import { toastManager } from "../ui/toast"; +import { stackedThreadToast, toastManager } from "../ui/toast"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { SettingResetButton, @@ -85,6 +83,7 @@ import { useServerObservability, useServerProviders, } from "../../rpc/serverState"; +import { formatProviderKindLabel } from "../../providerModels"; const THEME_OPTIONS = [ { @@ -332,11 +331,13 @@ function AboutVersionSection() { setDesktopUpdateStateQueryData(queryClient, state); }) .catch((error: unknown) => { - toastManager.add({ - type: "error", - title: "Could not change update track", - description: error instanceof Error ? error.message : "Update track change failed.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not change update track", + description: error instanceof Error ? error.message : "Update track change failed.", + }), + ); }) .finally(() => { setIsChangingUpdateChannel(false); @@ -358,11 +359,13 @@ function AboutVersionSection() { setDesktopUpdateStateQueryData(queryClient, result.state); }) .catch((error: unknown) => { - toastManager.add({ - type: "error", - title: "Could not download update", - description: error instanceof Error ? error.message : "Download failed.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not download update", + description: error instanceof Error ? error.message : "Download failed.", + }), + ); }); return; } @@ -380,11 +383,13 @@ function AboutVersionSection() { setDesktopUpdateStateQueryData(queryClient, result.state); }) .catch((error: unknown) => { - toastManager.add({ - type: "error", - title: "Could not install update", - description: error instanceof Error ? error.message : "Install failed.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not install update", + description: error instanceof Error ? error.message : "Install failed.", + }), + ); }); return; } @@ -394,21 +399,25 @@ function AboutVersionSection() { .checkForUpdate() .then((result) => { setDesktopUpdateStateQueryData(queryClient, result.state); - if (result.state.status === "error") { - toastManager.add({ - type: "error", - title: "Could not check for updates", - description: - result.state.message ?? "Automatic updates are not available in this build.", - }); + if (!result.checked) { + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not check for updates", + description: + result.state.message ?? "Automatic updates are not available in this build.", + }), + ); } }) .catch((error: unknown) => { - toastManager.add({ - type: "error", - title: "Could not check for updates", - description: error instanceof Error ? error.message : "Update check failed.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not check for updates", + description: error instanceof Error ? error.message : "Update check failed.", + }), + ); }); }, [queryClient, updateState]); @@ -513,6 +522,9 @@ export function useSettingsRestore(onRestored?: () => void) { ...(settings.diffWordWrap !== DEFAULT_UNIFIED_SETTINGS.diffWordWrap ? ["Diff line wrapping"] : []), + ...(settings.autoOpenPlanSidebar !== DEFAULT_UNIFIED_SETTINGS.autoOpenPlanSidebar + ? ["Task sidebar"] + : []), ...(settings.enableAssistantStreaming !== DEFAULT_UNIFIED_SETTINGS.enableAssistantStreaming ? ["Assistant output"] : []), @@ -534,6 +546,7 @@ export function useSettingsRestore(onRestored?: () => void) { [ areProviderSettingsDirty, isGitWritingModelDirty, + settings.autoOpenPlanSidebar, settings.confirmThreadArchive, settings.confirmThreadDelete, settings.addProjectBaseDirectory, @@ -1040,6 +1053,32 @@ export function GeneralSettingsPanel() { } /> + + updateSettings({ + autoOpenPlanSidebar: DEFAULT_UNIFIED_SETTINGS.autoOpenPlanSidebar, + }) + } + /> + ) : null + } + control={ + + updateSettings({ autoOpenPlanSidebar: Boolean(checked) }) + } + aria-label="Open the task sidebar automatically" + /> + } + /> + @@ -1594,11 +1635,15 @@ export function GeneralSettingsPanel() { {providerCard.models.map((model) => { const caps = model.capabilities; const capLabels: string[] = []; - if (caps?.supportsFastMode) capLabels.push("Fast mode"); - if (caps?.supportsThinkingToggle) capLabels.push("Thinking"); + if (caps?.supportsFastMode) { + capLabels.push("Fast mode"); + } + if (caps?.supportsThinkingToggle) { + capLabels.push("Thinking"); + } if ( - caps?.reasoningEffortLevels && - caps.reasoningEffortLevels.length > 0 + (caps?.reasoningEffortLevels?.length ?? 0) > 0 || + (caps?.variantOptions?.length ?? 0) > 0 ) { capLabels.push("Reasoning"); } @@ -1815,11 +1860,13 @@ export function ArchivedThreadsPanel() { try { await unarchiveThread(threadRef); } catch (error) { - toastManager.add({ - type: "error", - title: "Failed to unarchive thread", - description: error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to unarchive thread", + description: error instanceof Error ? error.message : "An error occurred.", + }), + ); } return; } @@ -1883,12 +1930,14 @@ export function ArchivedThreadsPanel() { onClick={() => void unarchiveThread(scopeThreadRef(thread.environmentId, thread.id)).catch( (error) => { - toastManager.add({ - type: "error", - title: "Failed to unarchive thread", - description: - error instanceof Error ? error.message : "An error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Failed to unarchive thread", + description: + error instanceof Error ? error.message : "An error occurred.", + }), + ); }, ) } diff --git a/apps/web/src/components/sidebar/SidebarUpdatePill.tsx b/apps/web/src/components/sidebar/SidebarUpdatePill.tsx index f6c482bb183..7a63bac7141 100644 --- a/apps/web/src/components/sidebar/SidebarUpdatePill.tsx +++ b/apps/web/src/components/sidebar/SidebarUpdatePill.tsx @@ -6,7 +6,7 @@ import { setDesktopUpdateStateQueryData, useDesktopUpdateState, } from "../../lib/desktopUpdateReactQuery"; -import { toastManager } from "../ui/toast"; +import { stackedThreadToast, toastManager } from "../ui/toast"; import { getArm64IntelBuildWarningDescription, getDesktopUpdateActionError, @@ -57,18 +57,22 @@ export function SidebarUpdatePill() { if (!shouldToastDesktopUpdateActionResult(result)) return; const actionError = getDesktopUpdateActionError(result); if (!actionError) return; - toastManager.add({ - type: "error", - title: "Could not download update", - description: actionError, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not download update", + description: actionError, + }), + ); }) .catch((error) => { - toastManager.add({ - type: "error", - title: "Could not start update download", - description: error instanceof Error ? error.message : "An unexpected error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not start update download", + description: error instanceof Error ? error.message : "An unexpected error occurred.", + }), + ); }) .finally(() => { setRequestInFlight(false); @@ -87,18 +91,22 @@ export function SidebarUpdatePill() { if (!shouldToastDesktopUpdateActionResult(result)) return; const actionError = getDesktopUpdateActionError(result); if (!actionError) return; - toastManager.add({ - type: "error", - title: "Could not install update", - description: actionError, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not install update", + description: actionError, + }), + ); }) .catch((error) => { - toastManager.add({ - type: "error", - title: "Could not install update", - description: error instanceof Error ? error.message : "An unexpected error occurred.", - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Could not install update", + description: error instanceof Error ? error.message : "An unexpected error occurred.", + }), + ); }) .finally(() => { setRequestInFlight(false); diff --git a/apps/web/src/components/ui/toast.logic.test.ts b/apps/web/src/components/ui/toast.logic.test.ts index e634d7d9463..fefb61196bb 100644 --- a/apps/web/src/components/ui/toast.logic.test.ts +++ b/apps/web/src/components/ui/toast.logic.test.ts @@ -45,6 +45,62 @@ describe("buildVisibleToastLayout", () => { ); }); + it("reflows live toasts forward when the front toast is dismissed", () => { + const visibleToasts = [ + { id: "a", height: 48, transitionStatus: "ending" as const }, + { id: "b", height: 72 }, + { id: "c", height: 24 }, + ]; + + const layout = buildVisibleToastLayout(visibleToasts); + + // frontmost height should be the first live toast, not the ending one + assert.equal(layout.frontmostHeight, 72); + assert.deepEqual( + layout.items.map(({ toast, visibleIndex, offsetY }) => ({ + id: toast.id, + visibleIndex, + offsetY, + })), + [ + // Ending toast stays at its front slot; data-ending-style drives its exit + { id: "a", visibleIndex: 0, offsetY: 0 }, + // Live toasts get fresh indices starting at 0 so they move up in sync + { id: "b", visibleIndex: 0, offsetY: 0 }, + { id: "c", visibleIndex: 1, offsetY: 72 }, + ], + ); + }); + + it("keeps a non-front ending toast at its current slot so it exits straight", () => { + const visibleToasts = [ + { id: "a", height: 48 }, + { id: "b", height: 72, transitionStatus: "ending" as const }, + { id: "c", height: 24 }, + ]; + + const layout = buildVisibleToastLayout(visibleToasts); + + // front toast stays, so frontmost height is unchanged + assert.equal(layout.frontmostHeight, 48); + assert.deepEqual( + layout.items.map(({ toast, visibleIndex, offsetY }) => ({ + id: toast.id, + visibleIndex, + offsetY, + })), + [ + // Front live toast — unaffected + { id: "a", visibleIndex: 0, offsetY: 0 }, + // Ending toast keeps its pre-dismissal slot so its horizontal exit + // originates from where the user saw it (not from Y=0). + { id: "b", visibleIndex: 1, offsetY: 48 }, + // Live toast behind "b" slides forward into the vacated slot. + { id: "c", visibleIndex: 1, offsetY: 48 }, + ], + ); + }); + it("treats missing heights as zero", () => { const layout = buildVisibleToastLayout([ { id: "a" }, diff --git a/apps/web/src/components/ui/toast.logic.ts b/apps/web/src/components/ui/toast.logic.ts index 09905a7a670..c7c196efd8c 100644 --- a/apps/web/src/components/ui/toast.logic.ts +++ b/apps/web/src/components/ui/toast.logic.ts @@ -14,6 +14,12 @@ type ToastWithHeight = { height?: number | null | undefined; }; +type ToastWithTransitionStatus = { + transitionStatus?: "starting" | "ending" | undefined; +}; + +type ToastWithLayoutProps = ToastWithHeight & ToastWithTransitionStatus; + type VisibleToastLayoutItem = { toast: TToast; visibleIndex: number; @@ -21,25 +27,64 @@ type VisibleToastLayoutItem = { }; export function buildVisibleToastLayout( - visibleToasts: readonly (TToast & ToastWithHeight)[], + visibleToasts: readonly (TToast & ToastWithLayoutProps)[], ): { frontmostHeight: number; - items: VisibleToastLayoutItem[]; + items: VisibleToastLayoutItem[]; } { - let offsetY = 0; + // Two parallel cursors: + // - `full*` advances on every toast, so an ending toast keeps the slot it + // occupied before dismissal and its data-ending-style exit transform + // originates from the correct position (critical for dismissing a + // non-front toast in the expanded stack — otherwise it would snap to + // Y=0 and slide off diagonally). + // - `live*` advances only on non-ending toasts, so live toasts reflow + // past the vacated slot in parallel with the exit animation instead of + // waiting for it to finish (which caused a visible "stop and bump"). + let fullIndex = 0; + let fullOffsetY = 0; + let liveIndex = 0; + let liveOffsetY = 0; + + const items: VisibleToastLayoutItem[] = visibleToasts.map( + (toast) => { + const height = normalizeToastHeight(toast.height); + + if (toast.transitionStatus === "ending") { + const item = { + toast, + visibleIndex: fullIndex, + offsetY: fullOffsetY, + }; + fullOffsetY += height; + fullIndex += 1; + return item; + } - return { - frontmostHeight: normalizeToastHeight(visibleToasts[0]?.height), - items: visibleToasts.map((toast, visibleIndex) => { const item = { toast, - visibleIndex, - offsetY, + visibleIndex: liveIndex, + offsetY: liveOffsetY, }; - offsetY += normalizeToastHeight(toast.height); + fullOffsetY += height; + fullIndex += 1; + liveOffsetY += height; + liveIndex += 1; return item; - }), + }, + ); + + // Frontmost height should reflect the first non-ending (live) toast so the + // stack sizes to what's actually staying on screen. While the last visible + // toast is exiting, fall back to it so the stack doesn't collapse to 0 + // before the exit animation finishes. + const frontmostToast = + visibleToasts.find((toast) => toast.transitionStatus !== "ending") ?? visibleToasts[0]; + + return { + frontmostHeight: normalizeToastHeight(frontmostToast?.height), + items, }; } diff --git a/apps/web/src/components/ui/toast.tsx b/apps/web/src/components/ui/toast.tsx index cb3a617b15b..81c891cd37d 100644 --- a/apps/web/src/components/ui/toast.tsx +++ b/apps/web/src/components/ui/toast.tsx @@ -1,17 +1,27 @@ "use client"; import { Toast } from "@base-ui/react/toast"; -import { useEffect, useMemo, type CSSProperties } from "react"; +import { + useEffect, + useMemo, + useState, + type CSSProperties, + type KeyboardEvent, + type ReactNode, +} from "react"; import { useParams } from "@tanstack/react-router"; import { type ScopedThreadRef, type ThreadId } from "@t3tools/contracts"; import { CheckIcon, + ChevronDownIcon, + ChevronUpIcon, CircleAlertIcon, CircleCheckIcon, CopyIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon, + XIcon, } from "lucide-react"; import { cn } from "~/lib/utils"; @@ -31,6 +41,11 @@ export type ThreadToastData = { tooltipStyle?: boolean; dismissAfterVisibleMs?: number; hideCopyButton?: boolean; + /** Optional extra body shown after toggling “Show details” (e.g. a list of pending RPCs). */ + expandableContent?: ReactNode; + expandableLabels?: { expand?: string; collapse?: string }; + /** When set with `expandableContent`, the summary + label act as one text disclosure (no separate chevron row). */ + expandableDescriptionTrigger?: boolean; actionLayout?: "inline" | "stacked-end"; actionVariant?: | "default" @@ -55,26 +70,266 @@ const TOAST_ICONS = { warning: TriangleAlertIcon, } as const; +/** Visually shorten long error bodies; clipboard copy still uses the full `description` string. */ +const ERROR_DESCRIPTION_CLAMP_MIN_CHARS = 180; +function errorDescriptionClampClass(type: unknown, description: unknown): string | undefined { + if (type !== "error" || typeof description !== "string") { + return undefined; + } + if (description.length < ERROR_DESCRIPTION_CLAMP_MIN_CHARS) { + return undefined; + } + return "line-clamp-4"; +} + +/** Dismiss-only: circular control overlapping the card corner (iOS notification–style). */ +const toastCornerDismissClass = "absolute z-20 -top-1.5 -right-1.5"; +const toastCornerOrbClass = cn( + "inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-popover/92 text-muted-foreground shadow-sm outline-none backdrop-blur-sm", + "transition-[color,background-color,box-shadow] hover:bg-popover hover:text-foreground", + "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background", +); + function CopyErrorButton({ text }: { text: string }) { const { copyToClipboard, isCopied } = useCopyToClipboard(); return ( copyToClipboard(text)} title="Copy error" aria-label={isCopied ? "Copied" : "Copy error"} type="button" > - {isCopied ? ( - - ) : ( - - )} + {isCopied ? : } ); } +/** Scrollable cap for long expandable lists (~10rem); keeps the toast from growing without bound. */ +const toastExpandablePanelClassName = + "mt-2 max-h-40 min-h-0 overflow-y-auto overscroll-contain pr-0.5 select-text"; + +function ToastExpandableSection({ + children, + labels, +}: { + children: ReactNode; + labels: { expand?: string; collapse?: string }; +}) { + const [open, setOpen] = useState(false); + const expandLabel = labels.expand ?? "Show details"; + const collapseLabel = labels.collapse ?? "Hide details"; + + return ( + + setOpen((prev) => !prev)} + type="button" + > + {open ? ( + + ) : ( + + )} + {open ? collapseLabel : expandLabel} + + {open ? {children} : null} + + ); +} + +function ToastDescriptionAndExpandable({ + toastData, + toastDescription, + toastType, +}: { + toastData: ThreadToastData | undefined; + toastDescription: unknown; + toastType: unknown; +}) { + const expandableContent = toastData?.expandableContent; + const labels = toastData?.expandableLabels ?? {}; + const descriptionTrigger = toastData?.expandableDescriptionTrigger ?? false; + const descriptionClassName = cn( + "min-w-0 select-text wrap-break-word text-muted-foreground", + errorDescriptionClampClass(toastType, toastDescription), + ); + const [open, setOpen] = useState(false); + + if (!expandableContent) { + return ; + } + + if (!descriptionTrigger) { + return ( + <> + + {expandableContent} + > + ); + } + + const expandLabel = labels.expand ?? "Show details"; + const collapseLabel = labels.collapse ?? "Hide details"; + + const toggle = () => setOpen((v) => !v); + const onKeyDown = (event: KeyboardEvent) => { + if (event.key === "Enter" || event.key === " ") { + event.preventDefault(); + toggle(); + } + }; + + return ( + <> + + + + + {open ? ( + + ) : ( + + )} + + {open ? {expandableContent} : null} + > + ); +} + +type ToastIconComponent = (typeof TOAST_ICONS)[keyof typeof TOAST_ICONS]; + +interface ToastBodyDescriptor { + readonly Icon: ToastIconComponent | null | undefined; + readonly stackedActionLayout: boolean; + readonly actionVariant: NonNullable; + readonly copyErrorText: string | null; + readonly hasTrailingControls: boolean; + readonly inlineContentEndPad: string; +} + +function deriveToastBodyDescriptor(toast: { + readonly type?: string | undefined; + readonly description?: unknown; + readonly actionProps?: unknown; + readonly data?: ThreadToastData | undefined; +}): ToastBodyDescriptor { + const Icon = toast.type ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS] : null; + const stackedActionLayout = + toast.actionProps !== undefined && toast.data?.actionLayout === "stacked-end"; + const actionVariant: NonNullable = + toast.data?.actionVariant ?? "default"; + const copyErrorText = + toast.type === "error" && typeof toast.description === "string" && !toast.data?.hideCopyButton + ? toast.description + : null; + const hasTrailingControls = copyErrorText !== null || toast.actionProps !== undefined; + const inlineContentEndPad = hasTrailingControls ? "pr-6" : "pr-10"; + return { + Icon, + stackedActionLayout, + actionVariant, + copyErrorText, + hasTrailingControls, + inlineContentEndPad, + }; +} + +interface ToastBodyContentProps extends ToastBodyDescriptor { + readonly actionProps: { readonly children?: ReactNode } | undefined; + readonly toastData: ThreadToastData | undefined; + readonly toastDescription: unknown; + readonly toastType: unknown; +} + +function ToastBodyContent({ + stackedActionLayout, + Icon, + copyErrorText, + actionProps, + actionVariant, + hasTrailingControls, + toastData, + toastDescription, + toastType, +}: ToastBodyContentProps) { + return ( + <> + + {Icon && ( + + + + )} + + + + + + {hasTrailingControls ? ( + + {copyErrorText !== null ? : null} + {actionProps ? ( + + {actionProps.children} + + ) : null} + + ) : null} + > + ); +} + type ToastPosition = | "top-left" | "top-center" @@ -237,19 +492,17 @@ function Toasts({ position = "top-right" }: { position: ToastPosition }) { } > {visibleToastLayout.items.map(({ toast, visibleIndex, offsetY }) => { - const Icon = toast.type ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS] : null; const hideCollapsedContent = shouldHideCollapsedToastContent( visibleIndex, visibleToastLayout.items.length, ); - const stackedActionLayout = - toast.actionProps !== undefined && toast.data?.actionLayout === "stacked-end"; - const actionVariant = toast.data?.actionVariant ?? "default"; + const bodyDescriptor = deriveToastBodyDescriptor(toast); + const { stackedActionLayout, inlineContentEndPad } = bodyDescriptor; return ( 0 + ? "not-data-expanded:[--toast-calc-height:var(--toast-frontmost-height)] data-expanded:[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]" + : "[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]", + "[--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]", + // Root height: never `min-h-(--toast-height)` — Base UI measures height by briefly forcing + // `height: auto` on this node; an old `min-height` from `--toast-height` blocks shrinking, + // so `recalculateHeight` keeps the inflated value after an expandable closes. + // Behind + collapsed: fixed peek. Otherwise natural height (expand/collapse, hover stack). + visibleIndex > 0 + ? "not-data-expanded:h-(--toast-calc-height) data-expanded:h-auto" + : "h-auto", // Define offset-y variable "data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]", "data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]", @@ -273,8 +534,7 @@ function Toasts({ position = "top-right" }: { position: ToastPosition }) { "data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]", // Limited state "data-limited:opacity-0", - // Expanded state - "data-expanded:h-(--toast-height)", + // Expanded stack "data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]", // Starting and ending animations "data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]", @@ -315,54 +575,42 @@ function Toasts({ position = "top-right" }: { position: ToastPosition }) { dismissAfterVisibleMs={toast.data?.dismissAfterVisibleMs} toastId={toast.id} /> + + toastManager.close(toast.id)} + type="button" + > + + + - - {Icon && ( - - - - )} - - - - - {toast.type === "error" && - typeof toast.description === "string" && - !toast.data?.hideCopyButton && } - - - - - {toast.actionProps && ( - - {toast.actionProps.children} - - )} + ); @@ -391,12 +639,10 @@ function AnchoredToasts() { {toasts .filter((toast) => shouldRenderThreadScopedToast(toast.data, activeThreadRef)) .map((toast) => { - const Icon = toast.type ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS] : null; const tooltipStyle = toast.data?.tooltipStyle ?? false; const positionerProps = toast.positionerProps; - const stackedActionLayout = - toast.actionProps !== undefined && toast.data?.actionLayout === "stacked-end"; - const actionVariant = toast.data?.actionVariant ?? "default"; + const bodyDescriptor = deriveToastBodyDescriptor(toast); + const { stackedActionLayout, inlineContentEndPad } = bodyDescriptor; if (!positionerProps?.anchor) { return null; @@ -412,7 +658,7 @@ function AnchoredToasts() { > ) : ( - - - {Icon && ( - - - - )} - - - - - {toast.type === "error" && - typeof toast.description === "string" && - !toast.data?.hideCopyButton && ( - - )} - - - - - {toast.actionProps && ( - + + anchoredToastManager.close(toast.id)} + type="button" > - {toast.actionProps.children} - - )} - + + + + + + + > )} @@ -484,6 +714,9 @@ function AnchoredToasts() { ); } +export { stackedThreadToast } from "./toastHelpers"; +export type { StackedThreadToastOptions } from "./toastHelpers"; + export { ToastProvider, type ToastPosition, diff --git a/apps/web/src/components/ui/toastHelpers.ts b/apps/web/src/components/ui/toastHelpers.ts new file mode 100644 index 00000000000..4ec5d14106c --- /dev/null +++ b/apps/web/src/components/ui/toastHelpers.ts @@ -0,0 +1,58 @@ +"use client"; + +import type { ToastManagerAddOptions } from "@base-ui/react/toast"; +import type { ComponentPropsWithoutRef, ReactNode } from "react"; + +import type { ThreadToastData } from "./toast"; + +export type StackedThreadToastOptions = { + type: "error" | "warning" | "success" | "info" | "loading"; + title: ReactNode; + description?: ReactNode; + timeout?: number; + priority?: "low" | "high"; + actionProps?: ComponentPropsWithoutRef<"button">; + /** Merged into `data`; `actionLayout` is always forced to `"stacked-end"` by the helper. */ + actionVariant?: ThreadToastData["actionVariant"]; + data?: Omit; +}; + +/** + * Thread toast using the stacked body + bottom action row (copy for errors, CTA on its own row). + */ +export function stackedThreadToast( + options: StackedThreadToastOptions, +): ToastManagerAddOptions { + const { type, title, description, timeout, priority, actionProps, actionVariant, data } = options; + + // Helper-owned `actionLayout` must win over any caller-provided `data`, so spread + // the caller's data first and apply `actionLayout: "stacked-end"` last. + const mergedData: ThreadToastData = { + ...(data !== undefined ? data : {}), + actionLayout: "stacked-end", + }; + if (actionVariant !== undefined) { + mergedData.actionVariant = actionVariant; + } + + const payload: ToastManagerAddOptions = { + type, + title, + data: mergedData, + }; + + if (description !== undefined) { + payload.description = description; + } + if (timeout !== undefined) { + payload.timeout = timeout; + } + if (priority !== undefined) { + payload.priority = priority; + } + if (actionProps !== undefined) { + payload.actionProps = actionProps; + } + + return payload; +} diff --git a/apps/web/src/environments/runtime/service.test.ts b/apps/web/src/environments/runtime/service.test.ts index 7a4af404980..40ec455adc1 100644 --- a/apps/web/src/environments/runtime/service.test.ts +++ b/apps/web/src/environments/runtime/service.test.ts @@ -1,6 +1,10 @@ import { describe, expect, it } from "vitest"; -import { shouldApplyTerminalEvent } from "./service"; +import { + shouldApplyProjectionEvent, + shouldApplyProjectionSnapshot, + shouldApplyTerminalEvent, +} from "./service"; describe("shouldApplyTerminalEvent", () => { it("applies terminal events for draft-only threads", () => { @@ -39,3 +43,106 @@ describe("shouldApplyTerminalEvent", () => { ).toBe(true); }); }); + +describe("shouldApplyProjectionSnapshot", () => { + it("accepts the first snapshot for an environment", () => { + expect( + shouldApplyProjectionSnapshot({ + current: null, + next: { + snapshotSequence: 1, + updatedAt: "2026-04-22T10:00:00.000Z", + }, + }), + ).toBe(true); + }); + + it("drops snapshots with an older sequence", () => { + expect( + shouldApplyProjectionSnapshot({ + current: { + sequence: 5, + updatedAt: "2026-04-22T10:05:00.000Z", + }, + next: { + snapshotSequence: 4, + updatedAt: "2026-04-22T10:06:00.000Z", + }, + }), + ).toBe(false); + }); + + it("drops snapshots with the same sequence and older timestamp", () => { + expect( + shouldApplyProjectionSnapshot({ + current: { + sequence: 5, + updatedAt: "2026-04-22T10:05:00.000Z", + }, + next: { + snapshotSequence: 5, + updatedAt: "2026-04-22T10:04:59.000Z", + }, + }), + ).toBe(false); + }); + + it("accepts snapshots with the same sequence and a newer timestamp", () => { + expect( + shouldApplyProjectionSnapshot({ + current: { + sequence: 5, + updatedAt: "2026-04-22T10:05:00.000Z", + }, + next: { + snapshotSequence: 5, + updatedAt: "2026-04-22T10:05:01.000Z", + }, + }), + ).toBe(true); + }); +}); + +describe("shouldApplyProjectionEvent", () => { + it("accepts the first event for an environment", () => { + expect( + shouldApplyProjectionEvent({ + current: null, + sequence: 1, + }), + ).toBe(true); + }); + + it("drops stale or duplicate events", () => { + expect( + shouldApplyProjectionEvent({ + current: { + sequence: 5, + updatedAt: "2026-04-22T10:05:00.000Z", + }, + sequence: 5, + }), + ).toBe(false); + expect( + shouldApplyProjectionEvent({ + current: { + sequence: 5, + updatedAt: "2026-04-22T10:05:00.000Z", + }, + sequence: 4, + }), + ).toBe(false); + }); + + it("accepts newer events", () => { + expect( + shouldApplyProjectionEvent({ + current: { + sequence: 5, + updatedAt: "2026-04-22T10:05:00.000Z", + }, + sequence: 6, + }), + ).toBe(true); + }); +}); diff --git a/apps/web/src/environments/runtime/service.ts b/apps/web/src/environments/runtime/service.ts index 726cd4de36d..9dae1b15856 100644 --- a/apps/web/src/environments/runtime/service.ts +++ b/apps/web/src/environments/runtime/service.ts @@ -87,6 +87,13 @@ type ThreadDetailSubscriptionEntry = { const environmentConnections = new Map(); const environmentConnectionListeners = new Set<() => void>(); const threadDetailSubscriptions = new Map(); +const lastAppliedProjectionVersionByEnvironment = new Map< + EnvironmentId, + { + readonly sequence: number; + readonly updatedAt: string | null; + } +>(); let activeService: EnvironmentServiceState | null = null; let needsProviderInvalidation = false; @@ -102,6 +109,98 @@ const THREAD_DETAIL_SUBSCRIPTION_IDLE_EVICTION_MS = 15 * 60 * 1000; const MAX_CACHED_THREAD_DETAIL_SUBSCRIPTIONS = 32; const NOOP = () => undefined; +function compareAppliedProjectionVersion( + left: { readonly sequence: number; readonly updatedAt: string | null }, + right: { readonly sequence: number; readonly updatedAt: string | null }, +): number { + if (left.sequence !== right.sequence) { + return left.sequence - right.sequence; + } + + const leftUpdatedAt = left.updatedAt ?? ""; + const rightUpdatedAt = right.updatedAt ?? ""; + if (leftUpdatedAt === rightUpdatedAt) { + return 0; + } + + return leftUpdatedAt < rightUpdatedAt ? -1 : 1; +} + +function toAppliedProjectionVersion( + snapshot: Pick, +): { + readonly sequence: number; + readonly updatedAt: string; +} { + return { + sequence: snapshot.snapshotSequence, + updatedAt: snapshot.updatedAt, + }; +} + +export function shouldApplyProjectionSnapshot(input: { + readonly current: { + readonly sequence: number; + readonly updatedAt: string | null; + } | null; + readonly next: Pick; +}): boolean { + if (input.current === null) { + return true; + } + + return compareAppliedProjectionVersion(input.current, toAppliedProjectionVersion(input.next)) < 0; +} + +export function shouldApplyProjectionEvent(input: { + readonly current: { + readonly sequence: number; + readonly updatedAt: string | null; + } | null; + readonly sequence: number; +}): boolean { + if (input.current === null) { + return true; + } + + return input.sequence > input.current.sequence; +} + +function readLastAppliedProjectionVersion(environmentId: EnvironmentId): { + readonly sequence: number; + readonly updatedAt: string | null; +} | null { + return lastAppliedProjectionVersionByEnvironment.get(environmentId) ?? null; +} + +function markAppliedProjectionSnapshot( + environmentId: EnvironmentId, + snapshot: Pick, +): void { + const nextVersion = toAppliedProjectionVersion(snapshot); + const currentVersion = readLastAppliedProjectionVersion(environmentId); + if ( + currentVersion !== null && + compareAppliedProjectionVersion(currentVersion, nextVersion) >= 0 + ) { + return; + } + + lastAppliedProjectionVersionByEnvironment.set(environmentId, nextVersion); +} + +function markAppliedProjectionEvent(environmentId: EnvironmentId, sequence: number): void { + const currentVersion = readLastAppliedProjectionVersion(environmentId); + if (currentVersion !== null && sequence <= currentVersion.sequence) { + return; + } + + lastAppliedProjectionVersionByEnvironment.set(environmentId, { + sequence, + updatedAt: currentVersion?.updatedAt ?? null, + }); +} + function getThreadDetailSubscriptionKey(environmentId: EnvironmentId, threadId: ThreadId): string { return scopedThreadKey(scopeThreadRef(environmentId, threadId)); } @@ -600,6 +699,15 @@ export function applyEnvironmentThreadDetailEvent( } function applyShellEvent(event: OrchestrationShellStreamEvent, environmentId: EnvironmentId) { + if ( + !shouldApplyProjectionEvent({ + current: readLastAppliedProjectionVersion(environmentId), + sequence: event.sequence, + }) + ) { + return; + } + const threadId = event.kind === "thread-upserted" ? event.thread.id @@ -610,6 +718,7 @@ function applyShellEvent(event: OrchestrationShellStreamEvent, environmentId: En const previousThread = threadRef ? selectThreadByRef(useStore.getState(), threadRef) : undefined; useStore.getState().applyShellEvent(event, environmentId); + markAppliedProjectionEvent(environmentId, event.sequence); switch (event.kind) { case "project-upserted": @@ -643,7 +752,17 @@ function createEnvironmentConnectionHandlers() { return { applyShellEvent, syncShellSnapshot: (snapshot: OrchestrationShellSnapshot, environmentId: EnvironmentId) => { + if ( + !shouldApplyProjectionSnapshot({ + current: readLastAppliedProjectionVersion(environmentId), + next: snapshot, + }) + ) { + return; + } + useStore.getState().syncServerShellSnapshot(snapshot, environmentId); + markAppliedProjectionSnapshot(environmentId, snapshot); reconcileThreadDetailSubscriptionsForEnvironment( environmentId, snapshot.threads.map((thread) => thread.id), @@ -758,6 +877,7 @@ async function removeConnection(environmentId: EnvironmentId): Promise } disposeThreadDetailSubscriptionsForEnvironment(environmentId); + lastAppliedProjectionVersionByEnvironment.delete(environmentId); environmentConnections.delete(environmentId); emitEnvironmentConnectionRegistryChange(); await connection.dispose(); @@ -1086,6 +1206,7 @@ export function startEnvironmentConnectionService(queryClient: QueryClient): () export async function resetEnvironmentServiceForTests(): Promise { stopActiveService(); + lastAppliedProjectionVersionByEnvironment.clear(); for (const key of Array.from(threadDetailSubscriptions.keys())) { disposeThreadDetailSubscriptionByKey(key); } diff --git a/apps/web/src/hooks/useThreadActions.ts b/apps/web/src/hooks/useThreadActions.ts index 60b1be85a70..de60ffb18dc 100644 --- a/apps/web/src/hooks/useThreadActions.ts +++ b/apps/web/src/hooks/useThreadActions.ts @@ -20,7 +20,7 @@ import { import { useTerminalStateStore } from "../terminalStateStore"; import { buildThreadRouteParams, resolveThreadRouteRef } from "../threadRoutes"; import { formatWorktreePathForDisplay, getOrphanedWorktreePathForThread } from "../worktreeCleanup"; -import { toastManager } from "../components/ui/toast"; +import { stackedThreadToast, toastManager } from "../components/ui/toast"; import { useSettings } from "./useSettings"; export function useThreadActions() { @@ -225,11 +225,13 @@ export function useThreadActions() { worktreePath: orphanedWorktreePath, error, }); - toastManager.add({ - type: "error", - title: "Thread deleted, but worktree removal failed", - description: `Could not remove ${displayWorktreePath ?? orphanedWorktreePath}. ${message}`, - }); + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Thread deleted, but worktree removal failed", + description: `Could not remove ${displayWorktreePath ?? orphanedWorktreePath}. ${message}`, + }), + ); } }, [ diff --git a/apps/web/src/localApi.test.ts b/apps/web/src/localApi.test.ts index 0da8f4771c7..4918728afd1 100644 --- a/apps/web/src/localApi.test.ts +++ b/apps/web/src/localApi.test.ts @@ -533,6 +533,7 @@ describe("wsApi", () => { it("reads and writes persistence through the desktop bridge when available", async () => { const clientSettings = { + autoOpenPlanSidebar: false, confirmThreadArchive: true, confirmThreadDelete: false, diffWordWrap: true, @@ -591,6 +592,7 @@ describe("wsApi", () => { const { createLocalApi } = await import("./localApi"); const api = createLocalApi(rpcClientMock as never); const clientSettings = { + autoOpenPlanSidebar: false, confirmThreadArchive: true, confirmThreadDelete: false, diffWordWrap: true, diff --git a/apps/web/src/providerModels.ts b/apps/web/src/providerModels.ts index 5f1c6ba6155..f94b344e669 100644 --- a/apps/web/src/providerModels.ts +++ b/apps/web/src/providerModels.ts @@ -1,6 +1,5 @@ import { DEFAULT_MODEL_BY_PROVIDER, - type CursorModelOptions, type ModelCapabilities, type ProviderKind, type ServerProvider, @@ -14,6 +13,14 @@ import { trimOrNull, } from "@t3tools/shared/model"; +export function formatProviderKindLabel(provider: ProviderKind): string { + return provider + .replace(/([a-z])([A-Z])/g, "$1 $2") + .replace(/[_-]+/g, " ") + .trim() + .replace(/\b\w/g, (char) => char.toUpperCase()); +} + export function getProviderModels( providers: ReadonlyArray, provider: ProviderKind, @@ -28,6 +35,21 @@ export function getProviderSnapshot( return providers.find((candidate) => candidate.provider === provider); } +export function getProviderDisplayName( + providers: ReadonlyArray, + provider: ProviderKind, +): string { + const snapshot = getProviderSnapshot(providers, provider); + return snapshot?.displayName?.trim() || formatProviderKindLabel(provider); +} + +export function getProviderInteractionModeToggle( + providers: ReadonlyArray, + provider: ProviderKind, +): boolean { + return getProviderSnapshot(providers, provider)?.showInteractionModeToggle ?? true; +} + export function isProviderEnabled( providers: ReadonlyArray, provider: ProviderKind, @@ -71,30 +93,3 @@ export function getDefaultServerModel( DEFAULT_MODEL_BY_PROVIDER[provider] ); } - -export function normalizeCursorModelOptionsWithCapabilities( - caps: ModelCapabilities, - modelOptions: CursorModelOptions | null | undefined, -): CursorModelOptions | undefined { - const reasoning = trimOrNull(modelOptions?.reasoning); - const reasoningValue = - reasoning && hasEffortLevel(caps, reasoning) - ? (reasoning as CursorModelOptions["reasoning"]) - : undefined; - const fastMode = - caps.supportsFastMode && typeof modelOptions?.fastMode === "boolean" - ? modelOptions.fastMode - : undefined; - const thinking = - caps.supportsThinkingToggle && typeof modelOptions?.thinking === "boolean" - ? modelOptions.thinking - : undefined; - const contextWindow = resolveContextWindow(caps, modelOptions?.contextWindow); - const nextOptions: CursorModelOptions = { - ...(reasoningValue ? { reasoning: reasoningValue } : {}), - ...(fastMode !== undefined ? { fastMode } : {}), - ...(thinking !== undefined ? { thinking } : {}), - ...(contextWindow ? { contextWindow } : {}), - }; - return Object.keys(nextOptions).length > 0 ? nextOptions : undefined; -} diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx index 0f8741280d1..acfa9c5ce2a 100644 --- a/apps/web/src/routes/__root.tsx +++ b/apps/web/src/routes/__root.tsx @@ -19,7 +19,12 @@ import { WebSocketConnectionSurface, } from "../components/WebSocketConnectionSurface"; import { Button } from "../components/ui/button"; -import { AnchoredToastProvider, ToastProvider, toastManager } from "../components/ui/toast"; +import { + AnchoredToastProvider, + stackedThreadToast, + ToastProvider, + toastManager, +} from "../components/ui/toast"; import { resolveAndPersistPreferredEditor } from "../editorPreferences"; import { readLocalApi } from "../localApi"; import { useSettings } from "../hooks/useSettings"; @@ -292,37 +297,42 @@ function EventRouter() { return; } - toastManager.add({ - type: "warning", - title: "Invalid keybindings configuration", - description: issue.message, - actionProps: { - children: "Open keybindings.json", - onClick: () => { - const api = readLocalApi(); - if (!api) { - return; - } - - void Promise.resolve(serverConfig ?? api.server.getConfig()) - .then((config) => { - const editor = resolveAndPersistPreferredEditor(config.availableEditors); - if (!editor) { - throw new Error("No available editors found."); - } - return api.shell.openInEditor(config.keybindingsConfigPath, editor); - }) - .catch((error) => { - toastManager.add({ - type: "error", - title: "Unable to open keybindings file", - description: - error instanceof Error ? error.message : "Unknown error opening file.", + toastManager.add( + stackedThreadToast({ + type: "warning", + title: "Invalid keybindings configuration", + description: issue.message, + actionVariant: "outline", + actionProps: { + children: "Open keybindings.json", + onClick: () => { + const api = readLocalApi(); + if (!api) { + return; + } + + void Promise.resolve(serverConfig ?? api.server.getConfig()) + .then((config) => { + const editor = resolveAndPersistPreferredEditor(config.availableEditors); + if (!editor) { + throw new Error("No available editors found."); + } + return api.shell.openInEditor(config.keybindingsConfigPath, editor); + }) + .catch((error) => { + toastManager.add( + stackedThreadToast({ + type: "error", + title: "Unable to open keybindings file", + description: + error instanceof Error ? error.message : "Unknown error opening file.", + }), + ); }); - }); + }, }, - }, - }); + }), + ); }, ); diff --git a/apps/web/src/rpc/requestLatencyState.ts b/apps/web/src/rpc/requestLatencyState.ts index d21e37b5298..950e907e865 100644 --- a/apps/web/src/rpc/requestLatencyState.ts +++ b/apps/web/src/rpc/requestLatencyState.ts @@ -36,7 +36,11 @@ function getSlowRpcAckRequestsValue(): ReadonlyArray { } function shouldTrackRpcAck(tag: string): boolean { - return !tag.startsWith("subscribe"); + // Skip subscribe RPCs (they are long-lived streams and the ack arrives much + // later than the user-visible payload). Match `subscribe` at the start of + // the tag or after a path-segment delimiter so `thread/unsubscribe` and + // similar still get tracked. + return !/(?:^|[./:])subscribe/i.test(tag); } export function getSlowRpcAckRequests(): ReadonlyArray { diff --git a/apps/web/src/session-logic.ts b/apps/web/src/session-logic.ts index 1970d4e3501..f629a8af29b 100644 --- a/apps/web/src/session-logic.ts +++ b/apps/web/src/session-logic.ts @@ -174,6 +174,7 @@ function requestKindFromRequestType(requestType: unknown): PendingApproval["requ switch (requestType) { case "command_execution_approval": case "exec_command_approval": + case "dynamic_tool_call": return "command"; case "file_read_approval": return "file-read"; diff --git a/bun.lock b/bun.lock index c4f7a534cec..aa4be4d7cd8 100644 --- a/bun.lock +++ b/bun.lock @@ -17,7 +17,7 @@ }, "apps/desktop": { "name": "@t3tools/desktop", - "version": "0.0.20", + "version": "0.0.21", "dependencies": { "effect": "catalog:", "electron": "40.8.5", @@ -46,7 +46,7 @@ }, "apps/server": { "name": "t3", - "version": "0.0.20", + "version": "0.0.21", "bin": { "t3": "./dist/bin.mjs", }, @@ -80,7 +80,7 @@ }, "apps/web": { "name": "@t3tools/web", - "version": "0.0.20", + "version": "0.0.21", "dependencies": { "@base-ui/react": "^1.2.0", "@dnd-kit/core": "^6.3.1", @@ -146,7 +146,7 @@ }, "packages/contracts": { "name": "@t3tools/contracts", - "version": "0.0.20", + "version": "0.0.21", "dependencies": { "effect": "catalog:", }, diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 8b499267f66..0e436d64d5e 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -1,6 +1,6 @@ { "name": "@t3tools/contracts", - "version": "0.0.20", + "version": "0.0.21", "private": true, "files": [ "dist" diff --git a/packages/contracts/src/server.ts b/packages/contracts/src/server.ts index 3cd25f2e8e9..1f048c13407 100644 --- a/packages/contracts/src/server.ts +++ b/packages/contracts/src/server.ts @@ -85,6 +85,9 @@ export type ServerProviderSkill = typeof ServerProviderSkill.Type; export const ServerProvider = Schema.Struct({ provider: ProviderKind, + displayName: Schema.optional(TrimmedNonEmptyString), + badgeLabel: Schema.optional(TrimmedNonEmptyString), + showInteractionModeToggle: Schema.optional(Schema.Boolean), enabled: Schema.Boolean, installed: Schema.Boolean, version: Schema.NullOr(TrimmedNonEmptyString), diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts index 1e43158c3c4..cc48d739384 100644 --- a/packages/contracts/src/settings.ts +++ b/packages/contracts/src/settings.ts @@ -38,6 +38,7 @@ export type SidebarProjectGroupingMode = typeof SidebarProjectGroupingMode.Type; export const DEFAULT_SIDEBAR_PROJECT_GROUPING_MODE: SidebarProjectGroupingMode = "repository"; export const ClientSettingsSchema = Schema.Struct({ + autoOpenPlanSidebar: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), confirmThreadArchive: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), confirmThreadDelete: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), diffWordWrap: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), @@ -334,6 +335,7 @@ export const ServerSettingsPatch = Schema.Struct({ export type ServerSettingsPatch = typeof ServerSettingsPatch.Type; export const ClientSettingsPatch = Schema.Struct({ + autoOpenPlanSidebar: Schema.optionalKey(Schema.Boolean), confirmThreadArchive: Schema.optionalKey(Schema.Boolean), confirmThreadDelete: Schema.optionalKey(Schema.Boolean), diffWordWrap: Schema.optionalKey(Schema.Boolean), diff --git a/packages/effect-codex-app-server/scripts/generate.ts b/packages/effect-codex-app-server/scripts/generate.ts index 5f0991c39f0..54ce0866f13 100644 --- a/packages/effect-codex-app-server/scripts/generate.ts +++ b/packages/effect-codex-app-server/scripts/generate.ts @@ -6,7 +6,7 @@ import { make as makeJsonSchemaGenerator } from "@effect/openapi-generator/JsonS import { Effect, FileSystem, Layer, Logger, Path, Schema } from "effect"; import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; -const UPSTREAM_REF = "dbfe855f4fd0f5dcdf079882652a8efe622b0595"; +const UPSTREAM_REF = "be75785504ff152fa6333e380a2d50642f42fba0"; const USER_AGENT = "effect-codex-app-server-generator"; const GITHUB_API_BASE = "https://api.github.com/repos/openai/codex/contents/codex-rs/app-server-protocol"; 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 d0b73764957..1afa46859ef 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: dbfe855f4fd0f5dcdf079882652a8efe622b0595 +// Upstream protocol ref: be75785504ff152fa6333e380a2d50642f42fba0 import * as CodexSchema from "./schema.gen.ts"; @@ -19,10 +19,17 @@ export const CLIENT_REQUEST_METHODS = { "thread/list": "thread/list", "thread/loaded/list": "thread/loaded/list", "thread/read": "thread/read", + "thread/turns/list": "thread/turns/list", + "thread/inject_items": "thread/inject_items", "skills/list": "skills/list", + "marketplace/add": "marketplace/add", + "marketplace/remove": "marketplace/remove", "plugin/list": "plugin/list", "plugin/read": "plugin/read", "app/list": "app/list", + "device/key/create": "device/key/create", + "device/key/public": "device/key/public", + "device/key/sign": "device/key/sign", "fs/readFile": "fs/readFile", "fs/writeFile": "fs/writeFile", "fs/createDirectory": "fs/createDirectory", @@ -52,6 +59,7 @@ export const CLIENT_REQUEST_METHODS = { "account/login/cancel": "account/login/cancel", "account/logout": "account/logout", "account/rateLimits/read": "account/rateLimits/read", + "account/sendAddCreditsNudgeEmail": "account/sendAddCreditsNudgeEmail", "feedback/upload": "feedback/upload", "command/exec": "command/exec", "command/exec/write": "command/exec/write", @@ -113,6 +121,7 @@ export const SERVER_NOTIFICATION_METHODS = { "item/commandExecution/outputDelta": "item/commandExecution/outputDelta", "item/commandExecution/terminalInteraction": "item/commandExecution/terminalInteraction", "item/fileChange/outputDelta": "item/fileChange/outputDelta", + "item/fileChange/patchUpdated": "item/fileChange/patchUpdated", "serverRequest/resolved": "serverRequest/resolved", "item/mcpToolCall/progress": "item/mcpToolCall/progress", "mcpServer/oauthLogin/completed": "mcpServer/oauthLogin/completed", @@ -120,19 +129,22 @@ export const SERVER_NOTIFICATION_METHODS = { "account/updated": "account/updated", "account/rateLimits/updated": "account/rateLimits/updated", "app/list/updated": "app/list/updated", + "externalAgentConfig/import/completed": "externalAgentConfig/import/completed", "fs/changed": "fs/changed", "item/reasoning/summaryTextDelta": "item/reasoning/summaryTextDelta", "item/reasoning/summaryPartAdded": "item/reasoning/summaryPartAdded", "item/reasoning/textDelta": "item/reasoning/textDelta", "thread/compacted": "thread/compacted", "model/rerouted": "model/rerouted", + warning: "warning", deprecationNotice: "deprecationNotice", configWarning: "configWarning", "fuzzyFileSearch/sessionUpdated": "fuzzyFileSearch/sessionUpdated", "fuzzyFileSearch/sessionCompleted": "fuzzyFileSearch/sessionCompleted", "thread/realtime/started": "thread/realtime/started", "thread/realtime/itemAdded": "thread/realtime/itemAdded", - "thread/realtime/transcriptUpdated": "thread/realtime/transcriptUpdated", + "thread/realtime/transcript/delta": "thread/realtime/transcript/delta", + "thread/realtime/transcript/done": "thread/realtime/transcript/done", "thread/realtime/outputAudio/delta": "thread/realtime/outputAudio/delta", "thread/realtime/sdp": "thread/realtime/sdp", "thread/realtime/error": "thread/realtime/error", @@ -163,10 +175,17 @@ export interface ClientRequestParamsByMethod { readonly "thread/list": typeof CodexSchema.V2ThreadListParams.Type; readonly "thread/loaded/list": typeof CodexSchema.V2ThreadLoadedListParams.Type; readonly "thread/read": typeof CodexSchema.V2ThreadReadParams.Type; + readonly "thread/turns/list": typeof CodexSchema.V2ThreadTurnsListParams.Type; + readonly "thread/inject_items": typeof CodexSchema.V2ThreadInjectItemsParams.Type; readonly "skills/list": typeof CodexSchema.V2SkillsListParams.Type; + readonly "marketplace/add": typeof CodexSchema.V2MarketplaceAddParams.Type; + readonly "marketplace/remove": typeof CodexSchema.V2MarketplaceRemoveParams.Type; readonly "plugin/list": typeof CodexSchema.V2PluginListParams.Type; readonly "plugin/read": typeof CodexSchema.V2PluginReadParams.Type; readonly "app/list": typeof CodexSchema.V2AppsListParams.Type; + readonly "device/key/create": typeof CodexSchema.V2DeviceKeyCreateParams.Type; + readonly "device/key/public": typeof CodexSchema.V2DeviceKeyPublicParams.Type; + readonly "device/key/sign": typeof CodexSchema.V2DeviceKeySignParams.Type; readonly "fs/readFile": typeof CodexSchema.V2FsReadFileParams.Type; readonly "fs/writeFile": typeof CodexSchema.V2FsWriteFileParams.Type; readonly "fs/createDirectory": typeof CodexSchema.V2FsCreateDirectoryParams.Type; @@ -196,6 +215,7 @@ export interface ClientRequestParamsByMethod { readonly "account/login/cancel": typeof CodexSchema.V2CancelLoginAccountParams.Type; readonly "account/logout": undefined; readonly "account/rateLimits/read": undefined; + readonly "account/sendAddCreditsNudgeEmail": typeof CodexSchema.V2SendAddCreditsNudgeEmailParams.Type; readonly "feedback/upload": typeof CodexSchema.V2FeedbackUploadParams.Type; readonly "command/exec": typeof CodexSchema.V2CommandExecParams.Type; readonly "command/exec/write": typeof CodexSchema.V2CommandExecWriteParams.Type; @@ -230,10 +250,17 @@ export interface ClientRequestResponsesByMethod { readonly "thread/list": typeof CodexSchema.V2ThreadListResponse.Type; readonly "thread/loaded/list": typeof CodexSchema.V2ThreadLoadedListResponse.Type; readonly "thread/read": typeof CodexSchema.V2ThreadReadResponse.Type; + readonly "thread/turns/list": typeof CodexSchema.V2ThreadTurnsListResponse.Type; + readonly "thread/inject_items": typeof CodexSchema.V2ThreadInjectItemsResponse.Type; readonly "skills/list": typeof CodexSchema.V2SkillsListResponse.Type; + readonly "marketplace/add": typeof CodexSchema.V2MarketplaceAddResponse.Type; + readonly "marketplace/remove": typeof CodexSchema.V2MarketplaceRemoveResponse.Type; readonly "plugin/list": typeof CodexSchema.V2PluginListResponse.Type; readonly "plugin/read": typeof CodexSchema.V2PluginReadResponse.Type; readonly "app/list": typeof CodexSchema.V2AppsListResponse.Type; + readonly "device/key/create": typeof CodexSchema.V2DeviceKeyCreateResponse.Type; + readonly "device/key/public": typeof CodexSchema.V2DeviceKeyPublicResponse.Type; + readonly "device/key/sign": typeof CodexSchema.V2DeviceKeySignResponse.Type; readonly "fs/readFile": typeof CodexSchema.V2FsReadFileResponse.Type; readonly "fs/writeFile": typeof CodexSchema.V2FsWriteFileResponse.Type; readonly "fs/createDirectory": typeof CodexSchema.V2FsCreateDirectoryResponse.Type; @@ -263,6 +290,7 @@ export interface ClientRequestResponsesByMethod { readonly "account/login/cancel": typeof CodexSchema.V2CancelLoginAccountResponse.Type; readonly "account/logout": typeof CodexSchema.V2LogoutAccountResponse.Type; readonly "account/rateLimits/read": typeof CodexSchema.V2GetAccountRateLimitsResponse.Type; + readonly "account/sendAddCreditsNudgeEmail": typeof CodexSchema.V2SendAddCreditsNudgeEmailResponse.Type; readonly "feedback/upload": typeof CodexSchema.V2FeedbackUploadResponse.Type; readonly "command/exec": typeof CodexSchema.V2CommandExecResponse.Type; readonly "command/exec/write": typeof CodexSchema.V2CommandExecWriteResponse.Type; @@ -336,6 +364,7 @@ export interface ServerNotificationParamsByMethod { readonly "item/commandExecution/outputDelta": typeof CodexSchema.V2CommandExecutionOutputDeltaNotification.Type; readonly "item/commandExecution/terminalInteraction": typeof CodexSchema.V2TerminalInteractionNotification.Type; readonly "item/fileChange/outputDelta": typeof CodexSchema.V2FileChangeOutputDeltaNotification.Type; + readonly "item/fileChange/patchUpdated": typeof CodexSchema.V2FileChangePatchUpdatedNotification.Type; readonly "serverRequest/resolved": typeof CodexSchema.V2ServerRequestResolvedNotification.Type; readonly "item/mcpToolCall/progress": typeof CodexSchema.V2McpToolCallProgressNotification.Type; readonly "mcpServer/oauthLogin/completed": typeof CodexSchema.V2McpServerOauthLoginCompletedNotification.Type; @@ -343,19 +372,22 @@ export interface ServerNotificationParamsByMethod { readonly "account/updated": typeof CodexSchema.V2AccountUpdatedNotification.Type; readonly "account/rateLimits/updated": typeof CodexSchema.V2AccountRateLimitsUpdatedNotification.Type; readonly "app/list/updated": typeof CodexSchema.V2AppListUpdatedNotification.Type; + readonly "externalAgentConfig/import/completed": typeof CodexSchema.V2ExternalAgentConfigImportCompletedNotification.Type; readonly "fs/changed": typeof CodexSchema.V2FsChangedNotification.Type; readonly "item/reasoning/summaryTextDelta": typeof CodexSchema.V2ReasoningSummaryTextDeltaNotification.Type; readonly "item/reasoning/summaryPartAdded": typeof CodexSchema.V2ReasoningSummaryPartAddedNotification.Type; readonly "item/reasoning/textDelta": typeof CodexSchema.V2ReasoningTextDeltaNotification.Type; readonly "thread/compacted": typeof CodexSchema.V2ContextCompactedNotification.Type; readonly "model/rerouted": typeof CodexSchema.V2ModelReroutedNotification.Type; + readonly warning: typeof CodexSchema.V2WarningNotification.Type; readonly deprecationNotice: typeof CodexSchema.V2DeprecationNoticeNotification.Type; readonly configWarning: typeof CodexSchema.V2ConfigWarningNotification.Type; readonly "fuzzyFileSearch/sessionUpdated": typeof CodexSchema.FuzzyFileSearchSessionUpdatedNotification.Type; readonly "fuzzyFileSearch/sessionCompleted": typeof CodexSchema.FuzzyFileSearchSessionCompletedNotification.Type; readonly "thread/realtime/started": typeof CodexSchema.V2ThreadRealtimeStartedNotification.Type; readonly "thread/realtime/itemAdded": typeof CodexSchema.V2ThreadRealtimeItemAddedNotification.Type; - readonly "thread/realtime/transcriptUpdated": typeof CodexSchema.V2ThreadRealtimeTranscriptUpdatedNotification.Type; + readonly "thread/realtime/transcript/delta": typeof CodexSchema.V2ThreadRealtimeTranscriptDeltaNotification.Type; + readonly "thread/realtime/transcript/done": typeof CodexSchema.V2ThreadRealtimeTranscriptDoneNotification.Type; readonly "thread/realtime/outputAudio/delta": typeof CodexSchema.V2ThreadRealtimeOutputAudioDeltaNotification.Type; readonly "thread/realtime/sdp": typeof CodexSchema.V2ThreadRealtimeSdpNotification.Type; readonly "thread/realtime/error": typeof CodexSchema.V2ThreadRealtimeErrorNotification.Type; @@ -381,10 +413,17 @@ export const CLIENT_REQUEST_PARAMS = { "thread/list": CodexSchema.V2ThreadListParams, "thread/loaded/list": CodexSchema.V2ThreadLoadedListParams, "thread/read": CodexSchema.V2ThreadReadParams, + "thread/turns/list": CodexSchema.V2ThreadTurnsListParams, + "thread/inject_items": CodexSchema.V2ThreadInjectItemsParams, "skills/list": CodexSchema.V2SkillsListParams, + "marketplace/add": CodexSchema.V2MarketplaceAddParams, + "marketplace/remove": CodexSchema.V2MarketplaceRemoveParams, "plugin/list": CodexSchema.V2PluginListParams, "plugin/read": CodexSchema.V2PluginReadParams, "app/list": CodexSchema.V2AppsListParams, + "device/key/create": CodexSchema.V2DeviceKeyCreateParams, + "device/key/public": CodexSchema.V2DeviceKeyPublicParams, + "device/key/sign": CodexSchema.V2DeviceKeySignParams, "fs/readFile": CodexSchema.V2FsReadFileParams, "fs/writeFile": CodexSchema.V2FsWriteFileParams, "fs/createDirectory": CodexSchema.V2FsCreateDirectoryParams, @@ -414,6 +453,7 @@ export const CLIENT_REQUEST_PARAMS = { "account/login/cancel": CodexSchema.V2CancelLoginAccountParams, "account/logout": undefined, "account/rateLimits/read": undefined, + "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailParams, "feedback/upload": CodexSchema.V2FeedbackUploadParams, "command/exec": CodexSchema.V2CommandExecParams, "command/exec/write": CodexSchema.V2CommandExecWriteParams, @@ -448,10 +488,17 @@ export const CLIENT_REQUEST_RESPONSES = { "thread/list": CodexSchema.V2ThreadListResponse, "thread/loaded/list": CodexSchema.V2ThreadLoadedListResponse, "thread/read": CodexSchema.V2ThreadReadResponse, + "thread/turns/list": CodexSchema.V2ThreadTurnsListResponse, + "thread/inject_items": CodexSchema.V2ThreadInjectItemsResponse, "skills/list": CodexSchema.V2SkillsListResponse, + "marketplace/add": CodexSchema.V2MarketplaceAddResponse, + "marketplace/remove": CodexSchema.V2MarketplaceRemoveResponse, "plugin/list": CodexSchema.V2PluginListResponse, "plugin/read": CodexSchema.V2PluginReadResponse, "app/list": CodexSchema.V2AppsListResponse, + "device/key/create": CodexSchema.V2DeviceKeyCreateResponse, + "device/key/public": CodexSchema.V2DeviceKeyPublicResponse, + "device/key/sign": CodexSchema.V2DeviceKeySignResponse, "fs/readFile": CodexSchema.V2FsReadFileResponse, "fs/writeFile": CodexSchema.V2FsWriteFileResponse, "fs/createDirectory": CodexSchema.V2FsCreateDirectoryResponse, @@ -481,6 +528,7 @@ export const CLIENT_REQUEST_RESPONSES = { "account/login/cancel": CodexSchema.V2CancelLoginAccountResponse, "account/logout": CodexSchema.V2LogoutAccountResponse, "account/rateLimits/read": CodexSchema.V2GetAccountRateLimitsResponse, + "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailResponse, "feedback/upload": CodexSchema.V2FeedbackUploadResponse, "command/exec": CodexSchema.V2CommandExecResponse, "command/exec/write": CodexSchema.V2CommandExecWriteResponse, @@ -555,6 +603,7 @@ export const SERVER_NOTIFICATION_PARAMS = { "item/commandExecution/outputDelta": CodexSchema.V2CommandExecutionOutputDeltaNotification, "item/commandExecution/terminalInteraction": CodexSchema.V2TerminalInteractionNotification, "item/fileChange/outputDelta": CodexSchema.V2FileChangeOutputDeltaNotification, + "item/fileChange/patchUpdated": CodexSchema.V2FileChangePatchUpdatedNotification, "serverRequest/resolved": CodexSchema.V2ServerRequestResolvedNotification, "item/mcpToolCall/progress": CodexSchema.V2McpToolCallProgressNotification, "mcpServer/oauthLogin/completed": CodexSchema.V2McpServerOauthLoginCompletedNotification, @@ -562,19 +611,23 @@ export const SERVER_NOTIFICATION_PARAMS = { "account/updated": CodexSchema.V2AccountUpdatedNotification, "account/rateLimits/updated": CodexSchema.V2AccountRateLimitsUpdatedNotification, "app/list/updated": CodexSchema.V2AppListUpdatedNotification, + "externalAgentConfig/import/completed": + CodexSchema.V2ExternalAgentConfigImportCompletedNotification, "fs/changed": CodexSchema.V2FsChangedNotification, "item/reasoning/summaryTextDelta": CodexSchema.V2ReasoningSummaryTextDeltaNotification, "item/reasoning/summaryPartAdded": CodexSchema.V2ReasoningSummaryPartAddedNotification, "item/reasoning/textDelta": CodexSchema.V2ReasoningTextDeltaNotification, "thread/compacted": CodexSchema.V2ContextCompactedNotification, "model/rerouted": CodexSchema.V2ModelReroutedNotification, + warning: CodexSchema.V2WarningNotification, deprecationNotice: CodexSchema.V2DeprecationNoticeNotification, configWarning: CodexSchema.V2ConfigWarningNotification, "fuzzyFileSearch/sessionUpdated": CodexSchema.FuzzyFileSearchSessionUpdatedNotification, "fuzzyFileSearch/sessionCompleted": CodexSchema.FuzzyFileSearchSessionCompletedNotification, "thread/realtime/started": CodexSchema.V2ThreadRealtimeStartedNotification, "thread/realtime/itemAdded": CodexSchema.V2ThreadRealtimeItemAddedNotification, - "thread/realtime/transcriptUpdated": CodexSchema.V2ThreadRealtimeTranscriptUpdatedNotification, + "thread/realtime/transcript/delta": CodexSchema.V2ThreadRealtimeTranscriptDeltaNotification, + "thread/realtime/transcript/done": CodexSchema.V2ThreadRealtimeTranscriptDoneNotification, "thread/realtime/outputAudio/delta": CodexSchema.V2ThreadRealtimeOutputAudioDeltaNotification, "thread/realtime/sdp": CodexSchema.V2ThreadRealtimeSdpNotification, "thread/realtime/error": CodexSchema.V2ThreadRealtimeErrorNotification, 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 baa94c87974..fd18e9d4d0b 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: dbfe855f4fd0f5dcdf079882652a8efe622b0595 +// Upstream protocol ref: be75785504ff152fa6333e380a2d50642f42fba0 import * as CodexSchema from "./schema.gen.ts"; @@ -37,6 +37,12 @@ export const v2 = { ConfigWriteResponse: CodexSchema.V2ConfigWriteResponse, ContextCompactedNotification: CodexSchema.V2ContextCompactedNotification, DeprecationNoticeNotification: CodexSchema.V2DeprecationNoticeNotification, + DeviceKeyCreateParams: CodexSchema.V2DeviceKeyCreateParams, + DeviceKeyCreateResponse: CodexSchema.V2DeviceKeyCreateResponse, + DeviceKeyPublicParams: CodexSchema.V2DeviceKeyPublicParams, + DeviceKeyPublicResponse: CodexSchema.V2DeviceKeyPublicResponse, + DeviceKeySignParams: CodexSchema.V2DeviceKeySignParams, + DeviceKeySignResponse: CodexSchema.V2DeviceKeySignResponse, ErrorNotification: CodexSchema.V2ErrorNotification, ExperimentalFeatureEnablementSetParams: CodexSchema.V2ExperimentalFeatureEnablementSetParams, ExperimentalFeatureEnablementSetResponse: CodexSchema.V2ExperimentalFeatureEnablementSetResponse, @@ -44,11 +50,14 @@ export const v2 = { ExperimentalFeatureListResponse: CodexSchema.V2ExperimentalFeatureListResponse, ExternalAgentConfigDetectParams: CodexSchema.V2ExternalAgentConfigDetectParams, ExternalAgentConfigDetectResponse: CodexSchema.V2ExternalAgentConfigDetectResponse, + ExternalAgentConfigImportCompletedNotification: + CodexSchema.V2ExternalAgentConfigImportCompletedNotification, ExternalAgentConfigImportParams: CodexSchema.V2ExternalAgentConfigImportParams, ExternalAgentConfigImportResponse: CodexSchema.V2ExternalAgentConfigImportResponse, FeedbackUploadParams: CodexSchema.V2FeedbackUploadParams, FeedbackUploadResponse: CodexSchema.V2FeedbackUploadResponse, FileChangeOutputDeltaNotification: CodexSchema.V2FileChangeOutputDeltaNotification, + FileChangePatchUpdatedNotification: CodexSchema.V2FileChangePatchUpdatedNotification, FsChangedNotification: CodexSchema.V2FsChangedNotification, FsCopyParams: CodexSchema.V2FsCopyParams, FsCopyResponse: CodexSchema.V2FsCopyResponse, @@ -84,6 +93,10 @@ export const v2 = { LoginAccountParams: CodexSchema.V2LoginAccountParams, LoginAccountResponse: CodexSchema.V2LoginAccountResponse, LogoutAccountResponse: CodexSchema.V2LogoutAccountResponse, + MarketplaceAddParams: CodexSchema.V2MarketplaceAddParams, + MarketplaceAddResponse: CodexSchema.V2MarketplaceAddResponse, + MarketplaceRemoveParams: CodexSchema.V2MarketplaceRemoveParams, + MarketplaceRemoveResponse: CodexSchema.V2MarketplaceRemoveResponse, McpResourceReadParams: CodexSchema.V2McpResourceReadParams, McpResourceReadResponse: CodexSchema.V2McpResourceReadResponse, McpServerOauthLoginCompletedNotification: CodexSchema.V2McpServerOauthLoginCompletedNotification, @@ -112,6 +125,8 @@ export const v2 = { ReasoningTextDeltaNotification: CodexSchema.V2ReasoningTextDeltaNotification, ReviewStartParams: CodexSchema.V2ReviewStartParams, ReviewStartResponse: CodexSchema.V2ReviewStartResponse, + SendAddCreditsNudgeEmailParams: CodexSchema.V2SendAddCreditsNudgeEmailParams, + SendAddCreditsNudgeEmailResponse: CodexSchema.V2SendAddCreditsNudgeEmailResponse, ServerRequestResolvedNotification: CodexSchema.V2ServerRequestResolvedNotification, SkillsChangedNotification: CodexSchema.V2SkillsChangedNotification, SkillsConfigWriteParams: CodexSchema.V2SkillsConfigWriteParams, @@ -127,6 +142,8 @@ export const v2 = { ThreadCompactStartResponse: CodexSchema.V2ThreadCompactStartResponse, ThreadForkParams: CodexSchema.V2ThreadForkParams, ThreadForkResponse: CodexSchema.V2ThreadForkResponse, + ThreadInjectItemsParams: CodexSchema.V2ThreadInjectItemsParams, + ThreadInjectItemsResponse: CodexSchema.V2ThreadInjectItemsResponse, ThreadListParams: CodexSchema.V2ThreadListParams, ThreadListResponse: CodexSchema.V2ThreadListResponse, ThreadLoadedListParams: CodexSchema.V2ThreadLoadedListParams, @@ -143,8 +160,9 @@ export const v2 = { CodexSchema.V2ThreadRealtimeOutputAudioDeltaNotification, ThreadRealtimeSdpNotification: CodexSchema.V2ThreadRealtimeSdpNotification, ThreadRealtimeStartedNotification: CodexSchema.V2ThreadRealtimeStartedNotification, - ThreadRealtimeTranscriptUpdatedNotification: - CodexSchema.V2ThreadRealtimeTranscriptUpdatedNotification, + ThreadRealtimeTranscriptDeltaNotification: + CodexSchema.V2ThreadRealtimeTranscriptDeltaNotification, + ThreadRealtimeTranscriptDoneNotification: CodexSchema.V2ThreadRealtimeTranscriptDoneNotification, ThreadResumeParams: CodexSchema.V2ThreadResumeParams, ThreadResumeResponse: CodexSchema.V2ThreadResumeResponse, ThreadRollbackParams: CodexSchema.V2ThreadRollbackParams, @@ -158,6 +176,8 @@ export const v2 = { ThreadStartResponse: CodexSchema.V2ThreadStartResponse, ThreadStatusChangedNotification: CodexSchema.V2ThreadStatusChangedNotification, ThreadTokenUsageUpdatedNotification: CodexSchema.V2ThreadTokenUsageUpdatedNotification, + ThreadTurnsListParams: CodexSchema.V2ThreadTurnsListParams, + ThreadTurnsListResponse: CodexSchema.V2ThreadTurnsListResponse, ThreadUnarchivedNotification: CodexSchema.V2ThreadUnarchivedNotification, ThreadUnarchiveParams: CodexSchema.V2ThreadUnarchiveParams, ThreadUnarchiveResponse: CodexSchema.V2ThreadUnarchiveResponse, @@ -173,6 +193,7 @@ export const v2 = { TurnStartResponse: CodexSchema.V2TurnStartResponse, TurnSteerParams: CodexSchema.V2TurnSteerParams, TurnSteerResponse: CodexSchema.V2TurnSteerResponse, + WarningNotification: CodexSchema.V2WarningNotification, WindowsSandboxSetupCompletedNotification: CodexSchema.V2WindowsSandboxSetupCompletedNotification, WindowsSandboxSetupStartParams: CodexSchema.V2WindowsSandboxSetupStartParams, WindowsSandboxSetupStartResponse: CodexSchema.V2WindowsSandboxSetupStartResponse, 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 5f2119a19b8..3af37c0785f 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: dbfe855f4fd0f5dcdf079882652a8efe622b0595 +// Upstream protocol ref: be75785504ff152fa6333e380a2d50642f42fba0 import * as Schema from "effect/Schema"; @@ -45,6 +45,9 @@ export const ClientRequest__AbsolutePathBuf = Schema.String.annotate({ "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", }); +export type ClientRequest__AddCreditsNudgeCreditType = "credits" | "usage_limit"; +export const ClientRequest__AddCreditsNudgeCreditType = Schema.Literals(["credits", "usage_limit"]); + export type ClientRequest__ApprovalsReviewer = "user" | "guardian_subagent"; export const ClientRequest__ApprovalsReviewer = Schema.Literals([ "user", @@ -234,27 +237,20 @@ export const ClientRequest__ConfigReadParams = Schema.Struct({ includeLayers: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), }); -export type ClientRequest__ContentItem = - | { readonly text: string; readonly type: "input_text" } - | { readonly image_url: string; readonly type: "input_image" } - | { 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.Struct({ - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), - }).annotate({ title: "InputImageContentItem" }), - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), - }).annotate({ title: "OutputTextContentItem" }), - ], - { mode: "oneOf" }, -); +export type ClientRequest__DeviceKeyProtectionPolicy = + | "hardware_only" + | "allow_os_protected_nonextractable"; +export const ClientRequest__DeviceKeyProtectionPolicy = Schema.Literals([ + "hardware_only", + "allow_os_protected_nonextractable", +]).annotate({ + description: "Protection policy for creating or loading a controller-local device key.", +}); + +export type ClientRequest__DeviceKeyPublicParams = { readonly keyId: string }; +export const ClientRequest__DeviceKeyPublicParams = Schema.Struct({ + keyId: Schema.String, +}).annotate({ description: "Fetch a controller-local device key public key by id." }); export type ClientRequest__ExperimentalFeatureEnablementSetParams = { readonly enablement: { readonly [x: string]: boolean }; @@ -316,11 +312,13 @@ export type ClientRequest__ExternalAgentConfigMigrationItemType = | "AGENTS_MD" | "CONFIG" | "SKILLS" + | "PLUGINS" | "MCP_SERVER_CONFIG"; export const ClientRequest__ExternalAgentConfigMigrationItemType = Schema.Literals([ "AGENTS_MD", "CONFIG", "SKILLS", + "PLUGINS", "MCP_SERVER_CONFIG", ]); @@ -329,6 +327,7 @@ export type ClientRequest__FeedbackUploadParams = { readonly extraLogFiles?: ReadonlyArray | null; readonly includeLogs: boolean; readonly reason?: string | null; + readonly tags?: { readonly [x: string]: string } | null; readonly threadId?: string | null; }; export const ClientRequest__FeedbackUploadParams = Schema.Struct({ @@ -336,6 +335,9 @@ export const ClientRequest__FeedbackUploadParams = Schema.Struct({ extraLogFiles: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), includeLogs: Schema.Boolean, reason: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + tags: Schema.optionalKey( + Schema.Union([Schema.Record(Schema.String, Schema.String), Schema.Null]), + ), threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); @@ -612,14 +614,30 @@ export const ClientRequest__LoginAccountParams = Schema.Union( { mode: "oneOf" }, ); +export type ClientRequest__MarketplaceAddParams = { + readonly refName?: string | null; + readonly source: string; + readonly sparsePaths?: ReadonlyArray | null; +}; +export const ClientRequest__MarketplaceAddParams = Schema.Struct({ + refName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + source: Schema.String, + sparsePaths: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), +}); + +export type ClientRequest__MarketplaceRemoveParams = { readonly marketplaceName: string }; +export const ClientRequest__MarketplaceRemoveParams = Schema.Struct({ + marketplaceName: Schema.String, +}); + export type ClientRequest__McpResourceReadParams = { readonly server: string; - readonly threadId: string; + readonly threadId?: string | null; readonly uri: string; }; export const ClientRequest__McpResourceReadParams = Schema.Struct({ server: Schema.String, - threadId: Schema.String, + threadId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), uri: Schema.String, }); @@ -708,17 +726,16 @@ export const ClientRequest__ModelListParams = Schema.Struct({ export type ClientRequest__Personality = "none" | "friendly" | "pragmatic"; export const ClientRequest__Personality = Schema.Literals(["none", "friendly", "pragmatic"]); -export type ClientRequest__PluginUninstallParams = { - readonly forceRemoteSync?: boolean; - readonly pluginId: string; +export type ClientRequest__PluginUninstallParams = { readonly pluginId: string }; +export const ClientRequest__PluginUninstallParams = Schema.Struct({ pluginId: Schema.String }); + +export type ClientRequest__PluginsMigration = { + readonly marketplaceName: string; + readonly pluginNames: ReadonlyArray; }; -export const ClientRequest__PluginUninstallParams = Schema.Struct({ - forceRemoteSync: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "When true, apply the remote plugin change before the local uninstall flow.", - }), - ), - pluginId: Schema.String, +export const ClientRequest__PluginsMigration = Schema.Struct({ + marketplaceName: Schema.String, + pluginNames: Schema.Array(Schema.String), }); export type ClientRequest__ReasoningEffort = @@ -787,6 +804,18 @@ export const ClientRequest__ReasoningSummary = Schema.Union( "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", }); +export type ClientRequest__RemoteControlClientConnectionAudience = + "remote_control_client_websocket"; +export const ClientRequest__RemoteControlClientConnectionAudience = Schema.Literal( + "remote_control_client_websocket", +).annotate({ description: "Audience for a remote-control client connection device-key proof." }); + +export type ClientRequest__RemoteControlClientEnrollmentAudience = + "remote_control_client_enrollment"; +export const ClientRequest__RemoteControlClientEnrollmentAudience = Schema.Literal( + "remote_control_client_enrollment", +).annotate({ description: "Audience for a remote-control client enrollment device-key proof." }); + export type ClientRequest__RequestId = string | number; export const ClientRequest__RequestId = Schema.Union([ Schema.String, @@ -903,6 +932,9 @@ export const ClientRequest__SkillsListExtraRootsForCwd = Schema.Struct({ extraUserRoots: Schema.Array(Schema.String), }); +export type ClientRequest__SortDirection = "asc" | "desc"; +export const ClientRequest__SortDirection = Schema.Literals(["asc", "desc"]); + export type ClientRequest__TextElement = { readonly byteRange: { readonly end: number; readonly start: number }; readonly placeholder?: string | null; @@ -934,6 +966,17 @@ export const ClientRequest__ThreadArchiveParams = Schema.Struct({ threadId: Sche export type ClientRequest__ThreadCompactStartParams = { readonly threadId: string }; export const ClientRequest__ThreadCompactStartParams = Schema.Struct({ threadId: Schema.String }); +export type ClientRequest__ThreadInjectItemsParams = { + readonly items: ReadonlyArray; + readonly threadId: string; +}; +export const ClientRequest__ThreadInjectItemsParams = Schema.Struct({ + items: Schema.Array(Schema.Unknown).annotate({ + description: "Raw Responses API items to append to the thread's model-visible history.", + }), + threadId: Schema.String, +}); + export type ClientRequest__ThreadLoadedListParams = { readonly cursor?: string | null; readonly limit?: number | null; @@ -1106,44 +1149,47 @@ export const CommandExecutionRequestApprovalParams__AdditionalNetworkPermissions enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), }); -export type CommandExecutionRequestApprovalParams__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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 CommandExecutionRequestApprovalParams__CommandAction = Schema.Union( +export type CommandExecutionRequestApprovalParams__FileSystemAccessMode = "read" | "write" | "none"; +export const CommandExecutionRequestApprovalParams__FileSystemAccessMode = Schema.Literals([ + "read", + "write", + "none", +]); + +export type CommandExecutionRequestApprovalParams__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { readonly kind: "current_working_directory" } + | { readonly kind: "project_roots"; readonly subpath?: string | null } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { readonly kind: "unknown"; readonly path: string; readonly subpath?: string | null }; +export const CommandExecutionRequestApprovalParams__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("current_working_directory") }).annotate({ + title: "CurrentWorkingDirectoryFileSystemSpecialPath", + }), Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - 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" }), + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "KindFileSystemSpecialPath" }), + Schema.Struct({ kind: Schema.Literal("tmpdir") }).annotate({ + title: "TmpdirFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("slash_tmp") }).annotate({ + title: "SlashTmpFileSystemSpecialPath", + }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + kind: Schema.Literal("unknown"), + path: Schema.String, + subpath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }), ], { mode: "oneOf" }, ); @@ -1404,6 +1450,51 @@ export const PermissionsRequestApprovalParams__AdditionalNetworkPermissions = Sc enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), }); +export type PermissionsRequestApprovalParams__FileSystemAccessMode = "read" | "write" | "none"; +export const PermissionsRequestApprovalParams__FileSystemAccessMode = Schema.Literals([ + "read", + "write", + "none", +]); + +export type PermissionsRequestApprovalParams__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { readonly kind: "current_working_directory" } + | { readonly kind: "project_roots"; readonly subpath?: string | null } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { readonly kind: "unknown"; readonly path: string; readonly subpath?: string | null }; +export const PermissionsRequestApprovalParams__FileSystemSpecialPath = Schema.Union( + [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("current_working_directory") }).annotate({ + title: "CurrentWorkingDirectoryFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey(Schema.Union([Schema.String, 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([Schema.String, Schema.Null])), + }), + ], + { mode: "oneOf" }, +); + export type PermissionsRequestApprovalResponse__AbsolutePathBuf = string; export const PermissionsRequestApprovalResponse__AbsolutePathBuf = Schema.String.annotate({ description: @@ -1417,6 +1508,51 @@ export const PermissionsRequestApprovalResponse__AdditionalNetworkPermissions = enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), }); +export type PermissionsRequestApprovalResponse__FileSystemAccessMode = "read" | "write" | "none"; +export const PermissionsRequestApprovalResponse__FileSystemAccessMode = Schema.Literals([ + "read", + "write", + "none", +]); + +export type PermissionsRequestApprovalResponse__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { readonly kind: "current_working_directory" } + | { readonly kind: "project_roots"; readonly subpath?: string | null } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { readonly kind: "unknown"; readonly path: string; readonly subpath?: string | 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("current_working_directory") }).annotate({ + title: "CurrentWorkingDirectoryFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey(Schema.Union([Schema.String, 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([Schema.String, Schema.Null])), + }), + ], + { mode: "oneOf" }, +); + export type ServerNotification__AbsolutePathBuf = string; export const ServerNotification__AbsolutePathBuf = Schema.String.annotate({ description: @@ -1434,6 +1570,13 @@ export const ServerNotification__AccountLoginCompletedNotification = Schema.Stru success: Schema.Boolean, }); +export type ServerNotification__AdditionalNetworkPermissions = { + readonly enabled?: boolean | null; +}; +export const ServerNotification__AdditionalNetworkPermissions = Schema.Struct({ + enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), +}); + export type ServerNotification__AgentMessageDeltaNotification = { readonly delta: string; readonly itemId: string; @@ -1490,7 +1633,7 @@ export const ServerNotification__AuthMode = Schema.Literals([ export type ServerNotification__AutoReviewDecisionSource = "agent"; export const ServerNotification__AutoReviewDecisionSource = Schema.Literal("agent").annotate({ - description: "[UNSTABLE] Source that produced a terminal guardian approval review decision.", + description: "[UNSTABLE] Source that produced a terminal approval auto-review decision.", }); export type ServerNotification__CollabAgentStatus = @@ -1511,48 +1654,6 @@ export const ServerNotification__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type ServerNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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 ServerNotification__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type ServerNotification__CommandExecOutputDeltaNotification = { readonly capReached: boolean; readonly deltaBase64: string; @@ -1666,6 +1767,9 @@ export const ServerNotification__DynamicToolCallStatus = Schema.Literals([ "failed", ]); +export type ServerNotification__ExternalAgentConfigImportCompletedNotification = {}; +export const ServerNotification__ExternalAgentConfigImportCompletedNotification = Schema.Struct({}); + export type ServerNotification__FileChangeOutputDeltaNotification = { readonly delta: string; readonly itemId: string; @@ -1679,6 +1783,47 @@ export const ServerNotification__FileChangeOutputDeltaNotification = Schema.Stru turnId: Schema.String, }); +export type ServerNotification__FileSystemAccessMode = "read" | "write" | "none"; +export const ServerNotification__FileSystemAccessMode = Schema.Literals(["read", "write", "none"]); + +export type ServerNotification__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { readonly kind: "current_working_directory" } + | { readonly kind: "project_roots"; readonly subpath?: string | null } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { readonly kind: "unknown"; readonly path: string; readonly subpath?: string | null }; +export const ServerNotification__FileSystemSpecialPath = Schema.Union( + [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("current_working_directory") }).annotate({ + title: "CurrentWorkingDirectoryFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey(Schema.Union([Schema.String, 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([Schema.String, Schema.Null])), + }), + ], + { mode: "oneOf" }, +); + export type ServerNotification__FuzzyFileSearchMatchType = "file" | "directory"; export const ServerNotification__FuzzyFileSearchMatchType = Schema.Literals(["file", "directory"]); @@ -1712,7 +1857,7 @@ export const ServerNotification__GuardianApprovalReviewStatus = Schema.Literals( "denied", "timedOut", "aborted", -]).annotate({ description: "[UNSTABLE] Lifecycle state for a guardian approval review." }); +]).annotate({ description: "[UNSTABLE] Lifecycle state for an approval auto-review." }); export type ServerNotification__GuardianCommandSource = "shell" | "unifiedExec"; export const ServerNotification__GuardianCommandSource = Schema.Literals(["shell", "unifiedExec"]); @@ -1723,7 +1868,7 @@ export const ServerNotification__GuardianRiskLevel = Schema.Literals([ "medium", "high", "critical", -]).annotate({ description: "[UNSTABLE] Risk level assigned by guardian approval review." }); +]).annotate({ description: "[UNSTABLE] Risk level assigned by approval auto-review." }); export type ServerNotification__GuardianUserAuthorization = "unknown" | "low" | "medium" | "high"; export const ServerNotification__GuardianUserAuthorization = Schema.Literals([ @@ -1731,18 +1876,18 @@ export const ServerNotification__GuardianUserAuthorization = Schema.Literals([ "low", "medium", "high", -]).annotate({ - description: "[UNSTABLE] Authorization level assigned by guardian approval review.", -}); +]).annotate({ description: "[UNSTABLE] Authorization level assigned by approval auto-review." }); export type ServerNotification__HookEventName = | "preToolUse" + | "permissionRequest" | "postToolUse" | "sessionStart" | "userPromptSubmit" | "stop"; export const ServerNotification__HookEventName = Schema.Literals([ "preToolUse", + "permissionRequest", "postToolUse", "sessionStart", "userPromptSubmit", @@ -1949,6 +2094,7 @@ export type ServerNotification__PlanType = | "go" | "plus" | "pro" + | "prolite" | "team" | "self_serve_business_usage_based" | "business" @@ -1961,6 +2107,7 @@ export const ServerNotification__PlanType = Schema.Literals([ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", @@ -1970,6 +2117,20 @@ export const ServerNotification__PlanType = Schema.Literals([ "unknown", ]); +export type ServerNotification__RateLimitReachedType = + | "rate_limit_reached" + | "workspace_owner_credits_depleted" + | "workspace_member_credits_depleted" + | "workspace_owner_usage_limit_reached" + | "workspace_member_usage_limit_reached"; +export const ServerNotification__RateLimitReachedType = Schema.Literals([ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached", +]); + export type ServerNotification__RateLimitWindow = { readonly resetsAt?: number | null; readonly usedPercent: number; @@ -2209,20 +2370,34 @@ export const ServerNotification__ThreadRealtimeSdpNotification = Schema.Struct({ description: "EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.", }); -export type ServerNotification__ThreadRealtimeTranscriptUpdatedNotification = { +export type ServerNotification__ThreadRealtimeTranscriptDeltaNotification = { + readonly delta: string; readonly role: string; - readonly text: string; readonly threadId: string; }; -export const ServerNotification__ThreadRealtimeTranscriptUpdatedNotification = Schema.Struct({ +export const ServerNotification__ThreadRealtimeTranscriptDeltaNotification = Schema.Struct({ + delta: Schema.String.annotate({ description: "Live transcript delta from the realtime event." }), role: Schema.String, - text: Schema.String, threadId: Schema.String, }).annotate({ description: "EXPERIMENTAL - flat transcript delta emitted whenever realtime transcript text changes.", }); +export type ServerNotification__ThreadRealtimeTranscriptDoneNotification = { + readonly role: string; + readonly text: string; + readonly threadId: string; +}; +export const ServerNotification__ThreadRealtimeTranscriptDoneNotification = Schema.Struct({ + role: Schema.String, + text: Schema.String.annotate({ description: "Final complete text for the transcript part." }), + threadId: Schema.String, +}).annotate({ + description: + "EXPERIMENTAL - final transcript text emitted when realtime completes a transcript part.", +}); + export type ServerNotification__ThreadUnarchivedNotification = { readonly threadId: string }; export const ServerNotification__ThreadUnarchivedNotification = Schema.Struct({ threadId: Schema.String, @@ -2272,6 +2447,22 @@ export const ServerNotification__TurnStatus = Schema.Literals([ "inProgress", ]); +export type ServerNotification__WarningNotification = { + readonly message: string; + readonly threadId?: string | null; +}; +export const ServerNotification__WarningNotification = Schema.Struct({ + message: Schema.String.annotate({ description: "Concise warning message for the user." }), + threadId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional thread target when the warning applies to a specific thread.", + }), + Schema.Null, + ]), + ), +}); + export type ServerNotification__WebSearchAction = | { readonly queries?: ReadonlyArray | null; @@ -2337,68 +2528,28 @@ export const ServerRequest__AdditionalNetworkPermissions = Schema.Struct({ export type ServerRequest__ChatgptAuthTokensRefreshReason = "unauthorized"; export const ServerRequest__ChatgptAuthTokensRefreshReason = Schema.Literal("unauthorized"); -export type ServerRequest__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const ServerRequest__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - -export type ServerRequest__DynamicToolCallParams = { - readonly arguments: unknown; - readonly callId: string; - readonly threadId: string; - readonly tool: string; - readonly turnId: string; -}; -export const ServerRequest__DynamicToolCallParams = Schema.Struct({ - arguments: Schema.Unknown, - callId: Schema.String, - threadId: Schema.String, - tool: Schema.String, - turnId: Schema.String, -}); - -export type ServerRequest__FileChange = - | { readonly content: string; readonly type: "add" } - | { readonly content: string; readonly type: "delete" } - | { readonly move_path?: string | null; readonly type: "update"; readonly unified_diff: string }; -export const ServerRequest__FileChange = Schema.Union( +export type ServerRequest__DynamicToolCallParams = { + readonly arguments: unknown; + readonly callId: string; + readonly namespace?: string | null; + readonly threadId: string; + readonly tool: string; + readonly turnId: string; +}; +export const ServerRequest__DynamicToolCallParams = Schema.Struct({ + arguments: Schema.Unknown, + callId: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + threadId: Schema.String, + tool: Schema.String, + turnId: Schema.String, +}); + +export type ServerRequest__FileChange = + | { readonly content: string; readonly type: "add" } + | { readonly content: string; readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update"; readonly unified_diff: string }; +export const ServerRequest__FileChange = Schema.Union( [ Schema.Struct({ content: Schema.String, @@ -2447,6 +2598,47 @@ export const ServerRequest__FileChangeRequestApprovalParams = Schema.Struct({ turnId: Schema.String, }); +export type ServerRequest__FileSystemAccessMode = "read" | "write" | "none"; +export const ServerRequest__FileSystemAccessMode = Schema.Literals(["read", "write", "none"]); + +export type ServerRequest__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { readonly kind: "current_working_directory" } + | { readonly kind: "project_roots"; readonly subpath?: string | null } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { readonly kind: "unknown"; readonly path: string; readonly subpath?: string | null }; +export const ServerRequest__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("current_working_directory") }).annotate({ + title: "CurrentWorkingDirectoryFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey(Schema.Union([Schema.String, 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([Schema.String, Schema.Null])), + }), + ], + { mode: "oneOf" }, +); + export type ServerRequest__McpElicitationArrayType = "array"; export const ServerRequest__McpElicitationArrayType = Schema.Literal("array"); @@ -2619,6 +2811,7 @@ export type V2AccountRateLimitsUpdatedNotification__PlanType = | "go" | "plus" | "pro" + | "prolite" | "team" | "self_serve_business_usage_based" | "business" @@ -2631,6 +2824,7 @@ export const V2AccountRateLimitsUpdatedNotification__PlanType = Schema.Literals( "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", @@ -2640,6 +2834,20 @@ export const V2AccountRateLimitsUpdatedNotification__PlanType = Schema.Literals( "unknown", ]); +export type V2AccountRateLimitsUpdatedNotification__RateLimitReachedType = + | "rate_limit_reached" + | "workspace_owner_credits_depleted" + | "workspace_member_credits_depleted" + | "workspace_owner_usage_limit_reached" + | "workspace_member_usage_limit_reached"; +export const V2AccountRateLimitsUpdatedNotification__RateLimitReachedType = Schema.Literals([ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached", +]); + export type V2AccountRateLimitsUpdatedNotification__RateLimitWindow = { readonly resetsAt?: number | null; readonly usedPercent: number; @@ -2667,6 +2875,7 @@ export type V2AccountUpdatedNotification__PlanType = | "go" | "plus" | "pro" + | "prolite" | "team" | "self_serve_business_usage_based" | "business" @@ -2679,6 +2888,7 @@ export const V2AccountUpdatedNotification__PlanType = Schema.Literals([ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", @@ -3034,6 +3244,63 @@ export const V2ConfigWriteResponse__AbsolutePathBuf = Schema.String.annotate({ export type V2ConfigWriteResponse__WriteStatus = "ok" | "okOverridden"; export const V2ConfigWriteResponse__WriteStatus = Schema.Literals(["ok", "okOverridden"]); +export type V2DeviceKeyCreateParams__DeviceKeyProtectionPolicy = + | "hardware_only" + | "allow_os_protected_nonextractable"; +export const V2DeviceKeyCreateParams__DeviceKeyProtectionPolicy = Schema.Literals([ + "hardware_only", + "allow_os_protected_nonextractable", +]).annotate({ + description: "Protection policy for creating or loading a controller-local device key.", +}); + +export type V2DeviceKeyCreateResponse__DeviceKeyAlgorithm = "ecdsa_p256_sha256"; +export const V2DeviceKeyCreateResponse__DeviceKeyAlgorithm = Schema.Literal( + "ecdsa_p256_sha256", +).annotate({ description: "Device-key algorithm reported at enrollment and signing boundaries." }); + +export type V2DeviceKeyCreateResponse__DeviceKeyProtectionClass = + | "hardware_secure_enclave" + | "hardware_tpm" + | "os_protected_nonextractable"; +export const V2DeviceKeyCreateResponse__DeviceKeyProtectionClass = Schema.Literals([ + "hardware_secure_enclave", + "hardware_tpm", + "os_protected_nonextractable", +]).annotate({ description: "Platform protection class for a controller-local device key." }); + +export type V2DeviceKeyPublicResponse__DeviceKeyAlgorithm = "ecdsa_p256_sha256"; +export const V2DeviceKeyPublicResponse__DeviceKeyAlgorithm = Schema.Literal( + "ecdsa_p256_sha256", +).annotate({ description: "Device-key algorithm reported at enrollment and signing boundaries." }); + +export type V2DeviceKeyPublicResponse__DeviceKeyProtectionClass = + | "hardware_secure_enclave" + | "hardware_tpm" + | "os_protected_nonextractable"; +export const V2DeviceKeyPublicResponse__DeviceKeyProtectionClass = Schema.Literals([ + "hardware_secure_enclave", + "hardware_tpm", + "os_protected_nonextractable", +]).annotate({ description: "Platform protection class for a controller-local device key." }); + +export type V2DeviceKeySignParams__RemoteControlClientConnectionAudience = + "remote_control_client_websocket"; +export const V2DeviceKeySignParams__RemoteControlClientConnectionAudience = Schema.Literal( + "remote_control_client_websocket", +).annotate({ description: "Audience for a remote-control client connection device-key proof." }); + +export type V2DeviceKeySignParams__RemoteControlClientEnrollmentAudience = + "remote_control_client_enrollment"; +export const V2DeviceKeySignParams__RemoteControlClientEnrollmentAudience = Schema.Literal( + "remote_control_client_enrollment", +).annotate({ description: "Audience for a remote-control client enrollment device-key proof." }); + +export type V2DeviceKeySignResponse__DeviceKeyAlgorithm = "ecdsa_p256_sha256"; +export const V2DeviceKeySignResponse__DeviceKeyAlgorithm = Schema.Literal( + "ecdsa_p256_sha256", +).annotate({ description: "Device-key algorithm reported at enrollment and signing boundaries." }); + export type V2ErrorNotification__NonSteerableTurnKind = "review" | "compact"; export const V2ErrorNotification__NonSteerableTurnKind = Schema.Literals(["review", "compact"]); @@ -3092,17 +3359,57 @@ export type V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationIte | "AGENTS_MD" | "CONFIG" | "SKILLS" + | "PLUGINS" | "MCP_SERVER_CONFIG"; export const V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType = - Schema.Literals(["AGENTS_MD", "CONFIG", "SKILLS", "MCP_SERVER_CONFIG"]); + Schema.Literals(["AGENTS_MD", "CONFIG", "SKILLS", "PLUGINS", "MCP_SERVER_CONFIG"]); + +export type V2ExternalAgentConfigDetectResponse__PluginsMigration = { + readonly marketplaceName: string; + readonly pluginNames: ReadonlyArray; +}; +export const V2ExternalAgentConfigDetectResponse__PluginsMigration = Schema.Struct({ + marketplaceName: Schema.String, + pluginNames: Schema.Array(Schema.String), +}); export type V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType = | "AGENTS_MD" | "CONFIG" | "SKILLS" + | "PLUGINS" | "MCP_SERVER_CONFIG"; export const V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType = - Schema.Literals(["AGENTS_MD", "CONFIG", "SKILLS", "MCP_SERVER_CONFIG"]); + Schema.Literals(["AGENTS_MD", "CONFIG", "SKILLS", "PLUGINS", "MCP_SERVER_CONFIG"]); + +export type V2ExternalAgentConfigImportParams__PluginsMigration = { + readonly marketplaceName: string; + readonly pluginNames: ReadonlyArray; +}; +export const V2ExternalAgentConfigImportParams__PluginsMigration = Schema.Struct({ + marketplaceName: Schema.String, + pluginNames: Schema.Array(Schema.String), +}); + +export type V2FileChangePatchUpdatedNotification__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2FileChangePatchUpdatedNotification__PatchChangeKind = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), + Schema.Struct({ + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), + Schema.Struct({ + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), + ], + { mode: "oneOf" }, +); export type V2FsChangedNotification__AbsolutePathBuf = string; export const V2FsChangedNotification__AbsolutePathBuf = Schema.String.annotate({ @@ -3143,6 +3450,7 @@ export type V2GetAccountRateLimitsResponse__PlanType = | "go" | "plus" | "pro" + | "prolite" | "team" | "self_serve_business_usage_based" | "business" @@ -3155,6 +3463,7 @@ export const V2GetAccountRateLimitsResponse__PlanType = Schema.Literals([ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", @@ -3164,6 +3473,20 @@ export const V2GetAccountRateLimitsResponse__PlanType = Schema.Literals([ "unknown", ]); +export type V2GetAccountRateLimitsResponse__RateLimitReachedType = + | "rate_limit_reached" + | "workspace_owner_credits_depleted" + | "workspace_member_credits_depleted" + | "workspace_owner_usage_limit_reached" + | "workspace_member_usage_limit_reached"; +export const V2GetAccountRateLimitsResponse__RateLimitReachedType = Schema.Literals([ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached", +]); + export type V2GetAccountRateLimitsResponse__RateLimitWindow = { readonly resetsAt?: number | null; readonly usedPercent: number; @@ -3184,6 +3507,7 @@ export type V2GetAccountResponse__PlanType = | "go" | "plus" | "pro" + | "prolite" | "team" | "self_serve_business_usage_based" | "business" @@ -3196,6 +3520,7 @@ export const V2GetAccountResponse__PlanType = Schema.Literals([ "go", "plus", "pro", + "prolite", "team", "self_serve_business_usage_based", "business", @@ -3205,14 +3530,22 @@ export const V2GetAccountResponse__PlanType = Schema.Literals([ "unknown", ]); +export type V2HookCompletedNotification__AbsolutePathBuf = string; +export const V2HookCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2HookCompletedNotification__HookEventName = | "preToolUse" + | "permissionRequest" | "postToolUse" | "sessionStart" | "userPromptSubmit" | "stop"; export const V2HookCompletedNotification__HookEventName = Schema.Literals([ "preToolUse", + "permissionRequest", "postToolUse", "sessionStart", "userPromptSubmit", @@ -3260,14 +3593,22 @@ export const V2HookCompletedNotification__HookRunStatus = Schema.Literals([ export type V2HookCompletedNotification__HookScope = "thread" | "turn"; export const V2HookCompletedNotification__HookScope = Schema.Literals(["thread", "turn"]); +export type V2HookStartedNotification__AbsolutePathBuf = string; +export const V2HookStartedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2HookStartedNotification__HookEventName = | "preToolUse" + | "permissionRequest" | "postToolUse" | "sessionStart" | "userPromptSubmit" | "stop"; export const V2HookStartedNotification__HookEventName = Schema.Literals([ "preToolUse", + "permissionRequest", "postToolUse", "sessionStart", "userPromptSubmit", @@ -3315,6 +3656,12 @@ export const V2HookStartedNotification__HookRunStatus = Schema.Literals([ export type V2HookStartedNotification__HookScope = "thread" | "turn"; export const V2HookStartedNotification__HookScope = Schema.Literals(["thread", "turn"]); +export type V2ItemCompletedNotification__AbsolutePathBuf = string; +export const V2ItemCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2ItemCompletedNotification__CollabAgentStatus = | "pendingInit" | "running" @@ -3333,48 +3680,6 @@ export const V2ItemCompletedNotification__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ItemCompletedNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ItemCompletedNotification__CommandExecutionStatus = | "inProgress" | "completed" @@ -3584,12 +3889,71 @@ export const V2ItemCompletedNotification__WebSearchAction = Schema.Union( { mode: "oneOf" }, ); +export type V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf = string; +export const V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf = + Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + }); + +export type V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions = { + readonly enabled?: boolean | null; +}; +export const V2ItemGuardianApprovalReviewCompletedNotification__AdditionalNetworkPermissions = + Schema.Struct({ enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }); + export type V2ItemGuardianApprovalReviewCompletedNotification__AutoReviewDecisionSource = "agent"; export const V2ItemGuardianApprovalReviewCompletedNotification__AutoReviewDecisionSource = Schema.Literal("agent").annotate({ - description: "[UNSTABLE] Source that produced a terminal guardian approval review decision.", + description: "[UNSTABLE] Source that produced a terminal approval auto-review decision.", }); +export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode = + | "read" + | "write" + | "none"; +export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode = + Schema.Literals(["read", "write", "none"]); + +export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { readonly kind: "current_working_directory" } + | { readonly kind: "project_roots"; readonly subpath?: string | null } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { readonly kind: "unknown"; readonly path: string; readonly subpath?: string | null }; +export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath = + Schema.Union( + [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("current_working_directory") }).annotate({ + title: "CurrentWorkingDirectoryFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey(Schema.Union([Schema.String, 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([Schema.String, Schema.Null])), + }), + ], + { mode: "oneOf" }, + ); + export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus = | "inProgress" | "approved" @@ -3598,7 +3962,7 @@ export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalR | "aborted"; export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewStatus = Schema.Literals(["inProgress", "approved", "denied", "timedOut", "aborted"]).annotate({ - description: "[UNSTABLE] Lifecycle state for a guardian approval review.", + description: "[UNSTABLE] Lifecycle state for an approval auto-review.", }); export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource = @@ -3614,7 +3978,7 @@ export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel | "critical"; export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel = Schema.Literals( ["low", "medium", "high", "critical"], -).annotate({ description: "[UNSTABLE] Risk level assigned by guardian approval review." }); +).annotate({ description: "[UNSTABLE] Risk level assigned by approval auto-review." }); export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization = | "unknown" @@ -3623,7 +3987,7 @@ export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAutho | "high"; export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianUserAuthorization = Schema.Literals(["unknown", "low", "medium", "high"]).annotate({ - description: "[UNSTABLE] Authorization level assigned by guardian approval review.", + description: "[UNSTABLE] Authorization level assigned by approval auto-review.", }); export type V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol = @@ -3634,6 +3998,64 @@ export type V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalPr export const V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol = Schema.Literals(["http", "https", "socks5Tcp", "socks5Udp"]); +export type V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf = string; +export const V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf = + Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + }); + +export type V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions = { + readonly enabled?: boolean | null; +}; +export const V2ItemGuardianApprovalReviewStartedNotification__AdditionalNetworkPermissions = + Schema.Struct({ enabled: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])) }); + +export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode = + | "read" + | "write" + | "none"; +export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode = + Schema.Literals(["read", "write", "none"]); + +export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath = + | { readonly kind: "root" } + | { readonly kind: "minimal" } + | { readonly kind: "current_working_directory" } + | { readonly kind: "project_roots"; readonly subpath?: string | null } + | { readonly kind: "tmpdir" } + | { readonly kind: "slash_tmp" } + | { readonly kind: "unknown"; readonly path: string; readonly subpath?: string | null }; +export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath = Schema.Union( + [ + Schema.Struct({ kind: Schema.Literal("root") }).annotate({ + title: "RootFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("minimal") }).annotate({ + title: "MinimalFileSystemSpecialPath", + }), + Schema.Struct({ kind: Schema.Literal("current_working_directory") }).annotate({ + title: "CurrentWorkingDirectoryFileSystemSpecialPath", + }), + Schema.Struct({ + kind: Schema.Literal("project_roots"), + subpath: Schema.optionalKey(Schema.Union([Schema.String, 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([Schema.String, Schema.Null])), + }), + ], + { mode: "oneOf" }, +); + export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus = | "inProgress" | "approved" @@ -3642,7 +4064,7 @@ export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalRev | "aborted"; export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewStatus = Schema.Literals(["inProgress", "approved", "denied", "timedOut", "aborted"]).annotate({ - description: "[UNSTABLE] Lifecycle state for a guardian approval review.", + description: "[UNSTABLE] Lifecycle state for an approval auto-review.", }); export type V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource = @@ -3661,7 +4083,7 @@ export const V2ItemGuardianApprovalReviewStartedNotification__GuardianRiskLevel "medium", "high", "critical", -]).annotate({ description: "[UNSTABLE] Risk level assigned by guardian approval review." }); +]).annotate({ description: "[UNSTABLE] Risk level assigned by approval auto-review." }); export type V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization = | "unknown" @@ -3670,7 +4092,7 @@ export type V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthori | "high"; export const V2ItemGuardianApprovalReviewStartedNotification__GuardianUserAuthorization = Schema.Literals(["unknown", "low", "medium", "high"]).annotate({ - description: "[UNSTABLE] Authorization level assigned by guardian approval review.", + description: "[UNSTABLE] Authorization level assigned by approval auto-review.", }); export type V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol = @@ -3681,6 +4103,12 @@ export type V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProt export const V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol = Schema.Literals(["http", "https", "socks5Tcp", "socks5Udp"]); +export type V2ItemStartedNotification__AbsolutePathBuf = string; +export const V2ItemStartedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2ItemStartedNotification__CollabAgentStatus = | "pendingInit" | "running" @@ -3699,48 +4127,6 @@ export const V2ItemStartedNotification__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ItemStartedNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ItemStartedNotification__CommandExecutionStatus = | "inProgress" | "completed" @@ -4031,6 +4417,18 @@ export const V2ListMcpServerStatusResponse__Tool = Schema.Struct({ title: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }).annotate({ description: "Definition for a tool the client can call." }); +export type V2MarketplaceAddResponse__AbsolutePathBuf = string; +export const V2MarketplaceAddResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + +export type V2MarketplaceRemoveResponse__AbsolutePathBuf = string; +export const V2MarketplaceRemoveResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2McpResourceReadResponse__ResourceContent = | { readonly _meta?: unknown; @@ -4209,50 +4607,11 @@ export const V2PluginReadResponse__PluginInstallPolicy = Schema.Literals([ "INSTALLED_BY_DEFAULT", ]); -export type V2PluginReadResponse__SkillInterface = { - readonly brandColor?: string | null; - readonly defaultPrompt?: string | null; - readonly displayName?: string | null; - readonly iconLarge?: string | null; - readonly iconSmall?: string | null; - readonly shortDescription?: string | null; -}; -export const V2PluginReadResponse__SkillInterface = Schema.Struct({ - brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - defaultPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconLarge: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconSmall: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - -export type V2RawResponseItemCompletedNotification__ContentItem = - | { readonly text: string; readonly type: "input_text" } - | { readonly image_url: string; readonly type: "input_image" } - | { readonly text: string; readonly type: "output_text" }; -export const V2RawResponseItemCompletedNotification__ContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), - }).annotate({ title: "InputTextContentItem" }), - Schema.Struct({ - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), - }).annotate({ title: "InputImageContentItem" }), - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), - }).annotate({ title: "OutputTextContentItem" }), - ], - { mode: "oneOf" }, -); - -export type V2RawResponseItemCompletedNotification__GhostCommit = { - readonly id: string; - readonly parent?: string | null; - readonly preexisting_untracked_dirs: ReadonlyArray; - readonly preexisting_untracked_files: ReadonlyArray; +export type V2RawResponseItemCompletedNotification__GhostCommit = { + readonly id: string; + readonly parent?: string | null; + readonly preexisting_untracked_dirs: ReadonlyArray; + readonly preexisting_untracked_files: ReadonlyArray; }; export const V2RawResponseItemCompletedNotification__GhostCommit = Schema.Struct({ id: Schema.String, @@ -4449,6 +4808,12 @@ export const V2ReviewStartParams__ReviewTarget = Schema.Union( { mode: "oneOf" }, ); +export type V2ReviewStartResponse__AbsolutePathBuf = string; +export const V2ReviewStartResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2ReviewStartResponse__CollabAgentStatus = | "pendingInit" | "running" @@ -4467,48 +4832,6 @@ export const V2ReviewStartResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ReviewStartResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ReviewStartResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -4728,6 +5051,20 @@ export const V2ReviewStartResponse__WebSearchAction = Schema.Union( { mode: "oneOf" }, ); +export type V2SendAddCreditsNudgeEmailParams__AddCreditsNudgeCreditType = "credits" | "usage_limit"; +export const V2SendAddCreditsNudgeEmailParams__AddCreditsNudgeCreditType = Schema.Literals([ + "credits", + "usage_limit", +]); + +export type V2SendAddCreditsNudgeEmailResponse__AddCreditsNudgeEmailStatus = + | "sent" + | "cooldown_active"; +export const V2SendAddCreditsNudgeEmailResponse__AddCreditsNudgeEmailStatus = Schema.Literals([ + "sent", + "cooldown_active", +]); + export type V2ServerRequestResolvedNotification__RequestId = string | number; export const V2ServerRequestResolvedNotification__RequestId = Schema.Union([ Schema.String, @@ -4749,6 +5086,12 @@ export const V2SkillsListParams__SkillsListExtraRootsForCwd = Schema.Struct({ extraUserRoots: Schema.Array(Schema.String), }); +export type V2SkillsListResponse__AbsolutePathBuf = string; +export const V2SkillsListResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2SkillsListResponse__SkillErrorInfo = { readonly message: string; readonly path: string; @@ -4758,23 +5101,6 @@ export const V2SkillsListResponse__SkillErrorInfo = Schema.Struct({ path: Schema.String, }); -export type V2SkillsListResponse__SkillInterface = { - readonly brandColor?: string | null; - readonly defaultPrompt?: string | null; - readonly displayName?: string | null; - readonly iconLarge?: string | null; - readonly iconSmall?: string | null; - readonly shortDescription?: string | null; -}; -export const V2SkillsListResponse__SkillInterface = Schema.Struct({ - brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - defaultPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconLarge: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - iconSmall: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); - export type V2SkillsListResponse__SkillScope = "user" | "repo" | "system" | "admin"; export const V2SkillsListResponse__SkillScope = Schema.Literals([ "user", @@ -4909,48 +5235,6 @@ export const V2ThreadForkResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ThreadForkResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadForkResponse__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadForkResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -5193,6 +5477,9 @@ export const V2ThreadForkResponse__WebSearchAction = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadListParams__SortDirection = "asc" | "desc"; +export const V2ThreadListParams__SortDirection = Schema.Literals(["asc", "desc"]); + export type V2ThreadListParams__ThreadSortKey = "created_at" | "updated_at"; export const V2ThreadListParams__ThreadSortKey = Schema.Literals(["created_at", "updated_at"]); @@ -5220,6 +5507,12 @@ export const V2ThreadListParams__ThreadSourceKind = Schema.Literals([ "unknown", ]); +export type V2ThreadListResponse__AbsolutePathBuf = string; +export const V2ThreadListResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2ThreadListResponse__AgentPath = string; export const V2ThreadListResponse__AgentPath = Schema.String; @@ -5241,48 +5534,6 @@ export const V2ThreadListResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ThreadListResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadListResponse__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadListResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -5557,6 +5808,12 @@ export const V2ThreadMetadataUpdateParams__ThreadMetadataGitInfoUpdateParams = S ), }); +export type V2ThreadMetadataUpdateResponse__AbsolutePathBuf = string; +export const V2ThreadMetadataUpdateResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2ThreadMetadataUpdateResponse__AgentPath = string; export const V2ThreadMetadataUpdateResponse__AgentPath = Schema.String; @@ -5578,48 +5835,6 @@ export const V2ThreadMetadataUpdateResponse__CollabAgentStatus = Schema.Literals "notFound", ]); -export type V2ThreadMetadataUpdateResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadMetadataUpdateResponse__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadMetadataUpdateResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -5872,6 +6087,12 @@ export const V2ThreadMetadataUpdateResponse__WebSearchAction = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadReadResponse__AbsolutePathBuf = string; +export const V2ThreadReadResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2ThreadReadResponse__AgentPath = string; export const V2ThreadReadResponse__AgentPath = Schema.String; @@ -5893,48 +6114,6 @@ export const V2ThreadReadResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ThreadReadResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadReadResponse__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadReadResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -6247,28 +6426,6 @@ export const V2ThreadResumeParams__AskForApproval = Schema.Union( { mode: "oneOf" }, ); -export type V2ThreadResumeParams__ContentItem = - | { readonly text: string; readonly type: "input_text" } - | { readonly image_url: string; readonly type: "input_image" } - | { readonly text: string; readonly type: "output_text" }; -export const V2ThreadResumeParams__ContentItem = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), - }).annotate({ title: "InputTextContentItem" }), - Schema.Struct({ - image_url: Schema.String, - type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), - }).annotate({ title: "InputImageContentItem" }), - Schema.Struct({ - text: Schema.String, - type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), - }).annotate({ title: "OutputTextContentItem" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadResumeParams__GhostCommit = { readonly id: string; readonly parent?: string | null; @@ -6485,48 +6642,6 @@ export const V2ThreadResumeResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ThreadResumeResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadResumeResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -6769,6 +6884,12 @@ export const V2ThreadResumeResponse__WebSearchAction = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadRollbackResponse__AbsolutePathBuf = string; +export const V2ThreadRollbackResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2ThreadRollbackResponse__AgentPath = string; export const V2ThreadRollbackResponse__AgentPath = Schema.String; @@ -6790,48 +6911,6 @@ export const V2ThreadRollbackResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ThreadRollbackResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadRollbackResponse__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadRollbackResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -7074,6 +7153,12 @@ export const V2ThreadRollbackResponse__WebSearchAction = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadStartedNotification__AbsolutePathBuf = string; +export const V2ThreadStartedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2ThreadStartedNotification__AgentPath = string; export const V2ThreadStartedNotification__AgentPath = Schema.String; @@ -7095,48 +7180,6 @@ export const V2ThreadStartedNotification__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ThreadStartedNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadStartedNotification__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadStartedNotification__CommandExecutionStatus = | "inProgress" | "completed" @@ -7501,48 +7544,6 @@ export const V2ThreadStartResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ThreadStartResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadStartResponse__CommandAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2ThreadStartResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -7808,10 +7809,16 @@ export const V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown = Schema totalTokens: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), }); -export type V2ThreadUnarchiveResponse__AgentPath = string; -export const V2ThreadUnarchiveResponse__AgentPath = Schema.String; +export type V2ThreadTurnsListParams__SortDirection = "asc" | "desc"; +export const V2ThreadTurnsListParams__SortDirection = Schema.Literals(["asc", "desc"]); -export type V2ThreadUnarchiveResponse__CollabAgentStatus = +export type V2ThreadTurnsListResponse__AbsolutePathBuf = string; +export const V2ThreadTurnsListResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + +export type V2ThreadTurnsListResponse__CollabAgentStatus = | "pendingInit" | "running" | "interrupted" @@ -7819,7 +7826,7 @@ export type V2ThreadUnarchiveResponse__CollabAgentStatus = | "errored" | "shutdown" | "notFound"; -export const V2ThreadUnarchiveResponse__CollabAgentStatus = Schema.Literals([ +export const V2ThreadTurnsListResponse__CollabAgentStatus = Schema.Literals([ "pendingInit", "running", "interrupted", @@ -7829,48 +7836,260 @@ export const V2ThreadUnarchiveResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2ThreadUnarchiveResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - readonly type: "read"; - } - | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } - | { - readonly command: string; - readonly path?: string | null; - readonly query?: string | null; - readonly type: "search"; - } - | { readonly command: string; readonly type: "unknown" }; -export const V2ThreadUnarchiveResponse__CommandAction = Schema.Union( +export type V2ThreadTurnsListResponse__CommandExecutionStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadTurnsListResponse__CommandExecutionStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]); + +export type V2ThreadTurnsListResponse__DynamicToolCallOutputContentItem = + | { readonly text: string; readonly type: "inputText" } + | { readonly imageUrl: string; readonly type: "inputImage" }; +export const V2ThreadTurnsListResponse__DynamicToolCallOutputContentItem = Schema.Union( [ Schema.Struct({ - command: Schema.String, - name: Schema.String, - path: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), + text: Schema.String, + type: Schema.Literal("inputText").annotate({ + title: "InputTextDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputTextDynamicToolCallOutputContentItem" }), Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), + imageUrl: Schema.String, + type: Schema.Literal("inputImage").annotate({ + title: "InputImageDynamicToolCallOutputContentItemType", + }), + }).annotate({ title: "InputImageDynamicToolCallOutputContentItem" }), + ], + { mode: "oneOf" }, +); + +export type V2ThreadTurnsListResponse__DynamicToolCallStatus = + | "inProgress" + | "completed" + | "failed"; +export const V2ThreadTurnsListResponse__DynamicToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]); + +export type V2ThreadTurnsListResponse__HookPromptFragment = { + readonly hookRunId: string; + readonly text: string; +}; +export const V2ThreadTurnsListResponse__HookPromptFragment = Schema.Struct({ + hookRunId: Schema.String, + text: Schema.String, +}); + +export type V2ThreadTurnsListResponse__McpToolCallError = { readonly message: string }; +export const V2ThreadTurnsListResponse__McpToolCallError = Schema.Struct({ + message: Schema.String, +}); + +export type V2ThreadTurnsListResponse__McpToolCallResult = { + readonly _meta?: unknown; + readonly content: ReadonlyArray; + readonly structuredContent?: unknown; +}; +export const V2ThreadTurnsListResponse__McpToolCallResult = Schema.Struct({ + _meta: Schema.optionalKey(Schema.Unknown), + content: Schema.Array(Schema.Unknown), + structuredContent: Schema.optionalKey(Schema.Unknown), +}); + +export type V2ThreadTurnsListResponse__McpToolCallStatus = "inProgress" | "completed" | "failed"; +export const V2ThreadTurnsListResponse__McpToolCallStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", +]); + +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()) + .check(Schema.isGreaterThanOrEqualTo(0)), + lineStart: Schema.Number.annotate({ format: "uint32" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + note: Schema.String, + path: Schema.String, +}); + +export type V2ThreadTurnsListResponse__MessagePhase = "commentary" | "final_answer"; +export const V2ThreadTurnsListResponse__MessagePhase = Schema.Literals([ + "commentary", + "final_answer", +]).annotate({ + description: + 'Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as "phase unknown" and keep compatibility behavior for legacy models.', +}); + +export type V2ThreadTurnsListResponse__NonSteerableTurnKind = "review" | "compact"; +export const V2ThreadTurnsListResponse__NonSteerableTurnKind = Schema.Literals([ + "review", + "compact", +]); + +export type V2ThreadTurnsListResponse__PatchApplyStatus = + | "inProgress" + | "completed" + | "failed" + | "declined"; +export const V2ThreadTurnsListResponse__PatchApplyStatus = Schema.Literals([ + "inProgress", + "completed", + "failed", + "declined", +]); + +export type V2ThreadTurnsListResponse__PatchChangeKind = + | { readonly type: "add" } + | { readonly type: "delete" } + | { readonly move_path?: string | null; readonly type: "update" }; +export const V2ThreadTurnsListResponse__PatchChangeKind = Schema.Union( + [ Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("add").annotate({ title: "AddPatchChangeKindType" }), + }).annotate({ title: "AddPatchChangeKind" }), + Schema.Struct({ + type: Schema.Literal("delete").annotate({ title: "DeletePatchChangeKindType" }), + }).annotate({ title: "DeletePatchChangeKind" }), + Schema.Struct({ + move_path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("update").annotate({ title: "UpdatePatchChangeKindType" }), + }).annotate({ title: "UpdatePatchChangeKind" }), + ], + { mode: "oneOf" }, +); + +export type V2ThreadTurnsListResponse__ReasoningEffort = + | "none" + | "minimal" + | "low" + | "medium" + | "high" + | "xhigh"; +export const V2ThreadTurnsListResponse__ReasoningEffort = Schema.Literals([ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh", +]).annotate({ + description: + "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", +}); + +export type V2ThreadTurnsListResponse__TextElement = { + readonly byteRange: { readonly end: number; readonly start: number }; + readonly placeholder?: string | null; +}; +export const V2ThreadTurnsListResponse__TextElement = Schema.Struct({ + byteRange: Schema.Struct({ + end: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + start: Schema.Number.annotate({ format: "uint" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + }).annotate({ + description: "Byte range in the parent `text` buffer that this element occupies.", + }), + placeholder: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional human-readable placeholder for the element, displayed in the UI.", + }), + Schema.Null, + ]), + ), +}); + +export type V2ThreadTurnsListResponse__TurnStatus = + | "completed" + | "interrupted" + | "failed" + | "inProgress"; +export const V2ThreadTurnsListResponse__TurnStatus = Schema.Literals([ + "completed", + "interrupted", + "failed", + "inProgress", +]); + +export type V2ThreadTurnsListResponse__WebSearchAction = + | { + readonly queries?: ReadonlyArray | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly type: "openPage"; readonly url?: string | null } + | { readonly pattern?: string | null; readonly type: "findInPage"; readonly url?: string | null } + | { readonly type: "other" }; +export const V2ThreadTurnsListResponse__WebSearchAction = Schema.Union( + [ + Schema.Struct({ + queries: Schema.optionalKey(Schema.Union([Schema.Array(Schema.String), Schema.Null])), query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), + type: Schema.Literal("search").annotate({ title: "SearchWebSearchActionType" }), + }).annotate({ title: "SearchWebSearchAction" }), Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), + type: Schema.Literal("openPage").annotate({ title: "OpenPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "OpenPageWebSearchAction" }), + Schema.Struct({ + pattern: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("findInPage").annotate({ title: "FindInPageWebSearchActionType" }), + url: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + }).annotate({ title: "FindInPageWebSearchAction" }), + Schema.Struct({ + type: Schema.Literal("other").annotate({ title: "OtherWebSearchActionType" }), + }).annotate({ title: "OtherWebSearchAction" }), ], { mode: "oneOf" }, ); +export type V2ThreadUnarchiveResponse__AbsolutePathBuf = string; +export const V2ThreadUnarchiveResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + +export type V2ThreadUnarchiveResponse__AgentPath = string; +export const V2ThreadUnarchiveResponse__AgentPath = Schema.String; + +export type V2ThreadUnarchiveResponse__CollabAgentStatus = + | "pendingInit" + | "running" + | "interrupted" + | "completed" + | "errored" + | "shutdown" + | "notFound"; +export const V2ThreadUnarchiveResponse__CollabAgentStatus = Schema.Literals([ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound", +]); + export type V2ThreadUnarchiveResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -8130,6 +8349,12 @@ export const V2ThreadUnsubscribeResponse__ThreadUnsubscribeStatus = Schema.Liter "unsubscribed", ]); +export type V2TurnCompletedNotification__AbsolutePathBuf = string; +export const V2TurnCompletedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2TurnCompletedNotification__CollabAgentStatus = | "pendingInit" | "running" @@ -8148,48 +8373,6 @@ export const V2TurnCompletedNotification__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2TurnCompletedNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2TurnCompletedNotification__CommandExecutionStatus = | "inProgress" | "completed" @@ -8427,6 +8610,12 @@ export const V2TurnPlanUpdatedNotification__TurnPlanStepStatus = Schema.Literals "completed", ]); +export type V2TurnStartedNotification__AbsolutePathBuf = string; +export const V2TurnStartedNotification__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2TurnStartedNotification__CollabAgentStatus = | "pendingInit" | "running" @@ -8445,48 +8634,6 @@ export const V2TurnStartedNotification__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2TurnStartedNotification__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2TurnStartedNotification__CommandExecutionStatus = | "inProgress" | "completed" @@ -8826,6 +8973,12 @@ export const V2TurnStartParams__TextElement = Schema.Struct({ ), }); +export type V2TurnStartResponse__AbsolutePathBuf = string; +export const V2TurnStartResponse__AbsolutePathBuf = Schema.String.annotate({ + description: + "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", +}); + export type V2TurnStartResponse__CollabAgentStatus = | "pendingInit" | "running" @@ -8844,48 +8997,6 @@ export const V2TurnStartResponse__CollabAgentStatus = Schema.Literals([ "notFound", ]); -export type V2TurnStartResponse__CommandAction = - | { - readonly command: string; - readonly name: string; - readonly path: string; - 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: Schema.String, - type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), - }).annotate({ title: "ReadCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), - }).annotate({ title: "ListFilesCommandAction" }), - Schema.Struct({ - command: Schema.String, - path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), - }).annotate({ title: "SearchCommandAction" }), - Schema.Struct({ - command: Schema.String, - type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), - }).annotate({ title: "UnknownCommandAction" }), - ], - { mode: "oneOf" }, -); - export type V2TurnStartResponse__CommandExecutionStatus = | "inProgress" | "completed" @@ -9156,23 +9267,18 @@ export const ApplyPatchApprovalResponse__NetworkPolicyAmendment = Schema.Struct( }); export type ClientRequest__PluginInstallParams = { - readonly forceRemoteSync?: boolean; - readonly marketplacePath: ClientRequest__AbsolutePathBuf; + readonly marketplacePath?: ClientRequest__AbsolutePathBuf | null; readonly pluginName: string; + readonly remoteMarketplaceName?: string | null; }; export const ClientRequest__PluginInstallParams = Schema.Struct({ - forceRemoteSync: Schema.optionalKey( - Schema.Boolean.annotate({ - description: "When true, apply the remote plugin change before the local install flow.", - }), - ), - marketplacePath: ClientRequest__AbsolutePathBuf, + marketplacePath: Schema.optionalKey(Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null])), pluginName: Schema.String, + remoteMarketplaceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); export type ClientRequest__PluginListParams = { readonly cwds?: ReadonlyArray | null; - readonly forceRemoteSync?: boolean; }; export const ClientRequest__PluginListParams = Schema.Struct({ cwds: Schema.optionalKey( @@ -9184,21 +9290,17 @@ export const ClientRequest__PluginListParams = Schema.Struct({ Schema.Null, ]), ), - forceRemoteSync: Schema.optionalKey( - Schema.Boolean.annotate({ - description: - "When true, reconcile the official curated marketplace against the remote plugin state before listing marketplaces.", - }), - ), }); export type ClientRequest__PluginReadParams = { - readonly marketplacePath: ClientRequest__AbsolutePathBuf; + readonly marketplacePath?: ClientRequest__AbsolutePathBuf | null; readonly pluginName: string; + readonly remoteMarketplaceName?: string | null; }; export const ClientRequest__PluginReadParams = Schema.Struct({ - marketplacePath: ClientRequest__AbsolutePathBuf, + marketplacePath: Schema.optionalKey(Schema.Union([ClientRequest__AbsolutePathBuf, Schema.Null])), pluginName: Schema.String, + remoteMarketplaceName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); export type ClientRequest__SandboxPolicy = @@ -9324,25 +9426,55 @@ export const ClientRequest__SkillsConfigWriteParams = Schema.Struct({ ), }); -export type ClientRequest__ExternalAgentConfigMigrationItem = { - readonly cwd?: string | null; - readonly description: string; - readonly itemType: ClientRequest__ExternalAgentConfigMigrationItemType; +export type ClientRequest__SendAddCreditsNudgeEmailParams = { + readonly creditType: ClientRequest__AddCreditsNudgeCreditType; }; -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, - itemType: ClientRequest__ExternalAgentConfigMigrationItemType, +export const ClientRequest__SendAddCreditsNudgeEmailParams = Schema.Struct({ + creditType: ClientRequest__AddCreditsNudgeCreditType, }); +export type ClientRequest__DeviceKeyCreateParams = { + readonly accountUserId: string; + readonly clientId: string; + readonly protectionPolicy?: ClientRequest__DeviceKeyProtectionPolicy | null; +}; +export const ClientRequest__DeviceKeyCreateParams = Schema.Struct({ + accountUserId: Schema.String, + clientId: Schema.String, + protectionPolicy: Schema.optionalKey( + Schema.Union([ClientRequest__DeviceKeyProtectionPolicy, Schema.Null]).annotate({ + description: "Defaults to `hardware_only` when omitted.", + }), + ), +}).annotate({ description: "Create a controller-local device key with a random key id." }); + +export type ClientRequest__ContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: ClientRequest__ImageDetail | null; + readonly image_url: string; + readonly type: "input_image"; + } + | { readonly 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.Struct({ + detail: Schema.optionalKey(Schema.Union([ClientRequest__ImageDetail, Schema.Null])), + image_url: Schema.String, + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + }).annotate({ title: "InputImageContentItem" }), + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), + }).annotate({ title: "OutputTextContentItem" }), + ], + { mode: "oneOf" }, +); + export type ClientRequest__FunctionCallOutputContentItem = | { readonly text: string; readonly type: "input_text" } | { @@ -9450,6 +9582,13 @@ export const ClientRequest__ConfigValueWriteParams = Schema.Struct({ value: Schema.Unknown, }); +export type ClientRequest__MigrationDetails = { + readonly plugins: ReadonlyArray; +}; +export const ClientRequest__MigrationDetails = Schema.Struct({ + plugins: Schema.Array(ClientRequest__PluginsMigration), +}); + export type ClientRequest__Settings = { readonly developer_instructions?: string | null; readonly model: string; @@ -9461,6 +9600,102 @@ export const ClientRequest__Settings = Schema.Struct({ reasoning_effort: Schema.optionalKey(Schema.Union([ClientRequest__ReasoningEffort, Schema.Null])), }).annotate({ description: "Settings for a collaboration mode." }); +export type ClientRequest__DeviceKeySignPayload = + | { + readonly accountUserId: string; + readonly audience: ClientRequest__RemoteControlClientConnectionAudience; + readonly clientId: string; + readonly nonce: string; + readonly scopes: ReadonlyArray; + readonly sessionId: string; + readonly targetOrigin: string; + readonly targetPath: string; + readonly tokenExpiresAt: number; + readonly tokenSha256Base64url: string; + readonly type: "remoteControlClientConnection"; + } + | { + readonly accountUserId: string; + readonly audience: ClientRequest__RemoteControlClientEnrollmentAudience; + readonly challengeExpiresAt: number; + readonly challengeId: string; + readonly clientId: string; + readonly deviceIdentitySha256Base64url: string; + readonly nonce: string; + readonly targetOrigin: string; + readonly targetPath: string; + readonly type: "remoteControlClientEnrollment"; + }; +export const ClientRequest__DeviceKeySignPayload = Schema.Union( + [ + Schema.Struct({ + accountUserId: Schema.String, + audience: ClientRequest__RemoteControlClientConnectionAudience, + clientId: Schema.String, + nonce: Schema.String, + scopes: Schema.Array(Schema.String).annotate({ + description: "Must contain exactly `remote_control_controller_websocket`.", + }), + sessionId: Schema.String.annotate({ + description: "Backend-issued websocket session id that this proof authorizes.", + }), + targetOrigin: Schema.String.annotate({ + description: + "Origin of the backend endpoint that issued the challenge and will verify this proof.", + }), + targetPath: Schema.String.annotate({ + description: "Websocket route path that this proof authorizes.", + }), + tokenExpiresAt: Schema.Number.annotate({ + description: "Remote-control token expiration as Unix seconds.", + format: "int64", + }).check(Schema.isInt()), + tokenSha256Base64url: Schema.String.annotate({ + description: + "SHA-256 of the controller-scoped remote-control token, encoded as unpadded base64url.", + }), + type: Schema.Literal("remoteControlClientConnection").annotate({ + title: "RemoteControlClientConnectionDeviceKeySignPayloadType", + }), + }).annotate({ + title: "RemoteControlClientConnectionDeviceKeySignPayload", + description: + "Payload bound to one remote-control controller websocket `/client` connection challenge.", + }), + Schema.Struct({ + accountUserId: Schema.String, + audience: ClientRequest__RemoteControlClientEnrollmentAudience, + challengeExpiresAt: Schema.Number.annotate({ + description: "Enrollment challenge expiration as Unix seconds.", + format: "int64", + }).check(Schema.isInt()), + challengeId: Schema.String.annotate({ + description: "Backend-issued enrollment challenge id that this proof authorizes.", + }), + clientId: Schema.String, + deviceIdentitySha256Base64url: Schema.String.annotate({ + description: + "SHA-256 of the requested device identity operation, encoded as unpadded base64url.", + }), + nonce: Schema.String, + targetOrigin: Schema.String.annotate({ + description: + "Origin of the backend endpoint that issued the challenge and will verify this proof.", + }), + targetPath: Schema.String.annotate({ + description: "HTTP route path that this proof authorizes.", + }), + type: Schema.Literal("remoteControlClientEnrollment").annotate({ + title: "RemoteControlClientEnrollmentDeviceKeySignPayloadType", + }), + }).annotate({ + title: "RemoteControlClientEnrollmentDeviceKeySignPayload", + description: "Payload bound to a remote-control client `/client/enroll` ownership challenge.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: "Structured payloads accepted by `device/key/sign`." }); + export type ClientRequest__ReviewStartParams = { readonly delivery?: ClientRequest__ReviewDelivery | null; readonly target: ClientRequest__ReviewTarget; @@ -9599,6 +9834,37 @@ export const ClientRequest__SkillsListParams = Schema.Struct({ ), }); +export type ClientRequest__ThreadTurnsListParams = { + readonly cursor?: string | null; + readonly limit?: number | null; + readonly sortDirection?: ClientRequest__SortDirection | null; + readonly threadId: string; +}; +export const ClientRequest__ThreadTurnsListParams = Schema.Struct({ + cursor: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Opaque cursor to pass to the next call to continue after the last turn.", + }), + Schema.Null, + ]), + ), + limit: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ description: "Optional turn page size.", format: "uint32" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Null, + ]), + ), + sortDirection: Schema.optionalKey( + Schema.Union([ClientRequest__SortDirection, Schema.Null]).annotate({ + description: "Optional turn pagination direction; defaults to descending.", + }), + ), + threadId: Schema.String, +}); + export type ClientRequest__UserInput = | { readonly text: string; @@ -9664,6 +9930,7 @@ export type ClientRequest__ThreadListParams = { readonly limit?: number | null; readonly modelProviders?: ReadonlyArray | null; readonly searchTerm?: string | null; + readonly sortDirection?: ClientRequest__SortDirection | null; readonly sortKey?: ClientRequest__ThreadSortKey | null; readonly sourceKinds?: ReadonlyArray | null; }; @@ -9722,6 +9989,11 @@ export const ClientRequest__ThreadListParams = Schema.Struct({ 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.", @@ -9791,32 +10063,78 @@ export const ClientRequest__WindowsSandboxSetupStartParams = Schema.Struct({ mode: ClientRequest__WindowsSandboxSetupMode, }); -export type CommandExecutionRequestApprovalParams__AdditionalFileSystemPermissions = { - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; -}; -export const CommandExecutionRequestApprovalParams__AdditionalFileSystemPermissions = Schema.Struct( - { - read: Schema.optionalKey( - Schema.Union([ - Schema.Array(CommandExecutionRequestApprovalParams__AbsolutePathBuf), - Schema.Null, - ]), - ), - write: Schema.optionalKey( - Schema.Union([ - Schema.Array(CommandExecutionRequestApprovalParams__AbsolutePathBuf), - Schema.Null, - ]), - ), - }, +export type CommandExecutionRequestApprovalParams__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: CommandExecutionRequestApprovalParams__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const CommandExecutionRequestApprovalParams__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: CommandExecutionRequestApprovalParams__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, ); -export type CommandExecutionRequestApprovalParams__NetworkApprovalContext = { - readonly host: string; - readonly protocol: CommandExecutionRequestApprovalParams__NetworkApprovalProtocol; -}; -export const CommandExecutionRequestApprovalParams__NetworkApprovalContext = Schema.Struct({ +export type CommandExecutionRequestApprovalParams__FileSystemPath = + | { readonly path: CommandExecutionRequestApprovalParams__AbsolutePathBuf; readonly type: "path" } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: CommandExecutionRequestApprovalParams__FileSystemSpecialPath; + }; +export const CommandExecutionRequestApprovalParams__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: CommandExecutionRequestApprovalParams__AbsolutePathBuf, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: CommandExecutionRequestApprovalParams__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +); + +export type CommandExecutionRequestApprovalParams__NetworkApprovalContext = { + readonly host: string; + readonly protocol: CommandExecutionRequestApprovalParams__NetworkApprovalProtocol; +}; +export const CommandExecutionRequestApprovalParams__NetworkApprovalContext = Schema.Struct({ host: Schema.String, protocol: CommandExecutionRequestApprovalParams__NetworkApprovalProtocol, }); @@ -10085,31 +10403,97 @@ export const McpServerElicitationRequestParams__McpElicitationUntitledSingleSele type: McpServerElicitationRequestParams__McpElicitationStringType, }); -export type PermissionsRequestApprovalParams__AdditionalFileSystemPermissions = { - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; -}; -export const PermissionsRequestApprovalParams__AdditionalFileSystemPermissions = Schema.Struct({ - read: Schema.optionalKey( - Schema.Union([Schema.Array(PermissionsRequestApprovalParams__AbsolutePathBuf), Schema.Null]), - ), - write: Schema.optionalKey( - Schema.Union([Schema.Array(PermissionsRequestApprovalParams__AbsolutePathBuf), Schema.Null]), - ), -}); +export type PermissionsRequestApprovalParams__FileSystemPath = + | { readonly path: PermissionsRequestApprovalParams__AbsolutePathBuf; readonly type: "path" } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: PermissionsRequestApprovalParams__FileSystemSpecialPath; + }; +export const PermissionsRequestApprovalParams__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: PermissionsRequestApprovalParams__AbsolutePathBuf, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: PermissionsRequestApprovalParams__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +); -export type PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions = { - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; -}; -export const PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions = Schema.Struct({ - read: Schema.optionalKey( - Schema.Union([Schema.Array(PermissionsRequestApprovalResponse__AbsolutePathBuf), Schema.Null]), - ), - write: Schema.optionalKey( - Schema.Union([Schema.Array(PermissionsRequestApprovalResponse__AbsolutePathBuf), Schema.Null]), - ), -}); +export type PermissionsRequestApprovalResponse__FileSystemPath = + | { readonly path: PermissionsRequestApprovalResponse__AbsolutePathBuf; readonly type: "path" } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: PermissionsRequestApprovalResponse__FileSystemSpecialPath; + }; +export const PermissionsRequestApprovalResponse__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: PermissionsRequestApprovalResponse__AbsolutePathBuf, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: PermissionsRequestApprovalResponse__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +); + +export type ServerNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: ServerNotification__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const ServerNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: ServerNotification__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); export type ServerNotification__FsChangedNotification = { readonly changedPaths: ReadonlyArray; @@ -10164,6 +10548,28 @@ export const ServerNotification__CollabAgentState = Schema.Struct({ status: ServerNotification__CollabAgentStatus, }); +export type ServerNotification__FileSystemPath = + | { readonly path: ServerNotification__AbsolutePathBuf; readonly type: "path" } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { readonly type: "special"; readonly value: ServerNotification__FileSystemSpecialPath }; +export const ServerNotification__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: ServerNotification__AbsolutePathBuf, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: ServerNotification__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +); + export type ServerNotification__FuzzyFileSearchResult = { readonly file_name: string; readonly indices?: ReadonlyArray | null; @@ -10207,7 +10613,7 @@ export const ServerNotification__GuardianApprovalReview = Schema.Struct({ ), }).annotate({ description: - "[UNSTABLE] Temporary guardian approval review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", }); export type ServerNotification__HookOutputEntry = { @@ -10254,85 +10660,6 @@ export const ServerNotification__ModelReroutedNotification = Schema.Struct({ turnId: Schema.String, }); -export type ServerNotification__GuardianApprovalReviewAction = - | { - readonly command: string; - readonly cwd: string; - readonly source: ServerNotification__GuardianCommandSource; - readonly type: "command"; - } - | { - readonly argv: ReadonlyArray; - readonly cwd: string; - readonly program: string; - readonly source: ServerNotification__GuardianCommandSource; - readonly type: "execve"; - } - | { readonly cwd: string; readonly files: ReadonlyArray; readonly type: "applyPatch" } - | { - readonly host: string; - readonly port: number; - readonly protocol: ServerNotification__NetworkApprovalProtocol; - readonly target: string; - readonly type: "networkAccess"; - } - | { - readonly connectorId?: string | null; - readonly connectorName?: string | null; - readonly server: string; - readonly toolName: string; - readonly toolTitle?: string | null; - readonly type: "mcpToolCall"; - }; -export const ServerNotification__GuardianApprovalReviewAction = Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - cwd: Schema.String, - source: ServerNotification__GuardianCommandSource, - type: Schema.Literal("command").annotate({ - title: "CommandGuardianApprovalReviewActionType", - }), - }).annotate({ title: "CommandGuardianApprovalReviewAction" }), - Schema.Struct({ - argv: Schema.Array(Schema.String), - cwd: Schema.String, - program: Schema.String, - source: ServerNotification__GuardianCommandSource, - type: Schema.Literal("execve").annotate({ title: "ExecveGuardianApprovalReviewActionType" }), - }).annotate({ title: "ExecveGuardianApprovalReviewAction" }), - Schema.Struct({ - cwd: Schema.String, - files: Schema.Array(Schema.String), - type: Schema.Literal("applyPatch").annotate({ - title: "ApplyPatchGuardianApprovalReviewActionType", - }), - }).annotate({ title: "ApplyPatchGuardianApprovalReviewAction" }), - Schema.Struct({ - host: Schema.String, - port: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - protocol: ServerNotification__NetworkApprovalProtocol, - target: Schema.String, - type: Schema.Literal("networkAccess").annotate({ - title: "NetworkAccessGuardianApprovalReviewActionType", - }), - }).annotate({ title: "NetworkAccessGuardianApprovalReviewAction" }), - Schema.Struct({ - connectorId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - server: Schema.String, - toolName: Schema.String, - toolTitle: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("mcpToolCall").annotate({ - title: "McpToolCallGuardianApprovalReviewActionType", - }), - }).annotate({ title: "McpToolCallGuardianApprovalReviewAction" }), - ], - { mode: "oneOf" }, -); - export type ServerNotification__CodexErrorInfo = | "contextWindowExceeded" | "usageLimitExceeded" @@ -10463,6 +10790,7 @@ export type ServerNotification__RateLimitSnapshot = { readonly limitName?: string | null; readonly planType?: ServerNotification__PlanType | null; readonly primary?: ServerNotification__RateLimitWindow | null; + readonly rateLimitReachedType?: ServerNotification__RateLimitReachedType | null; readonly secondary?: ServerNotification__RateLimitWindow | null; }; export const ServerNotification__RateLimitSnapshot = Schema.Struct({ @@ -10471,6 +10799,9 @@ export const ServerNotification__RateLimitSnapshot = Schema.Struct({ limitName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), planType: Schema.optionalKey(Schema.Union([ServerNotification__PlanType, Schema.Null])), primary: Schema.optionalKey(Schema.Union([ServerNotification__RateLimitWindow, Schema.Null])), + rateLimitReachedType: Schema.optionalKey( + Schema.Union([ServerNotification__RateLimitReachedType, Schema.Null]), + ), secondary: Schema.optionalKey(Schema.Union([ServerNotification__RateLimitWindow, Schema.Null])), }); @@ -10647,18 +10978,47 @@ export const ServerNotification__WindowsSandboxSetupCompletedNotification = Sche success: Schema.Boolean, }); -export type ServerRequest__AdditionalFileSystemPermissions = { - readonly read?: ReadonlyArray | null; - readonly write?: ReadonlyArray | null; -}; -export const ServerRequest__AdditionalFileSystemPermissions = Schema.Struct({ - read: Schema.optionalKey( - Schema.Union([Schema.Array(ServerRequest__AbsolutePathBuf), Schema.Null]), - ), - write: Schema.optionalKey( - Schema.Union([Schema.Array(ServerRequest__AbsolutePathBuf), Schema.Null]), - ), -}); +export type ServerRequest__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: ServerRequest__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const ServerRequest__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: ServerRequest__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); export type ServerRequest__ChatgptAuthTokensRefreshParams = { readonly previousAccountId?: string | null; @@ -10677,6 +11037,28 @@ export const ServerRequest__ChatgptAuthTokensRefreshParams = Schema.Struct({ reason: ServerRequest__ChatgptAuthTokensRefreshReason, }); +export type ServerRequest__FileSystemPath = + | { readonly path: ServerRequest__AbsolutePathBuf; readonly type: "path" } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { readonly type: "special"; readonly value: ServerRequest__FileSystemSpecialPath }; +export const ServerRequest__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: ServerRequest__AbsolutePathBuf, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: ServerRequest__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +); + export type ServerRequest__McpElicitationBooleanSchema = { readonly default?: boolean | null; readonly description?: string | null; @@ -10949,6 +11331,7 @@ export type V2AccountRateLimitsUpdatedNotification__RateLimitSnapshot = { readonly limitName?: string | null; readonly planType?: V2AccountRateLimitsUpdatedNotification__PlanType | null; readonly primary?: V2AccountRateLimitsUpdatedNotification__RateLimitWindow | null; + readonly rateLimitReachedType?: V2AccountRateLimitsUpdatedNotification__RateLimitReachedType | null; readonly secondary?: V2AccountRateLimitsUpdatedNotification__RateLimitWindow | null; }; export const V2AccountRateLimitsUpdatedNotification__RateLimitSnapshot = Schema.Struct({ @@ -10963,6 +11346,9 @@ export const V2AccountRateLimitsUpdatedNotification__RateLimitSnapshot = Schema. primary: Schema.optionalKey( Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitWindow, Schema.Null]), ), + rateLimitReachedType: Schema.optionalKey( + Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitReachedType, Schema.Null]), + ), secondary: Schema.optionalKey( Schema.Union([V2AccountRateLimitsUpdatedNotification__RateLimitWindow, Schema.Null]), ), @@ -11346,22 +11732,118 @@ export const V2ConfigWriteResponse__ConfigLayerSource = Schema.Union( { mode: "oneOf" }, ); -export type V2ErrorNotification__CodexErrorInfo = - | "contextWindowExceeded" - | "usageLimitExceeded" - | "serverOverloaded" - | "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: { +export type V2DeviceKeySignParams__DeviceKeySignPayload = + | { + readonly accountUserId: string; + readonly audience: V2DeviceKeySignParams__RemoteControlClientConnectionAudience; + readonly clientId: string; + readonly nonce: string; + readonly scopes: ReadonlyArray; + readonly sessionId: string; + readonly targetOrigin: string; + readonly targetPath: string; + readonly tokenExpiresAt: number; + readonly tokenSha256Base64url: string; + readonly type: "remoteControlClientConnection"; + } + | { + readonly accountUserId: string; + readonly audience: V2DeviceKeySignParams__RemoteControlClientEnrollmentAudience; + readonly challengeExpiresAt: number; + readonly challengeId: string; + readonly clientId: string; + readonly deviceIdentitySha256Base64url: string; + readonly nonce: string; + readonly targetOrigin: string; + readonly targetPath: string; + readonly type: "remoteControlClientEnrollment"; + }; +export const V2DeviceKeySignParams__DeviceKeySignPayload = Schema.Union( + [ + Schema.Struct({ + accountUserId: Schema.String, + audience: V2DeviceKeySignParams__RemoteControlClientConnectionAudience, + clientId: Schema.String, + nonce: Schema.String, + scopes: Schema.Array(Schema.String).annotate({ + description: "Must contain exactly `remote_control_controller_websocket`.", + }), + sessionId: Schema.String.annotate({ + description: "Backend-issued websocket session id that this proof authorizes.", + }), + targetOrigin: Schema.String.annotate({ + description: + "Origin of the backend endpoint that issued the challenge and will verify this proof.", + }), + targetPath: Schema.String.annotate({ + description: "Websocket route path that this proof authorizes.", + }), + tokenExpiresAt: Schema.Number.annotate({ + description: "Remote-control token expiration as Unix seconds.", + format: "int64", + }).check(Schema.isInt()), + tokenSha256Base64url: Schema.String.annotate({ + description: + "SHA-256 of the controller-scoped remote-control token, encoded as unpadded base64url.", + }), + type: Schema.Literal("remoteControlClientConnection").annotate({ + title: "RemoteControlClientConnectionDeviceKeySignPayloadType", + }), + }).annotate({ + title: "RemoteControlClientConnectionDeviceKeySignPayload", + description: + "Payload bound to one remote-control controller websocket `/client` connection challenge.", + }), + Schema.Struct({ + accountUserId: Schema.String, + audience: V2DeviceKeySignParams__RemoteControlClientEnrollmentAudience, + challengeExpiresAt: Schema.Number.annotate({ + description: "Enrollment challenge expiration as Unix seconds.", + format: "int64", + }).check(Schema.isInt()), + challengeId: Schema.String.annotate({ + description: "Backend-issued enrollment challenge id that this proof authorizes.", + }), + clientId: Schema.String, + deviceIdentitySha256Base64url: Schema.String.annotate({ + description: + "SHA-256 of the requested device identity operation, encoded as unpadded base64url.", + }), + nonce: Schema.String, + targetOrigin: Schema.String.annotate({ + description: + "Origin of the backend endpoint that issued the challenge and will verify this proof.", + }), + targetPath: Schema.String.annotate({ + description: "HTTP route path that this proof authorizes.", + }), + type: Schema.Literal("remoteControlClientEnrollment").annotate({ + title: "RemoteControlClientEnrollmentDeviceKeySignPayloadType", + }), + }).annotate({ + title: "RemoteControlClientEnrollmentDeviceKeySignPayload", + description: "Payload bound to a remote-control client `/client/enroll` ownership challenge.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: "Structured payloads accepted by `device/key/sign`." }); + +export type V2ErrorNotification__CodexErrorInfo = + | "contextWindowExceeded" + | "usageLimitExceeded" + | "serverOverloaded" + | "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; }; }; @@ -11452,42 +11934,29 @@ export const V2ErrorNotification__CodexErrorInfo = Schema.Union( "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", }); -export type V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem = { - readonly cwd?: string | null; - readonly description: string; - readonly itemType: V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType; +export type V2ExternalAgentConfigDetectResponse__MigrationDetails = { + readonly plugins: ReadonlyArray; }; -export const V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem = Schema.Struct({ - cwd: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", - }), - Schema.Null, - ]), - ), - description: Schema.String, - itemType: V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType, +export const V2ExternalAgentConfigDetectResponse__MigrationDetails = Schema.Struct({ + plugins: Schema.Array(V2ExternalAgentConfigDetectResponse__PluginsMigration), }); -export type V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem = { - readonly cwd?: string | null; - readonly description: string; - readonly itemType: V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType; +export type V2ExternalAgentConfigImportParams__MigrationDetails = { + readonly plugins: ReadonlyArray; }; -export const V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem = Schema.Struct({ - cwd: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", - }), - Schema.Null, - ]), - ), - description: Schema.String, - itemType: V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType, +export const V2ExternalAgentConfigImportParams__MigrationDetails = Schema.Struct({ + plugins: Schema.Array(V2ExternalAgentConfigImportParams__PluginsMigration), +}); + +export type V2FileChangePatchUpdatedNotification__FileUpdateChange = { + readonly diff: string; + readonly kind: V2FileChangePatchUpdatedNotification__PatchChangeKind; + readonly path: string; +}; +export const V2FileChangePatchUpdatedNotification__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2FileChangePatchUpdatedNotification__PatchChangeKind, + path: Schema.String, }); export type V2GetAccountRateLimitsResponse__RateLimitSnapshot = { @@ -11496,6 +11965,7 @@ export type V2GetAccountRateLimitsResponse__RateLimitSnapshot = { readonly limitName?: string | null; readonly planType?: V2GetAccountRateLimitsResponse__PlanType | null; readonly primary?: V2GetAccountRateLimitsResponse__RateLimitWindow | null; + readonly rateLimitReachedType?: V2GetAccountRateLimitsResponse__RateLimitReachedType | null; readonly secondary?: V2GetAccountRateLimitsResponse__RateLimitWindow | null; }; export const V2GetAccountRateLimitsResponse__RateLimitSnapshot = Schema.Struct({ @@ -11510,6 +11980,9 @@ export const V2GetAccountRateLimitsResponse__RateLimitSnapshot = Schema.Struct({ primary: Schema.optionalKey( Schema.Union([V2GetAccountRateLimitsResponse__RateLimitWindow, Schema.Null]), ), + rateLimitReachedType: Schema.optionalKey( + Schema.Union([V2GetAccountRateLimitsResponse__RateLimitReachedType, Schema.Null]), + ), secondary: Schema.optionalKey( Schema.Union([V2GetAccountRateLimitsResponse__RateLimitWindow, Schema.Null]), ), @@ -11554,6 +12027,48 @@ export const V2HookStartedNotification__HookOutputEntry = Schema.Struct({ text: Schema.String, }); +export type V2ItemCompletedNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ItemCompletedNotification__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ItemCompletedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ItemCompletedNotification__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + export type V2ItemCompletedNotification__CollabAgentState = { readonly message?: string | null; readonly status: V2ItemCompletedNotification__CollabAgentStatus; @@ -11627,6 +12142,34 @@ export const V2ItemCompletedNotification__UserInput = Schema.Union( { mode: "oneOf" }, ); +export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath = + | { + readonly path: V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf; + readonly type: "path"; + } + | { readonly pattern: string; readonly type: "glob_pattern" } + | { + readonly type: "special"; + readonly value: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath; + }; +export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: V2ItemGuardianApprovalReviewCompletedNotification__AbsolutePathBuf, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +); + export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReview = { readonly rationale?: string | null; readonly riskLevel?: V2ItemGuardianApprovalReviewCompletedNotification__GuardianRiskLevel | null; @@ -11651,90 +12194,36 @@ export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApproval ), }).annotate({ description: - "[UNSTABLE] Temporary guardian approval review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", }); -export type V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewAction = - | { - readonly command: string; - readonly cwd: string; - readonly source: V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource; - readonly type: "command"; - } - | { - readonly argv: ReadonlyArray; - readonly cwd: string; - readonly program: string; - readonly source: V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource; - readonly type: "execve"; - } - | { readonly cwd: string; readonly files: ReadonlyArray; readonly type: "applyPatch" } +export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath = | { - readonly host: string; - readonly port: number; - readonly protocol: V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol; - readonly target: string; - readonly type: "networkAccess"; + readonly path: V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf; + readonly type: "path"; } + | { readonly pattern: string; readonly type: "glob_pattern" } | { - readonly connectorId?: string | null; - readonly connectorName?: string | null; - readonly server: string; - readonly toolName: string; - readonly toolTitle?: string | null; - readonly type: "mcpToolCall"; + readonly type: "special"; + readonly value: V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath; }; -export const V2ItemGuardianApprovalReviewCompletedNotification__GuardianApprovalReviewAction = - Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - cwd: Schema.String, - source: V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource, - type: Schema.Literal("command").annotate({ - title: "CommandGuardianApprovalReviewActionType", - }), - }).annotate({ title: "CommandGuardianApprovalReviewAction" }), - Schema.Struct({ - argv: Schema.Array(Schema.String), - cwd: Schema.String, - program: Schema.String, - source: V2ItemGuardianApprovalReviewCompletedNotification__GuardianCommandSource, - type: Schema.Literal("execve").annotate({ - title: "ExecveGuardianApprovalReviewActionType", - }), - }).annotate({ title: "ExecveGuardianApprovalReviewAction" }), - Schema.Struct({ - cwd: Schema.String, - files: Schema.Array(Schema.String), - type: Schema.Literal("applyPatch").annotate({ - title: "ApplyPatchGuardianApprovalReviewActionType", - }), - }).annotate({ title: "ApplyPatchGuardianApprovalReviewAction" }), - Schema.Struct({ - host: Schema.String, - port: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - protocol: V2ItemGuardianApprovalReviewCompletedNotification__NetworkApprovalProtocol, - target: Schema.String, - type: Schema.Literal("networkAccess").annotate({ - title: "NetworkAccessGuardianApprovalReviewActionType", - }), - }).annotate({ title: "NetworkAccessGuardianApprovalReviewAction" }), - Schema.Struct({ - connectorId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - server: Schema.String, - toolName: Schema.String, - toolTitle: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("mcpToolCall").annotate({ - title: "McpToolCallGuardianApprovalReviewActionType", - }), - }).annotate({ title: "McpToolCallGuardianApprovalReviewAction" }), - ], - { mode: "oneOf" }, - ); +export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath = Schema.Union( + [ + Schema.Struct({ + path: V2ItemGuardianApprovalReviewStartedNotification__AbsolutePathBuf, + type: Schema.Literal("path").annotate({ title: "PathFileSystemPathType" }), + }).annotate({ title: "PathFileSystemPath" }), + Schema.Struct({ + pattern: Schema.String, + type: Schema.Literal("glob_pattern").annotate({ title: "GlobPatternFileSystemPathType" }), + }).annotate({ title: "GlobPatternFileSystemPath" }), + Schema.Struct({ + type: Schema.Literal("special").annotate({ title: "SpecialFileSystemPathType" }), + value: V2ItemGuardianApprovalReviewStartedNotification__FileSystemSpecialPath, + }).annotate({ title: "SpecialFileSystemPath" }), + ], + { mode: "oneOf" }, +); export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReview = { readonly rationale?: string | null; @@ -11760,90 +12249,50 @@ export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalRe ), }).annotate({ description: - "[UNSTABLE] Temporary guardian approval review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", }); -export type V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewAction = +export type V2ItemStartedNotification__CommandAction = | { readonly command: string; - readonly cwd: string; - readonly source: V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource; - readonly type: "command"; - } - | { - readonly argv: ReadonlyArray; - readonly cwd: string; - readonly program: string; - readonly source: V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource; - readonly type: "execve"; + readonly name: string; + readonly path: V2ItemStartedNotification__AbsolutePathBuf; + readonly type: "read"; } - | { readonly cwd: string; readonly files: ReadonlyArray; readonly type: "applyPatch" } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } | { - readonly host: string; - readonly port: number; - readonly protocol: V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol; - readonly target: string; - readonly type: "networkAccess"; + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; } - | { - readonly connectorId?: string | null; - readonly connectorName?: string | null; - readonly server: string; - readonly toolName: string; - readonly toolTitle?: string | null; - readonly type: "mcpToolCall"; - }; -export const V2ItemGuardianApprovalReviewStartedNotification__GuardianApprovalReviewAction = - Schema.Union( - [ - Schema.Struct({ - command: Schema.String, - cwd: Schema.String, - source: V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource, - type: Schema.Literal("command").annotate({ - title: "CommandGuardianApprovalReviewActionType", - }), - }).annotate({ title: "CommandGuardianApprovalReviewAction" }), - Schema.Struct({ - argv: Schema.Array(Schema.String), - cwd: Schema.String, - program: Schema.String, - source: V2ItemGuardianApprovalReviewStartedNotification__GuardianCommandSource, - type: Schema.Literal("execve").annotate({ - title: "ExecveGuardianApprovalReviewActionType", - }), - }).annotate({ title: "ExecveGuardianApprovalReviewAction" }), - Schema.Struct({ - cwd: Schema.String, - files: Schema.Array(Schema.String), - type: Schema.Literal("applyPatch").annotate({ - title: "ApplyPatchGuardianApprovalReviewActionType", - }), - }).annotate({ title: "ApplyPatchGuardianApprovalReviewAction" }), - Schema.Struct({ - host: Schema.String, - port: Schema.Number.annotate({ format: "uint16" }) - .check(Schema.isInt()) - .check(Schema.isGreaterThanOrEqualTo(0)), - protocol: V2ItemGuardianApprovalReviewStartedNotification__NetworkApprovalProtocol, - target: Schema.String, - type: Schema.Literal("networkAccess").annotate({ - title: "NetworkAccessGuardianApprovalReviewActionType", - }), - }).annotate({ title: "NetworkAccessGuardianApprovalReviewAction" }), - Schema.Struct({ - connectorId: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - connectorName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - server: Schema.String, - toolName: Schema.String, - toolTitle: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - type: Schema.Literal("mcpToolCall").annotate({ - title: "McpToolCallGuardianApprovalReviewActionType", - }), - }).annotate({ title: "McpToolCallGuardianApprovalReviewAction" }), - ], - { mode: "oneOf" }, - ); + | { readonly command: string; readonly type: "unknown" }; +export const V2ItemStartedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ItemStartedNotification__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); export type V2ItemStartedNotification__CollabAgentState = { readonly message?: string | null; @@ -11956,12 +12405,15 @@ export type V2PluginListResponse__PluginInterface = { 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 logoUrl?: string | null; readonly longDescription?: string | null; readonly privacyPolicyUrl?: string | null; + readonly screenshotUrls: ReadonlyArray; readonly screenshots: ReadonlyArray; readonly shortDescription?: string | null; readonly termsOfServiceUrl?: string | null; @@ -11972,7 +12424,15 @@ export const V2PluginListResponse__PluginInterface = Schema.Struct({ capabilities: Schema.Array(Schema.String), category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), composerIcon: Schema.optionalKey( - Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]), + 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([ @@ -11985,25 +12445,60 @@ export const V2PluginListResponse__PluginInterface = Schema.Struct({ ), 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])), + logo: Schema.optionalKey( + Schema.Union([V2PluginListResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local 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, + ]), + ), longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - screenshots: Schema.Array(V2PluginListResponse__AbsolutePathBuf), + 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])), }); -export type V2PluginListResponse__PluginSource = { - readonly path: V2PluginListResponse__AbsolutePathBuf; - readonly type: "local"; -}; +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 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({ + 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" }, ); @@ -12013,12 +12508,15 @@ export type V2PluginReadResponse__PluginInterface = { 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 logoUrl?: string | null; readonly longDescription?: string | null; readonly privacyPolicyUrl?: string | null; + readonly screenshotUrls: ReadonlyArray; readonly screenshots: ReadonlyArray; readonly shortDescription?: string | null; readonly termsOfServiceUrl?: string | null; @@ -12029,7 +12527,15 @@ export const V2PluginReadResponse__PluginInterface = Schema.Struct({ capabilities: Schema.Array(Schema.String), category: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), composerIcon: Schema.optionalKey( - Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]), + 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([ @@ -12042,46 +12548,110 @@ export const V2PluginReadResponse__PluginInterface = Schema.Struct({ ), 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])), + logo: Schema.optionalKey( + Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null]).annotate({ + description: "Local 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, + ]), + ), longDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), privacyPolicyUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - screenshots: Schema.Array(V2PluginReadResponse__AbsolutePathBuf), + screenshotUrls: Schema.Array(Schema.String).annotate({ + description: "Remote screenshot URLs from the plugin catalog.", + }), + screenshots: Schema.Array(V2PluginReadResponse__AbsolutePathBuf).annotate({ + description: "Local screenshot paths, resolved from the installed plugin package.", + }), shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), termsOfServiceUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), websiteUrl: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); -export type V2PluginReadResponse__PluginSource = { - readonly path: V2PluginReadResponse__AbsolutePathBuf; - readonly type: "local"; -}; +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 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({ + type: Schema.Literal("remote").annotate({ title: "RemotePluginSourceType" }), + }).annotate({ + title: "RemotePluginSource", + description: + "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + }), ], { mode: "oneOf" }, ); -export type V2PluginReadResponse__SkillSummary = { - readonly description: string; - readonly enabled: boolean; - readonly interface?: V2PluginReadResponse__SkillInterface | null; - readonly name: string; - readonly path: string; +export type V2PluginReadResponse__SkillInterface = { + readonly brandColor?: string | null; + readonly defaultPrompt?: string | null; + readonly displayName?: string | null; + readonly iconLarge?: V2PluginReadResponse__AbsolutePathBuf | null; + readonly iconSmall?: V2PluginReadResponse__AbsolutePathBuf | null; readonly shortDescription?: string | null; }; -export const V2PluginReadResponse__SkillSummary = Schema.Struct({ - description: Schema.String, - enabled: Schema.Boolean, - interface: Schema.optionalKey(Schema.Union([V2PluginReadResponse__SkillInterface, Schema.Null])), - name: Schema.String, - path: Schema.String, +export const V2PluginReadResponse__SkillInterface = Schema.Struct({ + brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + defaultPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconLarge: Schema.optionalKey(Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null])), + iconSmall: Schema.optionalKey(Schema.Union([V2PluginReadResponse__AbsolutePathBuf, Schema.Null])), shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); +export type V2RawResponseItemCompletedNotification__ContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2RawResponseItemCompletedNotification__ImageDetail | null; + readonly image_url: string; + readonly type: "input_image"; + } + | { readonly text: string; readonly type: "output_text" }; +export const V2RawResponseItemCompletedNotification__ContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), + }).annotate({ title: "InputTextContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey( + Schema.Union([V2RawResponseItemCompletedNotification__ImageDetail, Schema.Null]), + ), + image_url: Schema.String, + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + }).annotate({ title: "InputImageContentItem" }), + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), + }).annotate({ title: "OutputTextContentItem" }), + ], + { mode: "oneOf" }, +); + export type V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem = | { readonly text: string; readonly type: "input_text" } | { @@ -12113,6 +12683,48 @@ export const V2RawResponseItemCompletedNotification__FunctionCallOutputContentIt "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.", }); +export type V2ReviewStartResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ReviewStartResponse__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ReviewStartResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ReviewStartResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + export type V2ReviewStartResponse__CollabAgentState = { readonly message?: string | null; readonly status: V2ReviewStartResponse__CollabAgentStatus; @@ -12292,6 +12904,23 @@ export const V2ReviewStartResponse__UserInput = Schema.Union( { mode: "oneOf" }, ); +export type V2SkillsListResponse__SkillInterface = { + readonly brandColor?: string | null; + readonly defaultPrompt?: string | null; + readonly displayName?: string | null; + readonly iconLarge?: V2SkillsListResponse__AbsolutePathBuf | null; + readonly iconSmall?: V2SkillsListResponse__AbsolutePathBuf | null; + readonly shortDescription?: string | null; +}; +export const V2SkillsListResponse__SkillInterface = Schema.Struct({ + brandColor: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + defaultPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + displayName: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + iconLarge: Schema.optionalKey(Schema.Union([V2SkillsListResponse__AbsolutePathBuf, Schema.Null])), + iconSmall: Schema.optionalKey(Schema.Union([V2SkillsListResponse__AbsolutePathBuf, Schema.Null])), + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}); + export type V2SkillsListResponse__SkillDependencies = { readonly tools: ReadonlyArray; }; @@ -12299,38 +12928,80 @@ export const V2SkillsListResponse__SkillDependencies = Schema.Struct({ tools: Schema.Array(V2SkillsListResponse__SkillToolDependency), }); -export type V2ThreadForkResponse__SandboxPolicy = - | { readonly type: "dangerFullAccess" } +export type V2ThreadForkResponse__CommandAction = | { - readonly access?: - | { - readonly includePlatformDefaults?: boolean; - readonly readableRoots?: ReadonlyArray; - readonly type: "restricted"; - } - | { readonly type: "fullAccess" }; - readonly networkAccess?: boolean; - readonly type: "readOnly"; + readonly command: string; + readonly name: string; + readonly path: V2ThreadForkResponse__AbsolutePathBuf; + readonly type: "read"; } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly readOnlyAccess?: - | { - readonly includePlatformDefaults?: boolean; - readonly readableRoots?: ReadonlyArray; - readonly type: "restricted"; - } - | { readonly type: "fullAccess" }; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; -export const V2ThreadForkResponse__SandboxPolicy = Schema.Union( - [ - Schema.Struct({ - type: Schema.Literal("dangerFullAccess").annotate({ + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadForkResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadForkResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + +export type V2ThreadForkResponse__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { + readonly access?: + | { + readonly includePlatformDefaults?: boolean; + readonly readableRoots?: ReadonlyArray; + readonly type: "restricted"; + } + | { readonly type: "fullAccess" }; + readonly networkAccess?: boolean; + readonly type: "readOnly"; + } + | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } + | { + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly readOnlyAccess?: + | { + readonly includePlatformDefaults?: boolean; + readonly readableRoots?: ReadonlyArray; + readonly type: "restricted"; + } + | { readonly type: "fullAccess" }; + readonly type: "workspaceWrite"; + readonly writableRoots?: ReadonlyArray; + }; +export const V2ThreadForkResponse__SandboxPolicy = Schema.Union( + [ + Schema.Struct({ + type: Schema.Literal("dangerFullAccess").annotate({ title: "DangerFullAccessSandboxPolicyType", }), }).annotate({ title: "DangerFullAccessSandboxPolicy" }), @@ -12617,6 +13288,48 @@ export const V2ThreadForkResponse__SubAgentSource = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadListResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadListResponse__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadListResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadListResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + export type V2ThreadListResponse__CollabAgentState = { readonly message?: string | null; readonly status: V2ThreadListResponse__CollabAgentStatus; @@ -12829,6 +13542,48 @@ export const V2ThreadListResponse__SubAgentSource = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadMetadataUpdateResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadMetadataUpdateResponse__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadMetadataUpdateResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadMetadataUpdateResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + export type V2ThreadMetadataUpdateResponse__CollabAgentState = { readonly message?: string | null; readonly status: V2ThreadMetadataUpdateResponse__CollabAgentStatus; @@ -13041,6 +13796,48 @@ export const V2ThreadMetadataUpdateResponse__SubAgentSource = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadReadResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadReadResponse__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadReadResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadReadResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + export type V2ThreadReadResponse__CollabAgentState = { readonly message?: string | null; readonly status: V2ThreadReadResponse__CollabAgentStatus; @@ -13253,6 +14050,33 @@ export const V2ThreadReadResponse__SubAgentSource = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadResumeParams__ContentItem = + | { readonly text: string; readonly type: "input_text" } + | { + readonly detail?: V2ThreadResumeParams__ImageDetail | null; + readonly image_url: string; + readonly type: "input_image"; + } + | { readonly text: string; readonly type: "output_text" }; +export const V2ThreadResumeParams__ContentItem = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("input_text").annotate({ title: "InputTextContentItemType" }), + }).annotate({ title: "InputTextContentItem" }), + Schema.Struct({ + detail: Schema.optionalKey(Schema.Union([V2ThreadResumeParams__ImageDetail, Schema.Null])), + image_url: Schema.String, + type: Schema.Literal("input_image").annotate({ title: "InputImageContentItemType" }), + }).annotate({ title: "InputImageContentItem" }), + Schema.Struct({ + text: Schema.String, + type: Schema.Literal("output_text").annotate({ title: "OutputTextContentItemType" }), + }).annotate({ title: "OutputTextContentItem" }), + ], + { mode: "oneOf" }, +); + export type V2ThreadResumeParams__FunctionCallOutputContentItem = | { readonly text: string; readonly type: "input_text" } | { @@ -13282,6 +14106,48 @@ export const V2ThreadResumeParams__FunctionCallOutputContentItem = Schema.Union( "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.", }); +export type V2ThreadResumeResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadResumeResponse__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadResumeResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadResumeResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + export type V2ThreadResumeResponse__SandboxPolicy = | { readonly type: "dangerFullAccess" } | { @@ -13600,11 +14466,53 @@ export const V2ThreadResumeResponse__SubAgentSource = Schema.Union( { mode: "oneOf" }, ); -export type V2ThreadRollbackResponse__CollabAgentState = { - readonly message?: string | null; - readonly status: V2ThreadRollbackResponse__CollabAgentStatus; -}; -export const V2ThreadRollbackResponse__CollabAgentState = Schema.Struct({ +export type V2ThreadRollbackResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadRollbackResponse__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadRollbackResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadRollbackResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + +export type V2ThreadRollbackResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2ThreadRollbackResponse__CollabAgentStatus; +}; +export const V2ThreadRollbackResponse__CollabAgentState = Schema.Struct({ message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), status: V2ThreadRollbackResponse__CollabAgentStatus, }); @@ -13812,6 +14720,48 @@ export const V2ThreadRollbackResponse__SubAgentSource = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadStartedNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadStartedNotification__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadStartedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadStartedNotification__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + export type V2ThreadStartedNotification__CollabAgentState = { readonly message?: string | null; readonly status: V2ThreadStartedNotification__CollabAgentStatus; @@ -14024,6 +14974,48 @@ export const V2ThreadStartedNotification__SubAgentSource = Schema.Union( { mode: "oneOf" }, ); +export type V2ThreadStartResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadStartResponse__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadStartResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadStartResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + export type V2ThreadStartResponse__SandboxPolicy = | { readonly type: "dangerFullAccess" } | { @@ -14382,25 +15374,67 @@ export const V2ThreadTokenUsageUpdatedNotification__ThreadTokenUsage = Schema.St total: V2ThreadTokenUsageUpdatedNotification__TokenUsageBreakdown, }); -export type V2ThreadUnarchiveResponse__CollabAgentState = { +export type V2ThreadTurnsListResponse__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2ThreadTurnsListResponse__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadTurnsListResponse__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2ThreadTurnsListResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + +export type V2ThreadTurnsListResponse__CollabAgentState = { readonly message?: string | null; - readonly status: V2ThreadUnarchiveResponse__CollabAgentStatus; + readonly status: V2ThreadTurnsListResponse__CollabAgentStatus; }; -export const V2ThreadUnarchiveResponse__CollabAgentState = Schema.Struct({ +export const V2ThreadTurnsListResponse__CollabAgentState = Schema.Struct({ message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2ThreadUnarchiveResponse__CollabAgentStatus, + status: V2ThreadTurnsListResponse__CollabAgentStatus, }); -export type V2ThreadUnarchiveResponse__MemoryCitation = { - readonly entries: ReadonlyArray; +export type V2ThreadTurnsListResponse__MemoryCitation = { + readonly entries: ReadonlyArray; readonly threadIds: ReadonlyArray; }; -export const V2ThreadUnarchiveResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2ThreadUnarchiveResponse__MemoryCitationEntry), +export const V2ThreadTurnsListResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadTurnsListResponse__MemoryCitationEntry), threadIds: Schema.Array(Schema.String), }); -export type V2ThreadUnarchiveResponse__CodexErrorInfo = +export type V2ThreadTurnsListResponse__CodexErrorInfo = | "contextWindowExceeded" | "usageLimitExceeded" | "serverOverloaded" @@ -14416,10 +15450,10 @@ export type V2ThreadUnarchiveResponse__CodexErrorInfo = | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } | { readonly activeTurnNotSteerable: { - readonly turnKind: V2ThreadUnarchiveResponse__NonSteerableTurnKind; + readonly turnKind: V2ThreadTurnsListResponse__NonSteerableTurnKind; }; }; -export const V2ThreadUnarchiveResponse__CodexErrorInfo = Schema.Union( +export const V2ThreadTurnsListResponse__CodexErrorInfo = Schema.Union( [ Schema.Literals([ "contextWindowExceeded", @@ -14492,7 +15526,7 @@ export const V2ThreadUnarchiveResponse__CodexErrorInfo = Schema.Union( }), Schema.Struct({ activeTurnNotSteerable: Schema.Struct({ - turnKind: V2ThreadUnarchiveResponse__NonSteerableTurnKind, + turnKind: V2ThreadTurnsListResponse__NonSteerableTurnKind, }), }).annotate({ title: "ActiveTurnNotSteerableCodexErrorInfo", @@ -14506,33 +15540,33 @@ export const V2ThreadUnarchiveResponse__CodexErrorInfo = Schema.Union( "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", }); -export type V2ThreadUnarchiveResponse__FileUpdateChange = { +export type V2ThreadTurnsListResponse__FileUpdateChange = { readonly diff: string; - readonly kind: V2ThreadUnarchiveResponse__PatchChangeKind; + readonly kind: V2ThreadTurnsListResponse__PatchChangeKind; readonly path: string; }; -export const V2ThreadUnarchiveResponse__FileUpdateChange = Schema.Struct({ +export const V2ThreadTurnsListResponse__FileUpdateChange = Schema.Struct({ diff: Schema.String, - kind: V2ThreadUnarchiveResponse__PatchChangeKind, + kind: V2ThreadTurnsListResponse__PatchChangeKind, path: Schema.String, }); -export type V2ThreadUnarchiveResponse__UserInput = +export type V2ThreadTurnsListResponse__UserInput = | { readonly text: string; - readonly text_elements?: ReadonlyArray; + readonly text_elements?: ReadonlyArray; readonly type: "text"; } | { readonly type: "image"; readonly url: string } | { readonly path: string; readonly type: "localImage" } | { readonly name: string; readonly path: string; readonly type: "skill" } | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2ThreadUnarchiveResponse__UserInput = Schema.Union( +export const V2ThreadTurnsListResponse__UserInput = Schema.Union( [ Schema.Struct({ text: Schema.String, text_elements: Schema.optionalKey( - Schema.Array(V2ThreadUnarchiveResponse__TextElement).annotate({ + Schema.Array(V2ThreadTurnsListResponse__TextElement).annotate({ description: "UI-defined spans within `text` used to render or persist special elements.", default: [], }), @@ -14561,58 +15595,67 @@ export const V2ThreadUnarchiveResponse__UserInput = Schema.Union( { mode: "oneOf" }, ); -export type V2ThreadUnarchiveResponse__SubAgentSource = - | "review" - | "compact" - | "memory_consolidation" +export type V2ThreadUnarchiveResponse__CommandAction = | { - readonly thread_spawn: { - readonly agent_nickname?: string | null; - readonly agent_path?: V2ThreadUnarchiveResponse__AgentPath | null; - readonly agent_role?: string | null; - readonly depth: number; - readonly parent_thread_id: V2ThreadUnarchiveResponse__ThreadId; - }; + readonly command: string; + readonly name: string; + readonly path: V2ThreadUnarchiveResponse__AbsolutePathBuf; + readonly type: "read"; } - | { readonly other: string }; -export const V2ThreadUnarchiveResponse__SubAgentSource = Schema.Union( + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2ThreadUnarchiveResponse__CommandAction = Schema.Union( [ - Schema.Literals(["review", "compact", "memory_consolidation"]), Schema.Struct({ - thread_spawn: Schema.Struct({ - agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - agent_path: Schema.optionalKey( - Schema.Union([V2ThreadUnarchiveResponse__AgentPath, Schema.Null]), - ), - agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), - parent_thread_id: V2ThreadUnarchiveResponse__ThreadId, - }), - }).annotate({ title: "ThreadSpawnSubAgentSource" }), - Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + command: Schema.String, + name: Schema.String, + path: V2ThreadUnarchiveResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), ], { mode: "oneOf" }, ); -export type V2TurnCompletedNotification__CollabAgentState = { +export type V2ThreadUnarchiveResponse__CollabAgentState = { readonly message?: string | null; - readonly status: V2TurnCompletedNotification__CollabAgentStatus; + readonly status: V2ThreadUnarchiveResponse__CollabAgentStatus; }; -export const V2TurnCompletedNotification__CollabAgentState = Schema.Struct({ +export const V2ThreadUnarchiveResponse__CollabAgentState = Schema.Struct({ message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2TurnCompletedNotification__CollabAgentStatus, + status: V2ThreadUnarchiveResponse__CollabAgentStatus, }); -export type V2TurnCompletedNotification__MemoryCitation = { - readonly entries: ReadonlyArray; +export type V2ThreadUnarchiveResponse__MemoryCitation = { + readonly entries: ReadonlyArray; readonly threadIds: ReadonlyArray; }; -export const V2TurnCompletedNotification__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2TurnCompletedNotification__MemoryCitationEntry), +export const V2ThreadUnarchiveResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2ThreadUnarchiveResponse__MemoryCitationEntry), threadIds: Schema.Array(Schema.String), }); -export type V2TurnCompletedNotification__CodexErrorInfo = +export type V2ThreadUnarchiveResponse__CodexErrorInfo = | "contextWindowExceeded" | "usageLimitExceeded" | "serverOverloaded" @@ -14628,10 +15671,10 @@ export type V2TurnCompletedNotification__CodexErrorInfo = | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } | { readonly activeTurnNotSteerable: { - readonly turnKind: V2TurnCompletedNotification__NonSteerableTurnKind; + readonly turnKind: V2ThreadUnarchiveResponse__NonSteerableTurnKind; }; }; -export const V2TurnCompletedNotification__CodexErrorInfo = Schema.Union( +export const V2ThreadUnarchiveResponse__CodexErrorInfo = Schema.Union( [ Schema.Literals([ "contextWindowExceeded", @@ -14704,7 +15747,7 @@ export const V2TurnCompletedNotification__CodexErrorInfo = Schema.Union( }), Schema.Struct({ activeTurnNotSteerable: Schema.Struct({ - turnKind: V2TurnCompletedNotification__NonSteerableTurnKind, + turnKind: V2ThreadUnarchiveResponse__NonSteerableTurnKind, }), }).annotate({ title: "ActiveTurnNotSteerableCodexErrorInfo", @@ -14718,33 +15761,33 @@ export const V2TurnCompletedNotification__CodexErrorInfo = Schema.Union( "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", }); -export type V2TurnCompletedNotification__FileUpdateChange = { +export type V2ThreadUnarchiveResponse__FileUpdateChange = { readonly diff: string; - readonly kind: V2TurnCompletedNotification__PatchChangeKind; + readonly kind: V2ThreadUnarchiveResponse__PatchChangeKind; readonly path: string; }; -export const V2TurnCompletedNotification__FileUpdateChange = Schema.Struct({ +export const V2ThreadUnarchiveResponse__FileUpdateChange = Schema.Struct({ diff: Schema.String, - kind: V2TurnCompletedNotification__PatchChangeKind, + kind: V2ThreadUnarchiveResponse__PatchChangeKind, path: Schema.String, }); -export type V2TurnCompletedNotification__UserInput = +export type V2ThreadUnarchiveResponse__UserInput = | { readonly text: string; - readonly text_elements?: ReadonlyArray; + readonly text_elements?: ReadonlyArray; readonly type: "text"; } | { readonly type: "image"; readonly url: string } | { readonly path: string; readonly type: "localImage" } | { readonly name: string; readonly path: string; readonly type: "skill" } | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2TurnCompletedNotification__UserInput = Schema.Union( +export const V2ThreadUnarchiveResponse__UserInput = Schema.Union( [ Schema.Struct({ text: Schema.String, text_elements: Schema.optionalKey( - Schema.Array(V2TurnCompletedNotification__TextElement).annotate({ + Schema.Array(V2ThreadUnarchiveResponse__TextElement).annotate({ description: "UI-defined spans within `text` used to render or persist special elements.", default: [], }), @@ -14773,34 +15816,100 @@ export const V2TurnCompletedNotification__UserInput = Schema.Union( { mode: "oneOf" }, ); -export type V2TurnPlanUpdatedNotification__TurnPlanStep = { - readonly status: V2TurnPlanUpdatedNotification__TurnPlanStepStatus; - readonly step: string; -}; -export const V2TurnPlanUpdatedNotification__TurnPlanStep = Schema.Struct({ - status: V2TurnPlanUpdatedNotification__TurnPlanStepStatus, - step: Schema.String, -}); +export type V2ThreadUnarchiveResponse__SubAgentSource = + | "review" + | "compact" + | "memory_consolidation" + | { + readonly thread_spawn: { + readonly agent_nickname?: string | null; + readonly agent_path?: V2ThreadUnarchiveResponse__AgentPath | null; + readonly agent_role?: string | null; + readonly depth: number; + readonly parent_thread_id: V2ThreadUnarchiveResponse__ThreadId; + }; + } + | { readonly other: string }; +export const V2ThreadUnarchiveResponse__SubAgentSource = Schema.Union( + [ + Schema.Literals(["review", "compact", "memory_consolidation"]), + Schema.Struct({ + thread_spawn: Schema.Struct({ + agent_nickname: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + agent_path: Schema.optionalKey( + Schema.Union([V2ThreadUnarchiveResponse__AgentPath, Schema.Null]), + ), + agent_role: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + depth: Schema.Number.annotate({ format: "int32" }).check(Schema.isInt()), + parent_thread_id: V2ThreadUnarchiveResponse__ThreadId, + }), + }).annotate({ title: "ThreadSpawnSubAgentSource" }), + Schema.Struct({ other: Schema.String }).annotate({ title: "OtherSubAgentSource" }), + ], + { mode: "oneOf" }, +); -export type V2TurnStartedNotification__CollabAgentState = { +export type V2TurnCompletedNotification__CommandAction = + | { + readonly command: string; + readonly name: string; + readonly path: V2TurnCompletedNotification__AbsolutePathBuf; + readonly type: "read"; + } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } + | { + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; + } + | { readonly command: string; readonly type: "unknown" }; +export const V2TurnCompletedNotification__CommandAction = Schema.Union( + [ + Schema.Struct({ + command: Schema.String, + name: Schema.String, + path: V2TurnCompletedNotification__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + +export type V2TurnCompletedNotification__CollabAgentState = { readonly message?: string | null; - readonly status: V2TurnStartedNotification__CollabAgentStatus; + readonly status: V2TurnCompletedNotification__CollabAgentStatus; }; -export const V2TurnStartedNotification__CollabAgentState = Schema.Struct({ +export const V2TurnCompletedNotification__CollabAgentState = Schema.Struct({ message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2TurnStartedNotification__CollabAgentStatus, + status: V2TurnCompletedNotification__CollabAgentStatus, }); -export type V2TurnStartedNotification__MemoryCitation = { - readonly entries: ReadonlyArray; +export type V2TurnCompletedNotification__MemoryCitation = { + readonly entries: ReadonlyArray; readonly threadIds: ReadonlyArray; }; -export const V2TurnStartedNotification__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2TurnStartedNotification__MemoryCitationEntry), +export const V2TurnCompletedNotification__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2TurnCompletedNotification__MemoryCitationEntry), threadIds: Schema.Array(Schema.String), }); -export type V2TurnStartedNotification__CodexErrorInfo = +export type V2TurnCompletedNotification__CodexErrorInfo = | "contextWindowExceeded" | "usageLimitExceeded" | "serverOverloaded" @@ -14816,10 +15925,10 @@ export type V2TurnStartedNotification__CodexErrorInfo = | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } | { readonly activeTurnNotSteerable: { - readonly turnKind: V2TurnStartedNotification__NonSteerableTurnKind; + readonly turnKind: V2TurnCompletedNotification__NonSteerableTurnKind; }; }; -export const V2TurnStartedNotification__CodexErrorInfo = Schema.Union( +export const V2TurnCompletedNotification__CodexErrorInfo = Schema.Union( [ Schema.Literals([ "contextWindowExceeded", @@ -14892,7 +16001,7 @@ export const V2TurnStartedNotification__CodexErrorInfo = Schema.Union( }), Schema.Struct({ activeTurnNotSteerable: Schema.Struct({ - turnKind: V2TurnStartedNotification__NonSteerableTurnKind, + turnKind: V2TurnCompletedNotification__NonSteerableTurnKind, }), }).annotate({ title: "ActiveTurnNotSteerableCodexErrorInfo", @@ -14906,33 +16015,33 @@ export const V2TurnStartedNotification__CodexErrorInfo = Schema.Union( "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", }); -export type V2TurnStartedNotification__FileUpdateChange = { +export type V2TurnCompletedNotification__FileUpdateChange = { readonly diff: string; - readonly kind: V2TurnStartedNotification__PatchChangeKind; + readonly kind: V2TurnCompletedNotification__PatchChangeKind; readonly path: string; }; -export const V2TurnStartedNotification__FileUpdateChange = Schema.Struct({ +export const V2TurnCompletedNotification__FileUpdateChange = Schema.Struct({ diff: Schema.String, - kind: V2TurnStartedNotification__PatchChangeKind, + kind: V2TurnCompletedNotification__PatchChangeKind, path: Schema.String, }); -export type V2TurnStartedNotification__UserInput = +export type V2TurnCompletedNotification__UserInput = | { readonly text: string; - readonly text_elements?: ReadonlyArray; + readonly text_elements?: ReadonlyArray; readonly type: "text"; } | { readonly type: "image"; readonly url: string } | { readonly path: string; readonly type: "localImage" } | { readonly name: string; readonly path: string; readonly type: "skill" } | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2TurnStartedNotification__UserInput = Schema.Union( +export const V2TurnCompletedNotification__UserInput = Schema.Union( [ Schema.Struct({ text: Schema.String, text_elements: Schema.optionalKey( - Schema.Array(V2TurnStartedNotification__TextElement).annotate({ + Schema.Array(V2TurnCompletedNotification__TextElement).annotate({ description: "UI-defined spans within `text` used to render or persist special elements.", default: [], }), @@ -14961,188 +16070,76 @@ export const V2TurnStartedNotification__UserInput = Schema.Union( { mode: "oneOf" }, ); -export type V2TurnStartParams__SandboxPolicy = - | { readonly type: "dangerFullAccess" } +export type V2TurnPlanUpdatedNotification__TurnPlanStep = { + readonly status: V2TurnPlanUpdatedNotification__TurnPlanStepStatus; + readonly step: string; +}; +export const V2TurnPlanUpdatedNotification__TurnPlanStep = Schema.Struct({ + status: V2TurnPlanUpdatedNotification__TurnPlanStepStatus, + step: Schema.String, +}); + +export type V2TurnStartedNotification__CommandAction = | { - readonly access?: - | { - readonly includePlatformDefaults?: boolean; - readonly readableRoots?: ReadonlyArray; - readonly type: "restricted"; - } - | { readonly type: "fullAccess" }; - readonly networkAccess?: boolean; - readonly type: "readOnly"; + readonly command: string; + readonly name: string; + readonly path: V2TurnStartedNotification__AbsolutePathBuf; + readonly type: "read"; } - | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } | { - readonly excludeSlashTmp?: boolean; - readonly excludeTmpdirEnvVar?: boolean; - readonly networkAccess?: boolean; - readonly readOnlyAccess?: - | { - readonly includePlatformDefaults?: boolean; - readonly readableRoots?: ReadonlyArray; - readonly type: "restricted"; - } - | { readonly type: "fullAccess" }; - readonly type: "workspaceWrite"; - readonly writableRoots?: ReadonlyArray; - }; -export const V2TurnStartParams__SandboxPolicy = Schema.Union( + 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({ - type: Schema.Literal("dangerFullAccess").annotate({ - title: "DangerFullAccessSandboxPolicyType", - }), - }).annotate({ title: "DangerFullAccessSandboxPolicy" }), + command: Schema.String, + name: Schema.String, + path: V2TurnStartedNotification__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), Schema.Struct({ - access: Schema.optionalKey( - Schema.Union( - [ - Schema.Struct({ - includePlatformDefaults: Schema.optionalKey( - Schema.Boolean.annotate({ default: true }), - ), - readableRoots: Schema.optionalKey( - Schema.Array(V2TurnStartParams__AbsolutePathBuf).annotate({ default: [] }), - ), - type: Schema.Literal("restricted").annotate({ - title: "RestrictedReadOnlyAccessType", - }), - }).annotate({ title: "RestrictedReadOnlyAccess" }), - Schema.Struct({ - type: Schema.Literal("fullAccess").annotate({ - title: "FullAccessReadOnlyAccessType", - }), - }).annotate({ title: "FullAccessReadOnlyAccess" }), - ], - { mode: "oneOf" }, - ).annotate({ default: { type: "fullAccess" } }), - ), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), - }).annotate({ title: "ReadOnlySandboxPolicy" }), + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), Schema.Struct({ - networkAccess: Schema.optionalKey( - Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), - ), - type: Schema.Literal("externalSandbox").annotate({ - title: "ExternalSandboxSandboxPolicyType", - }), - }).annotate({ title: "ExternalSandboxSandboxPolicy" }), + 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({ - excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - readOnlyAccess: Schema.optionalKey( - Schema.Union( - [ - Schema.Struct({ - includePlatformDefaults: Schema.optionalKey( - Schema.Boolean.annotate({ default: true }), - ), - readableRoots: Schema.optionalKey( - Schema.Array(V2TurnStartParams__AbsolutePathBuf).annotate({ default: [] }), - ), - type: Schema.Literal("restricted").annotate({ - title: "RestrictedReadOnlyAccessType", - }), - }).annotate({ title: "RestrictedReadOnlyAccess" }), - Schema.Struct({ - type: Schema.Literal("fullAccess").annotate({ - title: "FullAccessReadOnlyAccessType", - }), - }).annotate({ title: "FullAccessReadOnlyAccess" }), - ], - { mode: "oneOf" }, - ).annotate({ default: { type: "fullAccess" } }), - ), - type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), - writableRoots: Schema.optionalKey( - Schema.Array(V2TurnStartParams__AbsolutePathBuf).annotate({ default: [] }), - ), - }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), - ], - { mode: "oneOf" }, -); - -export type V2TurnStartParams__Settings = { - readonly developer_instructions?: string | null; - readonly model: string; - readonly reasoning_effort?: V2TurnStartParams__ReasoningEffort | null; -}; -export const V2TurnStartParams__Settings = Schema.Struct({ - developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - model: Schema.String, - reasoning_effort: Schema.optionalKey( - Schema.Union([V2TurnStartParams__ReasoningEffort, Schema.Null]), - ), -}).annotate({ description: "Settings for a collaboration mode." }); - -export type V2TurnStartParams__UserInput = - | { - readonly text: string; - readonly text_elements?: ReadonlyArray; - readonly type: "text"; - } - | { readonly type: "image"; readonly url: string } - | { readonly path: string; readonly type: "localImage" } - | { readonly name: string; readonly path: string; readonly type: "skill" } - | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2TurnStartParams__UserInput = Schema.Union( - [ - Schema.Struct({ - text: Schema.String, - text_elements: Schema.optionalKey( - Schema.Array(V2TurnStartParams__TextElement).annotate({ - description: "UI-defined spans within `text` used to render or persist special elements.", - default: [], - }), - ), - type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), - }).annotate({ title: "TextUserInput" }), - Schema.Struct({ - type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), - url: Schema.String, - }).annotate({ title: "ImageUserInput" }), - Schema.Struct({ - path: Schema.String, - type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), - }).annotate({ title: "LocalImageUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), - }).annotate({ title: "SkillUserInput" }), - Schema.Struct({ - name: Schema.String, - path: Schema.String, - type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), - }).annotate({ title: "MentionUserInput" }), + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), ], { mode: "oneOf" }, ); -export type V2TurnStartResponse__CollabAgentState = { +export type V2TurnStartedNotification__CollabAgentState = { readonly message?: string | null; - readonly status: V2TurnStartResponse__CollabAgentStatus; + readonly status: V2TurnStartedNotification__CollabAgentStatus; }; -export const V2TurnStartResponse__CollabAgentState = Schema.Struct({ +export const V2TurnStartedNotification__CollabAgentState = Schema.Struct({ message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - status: V2TurnStartResponse__CollabAgentStatus, + status: V2TurnStartedNotification__CollabAgentStatus, }); -export type V2TurnStartResponse__MemoryCitation = { - readonly entries: ReadonlyArray; +export type V2TurnStartedNotification__MemoryCitation = { + readonly entries: ReadonlyArray; readonly threadIds: ReadonlyArray; }; -export const V2TurnStartResponse__MemoryCitation = Schema.Struct({ - entries: Schema.Array(V2TurnStartResponse__MemoryCitationEntry), +export const V2TurnStartedNotification__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2TurnStartedNotification__MemoryCitationEntry), threadIds: Schema.Array(Schema.String), }); -export type V2TurnStartResponse__CodexErrorInfo = +export type V2TurnStartedNotification__CodexErrorInfo = | "contextWindowExceeded" | "usageLimitExceeded" | "serverOverloaded" @@ -15158,10 +16155,10 @@ export type V2TurnStartResponse__CodexErrorInfo = | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } | { readonly activeTurnNotSteerable: { - readonly turnKind: V2TurnStartResponse__NonSteerableTurnKind; + readonly turnKind: V2TurnStartedNotification__NonSteerableTurnKind; }; }; -export const V2TurnStartResponse__CodexErrorInfo = Schema.Union( +export const V2TurnStartedNotification__CodexErrorInfo = Schema.Union( [ Schema.Literals([ "contextWindowExceeded", @@ -15234,7 +16231,7 @@ export const V2TurnStartResponse__CodexErrorInfo = Schema.Union( }), Schema.Struct({ activeTurnNotSteerable: Schema.Struct({ - turnKind: V2TurnStartResponse__NonSteerableTurnKind, + turnKind: V2TurnStartedNotification__NonSteerableTurnKind, }), }).annotate({ title: "ActiveTurnNotSteerableCodexErrorInfo", @@ -15248,33 +16245,33 @@ export const V2TurnStartResponse__CodexErrorInfo = Schema.Union( "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", }); -export type V2TurnStartResponse__FileUpdateChange = { +export type V2TurnStartedNotification__FileUpdateChange = { readonly diff: string; - readonly kind: V2TurnStartResponse__PatchChangeKind; + readonly kind: V2TurnStartedNotification__PatchChangeKind; readonly path: string; }; -export const V2TurnStartResponse__FileUpdateChange = Schema.Struct({ +export const V2TurnStartedNotification__FileUpdateChange = Schema.Struct({ diff: Schema.String, - kind: V2TurnStartResponse__PatchChangeKind, + kind: V2TurnStartedNotification__PatchChangeKind, path: Schema.String, }); -export type V2TurnStartResponse__UserInput = +export type V2TurnStartedNotification__UserInput = | { readonly text: string; - readonly text_elements?: ReadonlyArray; + readonly text_elements?: ReadonlyArray; readonly type: "text"; } | { readonly type: "image"; readonly url: string } | { readonly path: string; readonly type: "localImage" } | { readonly name: string; readonly path: string; readonly type: "skill" } | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2TurnStartResponse__UserInput = Schema.Union( +export const V2TurnStartedNotification__UserInput = Schema.Union( [ Schema.Struct({ text: Schema.String, text_elements: Schema.optionalKey( - Schema.Array(V2TurnStartResponse__TextElement).annotate({ + Schema.Array(V2TurnStartedNotification__TextElement).annotate({ description: "UI-defined spans within `text` used to render or persist special elements.", default: [], }), @@ -15303,22 +16300,141 @@ export const V2TurnStartResponse__UserInput = Schema.Union( { mode: "oneOf" }, ); -export type V2TurnSteerParams__UserInput = +export type V2TurnStartParams__SandboxPolicy = + | { readonly type: "dangerFullAccess" } + | { + readonly access?: + | { + readonly includePlatformDefaults?: boolean; + readonly readableRoots?: ReadonlyArray; + readonly type: "restricted"; + } + | { readonly type: "fullAccess" }; + readonly networkAccess?: boolean; + readonly type: "readOnly"; + } + | { readonly networkAccess?: "restricted" | "enabled"; readonly type: "externalSandbox" } + | { + readonly excludeSlashTmp?: boolean; + readonly excludeTmpdirEnvVar?: boolean; + readonly networkAccess?: boolean; + readonly readOnlyAccess?: + | { + readonly includePlatformDefaults?: boolean; + readonly readableRoots?: ReadonlyArray; + readonly type: "restricted"; + } + | { readonly type: "fullAccess" }; + 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({ + access: Schema.optionalKey( + Schema.Union( + [ + Schema.Struct({ + includePlatformDefaults: Schema.optionalKey( + Schema.Boolean.annotate({ default: true }), + ), + readableRoots: Schema.optionalKey( + Schema.Array(V2TurnStartParams__AbsolutePathBuf).annotate({ default: [] }), + ), + type: Schema.Literal("restricted").annotate({ + title: "RestrictedReadOnlyAccessType", + }), + }).annotate({ title: "RestrictedReadOnlyAccess" }), + Schema.Struct({ + type: Schema.Literal("fullAccess").annotate({ + title: "FullAccessReadOnlyAccessType", + }), + }).annotate({ title: "FullAccessReadOnlyAccess" }), + ], + { mode: "oneOf" }, + ).annotate({ default: { type: "fullAccess" } }), + ), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + type: Schema.Literal("readOnly").annotate({ title: "ReadOnlySandboxPolicyType" }), + }).annotate({ title: "ReadOnlySandboxPolicy" }), + Schema.Struct({ + networkAccess: Schema.optionalKey( + Schema.Literals(["restricted", "enabled"]).annotate({ default: "restricted" }), + ), + type: Schema.Literal("externalSandbox").annotate({ + title: "ExternalSandboxSandboxPolicyType", + }), + }).annotate({ title: "ExternalSandboxSandboxPolicy" }), + Schema.Struct({ + excludeSlashTmp: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + excludeTmpdirEnvVar: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + networkAccess: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + readOnlyAccess: Schema.optionalKey( + Schema.Union( + [ + Schema.Struct({ + includePlatformDefaults: Schema.optionalKey( + Schema.Boolean.annotate({ default: true }), + ), + readableRoots: Schema.optionalKey( + Schema.Array(V2TurnStartParams__AbsolutePathBuf).annotate({ default: [] }), + ), + type: Schema.Literal("restricted").annotate({ + title: "RestrictedReadOnlyAccessType", + }), + }).annotate({ title: "RestrictedReadOnlyAccess" }), + Schema.Struct({ + type: Schema.Literal("fullAccess").annotate({ + title: "FullAccessReadOnlyAccessType", + }), + }).annotate({ title: "FullAccessReadOnlyAccess" }), + ], + { mode: "oneOf" }, + ).annotate({ default: { type: "fullAccess" } }), + ), + type: Schema.Literal("workspaceWrite").annotate({ title: "WorkspaceWriteSandboxPolicyType" }), + writableRoots: Schema.optionalKey( + Schema.Array(V2TurnStartParams__AbsolutePathBuf).annotate({ default: [] }), + ), + }).annotate({ title: "WorkspaceWriteSandboxPolicy" }), + ], + { mode: "oneOf" }, +); + +export type V2TurnStartParams__Settings = { + readonly developer_instructions?: string | null; + readonly model: string; + readonly reasoning_effort?: V2TurnStartParams__ReasoningEffort | null; +}; +export const V2TurnStartParams__Settings = Schema.Struct({ + developer_instructions: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + model: Schema.String, + reasoning_effort: Schema.optionalKey( + Schema.Union([V2TurnStartParams__ReasoningEffort, Schema.Null]), + ), +}).annotate({ description: "Settings for a collaboration mode." }); + +export type V2TurnStartParams__UserInput = | { readonly text: string; - readonly text_elements?: ReadonlyArray; + readonly text_elements?: ReadonlyArray; readonly type: "text"; } | { readonly type: "image"; readonly url: string } | { readonly path: string; readonly type: "localImage" } | { readonly name: string; readonly path: string; readonly type: "skill" } | { readonly name: string; readonly path: string; readonly type: "mention" }; -export const V2TurnSteerParams__UserInput = Schema.Union( +export const V2TurnStartParams__UserInput = Schema.Union( [ Schema.Struct({ text: Schema.String, text_elements: Schema.optionalKey( - Schema.Array(V2TurnSteerParams__TextElement).annotate({ + Schema.Array(V2TurnStartParams__TextElement).annotate({ description: "UI-defined spans within `text` used to render or persist special elements.", default: [], }), @@ -15347,148 +16463,413 @@ export const V2TurnSteerParams__UserInput = Schema.Union( { mode: "oneOf" }, ); -export type ApplyPatchApprovalResponse__ReviewDecision = - | "approved" +export type V2TurnStartResponse__CommandAction = | { - readonly approved_execpolicy_amendment: { - readonly proposed_execpolicy_amendment: ReadonlyArray; - }; + readonly command: string; + readonly name: string; + readonly path: V2TurnStartResponse__AbsolutePathBuf; + readonly type: "read"; } - | "approved_for_session" + | { readonly command: string; readonly path?: string | null; readonly type: "listFiles" } | { - readonly network_policy_amendment: { - readonly network_policy_amendment: ApplyPatchApprovalResponse__NetworkPolicyAmendment; - }; + readonly command: string; + readonly path?: string | null; + readonly query?: string | null; + readonly type: "search"; } - | "denied" - | "timed_out" - | "abort"; -export const ApplyPatchApprovalResponse__ReviewDecision = Schema.Union( + | { readonly command: string; readonly type: "unknown" }; +export const V2TurnStartResponse__CommandAction = 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), + command: Schema.String, + name: Schema.String, + path: V2TurnStartResponse__AbsolutePathBuf, + type: Schema.Literal("read").annotate({ title: "ReadCommandActionType" }), + }).annotate({ title: "ReadCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("listFiles").annotate({ title: "ListFilesCommandActionType" }), + }).annotate({ title: "ListFilesCommandAction" }), + Schema.Struct({ + command: Schema.String, + path: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + query: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + type: Schema.Literal("search").annotate({ title: "SearchCommandActionType" }), + }).annotate({ title: "SearchCommandAction" }), + Schema.Struct({ + command: Schema.String, + type: Schema.Literal("unknown").annotate({ title: "UnknownCommandActionType" }), + }).annotate({ title: "UnknownCommandAction" }), + ], + { mode: "oneOf" }, +); + +export type V2TurnStartResponse__CollabAgentState = { + readonly message?: string | null; + readonly status: V2TurnStartResponse__CollabAgentStatus; +}; +export const V2TurnStartResponse__CollabAgentState = Schema.Struct({ + message: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2TurnStartResponse__CollabAgentStatus, +}); + +export type V2TurnStartResponse__MemoryCitation = { + readonly entries: ReadonlyArray; + readonly threadIds: ReadonlyArray; +}; +export const V2TurnStartResponse__MemoryCitation = Schema.Struct({ + entries: Schema.Array(V2TurnStartResponse__MemoryCitationEntry), + threadIds: Schema.Array(Schema.String), +}); + +export type V2TurnStartResponse__CodexErrorInfo = + | "contextWindowExceeded" + | "usageLimitExceeded" + | "serverOverloaded" + | "internalServerError" + | "unauthorized" + | "badRequest" + | "threadRollbackFailed" + | "sandboxError" + | "other" + | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } } + | { readonly responseStreamDisconnected: { readonly httpStatusCode?: number | null } } + | { readonly responseTooManyFailedAttempts: { readonly httpStatusCode?: number | null } } + | { + readonly activeTurnNotSteerable: { + readonly turnKind: V2TurnStartResponse__NonSteerableTurnKind; + }; + }; +export const V2TurnStartResponse__CodexErrorInfo = Schema.Union( + [ + Schema.Literals([ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other", + ]), + Schema.Struct({ + httpConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Null, + ]), + ), + }), + }).annotate({ title: "HttpConnectionFailedCodexErrorInfo" }), + Schema.Struct({ + responseStreamConnectionFailed: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Null, + ]), + ), }), }).annotate({ - title: "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.", + title: "ResponseStreamConnectionFailedCodexErrorInfo", + description: "Failed to connect to the response SSE stream.", }), Schema.Struct({ - network_policy_amendment: Schema.Struct({ - network_policy_amendment: ApplyPatchApprovalResponse__NetworkPolicyAmendment, + responseStreamDisconnected: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Null, + ]), + ), }), }).annotate({ - title: "NetworkPolicyAmendmentReviewDecision", - description: - "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", - }), - Schema.Literal("denied").annotate({ + title: "ResponseStreamDisconnectedCodexErrorInfo", description: - "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + "The response SSE stream disconnected in the middle of a turn before completion.", }), - Schema.Literal("timed_out").annotate({ - description: "Automatic approval review timed out before reaching a decision.", + Schema.Struct({ + responseTooManyFailedAttempts: Schema.Struct({ + httpStatusCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ format: "uint16" }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Null, + ]), + ), + }), + }).annotate({ + title: "ResponseTooManyFailedAttemptsCodexErrorInfo", + description: "Reached the retry limit for responses.", }), - Schema.Literal("abort").annotate({ + Schema.Struct({ + activeTurnNotSteerable: Schema.Struct({ + turnKind: V2TurnStartResponse__NonSteerableTurnKind, + }), + }).annotate({ + title: "ActiveTurnNotSteerableCodexErrorInfo", description: - "User has denied this command and the agent should not do anything until the user's next command.", + "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", }), ], { mode: "oneOf" }, -).annotate({ description: "User's decision in response to an ExecApprovalRequest." }); +).annotate({ + description: + "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", +}); -export type ClientRequest__CommandExecParams = { - readonly command: ReadonlyArray; - readonly cwd?: string | null; - readonly disableOutputCap?: boolean; - readonly disableTimeout?: boolean; - readonly env?: { readonly [x: string]: string | null } | null; - readonly outputBytesCap?: number | null; - readonly processId?: string | null; - readonly sandboxPolicy?: ClientRequest__SandboxPolicy | null; - readonly size?: ClientRequest__CommandExecTerminalSize | null; - readonly streamStdin?: boolean; - readonly streamStdoutStderr?: boolean; - readonly timeoutMs?: number | null; - readonly tty?: boolean; +export type V2TurnStartResponse__FileUpdateChange = { + readonly diff: string; + readonly kind: V2TurnStartResponse__PatchChangeKind; + readonly path: string; }; -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()) - .check(Schema.isGreaterThanOrEqualTo(0)), - Schema.Null, - ]), - ), - processId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", - }), - Schema.Null, - ]), - ), - sandboxPolicy: Schema.optionalKey( - Schema.Union([ClientRequest__SandboxPolicy, Schema.Null]).annotate({ - description: - "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted.", - }), - ), - 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`.", +export const V2TurnStartResponse__FileUpdateChange = Schema.Struct({ + diff: Schema.String, + kind: V2TurnStartResponse__PatchChangeKind, + path: Schema.String, +}); + +export type V2TurnStartResponse__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { readonly type: "image"; readonly url: string } + | { readonly path: string; readonly type: "localImage" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2TurnStartResponse__UserInput = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2TurnStartResponse__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Struct({ + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +); + +export type V2TurnSteerParams__UserInput = + | { + readonly text: string; + readonly text_elements?: ReadonlyArray; + readonly type: "text"; + } + | { readonly type: "image"; readonly url: string } + | { readonly path: string; readonly type: "localImage" } + | { readonly name: string; readonly path: string; readonly type: "skill" } + | { readonly name: string; readonly path: string; readonly type: "mention" }; +export const V2TurnSteerParams__UserInput = Schema.Union( + [ + Schema.Struct({ + text: Schema.String, + text_elements: Schema.optionalKey( + Schema.Array(V2TurnSteerParams__TextElement).annotate({ + description: "UI-defined spans within `text` used to render or persist special elements.", + default: [], + }), + ), + type: Schema.Literal("text").annotate({ title: "TextUserInputType" }), + }).annotate({ title: "TextUserInput" }), + Schema.Struct({ + type: Schema.Literal("image").annotate({ title: "ImageUserInputType" }), + url: Schema.String, + }).annotate({ title: "ImageUserInput" }), + Schema.Struct({ + path: Schema.String, + type: Schema.Literal("localImage").annotate({ title: "LocalImageUserInputType" }), + }).annotate({ title: "LocalImageUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("skill").annotate({ title: "SkillUserInputType" }), + }).annotate({ title: "SkillUserInput" }), + Schema.Struct({ + name: Schema.String, + path: Schema.String, + type: Schema.Literal("mention").annotate({ title: "MentionUserInputType" }), + }).annotate({ title: "MentionUserInput" }), + ], + { mode: "oneOf" }, +); + +export type ApplyPatchApprovalResponse__ReviewDecision = + | "approved" + | { + readonly approved_execpolicy_amendment: { + readonly proposed_execpolicy_amendment: ReadonlyArray; + }; + } + | "approved_for_session" + | { + readonly network_policy_amendment: { + readonly network_policy_amendment: ApplyPatchApprovalResponse__NetworkPolicyAmendment; + }; + } + | "denied" + | "timed_out" + | "abort"; +export const ApplyPatchApprovalResponse__ReviewDecision = Schema.Union( + [ + Schema.Literal("approved").annotate({ + description: "User has approved this command and the agent should execute it.", + }), + Schema.Struct({ + approved_execpolicy_amendment: Schema.Struct({ + proposed_execpolicy_amendment: Schema.Array(Schema.String), + }), + }).annotate({ + title: "ApprovedExecpolicyAmendmentReviewDecision", + description: + "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", + }), + Schema.Literal("approved_for_session").annotate({ + description: + "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", + }), + Schema.Struct({ + network_policy_amendment: Schema.Struct({ + network_policy_amendment: ApplyPatchApprovalResponse__NetworkPolicyAmendment, + }), + }).annotate({ + title: "NetworkPolicyAmendmentReviewDecision", + description: + "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", + }), + Schema.Literal("denied").annotate({ + description: + "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + }), + Schema.Literal("timed_out").annotate({ + description: "Automatic approval review timed out before reaching a decision.", + }), + Schema.Literal("abort").annotate({ + description: + "User has denied this command and the agent should not do anything until the user's next command.", + }), + ], + { mode: "oneOf" }, +).annotate({ description: "User's decision in response to an ExecApprovalRequest." }); + +export type ClientRequest__CommandExecParams = { + readonly command: ReadonlyArray; + readonly cwd?: string | null; + readonly disableOutputCap?: boolean; + readonly disableTimeout?: boolean; + readonly env?: { readonly [x: string]: string | null } | null; + readonly outputBytesCap?: number | null; + readonly processId?: string | null; + readonly sandboxPolicy?: ClientRequest__SandboxPolicy | null; + readonly size?: ClientRequest__CommandExecTerminalSize | null; + readonly streamStdin?: boolean; + readonly streamStdoutStderr?: boolean; + readonly timeoutMs?: number | null; + readonly tty?: boolean; +}; +export const ClientRequest__CommandExecParams = Schema.Struct({ + command: Schema.Array(Schema.String).annotate({ + description: "Command argv vector. Empty arrays are rejected.", + }), + cwd: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Optional working directory. Defaults to the server cwd.", + }), + Schema.Null, + ]), + ), + disableOutputCap: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.", + }), + ), + disableTimeout: Schema.optionalKey( + Schema.Boolean.annotate({ + description: + "Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.", + }), + ), + env: Schema.optionalKey( + Schema.Union([ + Schema.Record(Schema.String, Schema.Union([Schema.String, Schema.Null])).annotate({ + description: + "Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable.", + }), + Schema.Null, + ]), + ), + outputBytesCap: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: + "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", + format: "uint", + }) + .check(Schema.isInt()) + .check(Schema.isGreaterThanOrEqualTo(0)), + Schema.Null, + ]), + ), + processId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", + }), + Schema.Null, + ]), + ), + sandboxPolicy: Schema.optionalKey( + Schema.Union([ClientRequest__SandboxPolicy, Schema.Null]).annotate({ + description: + "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted.", + }), + ), + 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( @@ -15517,13 +16898,6 @@ export const ClientRequest__CommandExecParams = Schema.Struct({ "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.", }); -export type ClientRequest__ExternalAgentConfigImportParams = { - readonly migrationItems: ReadonlyArray; -}; -export const ClientRequest__ExternalAgentConfigImportParams = Schema.Struct({ - migrationItems: Schema.Array(ClientRequest__ExternalAgentConfigMigrationItem), -}); - export type ClientRequest__FunctionCallOutputBody = | string | ReadonlyArray; @@ -15558,19 +16932,51 @@ export const ClientRequest__ConfigBatchWriteParams = Schema.Struct({ ), }); -export type ClientRequest__TurnStartParams = { - readonly approvalPolicy?: ClientRequest__AskForApproval | null; - readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; +export type ClientRequest__ExternalAgentConfigMigrationItem = { readonly cwd?: string | null; - readonly effort?: ClientRequest__ReasoningEffort | null; - readonly input: ReadonlyArray; - readonly model?: string | null; - readonly outputSchema?: unknown; - readonly personality?: ClientRequest__Personality | null; - readonly sandboxPolicy?: ClientRequest__SandboxPolicy | null; - readonly serviceTier?: ClientRequest__ServiceTier | null | null; - readonly summary?: ClientRequest__ReasoningSummary | null; - readonly threadId: string; + 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, +}); + +export type ClientRequest__DeviceKeySignParams = { + readonly keyId: string; + readonly payload: ClientRequest__DeviceKeySignPayload; +}; +export const ClientRequest__DeviceKeySignParams = Schema.Struct({ + keyId: Schema.String, + payload: ClientRequest__DeviceKeySignPayload, +}).annotate({ + description: "Sign an accepted structured payload with a controller-local device key.", +}); + +export type ClientRequest__TurnStartParams = { + readonly approvalPolicy?: ClientRequest__AskForApproval | null; + readonly approvalsReviewer?: ClientRequest__ApprovalsReviewer | null; + readonly cwd?: string | null; + readonly effort?: ClientRequest__ReasoningEffort | null; + readonly input: ReadonlyArray; + readonly model?: string | null; + readonly outputSchema?: unknown; + readonly personality?: ClientRequest__Personality | null; + readonly sandboxPolicy?: ClientRequest__SandboxPolicy | null; + readonly serviceTier?: ClientRequest__ServiceTier | null | null; + readonly summary?: ClientRequest__ReasoningSummary | null; + readonly threadId: string; }; export const ClientRequest__TurnStartParams = Schema.Struct({ approvalPolicy: Schema.optionalKey( @@ -15649,6 +17055,15 @@ export const ClientRequest__TurnSteerParams = Schema.Struct({ threadId: Schema.String, }); +export type CommandExecutionRequestApprovalParams__FileSystemSandboxEntry = { + readonly access: CommandExecutionRequestApprovalParams__FileSystemAccessMode; + readonly path: CommandExecutionRequestApprovalParams__FileSystemPath; +}; +export const CommandExecutionRequestApprovalParams__FileSystemSandboxEntry = Schema.Struct({ + access: CommandExecutionRequestApprovalParams__FileSystemAccessMode, + path: CommandExecutionRequestApprovalParams__FileSystemPath, +}); + export type CommandExecutionRequestApprovalResponse__CommandExecutionApprovalDecision = | "accept" | "acceptForSession" @@ -15835,33 +17250,22 @@ export const McpServerElicitationRequestParams__McpElicitationSingleSelectEnumSc ], ); -export type PermissionsRequestApprovalParams__RequestPermissionProfile = { - readonly fileSystem?: PermissionsRequestApprovalParams__AdditionalFileSystemPermissions | null; - readonly network?: PermissionsRequestApprovalParams__AdditionalNetworkPermissions | null; +export type PermissionsRequestApprovalParams__FileSystemSandboxEntry = { + readonly access: PermissionsRequestApprovalParams__FileSystemAccessMode; + readonly path: PermissionsRequestApprovalParams__FileSystemPath; }; -export const PermissionsRequestApprovalParams__RequestPermissionProfile = Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalParams__AdditionalFileSystemPermissions, Schema.Null]), - ), - network: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalParams__AdditionalNetworkPermissions, Schema.Null]), - ), +export const PermissionsRequestApprovalParams__FileSystemSandboxEntry = Schema.Struct({ + access: PermissionsRequestApprovalParams__FileSystemAccessMode, + path: PermissionsRequestApprovalParams__FileSystemPath, }); -export type PermissionsRequestApprovalResponse__GrantedPermissionProfile = { - readonly fileSystem?: PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions | null; - readonly network?: PermissionsRequestApprovalResponse__AdditionalNetworkPermissions | null; +export type PermissionsRequestApprovalResponse__FileSystemSandboxEntry = { + readonly access: PermissionsRequestApprovalResponse__FileSystemAccessMode; + readonly path: PermissionsRequestApprovalResponse__FileSystemPath; }; -export const PermissionsRequestApprovalResponse__GrantedPermissionProfile = Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([ - PermissionsRequestApprovalResponse__AdditionalFileSystemPermissions, - Schema.Null, - ]), - ), - network: Schema.optionalKey( - Schema.Union([PermissionsRequestApprovalResponse__AdditionalNetworkPermissions, Schema.Null]), - ), +export const PermissionsRequestApprovalResponse__FileSystemSandboxEntry = Schema.Struct({ + access: PermissionsRequestApprovalResponse__FileSystemAccessMode, + path: PermissionsRequestApprovalResponse__FileSystemPath, }); export type ServerNotification__AppInfo = { @@ -15903,6 +17307,15 @@ export const ServerNotification__AppInfo = Schema.Struct({ pluginDisplayNames: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), }).annotate({ description: "EXPERIMENTAL - app metadata returned by app-list APIs." }); +export type ServerNotification__FileSystemSandboxEntry = { + readonly access: ServerNotification__FileSystemAccessMode; + readonly path: ServerNotification__FileSystemPath; +}; +export const ServerNotification__FileSystemSandboxEntry = Schema.Struct({ + access: ServerNotification__FileSystemAccessMode, + path: ServerNotification__FileSystemPath, +}); + export type ServerNotification__FuzzyFileSearchSessionUpdatedNotification = { readonly files: ReadonlyArray; readonly query: string; @@ -15924,7 +17337,16 @@ export type ServerNotification__HookRunSummary = { readonly handlerType: ServerNotification__HookHandlerType; readonly id: string; readonly scope: ServerNotification__HookScope; - readonly sourcePath: string; + readonly source?: + | "system" + | "user" + | "project" + | "mdm" + | "sessionFlags" + | "legacyManagedConfigFile" + | "legacyManagedConfigMdm" + | "unknown"; + readonly sourcePath: ServerNotification__AbsolutePathBuf; readonly startedAt: number; readonly status: ServerNotification__HookRunStatus; readonly statusMessage?: string | null; @@ -15943,70 +17365,24 @@ export const ServerNotification__HookRunSummary = Schema.Struct({ handlerType: ServerNotification__HookHandlerType, id: Schema.String, scope: ServerNotification__HookScope, - sourcePath: Schema.String, + source: Schema.optionalKey( + Schema.Literals([ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown", + ]).annotate({ default: "unknown" }), + ), + sourcePath: ServerNotification__AbsolutePathBuf, startedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), status: ServerNotification__HookRunStatus, statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), }); -export type ServerNotification__ItemGuardianApprovalReviewCompletedNotification = { - readonly action: ServerNotification__GuardianApprovalReviewAction; - readonly decisionSource: ServerNotification__AutoReviewDecisionSource; - readonly review: ServerNotification__GuardianApprovalReview; - readonly reviewId: string; - readonly targetItemId?: string | null; - readonly threadId: string; - readonly turnId: string; -}; -export const ServerNotification__ItemGuardianApprovalReviewCompletedNotification = Schema.Struct({ - action: ServerNotification__GuardianApprovalReviewAction, - decisionSource: ServerNotification__AutoReviewDecisionSource, - review: ServerNotification__GuardianApprovalReview, - reviewId: Schema.String.annotate({ description: "Stable identifier for this review." }), - targetItemId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", - }), - Schema.Null, - ]), - ), - threadId: Schema.String, - turnId: Schema.String, -}).annotate({ - description: - "[UNSTABLE] Temporary notification payload for guardian automatic approval review. This shape is expected to change soon.", -}); - -export type ServerNotification__ItemGuardianApprovalReviewStartedNotification = { - readonly action: ServerNotification__GuardianApprovalReviewAction; - readonly review: ServerNotification__GuardianApprovalReview; - readonly reviewId: string; - readonly targetItemId?: string | null; - readonly threadId: string; - readonly turnId: string; -}; -export const ServerNotification__ItemGuardianApprovalReviewStartedNotification = Schema.Struct({ - action: ServerNotification__GuardianApprovalReviewAction, - review: ServerNotification__GuardianApprovalReview, - reviewId: Schema.String.annotate({ description: "Stable identifier for this review." }), - targetItemId: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", - }), - Schema.Null, - ]), - ), - threadId: Schema.String, - turnId: Schema.String, -}).annotate({ - description: - "[UNSTABLE] Temporary notification payload for guardian automatic approval review. This shape is expected to change soon.", -}); - export type ServerNotification__TurnError = { readonly additionalDetails?: string | null; readonly codexErrorInfo?: ServerNotification__CodexErrorInfo | null; @@ -16020,6 +17396,19 @@ export const ServerNotification__TurnError = Schema.Struct({ message: Schema.String, }); +export type ServerNotification__FileChangePatchUpdatedNotification = { + readonly changes: ReadonlyArray; + readonly itemId: string; + readonly threadId: string; + readonly turnId: string; +}; +export const ServerNotification__FileChangePatchUpdatedNotification = Schema.Struct({ + changes: Schema.Array(ServerNotification__FileUpdateChange), + itemId: Schema.String, + threadId: Schema.String, + turnId: Schema.String, +}); + export type ServerNotification__AccountRateLimitsUpdatedNotification = { readonly rateLimits: ServerNotification__RateLimitSnapshot; }; @@ -16076,6 +17465,7 @@ export type ServerNotification__ThreadItem = readonly durationMs?: number | null; readonly error?: ServerNotification__McpToolCallError | null; readonly id: string; + readonly mcpAppResourceUri?: string | null; readonly result?: ServerNotification__McpToolCallResult | null; readonly server: string; readonly status: ServerNotification__McpToolCallStatus; @@ -16087,6 +17477,7 @@ export type ServerNotification__ThreadItem = 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; @@ -16110,12 +17501,16 @@ export type ServerNotification__ThreadItem = readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: ServerNotification__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: ServerNotification__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } @@ -16172,7 +17567,10 @@ export const ServerNotification__ThreadItem = Schema.Union( description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -16232,6 +17630,7 @@ export const ServerNotification__ThreadItem = Schema.Union( ), error: Schema.optionalKey(Schema.Union([ServerNotification__McpToolCallError, Schema.Null])), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( Schema.Union([ServerNotification__McpToolCallResult, Schema.Null]), ), @@ -16258,6 +17657,7 @@ export const ServerNotification__ThreadItem = Schema.Union( ]), ), 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, @@ -16318,14 +17718,16 @@ export const ServerNotification__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: ServerNotification__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([ServerNotification__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -16415,17 +17817,13 @@ export const ServerNotification__TurnPlanUpdatedNotification = Schema.Struct({ turnId: Schema.String, }); -export type ServerRequest__RequestPermissionProfile = { - readonly fileSystem?: ServerRequest__AdditionalFileSystemPermissions | null; - readonly network?: ServerRequest__AdditionalNetworkPermissions | null; +export type ServerRequest__FileSystemSandboxEntry = { + readonly access: ServerRequest__FileSystemAccessMode; + readonly path: ServerRequest__FileSystemPath; }; -export const ServerRequest__RequestPermissionProfile = Schema.Struct({ - fileSystem: Schema.optionalKey( - Schema.Union([ServerRequest__AdditionalFileSystemPermissions, Schema.Null]), - ), - network: Schema.optionalKey( - Schema.Union([ServerRequest__AdditionalNetworkPermissions, Schema.Null]), - ), +export const ServerRequest__FileSystemSandboxEntry = Schema.Struct({ + access: ServerRequest__FileSystemAccessMode, + path: ServerRequest__FileSystemPath, }); export type ServerRequest__McpElicitationTitledMultiSelectEnumSchema = { @@ -16506,7 +17904,7 @@ export type ServerRequest__CommandExecutionRequestApprovalParams = { readonly approvalId?: string | null; readonly command?: string | null; readonly commandActions?: ReadonlyArray | null; - readonly cwd?: string | null; + readonly cwd?: ServerRequest__AbsolutePathBuf | null; readonly itemId: string; readonly networkApprovalContext?: ServerRequest__NetworkApprovalContext | null; readonly proposedExecpolicyAmendment?: ReadonlyArray | null; @@ -16540,10 +17938,9 @@ export const ServerRequest__CommandExecutionRequestApprovalParams = Schema.Struc ]), ), cwd: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ description: "The command's working directory." }), - Schema.Null, - ]), + Schema.Union([ServerRequest__AbsolutePathBuf, Schema.Null]).annotate({ + description: "The command's working directory.", + }), ), itemId: Schema.String, networkApprovalContext: Schema.optionalKey( @@ -16731,91 +18128,547 @@ export const V2ErrorNotification__TurnError = Schema.Struct({ message: Schema.String, }); -export type V2HookCompletedNotification__HookRunSummary = { - readonly completedAt?: number | null; - readonly displayOrder: number; - readonly durationMs?: number | null; - readonly entries: ReadonlyArray; - readonly eventName: V2HookCompletedNotification__HookEventName; - readonly executionMode: V2HookCompletedNotification__HookExecutionMode; - readonly handlerType: V2HookCompletedNotification__HookHandlerType; - readonly id: string; - readonly scope: V2HookCompletedNotification__HookScope; - readonly sourcePath: string; - readonly startedAt: number; - readonly status: V2HookCompletedNotification__HookRunStatus; - readonly statusMessage?: string | null; +export type V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem = { + readonly cwd?: string | null; + readonly description: string; + readonly details?: V2ExternalAgentConfigDetectResponse__MigrationDetails | null; + readonly itemType: V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType; +}; +export const V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItem = Schema.Struct({ + cwd: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + }), + Schema.Null, + ]), + ), + description: Schema.String, + details: Schema.optionalKey( + Schema.Union([V2ExternalAgentConfigDetectResponse__MigrationDetails, Schema.Null]), + ), + itemType: V2ExternalAgentConfigDetectResponse__ExternalAgentConfigMigrationItemType, +}); + +export type V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem = { + readonly cwd?: string | null; + readonly description: string; + readonly details?: V2ExternalAgentConfigImportParams__MigrationDetails | null; + readonly itemType: V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType; +}; +export const V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItem = Schema.Struct({ + cwd: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + }), + Schema.Null, + ]), + ), + description: Schema.String, + details: Schema.optionalKey( + Schema.Union([V2ExternalAgentConfigImportParams__MigrationDetails, Schema.Null]), + ), + itemType: V2ExternalAgentConfigImportParams__ExternalAgentConfigMigrationItemType, +}); + +export type V2HookCompletedNotification__HookRunSummary = { + readonly completedAt?: number | null; + readonly displayOrder: number; + readonly durationMs?: number | null; + readonly entries: ReadonlyArray; + readonly eventName: V2HookCompletedNotification__HookEventName; + readonly executionMode: V2HookCompletedNotification__HookExecutionMode; + readonly handlerType: V2HookCompletedNotification__HookHandlerType; + readonly id: string; + readonly scope: V2HookCompletedNotification__HookScope; + readonly source?: + | "system" + | "user" + | "project" + | "mdm" + | "sessionFlags" + | "legacyManagedConfigFile" + | "legacyManagedConfigMdm" + | "unknown"; + readonly sourcePath: V2HookCompletedNotification__AbsolutePathBuf; + readonly startedAt: number; + readonly status: V2HookCompletedNotification__HookRunStatus; + readonly statusMessage?: string | null; +}; +export const V2HookCompletedNotification__HookRunSummary = Schema.Struct({ + completedAt: Schema.optionalKey( + Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + ), + displayOrder: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + durationMs: Schema.optionalKey( + Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + ), + entries: Schema.Array(V2HookCompletedNotification__HookOutputEntry), + eventName: V2HookCompletedNotification__HookEventName, + executionMode: V2HookCompletedNotification__HookExecutionMode, + handlerType: V2HookCompletedNotification__HookHandlerType, + id: Schema.String, + scope: V2HookCompletedNotification__HookScope, + source: Schema.optionalKey( + Schema.Literals([ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown", + ]).annotate({ default: "unknown" }), + ), + sourcePath: V2HookCompletedNotification__AbsolutePathBuf, + startedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + status: V2HookCompletedNotification__HookRunStatus, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}); + +export type V2HookStartedNotification__HookRunSummary = { + readonly completedAt?: number | null; + readonly displayOrder: number; + readonly durationMs?: number | null; + readonly entries: ReadonlyArray; + readonly eventName: V2HookStartedNotification__HookEventName; + readonly executionMode: V2HookStartedNotification__HookExecutionMode; + readonly handlerType: V2HookStartedNotification__HookHandlerType; + readonly id: string; + readonly scope: V2HookStartedNotification__HookScope; + readonly source?: + | "system" + | "user" + | "project" + | "mdm" + | "sessionFlags" + | "legacyManagedConfigFile" + | "legacyManagedConfigMdm" + | "unknown"; + readonly sourcePath: V2HookStartedNotification__AbsolutePathBuf; + readonly startedAt: number; + readonly status: V2HookStartedNotification__HookRunStatus; + readonly statusMessage?: string | null; +}; +export const V2HookStartedNotification__HookRunSummary = Schema.Struct({ + completedAt: Schema.optionalKey( + Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + ), + displayOrder: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + durationMs: Schema.optionalKey( + Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), + ), + entries: Schema.Array(V2HookStartedNotification__HookOutputEntry), + eventName: V2HookStartedNotification__HookEventName, + executionMode: V2HookStartedNotification__HookExecutionMode, + handlerType: V2HookStartedNotification__HookHandlerType, + id: Schema.String, + scope: V2HookStartedNotification__HookScope, + source: Schema.optionalKey( + Schema.Literals([ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown", + ]).annotate({ default: "unknown" }), + ), + sourcePath: V2HookStartedNotification__AbsolutePathBuf, + startedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), + status: V2HookStartedNotification__HookRunStatus, + statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}); + +export type V2ItemCompletedNotification__ThreadItem = + | { + readonly content: ReadonlyArray; + readonly id: string; + readonly type: "userMessage"; + } + | { + readonly fragments: ReadonlyArray; + readonly id: string; + readonly type: "hookPrompt"; + } + | { + readonly id: string; + readonly memoryCitation?: V2ItemCompletedNotification__MemoryCitation | null; + readonly phase?: V2ItemCompletedNotification__MessagePhase | null; + readonly text: string; + readonly type: "agentMessage"; + } + | { readonly id: string; readonly text: string; readonly type: "plan" } + | { + readonly content?: ReadonlyArray; + readonly id: string; + readonly summary?: ReadonlyArray; + readonly type: "reasoning"; + } + | { + readonly aggregatedOutput?: string | null; + readonly command: string; + readonly commandActions: ReadonlyArray; + readonly cwd: string; + readonly durationMs?: number | null; + readonly exitCode?: number | null; + readonly id: string; + readonly processId?: string | null; + readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; + readonly status: V2ItemCompletedNotification__CommandExecutionStatus; + readonly type: "commandExecution"; + } + | { + readonly changes: ReadonlyArray; + readonly id: string; + readonly status: V2ItemCompletedNotification__PatchApplyStatus; + readonly type: "fileChange"; + } + | { + readonly arguments: unknown; + readonly durationMs?: number | null; + readonly error?: V2ItemCompletedNotification__McpToolCallError | null; + readonly id: string; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ItemCompletedNotification__McpToolCallResult | null; + readonly server: string; + readonly status: V2ItemCompletedNotification__McpToolCallStatus; + readonly tool: string; + readonly type: "mcpToolCall"; + } + | { + readonly arguments: unknown; + readonly contentItems?: ReadonlyArray | null; + readonly durationMs?: number | null; + readonly id: string; + readonly namespace?: string | null; + readonly status: V2ItemCompletedNotification__DynamicToolCallStatus; + readonly success?: boolean | null; + readonly tool: string; + readonly type: "dynamicToolCall"; + } + | { + readonly agentsStates: { + readonly [x: string]: V2ItemCompletedNotification__CollabAgentState; + }; + readonly id: string; + readonly model?: string | null; + readonly prompt?: string | null; + readonly reasoningEffort?: V2ItemCompletedNotification__ReasoningEffort | null; + readonly receiverThreadIds: ReadonlyArray; + readonly senderThreadId: string; + readonly status: "inProgress" | "completed" | "failed"; + readonly tool: "spawnAgent" | "sendInput" | "resumeAgent" | "wait" | "closeAgent"; + readonly type: "collabAgentToolCall"; + } + | { + readonly action?: V2ItemCompletedNotification__WebSearchAction | null; + readonly id: string; + readonly query: string; + readonly type: "webSearch"; + } + | { + readonly id: string; + readonly path: V2ItemCompletedNotification__AbsolutePathBuf; + readonly type: "imageView"; + } + | { + readonly id: string; + readonly result: string; + readonly revisedPrompt?: string | null; + readonly savedPath?: V2ItemCompletedNotification__AbsolutePathBuf | null; + readonly status: string; + readonly type: "imageGeneration"; + } + | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } + | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } + | { readonly id: string; readonly type: "contextCompaction" }; +export const V2ItemCompletedNotification__ThreadItem = Schema.Union( + [ + Schema.Struct({ + content: Schema.Array(V2ItemCompletedNotification__UserInput), + id: Schema.String, + type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), + }).annotate({ title: "UserMessageThreadItem" }), + Schema.Struct({ + fragments: Schema.Array(V2ItemCompletedNotification__HookPromptFragment), + id: Schema.String, + type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), + }).annotate({ title: "HookPromptThreadItem" }), + Schema.Struct({ + id: Schema.String, + memoryCitation: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__MessagePhase, Schema.Null]), + ), + text: Schema.String, + type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), + }).annotate({ title: "AgentMessageThreadItem" }), + Schema.Struct({ + id: Schema.String, + text: Schema.String, + type: Schema.Literal("plan").annotate({ title: "PlanThreadItemType" }), + }).annotate({ + title: "PlanThreadItem", + description: + "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + }), + Schema.Struct({ + content: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + id: Schema.String, + summary: Schema.optionalKey(Schema.Array(Schema.String).annotate({ default: [] })), + type: Schema.Literal("reasoning").annotate({ title: "ReasoningThreadItemType" }), + }).annotate({ title: "ReasoningThreadItem" }), + Schema.Struct({ + aggregatedOutput: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "The command's output, aggregated from stdout and stderr.", + }), + Schema.Null, + ]), + ), + command: Schema.String.annotate({ description: "The command to be executed." }), + commandActions: Schema.Array(V2ItemCompletedNotification__CommandAction).annotate({ + description: + "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + }), + cwd: Schema.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.", + }), + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The duration of the command execution in milliseconds.", + format: "int64", + }).check(Schema.isInt()), + Schema.Null, + ]), + ), + exitCode: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The command's exit code.", + format: "int32", + }).check(Schema.isInt()), + Schema.Null, + ]), + ), + id: Schema.String, + processId: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: "Identifier for the underlying PTY process (when available).", + }), + Schema.Null, + ]), + ), + source: Schema.optionalKey( + Schema.Literals([ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction", + ]).annotate({ default: "agent" }), + ), + status: V2ItemCompletedNotification__CommandExecutionStatus, + type: Schema.Literal("commandExecution").annotate({ + title: "CommandExecutionThreadItemType", + }), + }).annotate({ title: "CommandExecutionThreadItem" }), + Schema.Struct({ + changes: Schema.Array(V2ItemCompletedNotification__FileUpdateChange), + id: Schema.String, + status: V2ItemCompletedNotification__PatchApplyStatus, + type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), + }).annotate({ title: "FileChangeThreadItem" }), + Schema.Struct({ + arguments: Schema.Unknown, + durationMs: Schema.optionalKey( + Schema.Union([ + Schema.Number.annotate({ + description: "The duration of the MCP tool call in milliseconds.", + format: "int64", + }).check(Schema.isInt()), + Schema.Null, + ]), + ), + error: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__McpToolCallError, Schema.Null]), + ), + id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + result: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__McpToolCallResult, Schema.Null]), + ), + server: Schema.String, + status: V2ItemCompletedNotification__McpToolCallStatus, + tool: Schema.String, + type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), + }).annotate({ title: "McpToolCallThreadItem" }), + Schema.Struct({ + arguments: Schema.Unknown, + 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()), + Schema.Null, + ]), + ), + id: Schema.String, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ItemCompletedNotification__DynamicToolCallStatus, + success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), + tool: Schema.String, + type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), + }).annotate({ title: "DynamicToolCallThreadItem" }), + Schema.Struct({ + 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.Literals(["inProgress", "completed", "failed"]).annotate({ + description: "Current status of the collab tool call.", + }), + tool: Schema.Literals([ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent", + ]).annotate({ description: "Name of the collab tool that was invoked." }), + type: Schema.Literal("collabAgentToolCall").annotate({ + title: "CollabAgentToolCallThreadItemType", + }), + }).annotate({ title: "CollabAgentToolCallThreadItem" }), + Schema.Struct({ + action: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__WebSearchAction, Schema.Null]), + ), + id: Schema.String, + query: Schema.String, + type: Schema.Literal("webSearch").annotate({ title: "WebSearchThreadItemType" }), + }).annotate({ title: "WebSearchThreadItem" }), + Schema.Struct({ + id: Schema.String, + path: V2ItemCompletedNotification__AbsolutePathBuf, + type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), + }).annotate({ title: "ImageViewThreadItem" }), + Schema.Struct({ + id: Schema.String, + result: Schema.String, + revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ItemCompletedNotification__AbsolutePathBuf, Schema.Null]), + ), + status: Schema.String, + type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), + }).annotate({ title: "ImageGenerationThreadItem" }), + Schema.Struct({ + id: Schema.String, + review: Schema.String, + type: Schema.Literal("enteredReviewMode").annotate({ + title: "EnteredReviewModeThreadItemType", + }), + }).annotate({ title: "EnteredReviewModeThreadItem" }), + Schema.Struct({ + id: Schema.String, + review: Schema.String, + type: Schema.Literal("exitedReviewMode").annotate({ + title: "ExitedReviewModeThreadItemType", + }), + }).annotate({ title: "ExitedReviewModeThreadItem" }), + Schema.Struct({ + id: Schema.String, + type: Schema.Literal("contextCompaction").annotate({ + title: "ContextCompactionThreadItemType", + }), + }).annotate({ title: "ContextCompactionThreadItem" }), + ], + { mode: "oneOf" }, +); + +export type V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry = { + readonly access: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode; + readonly path: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath; }; -export const V2HookCompletedNotification__HookRunSummary = Schema.Struct({ - completedAt: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - displayOrder: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - durationMs: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - entries: Schema.Array(V2HookCompletedNotification__HookOutputEntry), - eventName: V2HookCompletedNotification__HookEventName, - executionMode: V2HookCompletedNotification__HookExecutionMode, - handlerType: V2HookCompletedNotification__HookHandlerType, - id: Schema.String, - scope: V2HookCompletedNotification__HookScope, - sourcePath: Schema.String, - startedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - status: V2HookCompletedNotification__HookRunStatus, - statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export const V2ItemGuardianApprovalReviewCompletedNotification__FileSystemSandboxEntry = + Schema.Struct({ + access: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemAccessMode, + path: V2ItemGuardianApprovalReviewCompletedNotification__FileSystemPath, + }); -export type V2HookStartedNotification__HookRunSummary = { - readonly completedAt?: number | null; - readonly displayOrder: number; - readonly durationMs?: number | null; - readonly entries: ReadonlyArray; - readonly eventName: V2HookStartedNotification__HookEventName; - readonly executionMode: V2HookStartedNotification__HookExecutionMode; - readonly handlerType: V2HookStartedNotification__HookHandlerType; - readonly id: string; - readonly scope: V2HookStartedNotification__HookScope; - readonly sourcePath: string; - readonly startedAt: number; - readonly status: V2HookStartedNotification__HookRunStatus; - readonly statusMessage?: string | null; +export type V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry = { + readonly access: V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode; + readonly path: V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath; }; -export const V2HookStartedNotification__HookRunSummary = Schema.Struct({ - completedAt: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - displayOrder: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - durationMs: Schema.optionalKey( - Schema.Union([Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), Schema.Null]), - ), - entries: Schema.Array(V2HookStartedNotification__HookOutputEntry), - eventName: V2HookStartedNotification__HookEventName, - executionMode: V2HookStartedNotification__HookExecutionMode, - handlerType: V2HookStartedNotification__HookHandlerType, - id: Schema.String, - scope: V2HookStartedNotification__HookScope, - sourcePath: Schema.String, - startedAt: Schema.Number.annotate({ format: "int64" }).check(Schema.isInt()), - status: V2HookStartedNotification__HookRunStatus, - statusMessage: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), -}); +export const V2ItemGuardianApprovalReviewStartedNotification__FileSystemSandboxEntry = + Schema.Struct({ + access: V2ItemGuardianApprovalReviewStartedNotification__FileSystemAccessMode, + path: V2ItemGuardianApprovalReviewStartedNotification__FileSystemPath, + }); -export type V2ItemCompletedNotification__ThreadItem = +export type V2ItemStartedNotification__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ItemCompletedNotification__MemoryCitation | null; - readonly phase?: V2ItemCompletedNotification__MessagePhase | null; + readonly memoryCitation?: V2ItemStartedNotification__MemoryCitation | null; + readonly phase?: V2ItemStartedNotification__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -16829,51 +18682,51 @@ export type V2ItemCompletedNotification__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray; readonly cwd: string; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; readonly processId?: string | null; readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ItemCompletedNotification__CommandExecutionStatus; + readonly status: V2ItemStartedNotification__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ItemCompletedNotification__PatchApplyStatus; + readonly status: V2ItemStartedNotification__PatchApplyStatus; readonly type: "fileChange"; } | { readonly arguments: unknown; readonly durationMs?: number | null; - readonly error?: V2ItemCompletedNotification__McpToolCallError | null; + readonly error?: V2ItemStartedNotification__McpToolCallError | null; readonly id: string; - readonly result?: V2ItemCompletedNotification__McpToolCallResult | null; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ItemStartedNotification__McpToolCallResult | null; readonly server: string; - readonly status: V2ItemCompletedNotification__McpToolCallStatus; + readonly status: V2ItemStartedNotification__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; - readonly status: V2ItemCompletedNotification__DynamicToolCallStatus; + readonly namespace?: string | null; + readonly status: V2ItemStartedNotification__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { - readonly [x: string]: V2ItemCompletedNotification__CollabAgentState; - }; + readonly agentsStates: { readonly [x: string]: V2ItemStartedNotification__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ItemCompletedNotification__ReasoningEffort | null; + readonly reasoningEffort?: V2ItemStartedNotification__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; readonly status: "inProgress" | "completed" | "failed"; @@ -16881,42 +18734,46 @@ export type V2ItemCompletedNotification__ThreadItem = readonly type: "collabAgentToolCall"; } | { - readonly action?: V2ItemCompletedNotification__WebSearchAction | null; + readonly action?: V2ItemStartedNotification__WebSearchAction | null; readonly id: string; readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: V2ItemStartedNotification__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: V2ItemStartedNotification__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ItemCompletedNotification__ThreadItem = Schema.Union( +export const V2ItemStartedNotification__ThreadItem = Schema.Union( [ Schema.Struct({ - content: Schema.Array(V2ItemCompletedNotification__UserInput), + content: Schema.Array(V2ItemStartedNotification__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ItemCompletedNotification__HookPromptFragment), + fragments: Schema.Array(V2ItemStartedNotification__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__MemoryCitation, Schema.Null]), + Schema.Union([V2ItemStartedNotification__MemoryCitation, Schema.Null]), ), phase: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__MessagePhase, Schema.Null]), + Schema.Union([V2ItemStartedNotification__MessagePhase, Schema.Null]), ), text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), @@ -16946,11 +18803,14 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ItemCompletedNotification__CommandAction).annotate({ + commandActions: Schema.Array(V2ItemStartedNotification__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -16986,15 +18846,15 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( "unifiedExecInteraction", ]).annotate({ default: "agent" }), ), - status: V2ItemCompletedNotification__CommandExecutionStatus, + status: V2ItemStartedNotification__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ItemCompletedNotification__FileUpdateChange), + changes: Schema.Array(V2ItemStartedNotification__FileUpdateChange), id: Schema.String, - status: V2ItemCompletedNotification__PatchApplyStatus, + status: V2ItemStartedNotification__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ @@ -17009,14 +18869,15 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( ]), ), error: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__McpToolCallError, Schema.Null]), + Schema.Union([V2ItemStartedNotification__McpToolCallError, Schema.Null]), ), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__McpToolCallResult, Schema.Null]), + Schema.Union([V2ItemStartedNotification__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ItemCompletedNotification__McpToolCallStatus, + status: V2ItemStartedNotification__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), @@ -17024,7 +18885,7 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( arguments: Schema.Unknown, contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ItemCompletedNotification__DynamicToolCallOutputContentItem), + Schema.Array(V2ItemStartedNotification__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -17038,7 +18899,8 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( ]), ), id: Schema.String, - status: V2ItemCompletedNotification__DynamicToolCallStatus, + 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" }), @@ -17046,7 +18908,7 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( Schema.Struct({ agentsStates: Schema.Record( Schema.String, - V2ItemCompletedNotification__CollabAgentState, + 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( @@ -17066,7 +18928,7 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ItemStartedNotification__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -17093,7 +18955,7 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ItemCompletedNotification__WebSearchAction, Schema.Null]), + Schema.Union([V2ItemStartedNotification__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, @@ -17101,14 +18963,16 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: V2ItemStartedNotification__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ItemStartedNotification__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -17136,21 +19000,140 @@ export const V2ItemCompletedNotification__ThreadItem = Schema.Union( { mode: "oneOf" }, ); -export type V2ItemStartedNotification__ThreadItem = +export type V2ModelListResponse__Model = { + readonly additionalSpeedTiers?: ReadonlyArray; + readonly availabilityNux?: V2ModelListResponse__ModelAvailabilityNux | null; + readonly defaultReasoningEffort: V2ModelListResponse__ReasoningEffort; + readonly description: string; + readonly displayName: string; + readonly hidden: boolean; + readonly id: string; + readonly inputModalities?: ReadonlyArray; + readonly isDefault: boolean; + readonly model: string; + 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({ default: [] })), + availabilityNux: Schema.optionalKey( + Schema.Union([V2ModelListResponse__ModelAvailabilityNux, Schema.Null]), + ), + defaultReasoningEffort: V2ModelListResponse__ReasoningEffort, + 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, + supportedReasoningEfforts: Schema.Array(V2ModelListResponse__ReasoningEffortOption), + supportsPersonality: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), + upgrade: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + upgradeInfo: Schema.optionalKey( + Schema.Union([V2ModelListResponse__ModelUpgradeInfo, Schema.Null]), + ), +}); + +export type V2PluginListResponse__PluginSummary = { + readonly authPolicy: V2PluginListResponse__PluginAuthPolicy; + readonly enabled: boolean; + readonly id: string; + readonly installPolicy: V2PluginListResponse__PluginInstallPolicy; + readonly installed: boolean; + readonly interface?: V2PluginListResponse__PluginInterface | null; + readonly name: string; + readonly source: V2PluginListResponse__PluginSource; +}; +export const V2PluginListResponse__PluginSummary = Schema.Struct({ + authPolicy: V2PluginListResponse__PluginAuthPolicy, + enabled: Schema.Boolean, + id: Schema.String, + installPolicy: V2PluginListResponse__PluginInstallPolicy, + installed: Schema.Boolean, + interface: Schema.optionalKey(Schema.Union([V2PluginListResponse__PluginInterface, Schema.Null])), + name: Schema.String, + source: V2PluginListResponse__PluginSource, +}); + +export type V2PluginReadResponse__PluginSummary = { + readonly authPolicy: V2PluginReadResponse__PluginAuthPolicy; + readonly enabled: boolean; + readonly id: string; + readonly installPolicy: V2PluginReadResponse__PluginInstallPolicy; + readonly installed: boolean; + readonly interface?: V2PluginReadResponse__PluginInterface | null; + readonly name: string; + readonly source: V2PluginReadResponse__PluginSource; +}; +export const V2PluginReadResponse__PluginSummary = Schema.Struct({ + authPolicy: V2PluginReadResponse__PluginAuthPolicy, + enabled: Schema.Boolean, + id: Schema.String, + installPolicy: V2PluginReadResponse__PluginInstallPolicy, + installed: Schema.Boolean, + interface: Schema.optionalKey(Schema.Union([V2PluginReadResponse__PluginInterface, Schema.Null])), + name: Schema.String, + source: V2PluginReadResponse__PluginSource, +}); + +export type V2PluginReadResponse__SkillSummary = { + readonly description: string; + readonly enabled: boolean; + readonly interface?: V2PluginReadResponse__SkillInterface | null; + readonly name: string; + readonly path: V2PluginReadResponse__AbsolutePathBuf; + readonly shortDescription?: string | null; +}; +export const V2PluginReadResponse__SkillSummary = Schema.Struct({ + description: Schema.String, + enabled: Schema.Boolean, + interface: Schema.optionalKey(Schema.Union([V2PluginReadResponse__SkillInterface, Schema.Null])), + name: Schema.String, + path: V2PluginReadResponse__AbsolutePathBuf, + shortDescription: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), +}); + +export type V2RawResponseItemCompletedNotification__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2RawResponseItemCompletedNotification__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem), +]); + +export type V2ReviewStartResponse__TurnError = { + readonly additionalDetails?: string | null; + readonly codexErrorInfo?: V2ReviewStartResponse__CodexErrorInfo | null; + readonly message: string; +}; +export const V2ReviewStartResponse__TurnError = Schema.Struct({ + additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + codexErrorInfo: Schema.optionalKey( + Schema.Union([V2ReviewStartResponse__CodexErrorInfo, Schema.Null]), + ), + message: Schema.String, +}); + +export type V2ReviewStartResponse__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ItemStartedNotification__MemoryCitation | null; - readonly phase?: V2ItemStartedNotification__MessagePhase | null; + readonly memoryCitation?: V2ReviewStartResponse__MemoryCitation | null; + readonly phase?: V2ReviewStartResponse__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -17164,49 +19147,51 @@ export type V2ItemStartedNotification__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray; readonly cwd: string; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; readonly processId?: string | null; readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ItemStartedNotification__CommandExecutionStatus; + readonly status: V2ReviewStartResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ItemStartedNotification__PatchApplyStatus; + readonly status: V2ReviewStartResponse__PatchApplyStatus; readonly type: "fileChange"; } | { readonly arguments: unknown; readonly durationMs?: number | null; - readonly error?: V2ItemStartedNotification__McpToolCallError | null; + readonly error?: V2ReviewStartResponse__McpToolCallError | null; readonly id: string; - readonly result?: V2ItemStartedNotification__McpToolCallResult | null; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ReviewStartResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ItemStartedNotification__McpToolCallStatus; + readonly status: V2ReviewStartResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; - readonly status: V2ItemStartedNotification__DynamicToolCallStatus; + readonly namespace?: string | null; + readonly status: V2ReviewStartResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ItemStartedNotification__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ReviewStartResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ItemStartedNotification__ReasoningEffort | null; + readonly reasoningEffort?: V2ReviewStartResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; readonly status: "inProgress" | "completed" | "failed"; @@ -17214,43 +19199,45 @@ export type V2ItemStartedNotification__ThreadItem = readonly type: "collabAgentToolCall"; } | { - readonly action?: V2ItemStartedNotification__WebSearchAction | null; + readonly action?: V2ReviewStartResponse__WebSearchAction | null; readonly id: string; readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: V2ReviewStartResponse__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: V2ReviewStartResponse__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ItemStartedNotification__ThreadItem = Schema.Union( +export const V2ReviewStartResponse__ThreadItem = Schema.Union( [ Schema.Struct({ - content: Schema.Array(V2ItemStartedNotification__UserInput), + content: Schema.Array(V2ReviewStartResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ItemStartedNotification__HookPromptFragment), + fragments: Schema.Array(V2ReviewStartResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__MemoryCitation, Schema.Null]), - ), - phase: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__MessagePhase, Schema.Null]), + Schema.Union([V2ReviewStartResponse__MemoryCitation, Schema.Null]), ), + phase: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__MessagePhase, Schema.Null])), text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), @@ -17279,11 +19266,14 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ItemStartedNotification__CommandAction).annotate({ + commandActions: Schema.Array(V2ReviewStartResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -17319,15 +19309,15 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( "unifiedExecInteraction", ]).annotate({ default: "agent" }), ), - status: V2ItemStartedNotification__CommandExecutionStatus, + status: V2ReviewStartResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ItemStartedNotification__FileUpdateChange), + changes: Schema.Array(V2ReviewStartResponse__FileUpdateChange), id: Schema.String, - status: V2ItemStartedNotification__PatchApplyStatus, + status: V2ReviewStartResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ @@ -17342,14 +19332,15 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( ]), ), error: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__McpToolCallError, Schema.Null]), + Schema.Union([V2ReviewStartResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__McpToolCallResult, Schema.Null]), + Schema.Union([V2ReviewStartResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ItemStartedNotification__McpToolCallStatus, + status: V2ReviewStartResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), @@ -17357,7 +19348,7 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( arguments: Schema.Unknown, contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ItemStartedNotification__DynamicToolCallOutputContentItem), + Schema.Array(V2ReviewStartResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -17371,16 +19362,16 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( ]), ), id: Schema.String, - status: V2ItemStartedNotification__DynamicToolCallStatus, + 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" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record( - Schema.String, - V2ItemStartedNotification__CollabAgentState, - ).annotate({ description: "Last known status of the target agents, when available." }), + agentsStates: Schema.Record(Schema.String, 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([ @@ -17399,7 +19390,7 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ReviewStartResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -17426,7 +19417,7 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ItemStartedNotification__WebSearchAction, Schema.Null]), + Schema.Union([V2ReviewStartResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, @@ -17434,14 +19425,16 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: V2ReviewStartResponse__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ReviewStartResponse__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -17469,123 +19462,65 @@ export const V2ItemStartedNotification__ThreadItem = Schema.Union( { mode: "oneOf" }, ); -export type V2ModelListResponse__Model = { - readonly additionalSpeedTiers?: ReadonlyArray; - readonly availabilityNux?: V2ModelListResponse__ModelAvailabilityNux | null; - readonly defaultReasoningEffort: V2ModelListResponse__ReasoningEffort; +export type V2SkillsListResponse__SkillMetadata = { + readonly dependencies?: V2SkillsListResponse__SkillDependencies | null; readonly description: string; - readonly displayName: string; - readonly hidden: boolean; - readonly id: string; - readonly inputModalities?: ReadonlyArray; - readonly isDefault: boolean; - readonly model: string; - 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({ default: [] })), - availabilityNux: Schema.optionalKey( - Schema.Union([V2ModelListResponse__ModelAvailabilityNux, Schema.Null]), - ), - defaultReasoningEffort: V2ModelListResponse__ReasoningEffort, - 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, - supportedReasoningEfforts: Schema.Array(V2ModelListResponse__ReasoningEffortOption), - supportsPersonality: Schema.optionalKey(Schema.Boolean.annotate({ default: false })), - upgrade: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - upgradeInfo: Schema.optionalKey( - Schema.Union([V2ModelListResponse__ModelUpgradeInfo, Schema.Null]), - ), -}); - -export type V2PluginListResponse__PluginSummary = { - readonly authPolicy: V2PluginListResponse__PluginAuthPolicy; - readonly enabled: boolean; - readonly id: string; - readonly installPolicy: V2PluginListResponse__PluginInstallPolicy; - readonly installed: boolean; - readonly interface?: V2PluginListResponse__PluginInterface | null; - readonly name: string; - readonly source: V2PluginListResponse__PluginSource; -}; -export const V2PluginListResponse__PluginSummary = Schema.Struct({ - authPolicy: V2PluginListResponse__PluginAuthPolicy, - enabled: Schema.Boolean, - id: Schema.String, - installPolicy: V2PluginListResponse__PluginInstallPolicy, - installed: Schema.Boolean, - interface: Schema.optionalKey(Schema.Union([V2PluginListResponse__PluginInterface, Schema.Null])), - name: Schema.String, - source: V2PluginListResponse__PluginSource, -}); - -export type V2PluginReadResponse__PluginSummary = { - readonly authPolicy: V2PluginReadResponse__PluginAuthPolicy; readonly enabled: boolean; - readonly id: string; - readonly installPolicy: V2PluginReadResponse__PluginInstallPolicy; - readonly installed: boolean; - readonly interface?: V2PluginReadResponse__PluginInterface | null; + readonly interface?: V2SkillsListResponse__SkillInterface | null; readonly name: string; - readonly source: V2PluginReadResponse__PluginSource; + readonly path: V2SkillsListResponse__AbsolutePathBuf; + readonly scope: V2SkillsListResponse__SkillScope; + readonly shortDescription?: string | null; }; -export const V2PluginReadResponse__PluginSummary = Schema.Struct({ - authPolicy: V2PluginReadResponse__PluginAuthPolicy, +export const V2SkillsListResponse__SkillMetadata = Schema.Struct({ + dependencies: Schema.optionalKey( + Schema.Union([V2SkillsListResponse__SkillDependencies, Schema.Null]), + ), + description: Schema.String, enabled: Schema.Boolean, - id: Schema.String, - installPolicy: V2PluginReadResponse__PluginInstallPolicy, - installed: Schema.Boolean, - interface: Schema.optionalKey(Schema.Union([V2PluginReadResponse__PluginInterface, Schema.Null])), + interface: Schema.optionalKey(Schema.Union([V2SkillsListResponse__SkillInterface, Schema.Null])), name: Schema.String, - source: V2PluginReadResponse__PluginSource, + path: V2SkillsListResponse__AbsolutePathBuf, + scope: V2SkillsListResponse__SkillScope, + shortDescription: Schema.optionalKey( + Schema.Union([ + Schema.String.annotate({ + description: + "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", + }), + Schema.Null, + ]), + ), }); -export type V2RawResponseItemCompletedNotification__FunctionCallOutputBody = - | string - | ReadonlyArray; -export const V2RawResponseItemCompletedNotification__FunctionCallOutputBody = Schema.Union([ - Schema.String, - Schema.Array(V2RawResponseItemCompletedNotification__FunctionCallOutputContentItem), -]); - -export type V2ReviewStartResponse__TurnError = { +export type V2ThreadForkResponse__TurnError = { readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ReviewStartResponse__CodexErrorInfo | null; + readonly codexErrorInfo?: V2ThreadForkResponse__CodexErrorInfo | null; readonly message: string; }; -export const V2ReviewStartResponse__TurnError = Schema.Struct({ +export const V2ThreadForkResponse__TurnError = Schema.Struct({ additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__CodexErrorInfo, Schema.Null]), + Schema.Union([V2ThreadForkResponse__CodexErrorInfo, Schema.Null]), ), message: Schema.String, }); -export type V2ReviewStartResponse__ThreadItem = +export type V2ThreadForkResponse__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ReviewStartResponse__MemoryCitation | null; - readonly phase?: V2ReviewStartResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadForkResponse__MemoryCitation | null; + readonly phase?: V2ThreadForkResponse__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -17599,49 +19534,51 @@ export type V2ReviewStartResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray; readonly cwd: string; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; readonly processId?: string | null; readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ReviewStartResponse__CommandExecutionStatus; + readonly status: V2ThreadForkResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ReviewStartResponse__PatchApplyStatus; + readonly status: V2ThreadForkResponse__PatchApplyStatus; readonly type: "fileChange"; } | { readonly arguments: unknown; readonly durationMs?: number | null; - readonly error?: V2ReviewStartResponse__McpToolCallError | null; + readonly error?: V2ThreadForkResponse__McpToolCallError | null; readonly id: string; - readonly result?: V2ReviewStartResponse__McpToolCallResult | null; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ThreadForkResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ReviewStartResponse__McpToolCallStatus; + readonly status: V2ThreadForkResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; - readonly status: V2ReviewStartResponse__DynamicToolCallStatus; + readonly namespace?: string | null; + readonly status: V2ThreadForkResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ReviewStartResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadForkResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ReviewStartResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadForkResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; readonly status: "inProgress" | "completed" | "failed"; @@ -17649,41 +19586,45 @@ export type V2ReviewStartResponse__ThreadItem = readonly type: "collabAgentToolCall"; } | { - readonly action?: V2ReviewStartResponse__WebSearchAction | null; + readonly action?: V2ThreadForkResponse__WebSearchAction | null; readonly id: string; readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: V2ThreadForkResponse__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: V2ThreadForkResponse__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ReviewStartResponse__ThreadItem = Schema.Union( +export const V2ThreadForkResponse__ThreadItem = Schema.Union( [ Schema.Struct({ - content: Schema.Array(V2ReviewStartResponse__UserInput), + content: Schema.Array(V2ThreadForkResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ReviewStartResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadForkResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadForkResponse__MemoryCitation, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ReviewStartResponse__MessagePhase, Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__MessagePhase, Schema.Null])), text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), @@ -17712,11 +19653,14 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ReviewStartResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadForkResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -17752,15 +19696,15 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( "unifiedExecInteraction", ]).annotate({ default: "agent" }), ), - status: V2ReviewStartResponse__CommandExecutionStatus, + status: V2ThreadForkResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ReviewStartResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadForkResponse__FileUpdateChange), id: Schema.String, - status: V2ReviewStartResponse__PatchApplyStatus, + status: V2ThreadForkResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ @@ -17775,14 +19719,15 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( ]), ), error: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadForkResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadForkResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ReviewStartResponse__McpToolCallStatus, + status: V2ThreadForkResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), @@ -17790,7 +19735,7 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( arguments: Schema.Unknown, contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ReviewStartResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadForkResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -17804,13 +19749,14 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( ]), ), id: Schema.String, - status: V2ReviewStartResponse__DynamicToolCallStatus, + 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" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ReviewStartResponse__CollabAgentState).annotate({ + 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." }), @@ -17831,7 +19777,7 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadForkResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -17858,7 +19804,7 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ReviewStartResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadForkResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, @@ -17866,14 +19812,16 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: V2ThreadForkResponse__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ThreadForkResponse__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -17901,65 +19849,34 @@ export const V2ReviewStartResponse__ThreadItem = Schema.Union( { mode: "oneOf" }, ); -export type V2SkillsListResponse__SkillMetadata = { - readonly dependencies?: V2SkillsListResponse__SkillDependencies | null; - readonly description: string; - readonly enabled: boolean; - readonly interface?: V2SkillsListResponse__SkillInterface | null; - readonly name: string; - readonly path: string; - readonly scope: V2SkillsListResponse__SkillScope; - readonly shortDescription?: string | null; -}; -export const V2SkillsListResponse__SkillMetadata = Schema.Struct({ - dependencies: Schema.optionalKey( - Schema.Union([V2SkillsListResponse__SkillDependencies, Schema.Null]), - ), - description: Schema.String, - enabled: Schema.Boolean, - interface: Schema.optionalKey(Schema.Union([V2SkillsListResponse__SkillInterface, Schema.Null])), - name: Schema.String, - path: Schema.String, - scope: V2SkillsListResponse__SkillScope, - shortDescription: Schema.optionalKey( - Schema.Union([ - Schema.String.annotate({ - description: - "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", - }), - Schema.Null, - ]), - ), -}); - -export type V2ThreadForkResponse__TurnError = { +export type V2ThreadListResponse__TurnError = { readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadForkResponse__CodexErrorInfo | null; + readonly codexErrorInfo?: V2ThreadListResponse__CodexErrorInfo | null; readonly message: string; }; -export const V2ThreadForkResponse__TurnError = Schema.Struct({ +export const V2ThreadListResponse__TurnError = Schema.Struct({ additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__CodexErrorInfo, Schema.Null]), + Schema.Union([V2ThreadListResponse__CodexErrorInfo, Schema.Null]), ), message: Schema.String, }); -export type V2ThreadForkResponse__ThreadItem = +export type V2ThreadListResponse__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ThreadForkResponse__MemoryCitation | null; - readonly phase?: V2ThreadForkResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadListResponse__MemoryCitation | null; + readonly phase?: V2ThreadListResponse__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -17973,49 +19890,51 @@ export type V2ThreadForkResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray; readonly cwd: string; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; readonly processId?: string | null; readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadForkResponse__CommandExecutionStatus; + readonly status: V2ThreadListResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadForkResponse__PatchApplyStatus; + readonly status: V2ThreadListResponse__PatchApplyStatus; readonly type: "fileChange"; } | { readonly arguments: unknown; readonly durationMs?: number | null; - readonly error?: V2ThreadForkResponse__McpToolCallError | null; + readonly error?: V2ThreadListResponse__McpToolCallError | null; readonly id: string; - readonly result?: V2ThreadForkResponse__McpToolCallResult | null; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ThreadListResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadForkResponse__McpToolCallStatus; + readonly status: V2ThreadListResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; - readonly status: V2ThreadForkResponse__DynamicToolCallStatus; + readonly namespace?: string | null; + readonly status: V2ThreadListResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadForkResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadListResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadForkResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadListResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; readonly status: "inProgress" | "completed" | "failed"; @@ -18023,41 +19942,45 @@ export type V2ThreadForkResponse__ThreadItem = readonly type: "collabAgentToolCall"; } | { - readonly action?: V2ThreadForkResponse__WebSearchAction | null; + readonly action?: V2ThreadListResponse__WebSearchAction | null; readonly id: string; readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: V2ThreadListResponse__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: V2ThreadListResponse__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadForkResponse__ThreadItem = Schema.Union( +export const V2ThreadListResponse__ThreadItem = Schema.Union( [ Schema.Struct({ - content: Schema.Array(V2ThreadForkResponse__UserInput), + content: Schema.Array(V2ThreadListResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadForkResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadListResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadListResponse__MemoryCitation, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadForkResponse__MessagePhase, Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadListResponse__MessagePhase, Schema.Null])), text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), @@ -18086,11 +20009,14 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadForkResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadListResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -18126,15 +20052,15 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( "unifiedExecInteraction", ]).annotate({ default: "agent" }), ), - status: V2ThreadForkResponse__CommandExecutionStatus, + status: V2ThreadListResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadForkResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadListResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadForkResponse__PatchApplyStatus, + status: V2ThreadListResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ @@ -18149,14 +20075,15 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadListResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadListResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadForkResponse__McpToolCallStatus, + status: V2ThreadListResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), @@ -18164,7 +20091,7 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( arguments: Schema.Unknown, contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadForkResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadListResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -18178,13 +20105,14 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( ]), ), id: Schema.String, - status: V2ThreadForkResponse__DynamicToolCallStatus, + 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" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadForkResponse__CollabAgentState).annotate({ + agentsStates: Schema.Record(Schema.String, V2ThreadListResponse__CollabAgentState).annotate({ description: "Last known status of the target agents, when available.", }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), @@ -18205,7 +20133,7 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadListResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -18232,7 +20160,7 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadForkResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadListResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, @@ -18240,14 +20168,16 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: V2ThreadListResponse__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ThreadListResponse__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -18275,34 +20205,34 @@ export const V2ThreadForkResponse__ThreadItem = Schema.Union( { mode: "oneOf" }, ); -export type V2ThreadListResponse__TurnError = { +export type V2ThreadMetadataUpdateResponse__TurnError = { readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadListResponse__CodexErrorInfo | null; + readonly codexErrorInfo?: V2ThreadMetadataUpdateResponse__CodexErrorInfo | null; readonly message: string; }; -export const V2ThreadListResponse__TurnError = Schema.Struct({ +export const V2ThreadMetadataUpdateResponse__TurnError = Schema.Struct({ additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__CodexErrorInfo, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__CodexErrorInfo, Schema.Null]), ), message: Schema.String, }); -export type V2ThreadListResponse__ThreadItem = +export type V2ThreadMetadataUpdateResponse__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ThreadListResponse__MemoryCitation | null; - readonly phase?: V2ThreadListResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadMetadataUpdateResponse__MemoryCitation | null; + readonly phase?: V2ThreadMetadataUpdateResponse__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -18316,49 +20246,53 @@ export type V2ThreadListResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray; readonly cwd: string; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; readonly processId?: string | null; readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadListResponse__CommandExecutionStatus; + readonly status: V2ThreadMetadataUpdateResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadListResponse__PatchApplyStatus; + readonly status: V2ThreadMetadataUpdateResponse__PatchApplyStatus; readonly type: "fileChange"; } | { readonly arguments: unknown; readonly durationMs?: number | null; - readonly error?: V2ThreadListResponse__McpToolCallError | null; + readonly error?: V2ThreadMetadataUpdateResponse__McpToolCallError | null; readonly id: string; - readonly result?: V2ThreadListResponse__McpToolCallResult | null; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ThreadMetadataUpdateResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadListResponse__McpToolCallStatus; + readonly status: V2ThreadMetadataUpdateResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; - readonly status: V2ThreadListResponse__DynamicToolCallStatus; + readonly namespace?: string | null; + readonly status: V2ThreadMetadataUpdateResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadListResponse__CollabAgentState }; + readonly agentsStates: { + readonly [x: string]: V2ThreadMetadataUpdateResponse__CollabAgentState; + }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadListResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; readonly status: "inProgress" | "completed" | "failed"; @@ -18366,41 +20300,47 @@ export type V2ThreadListResponse__ThreadItem = readonly type: "collabAgentToolCall"; } | { - readonly action?: V2ThreadListResponse__WebSearchAction | null; + readonly action?: V2ThreadMetadataUpdateResponse__WebSearchAction | null; readonly id: string; readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: V2ThreadMetadataUpdateResponse__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: V2ThreadMetadataUpdateResponse__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadListResponse__ThreadItem = Schema.Union( +export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( [ Schema.Struct({ - content: Schema.Array(V2ThreadListResponse__UserInput), + content: Schema.Array(V2ThreadMetadataUpdateResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadListResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadMetadataUpdateResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__MessagePhase, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadListResponse__MessagePhase, Schema.Null])), text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), @@ -18429,11 +20369,14 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadListResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadMetadataUpdateResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -18469,15 +20412,15 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( "unifiedExecInteraction", ]).annotate({ default: "agent" }), ), - status: V2ThreadListResponse__CommandExecutionStatus, + status: V2ThreadMetadataUpdateResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadListResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadMetadataUpdateResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadListResponse__PatchApplyStatus, + status: V2ThreadMetadataUpdateResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ @@ -18492,14 +20435,15 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadListResponse__McpToolCallStatus, + status: V2ThreadMetadataUpdateResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), @@ -18507,7 +20451,7 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( arguments: Schema.Unknown, contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadListResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -18521,15 +20465,17 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( ]), ), id: Schema.String, - status: V2ThreadListResponse__DynamicToolCallStatus, + 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" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadListResponse__CollabAgentState).annotate({ - description: "Last known status of the target agents, when available.", - }), + agentsStates: Schema.Record( + Schema.String, + V2ThreadMetadataUpdateResponse__CollabAgentState, + ).annotate({ description: "Last known status of the target agents, when available." }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -18548,7 +20494,7 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadMetadataUpdateResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -18575,7 +20521,7 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadListResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadMetadataUpdateResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, @@ -18583,14 +20529,16 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: V2ThreadMetadataUpdateResponse__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ThreadMetadataUpdateResponse__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -18618,34 +20566,34 @@ export const V2ThreadListResponse__ThreadItem = Schema.Union( { mode: "oneOf" }, ); -export type V2ThreadMetadataUpdateResponse__TurnError = { +export type V2ThreadReadResponse__TurnError = { readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadMetadataUpdateResponse__CodexErrorInfo | null; + readonly codexErrorInfo?: V2ThreadReadResponse__CodexErrorInfo | null; readonly message: string; }; -export const V2ThreadMetadataUpdateResponse__TurnError = Schema.Struct({ +export const V2ThreadReadResponse__TurnError = Schema.Struct({ additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__CodexErrorInfo, Schema.Null]), + Schema.Union([V2ThreadReadResponse__CodexErrorInfo, Schema.Null]), ), message: Schema.String, }); -export type V2ThreadMetadataUpdateResponse__ThreadItem = +export type V2ThreadReadResponse__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ThreadMetadataUpdateResponse__MemoryCitation | null; - readonly phase?: V2ThreadMetadataUpdateResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadReadResponse__MemoryCitation | null; + readonly phase?: V2ThreadReadResponse__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -18659,51 +20607,51 @@ export type V2ThreadMetadataUpdateResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray; readonly cwd: string; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; readonly processId?: string | null; readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadMetadataUpdateResponse__CommandExecutionStatus; + readonly status: V2ThreadReadResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadMetadataUpdateResponse__PatchApplyStatus; + readonly status: V2ThreadReadResponse__PatchApplyStatus; readonly type: "fileChange"; } | { readonly arguments: unknown; readonly durationMs?: number | null; - readonly error?: V2ThreadMetadataUpdateResponse__McpToolCallError | null; + readonly error?: V2ThreadReadResponse__McpToolCallError | null; readonly id: string; - readonly result?: V2ThreadMetadataUpdateResponse__McpToolCallResult | null; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ThreadReadResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadMetadataUpdateResponse__McpToolCallStatus; + readonly status: V2ThreadReadResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; - readonly status: V2ThreadMetadataUpdateResponse__DynamicToolCallStatus; + readonly namespace?: string | null; + readonly status: V2ThreadReadResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { - readonly [x: string]: V2ThreadMetadataUpdateResponse__CollabAgentState; - }; + readonly agentsStates: { readonly [x: string]: V2ThreadReadResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadMetadataUpdateResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadReadResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; readonly status: "inProgress" | "completed" | "failed"; @@ -18711,43 +20659,45 @@ export type V2ThreadMetadataUpdateResponse__ThreadItem = readonly type: "collabAgentToolCall"; } | { - readonly action?: V2ThreadMetadataUpdateResponse__WebSearchAction | null; + readonly action?: V2ThreadReadResponse__WebSearchAction | null; readonly id: string; readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: V2ThreadReadResponse__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: V2ThreadReadResponse__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( +export const V2ThreadReadResponse__ThreadItem = Schema.Union( [ Schema.Struct({ - content: Schema.Array(V2ThreadMetadataUpdateResponse__UserInput), + content: Schema.Array(V2ThreadReadResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadMetadataUpdateResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadReadResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__MemoryCitation, Schema.Null]), - ), - phase: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__MessagePhase, Schema.Null]), + Schema.Union([V2ThreadReadResponse__MemoryCitation, Schema.Null]), ), + phase: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__MessagePhase, Schema.Null])), text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), @@ -18776,11 +20726,14 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadMetadataUpdateResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadReadResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -18816,15 +20769,15 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( "unifiedExecInteraction", ]).annotate({ default: "agent" }), ), - status: V2ThreadMetadataUpdateResponse__CommandExecutionStatus, + status: V2ThreadReadResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadMetadataUpdateResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadReadResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadMetadataUpdateResponse__PatchApplyStatus, + status: V2ThreadReadResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ @@ -18839,14 +20792,15 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadReadResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadReadResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadMetadataUpdateResponse__McpToolCallStatus, + status: V2ThreadReadResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), @@ -18854,7 +20808,7 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( arguments: Schema.Unknown, contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadMetadataUpdateResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadReadResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -18868,16 +20822,16 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( ]), ), id: Schema.String, - status: V2ThreadMetadataUpdateResponse__DynamicToolCallStatus, + 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" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record( - Schema.String, - V2ThreadMetadataUpdateResponse__CollabAgentState, - ).annotate({ description: "Last known status of the target agents, when available." }), + agentsStates: Schema.Record(Schema.String, V2ThreadReadResponse__CollabAgentState).annotate({ + description: "Last known status of the target agents, when available.", + }), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -18896,7 +20850,7 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadReadResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -18923,7 +20877,7 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadMetadataUpdateResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadReadResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, @@ -18931,14 +20885,16 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: V2ThreadReadResponse__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ThreadReadResponse__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -18966,34 +20922,42 @@ export const V2ThreadMetadataUpdateResponse__ThreadItem = Schema.Union( { mode: "oneOf" }, ); -export type V2ThreadReadResponse__TurnError = { +export type V2ThreadResumeParams__FunctionCallOutputBody = + | string + | ReadonlyArray; +export const V2ThreadResumeParams__FunctionCallOutputBody = Schema.Union([ + Schema.String, + Schema.Array(V2ThreadResumeParams__FunctionCallOutputContentItem), +]); + +export type V2ThreadResumeResponse__TurnError = { readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadReadResponse__CodexErrorInfo | null; + readonly codexErrorInfo?: V2ThreadResumeResponse__CodexErrorInfo | null; readonly message: string; }; -export const V2ThreadReadResponse__TurnError = Schema.Struct({ +export const V2ThreadResumeResponse__TurnError = Schema.Struct({ additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__CodexErrorInfo, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__CodexErrorInfo, Schema.Null]), ), message: Schema.String, }); -export type V2ThreadReadResponse__ThreadItem = +export type V2ThreadResumeResponse__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ThreadReadResponse__MemoryCitation | null; - readonly phase?: V2ThreadReadResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadResumeResponse__MemoryCitation | null; + readonly phase?: V2ThreadResumeResponse__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -19007,49 +20971,51 @@ export type V2ThreadReadResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray; readonly cwd: string; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; readonly processId?: string | null; readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadReadResponse__CommandExecutionStatus; + readonly status: V2ThreadResumeResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadReadResponse__PatchApplyStatus; + readonly status: V2ThreadResumeResponse__PatchApplyStatus; readonly type: "fileChange"; } | { readonly arguments: unknown; readonly durationMs?: number | null; - readonly error?: V2ThreadReadResponse__McpToolCallError | null; + readonly error?: V2ThreadResumeResponse__McpToolCallError | null; readonly id: string; - readonly result?: V2ThreadReadResponse__McpToolCallResult | null; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ThreadResumeResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadReadResponse__McpToolCallStatus; + readonly status: V2ThreadResumeResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; - readonly status: V2ThreadReadResponse__DynamicToolCallStatus; + readonly namespace?: string | null; + readonly status: V2ThreadResumeResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadReadResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadResumeResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadReadResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadResumeResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; readonly status: "inProgress" | "completed" | "failed"; @@ -19057,41 +21023,45 @@ export type V2ThreadReadResponse__ThreadItem = readonly type: "collabAgentToolCall"; } | { - readonly action?: V2ThreadReadResponse__WebSearchAction | null; + readonly action?: V2ThreadResumeResponse__WebSearchAction | null; readonly id: string; readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: V2ThreadResumeResponse__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: V2ThreadResumeResponse__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadReadResponse__ThreadItem = Schema.Union( +export const V2ThreadResumeResponse__ThreadItem = Schema.Union( [ Schema.Struct({ - content: Schema.Array(V2ThreadReadResponse__UserInput), + content: Schema.Array(V2ThreadResumeResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadReadResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadResumeResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__MemoryCitation, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadReadResponse__MessagePhase, Schema.Null])), + phase: Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__MessagePhase, Schema.Null])), text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), @@ -19120,11 +21090,14 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadReadResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadResumeResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -19160,15 +21133,15 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( "unifiedExecInteraction", ]).annotate({ default: "agent" }), ), - status: V2ThreadReadResponse__CommandExecutionStatus, + status: V2ThreadResumeResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadReadResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadResumeResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadReadResponse__PatchApplyStatus, + status: V2ThreadResumeResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ @@ -19183,14 +21156,15 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadReadResponse__McpToolCallStatus, + status: V2ThreadResumeResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), @@ -19198,7 +21172,7 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( arguments: Schema.Unknown, contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadReadResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadResumeResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -19212,15 +21186,16 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( ]), ), id: Schema.String, - status: V2ThreadReadResponse__DynamicToolCallStatus, + 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" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadReadResponse__CollabAgentState).annotate({ - description: "Last known status of the target agents, when available.", - }), + agentsStates: Schema.Record(Schema.String, V2ThreadResumeResponse__CollabAgentState).annotate( + { description: "Last known status of the target agents, when available." }, + ), id: Schema.String.annotate({ description: "Unique identifier for this collab tool call." }), model: Schema.optionalKey( Schema.Union([ @@ -19239,7 +21214,7 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -19266,7 +21241,7 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadReadResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadResumeResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, @@ -19274,14 +21249,16 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: V2ThreadResumeResponse__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ThreadResumeResponse__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -19309,42 +21286,34 @@ export const V2ThreadReadResponse__ThreadItem = Schema.Union( { mode: "oneOf" }, ); -export type V2ThreadResumeParams__FunctionCallOutputBody = - | string - | ReadonlyArray; -export const V2ThreadResumeParams__FunctionCallOutputBody = Schema.Union([ - Schema.String, - Schema.Array(V2ThreadResumeParams__FunctionCallOutputContentItem), -]); - -export type V2ThreadResumeResponse__TurnError = { +export type V2ThreadRollbackResponse__TurnError = { readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadResumeResponse__CodexErrorInfo | null; + readonly codexErrorInfo?: V2ThreadRollbackResponse__CodexErrorInfo | null; readonly message: string; }; -export const V2ThreadResumeResponse__TurnError = Schema.Struct({ +export const V2ThreadRollbackResponse__TurnError = Schema.Struct({ additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__CodexErrorInfo, Schema.Null]), + Schema.Union([V2ThreadRollbackResponse__CodexErrorInfo, Schema.Null]), ), message: Schema.String, }); -export type V2ThreadResumeResponse__ThreadItem = +export type V2ThreadRollbackResponse__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ThreadResumeResponse__MemoryCitation | null; - readonly phase?: V2ThreadResumeResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadRollbackResponse__MemoryCitation | null; + readonly phase?: V2ThreadRollbackResponse__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -19358,49 +21327,51 @@ export type V2ThreadResumeResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray; readonly cwd: string; readonly durationMs?: number | null; readonly exitCode?: number | null; readonly id: string; readonly processId?: string | null; readonly source?: "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction"; - readonly status: V2ThreadResumeResponse__CommandExecutionStatus; + readonly status: V2ThreadRollbackResponse__CommandExecutionStatus; readonly type: "commandExecution"; } | { - readonly changes: ReadonlyArray; + readonly changes: ReadonlyArray; readonly id: string; - readonly status: V2ThreadResumeResponse__PatchApplyStatus; + readonly status: V2ThreadRollbackResponse__PatchApplyStatus; readonly type: "fileChange"; } | { readonly arguments: unknown; readonly durationMs?: number | null; - readonly error?: V2ThreadResumeResponse__McpToolCallError | null; + readonly error?: V2ThreadRollbackResponse__McpToolCallError | null; readonly id: string; - readonly result?: V2ThreadResumeResponse__McpToolCallResult | null; + readonly mcpAppResourceUri?: string | null; + readonly result?: V2ThreadRollbackResponse__McpToolCallResult | null; readonly server: string; - readonly status: V2ThreadResumeResponse__McpToolCallStatus; + readonly status: V2ThreadRollbackResponse__McpToolCallStatus; readonly tool: string; readonly type: "mcpToolCall"; } | { readonly arguments: unknown; - readonly contentItems?: ReadonlyArray | null; + readonly contentItems?: ReadonlyArray | null; readonly durationMs?: number | null; readonly id: string; - readonly status: V2ThreadResumeResponse__DynamicToolCallStatus; + readonly namespace?: string | null; + readonly status: V2ThreadRollbackResponse__DynamicToolCallStatus; readonly success?: boolean | null; readonly tool: string; readonly type: "dynamicToolCall"; } | { - readonly agentsStates: { readonly [x: string]: V2ThreadResumeResponse__CollabAgentState }; + readonly agentsStates: { readonly [x: string]: V2ThreadRollbackResponse__CollabAgentState }; readonly id: string; readonly model?: string | null; readonly prompt?: string | null; - readonly reasoningEffort?: V2ThreadResumeResponse__ReasoningEffort | null; + readonly reasoningEffort?: V2ThreadRollbackResponse__ReasoningEffort | null; readonly receiverThreadIds: ReadonlyArray; readonly senderThreadId: string; readonly status: "inProgress" | "completed" | "failed"; @@ -19408,41 +21379,47 @@ export type V2ThreadResumeResponse__ThreadItem = readonly type: "collabAgentToolCall"; } | { - readonly action?: V2ThreadResumeResponse__WebSearchAction | null; + readonly action?: V2ThreadRollbackResponse__WebSearchAction | null; readonly id: string; readonly query: string; readonly type: "webSearch"; } - | { readonly id: string; readonly path: string; readonly type: "imageView" } + | { + readonly id: string; + readonly path: V2ThreadRollbackResponse__AbsolutePathBuf; + readonly type: "imageView"; + } | { readonly id: string; readonly result: string; readonly revisedPrompt?: string | null; - readonly savedPath?: string | null; + readonly savedPath?: V2ThreadRollbackResponse__AbsolutePathBuf | null; readonly status: string; readonly type: "imageGeneration"; } | { readonly id: string; readonly review: string; readonly type: "enteredReviewMode" } | { readonly id: string; readonly review: string; readonly type: "exitedReviewMode" } | { readonly id: string; readonly type: "contextCompaction" }; -export const V2ThreadResumeResponse__ThreadItem = Schema.Union( +export const V2ThreadRollbackResponse__ThreadItem = Schema.Union( [ Schema.Struct({ - content: Schema.Array(V2ThreadResumeResponse__UserInput), + content: Schema.Array(V2ThreadRollbackResponse__UserInput), id: Schema.String, type: Schema.Literal("userMessage").annotate({ title: "UserMessageThreadItemType" }), }).annotate({ title: "UserMessageThreadItem" }), Schema.Struct({ - fragments: Schema.Array(V2ThreadResumeResponse__HookPromptFragment), + fragments: Schema.Array(V2ThreadRollbackResponse__HookPromptFragment), id: Schema.String, type: Schema.Literal("hookPrompt").annotate({ title: "HookPromptThreadItemType" }), }).annotate({ title: "HookPromptThreadItem" }), Schema.Struct({ id: Schema.String, memoryCitation: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__MemoryCitation, Schema.Null]), + Schema.Union([V2ThreadRollbackResponse__MemoryCitation, Schema.Null]), + ), + phase: Schema.optionalKey( + Schema.Union([V2ThreadRollbackResponse__MessagePhase, Schema.Null]), ), - phase: Schema.optionalKey(Schema.Union([V2ThreadResumeResponse__MessagePhase, Schema.Null])), text: Schema.String, type: Schema.Literal("agentMessage").annotate({ title: "AgentMessageThreadItemType" }), }).annotate({ title: "AgentMessageThreadItem" }), @@ -19471,11 +21448,14 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( ]), ), command: Schema.String.annotate({ description: "The command to be executed." }), - commandActions: Schema.Array(V2ThreadResumeResponse__CommandAction).annotate({ + commandActions: Schema.Array(V2ThreadRollbackResponse__CommandAction).annotate({ description: "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", }), - cwd: Schema.String.annotate({ description: "The command's working directory." }), + cwd: Schema.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.", + }), durationMs: Schema.optionalKey( Schema.Union([ Schema.Number.annotate({ @@ -19511,15 +21491,15 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( "unifiedExecInteraction", ]).annotate({ default: "agent" }), ), - status: V2ThreadResumeResponse__CommandExecutionStatus, + status: V2ThreadRollbackResponse__CommandExecutionStatus, type: Schema.Literal("commandExecution").annotate({ title: "CommandExecutionThreadItemType", }), }).annotate({ title: "CommandExecutionThreadItem" }), Schema.Struct({ - changes: Schema.Array(V2ThreadResumeResponse__FileUpdateChange), + changes: Schema.Array(V2ThreadRollbackResponse__FileUpdateChange), id: Schema.String, - status: V2ThreadResumeResponse__PatchApplyStatus, + status: V2ThreadRollbackResponse__PatchApplyStatus, type: Schema.Literal("fileChange").annotate({ title: "FileChangeThreadItemType" }), }).annotate({ title: "FileChangeThreadItem" }), Schema.Struct({ @@ -19534,14 +21514,15 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( ]), ), error: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__McpToolCallError, Schema.Null]), + Schema.Union([V2ThreadRollbackResponse__McpToolCallError, Schema.Null]), ), id: Schema.String, + mcpAppResourceUri: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), result: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__McpToolCallResult, Schema.Null]), + Schema.Union([V2ThreadRollbackResponse__McpToolCallResult, Schema.Null]), ), server: Schema.String, - status: V2ThreadResumeResponse__McpToolCallStatus, + status: V2ThreadRollbackResponse__McpToolCallStatus, tool: Schema.String, type: Schema.Literal("mcpToolCall").annotate({ title: "McpToolCallThreadItemType" }), }).annotate({ title: "McpToolCallThreadItem" }), @@ -19549,7 +21530,7 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( arguments: Schema.Unknown, contentItems: Schema.optionalKey( Schema.Union([ - Schema.Array(V2ThreadResumeResponse__DynamicToolCallOutputContentItem), + Schema.Array(V2ThreadRollbackResponse__DynamicToolCallOutputContentItem), Schema.Null, ]), ), @@ -19563,15 +21544,17 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( ]), ), id: Schema.String, - status: V2ThreadResumeResponse__DynamicToolCallStatus, + namespace: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + status: V2ThreadRollbackResponse__DynamicToolCallStatus, success: Schema.optionalKey(Schema.Union([Schema.Boolean, Schema.Null])), tool: Schema.String, type: Schema.Literal("dynamicToolCall").annotate({ title: "DynamicToolCallThreadItemType" }), }).annotate({ title: "DynamicToolCallThreadItem" }), Schema.Struct({ - agentsStates: Schema.Record(Schema.String, V2ThreadResumeResponse__CollabAgentState).annotate( - { description: "Last known status of the target agents, when available." }, - ), + agentsStates: Schema.Record( + Schema.String, + V2ThreadRollbackResponse__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([ @@ -19590,7 +21573,7 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( ]), ), reasoningEffort: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__ReasoningEffort, Schema.Null]).annotate({ + Schema.Union([V2ThreadRollbackResponse__ReasoningEffort, Schema.Null]).annotate({ description: "Reasoning effort requested for the spawned agent, when applicable.", }), ), @@ -19617,7 +21600,7 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( }).annotate({ title: "CollabAgentToolCallThreadItem" }), Schema.Struct({ action: Schema.optionalKey( - Schema.Union([V2ThreadResumeResponse__WebSearchAction, Schema.Null]), + Schema.Union([V2ThreadRollbackResponse__WebSearchAction, Schema.Null]), ), id: Schema.String, query: Schema.String, @@ -19625,14 +21608,16 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( }).annotate({ title: "WebSearchThreadItem" }), Schema.Struct({ id: Schema.String, - path: Schema.String, + path: V2ThreadRollbackResponse__AbsolutePathBuf, type: Schema.Literal("imageView").annotate({ title: "ImageViewThreadItemType" }), }).annotate({ title: "ImageViewThreadItem" }), Schema.Struct({ id: Schema.String, result: Schema.String, revisedPrompt: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), - savedPath: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), + savedPath: Schema.optionalKey( + Schema.Union([V2ThreadRollbackResponse__AbsolutePathBuf, Schema.Null]), + ), status: Schema.String, type: Schema.Literal("imageGeneration").annotate({ title: "ImageGenerationThreadItemType" }), }).annotate({ title: "ImageGenerationThreadItem" }), @@ -19660,34 +21645,34 @@ export const V2ThreadResumeResponse__ThreadItem = Schema.Union( { mode: "oneOf" }, ); -export type V2ThreadRollbackResponse__TurnError = { +export type V2ThreadStartedNotification__TurnError = { readonly additionalDetails?: string | null; - readonly codexErrorInfo?: V2ThreadRollbackResponse__CodexErrorInfo | null; + readonly codexErrorInfo?: V2ThreadStartedNotification__CodexErrorInfo | null; readonly message: string; }; -export const V2ThreadRollbackResponse__TurnError = Schema.Struct({ +export const V2ThreadStartedNotification__TurnError = Schema.Struct({ additionalDetails: Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])), codexErrorInfo: Schema.optionalKey( - Schema.Union([V2ThreadRollbackResponse__CodexErrorInfo, Schema.Null]), + Schema.Union([V2ThreadStartedNotification__CodexErrorInfo, Schema.Null]), ), message: Schema.String, }); -export type V2ThreadRollbackResponse__ThreadItem = +export type V2ThreadStartedNotification__ThreadItem = | { - readonly content: ReadonlyArray; + readonly content: ReadonlyArray; readonly id: string; readonly type: "userMessage"; } | { - readonly fragments: ReadonlyArray; + readonly fragments: ReadonlyArray; readonly id: string; readonly type: "hookPrompt"; } | { readonly id: string; - readonly memoryCitation?: V2ThreadRollbackResponse__MemoryCitation | null; - readonly phase?: V2ThreadRollbackResponse__MessagePhase | null; + readonly memoryCitation?: V2ThreadStartedNotification__MemoryCitation | null; + readonly phase?: V2ThreadStartedNotification__MessagePhase | null; readonly text: string; readonly type: "agentMessage"; } @@ -19701,49 +21686,53 @@ export type V2ThreadRollbackResponse__ThreadItem = | { readonly aggregatedOutput?: string | null; readonly command: string; - readonly commandActions: ReadonlyArray; + readonly commandActions: ReadonlyArray