yaml-flow 3.0.0 → 3.1.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 +44 -23
- package/dist/{constants-B_ftYTTE.d.ts → constants-B2zqu10b.d.ts} +7 -57
- package/dist/{constants-CiyHX8L-.d.cts → constants-DJZU1pwJ.d.cts} +7 -57
- package/dist/continuous-event-graph/index.cjs +1161 -182
- package/dist/continuous-event-graph/index.cjs.map +1 -1
- package/dist/continuous-event-graph/index.d.cts +567 -48
- package/dist/continuous-event-graph/index.d.ts +567 -48
- package/dist/continuous-event-graph/index.js +1151 -183
- package/dist/continuous-event-graph/index.js.map +1 -1
- package/dist/event-graph/index.cjs +35 -11
- package/dist/event-graph/index.cjs.map +1 -1
- package/dist/event-graph/index.d.cts +14 -5
- package/dist/event-graph/index.d.ts +14 -5
- package/dist/event-graph/index.js +34 -11
- package/dist/event-graph/index.js.map +1 -1
- package/dist/index.cjs +945 -414
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +936 -415
- package/dist/index.js.map +1 -1
- package/dist/inference/index.cjs +31 -7
- package/dist/inference/index.cjs.map +1 -1
- package/dist/inference/index.d.cts +2 -2
- package/dist/inference/index.d.ts +2 -2
- package/dist/inference/index.js +31 -7
- package/dist/inference/index.js.map +1 -1
- package/dist/{types-CxJg9Jrt.d.cts → types-BwvgvlOO.d.cts} +2 -2
- package/dist/{types-BuEo3wVG.d.ts → types-ClRA8hzC.d.ts} +2 -2
- package/dist/{types-BpWrH1sf.d.cts → types-DEj7OakX.d.cts} +14 -4
- package/dist/{types-BpWrH1sf.d.ts → types-DEj7OakX.d.ts} +14 -4
- package/dist/validate-DEZ2Ymdb.d.ts +53 -0
- package/dist/validate-DqKTZg_o.d.cts +53 -0
- package/examples/batch/batch-step-machine.ts +121 -0
- package/examples/browser/index.html +367 -0
- package/examples/continuous-event-graph/live-cards-board.ts +215 -0
- package/examples/continuous-event-graph/live-portfolio-dashboard.ts +555 -0
- package/examples/continuous-event-graph/portfolio-tracker.ts +287 -0
- package/examples/continuous-event-graph/reactive-monitoring.ts +265 -0
- package/examples/continuous-event-graph/reactive-pipeline.ts +168 -0
- package/examples/continuous-event-graph/soc-incident-board.ts +287 -0
- package/examples/continuous-event-graph/stock-dashboard.ts +229 -0
- package/examples/event-graph/ci-cd-pipeline.ts +243 -0
- package/examples/event-graph/executor-diamond.ts +165 -0
- package/examples/event-graph/executor-pipeline.ts +161 -0
- package/examples/event-graph/research-pipeline.ts +137 -0
- package/examples/flows/ai-conversation.yaml +116 -0
- package/examples/flows/order-processing.yaml +143 -0
- package/examples/flows/simple-greeting.yaml +54 -0
- package/examples/graph-of-graphs/multi-stage-etl.ts +307 -0
- package/examples/graph-of-graphs/url-processing-pipeline.ts +254 -0
- package/examples/inference/azure-deployment.ts +149 -0
- package/examples/inference/copilot-cli.ts +138 -0
- package/examples/inference/data-pipeline.ts +145 -0
- package/examples/inference/pluggable-adapters.ts +254 -0
- package/examples/ingest.js +733 -0
- package/examples/node/ai-conversation.ts +195 -0
- package/examples/node/simple-greeting.ts +101 -0
- package/package.json +3 -2
|
@@ -6566,7 +6566,7 @@ function addDynamicTask(graph, taskName, taskConfig) {
|
|
|
6566
6566
|
}
|
|
6567
6567
|
};
|
|
6568
6568
|
}
|
|
6569
|
-
function
|
|
6569
|
+
function createDefaultGraphEngineStore() {
|
|
6570
6570
|
return {
|
|
6571
6571
|
status: "not-started",
|
|
6572
6572
|
executionCount: 0,
|
|
@@ -6579,7 +6579,7 @@ function createDefaultTaskState() {
|
|
|
6579
6579
|
function createInitialExecutionState(graph, executionId) {
|
|
6580
6580
|
const tasks = {};
|
|
6581
6581
|
for (const taskName of Object.keys(graph.tasks)) {
|
|
6582
|
-
tasks[taskName] =
|
|
6582
|
+
tasks[taskName] = createDefaultGraphEngineStore();
|
|
6583
6583
|
}
|
|
6584
6584
|
return {
|
|
6585
6585
|
status: "running",
|
|
@@ -7100,7 +7100,7 @@ function selectOptimalTasks(candidates, graph, state, conflictStrategy) {
|
|
|
7100
7100
|
|
|
7101
7101
|
// src/event-graph/task-transitions.ts
|
|
7102
7102
|
function applyTaskStart(state, taskName) {
|
|
7103
|
-
const existingTask = state.tasks[taskName] ??
|
|
7103
|
+
const existingTask = state.tasks[taskName] ?? createDefaultGraphEngineStore2();
|
|
7104
7104
|
const updatedTask = {
|
|
7105
7105
|
...existingTask,
|
|
7106
7106
|
status: "running",
|
|
@@ -7115,8 +7115,8 @@ function applyTaskStart(state, taskName) {
|
|
|
7115
7115
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString()
|
|
7116
7116
|
};
|
|
7117
7117
|
}
|
|
7118
|
-
function applyTaskCompletion(state, graph, taskName, result, dataHash) {
|
|
7119
|
-
const existingTask = state.tasks[taskName] ??
|
|
7118
|
+
function applyTaskCompletion(state, graph, taskName, result, dataHash, data) {
|
|
7119
|
+
const existingTask = state.tasks[taskName] ?? createDefaultGraphEngineStore2();
|
|
7120
7120
|
const taskConfig = graph.tasks[taskName];
|
|
7121
7121
|
if (!taskConfig) {
|
|
7122
7122
|
throw new Error(`Task "${taskName}" not found in graph`);
|
|
@@ -7148,6 +7148,7 @@ function applyTaskCompletion(state, graph, taskName, result, dataHash) {
|
|
|
7148
7148
|
executionCount: existingTask.executionCount + 1,
|
|
7149
7149
|
lastEpoch: existingTask.executionCount + 1,
|
|
7150
7150
|
lastDataHash: dataHash,
|
|
7151
|
+
data,
|
|
7151
7152
|
lastConsumedHashes,
|
|
7152
7153
|
error: void 0
|
|
7153
7154
|
};
|
|
@@ -7160,7 +7161,7 @@ function applyTaskCompletion(state, graph, taskName, result, dataHash) {
|
|
|
7160
7161
|
};
|
|
7161
7162
|
}
|
|
7162
7163
|
function applyTaskFailure(state, graph, taskName, error) {
|
|
7163
|
-
const existingTask = state.tasks[taskName] ??
|
|
7164
|
+
const existingTask = state.tasks[taskName] ?? createDefaultGraphEngineStore2();
|
|
7164
7165
|
const taskConfig = graph.tasks[taskName];
|
|
7165
7166
|
if (taskConfig?.retry) {
|
|
7166
7167
|
const retryCount = existingTask.retryCount + 1;
|
|
@@ -7203,7 +7204,7 @@ function applyTaskFailure(state, graph, taskName, error) {
|
|
|
7203
7204
|
};
|
|
7204
7205
|
}
|
|
7205
7206
|
function applyTaskProgress(state, taskName, message, progress) {
|
|
7206
|
-
const existingTask = state.tasks[taskName] ??
|
|
7207
|
+
const existingTask = state.tasks[taskName] ?? createDefaultGraphEngineStore2();
|
|
7207
7208
|
const updatedTask = {
|
|
7208
7209
|
...existingTask,
|
|
7209
7210
|
progress: typeof progress === "number" ? progress : existingTask.progress,
|
|
@@ -7219,7 +7220,27 @@ function applyTaskProgress(state, taskName, message, progress) {
|
|
|
7219
7220
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString()
|
|
7220
7221
|
};
|
|
7221
7222
|
}
|
|
7222
|
-
function
|
|
7223
|
+
function applyTaskRestart(state, taskName) {
|
|
7224
|
+
const existingTask = state.tasks[taskName];
|
|
7225
|
+
if (!existingTask) return state;
|
|
7226
|
+
const updatedTask = {
|
|
7227
|
+
...existingTask,
|
|
7228
|
+
status: "not-started",
|
|
7229
|
+
startedAt: void 0,
|
|
7230
|
+
completedAt: void 0,
|
|
7231
|
+
failedAt: void 0,
|
|
7232
|
+
error: void 0,
|
|
7233
|
+
data: void 0,
|
|
7234
|
+
progress: null,
|
|
7235
|
+
lastUpdated: (/* @__PURE__ */ new Date()).toISOString()
|
|
7236
|
+
};
|
|
7237
|
+
return {
|
|
7238
|
+
...state,
|
|
7239
|
+
tasks: { ...state.tasks, [taskName]: updatedTask },
|
|
7240
|
+
lastUpdated: (/* @__PURE__ */ new Date()).toISOString()
|
|
7241
|
+
};
|
|
7242
|
+
}
|
|
7243
|
+
function createDefaultGraphEngineStore2() {
|
|
7223
7244
|
return {
|
|
7224
7245
|
status: "not-started",
|
|
7225
7246
|
executionCount: 0,
|
|
@@ -7239,11 +7260,13 @@ function apply(state, event, graph) {
|
|
|
7239
7260
|
case "task-started":
|
|
7240
7261
|
return applyTaskStart(state, event.taskName);
|
|
7241
7262
|
case "task-completed":
|
|
7242
|
-
return applyTaskCompletion(state, graph, event.taskName, event.result, event.dataHash);
|
|
7263
|
+
return applyTaskCompletion(state, graph, event.taskName, event.result, event.dataHash, event.data);
|
|
7243
7264
|
case "task-failed":
|
|
7244
7265
|
return applyTaskFailure(state, graph, event.taskName, event.error);
|
|
7245
7266
|
case "task-progress":
|
|
7246
7267
|
return applyTaskProgress(state, event.taskName, event.message, event.progress);
|
|
7268
|
+
case "task-restart":
|
|
7269
|
+
return applyTaskRestart(state, event.taskName);
|
|
7247
7270
|
case "inject-tokens":
|
|
7248
7271
|
return applyInjectTokens(state, event.tokens);
|
|
7249
7272
|
case "agent-action":
|
|
@@ -7314,7 +7337,7 @@ function applyTaskCreation(state, taskName, taskConfig) {
|
|
|
7314
7337
|
...state,
|
|
7315
7338
|
tasks: {
|
|
7316
7339
|
...state.tasks,
|
|
7317
|
-
[taskName]:
|
|
7340
|
+
[taskName]: createDefaultGraphEngineStore()
|
|
7318
7341
|
},
|
|
7319
7342
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString()
|
|
7320
7343
|
};
|
|
@@ -8213,9 +8236,10 @@ exports.applyAll = applyAll;
|
|
|
8213
8236
|
exports.applyTaskCompletion = applyTaskCompletion;
|
|
8214
8237
|
exports.applyTaskFailure = applyTaskFailure;
|
|
8215
8238
|
exports.applyTaskProgress = applyTaskProgress;
|
|
8239
|
+
exports.applyTaskRestart = applyTaskRestart;
|
|
8216
8240
|
exports.applyTaskStart = applyTaskStart;
|
|
8217
8241
|
exports.computeAvailableOutputs = computeAvailableOutputs;
|
|
8218
|
-
exports.
|
|
8242
|
+
exports.createDefaultGraphEngineStore = createDefaultGraphEngineStore;
|
|
8219
8243
|
exports.createInitialExecutionState = createInitialExecutionState;
|
|
8220
8244
|
exports.detectStuckState = detectStuckState;
|
|
8221
8245
|
exports.exportGraphConfig = exportGraphConfig;
|