yaml-flow 5.2.1 → 5.2.5
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/board-livecards-server-runtime.js +48 -9
- package/browser/live-cards.js +55 -9
- package/dist/cli/board-live-cards-cli.cjs +9 -6
- package/dist/cli/board-live-cards-cli.cjs.map +1 -1
- package/dist/cli/board-live-cards-cli.js +9 -6
- package/dist/cli/board-live-cards-cli.js.map +1 -1
- package/examples/example-board/demo-chat-handler.js +111 -362
- package/examples/example-board/demo-server.js +6 -0
- package/examples/example-board/demo-shell-browser.html +3 -3
- package/examples/example-board/demo-shell-with-server.html +4 -4
- package/package.json +1 -1
|
@@ -1430,7 +1430,7 @@ function nextEntryAfterFetchFailure(entry, reason) {
|
|
|
1430
1430
|
return next;
|
|
1431
1431
|
}
|
|
1432
1432
|
function runtimePath(boardDir, cardId) {
|
|
1433
|
-
return path.join(boardDir,
|
|
1433
|
+
return path.join(boardDir, cardId, "runtime.json");
|
|
1434
1434
|
}
|
|
1435
1435
|
function readRuntimeState(boardDir, cardId) {
|
|
1436
1436
|
const p = runtimePath(boardDir, cardId);
|
|
@@ -1442,7 +1442,9 @@ function readRuntimeState(boardDir, cardId) {
|
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
function writeRuntimeState(boardDir, cardId, state) {
|
|
1445
|
-
|
|
1445
|
+
const p = runtimePath(boardDir, cardId);
|
|
1446
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
1447
|
+
fs.writeFileSync(p, JSON.stringify(state, null, 2));
|
|
1446
1448
|
}
|
|
1447
1449
|
function appendEventToJournal(boardDir, event) {
|
|
1448
1450
|
const journalPath = path.join(boardDir, JOURNAL_FILE);
|
|
@@ -1769,7 +1771,7 @@ function createBoardReactiveGraph(boardDir) {
|
|
|
1769
1771
|
const sourcesData = {};
|
|
1770
1772
|
for (const src of allSources) {
|
|
1771
1773
|
if (src.outputFile) {
|
|
1772
|
-
const filePath = path.join(boardDir, src.outputFile);
|
|
1774
|
+
const filePath = path.join(boardDir, cardId, src.outputFile);
|
|
1773
1775
|
if (fs.existsSync(filePath)) {
|
|
1774
1776
|
const raw = fs.readFileSync(filePath, "utf-8").trim();
|
|
1775
1777
|
try {
|
|
@@ -2300,10 +2302,10 @@ function cmdSourceDataFetched(args) {
|
|
|
2300
2302
|
process.exit(1);
|
|
2301
2303
|
}
|
|
2302
2304
|
const { cbk, rg, cid, b, d, cs } = payload;
|
|
2303
|
-
const destPath = path.join(rg, d);
|
|
2305
|
+
const destPath = path.join(rg, cid, d);
|
|
2304
2306
|
fs.mkdirSync(path.dirname(destPath), { recursive: true });
|
|
2305
2307
|
fs.renameSync(tmpFile, destPath);
|
|
2306
|
-
console.log(`[source-data-fetched] ${cid}.${b} \u2192 ${d}`);
|
|
2308
|
+
console.log(`[source-data-fetched] ${cid}.${b} \u2192 ${cid}/${d}`);
|
|
2307
2309
|
const fetchedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
2308
2310
|
const cbkDecoded = decodeCallbackToken2(cbk);
|
|
2309
2311
|
if (!cbkDecoded) {
|
|
@@ -2635,7 +2637,7 @@ function cmdInferenceDone(args) {
|
|
|
2635
2637
|
inferenceCompletedAt
|
|
2636
2638
|
};
|
|
2637
2639
|
fs.writeFileSync(cardPath, JSON.stringify(card, null, 2), "utf-8");
|
|
2638
|
-
const runtimePath2 = path.join(dir,
|
|
2640
|
+
const runtimePath2 = path.join(dir, taskName, "runtime.json");
|
|
2639
2641
|
let runtime = { _sources: {} };
|
|
2640
2642
|
if (fs.existsSync(runtimePath2)) {
|
|
2641
2643
|
try {
|
|
@@ -2645,6 +2647,7 @@ function cmdInferenceDone(args) {
|
|
|
2645
2647
|
}
|
|
2646
2648
|
const inferenceEntry = runtime._inferenceEntry ?? {};
|
|
2647
2649
|
runtime._inferenceEntry = nextEntryAfterFetchDelivery(inferenceEntry, inferenceCompletedAt);
|
|
2650
|
+
fs.mkdirSync(path.dirname(runtimePath2), { recursive: true });
|
|
2648
2651
|
fs.writeFileSync(runtimePath2, JSON.stringify(runtime, null, 2), "utf-8");
|
|
2649
2652
|
appendEventToJournal(dir, {
|
|
2650
2653
|
type: "task-progress",
|