yaml-flow 7.0.0 → 8.0.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/browser/asset-integrity.json +8 -4
- package/browser/board-livecards-client.js +1 -1
- package/browser/board-livecards-localstorage.js +5 -5
- package/browser/live-cards.js +19 -3307
- package/cli/board-live-cards-lib-tjYsPt5U.d.ts +321 -0
- package/{dist/cli → cli}/browser-api/board-live-cards-browser-adapter.d.ts +3 -5
- package/cli/browser-api/board-live-cards-browser-adapter.js +3 -0
- package/{dist/cli → cli}/browser-api/card-store-browser-api.d.ts +1 -2
- package/{dist/cli → cli}/browser-api/card-store-browser-api.js +1 -1
- package/cli/execution-interface-C_A6WCiK.d.ts +284 -0
- package/cli/node/artifacts-store-cli.js +11 -0
- package/cli/node/batch-runner-cli.js +3 -0
- package/cli/node/board-live-cards-cli.js +15 -0
- package/cli/node/card-store-cli.js +8 -0
- package/{dist/cli → cli}/node/execution-adapter.d.ts +3 -3
- package/cli/node/execution-adapter.js +3 -0
- package/{dist/cli → cli}/node/fs-board-adapter.d.ts +24 -11
- package/cli/node/fs-board-adapter.js +14 -0
- package/{dist/cli → cli}/node/source-cli-task-executor.js +2 -2
- package/cli/node/step-machine-cli.d.ts +7 -0
- package/cli/node/step-machine-cli.js +5 -0
- package/{dist/board-live-cards-public-CW5074xr.d.cts → cli/types-CziUxkiv.d.ts} +69 -7
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/card-store-ref.json +1 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/chat-handler.json +1 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/outputs-store-ref.json +1 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/task-executor.json +1 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/graph.json +29 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/lastJournalProcessedId.json +1 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime-out/.outputs/status.json +25 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-market-prices/computed_values.json +67 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio/computed_values.json +1 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio-value/computed_values.json +52 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/holdings.json +22 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/positions.json +46 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/quotes.json +35 -0
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/status.json +113 -0
- package/examples/{example-board/cards/card-market-prices.json → board/cards/cardT-market-prices.json} +2 -2
- package/examples/{example-board/cards/card-portfolio.json → board/cards/cardT-portfolio.json} +3 -13
- package/examples/{example-board → board}/demo-server-config.json +0 -1
- package/examples/{example-board → board}/demo-server.js +70 -72
- package/examples/{example-board → board}/demo-shell-with-server.html +3 -3
- package/examples/{example-board → board}/demo-task-executor.js +75 -32
- package/examples/board/gandalf-cards/card-source-kinds.json +36 -0
- package/examples/board/gandalf-cards/cards/_index.json +7 -0
- package/examples/board/gandalf-cards/cards/card-source-kinds.json +64 -0
- package/examples/board/source-def-flows/copilot.flow.json +33 -0
- package/examples/board/source-def-flows/mock.flow.json +35 -0
- package/examples/board/source-def-flows/url-list.flow.json +33 -0
- package/examples/board/source-def-flows/url.flow.json +33 -0
- package/examples/board/source-def-flows/workiq.flow.json +34 -0
- package/examples/board/source-def-handlers/copilot-source-handler.js +141 -0
- package/examples/board/source-def-handlers/http-source-handler.js +145 -0
- package/examples/board/source_def_flows.json +249 -0
- package/examples/board/test/demo-http-test.js +317 -0
- package/examples/{example-board → board-local}/demo-shell-localstorage.html +4 -4
- package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/handlers}/portfolio-tracker-fetch-prices.js +1 -1
- package/examples/{browser/boards/portfolio-tracker/portfolio-tracker-public.js → portfolio-tracker/portfolio-tracker.js} +11 -14
- package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/test}/portfolio-t4.js +32 -50
- package/lib/artifacts-store-lib-public-BABrgFkV.d.ts +119 -0
- package/lib/artifacts-store-lib-public-DGa8BpJT.d.cts +119 -0
- package/lib/artifacts-store-public.cjs +2 -0
- package/lib/artifacts-store-public.d.cts +5 -0
- package/lib/artifacts-store-public.d.ts +5 -0
- package/lib/artifacts-store-public.js +2 -0
- package/lib/board-live-cards-node.cjs +14 -0
- package/{dist/cli/node/execution-adapter.d.cts → lib/board-live-cards-node.d.cts} +45 -85
- package/lib/board-live-cards-node.d.ts +134 -0
- package/lib/board-live-cards-node.js +14 -0
- package/lib/board-live-cards-public-BnmRAbQV.d.cts +383 -0
- package/{dist/board-live-cards-public-hnZo0mAf.d.ts → lib/board-live-cards-public-CsmYrvpd.d.ts} +142 -77
- package/lib/board-live-cards-public.cjs +3 -0
- package/lib/board-live-cards-public.d.cts +4 -0
- package/lib/board-live-cards-public.d.ts +4 -0
- package/lib/board-live-cards-public.js +3 -0
- package/lib/board-live-cards-server-runtime.cjs +9 -0
- package/lib/board-live-cards-server-runtime.d.cts +6 -0
- package/lib/board-live-cards-server-runtime.d.ts +6 -0
- package/lib/board-live-cards-server-runtime.js +9 -0
- package/lib/board-livegraph-runtime/index.cjs +3 -0
- package/{dist → lib}/board-livegraph-runtime/index.d.cts +1 -2
- package/{dist → lib}/board-livegraph-runtime/index.d.ts +1 -2
- package/lib/board-livegraph-runtime/index.js +3 -0
- package/lib/board-worker-adapter.cjs +10 -0
- package/{dist/storage-refs.d.cts → lib/board-worker-adapter.d.cts} +5 -5
- package/{dist/storage-refs.d.ts → lib/board-worker-adapter.d.ts} +5 -5
- package/lib/board-worker-adapter.js +10 -0
- package/{dist → lib}/card-compute/index.cjs +1 -1
- package/{dist → lib}/card-compute/index.js +1 -1
- package/lib/card-store-public.cjs +2 -0
- package/lib/card-store-public.d.cts +61 -0
- package/lib/card-store-public.d.ts +61 -0
- package/lib/card-store-public.js +2 -0
- package/lib/card-validation.cjs +10 -0
- package/lib/card-validation.d.cts +35 -0
- package/lib/card-validation.d.ts +35 -0
- package/lib/card-validation.js +10 -0
- package/{dist/constants-oCEbNpul.d.ts → lib/constants-BPVLb3Es.d.ts} +1 -1
- package/{dist/constants-BzZUyYlp.d.cts → lib/constants-DXxsRN9y.d.cts} +1 -1
- package/{dist → lib}/continuous-event-graph/index.cjs +2 -2
- package/{dist → lib}/continuous-event-graph/index.d.cts +3 -5
- package/{dist → lib}/continuous-event-graph/index.d.ts +3 -5
- package/{dist → lib}/continuous-event-graph/index.js +2 -2
- package/{dist → lib}/event-graph/index.d.cts +2 -2
- package/{dist → lib}/event-graph/index.d.ts +2 -2
- package/lib/execution-refs.cjs +3 -0
- package/{dist → lib}/execution-refs.d.cts +38 -14
- package/{dist → lib}/execution-refs.d.ts +38 -14
- package/lib/execution-refs.js +3 -0
- package/lib/index.cjs +25 -0
- package/{dist → lib}/index.d.cts +7 -8
- package/{dist → lib}/index.d.ts +7 -8
- package/lib/index.js +25 -0
- package/{dist/live-cards-bridge-BXbVTsna.d.cts → lib/live-cards-bridge-DC_ZU0eS.d.ts} +134 -3
- package/{dist/live-cards-bridge-Ds28XR15.d.ts → lib/live-cards-bridge-b25aAVvE.d.cts} +134 -3
- package/lib/loader-CuuLjxVA.d.cts +42 -0
- package/lib/loader-Zborm2pq.d.ts +42 -0
- package/lib/server-runtime/index.cjs +9 -0
- package/{dist → lib}/server-runtime/index.d.cts +4 -4
- package/{dist → lib}/server-runtime/index.d.ts +4 -4
- package/lib/server-runtime/index.js +9 -0
- package/lib/step-machine/index.d.cts +64 -0
- package/lib/step-machine/index.d.ts +64 -0
- package/lib/step-machine-public/index.cjs +5 -0
- package/{dist → lib}/step-machine-public/index.d.cts +21 -1
- package/{dist → lib}/step-machine-public/index.d.ts +21 -1
- package/lib/step-machine-public/index.js +5 -0
- package/lib/storage-interface-BhAON-gW.d.cts +84 -0
- package/lib/storage-interface-BhAON-gW.d.ts +84 -0
- package/lib/stores/index.cjs +3 -0
- package/lib/stores/index.d.cts +4 -0
- package/lib/stores/index.d.ts +4 -0
- package/lib/stores/index.js +3 -0
- package/lib/stores/kv.cjs +3 -0
- package/lib/stores/kv.d.cts +32 -0
- package/lib/stores/kv.d.ts +32 -0
- package/lib/stores/kv.js +3 -0
- package/{dist → lib}/stores/memory.d.cts +1 -1
- package/{dist → lib}/stores/memory.d.ts +1 -1
- package/{dist/types-B1ZRa4aI.d.ts → lib/types-CBxkYuLY.d.ts} +2 -1
- package/{dist/types-ycun84cq.d.cts → lib/types-DQ1bKuB1.d.cts} +11 -0
- package/{dist/types-ycun84cq.d.ts → lib/types-DQ1bKuB1.d.ts} +11 -0
- package/{dist/types-BxEFcVK9.d.cts → lib/types-DkFvgxwq.d.cts} +2 -1
- package/package.json +79 -119
- package/board-live-cards-cli.js +0 -37
- package/browser/board-livecards-client.js.map +0 -1
- package/browser/board-livecards-localstorage.js.map +0 -1
- package/browser/board-livegraph-engine.js +0 -3
- package/browser/board-livegraph-engine.js.map +0 -1
- package/browser/card-compute.js +0 -266
- package/browser/compute-jsonata.js.map +0 -1
- package/card-store.js +0 -37
- package/dist/batch/index.cjs.map +0 -1
- package/dist/batch/index.js.map +0 -1
- package/dist/board-live-cards-lib-Bg6EvCo5.d.cts +0 -136
- package/dist/board-live-cards-lib-jM2uYG1v.d.ts +0 -136
- package/dist/board-livegraph-runtime/index.cjs +0 -3
- package/dist/board-livegraph-runtime/index.cjs.map +0 -1
- package/dist/board-livegraph-runtime/index.js +0 -3
- package/dist/board-livegraph-runtime/index.js.map +0 -1
- package/dist/card-compute/index.cjs.map +0 -1
- package/dist/card-compute/index.js.map +0 -1
- package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs +0 -3
- package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs.map +0 -1
- package/dist/cli/browser-api/board-live-cards-browser-adapter.d.cts +0 -37
- package/dist/cli/browser-api/board-live-cards-browser-adapter.js +0 -3
- package/dist/cli/browser-api/board-live-cards-browser-adapter.js.map +0 -1
- package/dist/cli/browser-api/card-store-browser-api.cjs +0 -2
- package/dist/cli/browser-api/card-store-browser-api.cjs.map +0 -1
- package/dist/cli/browser-api/card-store-browser-api.d.cts +0 -26
- package/dist/cli/browser-api/card-store-browser-api.js.map +0 -1
- package/dist/cli/node/artifacts-store-cli.cjs +0 -11
- package/dist/cli/node/artifacts-store-cli.cjs.map +0 -1
- package/dist/cli/node/artifacts-store-cli.d.cts +0 -8
- package/dist/cli/node/artifacts-store-cli.js +0 -11
- package/dist/cli/node/artifacts-store-cli.js.map +0 -1
- package/dist/cli/node/board-live-cards-cli.cjs +0 -15
- package/dist/cli/node/board-live-cards-cli.cjs.map +0 -1
- package/dist/cli/node/board-live-cards-cli.d.cts +0 -20
- package/dist/cli/node/board-live-cards-cli.js +0 -15
- package/dist/cli/node/board-live-cards-cli.js.map +0 -1
- package/dist/cli/node/card-store-cli.cjs +0 -8
- package/dist/cli/node/card-store-cli.cjs.map +0 -1
- package/dist/cli/node/card-store-cli.d.cts +0 -15
- package/dist/cli/node/card-store-cli.js +0 -8
- package/dist/cli/node/card-store-cli.js.map +0 -1
- package/dist/cli/node/execution-adapter.cjs +0 -3
- package/dist/cli/node/execution-adapter.cjs.map +0 -1
- package/dist/cli/node/execution-adapter.js +0 -3
- package/dist/cli/node/execution-adapter.js.map +0 -1
- package/dist/cli/node/fs-board-adapter.cjs +0 -14
- package/dist/cli/node/fs-board-adapter.cjs.map +0 -1
- package/dist/cli/node/fs-board-adapter.d.cts +0 -204
- package/dist/cli/node/fs-board-adapter.js +0 -14
- package/dist/cli/node/fs-board-adapter.js.map +0 -1
- package/dist/cli/node/source-cli-task-executor.cjs +0 -11
- package/dist/cli/node/source-cli-task-executor.cjs.map +0 -1
- package/dist/cli/node/source-cli-task-executor.js.map +0 -1
- package/dist/config/index.cjs.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/continuous-event-graph/index.cjs.map +0 -1
- package/dist/continuous-event-graph/index.js.map +0 -1
- package/dist/event-graph/index.cjs.map +0 -1
- package/dist/event-graph/index.js.map +0 -1
- package/dist/execution-refs.cjs +0 -3
- package/dist/execution-refs.cjs.map +0 -1
- package/dist/execution-refs.js +0 -3
- package/dist/execution-refs.js.map +0 -1
- package/dist/index.cjs +0 -30
- package/dist/index.cjs.map +0 -1
- package/dist/index.js +0 -30
- package/dist/index.js.map +0 -1
- package/dist/inference/index.cjs +0 -7
- package/dist/inference/index.cjs.map +0 -1
- package/dist/inference/index.d.cts +0 -229
- package/dist/inference/index.d.ts +0 -229
- package/dist/inference/index.js +0 -7
- package/dist/inference/index.js.map +0 -1
- package/dist/server-runtime/index.cjs +0 -9
- package/dist/server-runtime/index.cjs.map +0 -1
- package/dist/server-runtime/index.js +0 -9
- package/dist/server-runtime/index.js.map +0 -1
- package/dist/step-machine/index.cjs.map +0 -1
- package/dist/step-machine/index.d.cts +0 -102
- package/dist/step-machine/index.d.ts +0 -102
- package/dist/step-machine/index.js.map +0 -1
- package/dist/step-machine-public/index.cjs +0 -2
- package/dist/step-machine-public/index.cjs.map +0 -1
- package/dist/step-machine-public/index.js +0 -2
- package/dist/step-machine-public/index.js.map +0 -1
- package/dist/storage-refs.cjs +0 -10
- package/dist/storage-refs.cjs.map +0 -1
- package/dist/storage-refs.js +0 -10
- package/dist/storage-refs.js.map +0 -1
- package/dist/stores/file.cjs +0 -2
- package/dist/stores/file.cjs.map +0 -1
- package/dist/stores/file.d.cts +0 -36
- package/dist/stores/file.d.ts +0 -36
- package/dist/stores/file.js +0 -2
- package/dist/stores/file.js.map +0 -1
- package/dist/stores/index.cjs +0 -2
- package/dist/stores/index.cjs.map +0 -1
- package/dist/stores/index.d.cts +0 -4
- package/dist/stores/index.d.ts +0 -4
- package/dist/stores/index.js +0 -2
- package/dist/stores/index.js.map +0 -1
- package/dist/stores/localStorage.cjs +0 -2
- package/dist/stores/localStorage.cjs.map +0 -1
- package/dist/stores/localStorage.d.cts +0 -34
- package/dist/stores/localStorage.d.ts +0 -34
- package/dist/stores/localStorage.js +0 -2
- package/dist/stores/localStorage.js.map +0 -1
- package/dist/stores/memory.cjs.map +0 -1
- package/dist/stores/memory.js.map +0 -1
- package/dist/types-CHSdoAAA.d.cts +0 -135
- package/dist/types-CoW0gQl3.d.ts +0 -135
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-fetch-prices.py +0 -201
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-http-test.js +0 -357
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +0 -196
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.js +0 -300
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.py +0 -617
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.py +0 -366
- package/examples/browser/livecards-browser/index.html +0 -41
- package/examples/browser/step-machine-browser/index.html +0 -367
- package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/.runtime-out +0 -1
- package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/board-graph.json +0 -32
- package/examples/cli/step-machine-cli/portfolio-tracker/cards/holdings-table.json +0 -22
- package/examples/cli/step-machine-cli/portfolio-tracker/cards/portfolio-form.json +0 -43
- package/examples/cli/step-machine-cli/portfolio-tracker/cards/portfolio-value.json +0 -15
- package/examples/cli/step-machine-cli/portfolio-tracker/cards/price-fetch.json +0 -15
- package/examples/cli/step-machine-cli/portfolio-tracker/fetch-prices.js +0 -48
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -125
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +0 -32
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +0 -26
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/poll-status-cli.js +0 -49
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +0 -25
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +0 -23
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/status-cli.js +0 -21
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +0 -38
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +0 -48
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +0 -31
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/_board_pycli.py +0 -107
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/add-cards.py +0 -51
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/init-board.py +0 -45
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/poll-status.py +0 -71
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/reset-board-dir.py +0 -36
- package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-demo.flow.yaml +0 -26
- package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-handlers.py +0 -39
- package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker-pycli.flow.yaml +0 -80
- package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +0 -76
- package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +0 -44
- package/examples/cli/step-machine-cli/portfolio-tracker/run-inline-python-demo-pycli.py +0 -43
- package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker-pycli.py +0 -77
- package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +0 -28
- package/examples/cli/step-machine-demo/jsonata-init-board-cli.js +0 -31
- package/examples/cli/step-machine-demo/jsonata-init-board.flow.yaml +0 -54
- package/examples/cli/step-machine-demo/one-step-cli-only.flow.yaml +0 -21
- package/examples/cli/step-machine-demo/step-cli-echo-y.js +0 -15
- package/examples/cli/step-machine-demo/step2-double-cli.js +0 -33
- package/examples/cli/step-machine-demo/two-step-math.flow.yaml +0 -93
- package/examples/cli/step-machine-demo/two-step-mixed.flow.yaml +0 -43
- package/examples/example-board/agent-instructions-cardlayout.md +0 -56
- package/examples/example-board/agent-instructions.md +0 -834
- package/examples/example-board/cards/_index.json +0 -47
- package/examples/example-board/demo-shell.html +0 -63
- package/examples/index.html +0 -785
- package/examples/npm-libs/batch/batch-step-machine.ts +0 -121
- package/examples/npm-libs/continuous-event-graph/live-cards-board.ts +0 -215
- package/examples/npm-libs/continuous-event-graph/live-portfolio-dashboard.ts +0 -555
- package/examples/npm-libs/continuous-event-graph/portfolio-tracker.ts +0 -287
- package/examples/npm-libs/continuous-event-graph/reactive-monitoring.ts +0 -265
- package/examples/npm-libs/continuous-event-graph/reactive-pipeline.ts +0 -168
- package/examples/npm-libs/continuous-event-graph/soc-incident-board.ts +0 -287
- package/examples/npm-libs/continuous-event-graph/stock-dashboard.ts +0 -229
- package/examples/npm-libs/event-graph/ci-cd-pipeline.ts +0 -243
- package/examples/npm-libs/event-graph/executor-diamond.ts +0 -165
- package/examples/npm-libs/event-graph/executor-pipeline.ts +0 -161
- package/examples/npm-libs/event-graph/research-pipeline.ts +0 -137
- package/examples/npm-libs/flows/ai-conversation.yaml +0 -116
- package/examples/npm-libs/flows/order-processing.yaml +0 -143
- package/examples/npm-libs/flows/simple-greeting.yaml +0 -54
- package/examples/npm-libs/graph-of-graphs/multi-stage-etl.ts +0 -307
- package/examples/npm-libs/graph-of-graphs/url-processing-pipeline.ts +0 -254
- package/examples/npm-libs/inference/azure-deployment.ts +0 -149
- package/examples/npm-libs/inference/copilot-cli.ts +0 -138
- package/examples/npm-libs/inference/data-pipeline.ts +0 -145
- package/examples/npm-libs/inference/pluggable-adapters.ts +0 -254
- package/examples/npm-libs/node/ai-conversation.ts +0 -195
- package/examples/npm-libs/node/simple-greeting.ts +0 -101
- package/examples/step-machine-cli/portfolio-tracker/cards/holdings-table.json +0 -22
- package/examples/step-machine-cli/portfolio-tracker/cards/portfolio-form.json +0 -43
- package/examples/step-machine-cli/portfolio-tracker/cards/portfolio-value.json +0 -15
- package/examples/step-machine-cli/portfolio-tracker/cards/price-fetch.json +0 -15
- package/examples/step-machine-cli/portfolio-tracker/fetch-prices.js +0 -48
- package/examples/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -57
- package/examples/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +0 -27
- package/examples/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +0 -25
- package/examples/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +0 -29
- package/examples/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +0 -27
- package/examples/step-machine-cli/portfolio-tracker/handlers/status-cli.js +0 -25
- package/examples/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +0 -37
- package/examples/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +0 -53
- package/examples/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +0 -35
- package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker-task-executor.cjs +0 -96
- package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +0 -227
- package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +0 -38
- package/examples/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +0 -28
- package/step-machine-cli.js +0 -407
- /package/{dist/board-livegraph-runtime → cli/browser-api}/jsonata-sync.cjs +0 -0
- /package/{dist/cli → cli}/node/artifacts-store-cli.d.ts +0 -0
- /package/{dist/cli/node/source-cli-task-executor.d.cts → cli/node/batch-runner-cli.d.ts} +0 -0
- /package/{dist/cli → cli}/node/board-live-cards-cli.d.ts +0 -0
- /package/{dist/cli → cli}/node/card-store-cli.d.ts +0 -0
- /package/{dist/card-compute → cli/node}/jsonata-sync.cjs +0 -0
- /package/{dist/cli → cli}/node/source-cli-task-executor.d.ts +0 -0
- /package/examples/{example-board → board}/cards/card-concentration.json +0 -0
- /package/examples/{example-board → board}/cards/card-my-identity.json +0 -0
- /package/examples/{example-board → board}/cards/card-portfolio-action.json +0 -0
- /package/examples/{example-board → board}/cards/card-portfolio-intelligence.json +0 -0
- /package/examples/{example-board → board}/cards/card-portfolio-risks.json +0 -0
- /package/examples/{example-board → board}/cards/card-rebalance-impact.json +0 -0
- /package/examples/{example-board → board}/cards/card-rebalance-sim.json +0 -0
- /package/examples/{example-board/cards/card-portfolio-value.json → board/cards/cardT-portfolio-value.json} +0 -0
- /package/examples/{example-board → board}/demo-chat-handler.js +0 -0
- /package/examples/{example-board → board}/scripts/copilot_wrapper.bat +0 -0
- /package/examples/{example-board → board}/scripts/copilot_wrapper_helper.ps1 +0 -0
- /package/examples/{example-board → board}/scripts/workiq_wrapper.mjs +0 -0
- /package/examples/{browser/boards/portfolio-tracker → board/test}/portfolio-tracker-sse-worker.js +0 -0
- /package/{dist → lib}/batch/index.cjs +0 -0
- /package/{dist → lib}/batch/index.d.cts +0 -0
- /package/{dist → lib}/batch/index.d.ts +0 -0
- /package/{dist → lib}/batch/index.js +0 -0
- /package/{dist/cli/browser-api → lib/board-livegraph-runtime}/jsonata-sync.cjs +0 -0
- /package/{dist → lib}/card-compute/index.d.cts +0 -0
- /package/{dist → lib}/card-compute/index.d.ts +0 -0
- /package/{dist/cli/node → lib/card-compute}/jsonata-sync.cjs +0 -0
- /package/{dist → lib}/config/index.cjs +0 -0
- /package/{dist → lib}/config/index.d.cts +0 -0
- /package/{dist → lib}/config/index.d.ts +0 -0
- /package/{dist → lib}/config/index.js +0 -0
- /package/{dist → lib}/continuous-event-graph/jsonata-sync.cjs +0 -0
- /package/{dist → lib}/event-graph/index.cjs +0 -0
- /package/{dist → lib}/event-graph/index.js +0 -0
- /package/{dist → lib}/jsonata-sync.cjs +0 -0
- /package/{dist → lib}/server-runtime/jsonata-sync.cjs +0 -0
- /package/{dist → lib}/step-machine/index.cjs +0 -0
- /package/{dist → lib}/step-machine/index.js +0 -0
- /package/{dist → lib}/step-machine-public/jsonata-sync.cjs +0 -0
- /package/{dist → lib}/stores/memory.cjs +0 -0
- /package/{dist → lib}/stores/memory.js +0 -0
- /package/{dist → lib}/types-BBhqYGhE.d.cts +0 -0
- /package/{dist → lib}/types-BBhqYGhE.d.ts +0 -0
- /package/{dist → lib}/validate-BAVzUJWa.d.ts +0 -0
- /package/{dist → lib}/validate-Dbu7ygys.d.cts +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "v1",
|
|
3
|
+
"meta": {
|
|
4
|
+
"board": {
|
|
5
|
+
"path": "b64:eyJraW5kIjoiZnMtcGF0aCIsInZhbHVlIjoiL2hvbWUvcnVubmVyL3dvcmsveWFtbC1mbG93L3lhbWwtZmxvdy9wdWJsaWMtZXhhbXBsZXMvYm9hcmQvLmRlbW8tc2V0dXAvcnVuLTE3Nzg2NDM3MDMxNTEtMzM2MC1kb3BucHYvYm9hcmQtZGVmYXVsdC9ydW50aW1lIn0"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"summary": {
|
|
9
|
+
"card_count": 3,
|
|
10
|
+
"completed": 3,
|
|
11
|
+
"eligible": 0,
|
|
12
|
+
"pending": 0,
|
|
13
|
+
"blocked": 0,
|
|
14
|
+
"unresolved": 0,
|
|
15
|
+
"failed": 0,
|
|
16
|
+
"in_progress": 0,
|
|
17
|
+
"orphan_cards": 0,
|
|
18
|
+
"topology": {
|
|
19
|
+
"edge_count": 2,
|
|
20
|
+
"max_fan_out_card": "card-portfolio",
|
|
21
|
+
"max_fan_out": 2
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"cards": [
|
|
25
|
+
{
|
|
26
|
+
"name": "card-market-prices",
|
|
27
|
+
"status": "completed",
|
|
28
|
+
"requires": [
|
|
29
|
+
"holdings"
|
|
30
|
+
],
|
|
31
|
+
"requires_satisfied": [
|
|
32
|
+
"holdings"
|
|
33
|
+
],
|
|
34
|
+
"requires_missing": [],
|
|
35
|
+
"provides_declared": [
|
|
36
|
+
"quotes"
|
|
37
|
+
],
|
|
38
|
+
"provides_runtime": [
|
|
39
|
+
"quotes"
|
|
40
|
+
],
|
|
41
|
+
"blocked_by": [],
|
|
42
|
+
"unblocks": [
|
|
43
|
+
"card-portfolio-value"
|
|
44
|
+
],
|
|
45
|
+
"runtime": {
|
|
46
|
+
"attempt_count": 2,
|
|
47
|
+
"restart_count": 0,
|
|
48
|
+
"in_progress_since": null,
|
|
49
|
+
"last_transition_at": "2026-05-13T03:41:45.494Z",
|
|
50
|
+
"last_completed_at": "2026-05-13T03:41:45.494Z",
|
|
51
|
+
"last_restarted_at": "2026-05-13T03:41:44.720Z",
|
|
52
|
+
"status_age_ms": 0
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "card-portfolio",
|
|
57
|
+
"status": "completed",
|
|
58
|
+
"requires": [],
|
|
59
|
+
"requires_satisfied": [],
|
|
60
|
+
"requires_missing": [],
|
|
61
|
+
"provides_declared": [
|
|
62
|
+
"holdings"
|
|
63
|
+
],
|
|
64
|
+
"provides_runtime": [
|
|
65
|
+
"holdings"
|
|
66
|
+
],
|
|
67
|
+
"blocked_by": [],
|
|
68
|
+
"unblocks": [
|
|
69
|
+
"card-market-prices",
|
|
70
|
+
"card-portfolio-value"
|
|
71
|
+
],
|
|
72
|
+
"runtime": {
|
|
73
|
+
"attempt_count": 2,
|
|
74
|
+
"restart_count": 0,
|
|
75
|
+
"in_progress_since": null,
|
|
76
|
+
"last_transition_at": "2026-05-13T03:41:44.713Z",
|
|
77
|
+
"last_completed_at": "2026-05-13T03:41:44.713Z",
|
|
78
|
+
"last_restarted_at": "2026-05-13T03:41:44.712Z",
|
|
79
|
+
"status_age_ms": 0
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "card-portfolio-value",
|
|
84
|
+
"status": "completed",
|
|
85
|
+
"requires": [
|
|
86
|
+
"holdings",
|
|
87
|
+
"quotes"
|
|
88
|
+
],
|
|
89
|
+
"requires_satisfied": [
|
|
90
|
+
"holdings",
|
|
91
|
+
"quotes"
|
|
92
|
+
],
|
|
93
|
+
"requires_missing": [],
|
|
94
|
+
"provides_declared": [
|
|
95
|
+
"positions"
|
|
96
|
+
],
|
|
97
|
+
"provides_runtime": [
|
|
98
|
+
"positions"
|
|
99
|
+
],
|
|
100
|
+
"blocked_by": [],
|
|
101
|
+
"unblocks": [],
|
|
102
|
+
"runtime": {
|
|
103
|
+
"attempt_count": 3,
|
|
104
|
+
"restart_count": 0,
|
|
105
|
+
"in_progress_since": null,
|
|
106
|
+
"last_transition_at": "2026-05-13T03:41:45.498Z",
|
|
107
|
+
"last_completed_at": "2026-05-13T03:41:45.498Z",
|
|
108
|
+
"last_restarted_at": "2026-05-13T03:41:45.498Z",
|
|
109
|
+
"status_age_ms": 0
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"compute": [
|
|
30
30
|
{
|
|
31
31
|
"bindTo": "normalizedQuotes",
|
|
32
|
-
"expr": "{ \"quoteResponse\": { \"result\": $map(fetched_sources.quotes, function($r) { ($m := $r.chart.result[0].meta; $prev := $m.chartPreviousClose; $chg := $
|
|
32
|
+
"expr": "{ \"quoteResponse\": { \"result\": $map(fetched_sources.quotes, function($r) { ($m := $r.chart.result[0].meta; $price := $sum($m.regularMarketPrice); $prev := $sum($m.chartPreviousClose); $chg := $price - $prev; { \"symbol\": $join($m.symbol, \"\"), \"shortName\": ($join($m.shortName, \"\") != \"\" ? $join($m.shortName, \"\") : $join($m.longName, \"\")), \"regularMarketPrice\": $price, \"regularMarketChange\": $chg, \"regularMarketChangePercent\": $prev = 0 ? 0 : ($chg / $prev * 100) }) }), \"error\": null } }"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"bindTo": "prices",
|
|
36
|
-
"expr": "$map(computed_values.normalizedQuotes.quoteResponse.result, function($q) { {\"ticker\": $q.symbol, \"name\": $q.shortName, \"price\": $round($q.regularMarketPrice, 2), \"change\": $round($q.regularMarketChange, 2), \"chg_pct\": $round($q.regularMarketChangePercent, 2)} })"
|
|
36
|
+
"expr": "$map((computed_values.normalizedQuotes.quoteResponse.result ? computed_values.normalizedQuotes.quoteResponse.result : []), function($q) { {\"ticker\": $q.symbol, \"name\": $q.shortName, \"price\": $round($q.regularMarketPrice, 2), \"change\": $round($q.regularMarketChange, 2), \"chg_pct\": $round($q.regularMarketChangePercent, 2)} })"
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
"provides": [
|
package/examples/{example-board/cards/card-portfolio.json → board/cards/cardT-portfolio.json}
RENAMED
|
@@ -64,24 +64,14 @@
|
|
|
64
64
|
"cost_basis": 150
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
"ticker": "
|
|
67
|
+
"ticker": "NVDA",
|
|
68
68
|
"quantity": 5,
|
|
69
69
|
"cost_basis": 310
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
|
-
"ticker": "
|
|
73
|
-
"quantity": 2,
|
|
74
|
-
"cost_basis": 280
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"ticker": "TSLA",
|
|
72
|
+
"ticker": "GOOG",
|
|
78
73
|
"quantity": 3,
|
|
79
|
-
"cost_basis":
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"ticker": "NVDA",
|
|
83
|
-
"quantity": 5,
|
|
84
|
-
"cost_basis": 310
|
|
74
|
+
"cost_basis": 33
|
|
85
75
|
}
|
|
86
76
|
]
|
|
87
77
|
}
|
|
@@ -7,12 +7,11 @@ import os from 'node:os';
|
|
|
7
7
|
import net from 'node:net';
|
|
8
8
|
import { spawnSync, spawn } from 'node:child_process';
|
|
9
9
|
import { fileURLToPath } from 'node:url';
|
|
10
|
-
import { createRequire } from 'node:module';
|
|
11
10
|
|
|
12
11
|
import {
|
|
13
12
|
createMultiBoardServerRuntime,
|
|
14
13
|
createSingleBoardServerRuntime,
|
|
15
|
-
} from 'yaml-flow/server-runtime';
|
|
14
|
+
} from 'yaml-flow/board-live-cards-server-runtime';
|
|
16
15
|
|
|
17
16
|
import {
|
|
18
17
|
createFsBoardPlatformAdapter,
|
|
@@ -23,23 +22,7 @@ import {
|
|
|
23
22
|
|
|
24
23
|
const __filename = fileURLToPath(import.meta.url);
|
|
25
24
|
const __dirname = path.dirname(__filename);
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
function resolveYamlFlowDir() {
|
|
29
|
-
try {
|
|
30
|
-
return path.dirname(_require.resolve('yaml-flow/package.json'));
|
|
31
|
-
} catch {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const _yamlFlowDir = resolveYamlFlowDir();
|
|
37
|
-
|
|
38
|
-
// cliDir must point to the yaml-flow root so buildBoardCliInvocation finds
|
|
39
|
-
// board-live-cards-cli.js for task-executor completion callbacks.
|
|
40
|
-
// demo-src/example-board is 2 levels below the yaml-flow root.
|
|
41
|
-
const YAML_FLOW_CLI_DIR = _yamlFlowDir || path.resolve(__dirname, '..', '..');
|
|
42
|
-
const _pkgStepMachineCli = _yamlFlowDir ? path.join(_yamlFlowDir, 'step-machine-cli.js') : null;
|
|
25
|
+
const cliArgs = process.argv.slice(2);
|
|
43
26
|
|
|
44
27
|
function loadServerConfig() {
|
|
45
28
|
const configPath = path.join(__dirname, 'demo-server-config.json');
|
|
@@ -77,7 +60,7 @@ function resolveKindRefFromConfig(configValue) {
|
|
|
77
60
|
const serverConfig = loadServerConfig();
|
|
78
61
|
const configuredCardsDir = resolveFromConfig(serverConfig.cardsDir);
|
|
79
62
|
const configuredTaskExecutorPath = resolveFromConfig(serverConfig.taskExecutorPath || serverConfig.demoTaskExecutorPath);
|
|
80
|
-
const configuredStepMachineCliPath = resolveFromConfig(serverConfig.stepMachineCliPath)
|
|
63
|
+
const configuredStepMachineCliPath = resolveFromConfig(serverConfig.stepMachineCliPath);
|
|
81
64
|
const configuredChatHandlerPath = resolveFromConfig(serverConfig.chatHandlerPath);
|
|
82
65
|
const configuredInferenceAdapterPath = resolveFromConfig(serverConfig.inferenceAdapterPath);
|
|
83
66
|
const configuredGandalfCardsDir = resolveFromConfig(serverConfig.gandalfCardsDir);
|
|
@@ -97,7 +80,9 @@ if (!process.env.DEMO_INFERENCE_ADAPTER_PATH && configuredInferenceAdapterPath)
|
|
|
97
80
|
}
|
|
98
81
|
|
|
99
82
|
const PORT = Number(process.env.DEMO_SERVER_PORT || serverConfig.port || 7799);
|
|
100
|
-
const
|
|
83
|
+
const cardsPatternArgIndex = cliArgs.indexOf('--cards-pattern');
|
|
84
|
+
const cliCardsPattern = cardsPatternArgIndex !== -1 ? cliArgs[cardsPatternArgIndex + 1] : null;
|
|
85
|
+
const selectedCardsPattern = (process.env.DEMO_CARDS_PATTERN || cliCardsPattern || '').trim() || null;
|
|
101
86
|
|
|
102
87
|
const CORS_HEADERS = {
|
|
103
88
|
'Access-Control-Allow-Origin': '*',
|
|
@@ -132,12 +117,23 @@ const defaultGandalfInferenceAdapterPath = process.env.DEMO_GANDALF_INFERENCE_AD
|
|
|
132
117
|
// platform-free server runtime.
|
|
133
118
|
// ---------------------------------------------------------------------------
|
|
134
119
|
|
|
135
|
-
function
|
|
120
|
+
function wildcardToRegExp(pattern) {
|
|
121
|
+
const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, '\\$&');
|
|
122
|
+
return new RegExp(`^${escaped.replace(/\*/g, '.*').replace(/\?/g, '.')}$`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function createFsCardSource(cardsDir, cardPattern = null) {
|
|
126
|
+
const cardRegex = cardPattern ? wildcardToRegExp(cardPattern) : null;
|
|
136
127
|
return {
|
|
137
128
|
listCards() {
|
|
138
129
|
if (!fs.existsSync(cardsDir)) return [];
|
|
139
130
|
return fs.readdirSync(cardsDir)
|
|
140
|
-
.filter(f =>
|
|
131
|
+
.filter(f => {
|
|
132
|
+
if (!f.endsWith('.json')) return false;
|
|
133
|
+
if (!cardRegex) return true;
|
|
134
|
+
const cardId = path.basename(f, '.json');
|
|
135
|
+
return cardRegex.test(cardId);
|
|
136
|
+
})
|
|
141
137
|
.map(f => {
|
|
142
138
|
try { return JSON.parse(fs.readFileSync(path.join(cardsDir, f), 'utf-8')); }
|
|
143
139
|
catch { return null; }
|
|
@@ -164,20 +160,20 @@ function createNodeSpawnInvocationAdapter() {
|
|
|
164
160
|
if (ref.howToRun !== 'local-node') {
|
|
165
161
|
return { dispatched: false, error: `unsupported howToRun: ${ref.howToRun}` };
|
|
166
162
|
}
|
|
167
|
-
const whatToRun =
|
|
163
|
+
const whatToRun = ref.whatToRun;
|
|
168
164
|
let scriptPath = '';
|
|
169
|
-
if (whatToRun
|
|
165
|
+
if (whatToRun && typeof whatToRun === 'object') {
|
|
166
|
+
if (whatToRun.kind === 'fs-path') scriptPath = whatToRun.value;
|
|
167
|
+
} else if (typeof whatToRun === 'string' && whatToRun.startsWith('b64:')) {
|
|
170
168
|
try {
|
|
171
169
|
const parsed = parseRef(whatToRun);
|
|
172
170
|
if (parsed.kind === 'fs-path') scriptPath = parsed.value;
|
|
173
171
|
} catch {
|
|
174
172
|
scriptPath = '';
|
|
175
173
|
}
|
|
176
|
-
} else {
|
|
177
|
-
scriptPath = whatToRun;
|
|
178
174
|
}
|
|
179
175
|
if (!scriptPath) {
|
|
180
|
-
return { dispatched: false, error: `no
|
|
176
|
+
return { dispatched: false, error: `no fs-path in whatToRun: ${JSON.stringify(whatToRun)}` };
|
|
181
177
|
}
|
|
182
178
|
// Resolve chatsKeyPrefix (blob key prefix) to absolute FS chatDir for handlers
|
|
183
179
|
const finalArgs = { ...args };
|
|
@@ -203,17 +199,17 @@ function createNodeSpawnInvocationAdapter() {
|
|
|
203
199
|
},
|
|
204
200
|
async describe(ref) {
|
|
205
201
|
if (ref.howToRun !== 'local-node') return null;
|
|
206
|
-
const whatToRun =
|
|
202
|
+
const whatToRun = ref.whatToRun;
|
|
207
203
|
let scriptPath = '';
|
|
208
|
-
if (whatToRun
|
|
204
|
+
if (whatToRun && typeof whatToRun === 'object') {
|
|
205
|
+
if (whatToRun.kind === 'fs-path') scriptPath = whatToRun.value;
|
|
206
|
+
} else if (typeof whatToRun === 'string' && whatToRun.startsWith('b64:')) {
|
|
209
207
|
try {
|
|
210
208
|
const parsed = parseRef(whatToRun);
|
|
211
209
|
if (parsed.kind === 'fs-path') scriptPath = parsed.value;
|
|
212
210
|
} catch {
|
|
213
211
|
scriptPath = '';
|
|
214
212
|
}
|
|
215
|
-
} else {
|
|
216
|
-
scriptPath = whatToRun;
|
|
217
213
|
}
|
|
218
214
|
if (!scriptPath) return null;
|
|
219
215
|
try {
|
|
@@ -275,7 +271,7 @@ function createNamedPipeNotificationTransport() {
|
|
|
275
271
|
|
|
276
272
|
const serverMetaRef = process.env.DEMO_SERVER_META_STORE_REF || configuredServerMetaStoreRef || serializeRef({ kind: 'fs-path', value: setupDir });
|
|
277
273
|
const serverMetaAdapter = createFsBoardPlatformAdapter(
|
|
278
|
-
parseRef(serverMetaRef),
|
|
274
|
+
parseRef(serverMetaRef), { suppressSpawn: true },
|
|
279
275
|
);
|
|
280
276
|
const serverMetaStore = createArtifactsStore(serverMetaAdapter.blobStorage('server-meta'));
|
|
281
277
|
|
|
@@ -291,23 +287,30 @@ const logger = { info: console.log, warn: console.warn, error: console.error };
|
|
|
291
287
|
// Track per-board host config for demo-setup (FS paths are host concerns, not runtime concerns)
|
|
292
288
|
const boardHostConfig = new Map();
|
|
293
289
|
|
|
294
|
-
function buildBoardContextConfig(label, boardDir,
|
|
290
|
+
function buildBoardContextConfig(label, boardDir, taskExecPath, chatHandlerPath, infAdapterPath, boardId) {
|
|
295
291
|
fs.mkdirSync(boardDir, { recursive: true });
|
|
296
292
|
|
|
293
|
+
// Runtime card store lives inside the board's setup dir, isolated from the source cards dir.
|
|
294
|
+
// Layout: boardDir/cards/store — KV card store
|
|
295
|
+
// boardDir/cards/chats — chat blobs
|
|
296
|
+
// boardDir/cards/files — file uploads
|
|
297
|
+
const runtimeCardsDir = path.join(boardDir, 'cards');
|
|
298
|
+
const runtimeCardStoreDir = path.join(runtimeCardsDir, 'store');
|
|
299
|
+
fs.mkdirSync(runtimeCardStoreDir, { recursive: true });
|
|
300
|
+
|
|
297
301
|
const notifyChannel = `yaml-flow-server-${label}-${boardId}-${process.pid}`;
|
|
298
302
|
const baseRef = parseRef(serializeRef({ kind: 'fs-path', value: boardDir }));
|
|
299
|
-
const boardAdapter = createFsBoardPlatformAdapter(baseRef,
|
|
303
|
+
const boardAdapter = createFsBoardPlatformAdapter(baseRef, {
|
|
300
304
|
notifyChannel,
|
|
301
305
|
});
|
|
302
306
|
// In the server context the drain loop is driven in-process; suppress the
|
|
303
307
|
// detached CLI spawn that the FS adapter would otherwise fire as a continuation.
|
|
304
308
|
boardAdapter.requestProcessAccumulated = () => {};
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
const artifactsAdapter = createFsBoardPlatformAdapter(artifactsRef, YAML_FLOW_CLI_DIR, { suppressSpawn: true });
|
|
309
|
+
// Artifacts adapter rooted at runtimeCardsDir so chats/ and files/ are siblings of store/.
|
|
310
|
+
const artifactsRef = parseRef(serializeRef({ kind: 'fs-path', value: runtimeCardsDir }));
|
|
311
|
+
const artifactsAdapter = createFsBoardPlatformAdapter(artifactsRef, { suppressSpawn: true });
|
|
309
312
|
|
|
310
|
-
const cardStoreRef = serializeRef({ kind: 'fs-path', value:
|
|
313
|
+
const cardStoreRef = serializeRef({ kind: 'fs-path', value: runtimeCardStoreDir });
|
|
311
314
|
|
|
312
315
|
return {
|
|
313
316
|
label,
|
|
@@ -328,7 +331,8 @@ const runtime = createMultiBoardServerRuntime({
|
|
|
328
331
|
serverMetaStore,
|
|
329
332
|
logger,
|
|
330
333
|
boardRuntimeFactory: (boardId, entry) => {
|
|
331
|
-
|
|
334
|
+
// sourceCardsDir: read-only source used only for initial seeding.
|
|
335
|
+
const sourceCardsDir = typeof entry.cardsDir === 'string' ? path.resolve(entry.cardsDir) : defaultCardsDir;
|
|
332
336
|
const boardRoot = path.join(setupDir, `board-${boardId}`);
|
|
333
337
|
const boardDir = path.join(boardRoot, 'runtime');
|
|
334
338
|
|
|
@@ -337,29 +341,32 @@ const runtime = createMultiBoardServerRuntime({
|
|
|
337
341
|
const infAdapterPath = typeof entry.inferenceAdapterPath === 'string' ? entry.inferenceAdapterPath : defaultInferenceAdapterPath;
|
|
338
342
|
const stepMachinePath = typeof entry.stepMachineCliPath === 'string' ? entry.stepMachineCliPath : defaultStepMachineCliPath;
|
|
339
343
|
|
|
340
|
-
const
|
|
344
|
+
const sourceGandalfCardsDir = typeof entry.gandalfCardsDir === 'string' ? path.resolve(entry.gandalfCardsDir) : defaultGandalfCardsDir;
|
|
341
345
|
const gandalfTaskExecPath = typeof entry.gandalfTaskExecutorPath === 'string' ? entry.gandalfTaskExecutorPath : defaultGandalfTaskExecutorPath;
|
|
342
346
|
const gandalfChatPath = typeof entry.gandalfChatHandlerPath === 'string' ? entry.gandalfChatHandlerPath : defaultGandalfChatHandlerPath;
|
|
343
347
|
const gandalfInfPath = typeof entry.gandalfInferenceAdapterPath === 'string' ? entry.gandalfInferenceAdapterPath : defaultGandalfInferenceAdapterPath;
|
|
344
348
|
|
|
345
|
-
const baseCfg = buildBoardContextConfig('base', boardDir,
|
|
349
|
+
const baseCfg = buildBoardContextConfig('base', boardDir, taskExecPath, chatHandlerPath_, infAdapterPath, boardId);
|
|
346
350
|
|
|
347
351
|
const boards = [baseCfg];
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
+
let gandalfBoardDir = null;
|
|
353
|
+
if (sourceGandalfCardsDir && gandalfTaskExecPath) {
|
|
354
|
+
gandalfBoardDir = path.join(boardRoot, 'gandalf-runtime');
|
|
355
|
+
const gandalfCfg = buildBoardContextConfig('gandalf', gandalfBoardDir, gandalfTaskExecPath, gandalfChatPath, gandalfInfPath, boardId);
|
|
352
356
|
gandalfCfg.outputsStoreRef = serializeRef({ kind: 'fs-path', value: path.join(boardRoot, 'gandalf-runtime-out', '.outputs') });
|
|
353
357
|
boards.push(gandalfCfg);
|
|
354
358
|
}
|
|
355
359
|
|
|
356
360
|
// Store host config for demo-setup (FS paths are host concerns)
|
|
357
|
-
boardHostConfig.set(boardId, { cardsDir, gandalfCardsDir:
|
|
361
|
+
boardHostConfig.set(boardId, { cardsDir: sourceCardsDir, gandalfCardsDir: sourceGandalfCardsDir, boardDir, boardRoot });
|
|
358
362
|
|
|
359
363
|
// Auto-run demo-setup (write copilot-instructions.md) at board init time,
|
|
360
364
|
// so clients no longer need a separate /demo-setup request before bootstrapping.
|
|
361
365
|
demoPrepSetup(boardId);
|
|
362
366
|
|
|
367
|
+
// runtimeCardsDir is where the live card store lives (inside setupDir).
|
|
368
|
+
const runtimeCardsDir = path.join(boardDir, 'cards');
|
|
369
|
+
|
|
363
370
|
const singleBoardRuntime = createSingleBoardServerRuntime({
|
|
364
371
|
apiBasePath: `${apiBasePath}/${boardId}`,
|
|
365
372
|
boardId,
|
|
@@ -370,44 +377,35 @@ const runtime = createMultiBoardServerRuntime({
|
|
|
370
377
|
serverUrl: `http://127.0.0.1:${PORT}`,
|
|
371
378
|
executionExtra: {
|
|
372
379
|
boardSetupRoot: boardRoot,
|
|
373
|
-
chatsBlobBasePath: path.join(
|
|
380
|
+
chatsBlobBasePath: path.join(runtimeCardsDir, 'chats'),
|
|
374
381
|
...(stepMachinePath ? { stepMachineCliPath: stepMachinePath } : {}),
|
|
375
382
|
},
|
|
376
383
|
});
|
|
377
384
|
|
|
378
|
-
// Host concern
|
|
385
|
+
// Host concern: seed card store from source cardsDir only if the runtime store is empty.
|
|
379
386
|
const existing = singleBoardRuntime.cardStore.get({});
|
|
380
387
|
const isEmpty = existing.status !== 'success' || !existing.data?.cards?.length;
|
|
381
388
|
if (isEmpty) {
|
|
382
|
-
const cards = createFsCardSource(
|
|
389
|
+
const cards = createFsCardSource(sourceCardsDir, selectedCardsPattern).listCards();
|
|
383
390
|
if (cards.length) singleBoardRuntime.cardStore.set({ body: cards });
|
|
384
391
|
}
|
|
392
|
+
// Seed gandalf board if present
|
|
393
|
+
if (gandalfBoardDir && sourceGandalfCardsDir) {
|
|
394
|
+
const gandalfRuntime = singleBoardRuntime.getBoardRuntime?.('gandalf');
|
|
395
|
+
if (gandalfRuntime) {
|
|
396
|
+
const gExisting = gandalfRuntime.cardStore.get({});
|
|
397
|
+
const gEmpty = gExisting.status !== 'success' || !gExisting.data?.cards?.length;
|
|
398
|
+
if (gEmpty) {
|
|
399
|
+
const gCards = createFsCardSource(sourceGandalfCardsDir).listCards();
|
|
400
|
+
if (gCards.length) gandalfRuntime.cardStore.set({ body: gCards });
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
385
404
|
|
|
386
405
|
return singleBoardRuntime;
|
|
387
406
|
},
|
|
388
407
|
});
|
|
389
408
|
|
|
390
|
-
// ---------------------------------------------------------------------------
|
|
391
|
-
// Reset
|
|
392
|
-
// ---------------------------------------------------------------------------
|
|
393
|
-
|
|
394
|
-
function resetRuntime() {
|
|
395
|
-
if (fs.existsSync(setupDir)) {
|
|
396
|
-
fs.rmSync(setupDir, { recursive: true, force: true });
|
|
397
|
-
console.log(`[demo-server] reset: wiped ${setupDir}`);
|
|
398
|
-
}
|
|
399
|
-
const chatSessionsDir = serverConfig.chatSessionsDir
|
|
400
|
-
? path.resolve(__dirname, serverConfig.chatSessionsDir)
|
|
401
|
-
: path.join(os.tmpdir(), 'demo-chat-handler-sessions');
|
|
402
|
-
if (fs.existsSync(chatSessionsDir)) {
|
|
403
|
-
fs.rmSync(chatSessionsDir, { recursive: true, force: true });
|
|
404
|
-
console.log(`[demo-server] reset: wiped ${chatSessionsDir}`);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
if (RESET_ON_START) {
|
|
409
|
-
resetRuntime();
|
|
410
|
-
}
|
|
411
409
|
|
|
412
410
|
// ---------------------------------------------------------------------------
|
|
413
411
|
// Demo-setup — host-level concern (not a runtime concern).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Example Board Demo (Server Runtime)</title>
|
|
7
|
-
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
|
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
9
|
<style>
|
|
10
10
|
/* Scale down markdown headings inside cards to stay in proportion with card body text */
|
|
@@ -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@
|
|
23
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@
|
|
22
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.0.0/browser/live-cards.js"></script>
|
|
23
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.0.0/browser/board-livecards-client.js"></script>
|
|
24
24
|
</head>
|
|
25
25
|
<body class="bg-light">
|
|
26
26
|
<div class="container-fluid py-3">
|
|
@@ -60,10 +60,9 @@ import path from 'node:path';
|
|
|
60
60
|
import os from 'node:os';
|
|
61
61
|
import { execFileSync } from 'node:child_process';
|
|
62
62
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
63
|
-
import { parseRef, blobStorageForRef, reportComplete, reportFailed } from 'yaml-flow/
|
|
64
|
-
import { loadStepFlow, createStepMachine, MemoryStore } from '
|
|
65
|
-
import {
|
|
66
|
-
import { invokeRefSync } from '../../dist/cli/node/execution-adapter.js';
|
|
63
|
+
import { parseRef, blobStorageForRef, reportComplete, reportFailed } from 'yaml-flow/board-worker-adapter';
|
|
64
|
+
import { loadStepFlow, createStepMachine, MemoryStore, buildStepHandlersForFlow } from 'yaml-flow/step-machine-public';
|
|
65
|
+
import { invokeRefSync } from 'yaml-flow/board-live-cards-node';
|
|
67
66
|
|
|
68
67
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
69
68
|
const SOURCE_DEF_FLOWS_FILE = path.join(__dirname, 'source_def_flows.json');
|
|
@@ -212,7 +211,9 @@ function loadSourceDefFlowsConfig() {
|
|
|
212
211
|
try {
|
|
213
212
|
return readJson(SOURCE_DEF_FLOWS_FILE);
|
|
214
213
|
} catch (err) {
|
|
215
|
-
fail(
|
|
214
|
+
fail(
|
|
215
|
+
`Cannot read source flow registry (${SOURCE_DEF_FLOWS_FILE}): ${String(err && err.message || err)}`,
|
|
216
|
+
);
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
|
|
@@ -265,12 +266,7 @@ async function executeStepMachineSourceFlow(context) {
|
|
|
265
266
|
const flow = await loadStepFlow(flowPath);
|
|
266
267
|
|
|
267
268
|
const invokeHttpRef = async (ref, args) => {
|
|
268
|
-
|
|
269
|
-
try {
|
|
270
|
-
rawUrl = parseRef(ref.whatToRun).value;
|
|
271
|
-
} catch {
|
|
272
|
-
// Keep raw value when whatToRun is already a URL.
|
|
273
|
-
}
|
|
269
|
+
const rawUrl = typeof ref.whatToRun === 'object' ? ref.whatToRun.value : parseRef(ref.whatToRun).value;
|
|
274
270
|
|
|
275
271
|
const base = String(args?.extra?.serverUrl || 'http://127.0.0.1:7799').replace(/\/$/, '');
|
|
276
272
|
const resolvedUrl = /^https?:\/\//i.test(rawUrl)
|
|
@@ -326,10 +322,11 @@ async function executeStepMachineSourceFlow(context) {
|
|
|
326
322
|
return invokeHttpRef(ref, args);
|
|
327
323
|
}
|
|
328
324
|
if (ref.howToRun === 'demo-local-module') {
|
|
329
|
-
const
|
|
325
|
+
const whatValue = typeof ref.whatToRun === 'object' ? ref.whatToRun.value : parseRef(ref.whatToRun).value;
|
|
326
|
+
const modulePath = path.resolve(__dirname, whatValue);
|
|
330
327
|
const mod = await import(pathToFileURL(modulePath).href);
|
|
331
328
|
if (typeof mod.execute !== 'function') {
|
|
332
|
-
throw new Error(`Flow module ${ref.whatToRun} must export execute(context)`);
|
|
329
|
+
throw new Error(`Flow module ${JSON.stringify(ref.whatToRun)} must export execute(context)`);
|
|
333
330
|
}
|
|
334
331
|
return mod.execute(args);
|
|
335
332
|
}
|
|
@@ -360,6 +357,22 @@ async function executeStepMachineSourceFlow(context) {
|
|
|
360
357
|
};
|
|
361
358
|
}
|
|
362
359
|
|
|
360
|
+
async function resolveAndExecuteSourceFlow(sourceDef, extra, refs = {}) {
|
|
361
|
+
const registry = loadSourceDefFlowsConfig();
|
|
362
|
+
const kind = resolveSourceKind(sourceDef, registry);
|
|
363
|
+
const flowResult = await executeStepMachineSourceFlow({
|
|
364
|
+
kind,
|
|
365
|
+
registry,
|
|
366
|
+
sourceDef,
|
|
367
|
+
extra,
|
|
368
|
+
inRef: refs.inRef,
|
|
369
|
+
outRef: refs.outRef,
|
|
370
|
+
errRef: refs.errRef,
|
|
371
|
+
mockDb: MOCK_DB,
|
|
372
|
+
});
|
|
373
|
+
return { kind, flowResult };
|
|
374
|
+
}
|
|
375
|
+
|
|
363
376
|
async function runSourceFetchSubcommand(argv) {
|
|
364
377
|
const inIdx = argv.indexOf('--in-ref');
|
|
365
378
|
const outIdx = argv.indexOf('--out-ref');
|
|
@@ -422,29 +435,15 @@ async function runSourceFetchSubcommand(argv) {
|
|
|
422
435
|
failRef(`Cannot resolve source_def: ${String(err && err.message || err)}`, callback);
|
|
423
436
|
}
|
|
424
437
|
|
|
425
|
-
const registry = loadSourceDefFlowsConfig();
|
|
426
438
|
let kind;
|
|
427
|
-
try {
|
|
428
|
-
kind = resolveSourceKind(sourceDef, registry);
|
|
429
|
-
} catch (err) {
|
|
430
|
-
failRef(String(err && err.message || err), callback);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
439
|
let flowResult;
|
|
434
440
|
try {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
sourceDef,
|
|
439
|
-
extra,
|
|
440
|
-
inRef,
|
|
441
|
-
outRef,
|
|
442
|
-
errRef,
|
|
443
|
-
mockDb: MOCK_DB,
|
|
444
|
-
});
|
|
441
|
+
const resolved = await resolveAndExecuteSourceFlow(sourceDef, extra, { inRef, outRef, errRef });
|
|
442
|
+
kind = resolved.kind;
|
|
443
|
+
flowResult = resolved.flowResult;
|
|
445
444
|
} catch (err) {
|
|
446
445
|
const detail = (err && (err.stderr || err.stdout)) ? `\n${err.stderr || err.stdout}`.trimEnd() : '';
|
|
447
|
-
failRef(
|
|
446
|
+
failRef(`source invocation failed: ${String(err && err.message || err)}${detail}`, callback);
|
|
448
447
|
}
|
|
449
448
|
|
|
450
449
|
if (!flowResult?.wroteOutputDirectly) {
|
|
@@ -466,6 +465,46 @@ async function runSourceFetchSubcommand(argv) {
|
|
|
466
465
|
|
|
467
466
|
}
|
|
468
467
|
|
|
468
|
+
async function probeSourcePreflightSubcommand(argv) {
|
|
469
|
+
const extraIdx = argv.indexOf('--extra');
|
|
470
|
+
const extraB64 = extraIdx !== -1 ? argv[extraIdx + 1] : undefined;
|
|
471
|
+
|
|
472
|
+
let extra = {};
|
|
473
|
+
if (extraB64) {
|
|
474
|
+
try { extra = JSON.parse(Buffer.from(extraB64, 'base64').toString('utf-8')); }
|
|
475
|
+
catch { /* ignore malformed extra */ }
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
const startedAt = Date.now();
|
|
479
|
+
try {
|
|
480
|
+
const chunks = [];
|
|
481
|
+
for await (const chunk of process.stdin) {
|
|
482
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
483
|
+
}
|
|
484
|
+
const raw = Buffer.concat(chunks).toString('utf-8').trim();
|
|
485
|
+
if (!raw) {
|
|
486
|
+
console.log(JSON.stringify({ ok: false, reachable: false, latencyMs: Date.now() - startedAt, error: 'Missing probe input JSON on stdin' }));
|
|
487
|
+
process.exit(0);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
let sourceDef;
|
|
491
|
+
try {
|
|
492
|
+
sourceDef = JSON.parse(raw);
|
|
493
|
+
} catch (err) {
|
|
494
|
+
console.log(JSON.stringify({ ok: false, reachable: false, latencyMs: Date.now() - startedAt, error: `Invalid probe JSON: ${String(err && err.message || err)}` }));
|
|
495
|
+
process.exit(0);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
await resolveAndExecuteSourceFlow(sourceDef, extra);
|
|
499
|
+
console.log(JSON.stringify({ ok: true, reachable: true, latencyMs: Date.now() - startedAt }));
|
|
500
|
+
process.exit(0);
|
|
501
|
+
} catch (err) {
|
|
502
|
+
const detail = (err && (err.stderr || err.stdout)) ? `\n${err.stderr || err.stdout}`.trimEnd() : '';
|
|
503
|
+
console.log(JSON.stringify({ ok: false, reachable: false, latencyMs: Date.now() - startedAt, error: `source invocation failed: ${String(err && err.message || err)}${detail}` }));
|
|
504
|
+
process.exit(0);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
469
508
|
// ---------------------------------------------------------------------------
|
|
470
509
|
// validate-source-def — structural validation of a source definition
|
|
471
510
|
// ---------------------------------------------------------------------------
|
|
@@ -551,7 +590,7 @@ function validateSourceDefSubcommand(argv) {
|
|
|
551
590
|
const CAPABILITIES = {
|
|
552
591
|
version: '1.0',
|
|
553
592
|
executor: 'demo-task-executor',
|
|
554
|
-
subcommands: ['run-source-fetch', 'describe-capabilities', 'validate-source-def'],
|
|
593
|
+
subcommands: ['run-source-fetch', 'probe-source-preflight', 'describe-capabilities', 'validate-source-def'],
|
|
555
594
|
sourceKinds: {
|
|
556
595
|
mock: {
|
|
557
596
|
description: 'Look up a key in a hardcoded MOCK_DB dictionary.',
|
|
@@ -662,6 +701,10 @@ async function main() {
|
|
|
662
701
|
await runSourceFetchSubcommand(process.argv.slice(3));
|
|
663
702
|
return;
|
|
664
703
|
}
|
|
704
|
+
if (sub === 'probe-source-preflight') {
|
|
705
|
+
await probeSourcePreflightSubcommand(process.argv.slice(3));
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
665
708
|
if (sub === 'describe' || sub === 'describe-capabilities') {
|
|
666
709
|
describeCapabilities();
|
|
667
710
|
return;
|