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
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { L as LiveGraph, N as NodeInfo, b as LiveGraphSnapshot, D as DownstreamResult, U as UnreachableNodesResult, c as UnreachableTokensResult, e as UpstreamResult, a as LiveGraphHealth } from '../types-
|
|
2
|
-
export { B as BlockedTask, P as PendingTask, S as ScheduleResult, d as UnresolvedDependency } from '../types-
|
|
3
|
-
import { T as TaskConfig, f as GraphEvent, G as GraphConfig } from '../types-
|
|
4
|
-
export { c as ExecutionState, e as GraphEngineStore, g as GraphSettings } from '../types-
|
|
5
|
-
export { s as schedule } from '../schedule-
|
|
6
|
-
import { R as ReactiveGraph, e as TaskHandlerInput, T as TaskHandlerFn } from '../live-cards-bridge-
|
|
7
|
-
export { L as LiveBoard, a as LiveCard, b as LiveCardsToReactiveOptions, c as LiveCardsToReactiveResult, d as ReactiveGraphOptions, f as TaskHandlerReturn, h as computeDataHash, g as createReactiveGraph, l as liveCardsToReactiveGraph } from '../live-cards-bridge-
|
|
8
|
-
import { a as GraphValidationResult } from '../validate-
|
|
9
|
-
export { J as Journal, M as MemoryJournal } from '../journal-
|
|
1
|
+
import { L as LiveGraph, N as NodeInfo, b as LiveGraphSnapshot, D as DownstreamResult, U as UnreachableNodesResult, c as UnreachableTokensResult, e as UpstreamResult, a as LiveGraphHealth } from '../types-CHSdoAAA.cjs';
|
|
2
|
+
export { B as BlockedTask, P as PendingTask, S as ScheduleResult, d as UnresolvedDependency } from '../types-CHSdoAAA.cjs';
|
|
3
|
+
import { T as TaskConfig, f as GraphEvent, G as GraphConfig } from '../types-BBhqYGhE.cjs';
|
|
4
|
+
export { c as ExecutionState, e as GraphEngineStore, g as GraphSettings } from '../types-BBhqYGhE.cjs';
|
|
5
|
+
export { s as schedule } from '../schedule-qWNL0RQh.cjs';
|
|
6
|
+
import { R as ReactiveGraph, e as TaskHandlerInput, T as TaskHandlerFn } from '../live-cards-bridge-z_rJCSbi.cjs';
|
|
7
|
+
export { L as LiveBoard, a as LiveCard, b as LiveCardsToReactiveOptions, c as LiveCardsToReactiveResult, d as ReactiveGraphOptions, f as TaskHandlerReturn, h as computeDataHash, g as createReactiveGraph, l as liveCardsToReactiveGraph } from '../live-cards-bridge-z_rJCSbi.cjs';
|
|
8
|
+
import { a as GraphValidationResult } from '../validate-Dbu7ygys.cjs';
|
|
9
|
+
export { J as Journal, M as MemoryJournal } from '../journal-B-JCfQnh.cjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Continuous Event Graph — Core
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { L as LiveGraph, N as NodeInfo, b as LiveGraphSnapshot, D as DownstreamResult, U as UnreachableNodesResult, c as UnreachableTokensResult, e as UpstreamResult, a as LiveGraphHealth } from '../types-
|
|
2
|
-
export { B as BlockedTask, P as PendingTask, S as ScheduleResult, d as UnresolvedDependency } from '../types-
|
|
3
|
-
import { T as TaskConfig, f as GraphEvent, G as GraphConfig } from '../types-
|
|
4
|
-
export { c as ExecutionState, e as GraphEngineStore, g as GraphSettings } from '../types-
|
|
5
|
-
export { s as schedule } from '../schedule-
|
|
6
|
-
import { R as ReactiveGraph, e as TaskHandlerInput, T as TaskHandlerFn } from '../live-cards-bridge-
|
|
7
|
-
export { L as LiveBoard, a as LiveCard, b as LiveCardsToReactiveOptions, c as LiveCardsToReactiveResult, d as ReactiveGraphOptions, f as TaskHandlerReturn, h as computeDataHash, g as createReactiveGraph, l as liveCardsToReactiveGraph } from '../live-cards-bridge-
|
|
8
|
-
import { a as GraphValidationResult } from '../validate-
|
|
9
|
-
export { J as Journal, M as MemoryJournal } from '../journal-
|
|
1
|
+
import { L as LiveGraph, N as NodeInfo, b as LiveGraphSnapshot, D as DownstreamResult, U as UnreachableNodesResult, c as UnreachableTokensResult, e as UpstreamResult, a as LiveGraphHealth } from '../types-CoW0gQl3.js';
|
|
2
|
+
export { B as BlockedTask, P as PendingTask, S as ScheduleResult, d as UnresolvedDependency } from '../types-CoW0gQl3.js';
|
|
3
|
+
import { T as TaskConfig, f as GraphEvent, G as GraphConfig } from '../types-BBhqYGhE.js';
|
|
4
|
+
export { c as ExecutionState, e as GraphEngineStore, g as GraphSettings } from '../types-BBhqYGhE.js';
|
|
5
|
+
export { s as schedule } from '../schedule-Cszq9LYY.js';
|
|
6
|
+
import { R as ReactiveGraph, e as TaskHandlerInput, T as TaskHandlerFn } from '../live-cards-bridge-CeNxiVcm.js';
|
|
7
|
+
export { L as LiveBoard, a as LiveCard, b as LiveCardsToReactiveOptions, c as LiveCardsToReactiveResult, d as ReactiveGraphOptions, f as TaskHandlerReturn, h as computeDataHash, g as createReactiveGraph, l as liveCardsToReactiveGraph } from '../live-cards-bridge-CeNxiVcm.js';
|
|
8
|
+
import { a as GraphValidationResult } from '../validate-BAVzUJWa.js';
|
|
9
|
+
export { J as Journal, M as MemoryJournal } from '../journal-9HEgs7dU.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Continuous Event Graph — Core
|
|
@@ -65,15 +65,30 @@ function groupTasksByProvides(candidateTaskNames, tasks) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// src/event-graph/task-transitions.ts
|
|
68
|
-
function applyTaskStart(state, taskName) {
|
|
68
|
+
function applyTaskStart(state, taskName, graph) {
|
|
69
69
|
const existingTask = state.tasks[taskName] ?? createDefaultGraphEngineStore();
|
|
70
|
+
const startConsumedHashes = {};
|
|
71
|
+
if (graph) {
|
|
72
|
+
const taskConfig = graph.tasks[taskName];
|
|
73
|
+
const requires = getRequires(taskConfig);
|
|
74
|
+
for (const token of requires) {
|
|
75
|
+
for (const [otherName, otherConfig] of Object.entries(graph.tasks)) {
|
|
76
|
+
if (getProvides(otherConfig).includes(token)) {
|
|
77
|
+
const otherState = state.tasks[otherName];
|
|
78
|
+
if (otherState?.lastDataHash) startConsumedHashes[token] = otherState.lastDataHash;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
70
84
|
const updatedTask = {
|
|
71
85
|
...existingTask,
|
|
72
86
|
status: "running",
|
|
73
87
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
74
88
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
75
89
|
progress: 0,
|
|
76
|
-
error: void 0
|
|
90
|
+
error: void 0,
|
|
91
|
+
startConsumedHashes
|
|
77
92
|
};
|
|
78
93
|
return {
|
|
79
94
|
...state,
|
|
@@ -93,16 +108,18 @@ function applyTaskCompletion(state, graph, taskName, result, dataHash, data) {
|
|
|
93
108
|
} else {
|
|
94
109
|
outputTokens = getProvides(taskConfig);
|
|
95
110
|
}
|
|
96
|
-
const lastConsumedHashes = { ...existingTask.lastConsumedHashes };
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
for (const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
111
|
+
const lastConsumedHashes = existingTask.startConsumedHashes ? { ...existingTask.startConsumedHashes } : { ...existingTask.lastConsumedHashes };
|
|
112
|
+
if (!existingTask.startConsumedHashes) {
|
|
113
|
+
const requires = taskConfig.requires ?? [];
|
|
114
|
+
for (const token of requires) {
|
|
115
|
+
for (const [otherName, otherConfig] of Object.entries(graph.tasks)) {
|
|
116
|
+
if (getProvides(otherConfig).includes(token)) {
|
|
117
|
+
const otherState = state.tasks[otherName];
|
|
118
|
+
if (otherState?.lastDataHash) {
|
|
119
|
+
lastConsumedHashes[token] = otherState.lastDataHash;
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
104
122
|
}
|
|
105
|
-
break;
|
|
106
123
|
}
|
|
107
124
|
}
|
|
108
125
|
}
|
|
@@ -247,7 +264,7 @@ function applyEvent(live, event) {
|
|
|
247
264
|
switch (event.type) {
|
|
248
265
|
// --- Execution state transitions ---
|
|
249
266
|
case "task-started":
|
|
250
|
-
return { config, state: applyTaskStart(state, event.taskName) };
|
|
267
|
+
return { config, state: applyTaskStart(state, event.taskName, config) };
|
|
251
268
|
case "task-completed":
|
|
252
269
|
return { config, state: applyTaskCompletion(state, config, event.taskName, event.result, event.dataHash, event.data) };
|
|
253
270
|
case "task-failed":
|
|
@@ -1818,13 +1835,29 @@ function validateNode(node) {
|
|
|
1818
1835
|
if (!Array.isArray(n.sources)) {
|
|
1819
1836
|
errors.push("sources: must be an array");
|
|
1820
1837
|
} else {
|
|
1838
|
+
const bindTos = /* @__PURE__ */ new Set();
|
|
1839
|
+
const outputFiles = /* @__PURE__ */ new Set();
|
|
1821
1840
|
n.sources.forEach((src, i) => {
|
|
1822
1841
|
if (!src || typeof src !== "object" || Array.isArray(src)) {
|
|
1823
1842
|
errors.push(`sources[${i}]: must be an object`);
|
|
1824
1843
|
} else {
|
|
1825
1844
|
const s = src;
|
|
1826
|
-
if (typeof s.bindTo !== "string" || !s.bindTo)
|
|
1827
|
-
|
|
1845
|
+
if (typeof s.bindTo !== "string" || !s.bindTo) {
|
|
1846
|
+
errors.push(`sources[${i}]: missing required "bindTo" property`);
|
|
1847
|
+
} else {
|
|
1848
|
+
if (bindTos.has(s.bindTo)) {
|
|
1849
|
+
errors.push(`sources[${i}]: bindTo "${s.bindTo}" is not unique across sources`);
|
|
1850
|
+
}
|
|
1851
|
+
bindTos.add(s.bindTo);
|
|
1852
|
+
}
|
|
1853
|
+
if (typeof s.outputFile !== "string" || !s.outputFile) {
|
|
1854
|
+
errors.push(`sources[${i}]: missing required "outputFile" property`);
|
|
1855
|
+
} else {
|
|
1856
|
+
if (outputFiles.has(s.outputFile)) {
|
|
1857
|
+
errors.push(`sources[${i}]: outputFile "${s.outputFile}" is not unique across sources`);
|
|
1858
|
+
}
|
|
1859
|
+
outputFiles.add(s.outputFile);
|
|
1860
|
+
}
|
|
1828
1861
|
if (s.optionalForCompletionGating != null && typeof s.optionalForCompletionGating !== "boolean") {
|
|
1829
1862
|
errors.push(`sources[${i}]: optionalForCompletionGating must be a boolean`);
|
|
1830
1863
|
}
|