@jam-nodes/core 0.2.6 → 0.2.7
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/dist/execution/execute-node.d.ts +16 -0
- package/dist/execution/execute-node.d.ts.map +1 -0
- package/dist/execution/execute-node.js +107 -0
- package/dist/execution/execute-node.js.map +1 -0
- package/dist/execution/execute-workflow.d.ts +16 -0
- package/dist/execution/execute-workflow.d.ts.map +1 -0
- package/dist/execution/execute-workflow.js +141 -0
- package/dist/execution/execute-workflow.js.map +1 -0
- package/dist/execution/index.d.ts +3 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +3 -0
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/memory-cache.d.ts +12 -0
- package/dist/execution/memory-cache.d.ts.map +1 -0
- package/dist/execution/memory-cache.js +27 -0
- package/dist/execution/memory-cache.js.map +1 -0
- package/dist/execution/topological-sort.d.ts +10 -0
- package/dist/execution/topological-sort.d.ts.map +1 -0
- package/dist/execution/topological-sort.js +48 -0
- package/dist/execution/topological-sort.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/execution.d.ts +106 -0
- package/dist/types/execution.d.ts.map +1 -0
- package/dist/types/execution.js +2 -0
- package/dist/types/execution.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NodeDefinition, NodeExecutionContext, NodeExecutionResult } from '../types/node.js';
|
|
2
|
+
import type { ExecutionConfig } from '../types/execution.js';
|
|
3
|
+
/**
|
|
4
|
+
* Execute a single node with optional retry, caching, and timeout.
|
|
5
|
+
*
|
|
6
|
+
* Input is validated against the node's inputSchema before execution.
|
|
7
|
+
* When caching is enabled, successful results are stored and returned
|
|
8
|
+
* on subsequent calls with the same input.
|
|
9
|
+
*
|
|
10
|
+
* @param node - The node definition to execute
|
|
11
|
+
* @param input - Raw input (validated against node.inputSchema)
|
|
12
|
+
* @param context - Execution context passed to the node executor
|
|
13
|
+
* @param config - Optional retry, cache, timeout, and signal configuration
|
|
14
|
+
*/
|
|
15
|
+
export declare function executeNode<TInput, TOutput>(node: NodeDefinition<TInput, TOutput>, input: unknown, context: NodeExecutionContext, config?: ExecutionConfig): Promise<NodeExecutionResult<TOutput>>;
|
|
16
|
+
//# sourceMappingURL=execute-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-node.d.ts","sourceRoot":"","sources":["../../src/execution/execute-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,OAAO,EAC/C,IAAI,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,oBAAoB,EAC7B,MAAM,CAAC,EAAE,eAAe,GACvB,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAmBvC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
function sleep(ms) {
|
|
2
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Execute a single node with optional retry, caching, and timeout.
|
|
6
|
+
*
|
|
7
|
+
* Input is validated against the node's inputSchema before execution.
|
|
8
|
+
* When caching is enabled, successful results are stored and returned
|
|
9
|
+
* on subsequent calls with the same input.
|
|
10
|
+
*
|
|
11
|
+
* @param node - The node definition to execute
|
|
12
|
+
* @param input - Raw input (validated against node.inputSchema)
|
|
13
|
+
* @param context - Execution context passed to the node executor
|
|
14
|
+
* @param config - Optional retry, cache, timeout, and signal configuration
|
|
15
|
+
*/
|
|
16
|
+
export async function executeNode(node, input, context, config) {
|
|
17
|
+
const validatedInput = node.inputSchema.parse(input);
|
|
18
|
+
if (config?.cache?.enabled) {
|
|
19
|
+
const { store, ttlMs, keyFn } = config.cache;
|
|
20
|
+
const cacheKey = (keyFn ?? defaultKeyFn)(validatedInput);
|
|
21
|
+
const cached = await store.get(cacheKey);
|
|
22
|
+
if (cached)
|
|
23
|
+
return cached;
|
|
24
|
+
const result = await executeWithRetry(node, validatedInput, context, config);
|
|
25
|
+
if (result.success) {
|
|
26
|
+
await store.set(cacheKey, result, ttlMs);
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
return executeWithRetry(node, validatedInput, context, config);
|
|
31
|
+
}
|
|
32
|
+
function defaultKeyFn(input) {
|
|
33
|
+
return JSON.stringify(input);
|
|
34
|
+
}
|
|
35
|
+
async function executeWithRetry(node, input, context, config) {
|
|
36
|
+
const maxAttempts = config?.retry?.maxAttempts ?? 1;
|
|
37
|
+
const backoffMs = config?.retry?.backoffMs ?? 0;
|
|
38
|
+
const backoffMultiplier = config?.retry?.backoffMultiplier ?? 2;
|
|
39
|
+
const maxBackoffMs = config?.retry?.maxBackoffMs ?? Infinity;
|
|
40
|
+
const retryOn = config?.retry?.retryOn;
|
|
41
|
+
let lastError;
|
|
42
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
43
|
+
if (config?.signal?.aborted) {
|
|
44
|
+
return { success: false, error: 'Execution aborted' };
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const result = await executeWithTimeout(node, input, context, config);
|
|
48
|
+
// A non-success result with an error is treated as a retriable failure
|
|
49
|
+
if (!result.success && result.error && attempt < maxAttempts) {
|
|
50
|
+
const error = new Error(result.error);
|
|
51
|
+
if (!retryOn || retryOn(error)) {
|
|
52
|
+
lastError = error;
|
|
53
|
+
config?.onRetry?.(attempt, error);
|
|
54
|
+
const delay = Math.min(backoffMs * Math.pow(backoffMultiplier, attempt - 1), maxBackoffMs);
|
|
55
|
+
await sleep(delay);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
63
|
+
lastError = error;
|
|
64
|
+
if (attempt < maxAttempts && (!retryOn || retryOn(error))) {
|
|
65
|
+
config?.onRetry?.(attempt, error);
|
|
66
|
+
const delay = Math.min(backoffMs * Math.pow(backoffMultiplier, attempt - 1), maxBackoffMs);
|
|
67
|
+
await sleep(delay);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
return { success: false, error: error.message };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { success: false, error: lastError?.message ?? 'Execution failed' };
|
|
74
|
+
}
|
|
75
|
+
async function executeWithTimeout(node, input, context, config) {
|
|
76
|
+
const timeoutMs = config?.timeout;
|
|
77
|
+
const signal = config?.signal;
|
|
78
|
+
if (!timeoutMs && !signal) {
|
|
79
|
+
return node.executor(input, context);
|
|
80
|
+
}
|
|
81
|
+
let timeoutId;
|
|
82
|
+
const promises = [
|
|
83
|
+
node.executor(input, context),
|
|
84
|
+
];
|
|
85
|
+
if (timeoutMs) {
|
|
86
|
+
promises.push(new Promise((_, reject) => {
|
|
87
|
+
timeoutId = setTimeout(() => reject(new Error(`Execution timed out after ${timeoutMs}ms`)), timeoutMs);
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
if (signal) {
|
|
91
|
+
promises.push(new Promise((_, reject) => {
|
|
92
|
+
if (signal.aborted) {
|
|
93
|
+
reject(new Error('Execution aborted'));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
signal.addEventListener('abort', () => reject(new Error('Execution aborted')), { once: true });
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
return await Promise.race(promises);
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
if (timeoutId)
|
|
104
|
+
clearTimeout(timeoutId);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=execute-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-node.js","sourceRoot":"","sources":["../../src/execution/execute-node.ts"],"names":[],"mappings":"AAGA,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAqC,EACrC,KAAc,EACd,OAA6B,EAC7B,MAAwB;IAExB,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAW,CAAC;IAE/D,IAAI,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC3B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;QAC7C,MAAM,QAAQ,GAAG,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC,cAAc,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAA+B,QAAQ,CAAC,CAAC;QACvE,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAE1B,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAE7E,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,gBAAgB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SAAS,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Workflow, WorkflowExecutionConfig, WorkflowExecutionResult } from '../types/execution.js';
|
|
2
|
+
import { ExecutionContext } from './context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Execute a workflow DAG with configurable retry, caching, and timeout.
|
|
5
|
+
*
|
|
6
|
+
* Nodes are executed in topologically-sorted waves. Independent nodes
|
|
7
|
+
* within the same wave run in parallel via Promise.allSettled().
|
|
8
|
+
* Each node's output is stored in the execution context so downstream
|
|
9
|
+
* nodes can reference it via {{nodeId.field}} interpolation.
|
|
10
|
+
*
|
|
11
|
+
* @param workflow - The workflow DAG to execute
|
|
12
|
+
* @param context - Execution context for variable interpolation and output storage
|
|
13
|
+
* @param config - Optional execution configuration with per-node overrides
|
|
14
|
+
*/
|
|
15
|
+
export declare function executeWorkflow(workflow: Workflow, context: ExecutionContext, config?: WorkflowExecutionConfig): Promise<WorkflowExecutionResult>;
|
|
16
|
+
//# sourceMappingURL=execute-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-workflow.d.ts","sourceRoot":"","sources":["../../src/execution/execute-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EAGxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAoB,MAAM,cAAc,CAAC;AAIlE;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,gBAAgB,EACzB,MAAM,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CAmHlC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ExecutionContext, prepareNodeInput } from './context.js';
|
|
2
|
+
import { executeNode } from './execute-node.js';
|
|
3
|
+
import { topologicalSort } from './topological-sort.js';
|
|
4
|
+
/**
|
|
5
|
+
* Execute a workflow DAG with configurable retry, caching, and timeout.
|
|
6
|
+
*
|
|
7
|
+
* Nodes are executed in topologically-sorted waves. Independent nodes
|
|
8
|
+
* within the same wave run in parallel via Promise.allSettled().
|
|
9
|
+
* Each node's output is stored in the execution context so downstream
|
|
10
|
+
* nodes can reference it via {{nodeId.field}} interpolation.
|
|
11
|
+
*
|
|
12
|
+
* @param workflow - The workflow DAG to execute
|
|
13
|
+
* @param context - Execution context for variable interpolation and output storage
|
|
14
|
+
* @param config - Optional execution configuration with per-node overrides
|
|
15
|
+
*/
|
|
16
|
+
export async function executeWorkflow(workflow, context, config) {
|
|
17
|
+
const waves = topologicalSort(workflow);
|
|
18
|
+
const workflowExecutionId = `wf_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
19
|
+
const nodeMap = new Map(workflow.nodes.map((n) => [n.id, n]));
|
|
20
|
+
const statuses = {};
|
|
21
|
+
const results = {};
|
|
22
|
+
const skippedNodes = new Set();
|
|
23
|
+
// Build a map of downstream nodes for skip propagation
|
|
24
|
+
const downstreamOf = new Map();
|
|
25
|
+
for (const edge of workflow.edges) {
|
|
26
|
+
const list = downstreamOf.get(edge.from) ?? [];
|
|
27
|
+
list.push(edge.to);
|
|
28
|
+
downstreamOf.set(edge.from, list);
|
|
29
|
+
}
|
|
30
|
+
// Build edge lookup for conditional branching
|
|
31
|
+
const edgesFrom = new Map();
|
|
32
|
+
for (const edge of workflow.edges) {
|
|
33
|
+
const list = edgesFrom.get(edge.from) ?? [];
|
|
34
|
+
list.push(edge);
|
|
35
|
+
edgesFrom.set(edge.from, list);
|
|
36
|
+
}
|
|
37
|
+
for (const id of nodeMap.keys()) {
|
|
38
|
+
statuses[id] = 'idle';
|
|
39
|
+
}
|
|
40
|
+
for (const wave of waves) {
|
|
41
|
+
const wavePromises = wave.map(async (nodeId) => {
|
|
42
|
+
if (skippedNodes.has(nodeId)) {
|
|
43
|
+
statuses[nodeId] = 'skipped';
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (config?.signal?.aborted) {
|
|
47
|
+
statuses[nodeId] = 'skipped';
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const workflowNode = nodeMap.get(nodeId);
|
|
51
|
+
if (!workflowNode) {
|
|
52
|
+
statuses[nodeId] = 'error';
|
|
53
|
+
results[nodeId] = { success: false, error: `Node "${nodeId}" not found in workflow` };
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
statuses[nodeId] = 'running';
|
|
57
|
+
config?.onNodeStart?.(nodeId, workflowNode.type);
|
|
58
|
+
// Resolve per-node config: merge base config with node-specific overrides
|
|
59
|
+
const nodeConfig = resolveNodeConfig(config, workflowNode.type);
|
|
60
|
+
// Interpolate variables into the node input
|
|
61
|
+
const interpolatedInput = prepareNodeInput(workflowNode.input, context);
|
|
62
|
+
const nodeContext = context.toNodeContext(config?.userId ?? '', workflowExecutionId);
|
|
63
|
+
try {
|
|
64
|
+
const result = await executeNode(workflowNode.node, interpolatedInput, nodeContext, nodeConfig);
|
|
65
|
+
results[nodeId] = result;
|
|
66
|
+
if (result.success) {
|
|
67
|
+
statuses[nodeId] = 'success';
|
|
68
|
+
config?.onNodeComplete?.(nodeId, result);
|
|
69
|
+
if (result.output !== undefined) {
|
|
70
|
+
context.storeNodeOutput(nodeId, result.output);
|
|
71
|
+
}
|
|
72
|
+
// Handle conditional branching: skip branches not taken
|
|
73
|
+
if (result.nextNodeId) {
|
|
74
|
+
const edges = edgesFrom.get(nodeId) ?? [];
|
|
75
|
+
for (const edge of edges) {
|
|
76
|
+
if (edge.condition && edge.condition !== result.nextNodeId) {
|
|
77
|
+
skippedNodes.add(edge.to);
|
|
78
|
+
markDownstreamSkipped(edge.to, skippedNodes, downstreamOf);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
statuses[nodeId] = 'error';
|
|
85
|
+
const error = new Error(result.error ?? 'Node execution failed');
|
|
86
|
+
config?.onNodeError?.(nodeId, error);
|
|
87
|
+
if (config?.stopOnError !== false) {
|
|
88
|
+
markDownstreamSkipped(nodeId, skippedNodes, downstreamOf);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
statuses[nodeId] = 'error';
|
|
94
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
95
|
+
results[nodeId] = { success: false, error: error.message };
|
|
96
|
+
config?.onNodeError?.(nodeId, error);
|
|
97
|
+
if (config?.stopOnError !== false) {
|
|
98
|
+
markDownstreamSkipped(nodeId, skippedNodes, downstreamOf);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
await Promise.allSettled(wavePromises);
|
|
103
|
+
}
|
|
104
|
+
const allStatuses = Object.values(statuses);
|
|
105
|
+
const success = allStatuses.every((s) => s === 'success' || s === 'skipped');
|
|
106
|
+
return { success, results, statuses };
|
|
107
|
+
}
|
|
108
|
+
function resolveNodeConfig(config, nodeType) {
|
|
109
|
+
if (!config)
|
|
110
|
+
return undefined;
|
|
111
|
+
const override = config.nodeConfig?.[nodeType];
|
|
112
|
+
if (!override) {
|
|
113
|
+
return extractBaseConfig(config);
|
|
114
|
+
}
|
|
115
|
+
const base = extractBaseConfig(config);
|
|
116
|
+
return {
|
|
117
|
+
...base,
|
|
118
|
+
...override,
|
|
119
|
+
retry: override.retry ?? base?.retry,
|
|
120
|
+
cache: override.cache ?? base?.cache,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function extractBaseConfig(config) {
|
|
124
|
+
return {
|
|
125
|
+
retry: config.retry,
|
|
126
|
+
cache: config.cache,
|
|
127
|
+
timeout: config.timeout,
|
|
128
|
+
signal: config.signal,
|
|
129
|
+
onRetry: config.onRetry,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function markDownstreamSkipped(nodeId, skippedNodes, downstreamOf) {
|
|
133
|
+
const queue = downstreamOf.get(nodeId) ?? [];
|
|
134
|
+
for (const downstream of queue) {
|
|
135
|
+
if (!skippedNodes.has(downstream)) {
|
|
136
|
+
skippedNodes.add(downstream);
|
|
137
|
+
markDownstreamSkipped(downstream, skippedNodes, downstreamOf);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=execute-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-workflow.js","sourceRoot":"","sources":["../../src/execution/execute-workflow.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAkB,EAClB,OAAyB,EACzB,MAAgC;IAEhC,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAEzF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAA+B,EAAE,CAAC;IAChD,MAAM,OAAO,GAAwC,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAEvC,uDAAuD;IACvD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC;IACjD,KAAK,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;IAEnC,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC7C,KAAK,MAAM,UAAU,IAAI,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YAClC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC7B,qBAAqB,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { ExecutionContext, createExecutionContext, prepareNodeInput, } from './context.js';
|
|
2
|
+
export { executeNode } from './execute-node.js';
|
|
3
|
+
export { executeWorkflow } from './execute-workflow.js';
|
|
4
|
+
export { MemoryCacheStore } from './memory-cache.js';
|
|
2
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/execution/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { ExecutionContext, createExecutionContext, prepareNodeInput, } from './context.js';
|
|
2
|
+
export { executeNode } from './execute-node.js';
|
|
3
|
+
export { executeWorkflow } from './execute-workflow.js';
|
|
4
|
+
export { MemoryCacheStore } from './memory-cache.js';
|
|
2
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CacheStore } from '../types/execution.js';
|
|
2
|
+
/**
|
|
3
|
+
* Simple in-memory cache store backed by a Map.
|
|
4
|
+
* Expired entries are lazily evicted on read.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MemoryCacheStore implements CacheStore {
|
|
7
|
+
private cache;
|
|
8
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
9
|
+
set<T>(key: string, value: T, ttlMs: number): Promise<void>;
|
|
10
|
+
delete(key: string): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=memory-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-cache.d.ts","sourceRoot":"","sources":["../../src/execution/memory-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAOxD;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,UAAU;IACjD,OAAO,CAAC,KAAK,CAAiC;IAExC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAY3C,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple in-memory cache store backed by a Map.
|
|
3
|
+
* Expired entries are lazily evicted on read.
|
|
4
|
+
*/
|
|
5
|
+
export class MemoryCacheStore {
|
|
6
|
+
cache = new Map();
|
|
7
|
+
async get(key) {
|
|
8
|
+
const entry = this.cache.get(key);
|
|
9
|
+
if (!entry)
|
|
10
|
+
return undefined;
|
|
11
|
+
if (Date.now() > entry.expireAt) {
|
|
12
|
+
this.cache.delete(key);
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
return entry.value;
|
|
16
|
+
}
|
|
17
|
+
async set(key, value, ttlMs) {
|
|
18
|
+
this.cache.set(key, {
|
|
19
|
+
value,
|
|
20
|
+
expireAt: Date.now() + ttlMs,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async delete(key) {
|
|
24
|
+
this.cache.delete(key);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=memory-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-cache.js","sourceRoot":"","sources":["../../src/execution/memory-cache.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IACnB,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;IAE9C,KAAK,CAAC,GAAG,CAAI,GAAW;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAE7B,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;YAChC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,KAAK,CAAC,KAAU,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,GAAW,EAAE,KAAQ,EAAE,KAAa;QAC/C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE;YAClB,KAAK;YACL,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;SAC7B,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Workflow } from '../types/execution.js';
|
|
2
|
+
/**
|
|
3
|
+
* Kahn's algorithm returning nodes grouped into execution waves.
|
|
4
|
+
* Each wave contains node IDs whose dependencies are fully satisfied,
|
|
5
|
+
* meaning all nodes within a wave can run in parallel.
|
|
6
|
+
*
|
|
7
|
+
* @throws Error if the workflow graph contains a cycle.
|
|
8
|
+
*/
|
|
9
|
+
export declare function topologicalSort(workflow: Workflow): string[][];
|
|
10
|
+
//# sourceMappingURL=topological-sort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topological-sort.d.ts","sourceRoot":"","sources":["../../src/execution/topological-sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,EAAE,CAiD9D"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kahn's algorithm returning nodes grouped into execution waves.
|
|
3
|
+
* Each wave contains node IDs whose dependencies are fully satisfied,
|
|
4
|
+
* meaning all nodes within a wave can run in parallel.
|
|
5
|
+
*
|
|
6
|
+
* @throws Error if the workflow graph contains a cycle.
|
|
7
|
+
*/
|
|
8
|
+
export function topologicalSort(workflow) {
|
|
9
|
+
const nodeIds = new Set(workflow.nodes.map((n) => n.id));
|
|
10
|
+
const inDegree = new Map();
|
|
11
|
+
const adjacency = new Map();
|
|
12
|
+
for (const id of nodeIds) {
|
|
13
|
+
inDegree.set(id, 0);
|
|
14
|
+
adjacency.set(id, []);
|
|
15
|
+
}
|
|
16
|
+
for (const edge of workflow.edges) {
|
|
17
|
+
adjacency.get(edge.from).push(edge.to);
|
|
18
|
+
inDegree.set(edge.to, (inDegree.get(edge.to) ?? 0) + 1);
|
|
19
|
+
}
|
|
20
|
+
const waves = [];
|
|
21
|
+
let queue = [];
|
|
22
|
+
for (const [id, degree] of inDegree) {
|
|
23
|
+
if (degree === 0) {
|
|
24
|
+
queue.push(id);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
let processed = 0;
|
|
28
|
+
while (queue.length > 0) {
|
|
29
|
+
waves.push(queue);
|
|
30
|
+
const nextQueue = [];
|
|
31
|
+
for (const id of queue) {
|
|
32
|
+
processed++;
|
|
33
|
+
for (const neighbor of adjacency.get(id)) {
|
|
34
|
+
const newDegree = (inDegree.get(neighbor) ?? 0) - 1;
|
|
35
|
+
inDegree.set(neighbor, newDegree);
|
|
36
|
+
if (newDegree === 0) {
|
|
37
|
+
nextQueue.push(neighbor);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
queue = nextQueue;
|
|
42
|
+
}
|
|
43
|
+
if (processed !== nodeIds.size) {
|
|
44
|
+
throw new Error('Workflow graph contains a cycle');
|
|
45
|
+
}
|
|
46
|
+
return waves;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=topological-sort.js.map
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CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,MAAM,SAAS,GAAa,EAAE,CAAC;QAE/B,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;YACvB,SAAS,EAAE,CAAC;YACZ,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAE,EAAE,CAAC;gBAC1C,MAAM,SAAS,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;gBACpD,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBAClC,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;oBACpB,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC3B,CAAC;YACH,CAAC;QACH,CAAC;QAED,KAAK,GAAG,SAAS,CAAC;IACpB,CAAC;IAED,IAAI,SAAS,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { NodeCredentials, NodeExecutionContext, NodeExecutionResult, NodeExecutor, NodeApprovalRequest, NodeCapabilities, NodeCategory, NodeMetadata, NodeDefinition, NodeApprovalConfig, NodeNotificationConfig, BaseNodeConfig, NodeServices, ApolloClient, ApolloContact, DataForSeoClient, DataForSeoAuditResult, DataForSeoKeyword, TwitterClient, TwitterPost, ForumScoutClient, LinkedInPost, OpenAIClient, AnthropicClient, NotificationService, StorageService, CacheService, EmailDraftsService, EmailDraft, AnalyzedPostsStorage, AnalyzedPostData, CredentialType, AuthenticateType, CredentialAuthenticate, OAuth2Config, BaseCredentialDefinition, ApiKeyCredentialDefinition, OAuth2CredentialDefinition, BearerCredentialDefinition, BasicCredentialDefinition, WebhookCredentialDefinition, CustomCredentialDefinition, CredentialDefinition, ResolvedCredentials, CredentialProvider, CredentialRegistry, } from './types/index.js';
|
|
1
|
+
export type { NodeCredentials, NodeExecutionContext, NodeExecutionResult, NodeExecutor, NodeApprovalRequest, NodeCapabilities, NodeCategory, NodeMetadata, NodeDefinition, NodeApprovalConfig, NodeNotificationConfig, BaseNodeConfig, NodeServices, ApolloClient, ApolloContact, DataForSeoClient, DataForSeoAuditResult, DataForSeoKeyword, TwitterClient, TwitterPost, ForumScoutClient, LinkedInPost, OpenAIClient, AnthropicClient, NotificationService, StorageService, CacheService, EmailDraftsService, EmailDraft, AnalyzedPostsStorage, AnalyzedPostData, CredentialType, AuthenticateType, CredentialAuthenticate, OAuth2Config, BaseCredentialDefinition, ApiKeyCredentialDefinition, OAuth2CredentialDefinition, BearerCredentialDefinition, BasicCredentialDefinition, WebhookCredentialDefinition, CustomCredentialDefinition, CredentialDefinition, ResolvedCredentials, CredentialProvider, CredentialRegistry, RetryConfig, CacheStore, CacheConfig, ExecutionConfig, WorkflowExecutionConfig, WorkflowExecutionResult, Workflow, WorkflowNode, WorkflowEdge, NodeStatus, } from './types/index.js';
|
|
2
2
|
export { defineApiKeyCredential, defineOAuth2Credential, defineBearerCredential, defineBasicCredential, } from './types/index.js';
|
|
3
|
-
export { ExecutionContext, createExecutionContext, prepareNodeInput, } from './execution/index.js';
|
|
3
|
+
export { ExecutionContext, createExecutionContext, prepareNodeInput, executeNode, executeWorkflow, MemoryCacheStore, } from './execution/index.js';
|
|
4
4
|
export { NodeRegistry, createRegistry } from './registry/index.js';
|
|
5
5
|
export { defineNode } from './utils/index.js';
|
|
6
6
|
export type { DefineNodeConfig } from './utils/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EAEd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAEhB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EAEd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAEhB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAElB,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,GACX,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Credential helpers
|
|
2
2
|
export { defineApiKeyCredential, defineOAuth2Credential, defineBearerCredential, defineBasicCredential, } from './types/index.js';
|
|
3
|
-
// Execution
|
|
4
|
-
export { ExecutionContext, createExecutionContext, prepareNodeInput, } from './execution/index.js';
|
|
3
|
+
// Execution
|
|
4
|
+
export { ExecutionContext, createExecutionContext, prepareNodeInput, executeNode, executeWorkflow, MemoryCacheStore, } from './execution/index.js';
|
|
5
5
|
// Registry
|
|
6
6
|
export { NodeRegistry, createRegistry } from './registry/index.js';
|
|
7
7
|
// Utilities
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA+DA,qBAAqB;AACrB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,YAAY;AACZ,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,WAAW;AACX,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { NodeDefinition, NodeExecutionResult } from './node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for retry behavior on node execution failure.
|
|
4
|
+
*/
|
|
5
|
+
export interface RetryConfig {
|
|
6
|
+
/** Maximum number of execution attempts */
|
|
7
|
+
maxAttempts: number;
|
|
8
|
+
/** Initial delay between retries in milliseconds */
|
|
9
|
+
backoffMs: number;
|
|
10
|
+
/** Multiplier applied to backoffMs after each retry (default: 2) */
|
|
11
|
+
backoffMultiplier?: number;
|
|
12
|
+
/** Upper bound on backoff delay in milliseconds */
|
|
13
|
+
maxBackoffMs?: number;
|
|
14
|
+
/** Predicate to decide whether a given error should trigger a retry */
|
|
15
|
+
retryOn?: (error: Error) => boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Interface for pluggable cache backends.
|
|
19
|
+
* Implement this to use Redis, Memcached, or any other store.
|
|
20
|
+
*/
|
|
21
|
+
export interface CacheStore {
|
|
22
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
23
|
+
set<T>(key: string, value: T, ttlMs: number): Promise<void>;
|
|
24
|
+
delete(key: string): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for caching node execution results.
|
|
28
|
+
*/
|
|
29
|
+
export interface CacheConfig {
|
|
30
|
+
/** Whether caching is active */
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
/** Time-to-live for cached entries in milliseconds */
|
|
33
|
+
ttlMs: number;
|
|
34
|
+
/** Custom function to derive a cache key from the node input */
|
|
35
|
+
keyFn?: (input: unknown) => string;
|
|
36
|
+
/** Cache backend to use */
|
|
37
|
+
store: CacheStore;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Configuration for a single node execution.
|
|
41
|
+
* Controls retry, caching, timeout, and cancellation.
|
|
42
|
+
*/
|
|
43
|
+
export interface ExecutionConfig {
|
|
44
|
+
retry?: RetryConfig;
|
|
45
|
+
cache?: CacheConfig;
|
|
46
|
+
/** Maximum execution time per attempt in milliseconds */
|
|
47
|
+
timeout?: number;
|
|
48
|
+
/** AbortSignal for cancellation */
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
/** Called after each failed attempt before the next retry */
|
|
51
|
+
onRetry?: (attempt: number, error: Error) => void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Configuration for workflow execution.
|
|
55
|
+
* Extends ExecutionConfig with per-node overrides and lifecycle callbacks.
|
|
56
|
+
*/
|
|
57
|
+
export interface WorkflowExecutionConfig extends ExecutionConfig {
|
|
58
|
+
/** User ID passed to each node's execution context */
|
|
59
|
+
userId?: string;
|
|
60
|
+
/** Per-node-type config overrides (keyed by node type, e.g. 'http_request') */
|
|
61
|
+
nodeConfig?: Record<string, Partial<ExecutionConfig>>;
|
|
62
|
+
/** If true (default), downstream nodes are skipped when a node fails */
|
|
63
|
+
stopOnError?: boolean;
|
|
64
|
+
onNodeStart?: (nodeId: string, nodeType: string) => void;
|
|
65
|
+
onNodeComplete?: (nodeId: string, result: NodeExecutionResult) => void;
|
|
66
|
+
onNodeError?: (nodeId: string, error: Error) => void;
|
|
67
|
+
}
|
|
68
|
+
/** Lifecycle state of a node during workflow execution. */
|
|
69
|
+
export type NodeStatus = 'idle' | 'running' | 'success' | 'error' | 'skipped';
|
|
70
|
+
/** A node instance within a workflow DAG. */
|
|
71
|
+
export interface WorkflowNode {
|
|
72
|
+
/** Unique identifier for this node within the workflow */
|
|
73
|
+
id: string;
|
|
74
|
+
/** Node type (e.g. 'http_request'), used to match nodeConfig keys */
|
|
75
|
+
type: string;
|
|
76
|
+
/** The node definition containing the executor */
|
|
77
|
+
node: NodeDefinition;
|
|
78
|
+
/** Raw input to pass to the node (supports {{variable}} interpolation) */
|
|
79
|
+
input: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
/** A directed edge between two nodes in the workflow DAG. */
|
|
82
|
+
export interface WorkflowEdge {
|
|
83
|
+
from: string;
|
|
84
|
+
to: string;
|
|
85
|
+
/** When set, this edge is only followed if the source node's nextNodeId matches */
|
|
86
|
+
condition?: string;
|
|
87
|
+
}
|
|
88
|
+
/** A directed acyclic graph of workflow nodes. */
|
|
89
|
+
export interface Workflow {
|
|
90
|
+
nodes: WorkflowNode[];
|
|
91
|
+
edges: WorkflowEdge[];
|
|
92
|
+
/** ID of the root node (used for documentation; execution order is derived from edges) */
|
|
93
|
+
entryNodeId: string;
|
|
94
|
+
}
|
|
95
|
+
/** Aggregate result returned by executeWorkflow. */
|
|
96
|
+
export interface WorkflowExecutionResult {
|
|
97
|
+
/** True if every non-skipped node succeeded */
|
|
98
|
+
success: boolean;
|
|
99
|
+
/** Individual result for each node, keyed by node ID */
|
|
100
|
+
results: Record<string, NodeExecutionResult>;
|
|
101
|
+
/** Final status of each node, keyed by node ID */
|
|
102
|
+
statuses: Record<string, NodeStatus>;
|
|
103
|
+
/** Workflow-level error message, if any */
|
|
104
|
+
error?: string;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/types/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,WAAW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OAAO,CAAC;IACjB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC7C,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/types/execution.ts"],"names":[],"mappings":""}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export type { NodeApprovalConfig, NodeNotificationConfig, BaseNodeConfig, } from
|
|
|
3
3
|
export type { NodeServices, ApolloClient, ApolloContact, DataForSeoClient, DataForSeoAuditResult, DataForSeoKeyword, TwitterClient, TwitterPost, ForumScoutClient, LinkedInPost, OpenAIClient, AnthropicClient, NotificationService, StorageService, CacheService, EmailDraftsService, EmailDraft, AnalyzedPostsStorage, AnalyzedPostData, } from './services.js';
|
|
4
4
|
export type { CredentialType, AuthenticateType, CredentialAuthenticate, OAuth2Config, BaseCredentialDefinition, ApiKeyCredentialDefinition, OAuth2CredentialDefinition, BearerCredentialDefinition, BasicCredentialDefinition, WebhookCredentialDefinition, CustomCredentialDefinition, CredentialDefinition, ResolvedCredentials, CredentialProvider, CredentialRegistry, } from './credentials.js';
|
|
5
5
|
export { defineApiKeyCredential, defineOAuth2Credential, defineBearerCredential, defineBasicCredential, } from './credentials.js';
|
|
6
|
+
export type { RetryConfig, CacheStore, CacheConfig, ExecutionConfig, WorkflowExecutionConfig, WorkflowExecutionResult, Workflow, WorkflowNode, WorkflowEdge, NodeStatus, } from './execution.js';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC"}
|