/** * Promotion gate orchestration — write pending marker, resolve approve/reject, * then on approval call launch; on rejection clean up and return. * * PURE-ish DI core: all I/O via injected projectRoot paths + approval-state.ts * functions + injected confirm / now / launcher. Never reads the real clock * (now is injected). Never throws — failures propagate as Promise rejections * which the caller (runDo) converts to process.exitCode = 1. */ import type { PromotionPlan } from "./types.js"; /** Result returned by runPromotionGate after the approve/reject decision. */ export interface GateOutcome { approved: boolean; } /** Arguments for runPromotionGate — all I/O dependencies are injected. */ export interface PromotionGateArgs { /** Absolute project root (used to build .bober/approvals paths). */ projectRoot: string; /** Finding id — used to derive checkpointId `promote-`. */ findingId: string; /** The promotion plan to summarize in the pending marker. */ plan: PromotionPlan; /** When true, bypass interactive prompt and auto-approve. */ yes?: boolean; /** * Whether stdout is a TTY. When true and not --yes, calls the injected * confirm() and waits for a synchronous answer. When false, polls the * approvals directory until an external approve/reject marker appears. */ isTTY: boolean; /** Injected interactive confirm. TTY path only; must return true/false. */ confirm: () => Promise; /** Clock injection — returns an ISO string. */ now: () => string; /** Non-TTY poll interval in ms. Default 2000ms; use small values in tests. */ pollMs?: number; /** Non-TTY timeout in ms. Default 24 hours. */ timeoutMs?: number; } /** * Write promote-.pending.json, gate on it * (--yes → auto-approve; TTY → prompts(); non-TTY → poll directory), * and return { approved }. * * Writes/deletes markers via approval-state.ts only — no new format. * checkpointId is always `promote-${findingId}` so external * `bober approve promote-` resolves it (sc-2-5). */ export declare function runPromotionGate(args: PromotionGateArgs): Promise; //# sourceMappingURL=promote.d.ts.map