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,249 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"description": "Self-contained source-def registry for demo-task-executor runtimes.",
|
|
4
|
+
"executor": "demo-task-executor",
|
|
5
|
+
"subcommands": [
|
|
6
|
+
"run-source-fetch",
|
|
7
|
+
"describe-capabilities",
|
|
8
|
+
"validate-source-def",
|
|
9
|
+
"validate-card-preflight",
|
|
10
|
+
"probe-source-preflight"
|
|
11
|
+
],
|
|
12
|
+
"extraSchema": {
|
|
13
|
+
"description": "Board topology context passed via --extra (base64-encoded JSON, baked at init).",
|
|
14
|
+
"properties": {
|
|
15
|
+
"boardSetupRoot": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Absolute path to board root."
|
|
18
|
+
},
|
|
19
|
+
"boardId": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Board identifier."
|
|
22
|
+
},
|
|
23
|
+
"boardRuntimeDir": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Relative path to runtime dir."
|
|
26
|
+
},
|
|
27
|
+
"runtimeStatusDir": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Relative path to runtime-out dir."
|
|
30
|
+
},
|
|
31
|
+
"cardsDir": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Relative path to cards dir."
|
|
34
|
+
},
|
|
35
|
+
"serverUrl": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Base URL of the hosting server (e.g. http://127.0.0.1:7799). Used by source kinds that call server-side proxy endpoints."
|
|
38
|
+
},
|
|
39
|
+
"boardLiveCardsCliJs": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Absolute path to board-live-cards-cli.js when configured by the runtime."
|
|
42
|
+
},
|
|
43
|
+
"stepMachineCliPath": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Absolute path to step-machine-cli.js when configured by the runtime."
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"kinds": {
|
|
50
|
+
"url": {
|
|
51
|
+
"detect": {
|
|
52
|
+
"field": "url"
|
|
53
|
+
},
|
|
54
|
+
"flow": "./source-def-flows/url.flow.json",
|
|
55
|
+
"validate": [
|
|
56
|
+
{
|
|
57
|
+
"field": "url",
|
|
58
|
+
"type": "object",
|
|
59
|
+
"message": "url must be an object."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"field": "url.url",
|
|
63
|
+
"type": "string",
|
|
64
|
+
"message": "url.url is required and must be a string."
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"probe": {
|
|
68
|
+
"strategy": "http-head",
|
|
69
|
+
"urlFrom": "url.url"
|
|
70
|
+
},
|
|
71
|
+
"manifest": {
|
|
72
|
+
"description": "Single URL fetch via curl with interpolation and cache.",
|
|
73
|
+
"inputSchema": {
|
|
74
|
+
"url": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"required": true,
|
|
77
|
+
"properties": {
|
|
78
|
+
"url": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"required": true
|
|
81
|
+
},
|
|
82
|
+
"method": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"required": false
|
|
85
|
+
},
|
|
86
|
+
"headers": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"required": false
|
|
89
|
+
},
|
|
90
|
+
"args": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"required": false
|
|
93
|
+
},
|
|
94
|
+
"cacheTimeout": {
|
|
95
|
+
"type": "number",
|
|
96
|
+
"required": false
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"tickersFrom": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"required": false
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"url-list": {
|
|
108
|
+
"detect": {
|
|
109
|
+
"field": "url-list"
|
|
110
|
+
},
|
|
111
|
+
"flow": "./source-def-flows/url-list.flow.json",
|
|
112
|
+
"validate": [
|
|
113
|
+
{
|
|
114
|
+
"field": "url-list",
|
|
115
|
+
"type": "object",
|
|
116
|
+
"message": "url-list must be an object."
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"probe": {
|
|
120
|
+
"strategy": "http-head",
|
|
121
|
+
"urlFrom": "_projections.url_list[0]"
|
|
122
|
+
},
|
|
123
|
+
"manifest": {
|
|
124
|
+
"description": "Fan-out URL fetch over _projections.url_list.",
|
|
125
|
+
"inputSchema": {
|
|
126
|
+
"url-list": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"required": true,
|
|
129
|
+
"properties": {
|
|
130
|
+
"method": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"required": false
|
|
133
|
+
},
|
|
134
|
+
"headers": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"required": false
|
|
137
|
+
},
|
|
138
|
+
"cacheTimeout": {
|
|
139
|
+
"type": "number",
|
|
140
|
+
"required": false
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"copilot": {
|
|
148
|
+
"detect": {
|
|
149
|
+
"anyOfFields": [
|
|
150
|
+
"copilot",
|
|
151
|
+
"prompt_template"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"flow": "./source-def-flows/copilot.flow.json",
|
|
155
|
+
"validate": [
|
|
156
|
+
{
|
|
157
|
+
"condition": "copilot-or-prompt",
|
|
158
|
+
"message": "copilot must be an object, or prompt_template must be a top-level string."
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"probe": {
|
|
162
|
+
"strategy": "command-check",
|
|
163
|
+
"command": "copilot",
|
|
164
|
+
"args": [
|
|
165
|
+
"--version"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"manifest": {
|
|
169
|
+
"description": "Invoke Copilot with prompt interpolation.",
|
|
170
|
+
"inputSchema": {
|
|
171
|
+
"copilot": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"required": false
|
|
174
|
+
},
|
|
175
|
+
"prompt_template": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"required": false
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"workiq": {
|
|
183
|
+
"detect": {
|
|
184
|
+
"field": "workiq"
|
|
185
|
+
},
|
|
186
|
+
"flow": "./source-def-flows/workiq.flow.json",
|
|
187
|
+
"validate": [
|
|
188
|
+
{
|
|
189
|
+
"field": "workiq",
|
|
190
|
+
"type": "object",
|
|
191
|
+
"message": "workiq must be an object."
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"field": "workiq.query_template",
|
|
195
|
+
"type": "string",
|
|
196
|
+
"message": "workiq.query_template is required and must be a string."
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"probe": {
|
|
200
|
+
"strategy": "command-check",
|
|
201
|
+
"command": "workiq",
|
|
202
|
+
"args": [
|
|
203
|
+
"--version"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"manifest": {
|
|
207
|
+
"description": "Invoke WorkIQ via demo-server HTTP proxy endpoint.",
|
|
208
|
+
"inputSchema": {
|
|
209
|
+
"workiq": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"required": true
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"mock": {
|
|
217
|
+
"detect": {
|
|
218
|
+
"field": "mock"
|
|
219
|
+
},
|
|
220
|
+
"flow": "./source-def-flows/mock.flow.json",
|
|
221
|
+
"validate": [
|
|
222
|
+
{
|
|
223
|
+
"field": "mock",
|
|
224
|
+
"type": "string",
|
|
225
|
+
"message": "mock must be a string key."
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"probe": {
|
|
229
|
+
"strategy": "mock-db-lookup"
|
|
230
|
+
},
|
|
231
|
+
"manifest": {
|
|
232
|
+
"description": "Look up values from demo MOCK_DB map.",
|
|
233
|
+
"inputSchema": {
|
|
234
|
+
"mock": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"required": true
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"resolveOrder": [
|
|
243
|
+
"url",
|
|
244
|
+
"url-list",
|
|
245
|
+
"copilot",
|
|
246
|
+
"workiq",
|
|
247
|
+
"mock"
|
|
248
|
+
]
|
|
249
|
+
}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* demo-http-test.js
|
|
4
|
+
*
|
|
5
|
+
* Smoke test for public-examples/board/demo-server.js over HTTP + SSE.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node demo-http-test.js [--port 7799]
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { spawn } from 'node:child_process';
|
|
12
|
+
import { Worker } from 'node:worker_threads';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
import http from 'node:http';
|
|
16
|
+
import fs from 'node:fs';
|
|
17
|
+
import net from 'node:net';
|
|
18
|
+
|
|
19
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
+
const __dirname = path.dirname(__filename);
|
|
21
|
+
|
|
22
|
+
const cliArgs = process.argv.slice(2);
|
|
23
|
+
const portArg = cliArgs.indexOf('--port');
|
|
24
|
+
const cliPort = portArg !== -1 ? parseInt(cliArgs[portArg + 1], 10) : NaN;
|
|
25
|
+
const RUN_ID = `run-${Date.now()}-${process.pid}-${Math.random().toString(36).slice(2, 8)}`;
|
|
26
|
+
|
|
27
|
+
async function pickFreePort() {
|
|
28
|
+
return await new Promise((resolve, reject) => {
|
|
29
|
+
const server = net.createServer();
|
|
30
|
+
server.once('error', reject);
|
|
31
|
+
server.listen(0, '127.0.0.1', () => {
|
|
32
|
+
const addr = server.address();
|
|
33
|
+
const port = addr && typeof addr === 'object' ? addr.port : 0;
|
|
34
|
+
server.close((err) => {
|
|
35
|
+
if (err) {
|
|
36
|
+
reject(err);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
resolve(port);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const PORT = Number.isInteger(cliPort) && cliPort > 0 ? cliPort : await pickFreePort();
|
|
46
|
+
|
|
47
|
+
const BOARD_ID = 'default';
|
|
48
|
+
const BASE = `http://127.0.0.1:${PORT}/api/boards/${BOARD_ID}`;
|
|
49
|
+
const SERVER_SCRIPT = path.join(__dirname, '..', 'demo-server.js');
|
|
50
|
+
const SERVER_DIR = path.dirname(SERVER_SCRIPT);
|
|
51
|
+
const SSE_WORKER_SCRIPT = path.join(__dirname, 'portfolio-tracker-sse-worker.js');
|
|
52
|
+
const CARD_PATTERN = 'cardT*';
|
|
53
|
+
|
|
54
|
+
// Resolve and wipe the setup directory before starting the server so each
|
|
55
|
+
// test run begins from a clean slate. The location is read from
|
|
56
|
+
// demo-server-config.json (setupDir key) with the same fallback the server uses.
|
|
57
|
+
function resolveSetupDirRoot() {
|
|
58
|
+
const configPath = path.join(SERVER_DIR, 'demo-server-config.json');
|
|
59
|
+
try {
|
|
60
|
+
const cfg = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
61
|
+
if (cfg && typeof cfg.setupDir === 'string' && cfg.setupDir.trim()) {
|
|
62
|
+
return path.resolve(SERVER_DIR, cfg.setupDir.trim());
|
|
63
|
+
}
|
|
64
|
+
} catch { /* ignore */ }
|
|
65
|
+
return path.join(SERVER_DIR, '.demo-setup');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const SETUP_DIR = path.join(resolveSetupDirRoot(), RUN_ID);
|
|
69
|
+
if (fs.existsSync(SETUP_DIR)) {
|
|
70
|
+
fs.rmSync(SETUP_DIR, { recursive: true, force: true });
|
|
71
|
+
console.log(`[demo-http-test] wiped setup dir: ${SETUP_DIR}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
const NS = {
|
|
76
|
+
initialPayload: null,
|
|
77
|
+
statusSummary: null,
|
|
78
|
+
statusGeneration: 0,
|
|
79
|
+
computedValues: {},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
function applyFrame(payload) {
|
|
83
|
+
if (payload && Array.isArray(payload.cardDefinitions)) {
|
|
84
|
+
if (!NS.initialPayload && payload.cardDefinitions.length > 0) {
|
|
85
|
+
NS.initialPayload = payload;
|
|
86
|
+
}
|
|
87
|
+
const summary = payload.statusSnapshot && payload.statusSnapshot.summary;
|
|
88
|
+
if (summary) {
|
|
89
|
+
NS.statusSummary = summary;
|
|
90
|
+
NS.statusGeneration += 1;
|
|
91
|
+
}
|
|
92
|
+
if (payload.cardRuntimeById) {
|
|
93
|
+
for (const [cardId, runtime] of Object.entries(payload.cardRuntimeById)) {
|
|
94
|
+
if (runtime?.computed_values && Object.keys(runtime.computed_values).length > 0) {
|
|
95
|
+
NS.computedValues[cardId] = runtime.computed_values;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (payload && payload.kind === 'notification-batch' && Array.isArray(payload.notifications)) {
|
|
103
|
+
for (const n of payload.notifications) {
|
|
104
|
+
const summary = n && n.kind === 'status' && n.status && n.status.summary;
|
|
105
|
+
if (summary) {
|
|
106
|
+
NS.statusSummary = summary;
|
|
107
|
+
NS.statusGeneration += 1;
|
|
108
|
+
}
|
|
109
|
+
if (n && n.kind === 'computed_values' && n.cardId) {
|
|
110
|
+
NS.computedValues[n.cardId] = n.values;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function assert(condition, message) {
|
|
117
|
+
if (!condition) {
|
|
118
|
+
console.error(`\n[ASSERT FAILED] ${message}`);
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function waitUntil(predicate, timeoutMs, label) {
|
|
124
|
+
return new Promise((resolve, reject) => {
|
|
125
|
+
const deadline = Date.now() + timeoutMs;
|
|
126
|
+
const interval = setInterval(() => {
|
|
127
|
+
let result;
|
|
128
|
+
try { result = predicate(); } catch { /* retry */ }
|
|
129
|
+
if (result !== undefined && result !== null && result !== false) {
|
|
130
|
+
clearInterval(interval);
|
|
131
|
+
resolve(result);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (Date.now() > deadline) {
|
|
135
|
+
clearInterval(interval);
|
|
136
|
+
reject(new Error(`Timeout (${timeoutMs}ms) waiting for: ${label}`));
|
|
137
|
+
}
|
|
138
|
+
}, 150);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const waitForInitialPayload = (ms = 15_000) =>
|
|
143
|
+
waitUntil(() => NS.initialPayload || false, ms, 'initial SSE payload');
|
|
144
|
+
|
|
145
|
+
const waitForAllCompleted = (ms = 60_000, label = 'all completed') =>
|
|
146
|
+
waitUntil(() => {
|
|
147
|
+
const s = NS.statusSummary;
|
|
148
|
+
if (s && s.card_count > 0 && s.completed === s.card_count) return s;
|
|
149
|
+
return false;
|
|
150
|
+
}, ms, label);
|
|
151
|
+
|
|
152
|
+
function httpGet(url) {
|
|
153
|
+
return new Promise((resolve, reject) => {
|
|
154
|
+
http.get(url, (res) => {
|
|
155
|
+
let body = '';
|
|
156
|
+
res.on('data', c => { body += c; });
|
|
157
|
+
res.on('end', () => {
|
|
158
|
+
try { resolve({ status: res.statusCode, data: JSON.parse(body) }); }
|
|
159
|
+
catch { resolve({ status: res.statusCode, data: body }); }
|
|
160
|
+
});
|
|
161
|
+
}).on('error', reject);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function httpJson(method, url, payload) {
|
|
166
|
+
return new Promise((resolve, reject) => {
|
|
167
|
+
const u = new URL(url);
|
|
168
|
+
const data = payload != null ? JSON.stringify(payload) : null;
|
|
169
|
+
const opts = {
|
|
170
|
+
hostname: u.hostname,
|
|
171
|
+
port: u.port,
|
|
172
|
+
path: u.pathname,
|
|
173
|
+
method,
|
|
174
|
+
headers: data ? { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(data) } : {},
|
|
175
|
+
};
|
|
176
|
+
const req = http.request(opts, (res) => {
|
|
177
|
+
let body = '';
|
|
178
|
+
res.on('data', c => { body += c; });
|
|
179
|
+
res.on('end', () => {
|
|
180
|
+
try { resolve({ status: res.statusCode, data: JSON.parse(body) }); }
|
|
181
|
+
catch { resolve({ status: res.statusCode, data: body }); }
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
req.on('error', reject);
|
|
185
|
+
if (data) req.write(data);
|
|
186
|
+
req.end();
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function startServer(port) {
|
|
191
|
+
return new Promise((resolve, reject) => {
|
|
192
|
+
const proc = spawn(process.execPath, [SERVER_SCRIPT, '--cards-pattern', CARD_PATTERN], {
|
|
193
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
194
|
+
windowsHide: true,
|
|
195
|
+
env: { ...process.env, DEMO_SERVER_PORT: String(port), DEMO_SETUP_DIR: SETUP_DIR },
|
|
196
|
+
});
|
|
197
|
+
let ready = false;
|
|
198
|
+
|
|
199
|
+
proc.stdout.on('data', (chunk) => {
|
|
200
|
+
const text = chunk.toString('utf-8');
|
|
201
|
+
process.stdout.write(`[server] ${text}`);
|
|
202
|
+
if (!ready && text.includes('listening on')) {
|
|
203
|
+
ready = true;
|
|
204
|
+
resolve(proc);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
proc.stderr.on('data', (chunk) => process.stderr.write(`[server:err] ${chunk}`));
|
|
208
|
+
proc.on('error', reject);
|
|
209
|
+
proc.on('exit', (code) => {
|
|
210
|
+
if (!ready) reject(new Error(`Server exited early: code ${code}`));
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
setTimeout(() => {
|
|
214
|
+
if (!ready) reject(new Error('Server startup timeout (15s)'));
|
|
215
|
+
}, 15_000);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
console.log('\n=== board HTTP+SSE smoke test ===');
|
|
220
|
+
console.log(`target: ${BASE}`);
|
|
221
|
+
console.log(`card pattern: ${CARD_PATTERN}`);
|
|
222
|
+
|
|
223
|
+
const serverProc = await startServer(PORT);
|
|
224
|
+
let sseWorker = null;
|
|
225
|
+
|
|
226
|
+
try {
|
|
227
|
+
console.log('\n=== Step 1: init-board ===');
|
|
228
|
+
const initRes = await httpGet(`${BASE}/init-board`);
|
|
229
|
+
assert(initRes.status === 200, `init-board returned ${initRes.status}`);
|
|
230
|
+
console.log('[step1] ok');
|
|
231
|
+
|
|
232
|
+
console.log('\n=== Step 2: start SSE worker ===');
|
|
233
|
+
sseWorker = new Worker(SSE_WORKER_SCRIPT, {
|
|
234
|
+
workerData: { sseUrl: `${BASE}/sse` },
|
|
235
|
+
});
|
|
236
|
+
sseWorker.on('message', (msg) => {
|
|
237
|
+
if (msg.type === 'frame') applyFrame(msg.payload);
|
|
238
|
+
else if (msg.type === 'error') console.error(`[sse-worker] ${msg.message}`);
|
|
239
|
+
});
|
|
240
|
+
sseWorker.on('error', (err) => console.error(`[sse-worker] uncaught: ${err.message}`));
|
|
241
|
+
|
|
242
|
+
const initialPayload = await waitForInitialPayload();
|
|
243
|
+
const cardCount = Array.isArray(initialPayload.cardDefinitions) ? initialPayload.cardDefinitions.length : 0;
|
|
244
|
+
assert(cardCount > 0, 'initial SSE payload must include cardDefinitions');
|
|
245
|
+
console.log(`[step2] SSE initial payload received (${cardCount} cards)`);
|
|
246
|
+
|
|
247
|
+
console.log('\n=== Step 3: wait for completion ===');
|
|
248
|
+
const summary = await waitForAllCompleted(20_000, 'initial board completion');
|
|
249
|
+
assert(summary.failed === 0, `expected failed=0, got ${summary.failed}`);
|
|
250
|
+
console.log(`[step3] completed summary: ${JSON.stringify(summary)}`);
|
|
251
|
+
|
|
252
|
+
console.log('\n=== Step 4: board-status cross-check ===');
|
|
253
|
+
const statusRes = await httpGet(`${BASE}/board-status`);
|
|
254
|
+
assert(statusRes.status === 200, `board-status returned ${statusRes.status}`);
|
|
255
|
+
const httpSummary = statusRes.data && statusRes.data.statusSnapshot && statusRes.data.statusSnapshot.summary;
|
|
256
|
+
assert(httpSummary, 'statusSnapshot.summary missing from board-status');
|
|
257
|
+
console.log(`[step4] board-status summary: ${JSON.stringify(httpSummary)}`);
|
|
258
|
+
|
|
259
|
+
// ── T1: PATCH holdings (+1 row) and verify recomputation ──
|
|
260
|
+
console.log('\n=== T1: patch holdings (+1 row) ===');
|
|
261
|
+
|
|
262
|
+
// Read current holdings from card store via GET /cards/:id
|
|
263
|
+
const portfolioCardRes = await httpGet(`${BASE}/cards/card-portfolio`);
|
|
264
|
+
assert(portfolioCardRes.status === 200, `GET card-portfolio returned ${portfolioCardRes.status}`);
|
|
265
|
+
const existingHoldings = (portfolioCardRes.data.card_data || {}).holdings;
|
|
266
|
+
assert(Array.isArray(existingHoldings), 'card-portfolio.card_data.holdings missing');
|
|
267
|
+
const t0HoldingsCount = existingHoldings.length;
|
|
268
|
+
|
|
269
|
+
// Read current positions count from computed_values captured via SSE
|
|
270
|
+
const t0Positions = (NS.computedValues['card-portfolio-value'] || {}).positions;
|
|
271
|
+
const t0PositionsCount = Array.isArray(t0Positions) ? t0Positions.length : 0;
|
|
272
|
+
|
|
273
|
+
// Pick a ticker not already in holdings
|
|
274
|
+
const candidates = ['AAPL', 'MSFT', 'AMZN', 'TSLA', 'META', 'GOOG', 'NVDA', 'NFLX', 'INTC', 'AMD',
|
|
275
|
+
'IBM', 'ORCL', 'ADBE', 'CRM', 'QCOM'];
|
|
276
|
+
const existingTickers = new Set(existingHoldings.map(r => r.ticker));
|
|
277
|
+
const available = candidates.filter(t => !existingTickers.has(t));
|
|
278
|
+
assert(available.length > 0, 'No available ticker to add');
|
|
279
|
+
const newTicker = available[0];
|
|
280
|
+
|
|
281
|
+
const newHoldings = [...existingHoldings, { ticker: newTicker, quantity: 1, cost_basis: 100 }];
|
|
282
|
+
const patchRes = await httpJson('PATCH', `${BASE}/cards/card-portfolio`, { card_data: { holdings: newHoldings } });
|
|
283
|
+
assert(patchRes.status === 200, `PATCH card-portfolio returned ${patchRes.status}`);
|
|
284
|
+
|
|
285
|
+
// Wait for re-completion
|
|
286
|
+
NS.statusSummary = null;
|
|
287
|
+
await new Promise(r => setTimeout(r, 4000));
|
|
288
|
+
const t1Summary = await waitForAllCompleted(30_000, 'T1 holdings patch');
|
|
289
|
+
assert(t1Summary.failed === 0, `T1 failed=${t1Summary.failed}`);
|
|
290
|
+
|
|
291
|
+
// Verify holdings +1 from card store
|
|
292
|
+
const t1PortfolioRes = await httpGet(`${BASE}/cards/card-portfolio`);
|
|
293
|
+
assert(t1PortfolioRes.status === 200, `GET card-portfolio after patch returned ${t1PortfolioRes.status}`);
|
|
294
|
+
const afterHoldings = (t1PortfolioRes.data.card_data || {}).holdings;
|
|
295
|
+
const afterHoldingsCount = Array.isArray(afterHoldings) ? afterHoldings.length : 0;
|
|
296
|
+
|
|
297
|
+
// Verify positions +1 from computed_values captured via SSE
|
|
298
|
+
const afterPositions = (NS.computedValues['card-portfolio-value'] || {}).positions;
|
|
299
|
+
const afterPositionsCount = Array.isArray(afterPositions) ? afterPositions.length : 0;
|
|
300
|
+
|
|
301
|
+
assert(afterHoldingsCount === t0HoldingsCount + 1,
|
|
302
|
+
`Expected holdings rows +1 (before=${t0HoldingsCount}, after=${afterHoldingsCount})`);
|
|
303
|
+
assert(afterPositionsCount === t0PositionsCount + 1,
|
|
304
|
+
`Expected portfolio value rows +1 (before=${t0PositionsCount}, after=${afterPositionsCount})`);
|
|
305
|
+
|
|
306
|
+
console.log(`[T1] ok: holdings ${t0HoldingsCount}->${afterHoldingsCount}, ` +
|
|
307
|
+
`positions ${t0PositionsCount}->${afterPositionsCount}, added=${newTicker}`);
|
|
308
|
+
|
|
309
|
+
console.log('\n=== All smoke checks passed ===\n');
|
|
310
|
+
} finally {
|
|
311
|
+
// Kill server first so the SSE connection closes, then await worker termination.
|
|
312
|
+
// (Terminating the worker while the SSE socket is still open leaves dangling handles.)
|
|
313
|
+
serverProc.kill();
|
|
314
|
+
await new Promise((r) => serverProc.on('exit', r));
|
|
315
|
+
if (sseWorker) await sseWorker.terminate();
|
|
316
|
+
console.log('[demo-http-test] server stopped');
|
|
317
|
+
}
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Example Board Demo (LocalStorage 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
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.0.0/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@
|
|
15
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@
|
|
14
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.0.0/browser/live-cards.js"></script>
|
|
15
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.0.0/browser/board-livecards-localstorage.js"></script>
|
|
16
16
|
</head>
|
|
17
17
|
<body class="bg-light">
|
|
18
18
|
<div class="container-fluid py-3">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import fs from 'node:fs';
|
|
25
|
-
import { parseRef, blobStorageForRef, reportComplete, reportFailed } from 'yaml-flow/
|
|
25
|
+
import { parseRef, blobStorageForRef, reportComplete, reportFailed } from 'yaml-flow/board-worker-adapter';
|
|
26
26
|
|
|
27
27
|
// ---------------------------------------------------------------------------
|
|
28
28
|
// validate-source-def — structural validation of a source definition
|
|
@@ -16,14 +16,8 @@ import path from 'node:path';
|
|
|
16
16
|
import fs from 'node:fs';
|
|
17
17
|
import os from 'node:os';
|
|
18
18
|
import net from 'node:net';
|
|
19
|
-
import { fileURLToPath
|
|
20
|
-
|
|
21
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
22
|
-
const _REPO_ROOT = path.resolve(__dirname, '..', '..', '..', '..');
|
|
23
|
-
|
|
24
|
-
// ── Library imports ────────────────────────────────────────────────────────────
|
|
25
|
-
const _adapterPath = path.join(_REPO_ROOT, 'dist', 'cli', 'node', 'fs-board-adapter.js');
|
|
26
|
-
const {
|
|
19
|
+
import { fileURLToPath } from 'node:url';
|
|
20
|
+
import {
|
|
27
21
|
createBoardLiveCardsPublic,
|
|
28
22
|
createBoardLiveCardsNonCorePublic,
|
|
29
23
|
createFsBoardPlatformAdapter,
|
|
@@ -32,9 +26,12 @@ const {
|
|
|
32
26
|
createCardStore,
|
|
33
27
|
parseRef,
|
|
34
28
|
serializeRef,
|
|
35
|
-
}
|
|
29
|
+
} from 'yaml-flow/board-live-cards-node';
|
|
30
|
+
|
|
31
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
32
|
+
const _REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
36
33
|
|
|
37
|
-
const FETCH_PRICES_JS = path.join(__dirname, 'portfolio-tracker-fetch-prices.js');
|
|
34
|
+
const FETCH_PRICES_JS = path.join(__dirname, 'handlers', 'portfolio-tracker-fetch-prices.js');
|
|
38
35
|
|
|
39
36
|
// ── Runtime directories ────────────────────────────────────────────────────────
|
|
40
37
|
const _TMP_BASE = path.join(os.tmpdir(), 'experiment-js');
|
|
@@ -134,7 +131,7 @@ function assert(condition, message) {
|
|
|
134
131
|
|
|
135
132
|
function makeBoard() {
|
|
136
133
|
const br = parseRef(BOARDRUNTIME_REF);
|
|
137
|
-
return createBoardLiveCardsPublic(br, createFsBoardPlatformAdapter(br,
|
|
134
|
+
return createBoardLiveCardsPublic(br, createFsBoardPlatformAdapter(br, {
|
|
138
135
|
onWarn: console.warn,
|
|
139
136
|
notifyChannel: NOTIFY_CHANNEL,
|
|
140
137
|
}));
|
|
@@ -142,12 +139,12 @@ function makeBoard() {
|
|
|
142
139
|
|
|
143
140
|
function makeNonCoreBoard() {
|
|
144
141
|
const br = parseRef(BOARDRUNTIME_REF);
|
|
145
|
-
return createBoardLiveCardsNonCorePublic(br, createFsBoardNonCorePlatformAdapter(br,
|
|
142
|
+
return createBoardLiveCardsNonCorePublic(br, createFsBoardNonCorePlatformAdapter(br, { onWarn: console.warn }));
|
|
146
143
|
}
|
|
147
144
|
|
|
148
145
|
function makeCardStore() {
|
|
149
146
|
const ref = parseRef(CARDSTORE_REF);
|
|
150
|
-
const adapter = createFsBoardPlatformAdapter(ref,
|
|
147
|
+
const adapter = createFsBoardPlatformAdapter(ref, { onWarn: console.warn });
|
|
151
148
|
const kv = adapter.kvStorageForRef(CARDSTORE_REF);
|
|
152
149
|
const cardAdapterObj = {
|
|
153
150
|
readIndex: () => kv.read('_index'),
|
|
@@ -424,7 +421,7 @@ for (const card of [
|
|
|
424
421
|
CARD_HOLDINGS_TABLE,
|
|
425
422
|
CARD_PORTFOLIO_VALUE,
|
|
426
423
|
]) {
|
|
427
|
-
const vr = makeNonCoreBoard().
|
|
424
|
+
const vr = makeNonCoreBoard().validateCardPreflight({ body: card });
|
|
428
425
|
if (!vr.data?.isValid) {
|
|
429
426
|
console.error(`[VALIDATE FAILED] card ${card.id}:`, JSON.stringify(vr.data?.issues ?? vr.error));
|
|
430
427
|
process.exit(1);
|