ai-workflows 2.1.1 → 2.1.3
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +165 -3
- package/CHANGELOG.md +10 -1
- package/LICENSE +21 -0
- package/README.md +303 -184
- package/dist/barrier.d.ts +153 -0
- package/dist/barrier.d.ts.map +1 -0
- package/dist/barrier.js +339 -0
- package/dist/barrier.js.map +1 -0
- package/dist/cascade-context.d.ts +149 -0
- package/dist/cascade-context.d.ts.map +1 -0
- package/dist/cascade-context.js +324 -0
- package/dist/cascade-context.js.map +1 -0
- package/dist/cascade-executor.d.ts +196 -0
- package/dist/cascade-executor.d.ts.map +1 -0
- package/dist/cascade-executor.js +384 -0
- package/dist/cascade-executor.js.map +1 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +4 -1
- package/dist/context.js.map +1 -1
- package/dist/dependency-graph.d.ts +157 -0
- package/dist/dependency-graph.d.ts.map +1 -0
- package/dist/dependency-graph.js +382 -0
- package/dist/dependency-graph.js.map +1 -0
- package/dist/every.d.ts +31 -2
- package/dist/every.d.ts.map +1 -1
- package/dist/every.js +63 -32
- package/dist/every.js.map +1 -1
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +8 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/topological-sort.d.ts +121 -0
- package/dist/graph/topological-sort.d.ts.map +1 -0
- package/dist/graph/topological-sort.js +292 -0
- package/dist/graph/topological-sort.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/on.d.ts +35 -10
- package/dist/on.d.ts.map +1 -1
- package/dist/on.js +52 -18
- package/dist/on.js.map +1 -1
- package/dist/timer-registry.d.ts +52 -0
- package/dist/timer-registry.d.ts.map +1 -0
- package/dist/timer-registry.js +120 -0
- package/dist/timer-registry.js.map +1 -0
- package/dist/types.d.ts +88 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +17 -1
- package/dist/types.js.map +1 -1
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +15 -11
- package/dist/workflow.js.map +1 -1
- package/package.json +11 -11
- package/src/barrier.ts +466 -0
- package/src/cascade-context.ts +488 -0
- package/src/cascade-executor.ts +587 -0
- package/src/context.ts +12 -7
- package/src/dependency-graph.ts +518 -0
- package/src/every.ts +104 -35
- package/src/graph/index.ts +19 -0
- package/src/graph/topological-sort.ts +414 -0
- package/src/index.ts +78 -0
- package/src/on.ts +81 -25
- package/src/timer-registry.ts +145 -0
- package/src/types.ts +121 -0
- package/src/workflow.ts +23 -16
- package/test/barrier-join.test.ts +434 -0
- package/test/barrier-unhandled-rejections.test.ts +359 -0
- package/test/cascade-context.test.ts +390 -0
- package/test/cascade-executor.test.ts +859 -0
- package/test/dependency-graph.test.ts +512 -0
- package/test/graph/topological-sort.test.ts +586 -0
- package/test/schedule-timer-cleanup.test.ts +344 -0
- package/test/send-race-conditions.test.ts +410 -0
- package/test/type-safety-every.test.ts +303 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency Graph Architecture for Workflow Steps
|
|
3
|
+
*
|
|
4
|
+
* Provides a directed acyclic graph (DAG) for managing workflow step dependencies.
|
|
5
|
+
* Supports:
|
|
6
|
+
* - Hard vs soft dependencies
|
|
7
|
+
* - Cycle detection with path reporting
|
|
8
|
+
* - Parallel group identification for concurrent execution
|
|
9
|
+
* - Graph visualization (DOT, JSON)
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Error thrown when a circular dependency is detected
|
|
13
|
+
*/
|
|
14
|
+
export class CircularDependencyError extends Error {
|
|
15
|
+
/** The path of nodes forming the cycle */
|
|
16
|
+
cyclePath;
|
|
17
|
+
constructor(cyclePath) {
|
|
18
|
+
const pathStr = cyclePath.join(' -> ');
|
|
19
|
+
super(`Circular dependency detected: ${pathStr}`);
|
|
20
|
+
this.name = 'CircularDependencyError';
|
|
21
|
+
this.cyclePath = cyclePath;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Error thrown when a referenced dependency doesn't exist
|
|
26
|
+
*/
|
|
27
|
+
export class MissingDependencyError extends Error {
|
|
28
|
+
/** The missing dependency ID */
|
|
29
|
+
dependency;
|
|
30
|
+
/** The node that references the missing dependency */
|
|
31
|
+
node;
|
|
32
|
+
constructor(dependency, node) {
|
|
33
|
+
super(`Missing dependency '${dependency}' referenced by '${node}'. ` +
|
|
34
|
+
`Ensure '${dependency}' is added to the graph before '${node}'.`);
|
|
35
|
+
this.name = 'MissingDependencyError';
|
|
36
|
+
this.dependency = dependency;
|
|
37
|
+
this.node = node;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Directed Acyclic Graph for workflow step dependencies
|
|
42
|
+
*/
|
|
43
|
+
export class DependencyGraph {
|
|
44
|
+
nodes = new Map();
|
|
45
|
+
/**
|
|
46
|
+
* Create a DependencyGraph from event registrations
|
|
47
|
+
*/
|
|
48
|
+
static fromEventRegistrations(registrations) {
|
|
49
|
+
const graph = new DependencyGraph();
|
|
50
|
+
// First pass: add all nodes without dependencies
|
|
51
|
+
for (const reg of registrations) {
|
|
52
|
+
const nodeId = `${reg.noun}.${reg.event}`;
|
|
53
|
+
if (!graph.hasNode(nodeId)) {
|
|
54
|
+
// Add as placeholder first (will be updated with deps in second pass)
|
|
55
|
+
graph.nodes.set(nodeId, {
|
|
56
|
+
id: nodeId,
|
|
57
|
+
dependencies: [],
|
|
58
|
+
dependencyTypes: {},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Second pass: add dependencies
|
|
63
|
+
for (const reg of registrations) {
|
|
64
|
+
const nodeId = `${reg.noun}.${reg.event}`;
|
|
65
|
+
if (reg.dependencies) {
|
|
66
|
+
const deps = Array.isArray(reg.dependencies.dependsOn)
|
|
67
|
+
? reg.dependencies.dependsOn
|
|
68
|
+
: [reg.dependencies.dependsOn];
|
|
69
|
+
const depType = reg.dependencies.type || 'hard';
|
|
70
|
+
for (const dep of deps) {
|
|
71
|
+
if (!graph.hasNode(dep)) {
|
|
72
|
+
throw new MissingDependencyError(dep, nodeId);
|
|
73
|
+
}
|
|
74
|
+
const node = graph.nodes.get(nodeId);
|
|
75
|
+
if (!node.dependencies.includes(dep)) {
|
|
76
|
+
node.dependencies.push(dep);
|
|
77
|
+
node.dependencyTypes = node.dependencyTypes || {};
|
|
78
|
+
node.dependencyTypes[dep] = depType;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Check for cycles after adding edges
|
|
82
|
+
const cycle = graph.detectCycles();
|
|
83
|
+
if (cycle) {
|
|
84
|
+
throw new CircularDependencyError(cycle);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return graph;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Check if a node exists
|
|
92
|
+
*/
|
|
93
|
+
hasNode(id) {
|
|
94
|
+
return this.nodes.has(id);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Add a node to the graph
|
|
98
|
+
*/
|
|
99
|
+
addNode(id, config) {
|
|
100
|
+
// Check for self-reference
|
|
101
|
+
if (config?.dependsOn) {
|
|
102
|
+
const deps = Array.isArray(config.dependsOn)
|
|
103
|
+
? config.dependsOn
|
|
104
|
+
: [config.dependsOn];
|
|
105
|
+
if (deps.includes(id)) {
|
|
106
|
+
throw new CircularDependencyError([id, id]);
|
|
107
|
+
}
|
|
108
|
+
// Verify all dependencies exist
|
|
109
|
+
for (const dep of deps) {
|
|
110
|
+
if (!this.nodes.has(dep)) {
|
|
111
|
+
throw new MissingDependencyError(dep, id);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const dependencies = config?.dependsOn
|
|
116
|
+
? Array.isArray(config.dependsOn)
|
|
117
|
+
? config.dependsOn
|
|
118
|
+
: [config.dependsOn]
|
|
119
|
+
: [];
|
|
120
|
+
const depType = config?.type || 'hard';
|
|
121
|
+
const dependencyTypes = {};
|
|
122
|
+
for (const dep of dependencies) {
|
|
123
|
+
dependencyTypes[dep] = depType;
|
|
124
|
+
}
|
|
125
|
+
this.nodes.set(id, {
|
|
126
|
+
id,
|
|
127
|
+
dependencies,
|
|
128
|
+
dependencyTypes,
|
|
129
|
+
});
|
|
130
|
+
// Check for cycles after adding node with dependencies
|
|
131
|
+
if (dependencies.length > 0) {
|
|
132
|
+
const cycle = this.detectCycles();
|
|
133
|
+
if (cycle) {
|
|
134
|
+
// Remove the node we just added
|
|
135
|
+
this.nodes.delete(id);
|
|
136
|
+
throw new CircularDependencyError(cycle);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Add an edge (dependency) between existing nodes
|
|
142
|
+
*/
|
|
143
|
+
addEdge(from, to, type = 'hard') {
|
|
144
|
+
if (!this.nodes.has(from)) {
|
|
145
|
+
throw new MissingDependencyError(from, to);
|
|
146
|
+
}
|
|
147
|
+
if (!this.nodes.has(to)) {
|
|
148
|
+
throw new MissingDependencyError(to, from);
|
|
149
|
+
}
|
|
150
|
+
const toNode = this.nodes.get(to);
|
|
151
|
+
// Check for self-reference
|
|
152
|
+
if (from === to) {
|
|
153
|
+
throw new CircularDependencyError([from, to]);
|
|
154
|
+
}
|
|
155
|
+
// Add the dependency
|
|
156
|
+
if (!toNode.dependencies.includes(from)) {
|
|
157
|
+
toNode.dependencies.push(from);
|
|
158
|
+
toNode.dependencyTypes = toNode.dependencyTypes || {};
|
|
159
|
+
toNode.dependencyTypes[from] = type;
|
|
160
|
+
}
|
|
161
|
+
// Check for cycles
|
|
162
|
+
const cycle = this.detectCycles();
|
|
163
|
+
if (cycle) {
|
|
164
|
+
// Rollback the edge
|
|
165
|
+
toNode.dependencies = toNode.dependencies.filter((d) => d !== from);
|
|
166
|
+
if (toNode.dependencyTypes) {
|
|
167
|
+
delete toNode.dependencyTypes[from];
|
|
168
|
+
}
|
|
169
|
+
throw new CircularDependencyError(cycle);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Get all nodes in the graph
|
|
174
|
+
*/
|
|
175
|
+
getNodes() {
|
|
176
|
+
return Array.from(this.nodes.values());
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Get a specific node
|
|
180
|
+
*/
|
|
181
|
+
getNode(id) {
|
|
182
|
+
return this.nodes.get(id);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get direct dependencies of a node
|
|
186
|
+
*/
|
|
187
|
+
getDependencies(id) {
|
|
188
|
+
const node = this.nodes.get(id);
|
|
189
|
+
if (!node) {
|
|
190
|
+
throw new MissingDependencyError(id, 'getDependencies()');
|
|
191
|
+
}
|
|
192
|
+
return [...node.dependencies];
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Get all transitive dependencies of a node
|
|
196
|
+
*/
|
|
197
|
+
getAllDependencies(id) {
|
|
198
|
+
const node = this.nodes.get(id);
|
|
199
|
+
if (!node) {
|
|
200
|
+
throw new MissingDependencyError(id, 'getAllDependencies()');
|
|
201
|
+
}
|
|
202
|
+
const visited = new Set();
|
|
203
|
+
const stack = [...node.dependencies];
|
|
204
|
+
while (stack.length > 0) {
|
|
205
|
+
const current = stack.pop();
|
|
206
|
+
if (visited.has(current))
|
|
207
|
+
continue;
|
|
208
|
+
visited.add(current);
|
|
209
|
+
const currentNode = this.nodes.get(current);
|
|
210
|
+
if (currentNode) {
|
|
211
|
+
for (const dep of currentNode.dependencies) {
|
|
212
|
+
if (!visited.has(dep)) {
|
|
213
|
+
stack.push(dep);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return Array.from(visited);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Get nodes that depend on a given node
|
|
222
|
+
*/
|
|
223
|
+
getDependents(id) {
|
|
224
|
+
const dependents = [];
|
|
225
|
+
for (const node of this.nodes.values()) {
|
|
226
|
+
if (node.dependencies.includes(id)) {
|
|
227
|
+
dependents.push(node.id);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return dependents;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Get only hard dependencies
|
|
234
|
+
*/
|
|
235
|
+
getHardDependencies(id) {
|
|
236
|
+
const node = this.nodes.get(id);
|
|
237
|
+
if (!node) {
|
|
238
|
+
throw new MissingDependencyError(id, 'getHardDependencies()');
|
|
239
|
+
}
|
|
240
|
+
return node.dependencies.filter((dep) => (node.dependencyTypes?.[dep] || 'hard') === 'hard');
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get only soft dependencies
|
|
244
|
+
*/
|
|
245
|
+
getSoftDependencies(id) {
|
|
246
|
+
const node = this.nodes.get(id);
|
|
247
|
+
if (!node) {
|
|
248
|
+
throw new MissingDependencyError(id, 'getSoftDependencies()');
|
|
249
|
+
}
|
|
250
|
+
return node.dependencies.filter((dep) => node.dependencyTypes?.[dep] === 'soft');
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Detect cycles using DFS
|
|
254
|
+
* Returns the cycle path if found, null otherwise
|
|
255
|
+
*/
|
|
256
|
+
detectCycles() {
|
|
257
|
+
const visited = new Set();
|
|
258
|
+
const recursionStack = new Set();
|
|
259
|
+
const path = [];
|
|
260
|
+
const dfs = (nodeId) => {
|
|
261
|
+
visited.add(nodeId);
|
|
262
|
+
recursionStack.add(nodeId);
|
|
263
|
+
path.push(nodeId);
|
|
264
|
+
const node = this.nodes.get(nodeId);
|
|
265
|
+
if (node) {
|
|
266
|
+
for (const dep of node.dependencies) {
|
|
267
|
+
if (!visited.has(dep)) {
|
|
268
|
+
const cycle = dfs(dep);
|
|
269
|
+
if (cycle)
|
|
270
|
+
return cycle;
|
|
271
|
+
}
|
|
272
|
+
else if (recursionStack.has(dep)) {
|
|
273
|
+
// Found a cycle - construct the cycle path
|
|
274
|
+
const cycleStart = path.indexOf(dep);
|
|
275
|
+
const cyclePath = path.slice(cycleStart);
|
|
276
|
+
cyclePath.push(dep); // Complete the cycle
|
|
277
|
+
return cyclePath;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
path.pop();
|
|
282
|
+
recursionStack.delete(nodeId);
|
|
283
|
+
return null;
|
|
284
|
+
};
|
|
285
|
+
for (const nodeId of this.nodes.keys()) {
|
|
286
|
+
if (!visited.has(nodeId)) {
|
|
287
|
+
const cycle = dfs(nodeId);
|
|
288
|
+
if (cycle)
|
|
289
|
+
return cycle;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Get parallel execution groups
|
|
296
|
+
* Returns nodes grouped by execution level (0 = no deps, 1 = depends on 0, etc.)
|
|
297
|
+
*/
|
|
298
|
+
getParallelGroups() {
|
|
299
|
+
const levels = new Map();
|
|
300
|
+
// Calculate level for each node
|
|
301
|
+
const calculateLevel = (nodeId) => {
|
|
302
|
+
if (levels.has(nodeId)) {
|
|
303
|
+
return levels.get(nodeId);
|
|
304
|
+
}
|
|
305
|
+
const node = this.nodes.get(nodeId);
|
|
306
|
+
if (!node || node.dependencies.length === 0) {
|
|
307
|
+
levels.set(nodeId, 0);
|
|
308
|
+
return 0;
|
|
309
|
+
}
|
|
310
|
+
let maxDepLevel = -1;
|
|
311
|
+
for (const dep of node.dependencies) {
|
|
312
|
+
const depLevel = calculateLevel(dep);
|
|
313
|
+
maxDepLevel = Math.max(maxDepLevel, depLevel);
|
|
314
|
+
}
|
|
315
|
+
const level = maxDepLevel + 1;
|
|
316
|
+
levels.set(nodeId, level);
|
|
317
|
+
return level;
|
|
318
|
+
};
|
|
319
|
+
// Calculate levels for all nodes
|
|
320
|
+
for (const nodeId of this.nodes.keys()) {
|
|
321
|
+
calculateLevel(nodeId);
|
|
322
|
+
}
|
|
323
|
+
// Group nodes by level
|
|
324
|
+
const groups = new Map();
|
|
325
|
+
for (const [nodeId, level] of levels) {
|
|
326
|
+
if (!groups.has(level)) {
|
|
327
|
+
groups.set(level, []);
|
|
328
|
+
}
|
|
329
|
+
groups.get(level).push(nodeId);
|
|
330
|
+
}
|
|
331
|
+
// Convert to sorted array of ParallelGroups
|
|
332
|
+
const result = [];
|
|
333
|
+
const sortedLevels = Array.from(groups.keys()).sort((a, b) => a - b);
|
|
334
|
+
for (const level of sortedLevels) {
|
|
335
|
+
result.push({
|
|
336
|
+
level,
|
|
337
|
+
nodes: groups.get(level),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
return result;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Export graph to DOT format for visualization
|
|
344
|
+
*/
|
|
345
|
+
toDot() {
|
|
346
|
+
const lines = ['digraph DependencyGraph {'];
|
|
347
|
+
lines.push(' rankdir=TB;');
|
|
348
|
+
lines.push(' node [shape=box];');
|
|
349
|
+
// Add nodes
|
|
350
|
+
for (const node of this.nodes.values()) {
|
|
351
|
+
const label = node.id.replace(/\./g, '\\n');
|
|
352
|
+
lines.push(` "${node.id}" [label="${label}"];`);
|
|
353
|
+
}
|
|
354
|
+
// Add edges
|
|
355
|
+
for (const node of this.nodes.values()) {
|
|
356
|
+
for (const dep of node.dependencies) {
|
|
357
|
+
const style = node.dependencyTypes?.[dep] === 'soft' ? 'dashed' : 'solid';
|
|
358
|
+
lines.push(` "${dep}" -> "${node.id}" [style=${style}];`);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
lines.push('}');
|
|
362
|
+
return lines.join('\n');
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Export graph to JSON format
|
|
366
|
+
*/
|
|
367
|
+
toJSON() {
|
|
368
|
+
const nodes = this.getNodes();
|
|
369
|
+
const edges = [];
|
|
370
|
+
for (const node of nodes) {
|
|
371
|
+
for (const dep of node.dependencies) {
|
|
372
|
+
edges.push({
|
|
373
|
+
from: dep,
|
|
374
|
+
to: node.id,
|
|
375
|
+
type: node.dependencyTypes?.[dep] || 'hard',
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return { nodes, edges };
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
//# sourceMappingURL=dependency-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-graph.js","sourceRoot":"","sources":["../src/dependency-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAmEH;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,0CAA0C;IAC1C,SAAS,CAAU;IAEnB,YAAY,SAAmB;QAC7B,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACtC,KAAK,CAAC,iCAAiC,OAAO,EAAE,CAAC,CAAA;QACjD,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,gCAAgC;IAChC,UAAU,CAAQ;IAElB,sDAAsD;IACtD,IAAI,CAAQ;IAEZ,YAAY,UAAkB,EAAE,IAAY;QAC1C,KAAK,CACH,uBAAuB,UAAU,oBAAoB,IAAI,KAAK;YAC5D,WAAW,UAAU,mCAAmC,IAAI,IAAI,CACnE,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AASD;;GAEG;AACH,MAAM,OAAO,eAAe;IAClB,KAAK,GAA2B,IAAI,GAAG,EAAE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,KAAK,KAAK,CAAC,CAAA;QAClD,CAAC;QAED,YAAY;QACZ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YACvC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACpC,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAA;gBACzE,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,SAAS,IAAI,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC,CAAA;YAC5D,CAAC;QACH,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC7B,MAAM,KAAK,GAAuB,EAAE,CAAA;QAEpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACpC,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI,EAAE,GAAG;oBACT,EAAE,EAAE,IAAI,CAAC,EAAE;oBACX,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM;iBAC5C,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF"}
|
package/dist/every.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* every('hour during business hours', $ => { ... })
|
|
9
9
|
* every('first Monday of the month at 9am', $ => { ... })
|
|
10
10
|
*/
|
|
11
|
-
import type { ScheduleHandler, ScheduleRegistration, ScheduleInterval } from './types.js';
|
|
11
|
+
import type { ScheduleHandler, ScheduleRegistration, ScheduleInterval, EveryProxy } from './types.js';
|
|
12
12
|
/**
|
|
13
13
|
* Get all registered schedule handlers
|
|
14
14
|
*/
|
|
@@ -29,6 +29,35 @@ export declare function setCronConverter(converter: (description: string) => Pro
|
|
|
29
29
|
* Convert natural language to cron expression
|
|
30
30
|
*/
|
|
31
31
|
export declare function toCron(description: string): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Schedule registration callback type
|
|
34
|
+
* Used by createTypedEveryProxy to customize handler registration
|
|
35
|
+
*/
|
|
36
|
+
export type EveryProxyRegistrationCallback = (interval: ScheduleInterval, handler: ScheduleHandler) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Create a typed EveryProxy with proper TypeScript generics
|
|
39
|
+
*
|
|
40
|
+
* This factory function creates a callable proxy that supports:
|
|
41
|
+
* - Direct calls: every('natural language', handler)
|
|
42
|
+
* - Simple patterns: every.hour(handler)
|
|
43
|
+
* - Day + time: every.Monday.at9am(handler)
|
|
44
|
+
* - Intervals: every.minutes(30)(handler)
|
|
45
|
+
*
|
|
46
|
+
* @param registerCallback - Function called when a handler is registered
|
|
47
|
+
* @returns A properly typed EveryProxy
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Create proxy with custom registration
|
|
52
|
+
* const myEvery = createTypedEveryProxy((interval, handler) => {
|
|
53
|
+
* myRegistry.push({ interval, handler })
|
|
54
|
+
* })
|
|
55
|
+
*
|
|
56
|
+
* myEvery.hour(handler) // Properly typed!
|
|
57
|
+
* myEvery.Monday.at9am(handler) // Chained access typed!
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function createTypedEveryProxy(registerCallback: EveryProxyRegistrationCallback): EveryProxy;
|
|
32
61
|
/**
|
|
33
62
|
* The `every` function/object for registering scheduled handlers
|
|
34
63
|
*
|
|
@@ -55,7 +84,7 @@ export declare function toCron(description: string): Promise<string>;
|
|
|
55
84
|
* every('every 15 minutes between 9am and 5pm on weekdays', $ => { ... })
|
|
56
85
|
* ```
|
|
57
86
|
*/
|
|
58
|
-
export declare const every:
|
|
87
|
+
export declare const every: EveryProxy;
|
|
59
88
|
/**
|
|
60
89
|
* Convert interval to milliseconds (for simulation/testing)
|
|
61
90
|
*/
|
package/dist/every.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"every.d.ts","sourceRoot":"","sources":["../src/every.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"every.d.ts","sourceRoot":"","sources":["../src/every.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAEhB,UAAU,EAGX,MAAM,YAAY,CAAA;AAQnB;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,oBAAoB,EAAE,CAE5D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,GACvB,IAAI,CAMN;AA6ED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAE1F;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBjE;AAED;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG,CAC3C,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,KACrB,IAAI,CAAA;AAET;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,8BAA8B,GAAG,UAAU,CA8ElG;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,KAAK,YAAqB,CAAA;AAEvC;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAiB/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CA+BjE"}
|
package/dist/every.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* every('hour during business hours', $ => { ... })
|
|
9
9
|
* every('first Monday of the month at 9am', $ => { ... })
|
|
10
10
|
*/
|
|
11
|
+
import { PLURAL_UNITS, isPluralUnitKey } from './types.js';
|
|
11
12
|
/**
|
|
12
13
|
* Registry of schedule handlers
|
|
13
14
|
*/
|
|
@@ -128,46 +129,64 @@ export async function toCron(description) {
|
|
|
128
129
|
`Set up AI conversion with setCronConverter() for natural language schedules.`);
|
|
129
130
|
}
|
|
130
131
|
/**
|
|
131
|
-
* Create
|
|
132
|
+
* Create a typed EveryProxy with proper TypeScript generics
|
|
133
|
+
*
|
|
134
|
+
* This factory function creates a callable proxy that supports:
|
|
135
|
+
* - Direct calls: every('natural language', handler)
|
|
136
|
+
* - Simple patterns: every.hour(handler)
|
|
137
|
+
* - Day + time: every.Monday.at9am(handler)
|
|
138
|
+
* - Intervals: every.minutes(30)(handler)
|
|
139
|
+
*
|
|
140
|
+
* @param registerCallback - Function called when a handler is registered
|
|
141
|
+
* @returns A properly typed EveryProxy
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* // Create proxy with custom registration
|
|
146
|
+
* const myEvery = createTypedEveryProxy((interval, handler) => {
|
|
147
|
+
* myRegistry.push({ interval, handler })
|
|
148
|
+
* })
|
|
149
|
+
*
|
|
150
|
+
* myEvery.hour(handler) // Properly typed!
|
|
151
|
+
* myEvery.Monday.at9am(handler) // Chained access typed!
|
|
152
|
+
* ```
|
|
132
153
|
*/
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
154
|
+
export function createTypedEveryProxy(registerCallback) {
|
|
155
|
+
// Create typed handler for day schedule patterns with time modifiers
|
|
156
|
+
const createDayScheduleHandler = (pattern, prop) => ({
|
|
157
|
+
get(_target, timeKey, _receiver) {
|
|
158
|
+
const time = TIME_PATTERNS[timeKey];
|
|
159
|
+
if (time) {
|
|
160
|
+
const cron = combineWithTime(pattern, time);
|
|
161
|
+
return (handlerFn) => {
|
|
162
|
+
registerCallback({ type: 'cron', expression: cron, natural: `${prop}.${timeKey}` }, handlerFn);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
return undefined;
|
|
166
|
+
},
|
|
167
|
+
apply(_target, _thisArg, args) {
|
|
168
|
+
registerCallback({ type: 'cron', expression: pattern, natural: prop }, args[0]);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
// Create the main EveryProxy handler
|
|
172
|
+
const everyHandler = {
|
|
173
|
+
get(_target, prop, _receiver) {
|
|
136
174
|
// Check if it's a known pattern
|
|
137
175
|
const pattern = KNOWN_PATTERNS[prop];
|
|
138
176
|
if (pattern) {
|
|
139
177
|
// Return an object that can either be called directly or have time accessors
|
|
140
178
|
const result = (handlerFn) => {
|
|
141
|
-
|
|
179
|
+
registerCallback({ type: 'cron', expression: pattern, natural: prop }, handlerFn);
|
|
142
180
|
};
|
|
143
|
-
// Add time accessors
|
|
144
|
-
return new Proxy(result,
|
|
145
|
-
get(_t, timeKey) {
|
|
146
|
-
const time = TIME_PATTERNS[timeKey];
|
|
147
|
-
if (time) {
|
|
148
|
-
const cron = combineWithTime(pattern, time);
|
|
149
|
-
return (handlerFn) => {
|
|
150
|
-
registerScheduleHandler({ type: 'cron', expression: cron, natural: `${prop}.${timeKey}` }, handlerFn);
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return undefined;
|
|
154
|
-
},
|
|
155
|
-
apply(_t, _thisArg, args) {
|
|
156
|
-
registerScheduleHandler({ type: 'cron', expression: pattern, natural: prop }, args[0]);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
181
|
+
// Add time accessors with typed handler
|
|
182
|
+
return new Proxy(result, createDayScheduleHandler(pattern, prop));
|
|
159
183
|
}
|
|
160
184
|
// Check for plural time units (e.g., seconds(5), minutes(30))
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
hours: 'hour',
|
|
165
|
-
days: 'day',
|
|
166
|
-
weeks: 'week',
|
|
167
|
-
};
|
|
168
|
-
if (pluralUnits[prop]) {
|
|
185
|
+
// Using type guard and typed constant for type-safe interval creation
|
|
186
|
+
if (isPluralUnitKey(prop)) {
|
|
187
|
+
const intervalType = PLURAL_UNITS[prop];
|
|
169
188
|
return (value) => (handlerFn) => {
|
|
170
|
-
|
|
189
|
+
registerCallback({ type: intervalType, value, natural: `${value} ${prop}` }, handlerFn);
|
|
171
190
|
};
|
|
172
191
|
}
|
|
173
192
|
return undefined;
|
|
@@ -177,11 +196,23 @@ function createEveryProxy() {
|
|
|
177
196
|
const [description, handler] = args;
|
|
178
197
|
if (typeof description === 'string' && typeof handler === 'function') {
|
|
179
198
|
// Register with natural language - will be converted to cron at runtime
|
|
180
|
-
|
|
199
|
+
registerCallback({ type: 'natural', description }, handler);
|
|
181
200
|
}
|
|
182
201
|
}
|
|
183
202
|
};
|
|
184
|
-
|
|
203
|
+
// Create callable target with proper typing
|
|
204
|
+
// The function serves as the Proxy target - actual behavior is in the handler's apply trap
|
|
205
|
+
const target = function (_description, _handler) { };
|
|
206
|
+
return new Proxy(target, everyHandler);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Create the `every` proxy using the global schedule registry
|
|
210
|
+
*
|
|
211
|
+
* This is the default implementation that uses registerScheduleHandler
|
|
212
|
+
* for backward compatibility with the standalone `every` export.
|
|
213
|
+
*/
|
|
214
|
+
function createEveryProxy() {
|
|
215
|
+
return createTypedEveryProxy(registerScheduleHandler);
|
|
185
216
|
}
|
|
186
217
|
/**
|
|
187
218
|
* The `every` function/object for registering scheduled handlers
|
package/dist/every.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"every.js","sourceRoot":"","sources":["../src/every.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"every.js","sourceRoot":"","sources":["../src/every.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE1D;;GAEG;AACH,MAAM,gBAAgB,GAA2B,EAAE,CAAA;AAEnD;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAA;AAC9B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAA;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAA0B,EAC1B,OAAwB;IAExB,gBAAgB,CAAC,IAAI,CAAC;QACpB,QAAQ;QACR,OAAO;QACP,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE;KAC3B,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,cAAc,GAA2B;IAC7C,aAAa;IACb,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,WAAW;IAEnB,eAAe;IACf,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,WAAW;IACvB,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,WAAW;IACvB,QAAQ,EAAE,WAAW;IAErB,kBAAkB;IAClB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,UAAU,EAAE,W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,QAAQ,CAAC,KAAK,GAAG,CAAC;gBACzC,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,UAAU;gBACnC,CAAC,CAAC,cAAc,CAAA;QACpB,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC;gBACzC,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,QAAQ;gBACjC,CAAC,CAAC,YAAY,CAAA;QAClB,KAAK,KAAK;YACR,OAAO,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC;gBACzC,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,OAAO;gBAChC,CAAC,CAAC,WAAW,CAAA;QACjB,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC;gBACzC,CAAC,CAAC,SAAS,QAAQ,CAAC,KAAK,QAAQ;gBACjC,CAAC,CAAC,YAAY,CAAA;QAClB,KAAK,MAAM;YACT,OAAO,SAAS,QAAQ,CAAC,UAAU,EAAE,CAAA;QACvC,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC,WAAW,CAAA;IAC/B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph algorithms for workflow execution ordering
|
|
3
|
+
*
|
|
4
|
+
* Provides topological sorting and execution level grouping for
|
|
5
|
+
* managing workflow step dependencies.
|
|
6
|
+
*/
|
|
7
|
+
export { topologicalSort, topologicalSortKahn, topologicalSortDFS, getExecutionLevels, CycleDetectedError, MissingNodeError, type SortableNode, type ExecutionLevel, type TopologicalSortOptions, type TopologicalSortResult, } from './topological-sort.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph algorithms for workflow execution ordering
|
|
3
|
+
*
|
|
4
|
+
* Provides topological sorting and execution level grouping for
|
|
5
|
+
* managing workflow step dependencies.
|
|
6
|
+
*/
|
|
7
|
+
export { topologicalSort, topologicalSortKahn, topologicalSortDFS, getExecutionLevels, CycleDetectedError, MissingNodeError, } from './topological-sort.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GAKjB,MAAM,uBAAuB,CAAA"}
|