yaml-flow 5.0.0 → 5.2.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/{examples/example-board/reusable-server-runtime.js → board-livecards-server-runtime.js} +103 -24
- package/{examples/example-board/reusable-board-runtime-client.js → browser/board-livecards-runtime-client.js} +6 -2
- package/browser/{board-livegraph-runtime.js → board-livegraph-engine.js} +212 -16
- package/browser/board-livegraph-engine.js.map +1 -0
- package/browser/live-cards.js +362 -38
- package/browser/live-cards.schema.json +20 -4
- package/dist/board-livegraph-runtime/index.cjs +210 -14
- package/dist/board-livegraph-runtime/index.cjs.map +1 -1
- package/dist/board-livegraph-runtime/index.d.cts +49 -5
- package/dist/board-livegraph-runtime/index.d.ts +49 -5
- package/dist/board-livegraph-runtime/index.js +209 -15
- package/dist/board-livegraph-runtime/index.js.map +1 -1
- package/dist/card-compute/index.cjs +63 -7
- package/dist/card-compute/index.cjs.map +1 -1
- package/dist/card-compute/index.d.cts +2 -2
- package/dist/card-compute/index.d.ts +2 -2
- package/dist/card-compute/index.js +63 -7
- package/dist/card-compute/index.js.map +1 -1
- package/dist/cli/board-live-cards-cli.cjs +664 -75
- package/dist/cli/board-live-cards-cli.cjs.map +1 -1
- package/dist/cli/board-live-cards-cli.d.cts +33 -5
- package/dist/cli/board-live-cards-cli.d.ts +33 -5
- package/dist/cli/board-live-cards-cli.js +661 -76
- package/dist/cli/board-live-cards-cli.js.map +1 -1
- package/dist/{constants-ozjf1Ejw.d.cts → constants-BzZUyYlp.d.cts} +1 -1
- package/dist/{constants-DuzE5n03.d.ts → constants-oCEbNpul.d.ts} +1 -1
- package/dist/continuous-event-graph/index.cjs +47 -14
- package/dist/continuous-event-graph/index.cjs.map +1 -1
- package/dist/continuous-event-graph/index.d.cts +9 -9
- package/dist/continuous-event-graph/index.d.ts +9 -9
- package/dist/continuous-event-graph/index.js +47 -14
- package/dist/continuous-event-graph/index.js.map +1 -1
- package/dist/event-graph/index.cjs +29 -12
- package/dist/event-graph/index.cjs.map +1 -1
- package/dist/event-graph/index.d.cts +5 -5
- package/dist/event-graph/index.d.ts +5 -5
- package/dist/event-graph/index.js +29 -12
- package/dist/event-graph/index.js.map +1 -1
- package/dist/index.cjs +93 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +93 -20
- package/dist/index.js.map +1 -1
- package/dist/inference/index.cjs +29 -12
- 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 +29 -12
- package/dist/inference/index.js.map +1 -1
- package/dist/{journal-NLYuqege.d.ts → journal-9HEgs7dU.d.ts} +1 -1
- package/dist/{journal-DRfJiheM.d.cts → journal-B-JCfQnh.d.cts} +1 -1
- package/dist/{live-cards-bridge-Or7fdEJV.d.ts → live-cards-bridge-CeNxiVcm.d.ts} +6 -2
- package/dist/{live-cards-bridge-vGJ6tMzN.d.cts → live-cards-bridge-z_rJCSbi.d.cts} +6 -2
- package/dist/{schedule-CMcZe5Ny.d.ts → schedule-Cszq9LYY.d.ts} +1 -1
- package/dist/{schedule-CiucyCan.d.cts → schedule-qWNL0RQh.d.cts} +1 -1
- package/dist/{types-CMFSIjpc.d.cts → types-BBhqYGhE.d.cts} +4 -0
- package/dist/{types-CMFSIjpc.d.ts → types-BBhqYGhE.d.ts} +4 -0
- package/dist/{types-BzLD8bjb.d.cts → types-CHSdoAAA.d.cts} +1 -1
- package/dist/{types-C2eJ7DAV.d.ts → types-CoW0gQl3.d.ts} +1 -1
- package/dist/{validate-DJQTQ6bP.d.ts → validate-BAVzUJWa.d.ts} +1 -1
- package/dist/{validate-ke92Cleg.d.cts → validate-Dbu7ygys.d.cts} +1 -1
- package/examples/browser/boards/portfolio-tracker/cards/portfolio-risk-assessment.json +28 -0
- package/examples/browser/boards/portfolio-tracker/cards/rebalancing-strategy.json +28 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +187 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.js +139 -5
- package/examples/example-board/agent-instructions-cardlayout.md +28 -0
- package/examples/example-board/agent-instructions.md +603 -0
- package/examples/example-board/cards/card-concentration.json +42 -0
- package/examples/example-board/cards/card-market-prices.json +51 -0
- package/examples/example-board/cards/card-portfolio-action.json +19 -0
- package/examples/example-board/cards/card-portfolio-risks.json +19 -0
- package/examples/example-board/cards/card-portfolio-value.json +62 -0
- package/examples/example-board/cards/card-portfolio.json +44 -0
- package/examples/example-board/demo-chat-handler.js +373 -33
- package/examples/example-board/demo-server-config.json +5 -0
- package/examples/example-board/demo-server.js +83 -7
- package/examples/example-board/demo-shell-browser.html +75 -207
- package/examples/example-board/demo-shell-with-server.html +14 -9
- package/examples/example-board/demo-shell.html +1 -1
- package/examples/example-board/demo-task-executor.js +259 -41
- package/package.json +6 -2
- package/schema/live-cards.schema.json +20 -4
- package/browser/board-livegraph-runtime.js.map +0 -1
- package/examples/example-board/board.yaml +0 -23
- package/examples/example-board/bootstrap_payload.json +0 -1
- package/examples/example-board/cards/card-chain-region-alert.json +0 -39
- package/examples/example-board/cards/card-chain-region-totals.json +0 -26
- package/examples/example-board/cards/card-chain-top-region.json +0 -24
- package/examples/example-board/cards/card-ex-actions.json +0 -32
- package/examples/example-board/cards/card-ex-chart.json +0 -30
- package/examples/example-board/cards/card-ex-filter.json +0 -36
- package/examples/example-board/cards/card-ex-filtered-by-preference.json +0 -59
- package/examples/example-board/cards/card-ex-form.json +0 -91
- package/examples/example-board/cards/card-ex-list.json +0 -22
- package/examples/example-board/cards/card-ex-markdown.json +0 -17
- package/examples/example-board/cards/card-ex-metric.json +0 -19
- package/examples/example-board/cards/card-ex-narrative.json +0 -36
- package/examples/example-board/cards/card-ex-source-http.json +0 -28
- package/examples/example-board/cards/card-ex-source.json +0 -21
- package/examples/example-board/cards/card-ex-status.json +0 -35
- package/examples/example-board/cards/card-ex-table.json +0 -30
- package/examples/example-board/cards/card-ex-todo.json +0 -29
- package/examples/example-board/mock.db +0 -15
- package/examples/example-board/reusable-runtime-artifacts-adapter.js +0 -233
|
@@ -7099,15 +7099,30 @@ function selectOptimalTasks(candidates, graph, state, conflictStrategy) {
|
|
|
7099
7099
|
}
|
|
7100
7100
|
|
|
7101
7101
|
// src/event-graph/task-transitions.ts
|
|
7102
|
-
function applyTaskStart(state, taskName) {
|
|
7102
|
+
function applyTaskStart(state, taskName, graph) {
|
|
7103
7103
|
const existingTask = state.tasks[taskName] ?? createDefaultGraphEngineStore2();
|
|
7104
|
+
const startConsumedHashes = {};
|
|
7105
|
+
if (graph) {
|
|
7106
|
+
const taskConfig = graph.tasks[taskName];
|
|
7107
|
+
const requires = getRequires(taskConfig);
|
|
7108
|
+
for (const token of requires) {
|
|
7109
|
+
for (const [otherName, otherConfig] of Object.entries(graph.tasks)) {
|
|
7110
|
+
if (getProvides(otherConfig).includes(token)) {
|
|
7111
|
+
const otherState = state.tasks[otherName];
|
|
7112
|
+
if (otherState?.lastDataHash) startConsumedHashes[token] = otherState.lastDataHash;
|
|
7113
|
+
break;
|
|
7114
|
+
}
|
|
7115
|
+
}
|
|
7116
|
+
}
|
|
7117
|
+
}
|
|
7104
7118
|
const updatedTask = {
|
|
7105
7119
|
...existingTask,
|
|
7106
7120
|
status: "running",
|
|
7107
7121
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7108
7122
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7109
7123
|
progress: 0,
|
|
7110
|
-
error: void 0
|
|
7124
|
+
error: void 0,
|
|
7125
|
+
startConsumedHashes
|
|
7111
7126
|
};
|
|
7112
7127
|
return {
|
|
7113
7128
|
...state,
|
|
@@ -7127,16 +7142,18 @@ function applyTaskCompletion(state, graph, taskName, result, dataHash, data) {
|
|
|
7127
7142
|
} else {
|
|
7128
7143
|
outputTokens = getProvides(taskConfig);
|
|
7129
7144
|
}
|
|
7130
|
-
const lastConsumedHashes = { ...existingTask.lastConsumedHashes };
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
for (const
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7145
|
+
const lastConsumedHashes = existingTask.startConsumedHashes ? { ...existingTask.startConsumedHashes } : { ...existingTask.lastConsumedHashes };
|
|
7146
|
+
if (!existingTask.startConsumedHashes) {
|
|
7147
|
+
const requires = taskConfig.requires ?? [];
|
|
7148
|
+
for (const token of requires) {
|
|
7149
|
+
for (const [otherName, otherConfig] of Object.entries(graph.tasks)) {
|
|
7150
|
+
if (getProvides(otherConfig).includes(token)) {
|
|
7151
|
+
const otherState = state.tasks[otherName];
|
|
7152
|
+
if (otherState?.lastDataHash) {
|
|
7153
|
+
lastConsumedHashes[token] = otherState.lastDataHash;
|
|
7154
|
+
}
|
|
7155
|
+
break;
|
|
7138
7156
|
}
|
|
7139
|
-
break;
|
|
7140
7157
|
}
|
|
7141
7158
|
}
|
|
7142
7159
|
}
|
|
@@ -7258,7 +7275,7 @@ function apply(state, event, graph) {
|
|
|
7258
7275
|
}
|
|
7259
7276
|
switch (event.type) {
|
|
7260
7277
|
case "task-started":
|
|
7261
|
-
return applyTaskStart(state, event.taskName);
|
|
7278
|
+
return applyTaskStart(state, event.taskName, graph);
|
|
7262
7279
|
case "task-completed":
|
|
7263
7280
|
return applyTaskCompletion(state, graph, event.taskName, event.result, event.dataHash, event.data);
|
|
7264
7281
|
case "task-failed":
|