/** * `bober do ` — promote a hub Finding into a bober run task. * * Error handling: CLI handlers MUST NOT throw. Set process.exitCode=1 and return. * * HARD BOUNDARY: this file MUST NOT import execa, node:child_process, * or RunSpawner directly. Import the Launcher adapter from do-bridge/launcher.ts * instead — it owns the RunSpawner import. */ import type { Command } from "commander"; import type { FindingStore } from "../../do-bridge/finding-port.js"; import { PromoterRegistry } from "../../do-bridge/registry.js"; import type { Launcher } from "../../do-bridge/launcher.js"; /** * Injected dependencies for the real (non-dry-run) launch path. * OPTIONAL so the 12 existing Sprint-1 tests (4-arg calls that hit * dry-run/error branches) still compile without providing deps. */ export interface RunDoDeps { /** Launcher port — injected so tests use a fake and never spawn a real process. */ launcher: Launcher; /** Absolute project root for approval marker files. */ projectRoot: string; /** Interactive confirm. TTY path calls this; tests pass a stub. */ confirm: () => Promise; /** Whether stdout is a TTY. Defaults to process.stdout.isTTY. */ isTTY?: boolean; /** Clock injection. Defaults to () => new Date().toISOString(). */ now?: () => string; /** Non-TTY poll interval in ms (small values for tests). */ pollMs?: number; /** Non-TTY timeout in ms. */ timeoutMs?: number; } /** * DI core for `bober do` — accepts injected FindingStore + registry so tests * can drive it without opening a real DB or spawning anything. * * Never throws: every failure branch sets process.exitCode=1 and returns. * * Resolution branches: * 1. finding === null → stderr "no finding with id …" + exitCode 1 + return. * 2. promoter === undefined → stderr naming the unsupported domain + exitCode 1 + return. * 3. --dry-run → print ONE stdout line containing plan.task + "dry-run"; NO writes. * 4. non-dry-run → gate (pending → approve/reject) → launch on approve. */ export declare function runDo(store: FindingStore, registry: PromoterRegistry, findingId: string, opts: { dryRun?: boolean; yes?: boolean; }, deps?: RunDoDeps): Promise; export declare function registerDoCommand(program: Command): void; //# sourceMappingURL=do.d.ts.map