import type { NativeSettingsInspector } from "../execution/native-settings.js"; import { type TurnRunOptions } from "../execution/stream-turn.js"; import { type ConfigTier, type ProvenanceEntry, type ResolvedBehavior, type UnrenderableEntry } from "../interpretation/resolve-options.js"; import type { HarnessDescriptor, HarnessName } from "../knowledge/descriptor.js"; import { type ExtensionProbeFn } from "./extension-gate.js"; import { type Refusal } from "./refuse.js"; /** The impure edges a plan reads through, injectable for tests. */ export interface PlanDeps { readonly inspectNativeSettings?: NativeSettingsInspector; /** Map #300: the extension-registered option probe. Optional only so * legacy test fixtures can omit it - the default always provides the * real spawn, and production paths never construct PlanDeps without * it; when absent the gate skips (nothing probes, nothing renders * differently - the spec itself still refuses on absent extensions * at spawn time through the harness's own error). */ readonly probeExtensionOption?: ExtensionProbeFn; readonly loadUserConfig: () => { readonly config: ConfigTier; } | null; readonly loadProjectConfig: () => { readonly config: ConfigTier; } | null; readonly listKnownSkills: () => readonly string[]; readonly resolveSkillNames: (names: readonly string[], harness: HarnessName) => string[]; readonly readPrompt: (args: { positionalPrompt?: string; promptFlag?: string; promptFile?: string; }) => Promise<{ prompt: string; source: string; }>; } export declare const defaultPlanDeps: PlanDeps; export interface TurnPlan { /** Decided before any refusal can fire: a refused --json run still owes * the stream its terminal pair. */ readonly wantJson: boolean; /** Everything the runner takes: the composed prompt, the resolved turn * options (raw ones on resume), cwd, env, resume, question mode, and * the passthrough tail. */ readonly options: TurnRunOptions; /** The argv the runner will spawn, built by the same owner it uses. */ readonly argv: readonly string[]; readonly redactedArgv: readonly string[]; /** Launch-only; empty on resume, where omitted options follow native behavior. */ readonly provenance: readonly ProvenanceEntry[]; readonly unrenderable: readonly UnrenderableEntry[]; readonly behavior: ResolvedBehavior; /** Tool names the grant passes through ungated, for the provenance line. */ readonly nativeTools: readonly string[]; } export type PlanOutcome = { readonly kind: "plan"; readonly plan: TurnPlan; } | { readonly kind: "refusal"; readonly refusal: Refusal; readonly wantJson: boolean; }; export interface PlanRequest { /** Names the command in usage trailers. */ readonly command: "run" | "inspect"; } export declare const planTurn: (h: HarnessDescriptor, rawArgs: readonly string[], request: PlanRequest, deps?: PlanDeps) => Promise; /** The diagnostics a plan prints to stderr - never stdout, which carries * the NDJSON contract: provenance and divergence, the argv line under the * given label, the question-mode provenance, and the native tool names. */ export declare const writePlanDiagnostics: (h: HarnessDescriptor, plan: TurnPlan, label: "spawn" | "argv") => void; //# sourceMappingURL=plan-turn.d.ts.map