import { type WorkflowPhase } from '@generacy-ai/orchestrator'; export interface GateDefinition { /** Gate name (e.g. "clarification", "plan-review"). */ name: string; /** Full label name "waiting-for:". */ waitingLabel: string; /** Full label name "completed:". */ completedLabel: string; } export declare const GATES: ReadonlyMap; /** List gate names in `WORKFLOW_LABELS` order — stable for `--help-gates`. */ export declare function listGates(): string[]; /** * A gate whose completion causes the resolver to pick the failed phase as * `startPhase`. Returned by `resolvePrecedingGate`. */ export interface PrecedingGate { /** Gate name — e.g. "implementation-review", "tasks-review". */ name: string; /** Full label name "waiting-for:". */ waitingLabel: string; /** Full label name "completed:". */ completedLabel: string; /** The phase this gate belongs to (from GATE_MAPPING[name].phase). */ sourcePhase: WorkflowPhase; /** True when sourcePhase === the phase being re-entered (documented tie-break). */ isSelfLoop: boolean; } export type ResolvePrecedingGateResult = { kind: 'found'; gate: PrecedingGate; } | { kind: 'no-preceding-gate'; targetPhase: WorkflowPhase; }; /** * Resolve the preceding gate for a failed phase. * * Algorithm (deterministic; mirrors `PhaseResolver.getEffectiveGateMapping`): * 1. Build effective mapping = GATE_MAPPING overlaid with WORKFLOW_GATE_MAPPING[workflowName]. * 2. Filter entries where `resumeFrom === phase`. * 3. If empty: return `no-preceding-gate`. * 4. Partition into `crossPhase` (gatePhase !== phase) and `selfLoop`. * 5. If crossPhase non-empty: pick nearest predecessor by PHASE_SEQUENCE.indexOf descending. * 6. Otherwise: pick the first selfLoop entry in stable Object.entries order. */ export declare function resolvePrecedingGate(phase: WorkflowPhase, workflowName?: string): ResolvePrecedingGateResult; //# sourceMappingURL=gate-vocabulary.d.ts.map