yaml-flow 8.4.7 → 8.4.9
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/browser/asset-integrity.json +3 -3
- package/browser/board-livecards-localstorage.js +6 -6
- package/browser/live-cards.js +7 -7
- package/cli/browser-api/board-live-cards-browser-adapter.d.ts +1 -1
- package/cli/node/board-live-cards-cli.js +13 -13
- package/cli/node/chat-store-cli.js +3 -3
- package/cli/node/fs-board-adapter.d.ts +3 -3
- package/cli/node/fs-board-adapter.js +13 -13
- package/cli/{types-BkJvnXVD.d.ts → types-BbQ75HLf.d.ts} +3 -1
- package/examples/board/demo-shell-with-server.html +2 -2
- package/examples/board/doc.html +2 -2
- package/examples/board/server/board-worker/source_def_flows.json +2 -1
- package/examples/board/server/board-worker/task-executor.js +88 -2
- package/examples/board-local/demo-shell-localstorage.html +3 -3
- package/lib/{artifacts-store-lib-454TAuov.d.ts → artifacts-store-lib-CXgRA5J7.d.ts} +1 -1
- package/lib/{artifacts-store-lib-zsGFbBV8.d.cts → artifacts-store-lib-WdoKNAF0.d.cts} +1 -1
- package/lib/artifacts-store-public.d.cts +2 -2
- package/lib/artifacts-store-public.d.ts +2 -2
- package/lib/board-live-cards-node.cjs +13 -13
- package/lib/board-live-cards-node.d.cts +6 -6
- package/lib/board-live-cards-node.d.ts +6 -6
- package/lib/board-live-cards-node.js +13 -13
- package/lib/{board-live-cards-public-Crjm8KWn.d.ts → board-live-cards-public-C81ZEkF-.d.ts} +3 -1
- package/lib/{board-live-cards-public-CU8VVw3v.d.cts → board-live-cards-public-wbWRD1nO.d.cts} +3 -1
- package/lib/board-live-cards-public.cjs +2 -2
- package/lib/board-live-cards-public.d.cts +1 -1
- package/lib/board-live-cards-public.d.ts +1 -1
- package/lib/board-live-cards-public.js +2 -2
- package/lib/board-live-cards-server-runtime.cjs +3 -3
- package/lib/board-live-cards-server-runtime.d.cts +3 -3
- package/lib/board-live-cards-server-runtime.d.ts +3 -3
- package/lib/board-live-cards-server-runtime.js +3 -3
- package/lib/card-store-public.d.cts +1 -1
- package/lib/card-store-public.d.ts +1 -1
- package/lib/chat-store-public.d.cts +1 -1
- package/lib/chat-store-public.d.ts +1 -1
- package/lib/server-runtime/index.cjs +3 -3
- package/lib/server-runtime/index.d.cts +4 -4
- package/lib/server-runtime/index.d.ts +4 -4
- package/lib/server-runtime/index.js +3 -3
- package/lib/{types-DX8wXuZ0.d.cts → types-D5E1YmeB.d.cts} +2 -2
- package/lib/{types-BC8ZnA6i.d.ts → types-D_WD7RYH.d.ts} +2 -2
- package/package.json +1 -1
|
@@ -219,7 +219,7 @@ interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
|
|
|
219
219
|
* Each field can also be overridden per-source via source_def.timeout.
|
|
220
220
|
*
|
|
221
221
|
* validationMs — validate-source-def, validate-card-preflight (structural, fast). Default: 10_000.
|
|
222
|
-
|
|
222
|
+
* preflightMs — source preflight executor hooks (probe-source-preflight / run-source-preflight). Default: 60_000.
|
|
223
223
|
* probeMs — run-source-fetch in probe/simulation paths. Default: 60_000.
|
|
224
224
|
* describeMs — describe-capabilities introspection. Default: 10_000.
|
|
225
225
|
*/
|
|
@@ -249,6 +249,8 @@ interface BoardLiveCardsNonCorePublic {
|
|
|
249
249
|
probeTmpSource(input: CommandInput): CommandResult;
|
|
250
250
|
/** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — card JSON arrives via stdin; no board state needed */
|
|
251
251
|
probeSourcePreflight(input: CommandInput): CommandResult;
|
|
252
|
+
/** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — runs the real source fetch flow as a preflight */
|
|
253
|
+
runSourcePreflight(input: CommandInput): CommandResult;
|
|
252
254
|
/** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — evaluates compute expressions with supplied data; no board state needed */
|
|
253
255
|
evalCardCompute(input: CommandInput): CommandResult<{
|
|
254
256
|
cardId: string;
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
20
20
|
<script src="https://cdn.jsdelivr.net/npm/dompurify/dist/purify.min.js"></script>
|
|
21
21
|
<script src="https://cdn.jsdelivr.net/npm/leader-line/leader-line.min.js"></script>
|
|
22
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.
|
|
23
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.
|
|
22
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.9/browser/live-cards.js"></script>
|
|
23
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.9/browser/board-livecards-client.js"></script>
|
|
24
24
|
</head>
|
|
25
25
|
<body class="bg-light">
|
|
26
26
|
<div class="container-fluid py-3">
|
package/examples/board/doc.html
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
38
38
|
<script src="https://cdn.jsdelivr.net/npm/dompurify/dist/purify.min.js"></script>
|
|
39
39
|
<script src="https://cdn.jsdelivr.net/npm/leader-line/leader-line.min.js"></script>
|
|
40
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.
|
|
41
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.
|
|
40
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.9/browser/live-cards.js"></script>
|
|
41
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.9/browser/board-livecards-client.js"></script>
|
|
42
42
|
</head>
|
|
43
43
|
<body class="bg-light">
|
|
44
44
|
<div class="container-fluid py-3">
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"describe-capabilities",
|
|
8
8
|
"validate-source-def",
|
|
9
9
|
"validate-card-preflight",
|
|
10
|
-
"probe-source-preflight"
|
|
10
|
+
"probe-source-preflight",
|
|
11
|
+
"run-source-preflight"
|
|
11
12
|
],
|
|
12
13
|
"extraSchema": {
|
|
13
14
|
"description": "Board topology context passed via --extra (base64-encoded JSON, baked at init).",
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
* describe-capabilities — emit registry-derived kinds, schemas, and probe info as JSON
|
|
9
9
|
* validate-source-def — validate one source_def against registry rules from stdin
|
|
10
10
|
* probe-source-preflight — perform a lightweight preflight for one source_def from stdin
|
|
11
|
+
* run-source-preflight — execute one source_def through its real fetch flow from stdin
|
|
11
12
|
*
|
|
12
13
|
* Runtime invocation shapes used by board-live-cards:
|
|
13
14
|
* run-source-fetch --in-ref <b64ref> --out-ref <b64ref> [--err-ref <b64ref>] [--extra <base64json>]
|
|
14
15
|
* validate-source-def <stdin: source JSON>
|
|
15
16
|
* probe-source-preflight <stdin: source JSON> [--extra <base64json>]
|
|
17
|
+
* run-source-preflight <stdin: source JSON> [--extra <base64json>]
|
|
16
18
|
*
|
|
17
19
|
* Payload read from --in-ref (raw source definition or { source_def, callback } envelope):
|
|
18
20
|
* {
|
|
@@ -322,7 +324,7 @@ async function probeSourcePreflightSubcommand(argv) {
|
|
|
322
324
|
ok: true,
|
|
323
325
|
reachable: true,
|
|
324
326
|
latencyMs: Date.now() - startedAt,
|
|
325
|
-
...(mockProjectionWarning ? {
|
|
327
|
+
...(mockProjectionWarning ? { note: mockProjectionWarning } : {}),
|
|
326
328
|
...(!mockProjectionWarning ? { resultValue: flowResult?.resultValue } : {}),
|
|
327
329
|
}));
|
|
328
330
|
return;
|
|
@@ -333,6 +335,86 @@ async function probeSourcePreflightSubcommand(argv) {
|
|
|
333
335
|
}
|
|
334
336
|
}
|
|
335
337
|
|
|
338
|
+
function validateRunSourcePreflightProjections(sourceDef) {
|
|
339
|
+
const projections = sourceDef?._projections;
|
|
340
|
+
if (!projections || typeof projections !== 'object' || Array.isArray(projections)) {
|
|
341
|
+
throw new Error('Missing _projections object for run-source-preflight');
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const declared = sourceDef?.projections;
|
|
345
|
+
if (!declared || typeof declared !== 'object' || Array.isArray(declared)) return;
|
|
346
|
+
|
|
347
|
+
for (const key of Object.keys(declared)) {
|
|
348
|
+
if (!Object.prototype.hasOwnProperty.call(projections, key)) {
|
|
349
|
+
throw new Error(`Required projection "${key}" is missing`);
|
|
350
|
+
}
|
|
351
|
+
if (projections[key] === undefined) {
|
|
352
|
+
throw new Error(`Projection "${key}" resolved to undefined`);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
async function runSourcePreflightSubcommand(argv) {
|
|
358
|
+
const extraIdx = argv.indexOf('--extra');
|
|
359
|
+
const extraB64 = extraIdx !== -1 ? argv[extraIdx + 1] : undefined;
|
|
360
|
+
|
|
361
|
+
let extra = {};
|
|
362
|
+
if (extraB64) {
|
|
363
|
+
try { extra = JSON.parse(Buffer.from(extraB64, 'base64').toString('utf-8')); }
|
|
364
|
+
catch { /* ignore malformed extra */ }
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const startedAt = Date.now();
|
|
368
|
+
let bindTo;
|
|
369
|
+
let kind;
|
|
370
|
+
try {
|
|
371
|
+
const chunks = [];
|
|
372
|
+
for await (const chunk of process.stdin) {
|
|
373
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
374
|
+
}
|
|
375
|
+
const raw = Buffer.concat(chunks).toString('utf-8').trim();
|
|
376
|
+
if (!raw) {
|
|
377
|
+
console.log(JSON.stringify({ ok: false, reachable: false, latencyMs: Date.now() - startedAt, error: 'Missing run-source-preflight input JSON on stdin' }));
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
let sourceDef;
|
|
382
|
+
try {
|
|
383
|
+
sourceDef = JSON.parse(raw);
|
|
384
|
+
} catch (err) {
|
|
385
|
+
console.log(JSON.stringify({ ok: false, reachable: false, latencyMs: Date.now() - startedAt, error: `Invalid run-source-preflight JSON: ${String(err && err.message || err)}` }));
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
bindTo = typeof sourceDef?.bindTo === 'string' ? sourceDef.bindTo : undefined;
|
|
390
|
+
validateRunSourcePreflightProjections(sourceDef);
|
|
391
|
+
|
|
392
|
+
const resolved = await resolveAndExecuteSourceFlow(sourceDef, extra);
|
|
393
|
+
kind = resolved.kind;
|
|
394
|
+
console.log(JSON.stringify({
|
|
395
|
+
ok: true,
|
|
396
|
+
reachable: true,
|
|
397
|
+
latencyMs: Date.now() - startedAt,
|
|
398
|
+
...(bindTo ? { bindTo } : {}),
|
|
399
|
+
...(kind ? { kind } : {}),
|
|
400
|
+
resultValue: resolved.flowResult?.resultValue,
|
|
401
|
+
note: 'Actual fetch preflight passed',
|
|
402
|
+
}));
|
|
403
|
+
return;
|
|
404
|
+
} catch (err) {
|
|
405
|
+
const detail = (err && (err.stderr || err.stdout)) ? `\n${err.stderr || err.stdout}`.trimEnd() : '';
|
|
406
|
+
console.log(JSON.stringify({
|
|
407
|
+
ok: false,
|
|
408
|
+
reachable: false,
|
|
409
|
+
latencyMs: Date.now() - startedAt,
|
|
410
|
+
...(bindTo ? { bindTo } : {}),
|
|
411
|
+
...(kind ? { kind } : {}),
|
|
412
|
+
error: `${String(err && err.message || err)}${detail}`,
|
|
413
|
+
}));
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
336
418
|
function getByPath(obj, dottedPath) {
|
|
337
419
|
if (!dottedPath) return undefined;
|
|
338
420
|
return String(dottedPath).split('.').reduce((acc, key) => {
|
|
@@ -439,7 +521,7 @@ function describeCapabilities() {
|
|
|
439
521
|
executor: registry?.executor || EXECUTOR_NAME,
|
|
440
522
|
subcommands: Array.isArray(registry?.subcommands)
|
|
441
523
|
? registry.subcommands
|
|
442
|
-
: ['run-source-fetch', 'probe-source-preflight', 'describe-capabilities', 'validate-source-def'],
|
|
524
|
+
: ['run-source-fetch', 'probe-source-preflight', 'run-source-preflight', 'describe-capabilities', 'validate-source-def'],
|
|
443
525
|
sourceKinds,
|
|
444
526
|
...(registry?.extraSchema ? { extraSchema: registry.extraSchema } : {}),
|
|
445
527
|
};
|
|
@@ -456,6 +538,10 @@ async function main() {
|
|
|
456
538
|
await probeSourcePreflightSubcommand(process.argv.slice(3));
|
|
457
539
|
return;
|
|
458
540
|
}
|
|
541
|
+
if (sub === 'run-source-preflight') {
|
|
542
|
+
await runSourcePreflightSubcommand(process.argv.slice(3));
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
459
545
|
if (sub === 'describe' || sub === 'describe-capabilities') {
|
|
460
546
|
describeCapabilities();
|
|
461
547
|
return;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
<title>Example Board Demo (LocalStorage Runtime)</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="../../browser/favicon.svg" />
|
|
8
8
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
|
|
9
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.9/browser/compute-jsonata.js"></script>
|
|
10
10
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
11
11
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
12
12
|
<script src="https://cdn.jsdelivr.net/npm/dompurify/dist/purify.min.js"></script>
|
|
13
13
|
<script src="https://cdn.jsdelivr.net/npm/leader-line/leader-line.min.js"></script>
|
|
14
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.
|
|
15
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.
|
|
14
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.9/browser/live-cards.js"></script>
|
|
15
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.4.9/browser/board-livecards-localstorage.js"></script>
|
|
16
16
|
</head>
|
|
17
17
|
<body class="bg-light">
|
|
18
18
|
<div class="container-fluid py-3">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CommandInput, a as CommandResult } from './board-live-cards-public-
|
|
2
|
-
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-
|
|
1
|
+
import { C as CommandInput, a as CommandResult } from './board-live-cards-public-wbWRD1nO.cjs';
|
|
2
|
+
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-WdoKNAF0.cjs';
|
|
3
3
|
import './storage-interface-B-7pDHwD.cjs';
|
|
4
4
|
import './execution-refs.cjs';
|
|
5
5
|
import './types-BBhqYGhE.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CommandInput, a as CommandResult } from './board-live-cards-public-
|
|
2
|
-
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-
|
|
1
|
+
import { C as CommandInput, a as CommandResult } from './board-live-cards-public-C81ZEkF-.js';
|
|
2
|
+
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-CXgRA5J7.js';
|
|
3
3
|
import './storage-interface-B-7pDHwD.js';
|
|
4
4
|
import './execution-refs.js';
|
|
5
5
|
import './types-BBhqYGhE.js';
|