flowcraft 2.1.1 → 2.3.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 (162) hide show
  1. package/README.md +41 -35
  2. package/dist/analysis.d.ts +5 -2
  3. package/dist/analysis.js +1 -1
  4. package/dist/{chunk-HN72TZY5.js → chunk-233SESC2.js} +34 -23
  5. package/dist/chunk-233SESC2.js.map +1 -0
  6. package/dist/chunk-33NO4PUJ.js +74 -0
  7. package/dist/chunk-33NO4PUJ.js.map +1 -0
  8. package/dist/chunk-5KKSQWSC.js +90 -0
  9. package/dist/chunk-5KKSQWSC.js.map +1 -0
  10. package/dist/{chunk-O3XD45IL.js → chunk-6INWPSZT.js} +44 -17
  11. package/dist/chunk-6INWPSZT.js.map +1 -0
  12. package/dist/chunk-BC4G7OM6.js +42 -0
  13. package/dist/chunk-BC4G7OM6.js.map +1 -0
  14. package/dist/chunk-BCRWXTWX.js +21 -0
  15. package/dist/chunk-BCRWXTWX.js.map +1 -0
  16. package/dist/chunk-C4HYIJI3.js +279 -0
  17. package/dist/chunk-C4HYIJI3.js.map +1 -0
  18. package/dist/chunk-CD3Q4N6V.js +13 -0
  19. package/dist/chunk-CD3Q4N6V.js.map +1 -0
  20. package/dist/chunk-CD4FUZOJ.js +114 -0
  21. package/dist/chunk-CD4FUZOJ.js.map +1 -0
  22. package/dist/chunk-CY755I7I.js +25 -0
  23. package/dist/chunk-CY755I7I.js.map +1 -0
  24. package/dist/chunk-DL7KVYZF.js +39 -0
  25. package/dist/chunk-DL7KVYZF.js.map +1 -0
  26. package/dist/{chunk-UETC63DP.js → chunk-EUJWJWFA.js} +24 -4
  27. package/dist/chunk-EUJWJWFA.js.map +1 -0
  28. package/dist/chunk-FRKO3WX4.js +32 -0
  29. package/dist/chunk-FRKO3WX4.js.map +1 -0
  30. package/dist/chunk-G53CSLBF.js +54 -0
  31. package/dist/chunk-G53CSLBF.js.map +1 -0
  32. package/dist/chunk-G5BGBPFP.js +172 -0
  33. package/dist/chunk-G5BGBPFP.js.map +1 -0
  34. package/dist/chunk-HAZ26F3P.js +98 -0
  35. package/dist/chunk-HAZ26F3P.js.map +1 -0
  36. package/dist/chunk-IB2BISIC.js +446 -0
  37. package/dist/chunk-IB2BISIC.js.map +1 -0
  38. package/dist/{chunk-U5V5O5MN.js → chunk-LNK7LZER.js} +5 -3
  39. package/dist/chunk-LNK7LZER.js.map +1 -0
  40. package/dist/chunk-MCGK3FXQ.js +143 -0
  41. package/dist/chunk-MCGK3FXQ.js.map +1 -0
  42. package/dist/chunk-MUYLRTSR.js +82 -0
  43. package/dist/chunk-MUYLRTSR.js.map +1 -0
  44. package/dist/chunk-NVJ3ZO3P.js +3 -0
  45. package/dist/{chunk-HMR2GEGE.js.map → chunk-NVJ3ZO3P.js.map} +1 -1
  46. package/dist/chunk-NVLZFLYM.js +3 -0
  47. package/dist/chunk-NVLZFLYM.js.map +1 -0
  48. package/dist/chunk-ONH7PIJZ.js +300 -0
  49. package/dist/chunk-ONH7PIJZ.js.map +1 -0
  50. package/dist/chunk-QNYXQKFW.js +25 -0
  51. package/dist/chunk-QNYXQKFW.js.map +1 -0
  52. package/dist/{chunk-KWQHFT7E.js → chunk-R3HQXIEL.js} +6 -6
  53. package/dist/chunk-R3HQXIEL.js.map +1 -0
  54. package/dist/chunk-RM677CNU.js +52 -0
  55. package/dist/chunk-RM677CNU.js.map +1 -0
  56. package/dist/chunk-WWGFIYKW.js +47 -0
  57. package/dist/chunk-WWGFIYKW.js.map +1 -0
  58. package/dist/chunk-XNRIM27H.js +76 -0
  59. package/dist/chunk-XNRIM27H.js.map +1 -0
  60. package/dist/container-factory.d.ts +17 -0
  61. package/dist/container-factory.js +13 -0
  62. package/dist/container-factory.js.map +1 -0
  63. package/dist/container.d.ts +23 -0
  64. package/dist/container.js +3 -0
  65. package/dist/container.js.map +1 -0
  66. package/dist/context.d.ts +3 -1
  67. package/dist/context.js +1 -1
  68. package/dist/errors.d.ts +18 -17
  69. package/dist/errors.js +1 -1
  70. package/dist/evaluator.d.ts +3 -1
  71. package/dist/flow.d.ts +29 -8
  72. package/dist/flow.js +2 -2
  73. package/dist/index.d.ts +7 -7
  74. package/dist/index.js +27 -15
  75. package/dist/linter.d.ts +5 -3
  76. package/dist/linter.js +2 -2
  77. package/dist/logger.d.ts +3 -1
  78. package/dist/node.d.ts +3 -1
  79. package/dist/node.js +1 -1
  80. package/dist/nodes/batch-gather.d.ts +9 -0
  81. package/dist/nodes/batch-gather.js +4 -0
  82. package/dist/nodes/batch-gather.js.map +1 -0
  83. package/dist/nodes/batch-scatter.d.ts +9 -0
  84. package/dist/nodes/batch-scatter.js +4 -0
  85. package/dist/nodes/batch-scatter.js.map +1 -0
  86. package/dist/nodes/subflow.d.ts +9 -0
  87. package/dist/nodes/subflow.js +10 -0
  88. package/dist/nodes/subflow.js.map +1 -0
  89. package/dist/nodes/wait.d.ts +9 -0
  90. package/dist/nodes/wait.js +4 -0
  91. package/dist/nodes/wait.js.map +1 -0
  92. package/dist/runtime/adapter.d.ts +6 -5
  93. package/dist/runtime/adapter.js +20 -10
  94. package/dist/runtime/builtin-keys.d.ts +38 -0
  95. package/dist/runtime/builtin-keys.js +10 -0
  96. package/dist/runtime/builtin-keys.js.map +1 -0
  97. package/dist/runtime/execution-context.d.ts +3 -0
  98. package/dist/runtime/execution-context.js +6 -0
  99. package/dist/runtime/execution-context.js.map +1 -0
  100. package/dist/runtime/executors.d.ts +3 -26
  101. package/dist/runtime/executors.js +2 -2
  102. package/dist/runtime/index.d.ts +5 -6
  103. package/dist/runtime/index.js +22 -11
  104. package/dist/runtime/node-executor-factory.d.ts +12 -0
  105. package/dist/runtime/node-executor-factory.js +6 -0
  106. package/dist/runtime/node-executor-factory.js.map +1 -0
  107. package/dist/runtime/orchestrator.d.ts +9 -0
  108. package/dist/runtime/orchestrator.js +8 -0
  109. package/dist/runtime/orchestrator.js.map +1 -0
  110. package/dist/runtime/orchestrators/step-by-step.d.ts +16 -0
  111. package/dist/runtime/orchestrators/step-by-step.js +5 -0
  112. package/dist/runtime/orchestrators/step-by-step.js.map +1 -0
  113. package/dist/runtime/orchestrators/utils.d.ts +35 -0
  114. package/dist/runtime/orchestrators/utils.js +4 -0
  115. package/dist/runtime/orchestrators/utils.js.map +1 -0
  116. package/dist/runtime/runtime.d.ts +3 -35
  117. package/dist/runtime/runtime.js +19 -9
  118. package/dist/runtime/state.d.ts +3 -21
  119. package/dist/runtime/state.js +3 -2
  120. package/dist/runtime/traverser.d.ts +3 -26
  121. package/dist/runtime/traverser.js +2 -3
  122. package/dist/runtime/types.d.ts +3 -16
  123. package/dist/runtime/types.js +1 -1
  124. package/dist/runtime/workflow-logic-handler.d.ts +17 -0
  125. package/dist/runtime/workflow-logic-handler.js +5 -0
  126. package/dist/runtime/workflow-logic-handler.js.map +1 -0
  127. package/dist/sanitizer.d.ts +3 -1
  128. package/dist/serializer.d.ts +3 -1
  129. package/dist/testing/event-logger.d.ts +63 -0
  130. package/dist/testing/event-logger.js +3 -0
  131. package/dist/testing/event-logger.js.map +1 -0
  132. package/dist/testing/index.d.ts +6 -0
  133. package/dist/testing/index.js +31 -0
  134. package/dist/testing/index.js.map +1 -0
  135. package/dist/testing/run-with-trace.d.ts +38 -0
  136. package/dist/testing/run-with-trace.js +29 -0
  137. package/dist/testing/run-with-trace.js.map +1 -0
  138. package/dist/testing/stepper.d.ts +79 -0
  139. package/dist/testing/stepper.js +11 -0
  140. package/dist/testing/stepper.js.map +1 -0
  141. package/dist/types-ezHUBdpL.d.ts +564 -0
  142. package/dist/types.d.ts +3 -1
  143. package/package.json +6 -2
  144. package/dist/chunk-3XVVR2SR.js +0 -417
  145. package/dist/chunk-3XVVR2SR.js.map +0 -1
  146. package/dist/chunk-4A627Q6L.js +0 -147
  147. package/dist/chunk-4A627Q6L.js.map +0 -1
  148. package/dist/chunk-5ZXV3R5D.js +0 -28
  149. package/dist/chunk-5ZXV3R5D.js.map +0 -1
  150. package/dist/chunk-CSZ6EOWG.js +0 -61
  151. package/dist/chunk-CSZ6EOWG.js.map +0 -1
  152. package/dist/chunk-HMR2GEGE.js +0 -3
  153. package/dist/chunk-HN72TZY5.js.map +0 -1
  154. package/dist/chunk-KWQHFT7E.js.map +0 -1
  155. package/dist/chunk-M2FRTT2K.js +0 -144
  156. package/dist/chunk-M2FRTT2K.js.map +0 -1
  157. package/dist/chunk-NBIRTKZ7.js +0 -192
  158. package/dist/chunk-NBIRTKZ7.js.map +0 -1
  159. package/dist/chunk-O3XD45IL.js.map +0 -1
  160. package/dist/chunk-U5V5O5MN.js.map +0 -1
  161. package/dist/chunk-UETC63DP.js.map +0 -1
  162. package/dist/types-CQCe_nBM.d.ts +0 -214
@@ -0,0 +1,25 @@
1
+ import { DefaultOrchestrator } from './chunk-33NO4PUJ.js';
2
+ import { NullLogger } from './chunk-4PELJWF7.js';
3
+ import { JsonSerializer } from './chunk-CYHZ2YVH.js';
4
+ import { DIContainer, ServiceTokens } from './chunk-WWGFIYKW.js';
5
+ import { PropertyEvaluator } from './chunk-PH2IYZHV.js';
6
+
7
+ // src/container-factory.ts
8
+ function createDefaultContainer(options = {}) {
9
+ const container = new DIContainer();
10
+ container.register(ServiceTokens.Logger, options.logger || new NullLogger());
11
+ container.register(ServiceTokens.Serializer, options.serializer || new JsonSerializer());
12
+ container.register(ServiceTokens.Evaluator, options.evaluator || new PropertyEvaluator());
13
+ container.register(ServiceTokens.EventBus, options.eventBus || { emit: async () => {
14
+ } });
15
+ container.register(ServiceTokens.Middleware, options.middleware || []);
16
+ container.register(ServiceTokens.NodeRegistry, options.registry || {});
17
+ container.register(ServiceTokens.BlueprintRegistry, options.blueprints || {});
18
+ container.register(ServiceTokens.Dependencies, options.dependencies || {});
19
+ container.registerFactory(ServiceTokens.Orchestrator, () => new DefaultOrchestrator());
20
+ return container;
21
+ }
22
+
23
+ export { createDefaultContainer };
24
+ //# sourceMappingURL=chunk-QNYXQKFW.js.map
25
+ //# sourceMappingURL=chunk-QNYXQKFW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/container-factory.ts"],"names":[],"mappings":";;;;;;;AA4BO,SAAS,sBAAA,CACf,OAAA,GAA2C,EAAC,EAC9B;AACd,EAAA,MAAM,SAAA,GAAY,IAAI,WAAA,EAAY;AAElC,EAAA,SAAA,CAAU,SAAS,aAAA,CAAc,MAAA,EAAQ,QAAQ,MAAA,IAAU,IAAI,YAAY,CAAA;AAC3E,EAAA,SAAA,CAAU,SAAS,aAAA,CAAc,UAAA,EAAY,QAAQ,UAAA,IAAc,IAAI,gBAAgB,CAAA;AACvF,EAAA,SAAA,CAAU,SAAS,aAAA,CAAc,SAAA,EAAW,QAAQ,SAAA,IAAa,IAAI,mBAAmB,CAAA;AACxF,EAAA,SAAA,CAAU,SAAS,aAAA,CAAc,QAAA,EAAU,QAAQ,QAAA,IAAY,EAAE,MAAM,YAAY;AAAA,EAAC,GAAG,CAAA;AACvF,EAAA,SAAA,CAAU,SAAS,aAAA,CAAc,UAAA,EAAY,OAAA,CAAQ,UAAA,IAAc,EAAE,CAAA;AACrE,EAAA,SAAA,CAAU,SAAS,aAAA,CAAc,YAAA,EAAc,OAAA,CAAQ,QAAA,IAAY,EAAE,CAAA;AACrE,EAAA,SAAA,CAAU,SAAS,aAAA,CAAc,iBAAA,EAAmB,OAAA,CAAQ,UAAA,IAAc,EAAE,CAAA;AAC5E,EAAA,SAAA,CAAU,SAAS,aAAA,CAAc,YAAA,EAAc,OAAA,CAAQ,YAAA,IAAiB,EAAoB,CAAA;AAE5F,EAAA,SAAA,CAAU,gBAAgB,aAAA,CAAc,YAAA,EAAc,MAAM,IAAI,qBAAqB,CAAA;AAErF,EAAA,OAAO,SAAA;AACR","file":"chunk-QNYXQKFW.js","sourcesContent":["import { DIContainer, ServiceTokens } from './container'\nimport { PropertyEvaluator } from './evaluator'\nimport { NullLogger } from './logger'\nimport { DefaultOrchestrator } from './runtime/orchestrator'\nimport { JsonSerializer } from './serializer'\nimport type {\n\tIEvaluator,\n\tIEventBus,\n\tILogger,\n\tISerializer,\n\tMiddleware,\n\tNodeClass,\n\tNodeFunction,\n\tRuntimeDependencies,\n\tWorkflowBlueprint,\n} from './types'\n\nexport interface ContainerOptions<TDependencies extends RuntimeDependencies = RuntimeDependencies> {\n\tlogger?: ILogger\n\tserializer?: ISerializer\n\tevaluator?: IEvaluator\n\teventBus?: IEventBus\n\tmiddleware?: Middleware[]\n\tregistry?: Record<string, NodeFunction | NodeClass>\n\tblueprints?: Record<string, WorkflowBlueprint>\n\tdependencies?: TDependencies\n}\n\nexport function createDefaultContainer<TDependencies extends RuntimeDependencies = RuntimeDependencies>(\n\toptions: ContainerOptions<TDependencies> = {},\n): DIContainer {\n\tconst container = new DIContainer()\n\n\tcontainer.register(ServiceTokens.Logger, options.logger || new NullLogger())\n\tcontainer.register(ServiceTokens.Serializer, options.serializer || new JsonSerializer())\n\tcontainer.register(ServiceTokens.Evaluator, options.evaluator || new PropertyEvaluator())\n\tcontainer.register(ServiceTokens.EventBus, options.eventBus || { emit: async () => {} })\n\tcontainer.register(ServiceTokens.Middleware, options.middleware || [])\n\tcontainer.register(ServiceTokens.NodeRegistry, options.registry || {})\n\tcontainer.register(ServiceTokens.BlueprintRegistry, options.blueprints || {})\n\tcontainer.register(ServiceTokens.Dependencies, options.dependencies || ({} as TDependencies))\n\n\tcontainer.registerFactory(ServiceTokens.Orchestrator, () => new DefaultOrchestrator())\n\n\treturn container\n}\n"]}
@@ -6,16 +6,16 @@ var Context = class {
6
6
  this.data = new Map(Object.entries(initialData));
7
7
  }
8
8
  get(key) {
9
- return this.data.get(String(key));
9
+ return this.data.get(key);
10
10
  }
11
11
  set(key, value) {
12
- this.data.set(String(key), value);
12
+ this.data.set(key, value);
13
13
  }
14
14
  has(key) {
15
- return this.data.has(String(key));
15
+ return this.data.has(key);
16
16
  }
17
17
  delete(key) {
18
- return this.data.delete(String(key));
18
+ return this.data.delete(key);
19
19
  }
20
20
  toJSON() {
21
21
  return Object.fromEntries(this.data);
@@ -45,5 +45,5 @@ var AsyncContextView = class {
45
45
  };
46
46
 
47
47
  export { AsyncContextView, Context };
48
- //# sourceMappingURL=chunk-KWQHFT7E.js.map
49
- //# sourceMappingURL=chunk-KWQHFT7E.js.map
48
+ //# sourceMappingURL=chunk-R3HQXIEL.js.map
49
+ //# sourceMappingURL=chunk-R3HQXIEL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/context.ts"],"names":[],"mappings":";AAKO,IAAM,UAAN,MAAsF;AAAA,EAC5E,IAAA,GAAO,MAAA;AAAA,EACf,IAAA;AAAA,EAER,WAAA,CAAY,WAAA,GAAiC,EAAC,EAAG;AAChD,IAAA,IAAA,CAAK,OAAO,IAAI,GAAA,CAAI,MAAA,CAAO,OAAA,CAAQ,WAAW,CAAC,CAAA;AAAA,EAChD;AAAA,EAGA,IAAI,GAAA,EAA8B;AACjC,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA;AAAA,EACzB;AAAA,EAGA,GAAA,CAAI,KAAa,KAAA,EAAkB;AAClC,IAAA,IAAA,CAAK,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,KAAK,CAAA;AAAA,EACzB;AAAA,EAGA,IAAI,GAAA,EAAsB;AACzB,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA;AAAA,EACzB;AAAA,EAGA,OAAO,GAAA,EAAsB;AAC5B,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,MAAA,CAAO,GAAG,CAAA;AAAA,EAC5B;AAAA,EAEA,MAAA,GAA8B;AAC7B,IAAA,OAAO,MAAA,CAAO,WAAA,CAAY,IAAA,CAAK,IAAI,CAAA;AAAA,EACpC;AACD;AAMO,IAAM,mBAAN,MAAgG;AAAA,EAGtG,YAAoB,WAAA,EAAqC;AAArC,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA;AAAA,EAAsC;AAAA,EAF1C,IAAA,GAAO,OAAA;AAAA,EAKvB,IAAI,GAAA,EAAuC;AAC1C,IAAA,OAAO,QAAQ,OAAA,CAAQ,IAAA,CAAK,WAAA,CAAY,GAAA,CAAI,GAAG,CAAC,CAAA;AAAA,EACjD;AAAA,EAGA,GAAA,CAAI,KAAa,KAAA,EAA2B;AAC3C,IAAA,IAAA,CAAK,WAAA,CAAY,GAAA,CAAI,GAAA,EAAK,KAAK,CAAA;AAC/B,IAAA,OAAO,QAAQ,OAAA,EAAQ;AAAA,EACxB;AAAA,EAGA,IAAI,GAAA,EAA+B;AAClC,IAAA,OAAO,QAAQ,OAAA,CAAQ,IAAA,CAAK,WAAA,CAAY,GAAA,CAAI,GAAG,CAAC,CAAA;AAAA,EACjD;AAAA,EAGA,OAAO,GAAA,EAA+B;AACrC,IAAA,OAAO,QAAQ,OAAA,CAAQ,IAAA,CAAK,WAAA,CAAY,MAAA,CAAO,GAAG,CAAC,CAAA;AAAA,EACpD;AAAA,EAEA,MAAA,GAAuC;AACtC,IAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,IAAA,CAAK,WAAA,CAAY,QAAQ,CAAA;AAAA,EACjD;AACD","file":"chunk-R3HQXIEL.js","sourcesContent":["import type { IAsyncContext, ISyncContext } from './types'\n\n/**\n * A default, high-performance, in-memory implementation of ISyncContext using a Map.\n */\nexport class Context<TContext extends Record<string, any>> implements ISyncContext<TContext> {\n\tpublic readonly type = 'sync' as const\n\tprivate data: Map<string, any>\n\n\tconstructor(initialData: Partial<TContext> = {}) {\n\t\tthis.data = new Map(Object.entries(initialData))\n\t}\n\n\tget<K extends keyof TContext>(key: K): TContext[K] | undefined\n\tget(key: string): any | undefined {\n\t\treturn this.data.get(key)\n\t}\n\n\tset<K extends keyof TContext>(key: K, value: TContext[K]): void\n\tset(key: string, value: any): void {\n\t\tthis.data.set(key, value)\n\t}\n\n\thas<K extends keyof TContext>(key: K): boolean\n\thas(key: string): boolean {\n\t\treturn this.data.has(key)\n\t}\n\n\tdelete<K extends keyof TContext>(key: K): boolean\n\tdelete(key: string): boolean {\n\t\treturn this.data.delete(key)\n\t}\n\n\ttoJSON(): Record<string, any> {\n\t\treturn Object.fromEntries(this.data)\n\t}\n}\n\n/**\n * An adapter that provides a consistent, Promise-based view of a synchronous context.\n * This is created by the runtime and is transparent to the node author.\n */\nexport class AsyncContextView<TContext extends Record<string, any>> implements IAsyncContext<TContext> {\n\tpublic readonly type = 'async' as const\n\n\tconstructor(private syncContext: ISyncContext<TContext>) {}\n\n\tget<K extends keyof TContext>(key: K): Promise<TContext[K] | undefined>\n\tget(key: string): Promise<any | undefined> {\n\t\treturn Promise.resolve(this.syncContext.get(key))\n\t}\n\n\tset<K extends keyof TContext>(key: K, value: TContext[K]): Promise<void>\n\tset(key: string, value: any): Promise<void> {\n\t\tthis.syncContext.set(key, value)\n\t\treturn Promise.resolve()\n\t}\n\n\thas<K extends keyof TContext>(key: K): Promise<boolean>\n\thas(key: string): Promise<boolean> {\n\t\treturn Promise.resolve(this.syncContext.has(key))\n\t}\n\n\tdelete<K extends keyof TContext>(key: K): Promise<boolean>\n\tdelete(key: string): Promise<boolean> {\n\t\treturn Promise.resolve(this.syncContext.delete(key))\n\t}\n\n\ttoJSON(): Promise<Record<string, any>> {\n\t\treturn Promise.resolve(this.syncContext.toJSON())\n\t}\n}\n"]}
@@ -0,0 +1,52 @@
1
+ import { BaseNode } from './chunk-LNK7LZER.js';
2
+
3
+ // src/nodes/batch-scatter.ts
4
+ var BatchScatterNode = class extends BaseNode {
5
+ async exec(_prepResult, context) {
6
+ const inputArray = context.input || [];
7
+ if (!Array.isArray(inputArray)) {
8
+ throw new Error(`Input for batch-scatter node '${this.nodeId}' must be an array.`);
9
+ }
10
+ const { chunkSize = inputArray.length, workerUsesKey, gatherNodeId } = this.params || {};
11
+ if (!workerUsesKey || !gatherNodeId) {
12
+ throw new Error(`BatchScatterNode requires 'workerUsesKey' and 'gatherNodeId' parameters.`);
13
+ }
14
+ const batchId = globalThis.crypto.randomUUID();
15
+ const currentIndex = await context.context.get(`${this.nodeId}_currentIndex`) || 0;
16
+ const endIndex = Math.min(currentIndex + chunkSize, inputArray.length);
17
+ const dynamicNodes = [];
18
+ const workerIds = [];
19
+ for (let i = currentIndex; i < endIndex; i++) {
20
+ const item = inputArray[i];
21
+ const itemInputKey = `_batch.${this.nodeId}_${batchId}_item_${i}`;
22
+ await context.context.set(itemInputKey, item);
23
+ const workerId = `${workerUsesKey}_${batchId}_${i}`;
24
+ workerIds.push(workerId);
25
+ dynamicNodes.push({
26
+ id: workerId,
27
+ uses: workerUsesKey,
28
+ inputs: itemInputKey
29
+ });
30
+ }
31
+ const parentBatchId = this.nodeId?.replace("_scatter", "") || "";
32
+ await context.dependencies.runtime.services.eventBus.emit({
33
+ type: "batch:start",
34
+ payload: {
35
+ batchId: parentBatchId,
36
+ scatterNodeId: this.nodeId,
37
+ workerNodeIds: workerIds
38
+ }
39
+ });
40
+ await context.context.set(`${this.nodeId}_currentIndex`, endIndex);
41
+ const hasMore = endIndex < inputArray.length;
42
+ await context.context.set(`${gatherNodeId}_hasMore`, hasMore);
43
+ const existingWorkerIds = await context.context.get(`${gatherNodeId}_allWorkerIds`) || [];
44
+ const allWorkerIds = [...existingWorkerIds, ...workerIds];
45
+ await context.context.set(`${gatherNodeId}_allWorkerIds`, allWorkerIds);
46
+ return { dynamicNodes, output: { gatherNodeId, hasMore } };
47
+ }
48
+ };
49
+
50
+ export { BatchScatterNode };
51
+ //# sourceMappingURL=chunk-RM677CNU.js.map
52
+ //# sourceMappingURL=chunk-RM677CNU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/nodes/batch-scatter.ts"],"names":[],"mappings":";;;AAGO,IAAM,gBAAA,GAAN,cAA+B,QAAA,CAAS;AAAA,EAC9C,MAAM,IAAA,CAAK,WAAA,EAAkB,OAAA,EAAyE;AACrG,IAAA,MAAM,UAAA,GAAa,OAAA,CAAQ,KAAA,IAAS,EAAC;AACrC,IAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,UAAU,CAAA,EAAG;AAC/B,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,8BAAA,EAAiC,IAAA,CAAK,MAAM,CAAA,mBAAA,CAAqB,CAAA;AAAA,IAClF;AACA,IAAA,MAAM,EAAE,YAAY,UAAA,CAAW,MAAA,EAAQ,eAAe,YAAA,EAAa,GAAK,IAAA,CAAK,MAAA,IAAkB,EAAC;AAChG,IAAA,IAAI,CAAC,aAAA,IAAiB,CAAC,YAAA,EAAc;AACpC,MAAA,MAAM,IAAI,MAAM,CAAA,wEAAA,CAA0E,CAAA;AAAA,IAC3F;AACA,IAAA,MAAM,OAAA,GAAU,UAAA,CAAW,MAAA,CAAO,UAAA,EAAW;AAC7C,IAAA,MAAM,YAAA,GAAgB,MAAM,OAAA,CAAQ,OAAA,CAAQ,IAAI,CAAA,EAAG,IAAA,CAAK,MAAM,CAAA,aAAA,CAAe,CAAA,IAAM,CAAA;AACnF,IAAA,MAAM,WAAW,IAAA,CAAK,GAAA,CAAI,YAAA,GAAe,SAAA,EAAW,WAAW,MAAM,CAAA;AACrE,IAAA,MAAM,eAAsB,EAAC;AAC7B,IAAA,MAAM,YAAY,EAAC;AACnB,IAAA,KAAA,IAAS,CAAA,GAAI,YAAA,EAAc,CAAA,GAAI,QAAA,EAAU,CAAA,EAAA,EAAK;AAC7C,MAAA,MAAM,IAAA,GAAO,WAAW,CAAC,CAAA;AACzB,MAAA,MAAM,eAAe,CAAA,OAAA,EAAU,IAAA,CAAK,MAAM,CAAA,CAAA,EAAI,OAAO,SAAS,CAAC,CAAA,CAAA;AAC/D,MAAA,MAAM,OAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,YAAA,EAAqB,IAAI,CAAA;AACnD,MAAA,MAAM,WAAW,CAAA,EAAG,aAAa,CAAA,CAAA,EAAI,OAAO,IAAI,CAAC,CAAA,CAAA;AACjD,MAAA,SAAA,CAAU,KAAK,QAAQ,CAAA;AACvB,MAAA,YAAA,CAAa,IAAA,CAAK;AAAA,QACjB,EAAA,EAAI,QAAA;AAAA,QACJ,IAAA,EAAM,aAAA;AAAA,QACN,MAAA,EAAQ;AAAA,OACR,CAAA;AAAA,IACF;AAEA,IAAA,MAAM,gBAAgB,IAAA,CAAK,MAAA,EAAQ,OAAA,CAAQ,UAAA,EAAY,EAAE,CAAA,IAAK,EAAA;AAC9D,IAAA,MAAM,OAAA,CAAQ,YAAA,CAAa,OAAA,CAAQ,QAAA,CAAS,SAAS,IAAA,CAAK;AAAA,MACzD,IAAA,EAAM,aAAA;AAAA,MACN,OAAA,EAAS;AAAA,QACR,OAAA,EAAS,aAAA;AAAA,QACT,eAAe,IAAA,CAAK,MAAA;AAAA,QACpB,aAAA,EAAe;AAAA;AAChB,KACA,CAAA;AAED,IAAA,MAAM,QAAQ,OAAA,CAAQ,GAAA,CAAI,GAAG,IAAA,CAAK,MAAM,iBAAiB,QAAQ,CAAA;AACjE,IAAA,MAAM,OAAA,GAAU,WAAW,UAAA,CAAW,MAAA;AACtC,IAAA,MAAM,QAAQ,OAAA,CAAQ,GAAA,CAAI,CAAA,EAAG,YAAY,YAAY,OAAO,CAAA;AAC5D,IAAA,MAAM,iBAAA,GAAqB,MAAM,OAAA,CAAQ,OAAA,CAAQ,IAAI,CAAA,EAAG,YAAY,CAAA,aAAA,CAAe,CAAA,IAAM,EAAC;AAC1F,IAAA,MAAM,YAAA,GAAe,CAAC,GAAG,iBAAA,EAAmB,GAAG,SAAS,CAAA;AACxD,IAAA,MAAM,QAAQ,OAAA,CAAQ,GAAA,CAAI,CAAA,EAAG,YAAY,iBAAiB,YAAY,CAAA;AACtE,IAAA,OAAO,EAAE,YAAA,EAAc,MAAA,EAAQ,EAAE,YAAA,EAAc,SAAQ,EAAE;AAAA,EAC1D;AACD","file":"chunk-RM677CNU.js","sourcesContent":["import { BaseNode } from '../node'\nimport type { NodeContext, NodeResult } from '../types'\n\nexport class BatchScatterNode extends BaseNode {\n\tasync exec(_prepResult: any, context: NodeContext<any, any, any>): Promise<Omit<NodeResult, 'error'>> {\n\t\tconst inputArray = context.input || []\n\t\tif (!Array.isArray(inputArray)) {\n\t\t\tthrow new Error(`Input for batch-scatter node '${this.nodeId}' must be an array.`)\n\t\t}\n\t\tconst { chunkSize = inputArray.length, workerUsesKey, gatherNodeId } = (this.params as any) || {}\n\t\tif (!workerUsesKey || !gatherNodeId) {\n\t\t\tthrow new Error(`BatchScatterNode requires 'workerUsesKey' and 'gatherNodeId' parameters.`)\n\t\t}\n\t\tconst batchId = globalThis.crypto.randomUUID()\n\t\tconst currentIndex = (await context.context.get(`${this.nodeId}_currentIndex`)) || 0\n\t\tconst endIndex = Math.min(currentIndex + chunkSize, inputArray.length)\n\t\tconst dynamicNodes: any[] = []\n\t\tconst workerIds = []\n\t\tfor (let i = currentIndex; i < endIndex; i++) {\n\t\t\tconst item = inputArray[i]\n\t\t\tconst itemInputKey = `_batch.${this.nodeId}_${batchId}_item_${i}`\n\t\t\tawait context.context.set(itemInputKey as any, item)\n\t\t\tconst workerId = `${workerUsesKey}_${batchId}_${i}`\n\t\t\tworkerIds.push(workerId)\n\t\t\tdynamicNodes.push({\n\t\t\t\tid: workerId,\n\t\t\t\tuses: workerUsesKey,\n\t\t\t\tinputs: itemInputKey,\n\t\t\t})\n\t\t}\n\n\t\tconst parentBatchId = this.nodeId?.replace('_scatter', '') || ''\n\t\tawait context.dependencies.runtime.services.eventBus.emit({\n\t\t\ttype: 'batch:start',\n\t\t\tpayload: {\n\t\t\t\tbatchId: parentBatchId,\n\t\t\t\tscatterNodeId: this.nodeId,\n\t\t\t\tworkerNodeIds: workerIds,\n\t\t\t},\n\t\t})\n\n\t\tawait context.context.set(`${this.nodeId}_currentIndex`, endIndex)\n\t\tconst hasMore = endIndex < inputArray.length\n\t\tawait context.context.set(`${gatherNodeId}_hasMore`, hasMore)\n\t\tconst existingWorkerIds = (await context.context.get(`${gatherNodeId}_allWorkerIds`)) || []\n\t\tconst allWorkerIds = [...existingWorkerIds, ...workerIds]\n\t\tawait context.context.set(`${gatherNodeId}_allWorkerIds`, allWorkerIds)\n\t\treturn { dynamicNodes, output: { gatherNodeId, hasMore } }\n\t}\n}\n"]}
@@ -0,0 +1,47 @@
1
+ // src/container.ts
2
+ var DIContainer = class _DIContainer {
3
+ services = /* @__PURE__ */ new Map();
4
+ factories = /* @__PURE__ */ new Map();
5
+ register(token, implementation) {
6
+ this.services.set(token, implementation);
7
+ }
8
+ registerFactory(token, factory) {
9
+ this.factories.set(token, factory);
10
+ }
11
+ resolve(token) {
12
+ if (this.services.has(token)) {
13
+ return this.services.get(token);
14
+ }
15
+ if (this.factories.has(token)) {
16
+ const factory = this.factories.get(token);
17
+ const instance = factory?.(this);
18
+ this.services.set(token, instance);
19
+ return instance;
20
+ }
21
+ throw new Error(`Service not found for token: ${String(token)}`);
22
+ }
23
+ has(token) {
24
+ return this.services.has(token) || this.factories.has(token);
25
+ }
26
+ createChild() {
27
+ const child = new _DIContainer();
28
+ child.services = new Map(this.services);
29
+ child.factories = new Map(this.factories);
30
+ return child;
31
+ }
32
+ };
33
+ var ServiceTokens = {
34
+ Logger: Symbol.for("flowcraft:logger"),
35
+ Serializer: Symbol.for("flowcraft:serializer"),
36
+ Evaluator: Symbol.for("flowcraft:evaluator"),
37
+ EventBus: Symbol.for("flowcraft:eventBus"),
38
+ Orchestrator: Symbol.for("flowcraft:orchestrator"),
39
+ Middleware: Symbol.for("flowcraft:middleware"),
40
+ NodeRegistry: Symbol.for("flowcraft:nodeRegistry"),
41
+ BlueprintRegistry: Symbol.for("flowcraft:blueprintRegistry"),
42
+ Dependencies: Symbol.for("flowcraft:dependencies")
43
+ };
44
+
45
+ export { DIContainer, ServiceTokens };
46
+ //# sourceMappingURL=chunk-WWGFIYKW.js.map
47
+ //# sourceMappingURL=chunk-WWGFIYKW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/container.ts"],"names":[],"mappings":";AAEO,IAAM,WAAA,GAAN,MAAM,YAAA,CAAY;AAAA,EAChB,QAAA,uBAAuC,GAAA,EAAI;AAAA,EAC3C,SAAA,uBAAoE,GAAA,EAAI;AAAA,EAEhF,QAAA,CAAY,OAAwB,cAAA,EAAyB;AAC5D,IAAA,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,KAAA,EAAO,cAAc,CAAA;AAAA,EACxC;AAAA,EAEA,eAAA,CAAmB,OAAwB,OAAA,EAA8C;AACxF,IAAA,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,KAAA,EAAO,OAAO,CAAA;AAAA,EAClC;AAAA,EAEA,QAAW,KAAA,EAA2B;AACrC,IAAA,IAAI,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,KAAK,CAAA,EAAG;AAC7B,MAAA,OAAO,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,KAAK,CAAA;AAAA,IAC/B;AAEA,IAAA,IAAI,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,KAAK,CAAA,EAAG;AAC9B,MAAA,MAAM,OAAA,GAAU,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,KAAK,CAAA;AACxC,MAAA,MAAM,QAAA,GAAW,UAAU,IAAI,CAAA;AAC/B,MAAA,IAAA,CAAK,QAAA,CAAS,GAAA,CAAI,KAAA,EAAO,QAAQ,CAAA;AACjC,MAAA,OAAO,QAAA;AAAA,IACR;AAEA,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,6BAAA,EAAgC,MAAA,CAAO,KAAK,CAAC,CAAA,CAAE,CAAA;AAAA,EAChE;AAAA,EAEA,IAAI,KAAA,EAA8B;AACjC,IAAA,OAAO,IAAA,CAAK,SAAS,GAAA,CAAI,KAAK,KAAK,IAAA,CAAK,SAAA,CAAU,IAAI,KAAK,CAAA;AAAA,EAC5D;AAAA,EAEA,WAAA,GAA2B;AAC1B,IAAA,MAAM,KAAA,GAAQ,IAAI,YAAA,EAAY;AAC9B,IAAA,KAAA,CAAM,QAAA,GAAW,IAAI,GAAA,CAAI,IAAA,CAAK,QAAQ,CAAA;AACtC,IAAA,KAAA,CAAM,SAAA,GAAY,IAAI,GAAA,CAAI,IAAA,CAAK,SAAS,CAAA;AACxC,IAAA,OAAO,KAAA;AAAA,EACR;AACD;AAEO,IAAM,aAAA,GAAgB;AAAA,EAC5B,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,kBAAkB,CAAA;AAAA,EACrC,UAAA,EAAY,MAAA,CAAO,GAAA,CAAI,sBAAsB,CAAA;AAAA,EAC7C,SAAA,EAAW,MAAA,CAAO,GAAA,CAAI,qBAAqB,CAAA;AAAA,EAC3C,QAAA,EAAU,MAAA,CAAO,GAAA,CAAI,oBAAoB,CAAA;AAAA,EACzC,YAAA,EAAc,MAAA,CAAO,GAAA,CAAI,wBAAwB,CAAA;AAAA,EACjD,UAAA,EAAY,MAAA,CAAO,GAAA,CAAI,sBAAsB,CAAA;AAAA,EAC7C,YAAA,EAAc,MAAA,CAAO,GAAA,CAAI,wBAAwB,CAAA;AAAA,EACjD,iBAAA,EAAmB,MAAA,CAAO,GAAA,CAAI,6BAA6B,CAAA;AAAA,EAC3D,YAAA,EAAc,MAAA,CAAO,GAAA,CAAI,wBAAwB;AAClD","file":"chunk-WWGFIYKW.js","sourcesContent":["export type ServiceToken<_T = any> = string | symbol\n\nexport class DIContainer {\n\tprivate services: Map<ServiceToken, any> = new Map()\n\tprivate factories: Map<ServiceToken, (container: DIContainer) => any> = new Map()\n\n\tregister<T>(token: ServiceToken<T>, implementation: T): void {\n\t\tthis.services.set(token, implementation)\n\t}\n\n\tregisterFactory<T>(token: ServiceToken<T>, factory: (container: DIContainer) => T): void {\n\t\tthis.factories.set(token, factory)\n\t}\n\n\tresolve<T>(token: ServiceToken<T>): T {\n\t\tif (this.services.has(token)) {\n\t\t\treturn this.services.get(token)\n\t\t}\n\n\t\tif (this.factories.has(token)) {\n\t\t\tconst factory = this.factories.get(token)\n\t\t\tconst instance = factory?.(this)\n\t\t\tthis.services.set(token, instance)\n\t\t\treturn instance\n\t\t}\n\n\t\tthrow new Error(`Service not found for token: ${String(token)}`)\n\t}\n\n\thas(token: ServiceToken): boolean {\n\t\treturn this.services.has(token) || this.factories.has(token)\n\t}\n\n\tcreateChild(): DIContainer {\n\t\tconst child = new DIContainer()\n\t\tchild.services = new Map(this.services)\n\t\tchild.factories = new Map(this.factories)\n\t\treturn child\n\t}\n}\n\nexport const ServiceTokens = {\n\tLogger: Symbol.for('flowcraft:logger'),\n\tSerializer: Symbol.for('flowcraft:serializer'),\n\tEvaluator: Symbol.for('flowcraft:evaluator'),\n\tEventBus: Symbol.for('flowcraft:eventBus'),\n\tOrchestrator: Symbol.for('flowcraft:orchestrator'),\n\tMiddleware: Symbol.for('flowcraft:middleware'),\n\tNodeRegistry: Symbol.for('flowcraft:nodeRegistry'),\n\tBlueprintRegistry: Symbol.for('flowcraft:blueprintRegistry'),\n\tDependencies: Symbol.for('flowcraft:dependencies'),\n} as const\n"]}
@@ -0,0 +1,76 @@
1
+ import { StepByStepOrchestrator } from './chunk-G53CSLBF.js';
2
+ import { GraphTraverser } from './chunk-G5BGBPFP.js';
3
+ import { ExecutionContext } from './chunk-FRKO3WX4.js';
4
+ import { WorkflowState } from './chunk-CD4FUZOJ.js';
5
+
6
+ // src/testing/stepper.ts
7
+ async function createStepper(runtime, blueprint, functionRegistry, initialState = {}) {
8
+ const _initialBlueprint = structuredClone(blueprint);
9
+ const _initialState = structuredClone(initialState);
10
+ let state;
11
+ let traverser;
12
+ const history = [];
13
+ const orchestrator = new StepByStepOrchestrator();
14
+ const executionId = globalThis.crypto?.randomUUID();
15
+ const nodeRegistry = new Map([...runtime.registry, ...functionRegistry]);
16
+ const initialize = () => {
17
+ state = new WorkflowState(_initialState);
18
+ traverser = new GraphTraverser(_initialBlueprint);
19
+ history.length = 0;
20
+ };
21
+ initialize();
22
+ const stepper = {
23
+ get state() {
24
+ return state;
25
+ },
26
+ get traverser() {
27
+ return traverser;
28
+ },
29
+ isDone() {
30
+ return !traverser.hasMoreWork() && !state.isAwaiting();
31
+ },
32
+ reset() {
33
+ initialize();
34
+ },
35
+ async prev() {
36
+ const previousStateJson = history.pop();
37
+ if (!previousStateJson) {
38
+ return null;
39
+ }
40
+ const previousStateData = runtime.serializer.deserialize(previousStateJson);
41
+ state = new WorkflowState(previousStateData);
42
+ traverser = GraphTraverser.fromState(_initialBlueprint, state);
43
+ return state.toResult(runtime.serializer);
44
+ },
45
+ async next(options = {}) {
46
+ if (stepper.isDone()) {
47
+ return null;
48
+ }
49
+ const serializedContext = (await state.toResult(runtime.serializer)).serializedContext;
50
+ history.push(serializedContext);
51
+ const executionContext = new ExecutionContext(
52
+ _initialBlueprint,
53
+ state,
54
+ nodeRegistry,
55
+ executionId,
56
+ runtime,
57
+ {
58
+ logger: runtime.logger,
59
+ eventBus: runtime.eventBus,
60
+ serializer: runtime.serializer,
61
+ evaluator: runtime.evaluator,
62
+ middleware: runtime.middleware,
63
+ dependencies: runtime.dependencies
64
+ },
65
+ options.signal,
66
+ options.concurrency
67
+ );
68
+ return orchestrator.run(executionContext, traverser);
69
+ }
70
+ };
71
+ return stepper;
72
+ }
73
+
74
+ export { createStepper };
75
+ //# sourceMappingURL=chunk-XNRIM27H.js.map
76
+ //# sourceMappingURL=chunk-XNRIM27H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/testing/stepper.ts"],"names":[],"mappings":";;;;;;AAkFA,eAAsB,cACrB,OAAA,EACA,SAAA,EACA,gBAAA,EACA,YAAA,GAAkC,EAAC,EACG;AACtC,EAAA,MAAM,iBAAA,GAAoB,gBAAgB,SAAS,CAAA;AACnD,EAAA,MAAM,aAAA,GAAgB,gBAAgB,YAAY,CAAA;AAElD,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI,SAAA;AACJ,EAAA,MAAM,UAAoB,EAAC;AAE3B,EAAA,MAAM,YAAA,GAAe,IAAI,sBAAA,EAAuB;AAChD,EAAA,MAAM,WAAA,GAAc,UAAA,CAAW,MAAA,EAAQ,UAAA,EAAW;AAClD,EAAA,MAAM,YAAA,GAAe,IAAI,GAAA,CAAI,CAAC,GAAG,OAAA,CAAQ,QAAA,EAAU,GAAG,gBAAgB,CAAC,CAAA;AAEvE,EAAA,MAAM,aAAa,MAAM;AACxB,IAAA,KAAA,GAAQ,IAAI,cAAwB,aAAa,CAAA;AACjD,IAAA,SAAA,GAAY,IAAI,eAAe,iBAAiB,CAAA;AAChD,IAAA,OAAA,CAAQ,MAAA,GAAS,CAAA;AAAA,EAClB,CAAA;AAEA,EAAA,UAAA,EAAW;AAEX,EAAA,MAAM,OAAA,GAAsC;AAAA,IAC3C,IAAI,KAAA,GAAQ;AACX,MAAA,OAAO,KAAA;AAAA,IACR,CAAA;AAAA,IACA,IAAI,SAAA,GAAY;AACf,MAAA,OAAO,SAAA;AAAA,IACR,CAAA;AAAA,IACA,MAAA,GAAS;AACR,MAAA,OAAO,CAAC,SAAA,CAAU,WAAA,EAAY,IAAK,CAAC,MAAM,UAAA,EAAW;AAAA,IACtD,CAAA;AAAA,IACA,KAAA,GAAQ;AACP,MAAA,UAAA,EAAW;AAAA,IACZ,CAAA;AAAA,IACA,MAAM,IAAA,GAAO;AACZ,MAAA,MAAM,iBAAA,GAAoB,QAAQ,GAAA,EAAI;AACtC,MAAA,IAAI,CAAC,iBAAA,EAAmB;AACvB,QAAA,OAAO,IAAA;AAAA,MACR;AAEA,MAAA,MAAM,iBAAA,GAAoB,OAAA,CAAQ,UAAA,CAAW,WAAA,CAAY,iBAAiB,CAAA;AAE1E,MAAA,KAAA,GAAQ,IAAI,cAAc,iBAAiB,CAAA;AAC3C,MAAA,SAAA,GAAY,cAAA,CAAe,SAAA,CAAU,iBAAA,EAAmB,KAAK,CAAA;AAE7D,MAAA,OAAO,KAAA,CAAM,QAAA,CAAS,OAAA,CAAQ,UAAU,CAAA;AAAA,IACzC,CAAA;AAAA,IACA,MAAM,IAAA,CAAK,OAAA,GAA0D,EAAC,EAAG;AACxE,MAAA,IAAI,OAAA,CAAQ,QAAO,EAAG;AACrB,QAAA,OAAO,IAAA;AAAA,MACR;AAEA,MAAA,MAAM,qBAAqB,MAAM,KAAA,CAAM,QAAA,CAAS,OAAA,CAAQ,UAAU,CAAA,EAAG,iBAAA;AACrE,MAAA,OAAA,CAAQ,KAAK,iBAAiB,CAAA;AAE9B,MAAA,MAAM,mBAAmB,IAAI,gBAAA;AAAA,QAC5B,iBAAA;AAAA,QACA,KAAA;AAAA,QACA,YAAA;AAAA,QACA,WAAA;AAAA,QACA,OAAA;AAAA,QACA;AAAA,UACC,QAAQ,OAAA,CAAQ,MAAA;AAAA,UAChB,UAAU,OAAA,CAAQ,QAAA;AAAA,UAClB,YAAY,OAAA,CAAQ,UAAA;AAAA,UACpB,WAAW,OAAA,CAAQ,SAAA;AAAA,UACnB,YAAY,OAAA,CAAQ,UAAA;AAAA,UACpB,cAAc,OAAA,CAAQ;AAAA,SACvB;AAAA,QACA,OAAA,CAAQ,MAAA;AAAA,QACR,OAAA,CAAQ;AAAA,OACT;AACA,MAAA,OAAO,YAAA,CAAa,GAAA,CAAI,gBAAA,EAAkB,SAAS,CAAA;AAAA,IACpD;AAAA,GACD;AAEA,EAAA,OAAO,OAAA;AACR","file":"chunk-XNRIM27H.js","sourcesContent":["import type { FlowRuntime } from '../runtime'\nimport { ExecutionContext } from '../runtime/execution-context'\nimport { StepByStepOrchestrator } from '../runtime/orchestrators/step-by-step'\nimport { WorkflowState } from '../runtime/state'\nimport { GraphTraverser } from '../runtime/traverser'\nimport type { NodeClass, NodeFunction, WorkflowBlueprint, WorkflowResult } from '../types'\n\n/**\n * Represents the controlled, step-by-step execution of a workflow.\n * Returned by the `createStepper` utility.\n */\nexport interface IWorkflowStepper<TContext extends Record<string, any>> {\n\t/** The current state of the workflow. Can be inspected after each step. */\n\treadonly state: WorkflowState<TContext>\n\n\t/** The graph traverser instance. Can be used to inspect the frontier or completed nodes. */\n\treadonly traverser: GraphTraverser\n\n\t/**\n\t * Executes the next \"turn\" or batch of ready nodes in the workflow.\n\t * @param options Optional configuration for this specific step, like a cancellation signal.\n\t * @returns A `WorkflowResult` representing the state after the step, or `null` if the workflow has already completed.\n\t */\n\tnext(options?: { signal?: AbortSignal; concurrency?: number }): Promise<WorkflowResult<TContext> | null>\n\n\t/**\n\t * Reverts the workflow to its previous state.\n\t * @returns The `WorkflowResult` of the previous state, or `null` if there is no history to revert to.\n\t */\n\tprev(): Promise<WorkflowResult<TContext> | null>\n\n\t/**\n\t * Resets the stepper to its initial state, clearing all progress and history.\n\t */\n\treset(): void\n\n\t/**\n\t * A convenience method to check if the workflow has any more steps to run.\n\t * @returns `true` if the workflow is complete or stalled, `false` otherwise.\n\t */\n\tisDone(): boolean\n}\n\n/**\n * A test utility that creates a stepper to execute a workflow one \"turn\" at a time.\n * This is invaluable for debugging and writing fine-grained tests where you need to\n * assert the state of the workflow after each logical step.\n *\n * @example\n * // In your test file\n * it('should correctly execute step-by-step', async () => {\n * const runtime = new FlowRuntime({ ... });\n * const flow = createFlow('test')\n * .node('a', async () => ({ output: 10 }))\n * .node('b', async ({ input }) => ({ output: input * 2 }))\n * .edge('a', 'b');\n *\n * const stepper = await createStepper(runtime, flow.toBlueprint(), flow.getFunctionRegistry());\n *\n * // First step (executes node 'a')\n * const result1 = await stepper.next();\n * expect(stepper.isDone()).toBe(false);\n * expect(result1.status).toBe('stalled');\n * expect(result1.context._outputs.a).toBe(10);\n *\n * // Second step (executes node 'b')\n * const result2 = await stepper.next();\n * expect(stepper.isDone()).toBe(true);\n * expect(result2.status).toBe('completed');\n * expect(result2.context._outputs.b).toBe(20);\n *\n * // Final step (no more work)\n * const result3 = await stepper.next();\n * expect(result3).toBeNull();\n * });\n *\n * @param runtime The `FlowRuntime` instance, used for its configuration.\n * @param blueprint The `WorkflowBlueprint` to execute.\n * @param functionRegistry The function registry from createFlow, containing the node implementations.\n * @param initialState The initial state for the workflow run.\n * @returns A Promise that resolves to an `IWorkflowStepper` instance.\n */\nexport async function createStepper<TContext extends Record<string, any>, TDependencies extends Record<string, any>>(\n\truntime: FlowRuntime<TContext, TDependencies>,\n\tblueprint: WorkflowBlueprint,\n\tfunctionRegistry: Map<string, NodeFunction | NodeClass>,\n\tinitialState: Partial<TContext> = {},\n): Promise<IWorkflowStepper<TContext>> {\n\tconst _initialBlueprint = structuredClone(blueprint)\n\tconst _initialState = structuredClone(initialState)\n\n\tlet state: WorkflowState<TContext>\n\tlet traverser: GraphTraverser\n\tconst history: string[] = []\n\n\tconst orchestrator = new StepByStepOrchestrator()\n\tconst executionId = globalThis.crypto?.randomUUID()\n\tconst nodeRegistry = new Map([...runtime.registry, ...functionRegistry])\n\n\tconst initialize = () => {\n\t\tstate = new WorkflowState<TContext>(_initialState)\n\t\ttraverser = new GraphTraverser(_initialBlueprint)\n\t\thistory.length = 0\n\t}\n\n\tinitialize()\n\n\tconst stepper: IWorkflowStepper<TContext> = {\n\t\tget state() {\n\t\t\treturn state\n\t\t},\n\t\tget traverser() {\n\t\t\treturn traverser\n\t\t},\n\t\tisDone() {\n\t\t\treturn !traverser.hasMoreWork() && !state.isAwaiting()\n\t\t},\n\t\treset() {\n\t\t\tinitialize()\n\t\t},\n\t\tasync prev() {\n\t\t\tconst previousStateJson = history.pop()\n\t\t\tif (!previousStateJson) {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\tconst previousStateData = runtime.serializer.deserialize(previousStateJson) as Partial<TContext>\n\n\t\t\tstate = new WorkflowState(previousStateData)\n\t\t\ttraverser = GraphTraverser.fromState(_initialBlueprint, state)\n\n\t\t\treturn state.toResult(runtime.serializer)\n\t\t},\n\t\tasync next(options: { signal?: AbortSignal; concurrency?: number } = {}) {\n\t\t\tif (stepper.isDone()) {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\tconst serializedContext = (await state.toResult(runtime.serializer)).serializedContext\n\t\t\thistory.push(serializedContext)\n\n\t\t\tconst executionContext = new ExecutionContext(\n\t\t\t\t_initialBlueprint,\n\t\t\t\tstate,\n\t\t\t\tnodeRegistry,\n\t\t\t\texecutionId,\n\t\t\t\truntime,\n\t\t\t\t{\n\t\t\t\t\tlogger: runtime.logger,\n\t\t\t\t\teventBus: runtime.eventBus,\n\t\t\t\t\tserializer: runtime.serializer,\n\t\t\t\t\tevaluator: runtime.evaluator,\n\t\t\t\t\tmiddleware: runtime.middleware,\n\t\t\t\t\tdependencies: runtime.dependencies,\n\t\t\t\t},\n\t\t\t\toptions.signal,\n\t\t\t\toptions.concurrency,\n\t\t\t)\n\t\t\treturn orchestrator.run(executionContext, traverser)\n\t\t},\n\t}\n\n\treturn stepper\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import { DIContainer } from './container.js';
2
+ import { u as RuntimeDependencies, x as ILogger, A as ISerializer, w as IEvaluator, z as IEventBus, M as Middleware, n as NodeFunction, o as NodeClass, g as WorkflowBlueprint } from './types-ezHUBdpL.js';
3
+ import './errors.js';
4
+
5
+ interface ContainerOptions<TDependencies extends RuntimeDependencies = RuntimeDependencies> {
6
+ logger?: ILogger;
7
+ serializer?: ISerializer;
8
+ evaluator?: IEvaluator;
9
+ eventBus?: IEventBus;
10
+ middleware?: Middleware[];
11
+ registry?: Record<string, NodeFunction | NodeClass>;
12
+ blueprints?: Record<string, WorkflowBlueprint>;
13
+ dependencies?: TDependencies;
14
+ }
15
+ declare function createDefaultContainer<TDependencies extends RuntimeDependencies = RuntimeDependencies>(options?: ContainerOptions<TDependencies>): DIContainer;
16
+
17
+ export { type ContainerOptions, createDefaultContainer };
@@ -0,0 +1,13 @@
1
+ export { createDefaultContainer } from './chunk-QNYXQKFW.js';
2
+ import './chunk-33NO4PUJ.js';
3
+ import './chunk-HAZ26F3P.js';
4
+ import './chunk-FRKO3WX4.js';
5
+ import './chunk-CD4FUZOJ.js';
6
+ import './chunk-4PELJWF7.js';
7
+ import './chunk-CYHZ2YVH.js';
8
+ import './chunk-WWGFIYKW.js';
9
+ import './chunk-R3HQXIEL.js';
10
+ import './chunk-BCRWXTWX.js';
11
+ import './chunk-PH2IYZHV.js';
12
+ //# sourceMappingURL=container-factory.js.map
13
+ //# sourceMappingURL=container-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"container-factory.js"}
@@ -0,0 +1,23 @@
1
+ type ServiceToken<_T = any> = string | symbol;
2
+ declare class DIContainer {
3
+ private services;
4
+ private factories;
5
+ register<T>(token: ServiceToken<T>, implementation: T): void;
6
+ registerFactory<T>(token: ServiceToken<T>, factory: (container: DIContainer) => T): void;
7
+ resolve<T>(token: ServiceToken<T>): T;
8
+ has(token: ServiceToken): boolean;
9
+ createChild(): DIContainer;
10
+ }
11
+ declare const ServiceTokens: {
12
+ readonly Logger: symbol;
13
+ readonly Serializer: symbol;
14
+ readonly Evaluator: symbol;
15
+ readonly EventBus: symbol;
16
+ readonly Orchestrator: symbol;
17
+ readonly Middleware: symbol;
18
+ readonly NodeRegistry: symbol;
19
+ readonly BlueprintRegistry: symbol;
20
+ readonly Dependencies: symbol;
21
+ };
22
+
23
+ export { DIContainer, type ServiceToken, ServiceTokens };
@@ -0,0 +1,3 @@
1
+ export { DIContainer, ServiceTokens } from './chunk-WWGFIYKW.js';
2
+ //# sourceMappingURL=container.js.map
3
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"container.js"}
package/dist/context.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { I as ISyncContext, h as IAsyncContext } from './types-CQCe_nBM.js';
1
+ import { s as ISyncContext, t as IAsyncContext } from './types-ezHUBdpL.js';
2
+ import './errors.js';
3
+ import './container.js';
2
4
 
3
5
  /**
4
6
  * A default, high-performance, in-memory implementation of ISyncContext using a Map.
package/dist/context.js CHANGED
@@ -1,3 +1,3 @@
1
- export { AsyncContextView, Context } from './chunk-KWQHFT7E.js';
1
+ export { AsyncContextView, Context } from './chunk-R3HQXIEL.js';
2
2
  //# sourceMappingURL=context.js.map
3
3
  //# sourceMappingURL=context.js.map
package/dist/errors.d.ts CHANGED
@@ -1,19 +1,20 @@
1
- /** Error thrown when a node fails during execution. */
2
- declare class NodeExecutionError extends Error {
3
- readonly nodeId: string;
4
- readonly blueprintId: string;
5
- readonly originalError?: Error | undefined;
6
- readonly executionId?: string | undefined;
7
- constructor(message: string, nodeId: string, blueprintId: string, originalError?: Error | undefined, executionId?: string | undefined);
8
- }
9
- /** Error thrown when a workflow is gracefully aborted. */
10
- declare class CancelledWorkflowError extends Error {
11
- readonly executionId?: string | undefined;
12
- constructor(message?: string, executionId?: string | undefined);
13
- }
14
- /** Error thrown for a non-recoverable failure that should halt the workflow immediately. */
15
- declare class FatalNodeExecutionError extends NodeExecutionError {
16
- constructor(message: string, nodeId: string, blueprintId: string, originalError?: Error, executionId?: string);
1
+ /**
2
+ * A single, comprehensive error class for the framework.
3
+ * Use this for all errors to ensure consistent structure and easy debugging.
4
+ */
5
+ declare class FlowcraftError extends Error {
6
+ readonly message: string;
7
+ readonly nodeId?: string;
8
+ readonly blueprintId?: string;
9
+ readonly executionId?: string;
10
+ readonly isFatal: boolean;
11
+ constructor(message: string, options?: {
12
+ cause?: Error;
13
+ nodeId?: string;
14
+ blueprintId?: string;
15
+ executionId?: string;
16
+ isFatal?: boolean;
17
+ });
17
18
  }
18
19
 
19
- export { CancelledWorkflowError, FatalNodeExecutionError, NodeExecutionError };
20
+ export { FlowcraftError };
package/dist/errors.js CHANGED
@@ -1,3 +1,3 @@
1
- export { CancelledWorkflowError, FatalNodeExecutionError, NodeExecutionError } from './chunk-5ZXV3R5D.js';
1
+ export { FlowcraftError } from './chunk-BCRWXTWX.js';
2
2
  //# sourceMappingURL=errors.js.map
3
3
  //# sourceMappingURL=errors.js.map
@@ -1,4 +1,6 @@
1
- import { k as IEvaluator } from './types-CQCe_nBM.js';
1
+ import { w as IEvaluator } from './types-ezHUBdpL.js';
2
+ import './errors.js';
3
+ import './container.js';
2
4
 
3
5
  /**
4
6
  * A safe evaluator that only allows simple property access.
package/dist/flow.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { d as NodeFunction, e as NodeClass, N as NodeDefinition, E as EdgeDefinition, W as WorkflowBlueprint } from './types-CQCe_nBM.js';
1
+ import { n as NodeFunction, o as NodeClass, h as NodeDefinition, j as EdgeDefinition, g as WorkflowBlueprint, U as UIGraph } from './types-ezHUBdpL.js';
2
+ import './errors.js';
3
+ import './container.js';
2
4
 
3
5
  /**
4
6
  * A fluent API for programmatically constructing a WorkflowBlueprint.
@@ -8,25 +10,37 @@ declare class Flow<TContext extends Record<string, any> = Record<string, any>, T
8
10
  private functionRegistry;
9
11
  private loopControllerIds;
10
12
  private loopDefinitions;
13
+ private batchDefinitions;
14
+ private cycleEntryPoints;
11
15
  constructor(id: string);
12
16
  node<TInput = any, TOutput = any, TAction extends string = string>(id: string, implementation: NodeFunction<TContext, TDependencies, TInput, TOutput, TAction> | NodeClass<TContext, TDependencies, TInput, TOutput, TAction>, options?: Omit<NodeDefinition, 'id' | 'uses'>): this;
13
17
  edge(source: string, target: string, options?: Omit<EdgeDefinition, 'source' | 'target'>): this;
14
18
  /**
15
19
  * Creates a batch processing pattern.
16
20
  * It takes an input array, runs a worker node on each item in parallel, and gathers the results.
21
+ * This method augments the Flow's TContext with a new key for the output array.
22
+ *
17
23
  * @param id The base ID for this batch operation.
18
24
  * @param worker The node implementation to run on each item.
19
25
  * @param options Configuration for the batch operation.
20
- * @param options.inputKey The key in the context that holds the input array for the batch.
21
- * @param options.outputKey The key in the context where the array of results will be stored.
22
- * @returns The Flow instance for chaining.
26
+ * @returns The Flow instance with an updated context type for chaining.
23
27
  */
24
- batch<TInput = any, TOutput = any, TAction extends string = string>(id: string, worker: NodeFunction<TContext, TDependencies, TInput, TOutput, TAction> | NodeClass<TContext, TDependencies, TInput, TOutput, TAction>, options: {
28
+ batch<TWorkerInput, TWorkerOutput, TWorkerAction extends string, TOutputKey extends string>(id: string, worker: NodeFunction<TContext, TDependencies, TWorkerInput, TWorkerOutput, TWorkerAction> | NodeClass<TContext, TDependencies, TWorkerInput, TWorkerOutput, TWorkerAction>, options: {
25
29
  /** The key in the context that holds the input array for the batch. */
26
30
  inputKey: keyof TContext;
27
31
  /** The key in the context where the array of results will be stored. */
28
- outputKey: keyof TContext;
29
- }): this;
32
+ outputKey: TOutputKey;
33
+ /** The number of items to process in each chunk to limit memory usage. */
34
+ chunkSize?: number;
35
+ }): Flow<TContext & {
36
+ [K in TOutputKey]: TWorkerOutput[];
37
+ }, TDependencies>;
38
+ /**
39
+ * Creates a wait node that pauses workflow execution for external input.
40
+ * @param id A unique identifier for the wait node.
41
+ * @param options Optional configuration for the wait node.
42
+ */
43
+ wait(id: string, options?: Omit<NodeDefinition, 'id' | 'uses'>): this;
30
44
  /**
31
45
  * Creates a loop pattern in the workflow graph.
32
46
  * @param id A unique identifier for the loop construct.
@@ -44,8 +58,15 @@ declare class Flow<TContext extends Record<string, any> = Record<string, any>, T
44
58
  condition: string;
45
59
  }): this;
46
60
  getLoopControllerId(id: string): string;
61
+ /**
62
+ * Sets the preferred entry point for a cycle in non-DAG workflows.
63
+ * This helps remove ambiguity when the runtime needs to choose a starting node for cycles.
64
+ * @param nodeId The ID of the node to use as the entry point for cycles containing this node.
65
+ */
66
+ setCycleEntryPoint(nodeId: string): this;
47
67
  toBlueprint(): WorkflowBlueprint;
48
- getFunctionRegistry(): Map<string, NodeClass | NodeFunction>;
68
+ getFunctionRegistry(): Map<string, NodeFunction | NodeClass>;
69
+ toGraphRepresentation(): UIGraph;
49
70
  }
50
71
  /**
51
72
  * Helper function to create a new Flow builder instance.
package/dist/flow.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Flow, createFlow } from './chunk-4A627Q6L.js';
2
- import './chunk-U5V5O5MN.js';
1
+ export { Flow, createFlow } from './chunk-C4HYIJI3.js';
2
+ import './chunk-LNK7LZER.js';
3
3
  //# sourceMappingURL=flow.js.map
4
4
  //# sourceMappingURL=flow.js.map
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  export { BlueprintAnalysis, Cycles, analyzeBlueprint, checkForCycles, generateMermaid } from './analysis.js';
2
+ export { DIContainer, ServiceToken, ServiceTokens } from './container.js';
3
+ export { ContainerOptions, createDefaultContainer } from './container-factory.js';
2
4
  export { AsyncContextView, Context } from './context.js';
3
- export { CancelledWorkflowError, FatalNodeExecutionError, NodeExecutionError } from './errors.js';
5
+ export { FlowcraftError } from './errors.js';
4
6
  export { PropertyEvaluator, UnsafeEvaluator } from './evaluator.js';
5
7
  export { Flow, createFlow } from './flow.js';
6
8
  export { LinterIssue, LinterIssueCode, LinterResult, lintBlueprint } from './linter.js';
7
9
  export { ConsoleLogger, NullLogger } from './logger.js';
8
- export { B as BaseNode, C as ContextImplementation, E as EdgeDefinition, h as IAsyncContext, k as IEvaluator, m as IEventBus, l as ILogger, n as ISerializer, I as ISyncContext, M as Middleware, e as NodeClass, a as NodeConfig, c as NodeContext, N as NodeDefinition, d as NodeFunction, f as NodeImplementation, g as NodeRegistry, b as NodeResult, R as RuntimeDependencies, j as RuntimeOptions, W as WorkflowBlueprint, o as WorkflowError, p as WorkflowResult, i as isNodeClass } from './types-CQCe_nBM.js';
10
+ export { B as BaseNode, C as ClassNodeExecutor, r as ContextImplementation, j as EdgeDefinition, e as ExecutionServices, E as ExecutionStrategy, c as FlowRuntime, y as FlowcraftEvent, F as FunctionNodeExecutor, G as GraphTraverser, t as IAsyncContext, w as IEvaluator, z as IEventBus, x as ILogger, I as IOrchestrator, f as IRuntime, A as ISerializer, s as ISyncContext, M as Middleware, o as NodeClass, k as NodeConfig, m as NodeContext, h as NodeDefinition, N as NodeExecutionResult, b as NodeExecutor, a as NodeExecutorConfig, d as NodeExecutorFactory, n as NodeFunction, p as NodeImplementation, q as NodeRegistry, l as NodeResult, R as ReadyNode, u as RuntimeDependencies, v as RuntimeOptions, U as UIGraph, g as WorkflowBlueprint, D as WorkflowError, J as WorkflowResult, W as WorkflowState, H as WorkflowStatus, i as isNodeClass } from './types-ezHUBdpL.js';
9
11
  export { AdapterOptions, BaseDistributedAdapter, ICoordinationStore, JobPayload } from './runtime/adapter.js';
10
- export { BuiltInNodeExecutor, ClassNodeExecutor, ExecutionStrategy, FunctionNodeExecutor } from './runtime/executors.js';
11
- export { FlowRuntime } from './runtime/runtime.js';
12
- export { WorkflowState } from './runtime/state.js';
13
- export { GraphTraverser } from './runtime/traverser.js';
12
+ export { DefaultOrchestrator } from './runtime/orchestrator.js';
13
+ export { executeBatch, processResults } from './runtime/orchestrators/utils.js';
14
14
  export { sanitizeBlueprint } from './sanitizer.js';
15
- import './runtime/types.js';
15
+ export { JsonSerializer } from './serializer.js';
package/dist/index.js CHANGED
@@ -1,19 +1,31 @@
1
- import './chunk-55J6XMHW.js';
2
- import './chunk-HMR2GEGE.js';
3
- export { BaseDistributedAdapter } from './chunk-O3XD45IL.js';
4
- export { FlowRuntime } from './chunk-3XVVR2SR.js';
5
- export { WorkflowState } from './chunk-CSZ6EOWG.js';
6
- export { GraphTraverser } from './chunk-NBIRTKZ7.js';
1
+ import './chunk-NVJ3ZO3P.js';
2
+ import './chunk-NVLZFLYM.js';
3
+ export { BaseDistributedAdapter } from './chunk-6INWPSZT.js';
4
+ export { FlowRuntime } from './chunk-IB2BISIC.js';
5
+ import './chunk-MCGK3FXQ.js';
6
+ import './chunk-DL7KVYZF.js';
7
+ export { ClassNodeExecutor, FunctionNodeExecutor, NodeExecutor } from './chunk-ONH7PIJZ.js';
8
+ import './chunk-5KKSQWSC.js';
9
+ import './chunk-CD3Q4N6V.js';
10
+ export { GraphTraverser } from './chunk-G5BGBPFP.js';
11
+ export { lintBlueprint } from './chunk-EUJWJWFA.js';
7
12
  export { sanitizeBlueprint } from './chunk-DSYAC4WB.js';
8
- import './chunk-CYHZ2YVH.js';
9
- export { BuiltInNodeExecutor, ClassNodeExecutor, FunctionNodeExecutor } from './chunk-M2FRTT2K.js';
10
- export { AsyncContextView, Context } from './chunk-KWQHFT7E.js';
11
- export { CancelledWorkflowError, FatalNodeExecutionError, NodeExecutionError } from './chunk-5ZXV3R5D.js';
12
- export { PropertyEvaluator, UnsafeEvaluator } from './chunk-PH2IYZHV.js';
13
- export { Flow, createFlow } from './chunk-4A627Q6L.js';
14
- export { BaseNode, isNodeClass } from './chunk-U5V5O5MN.js';
15
- export { lintBlueprint } from './chunk-UETC63DP.js';
16
- export { analyzeBlueprint, checkForCycles, generateMermaid } from './chunk-HN72TZY5.js';
13
+ import './chunk-55J6XMHW.js';
14
+ import './chunk-BC4G7OM6.js';
15
+ import './chunk-RM677CNU.js';
16
+ export { analyzeBlueprint, checkForCycles, generateMermaid } from './chunk-233SESC2.js';
17
+ export { createDefaultContainer } from './chunk-QNYXQKFW.js';
18
+ export { DefaultOrchestrator } from './chunk-33NO4PUJ.js';
19
+ export { executeBatch, processResults } from './chunk-HAZ26F3P.js';
20
+ import './chunk-FRKO3WX4.js';
21
+ export { WorkflowState } from './chunk-CD4FUZOJ.js';
17
22
  export { ConsoleLogger, NullLogger } from './chunk-4PELJWF7.js';
23
+ export { JsonSerializer } from './chunk-CYHZ2YVH.js';
24
+ export { DIContainer, ServiceTokens } from './chunk-WWGFIYKW.js';
25
+ export { AsyncContextView, Context } from './chunk-R3HQXIEL.js';
26
+ export { FlowcraftError } from './chunk-BCRWXTWX.js';
27
+ export { PropertyEvaluator, UnsafeEvaluator } from './chunk-PH2IYZHV.js';
28
+ export { Flow, createFlow } from './chunk-C4HYIJI3.js';
29
+ export { BaseNode, isNodeClass } from './chunk-LNK7LZER.js';
18
30
  //# sourceMappingURL=index.js.map
19
31
  //# sourceMappingURL=index.js.map
package/dist/linter.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- import { W as WorkflowBlueprint, d as NodeFunction, e as NodeClass } from './types-CQCe_nBM.js';
1
+ import { g as WorkflowBlueprint, n as NodeFunction, o as NodeClass } from './types-ezHUBdpL.js';
2
+ import './errors.js';
3
+ import './container.js';
2
4
 
3
- type LinterIssueCode = 'INVALID_EDGE_SOURCE' | 'INVALID_EDGE_TARGET' | 'MISSING_NODE_IMPLEMENTATION' | 'ORPHAN_NODE';
5
+ type LinterIssueCode = 'INVALID_EDGE_SOURCE' | 'INVALID_EDGE_TARGET' | 'MISSING_NODE_IMPLEMENTATION' | 'ORPHAN_NODE' | 'INVALID_BATCH_WORKER_KEY' | 'INVALID_SUBFLOW_BLUEPRINT_ID';
4
6
  interface LinterIssue {
5
7
  code: LinterIssueCode;
6
8
  message: string;
@@ -19,6 +21,6 @@ interface LinterResult {
19
21
  * @param registry A map of node implementations (functions or classes) to check against.
20
22
  * @returns A LinterResult object containing any issues found.
21
23
  */
22
- declare function lintBlueprint(blueprint: WorkflowBlueprint, registry: Map<string, NodeFunction | NodeClass> | Record<string, NodeFunction | NodeClass>): LinterResult;
24
+ declare function lintBlueprint(blueprint: WorkflowBlueprint, registry: Map<string, NodeFunction | NodeClass> | Record<string, NodeFunction | NodeClass>, blueprints?: Record<string, WorkflowBlueprint>): LinterResult;
23
25
 
24
26
  export { type LinterIssue, type LinterIssueCode, type LinterResult, lintBlueprint };
package/dist/linter.js CHANGED
@@ -1,4 +1,4 @@
1
- export { lintBlueprint } from './chunk-UETC63DP.js';
2
- import './chunk-HN72TZY5.js';
1
+ export { lintBlueprint } from './chunk-EUJWJWFA.js';
2
+ import './chunk-233SESC2.js';
3
3
  //# sourceMappingURL=linter.js.map
4
4
  //# sourceMappingURL=linter.js.map
package/dist/logger.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { l as ILogger } from './types-CQCe_nBM.js';
1
+ import { x as ILogger } from './types-ezHUBdpL.js';
2
+ import './errors.js';
3
+ import './container.js';
2
4
 
3
5
  /** A logger implementation that outputs to the console. */
4
6
  declare class ConsoleLogger implements ILogger {