import * as z from "zod/mini"; import { SerializedMessage, SerializedThread } from "chat"; //#region src/core/config.d.ts declare const engineSchema: z.ZodMiniEnum<{ codex: "codex"; claude: "claude"; custom: "custom"; }>; declare const effortSchema: z.ZodMiniEnum<{ low: "low"; medium: "medium"; high: "high"; }>; declare const permissionSchema: z.ZodMiniEnum<{ "read-only": "read-only"; "workspace-write": "workspace-write"; auto: "auto"; }>; declare const customModelSchema: z.ZodMiniObject<{ baseUrl: z.ZodMiniURL; model: z.ZodMiniString; envKey: z.ZodMiniOptional>; wireApi: z.ZodMiniOptional>; disabled: z.ZodMiniOptional>; }, z.core.$strict>; /** The merged, effective shape (everything present after DEFAULT_CONFIG). */ declare const mcpEntrySchema: z.ZodMiniObject<{ command: z.ZodMiniOptional>; args: z.ZodMiniOptional>>; env: z.ZodMiniOptional, z.ZodMiniString>>; url: z.ZodMiniOptional>; type: z.ZodMiniOptional>; headers: z.ZodMiniOptional, z.ZodMiniString>>; tools: z.ZodMiniOptional>>; description: z.ZodMiniOptional>; }, z.core.$strict>; declare const effectiveConfigSchema: z.ZodMiniObject<{ chain: z.ZodMiniArray>; engines: z.ZodMiniObject<{ codex: z.ZodMiniOptional>; effort: z.ZodMiniOptional>; permissions: z.ZodMiniOptional>; network: z.ZodMiniOptional>; }, z.core.$strict>>; claude: z.ZodMiniOptional>; effort: z.ZodMiniOptional>; permissions: z.ZodMiniOptional>; }, z.core.$strict>>; custom: z.ZodMiniOptional>; effort: z.ZodMiniOptional>; permissions: z.ZodMiniOptional>; }, z.core.$strict>>; }, z.core.$strict>; models: z.ZodMiniOptional, z.ZodMiniUnion; envKey: z.ZodMiniOptional>; wireApi: z.ZodMiniOptional>; disabled: z.ZodMiniOptional>; }, z.core.$strict>, z.ZodMiniObject<{ provider: z.ZodMiniEnum<{ codex: "codex"; claude: "claude"; }>; model: z.ZodMiniString; effort: z.ZodMiniOptional>; disabled: z.ZodMiniOptional>; }, z.core.$strict>, z.ZodMiniObject<{ disabled: z.ZodMiniBoolean; }, z.core.$strict>]>>>; agents: z.ZodMiniOptional, z.ZodMiniUnion, z.ZodMiniObject<{ engine: z.ZodMiniOptional>; model: z.ZodMiniOptional>; effort: z.ZodMiniOptional>; permissions: z.ZodMiniOptional>; runner: z.ZodMiniOptional>; integrations: z.ZodMiniOptional, z.ZodMiniObject<{ allowedTools: z.ZodMiniOptional, z.ZodMiniArray>]>>; allowedEvents: z.ZodMiniOptional>>; }, z.core.$strict>>>; }, z.core.$strict>]>>>; mcp: z.ZodMiniOptional, z.ZodMiniObject<{ command: z.ZodMiniOptional>; args: z.ZodMiniOptional>>; env: z.ZodMiniOptional, z.ZodMiniString>>; url: z.ZodMiniOptional>; type: z.ZodMiniOptional>; headers: z.ZodMiniOptional, z.ZodMiniString>>; tools: z.ZodMiniOptional>>; description: z.ZodMiniOptional>; }, z.core.$strict>>>; approvals: z.ZodMiniObject<{ escalationTimeoutMs: z.ZodMiniNumber; allowedNetworkHosts: z.ZodMiniArray>; }, z.core.$strict>; }, z.core.$strict>; type McpConfigEntry = z.infer; type Engine = z.infer; type Effort = z.infer; type Permission = z.infer; type CustomModelConfig = z.infer; type CoderConfig = z.infer; /** Flags of `coder mcp add`: a remote `url` or a stdio `command`; env, header and tools are comma lists. */ interface McpAddOptions { url?: string; transport?: string; header?: string; env?: string; tools?: string; command?: string[]; user?: boolean; } //#endregion //#region src/client/types.d.ts type RunnerKind = 'local' | 'local-docker' | 'vercel-sandbox' | 'github-actions' | 'http'; interface RunnerSpec { kind: RunnerKind; name: string; description: string; connect: 'pair' | 'fields'; /** One or two sentences on what this kind needs and where to get it. */ help?: string; fields: Array<{ key: string; label: string; secret?: boolean; placeholder?: string; optional?: boolean; hint?: string; }>; available: boolean; reason?: string; } interface RunnerRow { id: string; kind: RunnerKind; name: string; scope: 'personal' | 'workspace'; default: boolean; online: boolean; lastSeen?: number; config: Record; createdAt: number; } interface RunnerPairing { token: string; expiresAt: number; command: string; } interface RunnerInput { kind: RunnerKind; name: string; scope: RunnerRow['scope']; config: Record; } interface RunnerUpdate { name?: string; default?: true; config?: Record; } interface RunnerTest { ok: boolean; detail: string; ms: number; } interface ProbeResult { reachable: boolean; modelListed: boolean | null; /** Model ids the endpoint lists, or null when it has no list. */ models: string[] | null; detail: string; } interface LocalFolder { path: string; name: string; recent?: number; /** The git URL a cloned checkout came from. */ url?: string; } interface LocalFolders { current: LocalFolder; recent: LocalFolder[]; /** The machine can open its own folder dialog. */ picker: boolean; } interface TaskTurn { prompt: string; result?: { ok?: boolean; output?: string; diff?: string; } | string; error?: string; finishedAt?: number; /** First log sequence after this turn. */ logSeq?: number; } //#endregion //#region src/core/task/log-view.d.ts interface TaskLogEntry { at?: string; message?: string; kind?: string; [key: string]: unknown; } interface TokenUsage { input: number; cachedInput: number; output: number; total: number; } //#endregion //#region src/core/types.d.ts /** An extra MCP server attached to a task, with the tools the engine may call. */ /** One MCP server in the `.mcp.json` entry shape: stdio (`command`) or remote (`url`). */ interface McpServerSpec { name: string; command?: string; args?: string[]; /** Values may hold `${VAR}` placeholders, resolved from the environment at spawn time. */ env?: Record; /** Remote server; `type` defaults to `http` (streamable HTTP), `sse` for legacy servers. */ url?: string; type?: 'stdio' | 'http' | 'sse'; headers?: Record; /** Tool allowlist; omit or empty for every tool the server offers. */ tools?: string[]; } type TaskKind = 'task'; type TaskStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled'; /** A persisted task record (task.json). Most fields accrete over the lifecycle. */ interface Task { id: string; createdAt: string; updatedAt?: string; status: TaskStatus; kind?: TaskKind; name?: string | null; engine?: Engine; prompt?: string; outputSchema?: object; currentPrompt?: string | null; system?: string | null; model?: string | null; effort?: Effort | null; permissions?: Permission; resumeThreadId?: string | null; cwd?: string; background?: boolean; pid?: number | null; dispatchId?: string; threadId?: string | null; turnId?: string | null; steerEndpoint?: string | null; completedAt?: string; resumedAt?: string; error?: string; fallbacks?: Array<{ engine: Engine; detail: string; next: Engine; }>; archived?: boolean; archivedAt?: string; simulateApproval?: boolean; flowRunId?: string; agentId?: string; source?: string; author?: string; repo?: string; mcp?: McpServerSpec[]; addDirs?: string[]; } /** The outcome of running one engine turn. status 0 == success. */ interface TurnResult { status: number; threadId: string | null; turnId?: string | null; finalMessage?: string; touchedFiles?: string[]; tokens?: TokenUsage | null; /** The model that ran the turn (tokens are only comparable per model). */ model?: string | null; error?: { message?: string; } | null; [key: string]: unknown; } /** Whether an engine binary is installed and usable. */ interface Availability { available: boolean; detail: string; } /** A persisted approval escalation and its answer, if any. */ interface Approval { id: string; summary: string; /** Where an escalated command runs. */ cwd?: string; createdAt?: string; response?: { decision: string; } | null; [key: string]: unknown; } /** A [flag-or-command, description] pair rendered in help tables. */ type HelpRow = [string, string]; /** Help metadata for one command. */ interface CommandHelpSpec { usage: string; summary?: string; flags?: HelpRow[]; globalFlags?: HelpRow[]; exitCodes?: HelpRow[]; examples?: HelpRow[]; /** Environment variables the command reads: name → what it does. */ env?: HelpRow[]; seeAlso?: string; } /** A subcommand handler. Receives the argv slice after the command name. */ type CommandHandler = (argv: string[]) => Promise | void; //#endregion export { CustomModelConfig as C, Permission as D, McpConfigEntry as E, CoderConfig as S, McpAddOptions as T, RunnerRow as _, HelpRow as a, RunnerUpdate as b, TurnResult as c, LocalFolder as d, LocalFolders as f, RunnerPairing as g, RunnerKind as h, CommandHelpSpec as i, TaskLogEntry as l, RunnerInput as m, Availability as n, Task as o, ProbeResult as p, CommandHandler as r, TaskStatus as s, Approval as t, TokenUsage as u, RunnerSpec as v, Effort as w, TaskTurn as x, RunnerTest as y };