flowcraft 2.2.0 → 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 (147) hide show
  1. package/README.md +40 -34
  2. package/dist/analysis.d.ts +3 -1
  3. package/dist/chunk-33NO4PUJ.js +74 -0
  4. package/dist/chunk-33NO4PUJ.js.map +1 -0
  5. package/dist/chunk-5KKSQWSC.js +90 -0
  6. package/dist/chunk-5KKSQWSC.js.map +1 -0
  7. package/dist/{chunk-QLGJUDQF.js → chunk-6INWPSZT.js} +6 -6
  8. package/dist/chunk-6INWPSZT.js.map +1 -0
  9. package/dist/chunk-BC4G7OM6.js +42 -0
  10. package/dist/chunk-BC4G7OM6.js.map +1 -0
  11. package/dist/chunk-BCRWXTWX.js +21 -0
  12. package/dist/chunk-BCRWXTWX.js.map +1 -0
  13. package/dist/{chunk-ZCHFZBGL.js → chunk-C4HYIJI3.js} +120 -5
  14. package/dist/chunk-C4HYIJI3.js.map +1 -0
  15. package/dist/chunk-CD3Q4N6V.js +13 -0
  16. package/dist/chunk-CD3Q4N6V.js.map +1 -0
  17. package/dist/chunk-CD4FUZOJ.js +114 -0
  18. package/dist/chunk-CD4FUZOJ.js.map +1 -0
  19. package/dist/chunk-CY755I7I.js +25 -0
  20. package/dist/chunk-CY755I7I.js.map +1 -0
  21. package/dist/chunk-DL7KVYZF.js +39 -0
  22. package/dist/chunk-DL7KVYZF.js.map +1 -0
  23. package/dist/chunk-FRKO3WX4.js +32 -0
  24. package/dist/chunk-FRKO3WX4.js.map +1 -0
  25. package/dist/chunk-G53CSLBF.js +54 -0
  26. package/dist/chunk-G53CSLBF.js.map +1 -0
  27. package/dist/chunk-G5BGBPFP.js +172 -0
  28. package/dist/chunk-G5BGBPFP.js.map +1 -0
  29. package/dist/chunk-HAZ26F3P.js +98 -0
  30. package/dist/chunk-HAZ26F3P.js.map +1 -0
  31. package/dist/chunk-IB2BISIC.js +446 -0
  32. package/dist/chunk-IB2BISIC.js.map +1 -0
  33. package/dist/{chunk-U5V5O5MN.js → chunk-LNK7LZER.js} +5 -3
  34. package/dist/chunk-LNK7LZER.js.map +1 -0
  35. package/dist/chunk-MCGK3FXQ.js +143 -0
  36. package/dist/chunk-MCGK3FXQ.js.map +1 -0
  37. package/dist/chunk-MUYLRTSR.js +82 -0
  38. package/dist/chunk-MUYLRTSR.js.map +1 -0
  39. package/dist/chunk-NVJ3ZO3P.js +3 -0
  40. package/dist/{chunk-HMR2GEGE.js.map → chunk-NVJ3ZO3P.js.map} +1 -1
  41. package/dist/chunk-NVLZFLYM.js +3 -0
  42. package/dist/chunk-NVLZFLYM.js.map +1 -0
  43. package/dist/chunk-ONH7PIJZ.js +300 -0
  44. package/dist/chunk-ONH7PIJZ.js.map +1 -0
  45. package/dist/chunk-QNYXQKFW.js +25 -0
  46. package/dist/chunk-QNYXQKFW.js.map +1 -0
  47. package/dist/chunk-RM677CNU.js +52 -0
  48. package/dist/chunk-RM677CNU.js.map +1 -0
  49. package/dist/chunk-WWGFIYKW.js +47 -0
  50. package/dist/chunk-WWGFIYKW.js.map +1 -0
  51. package/dist/chunk-XNRIM27H.js +76 -0
  52. package/dist/chunk-XNRIM27H.js.map +1 -0
  53. package/dist/container-factory.d.ts +17 -0
  54. package/dist/container-factory.js +13 -0
  55. package/dist/container-factory.js.map +1 -0
  56. package/dist/container.d.ts +23 -0
  57. package/dist/container.js +3 -0
  58. package/dist/container.js.map +1 -0
  59. package/dist/context.d.ts +3 -1
  60. package/dist/errors.d.ts +18 -17
  61. package/dist/errors.js +1 -1
  62. package/dist/evaluator.d.ts +3 -1
  63. package/dist/flow.d.ts +12 -2
  64. package/dist/flow.js +2 -2
  65. package/dist/index.d.ts +7 -8
  66. package/dist/index.js +26 -14
  67. package/dist/linter.d.ts +3 -1
  68. package/dist/logger.d.ts +3 -1
  69. package/dist/node.d.ts +3 -1
  70. package/dist/node.js +1 -1
  71. package/dist/nodes/batch-gather.d.ts +9 -0
  72. package/dist/nodes/batch-gather.js +4 -0
  73. package/dist/nodes/batch-gather.js.map +1 -0
  74. package/dist/nodes/batch-scatter.d.ts +9 -0
  75. package/dist/nodes/batch-scatter.js +4 -0
  76. package/dist/nodes/batch-scatter.js.map +1 -0
  77. package/dist/nodes/subflow.d.ts +9 -0
  78. package/dist/nodes/subflow.js +10 -0
  79. package/dist/nodes/subflow.js.map +1 -0
  80. package/dist/nodes/wait.d.ts +9 -0
  81. package/dist/nodes/wait.js +4 -0
  82. package/dist/nodes/wait.js.map +1 -0
  83. package/dist/runtime/adapter.d.ts +3 -5
  84. package/dist/runtime/adapter.js +19 -9
  85. package/dist/runtime/execution-context.d.ts +3 -0
  86. package/dist/runtime/execution-context.js +6 -0
  87. package/dist/runtime/execution-context.js.map +1 -0
  88. package/dist/runtime/executors.d.ts +3 -26
  89. package/dist/runtime/executors.js +2 -2
  90. package/dist/runtime/index.d.ts +5 -7
  91. package/dist/runtime/index.js +21 -10
  92. package/dist/runtime/node-executor-factory.d.ts +12 -0
  93. package/dist/runtime/node-executor-factory.js +6 -0
  94. package/dist/runtime/node-executor-factory.js.map +1 -0
  95. package/dist/runtime/orchestrator.d.ts +9 -0
  96. package/dist/runtime/orchestrator.js +8 -0
  97. package/dist/runtime/orchestrator.js.map +1 -0
  98. package/dist/runtime/orchestrators/step-by-step.d.ts +16 -0
  99. package/dist/runtime/orchestrators/step-by-step.js +5 -0
  100. package/dist/runtime/orchestrators/step-by-step.js.map +1 -0
  101. package/dist/runtime/orchestrators/utils.d.ts +35 -0
  102. package/dist/runtime/orchestrators/utils.js +4 -0
  103. package/dist/runtime/orchestrators/utils.js.map +1 -0
  104. package/dist/runtime/runtime.d.ts +3 -41
  105. package/dist/runtime/runtime.js +18 -8
  106. package/dist/runtime/state.d.ts +3 -21
  107. package/dist/runtime/state.js +2 -1
  108. package/dist/runtime/traverser.d.ts +3 -26
  109. package/dist/runtime/traverser.js +1 -2
  110. package/dist/runtime/types.d.ts +3 -16
  111. package/dist/runtime/types.js +1 -1
  112. package/dist/runtime/workflow-logic-handler.d.ts +17 -0
  113. package/dist/runtime/workflow-logic-handler.js +5 -0
  114. package/dist/runtime/workflow-logic-handler.js.map +1 -0
  115. package/dist/sanitizer.d.ts +3 -1
  116. package/dist/serializer.d.ts +3 -1
  117. package/dist/testing/event-logger.d.ts +63 -0
  118. package/dist/testing/event-logger.js +3 -0
  119. package/dist/testing/event-logger.js.map +1 -0
  120. package/dist/testing/index.d.ts +6 -0
  121. package/dist/testing/index.js +31 -0
  122. package/dist/testing/index.js.map +1 -0
  123. package/dist/testing/run-with-trace.d.ts +38 -0
  124. package/dist/testing/run-with-trace.js +29 -0
  125. package/dist/testing/run-with-trace.js.map +1 -0
  126. package/dist/testing/stepper.d.ts +79 -0
  127. package/dist/testing/stepper.js +11 -0
  128. package/dist/testing/stepper.js.map +1 -0
  129. package/dist/types-ezHUBdpL.d.ts +564 -0
  130. package/dist/types.d.ts +3 -1
  131. package/package.json +55 -51
  132. package/LICENSE +0 -21
  133. package/dist/chunk-5ZXV3R5D.js +0 -28
  134. package/dist/chunk-5ZXV3R5D.js.map +0 -1
  135. package/dist/chunk-GEKDR2SS.js +0 -201
  136. package/dist/chunk-GEKDR2SS.js.map +0 -1
  137. package/dist/chunk-HMR2GEGE.js +0 -3
  138. package/dist/chunk-M2FRTT2K.js +0 -144
  139. package/dist/chunk-M2FRTT2K.js.map +0 -1
  140. package/dist/chunk-OTS5YJ3S.js +0 -494
  141. package/dist/chunk-OTS5YJ3S.js.map +0 -1
  142. package/dist/chunk-QLGJUDQF.js.map +0 -1
  143. package/dist/chunk-U5V5O5MN.js.map +0 -1
  144. package/dist/chunk-VSGQDLBF.js +0 -61
  145. package/dist/chunk-VSGQDLBF.js.map +0 -1
  146. package/dist/chunk-ZCHFZBGL.js.map +0 -1
  147. package/dist/types-CsTeXTiA.d.ts +0 -222
@@ -1,8 +1,6 @@
1
- import { j as RuntimeOptions, n as ISerializer, h as IAsyncContext, p as WorkflowResult, W as WorkflowBlueprint } from '../types-CsTeXTiA.js';
2
- import { FlowRuntime } from './runtime.js';
3
- import './builtin-keys.js';
4
- import './state.js';
5
- import './types.js';
1
+ import { v as RuntimeOptions, c as FlowRuntime, A as ISerializer, t as IAsyncContext, J as WorkflowResult, g as WorkflowBlueprint } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
6
4
 
7
5
  /**
8
6
  * Defines the contract for an atomic, distributed key-value store required by
@@ -1,15 +1,25 @@
1
- export { BaseDistributedAdapter } from '../chunk-QLGJUDQF.js';
2
- import '../chunk-OTS5YJ3S.js';
3
- import '../chunk-VSGQDLBF.js';
4
- import '../chunk-GEKDR2SS.js';
1
+ export { BaseDistributedAdapter } from '../chunk-6INWPSZT.js';
2
+ import '../chunk-IB2BISIC.js';
3
+ import '../chunk-MCGK3FXQ.js';
4
+ import '../chunk-DL7KVYZF.js';
5
+ import '../chunk-ONH7PIJZ.js';
6
+ import '../chunk-5KKSQWSC.js';
7
+ import '../chunk-CD3Q4N6V.js';
8
+ import '../chunk-G5BGBPFP.js';
5
9
  import '../chunk-DSYAC4WB.js';
10
+ import '../chunk-BC4G7OM6.js';
11
+ import '../chunk-RM677CNU.js';
12
+ import '../chunk-233SESC2.js';
13
+ import '../chunk-33NO4PUJ.js';
14
+ import '../chunk-HAZ26F3P.js';
15
+ import '../chunk-FRKO3WX4.js';
16
+ import '../chunk-CD4FUZOJ.js';
17
+ import '../chunk-4PELJWF7.js';
6
18
  import '../chunk-CYHZ2YVH.js';
7
- import '../chunk-M2FRTT2K.js';
19
+ import '../chunk-WWGFIYKW.js';
8
20
  import '../chunk-R3HQXIEL.js';
9
- import '../chunk-5ZXV3R5D.js';
21
+ import '../chunk-BCRWXTWX.js';
10
22
  import '../chunk-PH2IYZHV.js';
11
- import '../chunk-U5V5O5MN.js';
12
- import '../chunk-233SESC2.js';
13
- import '../chunk-4PELJWF7.js';
23
+ import '../chunk-LNK7LZER.js';
14
24
  //# sourceMappingURL=adapter.js.map
15
25
  //# sourceMappingURL=adapter.js.map
@@ -0,0 +1,3 @@
1
+ export { K as ExecutionContext } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
@@ -0,0 +1,6 @@
1
+ export { ExecutionContext } from '../chunk-FRKO3WX4.js';
2
+ import '../chunk-CD4FUZOJ.js';
3
+ import '../chunk-R3HQXIEL.js';
4
+ import '../chunk-BCRWXTWX.js';
5
+ //# sourceMappingURL=execution-context.js.map
6
+ //# sourceMappingURL=execution-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"execution-context.js"}
@@ -1,26 +1,3 @@
1
- import { N as NodeDefinition, c as NodeContext, b as NodeResult, d as NodeFunction, m as IEventBus, e as NodeClass, C as ContextImplementation } from '../types-CsTeXTiA.js';
2
-
3
- interface ExecutionStrategy {
4
- execute: (nodeDef: NodeDefinition, context: NodeContext<any, any, any>, executionId?: string, signal?: AbortSignal) => Promise<NodeResult<any, any>>;
5
- }
6
- declare class FunctionNodeExecutor implements ExecutionStrategy {
7
- private implementation;
8
- private maxRetries;
9
- private eventBus;
10
- constructor(implementation: NodeFunction, maxRetries: number, eventBus: IEventBus);
11
- execute(nodeDef: NodeDefinition, context: NodeContext<any, any, any>, executionId?: string, signal?: AbortSignal): Promise<NodeResult<any, any>>;
12
- }
13
- declare class ClassNodeExecutor implements ExecutionStrategy {
14
- private implementation;
15
- private maxRetries;
16
- private eventBus;
17
- constructor(implementation: NodeClass, maxRetries: number, eventBus: IEventBus);
18
- execute(nodeDef: NodeDefinition, context: NodeContext<any, any, any>, executionId?: string, signal?: AbortSignal): Promise<NodeResult<any, any>>;
19
- }
20
- declare class BuiltInNodeExecutor implements ExecutionStrategy {
21
- private executeBuiltIn;
22
- constructor(executeBuiltIn: (nodeDef: NodeDefinition, context: ContextImplementation<any>) => Promise<NodeResult<any, any>>);
23
- execute(nodeDef: NodeDefinition, context: NodeContext<Record<string, unknown>, Record<string, unknown>, any>): Promise<NodeResult<any, any>>;
24
- }
25
-
26
- export { BuiltInNodeExecutor, ClassNodeExecutor, type ExecutionStrategy, FunctionNodeExecutor };
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-ezHUBdpL.js';
3
+ import '../container.js';
@@ -1,4 +1,4 @@
1
- export { BuiltInNodeExecutor, ClassNodeExecutor, FunctionNodeExecutor } from '../chunk-M2FRTT2K.js';
2
- import '../chunk-5ZXV3R5D.js';
1
+ export { ClassNodeExecutor, FunctionNodeExecutor, NodeExecutor } from '../chunk-ONH7PIJZ.js';
2
+ import '../chunk-BCRWXTWX.js';
3
3
  //# sourceMappingURL=executors.js.map
4
4
  //# sourceMappingURL=executors.js.map
@@ -1,8 +1,6 @@
1
1
  export { AdapterOptions, BaseDistributedAdapter, ICoordinationStore, JobPayload } from './adapter.js';
2
- export { BuiltInNodeExecutor, ClassNodeExecutor, ExecutionStrategy, FunctionNodeExecutor } from './executors.js';
3
- export { FlowRuntime } from './runtime.js';
4
- export { WorkflowState } from './state.js';
5
- export { GraphTraverser } from './traverser.js';
6
- import '../types-CsTeXTiA.js';
7
- import './builtin-keys.js';
8
- import './types.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-ezHUBdpL.js';
3
+ export { DefaultOrchestrator } from './orchestrator.js';
4
+ export { executeBatch, processResults } from './orchestrators/utils.js';
5
+ import '../errors.js';
6
+ import '../container.js';
@@ -1,16 +1,27 @@
1
- import '../chunk-HMR2GEGE.js';
2
- export { BaseDistributedAdapter } from '../chunk-QLGJUDQF.js';
3
- export { FlowRuntime } from '../chunk-OTS5YJ3S.js';
4
- export { WorkflowState } from '../chunk-VSGQDLBF.js';
5
- export { GraphTraverser } from '../chunk-GEKDR2SS.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';
6
11
  import '../chunk-DSYAC4WB.js';
12
+ import '../chunk-BC4G7OM6.js';
13
+ import '../chunk-RM677CNU.js';
14
+ import '../chunk-233SESC2.js';
15
+ export { DefaultOrchestrator } from '../chunk-33NO4PUJ.js';
16
+ export { executeBatch, processResults } from '../chunk-HAZ26F3P.js';
17
+ import '../chunk-FRKO3WX4.js';
18
+ export { WorkflowState } from '../chunk-CD4FUZOJ.js';
19
+ import '../chunk-4PELJWF7.js';
7
20
  import '../chunk-CYHZ2YVH.js';
8
- export { BuiltInNodeExecutor, ClassNodeExecutor, FunctionNodeExecutor } from '../chunk-M2FRTT2K.js';
21
+ import '../chunk-WWGFIYKW.js';
9
22
  import '../chunk-R3HQXIEL.js';
10
- import '../chunk-5ZXV3R5D.js';
23
+ import '../chunk-BCRWXTWX.js';
11
24
  import '../chunk-PH2IYZHV.js';
12
- import '../chunk-U5V5O5MN.js';
13
- import '../chunk-233SESC2.js';
14
- import '../chunk-4PELJWF7.js';
25
+ import '../chunk-LNK7LZER.js';
15
26
  //# sourceMappingURL=index.js.map
16
27
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,12 @@
1
+ import { z as IEventBus, K as ExecutionContext, b as NodeExecutor } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
4
+
5
+ declare class NodeExecutorFactory {
6
+ private readonly eventBus;
7
+ constructor(eventBus: IEventBus);
8
+ createExecutorForNode(nodeId: string, context: ExecutionContext<any, any>): NodeExecutor<any, any>;
9
+ private getExecutionStrategy;
10
+ }
11
+
12
+ export { NodeExecutorFactory };
@@ -0,0 +1,6 @@
1
+ export { NodeExecutorFactory } from '../chunk-DL7KVYZF.js';
2
+ import '../chunk-ONH7PIJZ.js';
3
+ import '../chunk-BCRWXTWX.js';
4
+ import '../chunk-LNK7LZER.js';
5
+ //# sourceMappingURL=node-executor-factory.js.map
6
+ //# sourceMappingURL=node-executor-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"node-executor-factory.js"}
@@ -0,0 +1,9 @@
1
+ import { I as IOrchestrator, K as ExecutionContext, G as GraphTraverser, J as WorkflowResult } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
4
+
5
+ declare class DefaultOrchestrator implements IOrchestrator {
6
+ run(context: ExecutionContext<any, any>, traverser: GraphTraverser): Promise<WorkflowResult<any>>;
7
+ }
8
+
9
+ export { DefaultOrchestrator };
@@ -0,0 +1,8 @@
1
+ export { DefaultOrchestrator } from '../chunk-33NO4PUJ.js';
2
+ import '../chunk-HAZ26F3P.js';
3
+ import '../chunk-FRKO3WX4.js';
4
+ import '../chunk-CD4FUZOJ.js';
5
+ import '../chunk-R3HQXIEL.js';
6
+ import '../chunk-BCRWXTWX.js';
7
+ //# sourceMappingURL=orchestrator.js.map
8
+ //# sourceMappingURL=orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"orchestrator.js"}
@@ -0,0 +1,16 @@
1
+ import { I as IOrchestrator, K as ExecutionContext, G as GraphTraverser, J as WorkflowResult } from '../../types-ezHUBdpL.js';
2
+ import '../../errors.js';
3
+ import '../../container.js';
4
+
5
+ /**
6
+ * An orchestrator that executes only one "tick" or "turn" of the workflow.
7
+ * It processes a single batch of ready nodes from the frontier and then returns,
8
+ * allowing the caller to inspect the intermediate state before proceeding.
9
+ *
10
+ * Useful for debugging, testing, or building interactive tools.
11
+ */
12
+ declare class StepByStepOrchestrator implements IOrchestrator {
13
+ run(context: ExecutionContext<any, any>, traverser: GraphTraverser): Promise<WorkflowResult<any>>;
14
+ }
15
+
16
+ export { StepByStepOrchestrator };
@@ -0,0 +1,5 @@
1
+ export { StepByStepOrchestrator } from '../../chunk-G53CSLBF.js';
2
+ import '../../chunk-HAZ26F3P.js';
3
+ import '../../chunk-BCRWXTWX.js';
4
+ //# sourceMappingURL=step-by-step.js.map
5
+ //# sourceMappingURL=step-by-step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"step-by-step.js"}
@@ -0,0 +1,35 @@
1
+ import { g as WorkflowBlueprint, W as WorkflowState, N as NodeExecutionResult, G as GraphTraverser } from '../../types-ezHUBdpL.js';
2
+ import '../../errors.js';
3
+ import '../../container.js';
4
+
5
+ declare function executeBatch(readyNodes: Array<{
6
+ nodeId: string;
7
+ nodeDef: any;
8
+ }>, blueprint: WorkflowBlueprint, state: WorkflowState<any>, executorFactory: (nodeId: string) => any, runtime: any, maxConcurrency?: number): Promise<Array<{
9
+ status: 'fulfilled';
10
+ value: {
11
+ nodeId: string;
12
+ executionResult: NodeExecutionResult;
13
+ };
14
+ } | {
15
+ status: 'rejected';
16
+ reason: {
17
+ nodeId: string;
18
+ error: unknown;
19
+ };
20
+ }>>;
21
+ declare function processResults(settledResults: Array<{
22
+ status: 'fulfilled';
23
+ value: {
24
+ nodeId: string;
25
+ executionResult: NodeExecutionResult;
26
+ };
27
+ } | {
28
+ status: 'rejected';
29
+ reason: {
30
+ nodeId: string;
31
+ error: unknown;
32
+ };
33
+ }>, traverser: GraphTraverser, state: WorkflowState<any>, runtime: any, _blueprint: WorkflowBlueprint, executionId?: string): Promise<void>;
34
+
35
+ export { executeBatch, processResults };
@@ -0,0 +1,4 @@
1
+ export { executeBatch, processResults } from '../../chunk-HAZ26F3P.js';
2
+ import '../../chunk-BCRWXTWX.js';
3
+ //# sourceMappingURL=utils.js.map
4
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"utils.js"}
@@ -1,41 +1,3 @@
1
- import { d as NodeFunction, e as NodeClass, B as BaseNode, j as RuntimeOptions, W as WorkflowBlueprint, p as WorkflowResult, b as NodeResult, C as ContextImplementation, N as NodeDefinition, E as EdgeDefinition } from '../types-CsTeXTiA.js';
2
- import { DynamicKeys } from './builtin-keys.js';
3
- import { WorkflowState } from './state.js';
4
- import { IRuntime } from './types.js';
5
-
6
- type InternalFlowContext<TContext extends Record<string, any>> = TContext & Partial<DynamicKeys>;
7
- declare class FlowRuntime<TContext extends Record<string, any>, TDependencies extends Record<string, any>> implements IRuntime<TContext, TDependencies> {
8
- registry: Record<string, NodeFunction | NodeClass | typeof BaseNode>;
9
- private blueprints;
10
- private dependencies;
11
- private logger;
12
- private eventBus;
13
- private serializer;
14
- private middleware;
15
- private evaluator;
16
- /**
17
- * Cache for blueprint analysis results to avoid recomputing for the same blueprint object.
18
- * Uses WeakMap to allow garbage collection of unused blueprints.
19
- */
20
- private analysisCache;
21
- options: RuntimeOptions<TDependencies>;
22
- constructor(options: RuntimeOptions<TDependencies>);
23
- run(blueprint: WorkflowBlueprint, initialState?: Partial<TContext> | string, options?: {
24
- functionRegistry?: Map<string, any>;
25
- strict?: boolean;
26
- signal?: AbortSignal;
27
- concurrency?: number;
28
- }): Promise<WorkflowResult<TContext>>;
29
- executeNode(blueprint: WorkflowBlueprint, nodeId: string, state: WorkflowState<TContext>, allPredecessors?: Map<string, Set<string>>, functionRegistry?: Map<string, any>, executionId?: string, signal?: AbortSignal): Promise<NodeResult<any, any>>;
30
- private getExecutor;
31
- private executeWithFallback;
32
- determineNextNodes(blueprint: WorkflowBlueprint, nodeId: string, result: NodeResult<any, any>, context: ContextImplementation<TContext>, executionId?: string): Promise<{
33
- node: NodeDefinition;
34
- edge: EdgeDefinition;
35
- }[]>;
36
- applyEdgeTransform(edge: EdgeDefinition, sourceResult: NodeResult<any, any>, targetNode: NodeDefinition, context: ContextImplementation<TContext>, allPredecessors?: Map<string, Set<string>>): Promise<void>;
37
- private _resolveNodeInput;
38
- protected _executeBuiltInNode(nodeDef: NodeDefinition, contextImpl: ContextImplementation<InternalFlowContext<TContext>>, functionRegistry?: Map<string, any>): Promise<NodeResult<any, any>>;
39
- }
40
-
41
- export { FlowRuntime };
1
+ import '../container.js';
2
+ export { c as FlowRuntime } from '../types-ezHUBdpL.js';
3
+ import '../errors.js';
@@ -1,14 +1,24 @@
1
- export { FlowRuntime } from '../chunk-OTS5YJ3S.js';
2
- import '../chunk-VSGQDLBF.js';
3
- import '../chunk-GEKDR2SS.js';
1
+ export { FlowRuntime } from '../chunk-IB2BISIC.js';
2
+ import '../chunk-MCGK3FXQ.js';
3
+ import '../chunk-DL7KVYZF.js';
4
+ import '../chunk-ONH7PIJZ.js';
5
+ import '../chunk-5KKSQWSC.js';
6
+ import '../chunk-CD3Q4N6V.js';
7
+ import '../chunk-G5BGBPFP.js';
4
8
  import '../chunk-DSYAC4WB.js';
9
+ import '../chunk-BC4G7OM6.js';
10
+ import '../chunk-RM677CNU.js';
11
+ import '../chunk-233SESC2.js';
12
+ import '../chunk-33NO4PUJ.js';
13
+ import '../chunk-HAZ26F3P.js';
14
+ import '../chunk-FRKO3WX4.js';
15
+ import '../chunk-CD4FUZOJ.js';
16
+ import '../chunk-4PELJWF7.js';
5
17
  import '../chunk-CYHZ2YVH.js';
6
- import '../chunk-M2FRTT2K.js';
18
+ import '../chunk-WWGFIYKW.js';
7
19
  import '../chunk-R3HQXIEL.js';
8
- import '../chunk-5ZXV3R5D.js';
20
+ import '../chunk-BCRWXTWX.js';
9
21
  import '../chunk-PH2IYZHV.js';
10
- import '../chunk-U5V5O5MN.js';
11
- import '../chunk-233SESC2.js';
12
- import '../chunk-4PELJWF7.js';
22
+ import '../chunk-LNK7LZER.js';
13
23
  //# sourceMappingURL=runtime.js.map
14
24
  //# sourceMappingURL=runtime.js.map
@@ -1,21 +1,3 @@
1
- import { C as ContextImplementation, o as WorkflowError, p as WorkflowResult, n as ISerializer } from '../types-CsTeXTiA.js';
2
-
3
- declare class WorkflowState<TContext extends Record<string, any>> {
4
- private _completedNodes;
5
- private errors;
6
- private anyFallbackExecuted;
7
- private context;
8
- constructor(initialData: Partial<TContext>);
9
- addCompletedNode(nodeId: string, output: any): void;
10
- addError(nodeId: string, error: Error): void;
11
- clearError(nodeId: string): void;
12
- markFallbackExecuted(): void;
13
- getContext(): ContextImplementation<TContext>;
14
- getCompletedNodes(): Set<string>;
15
- getErrors(): WorkflowError[];
16
- getAnyFallbackExecuted(): boolean;
17
- getStatus(allNodeIds: Set<string>, _fallbackNodeIds: Set<string>): WorkflowResult['status'];
18
- toResult(serializer: ISerializer): WorkflowResult<TContext>;
19
- }
20
-
21
- export { WorkflowState };
1
+ export { W as WorkflowState } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
@@ -1,4 +1,5 @@
1
- export { WorkflowState } from '../chunk-VSGQDLBF.js';
1
+ export { WorkflowState } from '../chunk-CD4FUZOJ.js';
2
2
  import '../chunk-R3HQXIEL.js';
3
+ import '../chunk-BCRWXTWX.js';
3
4
  //# sourceMappingURL=state.js.map
4
5
  //# sourceMappingURL=state.js.map
@@ -1,26 +1,3 @@
1
- import { W as WorkflowBlueprint } from '../types-CsTeXTiA.js';
2
- import { WorkflowState } from './state.js';
3
- import { IRuntime } from './types.js';
4
-
5
- declare class GraphTraverser<TContext extends Record<string, any>, TDependencies extends Record<string, any>> {
6
- private runtime;
7
- private state;
8
- private functionRegistry;
9
- private executionId;
10
- private signal?;
11
- private concurrency?;
12
- private frontier;
13
- private allPredecessors;
14
- private dynamicBlueprint;
15
- constructor(blueprint: WorkflowBlueprint, runtime: IRuntime<TContext, TDependencies>, state: WorkflowState<TContext>, functionRegistry: Map<string, any> | undefined, executionId: string, signal?: AbortSignal | undefined, concurrency?: number | undefined);
16
- private isFallbackNode;
17
- private getEffectiveJoinStrategy;
18
- traverse(): Promise<void>;
19
- private executeWithConcurrency;
20
- private handleDynamicNodes;
21
- getAllNodeIds(): Set<string>;
22
- getFallbackNodeIds(): Set<string>;
23
- getDynamicBlueprint(): WorkflowBlueprint;
24
- }
25
-
26
- export { GraphTraverser };
1
+ export { G as GraphTraverser, R as ReadyNode } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
@@ -1,5 +1,4 @@
1
- export { GraphTraverser } from '../chunk-GEKDR2SS.js';
2
- import '../chunk-5ZXV3R5D.js';
1
+ export { GraphTraverser } from '../chunk-G5BGBPFP.js';
3
2
  import '../chunk-233SESC2.js';
4
3
  //# sourceMappingURL=traverser.js.map
5
4
  //# sourceMappingURL=traverser.js.map
@@ -1,16 +1,3 @@
1
- import { R as RuntimeDependencies, j as RuntimeOptions, W as WorkflowBlueprint, b as NodeResult, C as ContextImplementation, N as NodeDefinition, E as EdgeDefinition } from '../types-CsTeXTiA.js';
2
- import { WorkflowState } from './state.js';
3
-
4
- /** Interface for the core runtime operations used by the traverser. */
5
- interface IRuntime<TContext extends Record<string, any> = Record<string, any>, TDependencies extends RuntimeDependencies = RuntimeDependencies> {
6
- options: RuntimeOptions<TDependencies>;
7
- registry: Record<string, any>;
8
- executeNode: (blueprint: WorkflowBlueprint, nodeId: string, state: WorkflowState<TContext>, allPredecessors?: Map<string, Set<string>>, functionRegistry?: Map<string, any>, executionId?: string, signal?: AbortSignal) => Promise<NodeResult>;
9
- determineNextNodes: (blueprint: WorkflowBlueprint, nodeId: string, result: NodeResult, context: ContextImplementation<TContext>, executionId?: string) => Promise<{
10
- node: NodeDefinition;
11
- edge: EdgeDefinition;
12
- }[]>;
13
- applyEdgeTransform: (edge: EdgeDefinition, sourceResult: NodeResult, targetNode: NodeDefinition, context: ContextImplementation<TContext>, allPredecessors?: Map<string, Set<string>>) => Promise<void>;
14
- }
15
-
16
- export type { IRuntime };
1
+ export { e as ExecutionServices, I as IOrchestrator, f as IRuntime, N as NodeExecutionResult, b as NodeExecutor, d as NodeExecutorFactory } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
@@ -1,3 +1,3 @@
1
-
1
+ import '../chunk-NVLZFLYM.js';
2
2
  //# sourceMappingURL=types.js.map
3
3
  //# sourceMappingURL=types.js.map
@@ -0,0 +1,17 @@
1
+ import { w as IEvaluator, z as IEventBus, g as WorkflowBlueprint, l as NodeResult, r as ContextImplementation, h as NodeDefinition, j as EdgeDefinition } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
4
+
5
+ declare class WorkflowLogicHandler {
6
+ private readonly evaluator;
7
+ private readonly eventBus;
8
+ constructor(evaluator: IEvaluator, eventBus: IEventBus);
9
+ determineNextNodes(blueprint: WorkflowBlueprint, completedNodeId: string, result: NodeResult<any, any>, context: ContextImplementation<any>, executionId?: string): Promise<{
10
+ node: NodeDefinition;
11
+ edge: EdgeDefinition;
12
+ }[]>;
13
+ applyEdgeTransform(edge: EdgeDefinition, sourceResult: NodeResult<any, any>, targetNode: NodeDefinition, context: ContextImplementation<any>, allPredecessors?: Map<string, Set<string>>): Promise<void>;
14
+ resolveNodeInput(nodeId: string, blueprint: WorkflowBlueprint, context: ContextImplementation<any>): Promise<any>;
15
+ }
16
+
17
+ export { WorkflowLogicHandler };
@@ -0,0 +1,5 @@
1
+ export { WorkflowLogicHandler } from '../chunk-MCGK3FXQ.js';
2
+ import '../chunk-R3HQXIEL.js';
3
+ import '../chunk-BCRWXTWX.js';
4
+ //# sourceMappingURL=workflow-logic-handler.js.map
5
+ //# sourceMappingURL=workflow-logic-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"workflow-logic-handler.js"}
@@ -1,4 +1,6 @@
1
- import { W as WorkflowBlueprint } from './types-CsTeXTiA.js';
1
+ import { g as WorkflowBlueprint } from './types-ezHUBdpL.js';
2
+ import './errors.js';
3
+ import './container.js';
2
4
 
3
5
  /**
4
6
  * Sanitizes a raw workflow blueprint by removing extra properties
@@ -1,4 +1,6 @@
1
- import { n as ISerializer } from './types-CsTeXTiA.js';
1
+ import { A as ISerializer } from './types-ezHUBdpL.js';
2
+ import './errors.js';
3
+ import './container.js';
2
4
 
3
5
  /**
4
6
  * A default serializer using standard JSON.
@@ -0,0 +1,63 @@
1
+ import { z as IEventBus, y as FlowcraftEvent } from '../types-ezHUBdpL.js';
2
+ import '../errors.js';
3
+ import '../container.js';
4
+
5
+ /**
6
+ * A test utility that implements IEventBus to capture all workflow events
7
+ * in memory, acting as a "flight recorder" for behavioral testing.
8
+ *
9
+ * @example
10
+ * // In your test file (e.g., resiliency.test.ts)
11
+ * it('should retry a node on failure', async () => {
12
+ * const eventLogger = new InMemoryEventLogger();
13
+ * const runtime = new FlowRuntime({ eventBus: eventLogger });
14
+ *
15
+ * const flow = createFlow('retry-flow')
16
+ * .node('api-call', vi.fn().mockRejectedValueOnce(new Error('fail')), {
17
+ * config: { maxRetries: 2 },
18
+ * });
19
+ *
20
+ * await runtime.run(flow.toBlueprint());
21
+ *
22
+ * // Assert against the captured event history to prove behavior.
23
+ * const retryEvents = eventLogger.filter('node:retry');
24
+ * expect(retryEvents).toHaveLength(1); // The first attempt is not a "retry"
25
+ * });
26
+ */
27
+ declare class InMemoryEventLogger implements IEventBus {
28
+ readonly events: FlowcraftEvent[];
29
+ /**
30
+ * Clears all captured events.
31
+ */
32
+ clear(): void;
33
+ /**
34
+ * The `emit` method required by the IEventBus interface.
35
+ * It simply pushes the received event into the internal events array.
36
+ * @param event The FlowcraftEvent to record.
37
+ */
38
+ emit(event: FlowcraftEvent): Promise<void>;
39
+ /**
40
+ * Finds the first event of a specific type.
41
+ * @param type The event type to find (e.g., 'node:error').
42
+ * @returns The first matching event, or undefined if not found.
43
+ */
44
+ find<T extends FlowcraftEvent['type']>(type: T): Extract<FlowcraftEvent, {
45
+ type: T;
46
+ }> | undefined;
47
+ /**
48
+ * Filters events to find all occurrences of a specific type.
49
+ * @param type The event type to filter by.
50
+ * @returns An array of matching events.
51
+ */
52
+ filter<T extends FlowcraftEvent['type']>(type: T): Extract<FlowcraftEvent, {
53
+ type: T;
54
+ }>[];
55
+ /**
56
+ * Prints a formatted log of all captured events to the console.
57
+ * Ideal for debugging failing tests.
58
+ * @param title A title for the log output.
59
+ */
60
+ printLog(title?: string): void;
61
+ }
62
+
63
+ export { InMemoryEventLogger };
@@ -0,0 +1,3 @@
1
+ export { InMemoryEventLogger } from '../chunk-MUYLRTSR.js';
2
+ //# sourceMappingURL=event-logger.js.map
3
+ //# sourceMappingURL=event-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"event-logger.js"}
@@ -0,0 +1,6 @@
1
+ export { InMemoryEventLogger } from './event-logger.js';
2
+ export { runWithTrace } from './run-with-trace.js';
3
+ export { IWorkflowStepper, createStepper } from './stepper.js';
4
+ import '../types-ezHUBdpL.js';
5
+ import '../errors.js';
6
+ import '../container.js';
@@ -0,0 +1,31 @@
1
+ export { runWithTrace } from '../chunk-CY755I7I.js';
2
+ export { InMemoryEventLogger } from '../chunk-MUYLRTSR.js';
3
+ export { createStepper } from '../chunk-XNRIM27H.js';
4
+ import '../chunk-G53CSLBF.js';
5
+ import '../chunk-NVJ3ZO3P.js';
6
+ import '../chunk-NVLZFLYM.js';
7
+ import '../chunk-6INWPSZT.js';
8
+ import '../chunk-IB2BISIC.js';
9
+ import '../chunk-MCGK3FXQ.js';
10
+ import '../chunk-DL7KVYZF.js';
11
+ import '../chunk-ONH7PIJZ.js';
12
+ import '../chunk-5KKSQWSC.js';
13
+ import '../chunk-CD3Q4N6V.js';
14
+ import '../chunk-G5BGBPFP.js';
15
+ import '../chunk-DSYAC4WB.js';
16
+ import '../chunk-BC4G7OM6.js';
17
+ import '../chunk-RM677CNU.js';
18
+ import '../chunk-233SESC2.js';
19
+ import '../chunk-33NO4PUJ.js';
20
+ import '../chunk-HAZ26F3P.js';
21
+ import '../chunk-FRKO3WX4.js';
22
+ import '../chunk-CD4FUZOJ.js';
23
+ import '../chunk-4PELJWF7.js';
24
+ import '../chunk-CYHZ2YVH.js';
25
+ import '../chunk-WWGFIYKW.js';
26
+ import '../chunk-R3HQXIEL.js';
27
+ import '../chunk-BCRWXTWX.js';
28
+ import '../chunk-PH2IYZHV.js';
29
+ import '../chunk-LNK7LZER.js';
30
+ //# sourceMappingURL=index.js.map
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}