import { type Command } from "commander"; import { type PlanResult } from "../internals/execute.js"; import type { CommandSpec, PlanContext } from "../internals/plan.js"; import { type Runner } from "../internals/proc.js"; import { type Prompter } from "../internals/prompt.js"; export interface RunDeps { run?: Runner; env?: NodeJS.ProcessEnv; write?: (text: string) => void; /** Separate stderr writer for bounded progress and secondary cleanup diagnostics. */ writeError?: (text: string) => void; /** Inject a prompter (tests); production wires a readline prompter when interactive. */ prompter?: Prompter; /** Clock seam — injected in tests so support timestamps + ledger rows are deterministic. */ now?: () => Date; /** Run-id seam — injected in tests so support references + ledger rows are deterministic. */ newRunId?: () => string; /** Raw invoking argv (defaults to process.argv.slice(2)); redacted before logging. */ argv?: string[]; /** Override extracted capability options (used by nested commands with custom positionals). */ optionOverrides?: Record; /** Override the positional root; false disables positional root handling. */ positionalRoot?: string | false; /** Capability-owned multi-phase executor; preserves shared output, support, and logging. */ execute?: (ctx: PlanContext) => Promise; } /** Convert a commander option flag spec into its camelCase opts key. */ export declare function flagKey(flags: string): string; /** * Shared execution path for every capability command: resolve settings + host, * build the {@link PlanContext}, run the capability's `plan`, execute it (honoring * dry-run/apply/verify), and print text or `--json`. Returns the process exit code. */ export declare function runCapability(spec: CommandSpec, command: Command, deps?: RunDeps): Promise;