flowcraft 2.2.0 → 2.3.1
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.
- package/README.md +40 -34
- package/dist/analysis.d.ts +3 -1
- package/dist/chunk-33NO4PUJ.js +74 -0
- package/dist/chunk-33NO4PUJ.js.map +1 -0
- package/dist/chunk-BC4G7OM6.js +42 -0
- package/dist/chunk-BC4G7OM6.js.map +1 -0
- package/dist/chunk-BCRWXTWX.js +21 -0
- package/dist/chunk-BCRWXTWX.js.map +1 -0
- package/dist/chunk-BN4MV36K.js +25 -0
- package/dist/chunk-BN4MV36K.js.map +1 -0
- package/dist/{chunk-ZCHFZBGL.js → chunk-C4HYIJI3.js} +120 -5
- package/dist/chunk-C4HYIJI3.js.map +1 -0
- package/dist/chunk-CD3Q4N6V.js +13 -0
- package/dist/chunk-CD3Q4N6V.js.map +1 -0
- package/dist/chunk-CD4FUZOJ.js +114 -0
- package/dist/chunk-CD4FUZOJ.js.map +1 -0
- package/dist/chunk-DL7KVYZF.js +39 -0
- package/dist/chunk-DL7KVYZF.js.map +1 -0
- package/dist/chunk-FRKO3WX4.js +32 -0
- package/dist/chunk-FRKO3WX4.js.map +1 -0
- package/dist/chunk-G53CSLBF.js +54 -0
- package/dist/chunk-G53CSLBF.js.map +1 -0
- package/dist/chunk-G5BGBPFP.js +172 -0
- package/dist/chunk-G5BGBPFP.js.map +1 -0
- package/dist/chunk-HAZ26F3P.js +98 -0
- package/dist/chunk-HAZ26F3P.js.map +1 -0
- package/dist/chunk-HKX7WQLS.js +446 -0
- package/dist/chunk-HKX7WQLS.js.map +1 -0
- package/dist/{chunk-U5V5O5MN.js → chunk-LNK7LZER.js} +5 -3
- package/dist/chunk-LNK7LZER.js.map +1 -0
- package/dist/chunk-MCGK3FXQ.js +143 -0
- package/dist/chunk-MCGK3FXQ.js.map +1 -0
- package/dist/chunk-MKNZBKSR.js +90 -0
- package/dist/chunk-MKNZBKSR.js.map +1 -0
- package/dist/chunk-MUYLRTSR.js +82 -0
- package/dist/chunk-MUYLRTSR.js.map +1 -0
- package/dist/chunk-NVJ3ZO3P.js +3 -0
- package/dist/{chunk-HMR2GEGE.js.map → chunk-NVJ3ZO3P.js.map} +1 -1
- package/dist/chunk-NVLZFLYM.js +3 -0
- package/dist/chunk-NVLZFLYM.js.map +1 -0
- package/dist/chunk-ONH7PIJZ.js +300 -0
- package/dist/chunk-ONH7PIJZ.js.map +1 -0
- package/dist/chunk-QNYXQKFW.js +25 -0
- package/dist/chunk-QNYXQKFW.js.map +1 -0
- package/dist/chunk-RM677CNU.js +52 -0
- package/dist/chunk-RM677CNU.js.map +1 -0
- package/dist/chunk-WWGFIYKW.js +47 -0
- package/dist/chunk-WWGFIYKW.js.map +1 -0
- package/dist/chunk-XNRIM27H.js +76 -0
- package/dist/chunk-XNRIM27H.js.map +1 -0
- package/dist/{chunk-QLGJUDQF.js → chunk-ZNL7ZXPR.js} +26 -11
- package/dist/chunk-ZNL7ZXPR.js.map +1 -0
- package/dist/container-factory.d.ts +17 -0
- package/dist/container-factory.js +13 -0
- package/dist/container-factory.js.map +1 -0
- package/dist/container.d.ts +23 -0
- package/dist/container.js +3 -0
- package/dist/container.js.map +1 -0
- package/dist/context.d.ts +3 -1
- package/dist/errors.d.ts +18 -17
- package/dist/errors.js +1 -1
- package/dist/evaluator.d.ts +3 -1
- package/dist/flow.d.ts +12 -2
- package/dist/flow.js +2 -2
- package/dist/index.d.ts +7 -8
- package/dist/index.js +26 -14
- package/dist/linter.d.ts +3 -1
- package/dist/logger.d.ts +3 -1
- package/dist/node.d.ts +3 -1
- package/dist/node.js +1 -1
- package/dist/nodes/batch-gather.d.ts +9 -0
- package/dist/nodes/batch-gather.js +4 -0
- package/dist/nodes/batch-gather.js.map +1 -0
- package/dist/nodes/batch-scatter.d.ts +9 -0
- package/dist/nodes/batch-scatter.js +4 -0
- package/dist/nodes/batch-scatter.js.map +1 -0
- package/dist/nodes/subflow.d.ts +9 -0
- package/dist/nodes/subflow.js +10 -0
- package/dist/nodes/subflow.js.map +1 -0
- package/dist/nodes/wait.d.ts +9 -0
- package/dist/nodes/wait.js +4 -0
- package/dist/nodes/wait.js.map +1 -0
- package/dist/runtime/adapter.d.ts +3 -5
- package/dist/runtime/adapter.js +19 -9
- package/dist/runtime/execution-context.d.ts +3 -0
- package/dist/runtime/execution-context.js +6 -0
- package/dist/runtime/execution-context.js.map +1 -0
- package/dist/runtime/executors.d.ts +3 -26
- package/dist/runtime/executors.js +2 -2
- package/dist/runtime/index.d.ts +5 -7
- package/dist/runtime/index.js +21 -10
- package/dist/runtime/node-executor-factory.d.ts +12 -0
- package/dist/runtime/node-executor-factory.js +6 -0
- package/dist/runtime/node-executor-factory.js.map +1 -0
- package/dist/runtime/orchestrator.d.ts +9 -0
- package/dist/runtime/orchestrator.js +8 -0
- package/dist/runtime/orchestrator.js.map +1 -0
- package/dist/runtime/orchestrators/step-by-step.d.ts +16 -0
- package/dist/runtime/orchestrators/step-by-step.js +5 -0
- package/dist/runtime/orchestrators/step-by-step.js.map +1 -0
- package/dist/runtime/orchestrators/utils.d.ts +35 -0
- package/dist/runtime/orchestrators/utils.js +4 -0
- package/dist/runtime/orchestrators/utils.js.map +1 -0
- package/dist/runtime/runtime.d.ts +3 -41
- package/dist/runtime/runtime.js +18 -8
- package/dist/runtime/state.d.ts +3 -21
- package/dist/runtime/state.js +2 -1
- package/dist/runtime/traverser.d.ts +3 -26
- package/dist/runtime/traverser.js +1 -2
- package/dist/runtime/types.d.ts +3 -16
- package/dist/runtime/types.js +1 -1
- package/dist/runtime/workflow-logic-handler.d.ts +17 -0
- package/dist/runtime/workflow-logic-handler.js +5 -0
- package/dist/runtime/workflow-logic-handler.js.map +1 -0
- package/dist/sanitizer.d.ts +3 -1
- package/dist/serializer.d.ts +3 -1
- package/dist/testing/event-logger.d.ts +63 -0
- package/dist/testing/event-logger.js +3 -0
- package/dist/testing/event-logger.js.map +1 -0
- package/dist/testing/index.d.ts +6 -0
- package/dist/testing/index.js +31 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/run-with-trace.d.ts +38 -0
- package/dist/testing/run-with-trace.js +29 -0
- package/dist/testing/run-with-trace.js.map +1 -0
- package/dist/testing/stepper.d.ts +79 -0
- package/dist/testing/stepper.js +11 -0
- package/dist/testing/stepper.js.map +1 -0
- package/dist/types-ezHUBdpL.d.ts +564 -0
- package/dist/types.d.ts +3 -1
- package/package.json +55 -51
- package/LICENSE +0 -21
- package/dist/chunk-5ZXV3R5D.js +0 -28
- package/dist/chunk-5ZXV3R5D.js.map +0 -1
- package/dist/chunk-GEKDR2SS.js +0 -201
- package/dist/chunk-GEKDR2SS.js.map +0 -1
- package/dist/chunk-HMR2GEGE.js +0 -3
- package/dist/chunk-M2FRTT2K.js +0 -144
- package/dist/chunk-M2FRTT2K.js.map +0 -1
- package/dist/chunk-OTS5YJ3S.js +0 -494
- package/dist/chunk-OTS5YJ3S.js.map +0 -1
- package/dist/chunk-QLGJUDQF.js.map +0 -1
- package/dist/chunk-U5V5O5MN.js.map +0 -1
- package/dist/chunk-VSGQDLBF.js +0 -61
- package/dist/chunk-VSGQDLBF.js.map +0 -1
- package/dist/chunk-ZCHFZBGL.js.map +0 -1
- package/dist/types-CsTeXTiA.d.ts +0 -222
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../chunk-
|
|
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
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export { AdapterOptions, BaseDistributedAdapter, ICoordinationStore, JobPayload } from './adapter.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
import '../
|
|
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';
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import '../chunk-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
|
|
1
|
+
import '../chunk-NVJ3ZO3P.js';
|
|
2
|
+
import '../chunk-NVLZFLYM.js';
|
|
3
|
+
export { BaseDistributedAdapter } from '../chunk-ZNL7ZXPR.js';
|
|
4
|
+
export { FlowRuntime } from '../chunk-HKX7WQLS.js';
|
|
5
|
+
import '../chunk-MCGK3FXQ.js';
|
|
6
|
+
import '../chunk-MKNZBKSR.js';
|
|
7
|
+
export { GraphTraverser } from '../chunk-G5BGBPFP.js';
|
|
8
|
+
import '../chunk-CD3Q4N6V.js';
|
|
9
|
+
import '../chunk-DL7KVYZF.js';
|
|
10
|
+
export { ClassNodeExecutor, FunctionNodeExecutor, NodeExecutor } from '../chunk-ONH7PIJZ.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
|
-
|
|
21
|
+
import '../chunk-WWGFIYKW.js';
|
|
9
22
|
import '../chunk-R3HQXIEL.js';
|
|
10
|
-
import '../chunk-
|
|
23
|
+
import '../chunk-BCRWXTWX.js';
|
|
11
24
|
import '../chunk-PH2IYZHV.js';
|
|
12
|
-
import '../chunk-
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"utils.js"}
|
|
@@ -1,41 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
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';
|
package/dist/runtime/runtime.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
export { FlowRuntime } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { FlowRuntime } from '../chunk-HKX7WQLS.js';
|
|
2
|
+
import '../chunk-MCGK3FXQ.js';
|
|
3
|
+
import '../chunk-MKNZBKSR.js';
|
|
4
|
+
import '../chunk-G5BGBPFP.js';
|
|
5
|
+
import '../chunk-CD3Q4N6V.js';
|
|
6
|
+
import '../chunk-DL7KVYZF.js';
|
|
7
|
+
import '../chunk-ONH7PIJZ.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-
|
|
18
|
+
import '../chunk-WWGFIYKW.js';
|
|
7
19
|
import '../chunk-R3HQXIEL.js';
|
|
8
|
-
import '../chunk-
|
|
20
|
+
import '../chunk-BCRWXTWX.js';
|
|
9
21
|
import '../chunk-PH2IYZHV.js';
|
|
10
|
-
import '../chunk-
|
|
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
|
package/dist/runtime/state.d.ts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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';
|
package/dist/runtime/state.js
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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';
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
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';
|
package/dist/runtime/types.js
CHANGED
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"workflow-logic-handler.js"}
|
package/dist/sanitizer.d.ts
CHANGED
package/dist/serializer.d.ts
CHANGED
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"event-logger.js"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { runWithTrace } from '../chunk-BN4MV36K.js';
|
|
2
|
+
export { createStepper } from '../chunk-XNRIM27H.js';
|
|
3
|
+
import '../chunk-G53CSLBF.js';
|
|
4
|
+
export { InMemoryEventLogger } from '../chunk-MUYLRTSR.js';
|
|
5
|
+
import '../chunk-NVJ3ZO3P.js';
|
|
6
|
+
import '../chunk-NVLZFLYM.js';
|
|
7
|
+
import '../chunk-ZNL7ZXPR.js';
|
|
8
|
+
import '../chunk-HKX7WQLS.js';
|
|
9
|
+
import '../chunk-MCGK3FXQ.js';
|
|
10
|
+
import '../chunk-MKNZBKSR.js';
|
|
11
|
+
import '../chunk-G5BGBPFP.js';
|
|
12
|
+
import '../chunk-CD3Q4N6V.js';
|
|
13
|
+
import '../chunk-DL7KVYZF.js';
|
|
14
|
+
import '../chunk-ONH7PIJZ.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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { c as FlowRuntime, g as WorkflowBlueprint, J as WorkflowResult } from '../types-ezHUBdpL.js';
|
|
2
|
+
import '../errors.js';
|
|
3
|
+
import '../container.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A test helper that executes a workflow and automatically prints a detailed
|
|
7
|
+
* execution trace to the console if the workflow fails.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // In your test file (e.g., my-workflow.test.ts)
|
|
11
|
+
* it('should process data correctly', async () => {
|
|
12
|
+
* const flow = createFlow('my-flow')
|
|
13
|
+
* .node('a', async () => ({ output: 1 }))
|
|
14
|
+
* .node('b', async ({ input }) => ({ output: input + 1 })) // Bug: returns { output: 3 }
|
|
15
|
+
* .edge('a', 'b')
|
|
16
|
+
*
|
|
17
|
+
* const runtime = new FlowRuntime({})
|
|
18
|
+
*
|
|
19
|
+
* // If this test fails, a full, human-readable trace of the execution
|
|
20
|
+
* // (inputs, outputs, context changes) is printed to the console.
|
|
21
|
+
* const result = await runWithTrace(runtime, flow.toBlueprint())
|
|
22
|
+
*
|
|
23
|
+
* expect(result.context.b).toBe(2)
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* @param runtime The original FlowRuntime instance (its options will be used).
|
|
27
|
+
* @param blueprint The WorkflowBlueprint to execute.
|
|
28
|
+
* @param initialState The initial state for the workflow run.
|
|
29
|
+
* @param options Additional options for the run.
|
|
30
|
+
* @returns The WorkflowResult if successful.
|
|
31
|
+
*/
|
|
32
|
+
declare function runWithTrace<TContext extends Record<string, any>>(runtime: FlowRuntime<TContext, any>, blueprint: WorkflowBlueprint, initialState?: Partial<TContext> | string, options?: {
|
|
33
|
+
functionRegistry?: Map<string, any>;
|
|
34
|
+
strict?: boolean;
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
}): Promise<WorkflowResult<Record<string, any>>>;
|
|
37
|
+
|
|
38
|
+
export { runWithTrace };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { runWithTrace } from '../chunk-BN4MV36K.js';
|
|
2
|
+
import '../chunk-MUYLRTSR.js';
|
|
3
|
+
import '../chunk-NVJ3ZO3P.js';
|
|
4
|
+
import '../chunk-NVLZFLYM.js';
|
|
5
|
+
import '../chunk-ZNL7ZXPR.js';
|
|
6
|
+
import '../chunk-HKX7WQLS.js';
|
|
7
|
+
import '../chunk-MCGK3FXQ.js';
|
|
8
|
+
import '../chunk-MKNZBKSR.js';
|
|
9
|
+
import '../chunk-G5BGBPFP.js';
|
|
10
|
+
import '../chunk-CD3Q4N6V.js';
|
|
11
|
+
import '../chunk-DL7KVYZF.js';
|
|
12
|
+
import '../chunk-ONH7PIJZ.js';
|
|
13
|
+
import '../chunk-DSYAC4WB.js';
|
|
14
|
+
import '../chunk-BC4G7OM6.js';
|
|
15
|
+
import '../chunk-RM677CNU.js';
|
|
16
|
+
import '../chunk-233SESC2.js';
|
|
17
|
+
import '../chunk-33NO4PUJ.js';
|
|
18
|
+
import '../chunk-HAZ26F3P.js';
|
|
19
|
+
import '../chunk-FRKO3WX4.js';
|
|
20
|
+
import '../chunk-CD4FUZOJ.js';
|
|
21
|
+
import '../chunk-4PELJWF7.js';
|
|
22
|
+
import '../chunk-CYHZ2YVH.js';
|
|
23
|
+
import '../chunk-WWGFIYKW.js';
|
|
24
|
+
import '../chunk-R3HQXIEL.js';
|
|
25
|
+
import '../chunk-BCRWXTWX.js';
|
|
26
|
+
import '../chunk-PH2IYZHV.js';
|
|
27
|
+
import '../chunk-LNK7LZER.js';
|
|
28
|
+
//# sourceMappingURL=run-with-trace.js.map
|
|
29
|
+
//# sourceMappingURL=run-with-trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"run-with-trace.js"}
|