yaml-flow 5.2.8 → 5.4.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/board-livecards-server-runtime.js +15 -66
- package/browser/board-livegraph-engine.js +4 -1
- package/browser/board-livegraph-engine.js.map +1 -1
- package/browser/card-compute.js +1 -1
- package/browser/live-cards.js +178 -144
- package/browser/live-cards.schema.json +1 -1
- package/dist/board-livegraph-runtime/index.cjs +4 -1
- package/dist/board-livegraph-runtime/index.cjs.map +1 -1
- package/dist/board-livegraph-runtime/index.js +4 -1
- package/dist/board-livegraph-runtime/index.js.map +1 -1
- package/dist/card-compute/index.cjs +5 -1
- package/dist/card-compute/index.cjs.map +1 -1
- package/dist/card-compute/index.js +5 -1
- package/dist/card-compute/index.js.map +1 -1
- package/dist/cli/board-live-cards-cli.cjs +2416 -2113
- package/dist/cli/board-live-cards-cli.cjs.map +1 -1
- package/dist/cli/board-live-cards-cli.d.cts +59 -113
- package/dist/cli/board-live-cards-cli.d.ts +59 -113
- package/dist/cli/board-live-cards-cli.js +2413 -2109
- package/dist/cli/board-live-cards-cli.js.map +1 -1
- package/dist/continuous-event-graph/index.cjs +4 -1
- package/dist/continuous-event-graph/index.cjs.map +1 -1
- package/dist/continuous-event-graph/index.js +4 -1
- package/dist/continuous-event-graph/index.js.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.js +4 -4
- package/examples/example-board/agent-instructions-cardlayout.md +28 -0
- package/examples/example-board/agent-instructions.md +4 -5
- package/examples/example-board/cards/card-rebalance-sim.json +13 -3
- package/examples/example-board/demo-server.js +77 -11
- package/examples/example-board/demo-shell-browser.html +4 -4
- package/examples/example-board/demo-shell-with-server.html +4 -4
- package/examples/example-board/demo-task-executor.js +22 -2
- package/package.json +1 -1
- package/schema/live-cards.schema.json +1 -1
|
@@ -424,8 +424,6 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
424
424
|
}
|
|
425
425
|
function isGandalfCard(cardId) { return _gandalfCardIds.has(cardId); }
|
|
426
426
|
|
|
427
|
-
let didDemoSetup = false;
|
|
428
|
-
|
|
429
427
|
function resolveCliJsPath() {
|
|
430
428
|
if (configuredBoardLiveCardsCliJs && fs.existsSync(configuredBoardLiveCardsCliJs)) return configuredBoardLiveCardsCliJs;
|
|
431
429
|
|
|
@@ -729,57 +727,6 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
729
727
|
};
|
|
730
728
|
}
|
|
731
729
|
|
|
732
|
-
function demoPrepSetup() {
|
|
733
|
-
fs.mkdirSync(tmpSurfaceDir, { recursive: true });
|
|
734
|
-
fs.rmSync(tmpCardsDir, { recursive: true, force: true });
|
|
735
|
-
fs.mkdirSync(tmpCardsDir, { recursive: true });
|
|
736
|
-
|
|
737
|
-
const entries = fs.readdirSync(cardsDir, { withFileTypes: true });
|
|
738
|
-
for (const entry of entries) {
|
|
739
|
-
if (!entry.isFile()) continue;
|
|
740
|
-
if (!entry.name.toLowerCase().endsWith('.json')) continue;
|
|
741
|
-
const src = path.join(cardsDir, entry.name);
|
|
742
|
-
const dst = path.join(tmpCardsDir, entry.name);
|
|
743
|
-
fs.copyFileSync(src, dst);
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
// Copy gandalf-card templates if gandalfCardsDir is configured.
|
|
747
|
-
if (gandalfCardsDir && fs.existsSync(gandalfCardsDir)) {
|
|
748
|
-
fs.rmSync(tmpGandalfCardsDir, { recursive: true, force: true });
|
|
749
|
-
fs.mkdirSync(tmpGandalfCardsDir, { recursive: true });
|
|
750
|
-
for (const entry of fs.readdirSync(gandalfCardsDir, { withFileTypes: true })) {
|
|
751
|
-
if (!entry.isFile() || !entry.name.toLowerCase().endsWith('.json')) continue;
|
|
752
|
-
fs.copyFileSync(path.join(gandalfCardsDir, entry.name), path.join(tmpGandalfCardsDir, entry.name));
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
// Concatenate agent-instructions*.md files into copilot-instructions.md at boardSetupRoot
|
|
757
|
-
const boardSetupRoot = path.dirname(boardDir);
|
|
758
|
-
const agentInstructionFiles = ['agent-instructions.md', 'agent-instructions-cardlayout.md'];
|
|
759
|
-
const srcDir = path.dirname(cardsDir); // board source dir where agent-instructions*.md live
|
|
760
|
-
const parts = [];
|
|
761
|
-
for (const fname of agentInstructionFiles) {
|
|
762
|
-
const fpath = path.join(srcDir, fname);
|
|
763
|
-
if (fs.existsSync(fpath)) {
|
|
764
|
-
parts.push(fs.readFileSync(fpath, 'utf-8').trimEnd());
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
if (parts.length > 0) {
|
|
768
|
-
fs.writeFileSync(path.join(boardSetupRoot, 'copilot-instructions.md'), parts.join('\n\n') + '\n', 'utf-8');
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
didDemoSetup = true;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
function isDemoSetupDone() {
|
|
775
|
-
return didDemoSetup && fs.existsSync(tmpCardsDir);
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
function ensureDemoSetup() {
|
|
779
|
-
if (isDemoSetupDone()) return;
|
|
780
|
-
demoPrepSetup();
|
|
781
|
-
}
|
|
782
|
-
|
|
783
730
|
function resolveTaskExecutorPath(taskExecutorPathParam) {
|
|
784
731
|
const raw = typeof taskExecutorPathParam === 'string' ? taskExecutorPathParam.trim() : '';
|
|
785
732
|
const resolved = raw
|
|
@@ -931,8 +878,6 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
931
878
|
}
|
|
932
879
|
|
|
933
880
|
function initBoardAndSetup(taskExecutorPathParam, chatHandlerPathParam, inferenceAdapterPathParam) {
|
|
934
|
-
ensureDemoSetup();
|
|
935
|
-
|
|
936
881
|
if (!fs.existsSync(boardFile)) {
|
|
937
882
|
initBoard(taskExecutorPathParam, chatHandlerPathParam, inferenceAdapterPathParam);
|
|
938
883
|
}
|
|
@@ -958,6 +903,8 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
958
903
|
runtimeStatusDir: path.relative(path.dirname(boardDir), runtimeOutDir),
|
|
959
904
|
cardsDir: path.relative(path.dirname(boardDir), tmpCardsDir),
|
|
960
905
|
...(serverUrl ? { serverUrl } : {}),
|
|
906
|
+
...(configuredBoardLiveCardsCliJs ? { boardLiveCardsCliJs: configuredBoardLiveCardsCliJs } : {}),
|
|
907
|
+
...(configuredStepMachineCliPath ? { stepMachineCliPath: configuredStepMachineCliPath } : {}),
|
|
961
908
|
});
|
|
962
909
|
|
|
963
910
|
// Board-cards runtime: init if configured but not yet initialized.
|
|
@@ -976,7 +923,6 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
976
923
|
}
|
|
977
924
|
|
|
978
925
|
function bootstrapCards() {
|
|
979
|
-
ensureDemoSetup();
|
|
980
926
|
runCli(['upsert-card', '--rg', boardDir, '--card-glob', path.join(tmpCardsDir, '*.json')]);
|
|
981
927
|
}
|
|
982
928
|
|
|
@@ -1212,12 +1158,14 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
1212
1158
|
// The handler file lives in the appropriate runtime dir (.chat-handler).
|
|
1213
1159
|
// Called with: --boardId <id> --cardId <id> --extraEncJson <base64json>
|
|
1214
1160
|
// extraEncJson decodes to:
|
|
1215
|
-
// boardSetupRoot
|
|
1216
|
-
// boardRuntimeDir
|
|
1217
|
-
// runtimeStatusDir— relative: 'runtime-out'
|
|
1218
|
-
// cardsDir
|
|
1219
|
-
// chatDir
|
|
1220
|
-
// lastChatFile
|
|
1161
|
+
// boardSetupRoot — absolute path to board root (parent of runtime/, surface/, runtime-out/)
|
|
1162
|
+
// boardRuntimeDir — relative: 'runtime' (or 'gandalf-runtime' for gandalf cards)
|
|
1163
|
+
// runtimeStatusDir — relative: 'runtime-out'
|
|
1164
|
+
// cardsDir — relative: 'surface/tmp-cards' (or 'surface/tmp-gandalf-cards')
|
|
1165
|
+
// chatDir — relative (from cardsDir): e.g. 'card-portfolio/chats'
|
|
1166
|
+
// lastChatFile — filename of the just-written user message, e.g. '001_user.txt'
|
|
1167
|
+
// boardLiveCardsCliJs — absolute path to board-live-cards-cli.js (if configured)
|
|
1168
|
+
// stepMachineCliPath — absolute path to step-machine-cli.js (if configured)
|
|
1221
1169
|
// Handler failures are logged and silently ignored — chat-send response is never affected.
|
|
1222
1170
|
function invokeChatHandler(cardId, chatsDir, lastChatFile) {
|
|
1223
1171
|
const isGandalf = isGandalfCard(cardId);
|
|
@@ -1237,6 +1185,8 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
1237
1185
|
chatDir: chatsDir,
|
|
1238
1186
|
lastChatFile,
|
|
1239
1187
|
...(serverUrl ? { serverUrl } : {}),
|
|
1188
|
+
...(configuredBoardLiveCardsCliJs ? { boardLiveCardsCliJs: configuredBoardLiveCardsCliJs } : {}),
|
|
1189
|
+
...(configuredStepMachineCliPath ? { stepMachineCliPath: configuredStepMachineCliPath } : {}),
|
|
1240
1190
|
})).toString('base64');
|
|
1241
1191
|
try {
|
|
1242
1192
|
const proc = spawn(handlerCmd, [
|
|
@@ -1461,7 +1411,6 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
1461
1411
|
}
|
|
1462
1412
|
|
|
1463
1413
|
if (method === 'GET' && p === `${apiBasePath}/board-status`) {
|
|
1464
|
-
ensureDemoSetup();
|
|
1465
1414
|
json(res, 200, buildPublishedRuntimePayload());
|
|
1466
1415
|
return true;
|
|
1467
1416
|
}
|
|
@@ -1617,9 +1566,9 @@ export function createExampleBoardServerRuntime(options = {}) {
|
|
|
1617
1566
|
parseUrl,
|
|
1618
1567
|
json,
|
|
1619
1568
|
runCli,
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1569
|
+
cardsDir,
|
|
1570
|
+
gandalfCardsDir,
|
|
1571
|
+
tmpGandalfCardsDir,
|
|
1623
1572
|
buildPublishedRuntimePayload,
|
|
1624
1573
|
handleRuntimeApi,
|
|
1625
1574
|
clearChatRecords,
|
|
@@ -69,6 +69,7 @@ var BoardLiveGraph = (function (exports) {
|
|
|
69
69
|
var VALID_ELEMENT_KINDS = /* @__PURE__ */ new Set([
|
|
70
70
|
"metric",
|
|
71
71
|
"table",
|
|
72
|
+
"editable-table",
|
|
72
73
|
"chart",
|
|
73
74
|
"form",
|
|
74
75
|
"filter",
|
|
@@ -80,7 +81,9 @@ var BoardLiveGraph = (function (exports) {
|
|
|
80
81
|
"badge",
|
|
81
82
|
"text",
|
|
82
83
|
"markdown",
|
|
83
|
-
"
|
|
84
|
+
"ref",
|
|
85
|
+
"custom",
|
|
86
|
+
"actions"
|
|
84
87
|
]);
|
|
85
88
|
var ALLOWED_KEYS = /* @__PURE__ */ new Set(["id", "meta", "requires", "provides", "view", "card_data", "compute", "source_defs"]);
|
|
86
89
|
function validateNode(node) {
|