flowcraft 2.7.1 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/adapters/index.d.ts +1 -1
  2. package/dist/adapters/persistent-event-bus.d.ts +1 -1
  3. package/dist/analysis.d.ts +1 -1
  4. package/dist/{chunk-N63S5NEG.js → chunk-26VTGQAF.js} +4 -8
  5. package/dist/chunk-26VTGQAF.js.map +1 -0
  6. package/dist/{chunk-BCMR7Y4U.js → chunk-4JUPOFSL.js} +4 -4
  7. package/dist/{chunk-BCMR7Y4U.js.map → chunk-4JUPOFSL.js.map} +1 -1
  8. package/dist/{chunk-7EMUOH77.js → chunk-5A24LVGQ.js} +3 -3
  9. package/dist/{chunk-7EMUOH77.js.map → chunk-5A24LVGQ.js.map} +1 -1
  10. package/dist/{chunk-U7DKCIWT.js → chunk-BV6MXL74.js} +3 -3
  11. package/dist/{chunk-U7DKCIWT.js.map → chunk-BV6MXL74.js.map} +1 -1
  12. package/dist/{chunk-BEHVGFIM.js → chunk-CIXL7AKH.js} +7 -7
  13. package/dist/{chunk-BEHVGFIM.js.map → chunk-CIXL7AKH.js.map} +1 -1
  14. package/dist/{chunk-7M6FHFHP.js → chunk-E6ICIXVR.js} +4 -4
  15. package/dist/{chunk-7M6FHFHP.js.map → chunk-E6ICIXVR.js.map} +1 -1
  16. package/dist/{chunk-XZZWIJ4G.js → chunk-K446NZ4E.js} +3 -3
  17. package/dist/{chunk-XZZWIJ4G.js.map → chunk-K446NZ4E.js.map} +1 -1
  18. package/dist/{chunk-WWGFIYKW.js → chunk-OOJEXFYY.js} +11 -11
  19. package/dist/chunk-OOJEXFYY.js.map +1 -0
  20. package/dist/{chunk-HXSK5P2X.js → chunk-PU2VTWJD.js} +23 -9
  21. package/dist/chunk-PU2VTWJD.js.map +1 -0
  22. package/dist/{chunk-DV2CXHOY.js → chunk-QA2WDZPV.js} +3 -3
  23. package/dist/{chunk-DV2CXHOY.js.map → chunk-QA2WDZPV.js.map} +1 -1
  24. package/dist/{chunk-RAZWRNAJ.js → chunk-VZ4BRDBK.js} +3 -3
  25. package/dist/{chunk-RAZWRNAJ.js.map → chunk-VZ4BRDBK.js.map} +1 -1
  26. package/dist/{chunk-AKDL2ZX7.js → chunk-X5RJOZY2.js} +17 -25
  27. package/dist/chunk-X5RJOZY2.js.map +1 -0
  28. package/dist/{chunk-H4JTZYIT.js → chunk-ZKINHLMS.js} +80 -22
  29. package/dist/chunk-ZKINHLMS.js.map +1 -0
  30. package/dist/container-factory.d.ts +1 -1
  31. package/dist/container-factory.js +4 -4
  32. package/dist/container.js +1 -1
  33. package/dist/context.d.ts +1 -1
  34. package/dist/error-mapper.d.ts +1 -1
  35. package/dist/evaluator.d.ts +1 -1
  36. package/dist/flow.d.ts +1 -3
  37. package/dist/flow.js +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.js +10 -10
  40. package/dist/linter.d.ts +1 -1
  41. package/dist/logger.d.ts +1 -1
  42. package/dist/node.d.ts +1 -1
  43. package/dist/nodes/batch-gather.d.ts +1 -1
  44. package/dist/nodes/batch-scatter.d.ts +1 -1
  45. package/dist/nodes/sleep.d.ts +1 -1
  46. package/dist/nodes/subflow.d.ts +1 -1
  47. package/dist/nodes/subflow.js +2 -2
  48. package/dist/nodes/wait.d.ts +1 -1
  49. package/dist/nodes/webhook.d.ts +1 -1
  50. package/dist/runtime/adapter.d.ts +1 -1
  51. package/dist/runtime/adapter.js +8 -8
  52. package/dist/runtime/execution-context.d.ts +1 -1
  53. package/dist/runtime/executors.d.ts +1 -1
  54. package/dist/runtime/index.d.ts +1 -1
  55. package/dist/runtime/index.js +8 -8
  56. package/dist/runtime/node-executor-factory.d.ts +1 -1
  57. package/dist/runtime/orchestrator.d.ts +1 -1
  58. package/dist/runtime/orchestrator.js +2 -2
  59. package/dist/runtime/orchestrators/replay.d.ts +1 -1
  60. package/dist/runtime/orchestrators/step-by-step.d.ts +1 -1
  61. package/dist/runtime/orchestrators/step-by-step.js +2 -2
  62. package/dist/runtime/orchestrators/utils.d.ts +1 -1
  63. package/dist/runtime/orchestrators/utils.js +1 -1
  64. package/dist/runtime/runtime.d.ts +1 -1
  65. package/dist/runtime/runtime.js +7 -7
  66. package/dist/runtime/scheduler.d.ts +1 -1
  67. package/dist/runtime/state.d.ts +1 -1
  68. package/dist/runtime/traverser.d.ts +1 -1
  69. package/dist/runtime/traverser.js +2 -1
  70. package/dist/runtime/types.d.ts +1 -1
  71. package/dist/runtime/workflow-logic-handler.d.ts +1 -1
  72. package/dist/runtime/workflow-logic-handler.js +1 -1
  73. package/dist/sanitizer.d.ts +1 -1
  74. package/dist/serializer.d.ts +1 -1
  75. package/dist/testing/event-logger.d.ts +1 -1
  76. package/dist/testing/index.d.ts +1 -1
  77. package/dist/testing/index.js +11 -11
  78. package/dist/testing/run-with-trace.d.ts +1 -1
  79. package/dist/testing/run-with-trace.js +9 -9
  80. package/dist/testing/stepper.d.ts +1 -1
  81. package/dist/testing/stepper.js +4 -4
  82. package/dist/{types-CKhffqyb.d.ts → types-Biip2gLh.d.ts} +11 -1
  83. package/dist/types.d.ts +1 -1
  84. package/package.json +59 -59
  85. package/LICENSE +0 -21
  86. package/dist/chunk-AKDL2ZX7.js.map +0 -1
  87. package/dist/chunk-H4JTZYIT.js.map +0 -1
  88. package/dist/chunk-HXSK5P2X.js.map +0 -1
  89. package/dist/chunk-N63S5NEG.js.map +0 -1
  90. package/dist/chunk-WWGFIYKW.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flow.ts"],"names":[],"mappings":";;;AAMA,IAAI,WAAA,GAAc,CAAA;AAClB,SAAS,cAAc,EAAA,EAAwF;AAC9G,EAAA,MAAM,MAAA,GAAS,GAAG,QAAA,EAAS;AAC3B,EAAA,IAAI,IAAA,GAAO,CAAA;AACX,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,MAAA,CAAO,QAAQ,CA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;AAAA,EACzC;AACD;AAKO,SAAS,WAGd,EAAA,EAAkD;AACnD,EAAA,OAAO,IAAI,YAAY,EAAE,CAAA;AAC1B","file":"chunk-X5RJOZY2.js","sourcesContent":["import { isNodeClass } from './node'\nimport type { EdgeDefinition, NodeClass, NodeDefinition, NodeFunction, UIGraph, WorkflowBlueprint } from './types'\n\n/**\n * Generates a deterministic hash for a function based on its source code and a unique counter.\n */\nlet hashCounter = 0\nfunction _hashFunction(fn: NodeFunction<any, any, any, any, any> | NodeClass<any, any, any, any, any>): string {\n\tconst source = fn.toString()\n\tlet hash = 0\n\tfor (let i = 0; i < source.length; i++) {\n\t\tconst char = source.charCodeAt(i)\n\t\thash = (hash << 5) - hash + char\n\t\thash = hash & hash // Convert to 32-bit integer\n\t}\n\t// Add counter to ensure uniqueness even for identical functions\n\treturn (Math.abs(hash) + hashCounter++).toString(16)\n}\n\n/**\n * A fluent API for programmatically constructing a WorkflowBlueprint.\n */\nexport class FlowBuilder<\n\tTContext extends Record<string, any> = Record<string, any>,\n\tTDependencies extends Record<string, any> = Record<string, any>,\n> {\n\tprivate blueprint: Partial<WorkflowBlueprint>\n\tprivate functionRegistry: Map<string, NodeFunction | NodeClass>\n\tprivate loopDefinitions: Array<{\n\t\tid: string\n\t\tstartNodeId: string\n\t\tendNodeId: string\n\t\tcondition: string\n\t}>\n\tprivate batchDefinitions: Array<{\n\t\tid: string\n\t\tscatterId: string\n\t\tgatherId: string\n\t}>\n\tprivate cycleEntryPoints: Map<string, string>\n\n\tconstructor(id: string) {\n\t\tthis.blueprint = { id, nodes: [], edges: [] }\n\t\tthis.functionRegistry = new Map()\n\t\tthis.loopDefinitions = []\n\t\tthis.batchDefinitions = []\n\t\tthis.cycleEntryPoints = new Map()\n\t}\n\n\tnode<TInput = any, TOutput = any, TAction extends string = string>(\n\t\tid: string,\n\t\timplementation:\n\t\t\t| NodeFunction<TContext, TDependencies, TInput, TOutput, TAction>\n\t\t\t| NodeClass<TContext, TDependencies, TInput, TOutput, TAction>,\n\t\toptions?: Omit<NodeDefinition, 'id' | 'uses'>,\n\t): this {\n\t\tlet usesKey: string\n\n\t\tif (isNodeClass(implementation)) {\n\t\t\tusesKey =\n\t\t\t\timplementation.name && implementation.name !== 'BaseNode'\n\t\t\t\t\t? implementation.name\n\t\t\t\t\t: `class_${_hashFunction(implementation)}`\n\t\t\tthis.functionRegistry.set(usesKey, implementation)\n\t\t} else {\n\t\t\tusesKey = `fn_${_hashFunction(implementation)}`\n\t\t\tthis.functionRegistry.set(usesKey, implementation as unknown as NodeFunction)\n\t\t}\n\n\t\tconst nodeDef: NodeDefinition = { id, uses: usesKey, ...options }\n\t\tthis.blueprint.nodes?.push(nodeDef)\n\t\treturn this\n\t}\n\n\tedge(source: string, target: string, options?: Omit<EdgeDefinition, 'source' | 'target'>): this {\n\t\tconst edgeDef: EdgeDefinition = { source, target, ...options }\n\t\tthis.blueprint.edges?.push(edgeDef)\n\t\treturn this\n\t}\n\n\t/**\n\t * Creates a batch processing pattern.\n\t * It takes an input array, runs a worker node on each item in parallel, and gathers the results.\n\t * This method augments the Flow's TContext with a new key for the output array.\n\t *\n\t * @param id The base ID for this batch operation.\n\t * @param worker The node implementation to run on each item.\n\t * @param options Configuration for the batch operation.\n\t * @returns The Flow instance with an updated context type for chaining.\n\t */\n\tbatch<TWorkerInput, TWorkerOutput, TWorkerAction extends string, TOutputKey extends string>(\n\t\tid: string,\n\t\tworker:\n\t\t\t| NodeFunction<TContext, TDependencies, TWorkerInput, TWorkerOutput, TWorkerAction>\n\t\t\t| NodeClass<TContext, TDependencies, TWorkerInput, TWorkerOutput, TWorkerAction>,\n\t\toptions: {\n\t\t\t/** The key in the context that holds the input array for the batch. */\n\t\t\tinputKey: keyof TContext\n\t\t\t/** The key in the context where the array of results will be stored. */\n\t\t\toutputKey: TOutputKey\n\t\t\t/** The number of items to process in each chunk to limit memory usage. */\n\t\t\tchunkSize?: number\n\t\t},\n\t): FlowBuilder<TContext & { [K in TOutputKey]: TWorkerOutput[] }, TDependencies> {\n\t\tconst { inputKey, outputKey } = options\n\t\tconst scatterId = `${id}_scatter`\n\t\tconst gatherId = `${id}_gather`\n\n\t\tthis.batchDefinitions.push({ id, scatterId, gatherId })\n\n\t\tlet workerUsesKey: string\n\t\tif (isNodeClass(worker)) {\n\t\t\tworkerUsesKey =\n\t\t\t\tworker.name && worker.name !== 'BaseNode' ? worker.name : `class_batch_worker_${_hashFunction(worker)}`\n\t\t\tthis.functionRegistry.set(workerUsesKey, worker)\n\t\t} else {\n\t\t\tworkerUsesKey = `fn_batch_worker_${_hashFunction(worker)}`\n\t\t\tthis.functionRegistry.set(workerUsesKey, worker as unknown as NodeFunction)\n\t\t}\n\n\t\tthis.blueprint.nodes?.push({\n\t\t\tid: scatterId,\n\t\t\tuses: 'batch-scatter',\n\t\t\tinputs: inputKey as string,\n\t\t\tparams: { workerUsesKey, outputKey: outputKey as string, gatherNodeId: gatherId, chunkSize: options.chunkSize },\n\t\t})\n\n\t\tthis.blueprint.nodes?.push({\n\t\t\tid: gatherId,\n\t\t\tuses: 'batch-gather',\n\t\t\tparams: { outputKey, gatherNodeId: gatherId },\n\t\t\tconfig: { joinStrategy: 'all' },\n\t\t})\n\n\t\tthis.edge(scatterId, gatherId)\n\n\t\treturn this as unknown as FlowBuilder<TContext & { [K in TOutputKey]: TWorkerOutput[] }, TDependencies>\n\t}\n\n\t/**\n\t * Creates a sleep node that pauses workflow execution for a specified duration.\n\t * @param id A unique identifier for the sleep node.\n\t * @param options Configuration for the sleep duration.\n\t */\n\tsleep(\n\t\tid: string,\n\t\toptions: {\n\t\t\t/** The duration to sleep in milliseconds or a string like '5s', '1m', '2h', '1d'. */\n\t\t\tduration: number | string\n\t\t},\n\t): this {\n\t\tconst nodeDef: NodeDefinition = {\n\t\t\tid,\n\t\t\tuses: 'sleep',\n\t\t\tparams: { duration: options.duration },\n\t\t}\n\t\tthis.blueprint.nodes?.push(nodeDef)\n\t\treturn this\n\t}\n\n\t/**\n\t * Creates a wait node that pauses workflow execution for external input.\n\t * @param id A unique identifier for the wait node.\n\t * @param options Optional configuration for the wait node.\n\t */\n\twait(id: string, options?: Omit<NodeDefinition, 'id' | 'uses'>): this {\n\t\tconst nodeDef: NodeDefinition = { id, uses: 'wait', ...options }\n\t\tthis.blueprint.nodes?.push(nodeDef)\n\t\treturn this\n\t}\n\n\t/**\n\t * Creates a loop pattern in the workflow graph.\n\t * @param id A unique identifier for the loop construct.\n\t * @param options Defines the start, end, and continuation condition of the loop.\n\t * @param options.startNodeId The ID of the first node inside the loop body.\n\t * @param options.endNodeId The ID of the last node inside the loop body.\n\t * @param options.condition An expression that, if true, causes the loop to run again.\n\t */\n\tloop(\n\t\tid: string,\n\t\toptions: {\n\t\t\t/** The ID of the first node inside the loop body. */\n\t\t\tstartNodeId: string\n\t\t\t/** The ID of the last node inside the loop body. */\n\t\t\tendNodeId: string\n\t\t\t/** An expression that, if true, causes the loop to run again. */\n\t\t\tcondition: string\n\t\t},\n\t): this {\n\t\tconst { startNodeId, endNodeId, condition } = options\n\t\tthis.loopDefinitions.push({ id, startNodeId, endNodeId, condition })\n\n\t\tthis.blueprint.nodes?.push({\n\t\t\tid,\n\t\t\tuses: 'loop-controller',\n\t\t\tparams: { condition },\n\t\t\tconfig: { joinStrategy: 'any' },\n\t\t})\n\n\t\tthis.edge(endNodeId, id)\n\t\tthis.edge(id, startNodeId, {\n\t\t\taction: 'continue',\n\t\t\ttransform: `context.${endNodeId}`,\n\t\t})\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Sets the preferred entry point for a cycle in non-DAG workflows.\n\t * This helps remove ambiguity when the runtime needs to choose a starting node for cycles.\n\t * @param nodeId The ID of the node to use as the entry point for cycles containing this node.\n\t */\n\tsetCycleEntryPoint(nodeId: string): this {\n\t\tthis.cycleEntryPoints.set(nodeId, nodeId)\n\t\treturn this\n\t}\n\n\ttoBlueprint(): WorkflowBlueprint {\n\t\tif (!this.blueprint.nodes || this.blueprint.nodes.length === 0) {\n\t\t\tthrow new Error('Cannot build a blueprint with no nodes.')\n\t\t}\n\t\tconst finalEdges: EdgeDefinition[] = []\n\t\tconst processedOriginalEdges = new Set<EdgeDefinition>()\n\t\tconst allOriginalEdges = this.blueprint.edges || []\n\n\t\t// loop edge re-wiring\n\t\tfor (const loopDef of this.loopDefinitions) {\n\t\t\tconst edgesToRewire = allOriginalEdges.filter((e) => e.source === loopDef.id && e.target !== loopDef.startNodeId)\n\t\t\tfor (const edge of edgesToRewire) {\n\t\t\t\tfinalEdges.push({ ...edge, action: edge.action || 'break', transform: `context.${loopDef.endNodeId}` })\n\t\t\t\tprocessedOriginalEdges.add(edge)\n\t\t\t}\n\t\t}\n\n\t\t// batch edge re-wiring\n\t\tfor (const batchDef of this.batchDefinitions) {\n\t\t\tconst incomingEdges = allOriginalEdges.filter((e) => e.target === batchDef.id)\n\t\t\tfor (const edge of incomingEdges) {\n\t\t\t\tfinalEdges.push({ ...edge, target: batchDef.scatterId })\n\t\t\t\tprocessedOriginalEdges.add(edge)\n\t\t\t}\n\n\t\t\tconst outgoingEdges = allOriginalEdges.filter((e) => e.source === batchDef.id)\n\t\t\tfor (const edge of outgoingEdges) {\n\t\t\t\tfinalEdges.push({ ...edge, source: batchDef.gatherId })\n\t\t\t\tprocessedOriginalEdges.add(edge)\n\t\t\t}\n\t\t}\n\n\t\t// all remaining edges\n\t\tfor (const edge of allOriginalEdges) {\n\t\t\tif (!processedOriginalEdges.has(edge)) {\n\t\t\t\tfinalEdges.push(edge)\n\t\t\t}\n\t\t}\n\t\tthis.blueprint.edges = finalEdges\n\n\t\tfor (const loopDef of this.loopDefinitions) {\n\t\t\tconst startNode = this.blueprint.nodes?.find((n) => n.id === loopDef.startNodeId)\n\t\t\tconst endNode = this.blueprint.nodes?.find((n) => n.id === loopDef.endNodeId)\n\n\t\t\tif (!startNode) {\n\t\t\t\tthrow new Error(`Loop '${loopDef.id}' references non-existent start node '${loopDef.startNodeId}'.`)\n\t\t\t}\n\t\t\tif (!endNode) {\n\t\t\t\tthrow new Error(`Loop '${loopDef.id}' references non-existent end node '${loopDef.endNodeId}'.`)\n\t\t\t}\n\t\t}\n\n\t\tif (this.cycleEntryPoints.size > 0) {\n\t\t\tthis.blueprint.metadata = {\n\t\t\t\t...this.blueprint.metadata,\n\t\t\t\tcycleEntryPoints: Array.from(this.cycleEntryPoints.keys()),\n\t\t\t}\n\t\t}\n\n\t\treturn this.blueprint as WorkflowBlueprint\n\t}\n\n\tgetFunctionRegistry() {\n\t\treturn this.functionRegistry\n\t}\n\n\ttoGraphRepresentation(): UIGraph {\n\t\tconst blueprint = this.toBlueprint()\n\t\tconst uiNodes: UIGraph['nodes'] = []\n\t\tconst uiEdges: UIGraph['edges'] = []\n\n\t\tconst ignoredNodeIds = new Set<string>()\n\n\t\t// replace loop-controllers with direct, cyclical edges\n\t\tfor (const loopDef of this.loopDefinitions) {\n\t\t\tconst id = loopDef.id\n\t\t\tignoredNodeIds.add(id)\n\n\t\t\t// direct edge from the end of loop to start\n\t\t\tuiEdges.push({\n\t\t\t\tsource: loopDef.endNodeId,\n\t\t\t\ttarget: loopDef.startNodeId,\n\t\t\t\tdata: {\n\t\t\t\t\tisLoopback: true,\n\t\t\t\t\tcondition: loopDef.condition,\n\t\t\t\t\tlabel: `continue if: ${loopDef.condition}`,\n\t\t\t\t},\n\t\t\t})\n\n\t\t\t// re-wire any 'break' edges\n\t\t\tconst breakEdges = blueprint.edges.filter((edge) => edge.source === id && edge.action === 'break')\n\t\t\tfor (const breakEdge of breakEdges) {\n\t\t\t\tuiEdges.push({\n\t\t\t\t\t...breakEdge,\n\t\t\t\t\tsource: loopDef.endNodeId,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// re-wire any 'incoming' edges\n\t\t\tconst incomingEdges = blueprint.edges.filter((edge) => edge.target === id && edge.source !== loopDef.endNodeId)\n\t\t\tfor (const incomingEdge of incomingEdges) {\n\t\t\t\tuiEdges.push({\n\t\t\t\t\t...incomingEdge,\n\t\t\t\t\tsource: loopDef.startNodeId,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// replace scatter/gather pairs with a single representative worker node\n\t\tconst scatterNodes = blueprint.nodes.filter((n) => n.uses === 'batch-scatter')\n\t\tfor (const scatterNode of scatterNodes) {\n\t\t\tconst gatherNodeId = scatterNode.params?.gatherNodeId\n\t\t\tif (!gatherNodeId) continue\n\n\t\t\tignoredNodeIds.add(scatterNode.id)\n\t\t\tignoredNodeIds.add(gatherNodeId)\n\n\t\t\t// single node to represent parallel work\n\t\t\tconst batchId = scatterNode.id.replace('_scatter', '')\n\t\t\tconst gatherNode = blueprint.nodes.find((n) => n.id === gatherNodeId)\n\n\t\t\tuiNodes.push({\n\t\t\t\tid: batchId,\n\t\t\t\tuses: scatterNode.params?.workerUsesKey,\n\t\t\t\ttype: 'batch-worker',\n\t\t\t\tdata: {\n\t\t\t\t\tlabel: `Batch: ${batchId}`,\n\t\t\t\t\tisBatchPlaceholder: true,\n\t\t\t\t\tworkerUsesKey: scatterNode.params?.workerUsesKey,\n\t\t\t\t\tinputKey: scatterNode.inputs,\n\t\t\t\t\toutputKey: gatherNode?.params?.outputKey,\n\t\t\t\t},\n\t\t\t})\n\n\t\t\t// re-wire incoming edges\n\t\t\tconst incomingEdges = blueprint.edges.filter((e) => e.target === scatterNode.id)\n\t\t\tfor (const edge of incomingEdges) {\n\t\t\t\tuiEdges.push({ ...edge, target: batchId })\n\t\t\t}\n\n\t\t\t// re-wire outgoing edges\n\t\t\tconst outgoingEdges = blueprint.edges.filter((e) => e.source === gatherNodeId)\n\t\t\tfor (const edge of outgoingEdges) {\n\t\t\t\tuiEdges.push({ ...edge, source: batchId })\n\t\t\t}\n\t\t}\n\n\t\tfor (const node of blueprint.nodes) {\n\t\t\tif (!ignoredNodeIds.has(node.id)) {\n\t\t\t\tuiNodes.push(node)\n\t\t\t}\n\t\t}\n\n\t\tfor (const edge of blueprint.edges) {\n\t\t\tif (!ignoredNodeIds.has(edge.source) && !ignoredNodeIds.has(edge.target)) {\n\t\t\t\tconst alreadyAdded = uiEdges.some(\n\t\t\t\t\t(e) => e.source === edge.source && e.target === edge.target && e.action === edge.action,\n\t\t\t\t)\n\t\t\t\tif (!alreadyAdded) {\n\t\t\t\t\tuiEdges.push(edge)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { nodes: uiNodes, edges: uiEdges }\n\t}\n}\n\n/**\n * Helper function to create a new Flow builder instance.\n */\nexport function createFlow<\n\tTContext extends Record<string, any> = Record<string, any>,\n\tTDependencies extends Record<string, any> = Record<string, any>,\n>(id: string): FlowBuilder<TContext, TDependencies> {\n\treturn new FlowBuilder(id)\n}\n"]}
@@ -1,21 +1,31 @@
1
1
  import { analyzeBlueprint } from './chunk-ZLW4QOTS.js';
2
+ import { FlowcraftError } from './chunk-BCRWXTWX.js';
2
3
 
3
4
  // src/runtime/traverser.ts
4
5
  var GraphTraverser = class _GraphTraverser {
5
6
  frontier = /* @__PURE__ */ new Set();
6
7
  allPredecessors;
8
+ allSuccessors;
7
9
  dynamicBlueprint;
8
10
  completedNodes = /* @__PURE__ */ new Set();
11
+ nodesInLoops;
9
12
  constructor(blueprint, isStrictMode = false) {
10
13
  this.dynamicBlueprint = structuredClone(blueprint);
11
14
  this.allPredecessors = /* @__PURE__ */ new Map();
15
+ this.allSuccessors = /* @__PURE__ */ new Map();
16
+ this.nodesInLoops = /* @__PURE__ */ new Map();
12
17
  for (const node of this.dynamicBlueprint.nodes) {
13
18
  this.allPredecessors.set(node.id, /* @__PURE__ */ new Set());
19
+ this.allSuccessors.set(node.id, /* @__PURE__ */ new Set());
14
20
  }
15
21
  for (const edge of this.dynamicBlueprint.edges) {
16
- this.allPredecessors.get(edge.target)?.add(edge.source);
22
+ this.getPredecessors(edge.target).add(edge.source);
23
+ }
24
+ for (const edge of this.dynamicBlueprint.edges) {
25
+ this.getSuccessors(edge.source).add(edge.target);
17
26
  }
18
27
  const analysis = analyzeBlueprint(blueprint);
28
+ this.filterNodesInLoops(blueprint);
19
29
  this.frontier = new Set(analysis.startNodeIds.filter((id) => !this.isFallbackNode(id)));
20
30
  if (this.frontier.size === 0 && analysis.cycles.length > 0 && !isStrictMode) {
21
31
  const uniqueStartNodes = /* @__PURE__ */ new Set();
@@ -50,7 +60,7 @@ var GraphTraverser = class _GraphTraverser {
50
60
  for (const node of traverser.dynamicBlueprint.nodes) {
51
61
  if (traverser.completedNodes.has(node.id)) continue;
52
62
  const requiredPredecessors = traverser.allPredecessors.get(node.id);
53
- const joinStrategy = traverser.getEffectiveJoinStrategy(node.id);
63
+ const joinStrategy = traverser.getJoinStrategy(node.id);
54
64
  if (!requiredPredecessors || requiredPredecessors.size === 0) {
55
65
  traverser.frontier.add(node.id);
56
66
  continue;
@@ -64,23 +74,36 @@ var GraphTraverser = class _GraphTraverser {
64
74
  isFallbackNode(nodeId) {
65
75
  return this.dynamicBlueprint.nodes.some((n) => n.config?.fallback === nodeId);
66
76
  }
67
- getEffectiveJoinStrategy(nodeId) {
77
+ getJoinStrategy(nodeId) {
68
78
  const node = this.dynamicBlueprint.nodes.find((n) => n.id === nodeId);
69
79
  const baseJoinStrategy = node?.config?.joinStrategy || "all";
70
- if (node?.uses === "loop-controller") {
71
- return "any";
72
- }
73
- const predecessors = this.allPredecessors.get(nodeId);
74
- if (predecessors) {
75
- for (const predecessorId of predecessors) {
76
- const predecessorNode = this.dynamicBlueprint.nodes.find((n) => n.id === predecessorId);
77
- if (predecessorNode?.uses === "loop-controller") {
78
- return "any";
79
- }
80
- }
81
- }
82
80
  return baseJoinStrategy;
83
81
  }
82
+ filterNodesInLoops(blueprint) {
83
+ blueprint.nodes.forEach((node) => {
84
+ if (node.uses !== "loop-controller") return;
85
+ const nextInLoopId = blueprint.edges.find((e) => e.source === node.id && e.action === "continue")?.target;
86
+ if (!nextInLoopId) {
87
+ throw new FlowcraftError(
88
+ `Loop '${node.id}' has no continue edge to start node. Ensure edges are wired inside the loop and incoming/breaking edges point to the loop controller.`,
89
+ { nodeId: node.id, blueprintId: blueprint.id }
90
+ );
91
+ }
92
+ const set = /* @__PURE__ */ new Set();
93
+ set.add(nextInLoopId);
94
+ this.nodesInLoops.set(node.id, this.getAllLoopSuccessors(nextInLoopId, blueprint, set));
95
+ });
96
+ }
97
+ getAllLoopSuccessors(nodeId, blueprint, set) {
98
+ this.getSuccessors(nodeId).forEach((successor) => {
99
+ if (set.has(successor)) return;
100
+ const node = this.getNode(successor, blueprint);
101
+ if (!node || node.uses === "loop-controller") return;
102
+ set.add(successor);
103
+ this.getAllLoopSuccessors(successor, blueprint, set);
104
+ });
105
+ return set;
106
+ }
84
107
  getReadyNodes() {
85
108
  const readyNodes = [];
86
109
  for (const nodeId of this.frontier) {
@@ -103,28 +126,39 @@ var GraphTraverser = class _GraphTraverser {
103
126
  this.dynamicBlueprint.nodes.push(dynamicNode);
104
127
  this.allPredecessors.set(dynamicNode.id, /* @__PURE__ */ new Set([nodeId]));
105
128
  if (gatherNodeId) {
106
- this.allPredecessors.get(gatherNodeId)?.add(dynamicNode.id);
129
+ this.getPredecessors(gatherNodeId).add(dynamicNode.id);
107
130
  }
108
131
  this.frontier.add(dynamicNode.id);
109
132
  }
110
133
  }
111
134
  for (const node of nextNodes) {
112
- const joinStrategy = this.getEffectiveJoinStrategy(node.id);
135
+ const joinStrategy = this.getJoinStrategy(node.id);
113
136
  if (joinStrategy !== "any" && this.completedNodes.has(node.id)) continue;
114
- const requiredPredecessors = this.allPredecessors.get(node.id);
115
- if (!requiredPredecessors) continue;
137
+ const requiredPredecessors = this.getPredecessors(node.id);
116
138
  const isReady = joinStrategy === "any" ? requiredPredecessors.has(nodeId) : [...requiredPredecessors].every((p) => this.completedNodes.has(p));
117
139
  if (isReady) {
118
140
  this.frontier.add(node.id);
141
+ if (node.uses === "loop-controller") {
142
+ this.getNodesInLoop(node.id).forEach((id) => {
143
+ this.resetNodeCompletion(id);
144
+ });
145
+ }
119
146
  }
120
147
  }
121
148
  if (nextNodes.length === 0) {
122
149
  for (const [potentialNextId, predecessors] of this.allPredecessors) {
123
150
  if (predecessors.has(nodeId) && !this.completedNodes.has(potentialNextId)) {
124
- const joinStrategy = this.getEffectiveJoinStrategy(potentialNextId);
151
+ const joinStrategy = this.getJoinStrategy(potentialNextId);
125
152
  const isReady = joinStrategy === "any" ? predecessors.has(nodeId) : [...predecessors].every((p) => this.completedNodes.has(p));
126
153
  if (isReady) {
127
154
  this.frontier.add(potentialNextId);
155
+ const node = this.getNode(potentialNextId, this.dynamicBlueprint);
156
+ if (!node) continue;
157
+ if (node.uses === "loop-controller") {
158
+ this.getNodesInLoop(node.id).forEach((id) => {
159
+ this.resetNodeCompletion(id);
160
+ });
161
+ }
128
162
  }
129
163
  }
130
164
  }
@@ -149,6 +183,30 @@ var GraphTraverser = class _GraphTraverser {
149
183
  getAllPredecessors() {
150
184
  return this.allPredecessors;
151
185
  }
186
+ getAllSuccessors() {
187
+ return this.allSuccessors;
188
+ }
189
+ getPredecessors(nodeId) {
190
+ const predecessors = this.allPredecessors.get(nodeId);
191
+ if (!predecessors) return /* @__PURE__ */ new Set();
192
+ return predecessors;
193
+ }
194
+ getSuccessors(nodeId) {
195
+ const successors = this.allSuccessors.get(nodeId);
196
+ if (!successors) return /* @__PURE__ */ new Set();
197
+ return successors;
198
+ }
199
+ getNodesInLoop(id) {
200
+ const loopNodes = this.nodesInLoops.get(id);
201
+ if (!loopNodes) return /* @__PURE__ */ new Set();
202
+ return loopNodes;
203
+ }
204
+ resetNodeCompletion(nodeId) {
205
+ this.completedNodes.delete(nodeId);
206
+ }
207
+ getNode(nodeId, blueprint) {
208
+ return blueprint.nodes.find((n) => n.id === nodeId);
209
+ }
152
210
  addDynamicNode(_nodeId, dynamicNode, predecessorId, gatherNodeId) {
153
211
  this.dynamicBlueprint.nodes.push(dynamicNode);
154
212
  this.allPredecessors.set(dynamicNode.id, /* @__PURE__ */ new Set([predecessorId]));
@@ -168,5 +226,5 @@ var GraphTraverser = class _GraphTraverser {
168
226
  };
169
227
 
170
228
  export { GraphTraverser };
171
- //# sourceMappingURL=chunk-H4JTZYIT.js.map
172
- //# sourceMappingURL=chunk-H4JTZYIT.js.map
229
+ //# sourceMappingURL=chunk-ZKINHLMS.js.map
230
+ //# sourceMappingURL=chunk-ZKINHLMS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/runtime/traverser.ts"],"names":[],"mappings":";;;;AAUO,IAAM,cAAA,GAAN,MAAM,eAAA,CAAe;AAAA,EACnB,QAAA,uBAAe,GAAA,EAAY;AAAA,EAC3B,eAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA,uBAAqB,GAAA,EAAY;AAAA,EACjC,YAAA;AAAA,EAER,WAAA,CAAY,SAAA,EAA8B,YAAA,GAAwB,KAAA,EAAO;AACxE,IAAA,IAAA,CAAK,gBAAA,GAAmB,gBAAgB,SAAS,CAAA;AACjD,IAAA,IAAA,CAAK,eAAA,uBAAsB,GAAA,EAAyB;AACpD,IAAA,IAAA,CAAK,aAAA,uBAAoB,GAAA,EAAyB;AAClD,IAAA,IAAA,CAAK,YAAA,uBAAmB,GAAA,EAAyB;AACjD,IAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,gBAAA,CAAiB,KAAA,EAAO;AAC/C,MAAA,IAAA,CAAK,gBAAgB,GAAA,CAAI,IAAA,CAAK,EAAA,kBAAI,IAAI,KAAK,CAAA;AAC3C,MAAA,IAAA,CAAK,cAAc,GAAA,CAAI,IAAA,CAAK,EAAA,kBAAI,IAAI,KAAK,CAAA;AAAA,IAC1C;AACA,IAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,gBAAA,CAAiB,KAAA,EAAO;AAC/C,MAAA,IAAA,CAAK,gBAAgB,IAAA,CAAK,MAAM,CAAA,CAAE,GAAA,CAAI,KAAK,MAAM,CAAA;AAAA,IAClD;AACA,IAAA,KAAA,MAAW,IAAA,IAAQ,IAAA,CAAK,gBAAA,CAAiB,KAAA,EAAO;AAC/C,MAAA,IAA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R;AAAA,EAEA,oBAAoB,MAAA,EAAsB;AACzC,IAAA,IAAA,CAAK,cAAA,CAAe,OAAO,MAAM,CAAA;AAAA,EAClC;AAAA,EAEA,OAAA,CAAQ,QAAgB,SAAA,EAA0D;AACjF,IAAA,OAAO,UAAU,KAAA,CAAM,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,OAAO,MAAM,CAAA;AAAA,EACnD;AAAA,EAEA,cAAA,CAAe,OAAA,EAAiB,WAAA,EAA6B,aAAA,EAAuB,YAAA,EAA6B;AAChH,IAAA,IAAA,CAAK,gBAAA,CAAiB,KAAA,CAAM,IAAA,CAAK,WAAW,CAAA;AAC5C,IAAA,IAAA,CAAK,eAAA,CAAgB,IAAI,WAAA,CAAY,EAAA,sBAAQ,GAAA,CAAI,CAAC,aAAa,CAAC,CAAC,CAAA;AACjE,IAAA,IAAI,YAAA,EAAc;AACjB,MAAA,IAAA,CAAK,gBAAgB,GAAA,CAAI,YAAY,CAAA,EAAG,GAAA,CAAI,YAAY,EAAE,CAAA;AAAA,IAC3D;AACA,IAAA,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,WAAA,CAAY,EAAE,CAAA;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,cAAc,MAAA,EAAsB;AAC1C,IAAA,IAAA,CAAK,QAAA,CAAS,IAAI,MAAM,CAAA;AAAA,EACzB;AACD","file":"chunk-ZKINHLMS.js","sourcesContent":["import { analyzeBlueprint } from '../analysis'\nimport { FlowcraftError } from '../errors'\nimport type { NodeDefinition, NodeResult, WorkflowBlueprint } from '../types'\nimport type { WorkflowState } from './state'\n\nexport interface ReadyNode {\n\tnodeId: string\n\tnodeDef: NodeDefinition\n}\n\nexport class GraphTraverser {\n\tprivate frontier = new Set<string>()\n\tprivate allPredecessors: Map<string, Set<string>>\n\tprivate allSuccessors: Map<string, Set<string>>\n\tprivate dynamicBlueprint: WorkflowBlueprint\n\tprivate completedNodes = new Set<string>()\n\tprivate nodesInLoops: Map<string, Set<string>>\n\n\tconstructor(blueprint: WorkflowBlueprint, isStrictMode: boolean = false) {\n\t\tthis.dynamicBlueprint = structuredClone(blueprint) as WorkflowBlueprint\n\t\tthis.allPredecessors = new Map<string, Set<string>>()\n\t\tthis.allSuccessors = new Map<string, Set<string>>()\n\t\tthis.nodesInLoops = new Map<string, Set<string>>()\n\t\tfor (const node of this.dynamicBlueprint.nodes) {\n\t\t\tthis.allPredecessors.set(node.id, new Set())\n\t\t\tthis.allSuccessors.set(node.id, new Set())\n\t\t}\n\t\tfor (const edge of this.dynamicBlueprint.edges) {\n\t\t\tthis.getPredecessors(edge.target).add(edge.source)\n\t\t}\n\t\tfor (const edge of this.dynamicBlueprint.edges) {\n\t\t\tthis.getSuccessors(edge.source).add(edge.target)\n\t\t}\n\t\tconst analysis = analyzeBlueprint(blueprint)\n\t\tthis.filterNodesInLoops(blueprint)\n\t\tthis.frontier = new Set(analysis.startNodeIds.filter((id) => !this.isFallbackNode(id)))\n\t\tif (this.frontier.size === 0 && analysis.cycles.length > 0 && !isStrictMode) {\n\t\t\tconst uniqueStartNodes = new Set<string>()\n\t\t\tconst cycleEntryPoints = new Set(blueprint.metadata?.cycleEntryPoints || [])\n\t\t\tfor (const cycle of analysis.cycles) {\n\t\t\t\tif (cycle.length > 0) {\n\t\t\t\t\tconst entryPoint = cycle.find((node) => cycleEntryPoints.has(node))\n\t\t\t\t\tuniqueStartNodes.add(entryPoint || cycle[0])\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.frontier = new Set(uniqueStartNodes)\n\t\t}\n\t}\n\n\t/**\n\t * Clears all nodes from the execution frontier.\n\t */\n\tpublic clearFrontier(): void {\n\t\tthis.frontier.clear()\n\t}\n\n\t/**\n\t * Creates and initializes a GraphTraverser from a saved workflow state.\n\t * This is the correct way to prepare a traverser for a `resume` operation.\n\t * @param blueprint The workflow blueprint.\n\t * @param state The workflow state being resumed.\n\t * @returns A configured GraphTraverser instance.\n\t */\n\tpublic static fromState(blueprint: WorkflowBlueprint, state: WorkflowState<any>): GraphTraverser {\n\t\tconst traverser = new GraphTraverser(blueprint)\n\n\t\t// clear auto-populated frontier from constructor\n\t\ttraverser.clearFrontier()\n\n\t\t// re-hydrate the set of completed nodes\n\t\tconst completedNodes = state.getCompletedNodes()\n\t\ttraverser.completedNodes = new Set(completedNodes)\n\n\t\tfor (const node of traverser.dynamicBlueprint.nodes) {\n\t\t\tif (traverser.completedNodes.has(node.id)) continue\n\n\t\t\tconst requiredPredecessors = traverser.allPredecessors.get(node.id)\n\t\t\tconst joinStrategy = traverser.getJoinStrategy(node.id)\n\n\t\t\t// if no predecessors and not completed, it's a start node and should be in the frontier\n\t\t\tif (!requiredPredecessors || requiredPredecessors.size === 0) {\n\t\t\t\ttraverser.frontier.add(node.id)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst completedPredecessors = [...requiredPredecessors].filter((p) => traverser.completedNodes.has(p))\n\t\t\tconst isReady =\n\t\t\t\tjoinStrategy === 'any'\n\t\t\t\t\t? completedPredecessors.length > 0\n\t\t\t\t\t: completedPredecessors.length === requiredPredecessors.size\n\n\t\t\tif (isReady) traverser.frontier.add(node.id)\n\t\t}\n\n\t\treturn traverser\n\t}\n\n\tprivate isFallbackNode(nodeId: string): boolean {\n\t\treturn this.dynamicBlueprint.nodes.some((n) => n.config?.fallback === nodeId)\n\t}\n\n\tprivate getJoinStrategy(nodeId: string): 'any' | 'all' {\n\t\tconst node = this.dynamicBlueprint.nodes.find((n) => n.id === nodeId)\n\t\tconst baseJoinStrategy = node?.config?.joinStrategy || 'all'\n\t\treturn baseJoinStrategy\n\t}\n\n\tprivate filterNodesInLoops(blueprint: WorkflowBlueprint): void {\n\t\tblueprint.nodes.forEach((node) => {\n\t\t\tif (node.uses !== 'loop-controller') return\n\n\t\t\tconst nextInLoopId = blueprint.edges.find((e) => e.source === node.id && e.action === 'continue')?.target\n\t\t\tif (!nextInLoopId) {\n\t\t\t\tthrow new FlowcraftError(\n\t\t\t\t\t`Loop '${node.id}' has no continue edge to start node. ` +\n\t\t\t\t\t\t`Ensure edges are wired inside the loop and incoming/breaking edges point to the loop controller.`,\n\t\t\t\t\t{ nodeId: node.id, blueprintId: blueprint.id },\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tconst set: Set<string> = new Set()\n\t\t\tset.add(nextInLoopId)\n\t\t\tthis.nodesInLoops.set(node.id, this.getAllLoopSuccessors(nextInLoopId, blueprint, set))\n\t\t})\n\t}\n\n\tprivate getAllLoopSuccessors(nodeId: string, blueprint: WorkflowBlueprint, set: Set<string>): Set<string> {\n\t\tthis.getSuccessors(nodeId).forEach((successor) => {\n\t\t\tif (set.has(successor)) return\n\t\t\tconst node = this.getNode(successor, blueprint)\n\t\t\tif (!node || node.uses === 'loop-controller') return\n\t\t\tset.add(successor)\n\t\t\tthis.getAllLoopSuccessors(successor, blueprint, set)\n\t\t})\n\t\treturn set\n\t}\n\n\tgetReadyNodes(): ReadyNode[] {\n\t\tconst readyNodes: ReadyNode[] = []\n\t\tfor (const nodeId of this.frontier) {\n\t\t\tconst nodeDef = this.dynamicBlueprint.nodes.find((n) => n.id === nodeId)\n\t\t\tif (nodeDef) {\n\t\t\t\treadyNodes.push({ nodeId, nodeDef })\n\t\t\t}\n\t\t}\n\t\tthis.frontier.clear()\n\t\treturn readyNodes\n\t}\n\n\thasMoreWork(): boolean {\n\t\treturn this.frontier.size > 0\n\t}\n\n\tmarkNodeCompleted(nodeId: string, result: NodeResult<any, any>, nextNodes: NodeDefinition[]): void {\n\t\tthis.completedNodes.add(nodeId)\n\n\t\tif (result?.dynamicNodes && result.dynamicNodes.length > 0) {\n\t\t\tconst gatherNodeId = result.output?.gatherNodeId\n\t\t\tfor (const dynamicNode of result.dynamicNodes) {\n\t\t\t\tthis.dynamicBlueprint.nodes.push(dynamicNode)\n\t\t\t\tthis.allPredecessors.set(dynamicNode.id, new Set([nodeId]))\n\t\t\t\tif (gatherNodeId) {\n\t\t\t\t\tthis.getPredecessors(gatherNodeId).add(dynamicNode.id)\n\t\t\t\t}\n\t\t\t\tthis.frontier.add(dynamicNode.id)\n\t\t\t}\n\t\t}\n\n\t\tfor (const node of nextNodes) {\n\t\t\tconst joinStrategy = this.getJoinStrategy(node.id)\n\t\t\tif (joinStrategy !== 'any' && this.completedNodes.has(node.id)) continue\n\n\t\t\tconst requiredPredecessors = this.getPredecessors(node.id)\n\n\t\t\tconst isReady =\n\t\t\t\tjoinStrategy === 'any'\n\t\t\t\t\t? requiredPredecessors.has(nodeId)\n\t\t\t\t\t: [...requiredPredecessors].every((p) => this.completedNodes.has(p))\n\n\t\t\tif (isReady) {\n\t\t\t\tthis.frontier.add(node.id)\n\t\t\t\t// reset to uncompleted for all nodes in a loop\n\t\t\t\tif (node.uses === 'loop-controller') {\n\t\t\t\t\tthis.getNodesInLoop(node.id).forEach((id) => {\n\t\t\t\t\t\tthis.resetNodeCompletion(id)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (nextNodes.length === 0) {\n\t\t\tfor (const [potentialNextId, predecessors] of this.allPredecessors) {\n\t\t\t\tif (predecessors.has(nodeId) && !this.completedNodes.has(potentialNextId)) {\n\t\t\t\t\tconst joinStrategy = this.getJoinStrategy(potentialNextId)\n\t\t\t\t\tconst isReady =\n\t\t\t\t\t\tjoinStrategy === 'any'\n\t\t\t\t\t\t\t? predecessors.has(nodeId)\n\t\t\t\t\t\t\t: [...predecessors].every((p) => this.completedNodes.has(p))\n\t\t\t\t\tif (isReady) {\n\t\t\t\t\t\tthis.frontier.add(potentialNextId)\n\t\t\t\t\t\tconst node = this.getNode(potentialNextId, this.dynamicBlueprint)\n\t\t\t\t\t\tif (!node) continue\n\t\t\t\t\t\t// reset to uncompleted for all nodes in a loop\n\t\t\t\t\t\tif (node.uses === 'loop-controller') {\n\t\t\t\t\t\t\tthis.getNodesInLoop(node.id).forEach((id) => {\n\t\t\t\t\t\t\t\tthis.resetNodeCompletion(id)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tgetAllNodeIds(): Set<string> {\n\t\treturn new Set(this.dynamicBlueprint.nodes.map((n) => n.id))\n\t}\n\n\tgetFallbackNodeIds(): Set<string> {\n\t\tconst fallbackNodeIds = new Set<string>()\n\t\tfor (const node of this.dynamicBlueprint.nodes) {\n\t\t\tif (node.config?.fallback) fallbackNodeIds.add(node.config.fallback)\n\t\t}\n\t\treturn fallbackNodeIds\n\t}\n\n\tgetCompletedNodes(): Set<string> {\n\t\treturn new Set(this.completedNodes)\n\t}\n\n\tgetDynamicBlueprint(): WorkflowBlueprint {\n\t\treturn this.dynamicBlueprint\n\t}\n\n\tgetAllPredecessors(): Map<string, Set<string>> {\n\t\treturn this.allPredecessors\n\t}\n\n\tgetAllSuccessors(): Map<string, Set<string>> {\n\t\treturn this.allSuccessors\n\t}\n\n\tgetPredecessors(nodeId: string): Set<string> {\n\t\tconst predecessors = this.allPredecessors.get(nodeId)\n\t\tif (!predecessors) return new Set()\n\t\treturn predecessors\n\t}\n\n\tgetSuccessors(nodeId: string): Set<string> {\n\t\tconst successors = this.allSuccessors.get(nodeId)\n\t\tif (!successors) return new Set()\n\t\treturn successors\n\t}\n\n\tgetNodesInLoop(id: string): Set<string> {\n\t\tconst loopNodes = this.nodesInLoops.get(id)\n\t\tif (!loopNodes) return new Set()\n\t\treturn loopNodes\n\t}\n\n\tresetNodeCompletion(nodeId: string): void {\n\t\tthis.completedNodes.delete(nodeId)\n\t}\n\n\tgetNode(nodeId: string, blueprint: WorkflowBlueprint): NodeDefinition | undefined {\n\t\treturn blueprint.nodes.find((n) => n.id === nodeId)\n\t}\n\n\taddDynamicNode(_nodeId: string, dynamicNode: NodeDefinition, predecessorId: string, gatherNodeId?: string): void {\n\t\tthis.dynamicBlueprint.nodes.push(dynamicNode)\n\t\tthis.allPredecessors.set(dynamicNode.id, new Set([predecessorId]))\n\t\tif (gatherNodeId) {\n\t\t\tthis.allPredecessors.get(gatherNodeId)?.add(dynamicNode.id)\n\t\t}\n\t\tthis.frontier.add(dynamicNode.id)\n\t}\n\n\t/**\n\t * Manually adds a node ID back to the execution frontier.\n\t * Used by orchestrators that need fine-grained control over steps.\n\t * @param nodeId The ID of the node to add to the frontier.\n\t */\n\tpublic addToFrontier(nodeId: string): void {\n\t\tthis.frontier.add(nodeId)\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { DIContainer } from './container.js';
2
- import { v as RuntimeDependencies, y as ILogger, D as ISerializer, x as IEvaluator, A as IEventBus, M as Middleware, o as NodeFunction, p as NodeClass, h as WorkflowBlueprint } from './types-CKhffqyb.js';
2
+ import { v as RuntimeDependencies, y as ILogger, D as ISerializer, x as IEvaluator, A as IEventBus, M as Middleware, o as NodeFunction, p as NodeClass, h as WorkflowBlueprint } from './types-Biip2gLh.js';
3
3
  import './errors.js';
4
4
 
5
5
  interface ContainerOptions<TDependencies extends RuntimeDependencies = RuntimeDependencies> {
@@ -1,11 +1,11 @@
1
- export { createDefaultContainer } from './chunk-7M6FHFHP.js';
2
- import './chunk-DV2CXHOY.js';
3
- import './chunk-N63S5NEG.js';
1
+ export { createDefaultContainer } from './chunk-E6ICIXVR.js';
2
+ import './chunk-QA2WDZPV.js';
3
+ import './chunk-26VTGQAF.js';
4
4
  import './chunk-L3MX5MTA.js';
5
5
  import './chunk-L46TQXCV.js';
6
6
  import './chunk-4PELJWF7.js';
7
7
  import './chunk-6RKHCJUU.js';
8
- import './chunk-WWGFIYKW.js';
8
+ import './chunk-OOJEXFYY.js';
9
9
  import './chunk-ZETQCNEF.js';
10
10
  import './chunk-BCRWXTWX.js';
11
11
  import './chunk-PH2IYZHV.js';
package/dist/container.js CHANGED
@@ -1,3 +1,3 @@
1
- export { DIContainer, ServiceTokens } from './chunk-WWGFIYKW.js';
1
+ export { DIContainer, ServiceTokens } from './chunk-OOJEXFYY.js';
2
2
  //# sourceMappingURL=container.js.map
3
3
  //# sourceMappingURL=container.js.map
package/dist/context.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ISyncContext, u as IAsyncContext, P as PatchOperation } from './types-CKhffqyb.js';
1
+ import { t as ISyncContext, u as IAsyncContext, P as PatchOperation } from './types-Biip2gLh.js';
2
2
  import './errors.js';
3
3
  import './container.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { h as WorkflowBlueprint } from './types-CKhffqyb.js';
1
+ import { h as WorkflowBlueprint } from './types-Biip2gLh.js';
2
2
  import './errors.js';
3
3
  import './container.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { x as IEvaluator } from './types-CKhffqyb.js';
1
+ import { x as IEvaluator } from './types-Biip2gLh.js';
2
2
  import './errors.js';
3
3
  import './container.js';
4
4
 
package/dist/flow.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { o as NodeFunction, p as NodeClass, j as NodeDefinition, k as EdgeDefinition, h as WorkflowBlueprint, U as UIGraph } from './types-CKhffqyb.js';
1
+ import { o as NodeFunction, p as NodeClass, j as NodeDefinition, k as EdgeDefinition, h as WorkflowBlueprint, U as UIGraph } from './types-Biip2gLh.js';
2
2
  import './errors.js';
3
3
  import './container.js';
4
4
 
@@ -8,7 +8,6 @@ import './container.js';
8
8
  declare class FlowBuilder<TContext extends Record<string, any> = Record<string, any>, TDependencies extends Record<string, any> = Record<string, any>> {
9
9
  private blueprint;
10
10
  private functionRegistry;
11
- private loopControllerIds;
12
11
  private loopDefinitions;
13
12
  private batchDefinitions;
14
13
  private cycleEntryPoints;
@@ -66,7 +65,6 @@ declare class FlowBuilder<TContext extends Record<string, any> = Record<string,
66
65
  /** An expression that, if true, causes the loop to run again. */
67
66
  condition: string;
68
67
  }): this;
69
- getLoopControllerId(id: string): string;
70
68
  /**
71
69
  * Sets the preferred entry point for a cycle in non-DAG workflows.
72
70
  * This helps remove ambiguity when the runtime needs to choose a starting node for cycles.
package/dist/flow.js CHANGED
@@ -1,4 +1,4 @@
1
- export { FlowBuilder, createFlow } from './chunk-AKDL2ZX7.js';
1
+ export { FlowBuilder, createFlow } from './chunk-X5RJOZY2.js';
2
2
  import './chunk-LNK7LZER.js';
3
3
  //# sourceMappingURL=flow.js.map
4
4
  //# sourceMappingURL=flow.js.map
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { PropertyEvaluator, UnsafeEvaluator } from './evaluator.js';
9
9
  export { FlowBuilder, createFlow } from './flow.js';
10
10
  export { LinterIssue, LinterIssueCode, LinterResult, lintBlueprint } from './linter.js';
11
11
  export { ConsoleLogger, NullLogger } from './logger.js';
12
- export { B as BaseNode, C as ClassNodeExecutor, s as ContextImplementation, k as EdgeDefinition, e as ExecutionServices, E as ExecutionStrategy, c as FlowRuntime, z as FlowcraftEvent, F as FunctionNodeExecutor, G as GraphTraverser, u as IAsyncContext, x as IEvaluator, A as IEventBus, y as ILogger, I as IOrchestrator, f as IRuntime, D as ISerializer, t as ISyncContext, M as Middleware, p as NodeClass, l as NodeConfig, n as NodeContext, j as NodeDefinition, N as NodeExecutionResult, b as NodeExecutor, a as NodeExecutorConfig, d as NodeExecutorFactory, o as NodeFunction, q as NodeImplementation, r as NodeRegistry, m as NodeResult, P as PatchOperation, R as ReadyNode, v as RuntimeDependencies, w as RuntimeOptions, S as SourceLocation, U as UIGraph, h as WorkflowBlueprint, g as WorkflowBlueprintMetadata, H as WorkflowError, K as WorkflowResult, W as WorkflowState, J as WorkflowStatus, i as isNodeClass } from './types-CKhffqyb.js';
12
+ export { B as BaseNode, C as ClassNodeExecutor, s as ContextImplementation, k as EdgeDefinition, e as ExecutionServices, E as ExecutionStrategy, c as FlowRuntime, z as FlowcraftEvent, F as FunctionNodeExecutor, G as GraphTraverser, u as IAsyncContext, x as IEvaluator, A as IEventBus, y as ILogger, I as IOrchestrator, f as IRuntime, D as ISerializer, t as ISyncContext, M as Middleware, p as NodeClass, l as NodeConfig, n as NodeContext, j as NodeDefinition, N as NodeExecutionResult, b as NodeExecutor, a as NodeExecutorConfig, d as NodeExecutorFactory, o as NodeFunction, q as NodeImplementation, r as NodeRegistry, m as NodeResult, P as PatchOperation, R as ReadyNode, v as RuntimeDependencies, w as RuntimeOptions, S as SourceLocation, U as UIGraph, h as WorkflowBlueprint, g as WorkflowBlueprintMetadata, H as WorkflowError, K as WorkflowResult, W as WorkflowState, J as WorkflowStatus, i as isNodeClass } from './types-Biip2gLh.js';
13
13
  export { AdapterOptions, BaseDistributedAdapter, ICoordinationStore, JobPayload } from './runtime/adapter.js';
14
14
  export { DefaultOrchestrator } from './runtime/orchestrator.js';
15
15
  export { ReplayOrchestrator } from './runtime/orchestrators/replay.js';
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import './chunk-HFJXYY4E.js';
2
2
  export { ReplayOrchestrator } from './chunk-UNORA7EM.js';
3
3
  import './chunk-NVLZFLYM.js';
4
- export { BaseDistributedAdapter } from './chunk-U7DKCIWT.js';
5
- export { FlowRuntime } from './chunk-BEHVGFIM.js';
6
- import './chunk-HXSK5P2X.js';
4
+ export { BaseDistributedAdapter } from './chunk-BV6MXL74.js';
5
+ export { FlowRuntime } from './chunk-CIXL7AKH.js';
6
+ import './chunk-PU2VTWJD.js';
7
7
  import './chunk-DL7KVYZF.js';
8
8
  import './chunk-LM4ACVHL.js';
9
9
  export { ClassNodeExecutor, FunctionNodeExecutor, NodeExecutor } from './chunk-ONH7PIJZ.js';
@@ -12,27 +12,27 @@ export { InMemoryEventStore, PersistentEventBusAdapter } from './chunk-2TSADFQX.
12
12
  import './chunk-BC4G7OM6.js';
13
13
  import './chunk-RM677CNU.js';
14
14
  import './chunk-HNHM3FDK.js';
15
- import './chunk-7EMUOH77.js';
16
- export { GraphTraverser } from './chunk-H4JTZYIT.js';
15
+ import './chunk-5A24LVGQ.js';
16
+ export { GraphTraverser } from './chunk-ZKINHLMS.js';
17
17
  import './chunk-IDTYHLDQ.js';
18
18
  import './chunk-I53JB2KW.js';
19
19
  export { lintBlueprint } from './chunk-IKOTX22J.js';
20
20
  export { sanitizeBlueprint } from './chunk-TKSSRS5U.js';
21
21
  import './chunk-55J6XMHW.js';
22
22
  export { analyzeBlueprint, checkForCycles, generateMermaid, generateMermaidForRun } from './chunk-ZLW4QOTS.js';
23
- export { createDefaultContainer } from './chunk-7M6FHFHP.js';
24
- export { DefaultOrchestrator } from './chunk-DV2CXHOY.js';
25
- export { executeBatch, processResults } from './chunk-N63S5NEG.js';
23
+ export { createDefaultContainer } from './chunk-E6ICIXVR.js';
24
+ export { DefaultOrchestrator } from './chunk-QA2WDZPV.js';
25
+ export { executeBatch, processResults } from './chunk-26VTGQAF.js';
26
26
  import './chunk-L3MX5MTA.js';
27
27
  export { WorkflowState } from './chunk-L46TQXCV.js';
28
28
  export { ConsoleLogger, NullLogger } from './chunk-4PELJWF7.js';
29
29
  export { JsonSerializer } from './chunk-6RKHCJUU.js';
30
- export { DIContainer, ServiceTokens } from './chunk-WWGFIYKW.js';
30
+ export { DIContainer, ServiceTokens } from './chunk-OOJEXFYY.js';
31
31
  export { AsyncContextView, Context, TrackedAsyncContext } from './chunk-ZETQCNEF.js';
32
32
  export { createErrorMapper } from './chunk-27STBUGG.js';
33
33
  export { FlowcraftError } from './chunk-BCRWXTWX.js';
34
34
  export { PropertyEvaluator, UnsafeEvaluator } from './chunk-PH2IYZHV.js';
35
- export { FlowBuilder, createFlow } from './chunk-AKDL2ZX7.js';
35
+ export { FlowBuilder, createFlow } from './chunk-X5RJOZY2.js';
36
36
  export { BaseNode, isNodeClass } from './chunk-LNK7LZER.js';
37
37
  //# sourceMappingURL=index.js.map
38
38
  //# sourceMappingURL=index.js.map
package/dist/linter.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { h as WorkflowBlueprint, o as NodeFunction, p as NodeClass } from './types-CKhffqyb.js';
1
+ import { h as WorkflowBlueprint, o as NodeFunction, p as NodeClass } from './types-Biip2gLh.js';
2
2
  import './errors.js';
3
3
  import './container.js';
4
4
 
package/dist/logger.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { y as ILogger } from './types-CKhffqyb.js';
1
+ import { y as ILogger } from './types-Biip2gLh.js';
2
2
  import './errors.js';
3
3
  import './container.js';
4
4
 
package/dist/node.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { B as BaseNode, i as isNodeClass } from './types-CKhffqyb.js';
1
+ export { B as BaseNode, i as isNodeClass } from './types-Biip2gLh.js';
2
2
  import './errors.js';
3
3
  import './container.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-CKhffqyb.js';
1
+ import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-CKhffqyb.js';
1
+ import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-CKhffqyb.js';
1
+ import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-CKhffqyb.js';
1
+ import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,5 +1,5 @@
1
- export { SubflowNode } from '../chunk-7EMUOH77.js';
2
- import '../chunk-H4JTZYIT.js';
1
+ export { SubflowNode } from '../chunk-5A24LVGQ.js';
2
+ import '../chunk-ZKINHLMS.js';
3
3
  import '../chunk-ZLW4QOTS.js';
4
4
  import '../chunk-L3MX5MTA.js';
5
5
  import '../chunk-L46TQXCV.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-CKhffqyb.js';
1
+ import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-CKhffqyb.js';
1
+ import { B as BaseNode, n as NodeContext, m as NodeResult } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { w as RuntimeOptions, A as IEventBus, c as FlowRuntime, D as ISerializer, y as ILogger, u as IAsyncContext, K as WorkflowResult, h as WorkflowBlueprint } from '../types-CKhffqyb.js';
1
+ import { w as RuntimeOptions, A as IEventBus, c as FlowRuntime, D as ISerializer, y as ILogger, u as IAsyncContext, K as WorkflowResult, h as WorkflowBlueprint } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,25 +1,25 @@
1
- export { BaseDistributedAdapter } from '../chunk-U7DKCIWT.js';
2
- import '../chunk-BEHVGFIM.js';
3
- import '../chunk-HXSK5P2X.js';
1
+ export { BaseDistributedAdapter } from '../chunk-BV6MXL74.js';
2
+ import '../chunk-CIXL7AKH.js';
3
+ import '../chunk-PU2VTWJD.js';
4
4
  import '../chunk-DL7KVYZF.js';
5
5
  import '../chunk-LM4ACVHL.js';
6
6
  import '../chunk-ONH7PIJZ.js';
7
7
  import '../chunk-BC4G7OM6.js';
8
8
  import '../chunk-RM677CNU.js';
9
9
  import '../chunk-HNHM3FDK.js';
10
- import '../chunk-7EMUOH77.js';
11
- import '../chunk-H4JTZYIT.js';
10
+ import '../chunk-5A24LVGQ.js';
11
+ import '../chunk-ZKINHLMS.js';
12
12
  import '../chunk-IDTYHLDQ.js';
13
13
  import '../chunk-I53JB2KW.js';
14
14
  import '../chunk-TKSSRS5U.js';
15
15
  import '../chunk-ZLW4QOTS.js';
16
- import '../chunk-DV2CXHOY.js';
17
- import '../chunk-N63S5NEG.js';
16
+ import '../chunk-QA2WDZPV.js';
17
+ import '../chunk-26VTGQAF.js';
18
18
  import '../chunk-L3MX5MTA.js';
19
19
  import '../chunk-L46TQXCV.js';
20
20
  import '../chunk-4PELJWF7.js';
21
21
  import '../chunk-6RKHCJUU.js';
22
- import '../chunk-WWGFIYKW.js';
22
+ import '../chunk-OOJEXFYY.js';
23
23
  import '../chunk-ZETQCNEF.js';
24
24
  import '../chunk-BCRWXTWX.js';
25
25
  import '../chunk-PH2IYZHV.js';
@@ -1,3 +1,3 @@
1
- export { L as ExecutionContext } from '../types-CKhffqyb.js';
1
+ export { L as ExecutionContext } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
@@ -1,3 +1,3 @@
1
1
  import '../errors.js';
2
- export { C as ClassNodeExecutor, E as ExecutionStrategy, F as FunctionNodeExecutor, N as NodeExecutionResult, b as NodeExecutor, a as NodeExecutorConfig } from '../types-CKhffqyb.js';
2
+ export { C as ClassNodeExecutor, E as ExecutionStrategy, F as FunctionNodeExecutor, N as NodeExecutionResult, b as NodeExecutor, a as NodeExecutorConfig } from '../types-Biip2gLh.js';
3
3
  import '../container.js';
@@ -1,5 +1,5 @@
1
1
  export { AdapterOptions, BaseDistributedAdapter, ICoordinationStore, JobPayload } from './adapter.js';
2
- export { C as ClassNodeExecutor, e as ExecutionServices, E as ExecutionStrategy, c as FlowRuntime, F as FunctionNodeExecutor, G as GraphTraverser, I as IOrchestrator, f as IRuntime, N as NodeExecutionResult, b as NodeExecutor, a as NodeExecutorConfig, d as NodeExecutorFactory, R as ReadyNode, W as WorkflowState } from '../types-CKhffqyb.js';
2
+ export { C as ClassNodeExecutor, e as ExecutionServices, E as ExecutionStrategy, c as FlowRuntime, F as FunctionNodeExecutor, G as GraphTraverser, I as IOrchestrator, f as IRuntime, N as NodeExecutionResult, b as NodeExecutor, a as NodeExecutorConfig, d as NodeExecutorFactory, R as ReadyNode, W as WorkflowState } from '../types-Biip2gLh.js';
3
3
  export { DefaultOrchestrator } from './orchestrator.js';
4
4
  export { ReplayOrchestrator } from './orchestrators/replay.js';
5
5
  export { executeBatch, processResults } from './orchestrators/utils.js';
@@ -1,28 +1,28 @@
1
1
  import '../chunk-HFJXYY4E.js';
2
2
  export { ReplayOrchestrator } from '../chunk-UNORA7EM.js';
3
3
  import '../chunk-NVLZFLYM.js';
4
- export { BaseDistributedAdapter } from '../chunk-U7DKCIWT.js';
5
- export { FlowRuntime } from '../chunk-BEHVGFIM.js';
6
- import '../chunk-HXSK5P2X.js';
4
+ export { BaseDistributedAdapter } from '../chunk-BV6MXL74.js';
5
+ export { FlowRuntime } from '../chunk-CIXL7AKH.js';
6
+ import '../chunk-PU2VTWJD.js';
7
7
  import '../chunk-DL7KVYZF.js';
8
8
  import '../chunk-LM4ACVHL.js';
9
9
  export { ClassNodeExecutor, FunctionNodeExecutor, NodeExecutor } from '../chunk-ONH7PIJZ.js';
10
10
  import '../chunk-BC4G7OM6.js';
11
11
  import '../chunk-RM677CNU.js';
12
12
  import '../chunk-HNHM3FDK.js';
13
- import '../chunk-7EMUOH77.js';
14
- export { GraphTraverser } from '../chunk-H4JTZYIT.js';
13
+ import '../chunk-5A24LVGQ.js';
14
+ export { GraphTraverser } from '../chunk-ZKINHLMS.js';
15
15
  import '../chunk-IDTYHLDQ.js';
16
16
  import '../chunk-I53JB2KW.js';
17
17
  import '../chunk-TKSSRS5U.js';
18
18
  import '../chunk-ZLW4QOTS.js';
19
- export { DefaultOrchestrator } from '../chunk-DV2CXHOY.js';
20
- export { executeBatch, processResults } from '../chunk-N63S5NEG.js';
19
+ export { DefaultOrchestrator } from '../chunk-QA2WDZPV.js';
20
+ export { executeBatch, processResults } from '../chunk-26VTGQAF.js';
21
21
  import '../chunk-L3MX5MTA.js';
22
22
  export { WorkflowState } from '../chunk-L46TQXCV.js';
23
23
  import '../chunk-4PELJWF7.js';
24
24
  import '../chunk-6RKHCJUU.js';
25
- import '../chunk-WWGFIYKW.js';
25
+ import '../chunk-OOJEXFYY.js';
26
26
  import '../chunk-ZETQCNEF.js';
27
27
  import '../chunk-BCRWXTWX.js';
28
28
  import '../chunk-PH2IYZHV.js';
@@ -1,4 +1,4 @@
1
- import { A as IEventBus, L as ExecutionContext, b as NodeExecutor } from '../types-CKhffqyb.js';
1
+ import { A as IEventBus, L as ExecutionContext, b as NodeExecutor } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { I as IOrchestrator, L as ExecutionContext, G as GraphTraverser, K as WorkflowResult } from '../types-CKhffqyb.js';
1
+ import { I as IOrchestrator, L as ExecutionContext, G as GraphTraverser, K as WorkflowResult } from '../types-Biip2gLh.js';
2
2
  import '../errors.js';
3
3
  import '../container.js';
4
4
 
@@ -1,5 +1,5 @@
1
- export { DefaultOrchestrator } from '../chunk-DV2CXHOY.js';
2
- import '../chunk-N63S5NEG.js';
1
+ export { DefaultOrchestrator } from '../chunk-QA2WDZPV.js';
2
+ import '../chunk-26VTGQAF.js';
3
3
  import '../chunk-L3MX5MTA.js';
4
4
  import '../chunk-L46TQXCV.js';
5
5
  import '../chunk-ZETQCNEF.js';