export type PipelinePhase = "plan" | "review-plan" | "implement" | "review-code" | "validate" | "approve" | "commit"; /** * Split raw args into (taskId, forceFlag, remainder). * * - `--force` is consumed; the boolean is returned. * - The first non-flag token is taken as the task ID hint (may be empty when * the user passes no args — in that case the agent will infer the task from * context; the guard cannot run and returns null). * - All other tokens (excluding `--force`) are returned as remainder. */ export interface ParsedGuardArgs { force: boolean; /** First non-flag arg; empty string when absent. */ taskIdHint: string; /** Remaining args with --force stripped (for re-passing to composeKickoff). */ cleanArgs: string; } export declare function parseGuardArgs(rawArgs: string): ParsedGuardArgs; export interface PipelineGuardResult { /** true = blocked; false = allowed or lookup failed (fail-open). */ blocked: boolean; /** Error message to emit when blocked. Empty string when allowed/fail-open. */ message: string; } /** * Run the pipeline step guard for a given phase. * * @param phase The pipeline phase being invoked. * @param taskId Task ID to look up. If empty, the guard is a no-op (returns allowed). * @param forgeRoot Absolute path to the forge plugin root (needed to locate store-cli.cjs). * @param cwd Working directory for the store-cli subprocess. * * Returns `{ blocked: false, message: "" }` when: * - taskId is empty (can't check — fail-open) * - store-cli lookup fails (fail-open) * - current status is in the allowed set for this phase * * Returns `{ blocked: true, message: "..." }` when the current status is NOT * in the allowed set. */ export declare function runPipelineGuard(phase: PipelinePhase, taskId: string, forgeRoot: string, cwd: string): PipelineGuardResult;