/**
 * Job templating and gate evaluation.
 *
 * The run context is a plain object derived from the run's frozen inputs and
 * step history:
 *
 *   inputs.<key>                  — spawn-time input values
 *   steps.<id>.outputs.<key>      — outputs of the most recent completed
 *                                   entry for that step
 *   steps.<id>.verdict            — verdict of the most recent entry
 *   run.id / run.jobId            — run identity
 *
 * interpolate() throws on unresolved references — a job must fail loudly,
 * never silently substitute an empty string into an agent prompt.
 */
import type { JobRun, GateJobStep } from "shared";
export interface JobRunContext {
    inputs: Record<string, string>;
    steps: Record<string, {
        outputs: Record<string, unknown>;
        verdict?: string;
    }>;
    run: {
        id: string;
        jobId: string;
    };
}
export declare function buildRunContext(run: JobRun): JobRunContext;
/** Resolve a context ref like "steps.plan.outputs.plan_md". */
export declare function resolveRef(ctx: JobRunContext, ref: string): unknown;
/**
 * Replace {{ref}} placeholders. Throws listing every unresolved ref so the
 * step (and run) fails with an actionable message.
 */
export declare function interpolate(template: string, ctx: JobRunContext): string;
/** AND of condition.all, AND'd with OR of condition.any (when present). */
export declare function evaluateGate(step: GateJobStep, ctx: JobRunContext): boolean;
//# sourceMappingURL=job-template.d.ts.map