/** * Expand phase helpers — pure transforms for fragment prep + graft promote. * Execution still wires through flow|def path in runtime.ts; logic lives here * so expand does not keep growing executePhaseInner. */ import type { Phase, Taskflow } from "../../schema.ts"; import type { PhaseState, RunState } from "../../store.ts"; import { emptyUsage } from "../../usage.ts"; export type ExpandMode = "nested" | "graft"; export declare function resolveExpandMode(phase: Phase): ExpandMode; export declare function resolveMaxNodes(phase: Phase, hardCap: number): number; /** * Prefix every phase id (and rewrite dependsOn/from + template step refs) so * graft fragments never collide with parent phase ids and internal edges stay valid. */ export declare function prefixGraftFragment(fragment: Taskflow, expandPhaseId: string): Taskflow; /** * Copy child phase states onto the parent run (graft promote). * Skips ids that already exist on the parent. * Returns whether any phase was promoted (caller should zero expand usage to avoid double-count). */ export declare function promoteGraftPhases(parent: RunState, childPhases: Record): { promoted: number; promotedIds: string[]; warnings: string[]; }; /** Empty usage helper for expand phase after graft (avoid double-count in rollup). */ export declare function emptyUsageForGraftExpand(): ReturnType; //# sourceMappingURL=expand.d.ts.map