/** * Genuine Taskflow → FlowIR compiler (RFC §5.2, S0). * * This graduates the stub `translateTaskflow` into a **canonical** IR emitter: * 1:1 phase→node projection (native multi-node lowering deferred per §12), * declared inject/emits, explicit edges, normalized `when` via {@link normalizeCond}, * and richer optional node fields (`task`, `deps`, `join`, `timeout`, `condRef`). * * Pure, synchronous, never throws — diagnostics live in the return value so * `/tf ir` on a broken flow still yields a structured report. * * @see docs/rfc-0.2.0-architecture.md §5 * @see ./translate.ts (stub; still used for sidecar field list parity) */ import { type Taskflow } from "../schema.ts"; import type { FlowIR as CanonicalFlowIR } from "./schema.ts"; import type { CompileError, CompileWarning, FlowIR, TaskflowIRMeta } from "./meta.ts"; /** * Result of {@link compileTaskflowToFlowIR}: canonical IR + declared meta + diagnostics. * `usedFallbackHash` is **false** when the IR is well-formed enough to content-address * (always, unless hard errors prevent IR emission). * * Named separately from Mermaid `compileTaskflow` in `../compile.ts` (diagram). */ export interface CompileTaskflowToFlowIRResult { /** Canonical FlowIR (superset of the stub projection). */ canonical: CanonicalFlowIR; /** Stub-compatible IR projection (same nodes without requiring consumers to import schema.ts). */ ir: FlowIR; meta: TaskflowIRMeta; warnings: CompileWarning[]; errors: CompileError[]; /** False once the genuine compiler owns the hash (S0). */ usedFallbackHash: boolean; } /** * Compile a (desugared) Taskflow into canonical FlowIR. * * - One node per phase (1:1). * - `inject` = `{steps.*}` refs ∪ `dependsOn` (minus self). * - `emits` = `[phase.id]`. * - `edges` synthesized from inject for graph consumers. * - `when` kept as source text; `condRef` = normalizeCond(canonical) when present. * - Optional fields: task, deps, join, timeout copied when set. * * Never throws. */ export declare function compileTaskflowToFlowIR(def: Taskflow): CompileTaskflowToFlowIRResult; //# sourceMappingURL=compile.d.ts.map