yaml-flow 1.0.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.
- package/README.md +380 -0
- package/dist/core/index.cjs +557 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +102 -0
- package/dist/core/index.d.ts +102 -0
- package/dist/core/index.js +549 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.cjs +742 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +731 -0
- package/dist/index.js.map +1 -0
- package/dist/stores/file.cjs +115 -0
- package/dist/stores/file.cjs.map +1 -0
- package/dist/stores/file.d.cts +36 -0
- package/dist/stores/file.d.ts +36 -0
- package/dist/stores/file.js +113 -0
- package/dist/stores/file.js.map +1 -0
- package/dist/stores/localStorage.cjs +77 -0
- package/dist/stores/localStorage.cjs.map +1 -0
- package/dist/stores/localStorage.d.cts +34 -0
- package/dist/stores/localStorage.d.ts +34 -0
- package/dist/stores/localStorage.js +75 -0
- package/dist/stores/localStorage.js.map +1 -0
- package/dist/stores/memory.cjs +48 -0
- package/dist/stores/memory.cjs.map +1 -0
- package/dist/stores/memory.d.cts +27 -0
- package/dist/stores/memory.d.ts +27 -0
- package/dist/stores/memory.js +46 -0
- package/dist/stores/memory.js.map +1 -0
- package/dist/types-BoWndaAJ.d.cts +237 -0
- package/dist/types-BoWndaAJ.d.ts +237 -0
- package/package.json +83 -0
- package/schema/flow.schema.json +159 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { F as FlowConfig, i as StepHandler, E as EngineOptions, d as FlowResult, c as FlowEventType, b as FlowEventListener, f as FlowStore } from '../types-BoWndaAJ.cjs';
|
|
2
|
+
export { C as CircuitBreakerConfig, a as FlowEvent, e as FlowSettings, R as RetryConfig, g as RunState, S as StepConfig, h as StepContext, j as StepInput, k as StepResult, T as TerminalStateConfig } from '../types-BoWndaAJ.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* yaml-flow - Core Flow Engine
|
|
6
|
+
*
|
|
7
|
+
* Isomorphic workflow engine that executes declarative flows.
|
|
8
|
+
* Works in both browser and Node.js environments.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* FlowEngine - The main workflow execution engine
|
|
13
|
+
*/
|
|
14
|
+
declare class FlowEngine {
|
|
15
|
+
private flow;
|
|
16
|
+
private handlers;
|
|
17
|
+
private store;
|
|
18
|
+
private components;
|
|
19
|
+
private options;
|
|
20
|
+
private listeners;
|
|
21
|
+
private aborted;
|
|
22
|
+
constructor(flow: FlowConfig, handlers: Record<string, StepHandler>, options?: EngineOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Validate the flow configuration
|
|
25
|
+
*/
|
|
26
|
+
private validateFlow;
|
|
27
|
+
/**
|
|
28
|
+
* Run the flow from the start
|
|
29
|
+
*/
|
|
30
|
+
run(initialData?: Record<string, unknown>): Promise<FlowResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Resume a paused or interrupted flow
|
|
33
|
+
*/
|
|
34
|
+
resume(runId: string): Promise<FlowResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Pause a running flow
|
|
37
|
+
*/
|
|
38
|
+
pause(runId: string): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Main execution loop
|
|
41
|
+
*/
|
|
42
|
+
private executeLoop;
|
|
43
|
+
/**
|
|
44
|
+
* Execute a single step
|
|
45
|
+
*/
|
|
46
|
+
private executeStep;
|
|
47
|
+
/**
|
|
48
|
+
* Extract data to return based on return_artifacts configuration
|
|
49
|
+
*/
|
|
50
|
+
private extractReturnData;
|
|
51
|
+
/**
|
|
52
|
+
* Sleep helper
|
|
53
|
+
*/
|
|
54
|
+
private sleep;
|
|
55
|
+
/**
|
|
56
|
+
* Subscribe to flow events
|
|
57
|
+
*/
|
|
58
|
+
on(type: FlowEventType, listener: FlowEventListener): () => void;
|
|
59
|
+
/**
|
|
60
|
+
* Emit an event
|
|
61
|
+
*/
|
|
62
|
+
private emit;
|
|
63
|
+
/**
|
|
64
|
+
* Get the current store instance
|
|
65
|
+
*/
|
|
66
|
+
getStore(): FlowStore;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a flow engine instance
|
|
70
|
+
*/
|
|
71
|
+
declare function createEngine(flow: FlowConfig, handlers: Record<string, StepHandler>, options?: EngineOptions): FlowEngine;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* yaml-flow - Flow Loader
|
|
75
|
+
*
|
|
76
|
+
* Utilities for loading and validating flow configurations.
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Parse YAML string to FlowConfig
|
|
81
|
+
* Requires 'yaml' package to be installed
|
|
82
|
+
*/
|
|
83
|
+
declare function parseYaml(yamlString: string): Promise<FlowConfig>;
|
|
84
|
+
/**
|
|
85
|
+
* Load flow from a URL (browser-friendly)
|
|
86
|
+
*/
|
|
87
|
+
declare function loadFlowFromUrl(url: string): Promise<FlowConfig>;
|
|
88
|
+
/**
|
|
89
|
+
* Load flow from file path (Node.js only)
|
|
90
|
+
*/
|
|
91
|
+
declare function loadFlowFromFile(filePath: string): Promise<FlowConfig>;
|
|
92
|
+
/**
|
|
93
|
+
* Validate a flow configuration
|
|
94
|
+
* Returns array of validation errors (empty if valid)
|
|
95
|
+
*/
|
|
96
|
+
declare function validateFlowConfig(flow: unknown): string[];
|
|
97
|
+
/**
|
|
98
|
+
* Load and validate flow, throwing if invalid
|
|
99
|
+
*/
|
|
100
|
+
declare function loadFlow(source: string | FlowConfig): Promise<FlowConfig>;
|
|
101
|
+
|
|
102
|
+
export { EngineOptions, FlowConfig, FlowEngine, FlowEventListener, FlowEventType, FlowResult, FlowStore, StepHandler, createEngine, loadFlow, loadFlowFromFile, loadFlowFromUrl, parseYaml, validateFlowConfig };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { F as FlowConfig, i as StepHandler, E as EngineOptions, d as FlowResult, c as FlowEventType, b as FlowEventListener, f as FlowStore } from '../types-BoWndaAJ.js';
|
|
2
|
+
export { C as CircuitBreakerConfig, a as FlowEvent, e as FlowSettings, R as RetryConfig, g as RunState, S as StepConfig, h as StepContext, j as StepInput, k as StepResult, T as TerminalStateConfig } from '../types-BoWndaAJ.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* yaml-flow - Core Flow Engine
|
|
6
|
+
*
|
|
7
|
+
* Isomorphic workflow engine that executes declarative flows.
|
|
8
|
+
* Works in both browser and Node.js environments.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* FlowEngine - The main workflow execution engine
|
|
13
|
+
*/
|
|
14
|
+
declare class FlowEngine {
|
|
15
|
+
private flow;
|
|
16
|
+
private handlers;
|
|
17
|
+
private store;
|
|
18
|
+
private components;
|
|
19
|
+
private options;
|
|
20
|
+
private listeners;
|
|
21
|
+
private aborted;
|
|
22
|
+
constructor(flow: FlowConfig, handlers: Record<string, StepHandler>, options?: EngineOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Validate the flow configuration
|
|
25
|
+
*/
|
|
26
|
+
private validateFlow;
|
|
27
|
+
/**
|
|
28
|
+
* Run the flow from the start
|
|
29
|
+
*/
|
|
30
|
+
run(initialData?: Record<string, unknown>): Promise<FlowResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Resume a paused or interrupted flow
|
|
33
|
+
*/
|
|
34
|
+
resume(runId: string): Promise<FlowResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Pause a running flow
|
|
37
|
+
*/
|
|
38
|
+
pause(runId: string): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Main execution loop
|
|
41
|
+
*/
|
|
42
|
+
private executeLoop;
|
|
43
|
+
/**
|
|
44
|
+
* Execute a single step
|
|
45
|
+
*/
|
|
46
|
+
private executeStep;
|
|
47
|
+
/**
|
|
48
|
+
* Extract data to return based on return_artifacts configuration
|
|
49
|
+
*/
|
|
50
|
+
private extractReturnData;
|
|
51
|
+
/**
|
|
52
|
+
* Sleep helper
|
|
53
|
+
*/
|
|
54
|
+
private sleep;
|
|
55
|
+
/**
|
|
56
|
+
* Subscribe to flow events
|
|
57
|
+
*/
|
|
58
|
+
on(type: FlowEventType, listener: FlowEventListener): () => void;
|
|
59
|
+
/**
|
|
60
|
+
* Emit an event
|
|
61
|
+
*/
|
|
62
|
+
private emit;
|
|
63
|
+
/**
|
|
64
|
+
* Get the current store instance
|
|
65
|
+
*/
|
|
66
|
+
getStore(): FlowStore;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a flow engine instance
|
|
70
|
+
*/
|
|
71
|
+
declare function createEngine(flow: FlowConfig, handlers: Record<string, StepHandler>, options?: EngineOptions): FlowEngine;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* yaml-flow - Flow Loader
|
|
75
|
+
*
|
|
76
|
+
* Utilities for loading and validating flow configurations.
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Parse YAML string to FlowConfig
|
|
81
|
+
* Requires 'yaml' package to be installed
|
|
82
|
+
*/
|
|
83
|
+
declare function parseYaml(yamlString: string): Promise<FlowConfig>;
|
|
84
|
+
/**
|
|
85
|
+
* Load flow from a URL (browser-friendly)
|
|
86
|
+
*/
|
|
87
|
+
declare function loadFlowFromUrl(url: string): Promise<FlowConfig>;
|
|
88
|
+
/**
|
|
89
|
+
* Load flow from file path (Node.js only)
|
|
90
|
+
*/
|
|
91
|
+
declare function loadFlowFromFile(filePath: string): Promise<FlowConfig>;
|
|
92
|
+
/**
|
|
93
|
+
* Validate a flow configuration
|
|
94
|
+
* Returns array of validation errors (empty if valid)
|
|
95
|
+
*/
|
|
96
|
+
declare function validateFlowConfig(flow: unknown): string[];
|
|
97
|
+
/**
|
|
98
|
+
* Load and validate flow, throwing if invalid
|
|
99
|
+
*/
|
|
100
|
+
declare function loadFlow(source: string | FlowConfig): Promise<FlowConfig>;
|
|
101
|
+
|
|
102
|
+
export { EngineOptions, FlowConfig, FlowEngine, FlowEventListener, FlowEventType, FlowResult, FlowStore, StepHandler, createEngine, loadFlow, loadFlowFromFile, loadFlowFromUrl, parseYaml, validateFlowConfig };
|