/** * Preflight dry-run — zero-token plan before spend. * * Binds typed args, runs structural verify, projects a phase plan with * static/dynamic binding status, and computes a worst-case agent-call bound. */ import { type Phase } from "./schema.ts"; import { type VerificationIssue, type VerificationResult, type TaskflowVerifier } from "./verify.ts"; export interface PreflightOptions { /** Invocation arguments (same shape as taskflow_run.args). */ args?: Record; /** When true (default), missing required typed args → ok:false. */ strictArgs?: boolean; /** Optional plugin verifiers (same as verify/lint). */ verifiers?: TaskflowVerifier[]; /** Working directory for validateTaskflow cwd checks. */ cwd?: string; } export type PreflightWhenKind = "always" | "static-true" | "static-false" | "dynamic"; export interface PreflightBinding { path: string; status: "bound" | "unresolved" | "dynamic"; value?: string; } export interface PreflightPhasePlan { id: string; type: string; order: number; when: PreflightWhenKind; bindings: PreflightBinding[]; agent?: string; modelHint?: string; notes?: string[]; } export interface PreflightBudgetBound { maxAgentCalls: number | "unbounded"; maxMapFanout?: number | "unbounded"; phasesCounted: number; assumptions: string[]; } export interface PreflightResult { ok: boolean; issues: VerificationIssue[]; flowName: string; args: Record; phases: PreflightPhasePlan[]; budget: PreflightBudgetBound; summary: string; /** Structural verify result (may be empty if flow failed validation). */ verify?: VerificationResult; } /** Classify a `when` guard for preflight (args-only static evaluation). */ export declare function classifyWhen(when: string | undefined, args: Record): PreflightWhenKind; export declare function computeBudgetBound(phases: Phase[], args?: Record): PreflightBudgetBound; /** * Plan a flow without executing any agent. Pure w.r.t. model spend. */ export declare function preflightTaskflow(raw: unknown, opts?: PreflightOptions): PreflightResult; export declare function formatPreflightSummary(p: { ok: boolean; flowName: string; phases: PreflightPhasePlan[]; budget: PreflightBudgetBound; issueCount: number; errorCount: number; }): string; /** Full human report for MCP/CLI. */ export declare function formatPreflightReport(r: PreflightResult, json?: boolean): string; //# sourceMappingURL=preflight.d.ts.map