import type { WorkflowContext } from "../../types.js"; import type { ContextPatch } from "./types.js"; /** An explicit top-level patch. A key is either set or deleted, never both. */ export interface RecordPatch { set: Record; delete: string[]; } /** * Clone execution state at an isolation boundary. * * Workflow context is durable state and must therefore be structured-cloneable. * Using the same operation as checkpoints keeps in-memory execution semantics * aligned with checkpoint and resume behavior. */ export declare function cloneExecutionState(value: T, label: string): T; export declare function createRecordPatch(before: Record, after: Record): RecordPatch; export declare function createContextPatch(before: WorkflowContext, after: WorkflowContext): ContextPatch; export declare function createSetContextPatch(values?: Record): ContextPatch; /** Merge patches in order. A later operation wins when patches touch the same key. */ export declare function mergeContextPatches(...patches: ContextPatch[]): ContextPatch; /** * Apply one node's patch. The executor calls this in node declaration order, * which makes a later node the deterministic winner for same-key writes. */ export declare function applyRecordPatch(target: Record, patch: RecordPatch): void; export declare function applyContextPatch(target: WorkflowContext, patch: ContextPatch): void; //# sourceMappingURL=context-patch.d.ts.map