import type { LoopNodeConfig, NodeState, WorkflowContext, WorkflowNode } from "../../types.js"; import type { NodeExecutionResult } from "./types.js"; import type { NodeStrategyRuntime } from "./node-strategy-types.js"; interface ExecuteLoopNodeStrategyInput { node: WorkflowNode; config: LoopNodeConfig; context: WorkflowContext; nodeStates: Record; /** Declared node ids in the graph that owns this loop node. */ parentNodeIds: ReadonlySet; runtime: NodeStrategyRuntime; abortSignal?: AbortSignal; } /** * A `NodeState` in the shape that survives the context's JSON round trip. * * `WorkflowContext` is JSON-representable by contract, and `NodeState` is not: * `startedAt` and `completedAt` are `Date`. Writing them into the context puts * a value there that `JSON.stringify` rewrites, so a resumed iteration read * back a string where the suspending one wrote a `Date`, and the persistence * check reported the framework's own timestamps as user-authored lossy values. * * The encoded bytes are unchanged: `JSON.stringify` already produced these * strings. What changes is that the loop now writes them itself, so the value * in memory matches the value after a resume either way. */ type PersistedNodeState = Omit & { startedAt?: string; completedAt?: string; }; /** * @internal Encode child node states so the context holds nothing JSON rewrites. * * Absent optional fields are dropped rather than written as `undefined`, which * JSON removes anyway. Keeping them would have the check report the framework's * own empty fields as lossy. `input` and `output` are copied through untouched: * they hold step values, and a step writing something JSON cannot carry is * exactly what the check exists to report. */ export declare function toPersistedNodeStates(states: Record): Record; export declare function executeLoopNodeStrategy(input: ExecuteLoopNodeStrategyInput): Promise; export {}; //# sourceMappingURL=loop-node-strategy.d.ts.map