import { C as Job, E as CustomModelConfig, S as Availability, T as CoderConfig, _ as FlowStep, a as JobLogEntry, c as StopSummary, g as FlowRecord, h as FlowEvent, i as TaskResult, m as DiscoveredFlow, n as flowSdk, o as RunOptions, r as CoderError, s as RunSummary, w as TurnResult, x as Approval } from "./index-BQ-b77or.js"; //#region src/lib/codex-core.d.ts declare function getCodexAvailability(cwd: string): Availability; //#endregion //#region src/lib/plugins.d.ts /** Result of a plugin install/refresh attempt. */ interface PluginResult { marketplace: string; installed: boolean; note: string; } /** Outcome of the codex auto-update check; null when nothing to do. */ type CodexUpdateResult = { updated: true; from: string; } | { updated: false; from: string; note: string; } | null; /** Outcome of an on-demand codex install; null when codex was already present. */ type CodexInstallResult = { installed: boolean; note: string; } | null; declare function ensureCodexInstalled(availability: Availability): CodexInstallResult; declare function ensureCodexUpToDate(availability: Availability): CodexUpdateResult; //#endregion //#region src/cmd/model.d.ts interface ProbeResult { reachable: boolean; modelListed: boolean | null; detail: string; } interface PersistedModel { name: string; entry: CustomModelConfig; file: string; probe: ProbeResult; codex: ReturnType; install: ReturnType; nativeResponses: boolean; keyMissing: boolean; ready: boolean; } interface ModelWriteOptions { baseUrl?: string; model?: string; envKey?: string; workspace?: boolean; } //#endregion //#region src/cmd/setup-host.d.ts interface SetupHostReport { codex: { available: boolean; detail: string; auth: string; loggedIn: boolean; }; codexUpdate?: ReturnType; claude: { available: boolean; detail: string; auth: string; loggedIn: boolean; }; configFile: string; runtime: string; claudePlugin?: PluginResult; agentsSkill?: PluginResult; config: CoderConfig; ready: boolean; } //#endregion //#region src/cmd/upgrade.d.ts interface UpgradeReport { cli?: { pm: string; from: string | null; to: string | null; changed: boolean; }; claudePlugin?: { installed: boolean; note: string; from: string | null; to: string | null; }; agentsSkill?: { installed: boolean; note: string; from: string | null; to: string | null; }; } //#endregion //#region src/cmd/jobs.d.ts /** Filters for the task list, mirroring the CLI flags. */ interface ListOptions { running?: boolean; stopped?: boolean; archived?: boolean; /** Narrow to a workspace (matched by git root). */ dir?: string; /** Max rows; 'all' or undefined means no limit. */ limit?: number | 'all'; } //#endregion //#region src/cmd/steer.d.ts /** How a steer was applied to a task. */ type SteerOutcome = 'live' | 'queued' | 'resumed'; //#endregion //#region src/sdk.d.ts interface TaskRunOptions { agent?: string; model?: string; effort?: string; permissions?: string; name?: string; system?: string; resume?: string; cwd?: string; } /** Run and control coder tasks. Mirrors `coder task`. */ declare const task: { /** Dispatch a task to the agent chain; returns as soon as it is live. */ run(prompt: string, opts?: TaskRunOptions): Promise<{ taskId: string; }>; /** * A task's result. With `wait`, blocks until the task is terminal (a pending * approval throws a CoderError with code 'approval-pending'). `tail` fills * `steps` with the last n steps (default 0: []). Omit the id for the * most recent task. */ result(id?: string, opts?: { wait?: boolean; tail?: number | "all"; cwd?: string; }): Promise; /** Recent tasks (mirrors `coder list` / `coder task list`). */ list(opts?: ListOptions & { cwd?: string; }): Job[]; /** Steer a follow-up into a task (live, queued, or resumed on its thread). */ steer(id: string, text: string, opts?: { model?: string; effort?: string; permissions?: string; cwd?: string; }): Promise<{ taskId: string; steered: SteerOutcome; }>; /** Ask about a task via a read-only sidecar; its thread is never touched. */ ask(id: string, question: string, opts?: { model?: string; effort?: string; cwd?: string; }): Promise<{ taskId: string; answer: string | null; }>; /** Stop a running task. */ stop(id: string, opts?: { cwd?: string; }): Promise<{ taskId: string; status: "cancelled"; interrupt: string; }>; /** Archive a task (hide it from the default list). */ archive(id: string, opts?: { cwd?: string; }): { taskId: string; archived: true; }; /** Delete a task and its engine session from disk. */ delete(id: string, opts?: { cwd?: string; }): { taskId: string; deleted: boolean; }; /** Answer a pending approval (accept, or `deny`). */ approve(id: string, approvalId: string, opts?: { deny?: boolean; cwd?: string; }): { taskId: string; approvalId: string; decision: "accept" | "decline"; }; /** Pending approvals for a task (omit the id for the most recent task). */ approvals(id?: string, opts?: { cwd?: string; }): Approval[]; /** Follow a task live: an async iterable of progress log entries. `tail` replays only the last n steps (default 1). */ stream(id?: string, opts?: { tail?: number | "all"; cwd?: string; }): AsyncGenerator; }; /** Manage models: custom endpoints, engine aliases, disable toggles. Mirrors `coder model`. */ declare const model: { /** Register a custom OpenAI-compatible endpoint model. */ add: (name: string, opts: ModelWriteOptions & { cwd?: string; }) => Promise; /** Update fields of a configured model entry. */ update: (name: string, opts: ModelWriteOptions & { cwd?: string; }) => Promise; /** Remove a configured model entry. */ remove: (name: string, opts?: { workspace?: boolean; cwd?: string; }) => { removed: string; file: string; }; /** Every dispatchable model: built-ins, aliases, custom endpoints. */ list: (opts?: { cwd?: string; }) => Promise<{ toggles?: { name: string; disabled: boolean; }[] | undefined; codex: ({ alias: string; model: string; builtin: boolean; disabled: boolean; spec?: undefined; overrides?: undefined; } | { alias: string; spec: string; disabled: boolean; })[]; claude: ({ alias: string; model: string; builtin: boolean; disabled: boolean; spec?: undefined; overrides?: undefined; } | { alias: string; spec: string; disabled: boolean; })[]; custom: { probe: ProbeResult; baseUrl: string; model: string; envKey?: string | undefined; wireApi?: "chat" | "responses" | undefined; disabled?: boolean | undefined; name: string; }[]; }>; /** Alias a name to an engine spec, e.g. alias('fast', 'codex:spark'). */ alias: (name: string, spec: string, opts?: { workspace?: boolean; cwd?: string; }) => { provider: "codex" | "claude"; model: string; effort?: "low" | "medium" | "high" | undefined; disabled?: boolean | undefined; } & { alias: string; file: string; }; /** Remove a user-defined alias. */ unalias: (name: string, opts?: { workspace?: boolean; cwd?: string; }) => { unaliased: string; file: string; }; /** Disable a model name (built-in, alias, or raw slug) without removing it. */ disable: (name: string, opts?: { workspace?: boolean; cwd?: string; }) => { name: string; disabled: boolean; file: string; }; /** Re-enable a disabled model name. */ enable: (name: string, opts?: { workspace?: boolean; cwd?: string; }) => { name: string; disabled: boolean; file: string; }; }; /** Read and write coder configuration. Mirrors `coder config`. */ declare const config: { /** A config value by dotted key (or the whole effective config). */ get: (key?: string, opts?: { cwd?: string; }) => unknown; /** Set a config value; `workspace` targets the repo file instead of the user file. */ set: (key: string, value: unknown, opts?: { workspace?: boolean; cwd?: string; }) => { file: string; key: string; effective: unknown; value?: unknown; unset?: boolean; }; }; /** Probe engines, seed the chain, install requested host plugins. */ declare function setupHost(hosts?: string[], opts?: { cwd?: string; }): Promise; /** Update the CLI and/or host plugin installs; returns what moved. */ declare function upgrade(opts?: { cliOnly?: boolean; pluginsOnly?: boolean; }): Promise; /** List bundled docs, or return one topic's raw markdown. */ declare function docs(topic?: string): { topics: { name: string; description: string; }[]; } | { name: string; content: string; }; declare const _default: { task: { /** Dispatch a task to the agent chain; returns as soon as it is live. */ run(prompt: string, opts?: TaskRunOptions): Promise<{ taskId: string; }>; /** * A task's result. With `wait`, blocks until the task is terminal (a pending * approval throws a CoderError with code 'approval-pending'). `tail` fills * `steps` with the last n steps (default 0: []). Omit the id for the * most recent task. */ result(id?: string, opts?: { wait?: boolean; tail?: number | "all"; cwd?: string; }): Promise; /** Recent tasks (mirrors `coder list` / `coder task list`). */ list(opts?: ListOptions & { cwd?: string; }): Job[]; /** Steer a follow-up into a task (live, queued, or resumed on its thread). */ steer(id: string, text: string, opts?: { model?: string; effort?: string; permissions?: string; cwd?: string; }): Promise<{ taskId: string; steered: SteerOutcome; }>; /** Ask about a task via a read-only sidecar; its thread is never touched. */ ask(id: string, question: string, opts?: { model?: string; effort?: string; cwd?: string; }): Promise<{ taskId: string; answer: string | null; }>; /** Stop a running task. */ stop(id: string, opts?: { cwd?: string; }): Promise<{ taskId: string; status: "cancelled"; interrupt: string; }>; /** Archive a task (hide it from the default list). */ archive(id: string, opts?: { cwd?: string; }): { taskId: string; archived: true; }; /** Delete a task and its engine session from disk. */ delete(id: string, opts?: { cwd?: string; }): { taskId: string; deleted: boolean; }; /** Answer a pending approval (accept, or `deny`). */ approve(id: string, approvalId: string, opts?: { deny?: boolean; cwd?: string; }): { taskId: string; approvalId: string; decision: "accept" | "decline"; }; /** Pending approvals for a task (omit the id for the most recent task). */ approvals(id?: string, opts?: { cwd?: string; }): Approval[]; /** Follow a task live: an async iterable of progress log entries. `tail` replays only the last n steps (default 1). */ stream(id?: string, opts?: { tail?: number | "all"; cwd?: string; }): AsyncGenerator; }; flow: { run(nameOrPath: string, opts?: RunOptions): Promise; list(opts?: { archived?: boolean; limit?: number; }): FlowRecord[]; discover(cwd?: string): DiscoveredFlow[]; result(runId?: string, opts?: { tail?: number | "all"; }): (FlowRecord & { steps: FlowStep[]; }) | null; stream(runId?: string, opts?: { tail?: number | "all"; }): AsyncGenerator; stop(runId?: string, opts?: { keepTasks?: boolean; }): Promise; resume(runId?: string, opts?: RunOptions): Promise; archive(runId: string): { runId: string; archived: true; }; delete(runId: string): { runId: string; deleted: boolean; }; }; model: { /** Register a custom OpenAI-compatible endpoint model. */ add: (name: string, opts: ModelWriteOptions & { cwd?: string; }) => Promise; /** Update fields of a configured model entry. */ update: (name: string, opts: ModelWriteOptions & { cwd?: string; }) => Promise; /** Remove a configured model entry. */ remove: (name: string, opts?: { workspace?: boolean; cwd?: string; }) => { removed: string; file: string; }; /** Every dispatchable model: built-ins, aliases, custom endpoints. */ list: (opts?: { cwd?: string; }) => Promise<{ toggles?: { name: string; disabled: boolean; }[] | undefined; codex: ({ alias: string; model: string; builtin: boolean; disabled: boolean; spec?: undefined; overrides?: undefined; } | { alias: string; spec: string; disabled: boolean; })[]; claude: ({ alias: string; model: string; builtin: boolean; disabled: boolean; spec?: undefined; overrides?: undefined; } | { alias: string; spec: string; disabled: boolean; })[]; custom: { probe: ProbeResult; baseUrl: string; model: string; envKey?: string | undefined; wireApi?: "chat" | "responses" | undefined; disabled?: boolean | undefined; name: string; }[]; }>; /** Alias a name to an engine spec, e.g. alias('fast', 'codex:spark'). */ alias: (name: string, spec: string, opts?: { workspace?: boolean; cwd?: string; }) => { provider: "codex" | "claude"; model: string; effort?: "low" | "medium" | "high" | undefined; disabled?: boolean | undefined; } & { alias: string; file: string; }; /** Remove a user-defined alias. */ unalias: (name: string, opts?: { workspace?: boolean; cwd?: string; }) => { unaliased: string; file: string; }; /** Disable a model name (built-in, alias, or raw slug) without removing it. */ disable: (name: string, opts?: { workspace?: boolean; cwd?: string; }) => { name: string; disabled: boolean; file: string; }; /** Re-enable a disabled model name. */ enable: (name: string, opts?: { workspace?: boolean; cwd?: string; }) => { name: string; disabled: boolean; file: string; }; }; config: { /** A config value by dotted key (or the whole effective config). */ get: (key?: string, opts?: { cwd?: string; }) => unknown; /** Set a config value; `workspace` targets the repo file instead of the user file. */ set: (key: string, value: unknown, opts?: { workspace?: boolean; cwd?: string; }) => { file: string; key: string; effective: unknown; value?: unknown; unset?: boolean; }; }; setupHost: typeof setupHost; upgrade: typeof upgrade; docs: typeof docs; }; //#endregion export { type Approval, CoderError, type FlowEvent, type FlowStep, type Job, type JobLogEntry, type SteerOutcome, type TaskResult, TaskRunOptions, type TurnResult, config, _default as default, docs, flowSdk as flow, model, setupHost, task, upgrade };