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
package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/test}/portfolio-t4.js
RENAMED
|
@@ -2,23 +2,15 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* portfolio-t4.js — T4 rapid-fire test only.
|
|
4
4
|
*
|
|
5
|
-
* Runs T0
|
|
6
|
-
* back-to-back
|
|
7
|
-
* Asserts final prices contain the iter-5 tickers only (AAPL/MSFT/GOOG/TSLA)
|
|
8
|
-
* and AMZN is absent.
|
|
5
|
+
* Public-examples variant. Runs T0 init, then fires 5 portfolio-form upserts
|
|
6
|
+
* back-to-back and waits for convergence.
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
9
|
import path from 'node:path';
|
|
12
10
|
import fs from 'node:fs';
|
|
13
11
|
import os from 'node:os';
|
|
14
|
-
import { fileURLToPath
|
|
15
|
-
|
|
16
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
const _REPO_ROOT = path.resolve(__dirname, '..', '..', '..', '..');
|
|
18
|
-
|
|
19
|
-
// ── Library imports ────────────────────────────────────────────────────────────
|
|
20
|
-
const _adapterPath = path.join(_REPO_ROOT, 'dist', 'cli', 'node', 'fs-board-adapter.js');
|
|
21
|
-
const {
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
import {
|
|
22
14
|
createBoardLiveCardsPublic,
|
|
23
15
|
createBoardLiveCardsNonCorePublic,
|
|
24
16
|
createFsBoardPlatformAdapter,
|
|
@@ -27,27 +19,28 @@ const {
|
|
|
27
19
|
createCardStore,
|
|
28
20
|
parseRef,
|
|
29
21
|
serializeRef,
|
|
30
|
-
}
|
|
22
|
+
} from 'yaml-flow/board-live-cards-node';
|
|
23
|
+
|
|
24
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
25
|
+
const _REPO_ROOT = path.resolve(__dirname, '..', '..', '..');
|
|
31
26
|
|
|
32
|
-
const FETCH_PRICES_JS = path.join(__dirname, 'portfolio-tracker-fetch-prices.js');
|
|
27
|
+
const FETCH_PRICES_JS = path.join(__dirname, '..', 'handlers', 'portfolio-tracker-fetch-prices.js');
|
|
33
28
|
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
const CARDSTORE_DIR = path.join(_TMP_BASE, 'cardstore');
|
|
29
|
+
const _TMP_BASE = path.join(os.tmpdir(), 'experiment-js-t4');
|
|
30
|
+
const CARDSTORE_DIR = path.join(_TMP_BASE, 'cardstore');
|
|
37
31
|
const BOARDRUNTIME_DIR = path.join(_TMP_BASE, 'boardruntime');
|
|
38
|
-
const OUTPUTS_DIR
|
|
32
|
+
const OUTPUTS_DIR = path.join(_TMP_BASE, 'outputs');
|
|
39
33
|
|
|
40
|
-
const CARDSTORE_REF
|
|
34
|
+
const CARDSTORE_REF = serializeRef({ kind: 'fs-path', value: CARDSTORE_DIR });
|
|
41
35
|
const BOARDRUNTIME_REF = serializeRef({ kind: 'fs-path', value: BOARDRUNTIME_DIR });
|
|
42
|
-
const OUTPUTS_REF
|
|
36
|
+
const OUTPUTS_REF = serializeRef({ kind: 'fs-path', value: OUTPUTS_DIR });
|
|
43
37
|
|
|
44
|
-
// ── Card definitions ───────────────────────────────────────────────────────────
|
|
45
38
|
const CARD_PORTFOLIO_FORM = {
|
|
46
39
|
id: 'portfolio-form',
|
|
47
40
|
meta: { title: 'Portfolio Holdings Form' },
|
|
48
41
|
provides: [{ bindTo: 'holdings', ref: 'card_data.holdings' }],
|
|
49
42
|
card_data: { holdings: [] },
|
|
50
|
-
view: { elements: [{ kind: 'table', label: 'Holdings', data: { bind: 'card_data.holdings', columns: ['symbol', 'qty'] } }] }
|
|
43
|
+
view: { elements: [{ kind: 'table', label: 'Holdings', data: { bind: 'card_data.holdings', columns: ['symbol', 'qty'] } }] },
|
|
51
44
|
};
|
|
52
45
|
|
|
53
46
|
const CARD_PRICE_FETCH = {
|
|
@@ -58,9 +51,9 @@ const CARD_PRICE_FETCH = {
|
|
|
58
51
|
card_data: {},
|
|
59
52
|
compute: [{
|
|
60
53
|
bindTo: 'prices',
|
|
61
|
-
expr: '$merge($map(requires.holdings, function($h){ { $h.symbol: 100 } }))'
|
|
54
|
+
expr: '$merge($map(requires.holdings, function($h){ { $h.symbol: 100 } }))',
|
|
62
55
|
}],
|
|
63
|
-
view: { elements: [{ kind: 'table', label: 'Market Prices', data: { bind: 'computed_values.prices' } }] }
|
|
56
|
+
view: { elements: [{ kind: 'table', label: 'Market Prices', data: { bind: 'computed_values.prices' } }] },
|
|
64
57
|
};
|
|
65
58
|
|
|
66
59
|
const CARD_HOLDINGS_TABLE = {
|
|
@@ -71,9 +64,9 @@ const CARD_HOLDINGS_TABLE = {
|
|
|
71
64
|
card_data: {},
|
|
72
65
|
compute: [{
|
|
73
66
|
bindTo: 'table',
|
|
74
|
-
expr: '{ "rows": $map(requires.holdings, function($h) { { "symbol": $h.symbol, "qty": $h.qty, "price": $lookup(requires.prices, $h.symbol), "value": $h.qty * $lookup(requires.prices, $h.symbol) } }) }'
|
|
67
|
+
expr: '{ "rows": $map(requires.holdings, function($h) { { "symbol": $h.symbol, "qty": $h.qty, "price": $lookup(requires.prices, $h.symbol), "value": $h.qty * $lookup(requires.prices, $h.symbol) } }) }',
|
|
75
68
|
}],
|
|
76
|
-
view: { elements: [{ kind: 'table', label: 'Portfolio Positions', data: { bind: 'computed_values.table.rows', columns: ['symbol', 'qty', 'price', 'value'] } }] }
|
|
69
|
+
view: { elements: [{ kind: 'table', label: 'Portfolio Positions', data: { bind: 'computed_values.table.rows', columns: ['symbol', 'qty', 'price', 'value'] } }] },
|
|
77
70
|
};
|
|
78
71
|
|
|
79
72
|
const CARD_PORTFOLIO_VALUE = {
|
|
@@ -83,10 +76,9 @@ const CARD_PORTFOLIO_VALUE = {
|
|
|
83
76
|
provides: [{ bindTo: 'totalValue', ref: 'computed_values.totalValue' }],
|
|
84
77
|
card_data: {},
|
|
85
78
|
compute: [{ bindTo: 'totalValue', expr: '$sum(requires.table.rows.value)' }],
|
|
86
|
-
view: { elements: [{ kind: 'metric', label: 'Total Portfolio Value', data: { bind: 'computed_values.totalValue' } }] }
|
|
79
|
+
view: { elements: [{ kind: 'metric', label: 'Total Portfolio Value', data: { bind: 'computed_values.totalValue' } }] },
|
|
87
80
|
};
|
|
88
81
|
|
|
89
|
-
// ── Helpers ────────────────────────────────────────────────────────────────────
|
|
90
82
|
function setHoldings(card, holdings) {
|
|
91
83
|
return { ...card, card_data: { ...card.card_data, holdings: Object.entries(holdings).map(([symbol, qty]) => ({ symbol, qty })) } };
|
|
92
84
|
}
|
|
@@ -101,17 +93,17 @@ function readJson(filePath) {
|
|
|
101
93
|
|
|
102
94
|
function makeBoard() {
|
|
103
95
|
const br = parseRef(BOARDRUNTIME_REF);
|
|
104
|
-
return createBoardLiveCardsPublic(br, createFsBoardPlatformAdapter(br,
|
|
96
|
+
return createBoardLiveCardsPublic(br, createFsBoardPlatformAdapter(br, { onWarn: console.warn }));
|
|
105
97
|
}
|
|
106
98
|
|
|
107
99
|
function makeNonCoreBoard() {
|
|
108
100
|
const br = parseRef(BOARDRUNTIME_REF);
|
|
109
|
-
return createBoardLiveCardsNonCorePublic(br, createFsBoardNonCorePlatformAdapter(br,
|
|
101
|
+
return createBoardLiveCardsNonCorePublic(br, createFsBoardNonCorePlatformAdapter(br, { onWarn: console.warn }));
|
|
110
102
|
}
|
|
111
103
|
|
|
112
104
|
function makeCardStore() {
|
|
113
105
|
const ref = parseRef(CARDSTORE_REF);
|
|
114
|
-
const adapter = createFsBoardPlatformAdapter(ref,
|
|
106
|
+
const adapter = createFsBoardPlatformAdapter(ref, { onWarn: console.warn });
|
|
115
107
|
const kv = adapter.kvStorageForRef(CARDSTORE_REF);
|
|
116
108
|
const cardAdapterObj = {
|
|
117
109
|
readIndex: () => kv.read('_index'),
|
|
@@ -125,7 +117,7 @@ function makeCardStore() {
|
|
|
125
117
|
}
|
|
126
118
|
|
|
127
119
|
function checkResult(result, label) {
|
|
128
|
-
if (result.status !== 'success') { console.error(`[ERROR] ${label}: ${result.status}
|
|
120
|
+
if (result.status !== 'success') { console.error(`[ERROR] ${label}: ${result.status} - ${result.error}`); process.exit(1); }
|
|
129
121
|
return result.data;
|
|
130
122
|
}
|
|
131
123
|
|
|
@@ -154,7 +146,6 @@ async function waitForCompleted(label, timeoutMs = 90_000, pollMs = 500) {
|
|
|
154
146
|
|
|
155
147
|
const T = () => Date.now();
|
|
156
148
|
|
|
157
|
-
// ── T0 — Init ─────────────────────────────────────────────────────────────────
|
|
158
149
|
console.log('\n=== T0: Init ===');
|
|
159
150
|
if (fs.existsSync(_TMP_BASE)) fs.rmSync(_TMP_BASE, { recursive: true, force: true });
|
|
160
151
|
for (const d of [CARDSTORE_DIR, BOARDRUNTIME_DIR, OUTPUTS_DIR]) fs.mkdirSync(d, { recursive: true });
|
|
@@ -165,7 +156,7 @@ checkResult(
|
|
|
165
156
|
params: { cardStoreRef: CARDSTORE_REF, outputsStoreRef: OUTPUTS_REF },
|
|
166
157
|
body: { 'task-executor-ref': { meta: 'task-executor', howToRun: 'local-node', whatToRun: serializeRef({ kind: 'fs-path', value: FETCH_PRICES_JS }) } },
|
|
167
158
|
}),
|
|
168
|
-
'init'
|
|
159
|
+
'init',
|
|
169
160
|
);
|
|
170
161
|
console.log(` [${T()}] init done`);
|
|
171
162
|
|
|
@@ -176,8 +167,8 @@ for (const card of [
|
|
|
176
167
|
CARD_HOLDINGS_TABLE,
|
|
177
168
|
CARD_PORTFOLIO_VALUE,
|
|
178
169
|
]) {
|
|
179
|
-
const vr = makeNonCoreBoard().
|
|
180
|
-
console.log(` [${T()}]
|
|
170
|
+
const vr = makeNonCoreBoard().validateCardPreflight({ body: card });
|
|
171
|
+
console.log(` [${T()}] validateCardPreflight ${card.id} done`);
|
|
181
172
|
if (!vr.data?.isValid) { console.error(`[VALIDATE FAILED] ${card.id}:`, JSON.stringify(vr.data?.issues ?? vr.error)); process.exit(1); }
|
|
182
173
|
checkResult(cardStore.set({ body: card }), `card-store set ${card.id}`);
|
|
183
174
|
console.log(` [${T()}] cardStore.set ${card.id} done`);
|
|
@@ -191,7 +182,6 @@ for (const cardId of ['portfolio-form', 'price-fetch', 'holdings-table', 'portfo
|
|
|
191
182
|
await waitForCompleted('T0-settle');
|
|
192
183
|
console.log(`[${T()}] [T0] board settled with initial holdings.`);
|
|
193
184
|
|
|
194
|
-
// ── T4 — Rapid 5× portfolio-form updates (no delay) ───────────────────────────
|
|
195
185
|
console.log('\n=== T4: Rapid 5x portfolio-form updates (no delay) ===');
|
|
196
186
|
|
|
197
187
|
const T4_ITERS = [
|
|
@@ -202,7 +192,6 @@ const T4_ITERS = [
|
|
|
202
192
|
{ AAPL: 45, MSFT: 30, GOOG: 110, AMZN: 140, TSLA: 60 },
|
|
203
193
|
];
|
|
204
194
|
|
|
205
|
-
// Expected final state: iter 5 holdings (AMZN present in iter 5 but test verifies what actually wins)
|
|
206
195
|
const T4_EXPECTED_FINAL = { AAPL: 45, MSFT: 30, GOOG: 110, AMZN: 140, TSLA: 60 };
|
|
207
196
|
|
|
208
197
|
for (let i = 0; i < T4_ITERS.length; i++) {
|
|
@@ -212,14 +201,12 @@ for (let i = 0; i < T4_ITERS.length; i++) {
|
|
|
212
201
|
console.log(` [${T()}] iter ${i + 1} cardStore.set done`);
|
|
213
202
|
checkResult(makeBoard().upsertCard({ params: { cardId: 'portfolio-form', restart: 'true' } }), `iter${i + 1} upsert`);
|
|
214
203
|
console.log(` [${T()}] iter ${i + 1} upsertCard done`);
|
|
215
|
-
// await waitForCompleted(`T4-iter${i + 1}`); // commented out: rapid-fire, no waits
|
|
216
204
|
}
|
|
217
205
|
|
|
218
|
-
console.log(`\n[${T()}] [T4] all 5 upserts fired
|
|
206
|
+
console.log(`\n[${T()}] [T4] all 5 upserts fired - waiting for board to converge...`);
|
|
219
207
|
const t4Final = await waitForCompleted('T4');
|
|
220
208
|
console.log(`[${T()}] [T4] waitForCompleted done`);
|
|
221
209
|
|
|
222
|
-
// ── Assertions ────────────────────────────────────────────────────────────────
|
|
223
210
|
const holdingsPath = path.join(OUTPUTS_DIR, 'data-objects', 'holdings.json');
|
|
224
211
|
const holdings = readJson(holdingsPath);
|
|
225
212
|
console.log('\n[T4] holdings.json (data-object output):', JSON.stringify(holdings, null, 2));
|
|
@@ -227,7 +214,6 @@ console.log('\n[T4] holdings.json (data-object output):', JSON.stringify(holding
|
|
|
227
214
|
const finalCard = readJson(path.join(CARDSTORE_DIR, 'portfolio-form.json'));
|
|
228
215
|
console.log('[T4] cardstore portfolio-form holdings:', JSON.stringify(finalCard.card_data?.holdings, null, 2));
|
|
229
216
|
|
|
230
|
-
// Assert final holdings match iter-5
|
|
231
217
|
const holdingsBySymbol = Object.fromEntries(holdings.map(h => [h.symbol, h.qty]));
|
|
232
218
|
const expectedSymbols = Object.keys(T4_EXPECTED_FINAL).sort();
|
|
233
219
|
const actualSymbols = Object.keys(holdingsBySymbol).sort();
|
|
@@ -239,7 +225,6 @@ for (const [sym, qty] of Object.entries(T4_EXPECTED_FINAL)) {
|
|
|
239
225
|
}
|
|
240
226
|
console.log('[T4] holdings assertions passed: iter-5 symbols and quantities match.');
|
|
241
227
|
|
|
242
|
-
// Assert prices contain exactly the iter-5 tickers
|
|
243
228
|
const pricesPath = path.join(OUTPUTS_DIR, 'data-objects', 'prices.json');
|
|
244
229
|
const prices = readJson(pricesPath);
|
|
245
230
|
const priceKeys = Object.keys(prices).sort();
|
|
@@ -249,7 +234,6 @@ assert(Object.values(prices).every(v => typeof v === 'number'),
|
|
|
249
234
|
'T4: all price values must be numbers');
|
|
250
235
|
console.log('[T4] prices assertions passed:', JSON.stringify(prices));
|
|
251
236
|
|
|
252
|
-
// Assert holdings-table rows match
|
|
253
237
|
const htCvPath = path.join(OUTPUTS_DIR, 'cards', 'holdings-table', 'computed_values.json');
|
|
254
238
|
const htCv = readJson(htCvPath);
|
|
255
239
|
const rowsBySymbol = Object.fromEntries([].concat(htCv.table.rows).map(r => [r.symbol, r]));
|
|
@@ -260,20 +244,18 @@ for (const [sym, qty] of Object.entries(T4_EXPECTED_FINAL)) {
|
|
|
260
244
|
assert(Math.round(rowsBySymbol[sym]?.value * 100) === Math.round(expectedValue * 100),
|
|
261
245
|
`T4: holdings-table expected ${sym} value=${expectedValue}, got ${rowsBySymbol[sym]?.value}`);
|
|
262
246
|
}
|
|
263
|
-
console.log('[T4] holdings-table assertions passed: rows match holdings
|
|
247
|
+
console.log('[T4] holdings-table assertions passed: rows match holdings x prices.');
|
|
264
248
|
|
|
265
|
-
// Assert portfolio-value totalValue = sum(holdings × prices)
|
|
266
249
|
const pvCv = readJson(path.join(OUTPUTS_DIR, 'cards', 'portfolio-value', 'computed_values.json'));
|
|
267
250
|
const expectedTotal = Object.entries(T4_EXPECTED_FINAL).reduce(
|
|
268
|
-
(sum, [sym, qty]) => sum + qty * prices[sym], 0
|
|
251
|
+
(sum, [sym, qty]) => sum + qty * prices[sym], 0,
|
|
269
252
|
);
|
|
270
253
|
assert(Math.round(pvCv.totalValue * 100) === Math.round(expectedTotal * 100),
|
|
271
254
|
`T4: expected totalValue=${Math.round(expectedTotal * 100) / 100}, got ${pvCv.totalValue}`);
|
|
272
|
-
console.log(`[T4] portfolio-value assertion passed: totalValue=${pvCv.totalValue} matches sum(holdings
|
|
255
|
+
console.log(`[T4] portfolio-value assertion passed: totalValue=${pvCv.totalValue} matches sum(holdings x prices).`);
|
|
273
256
|
|
|
274
|
-
// Assert cardstore portfolio-form holdings match iter-5
|
|
275
257
|
const cardstoreHoldings = Object.fromEntries(
|
|
276
|
-
(finalCard.card_data?.holdings ?? []).map(h => [h.symbol, h.qty])
|
|
258
|
+
(finalCard.card_data?.holdings ?? []).map(h => [h.symbol, h.qty]),
|
|
277
259
|
);
|
|
278
260
|
for (const [sym, qty] of Object.entries(T4_EXPECTED_FINAL)) {
|
|
279
261
|
assert(cardstoreHoldings[sym] === qty,
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { C as CommandInput, a as CommandResult } from './board-live-cards-public-CsmYrvpd.js';
|
|
2
|
+
import { B as BlobStorage } from './storage-interface-BhAON-gW.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* artifacts-store-lib.ts
|
|
6
|
+
*
|
|
7
|
+
* Backend-neutral artifact store built on BlobStorage.
|
|
8
|
+
* Supports text + binary content, CRUD, listing, and lightweight metadata.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface ArtifactInfo {
|
|
12
|
+
key: string;
|
|
13
|
+
size?: number;
|
|
14
|
+
updatedAt?: string;
|
|
15
|
+
contentType?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ArtifactsStore {
|
|
18
|
+
exists(key: string): boolean;
|
|
19
|
+
putText(key: string, content: string, contentType?: string): ArtifactInfo;
|
|
20
|
+
putBytes(key: string, content: Uint8Array, contentType?: string): ArtifactInfo;
|
|
21
|
+
getText(key: string): string | null;
|
|
22
|
+
getBytes(key: string): Uint8Array | null;
|
|
23
|
+
head(key: string): ArtifactInfo | null;
|
|
24
|
+
list(prefix?: string): ArtifactInfo[];
|
|
25
|
+
remove(key: string): void;
|
|
26
|
+
}
|
|
27
|
+
interface ChatIndexRecord {
|
|
28
|
+
serial: number;
|
|
29
|
+
role: string;
|
|
30
|
+
stored_name: string;
|
|
31
|
+
path: string;
|
|
32
|
+
updated_at?: string | null;
|
|
33
|
+
}
|
|
34
|
+
interface ChatRecord extends ChatIndexRecord {
|
|
35
|
+
text: string;
|
|
36
|
+
}
|
|
37
|
+
interface ChatSignal {
|
|
38
|
+
count: number;
|
|
39
|
+
latest_mtime_ms: number;
|
|
40
|
+
processing: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface ChatArtifactsStore {
|
|
43
|
+
indexKey(cardPrefix: string): string;
|
|
44
|
+
loadIndex(cardPrefix: string): ChatIndexRecord[];
|
|
45
|
+
saveIndex(cardPrefix: string, records: ChatIndexRecord[]): void;
|
|
46
|
+
nextSerial(cardPrefix: string): number;
|
|
47
|
+
appendIndexRecord(cardPrefix: string, record: ChatIndexRecord): void;
|
|
48
|
+
readRecords(cardPrefix: string): ChatRecord[];
|
|
49
|
+
clear(cardPrefix: string): void;
|
|
50
|
+
readSignal(cardPrefix: string): ChatSignal;
|
|
51
|
+
}
|
|
52
|
+
interface FileArtifactsStore {
|
|
53
|
+
nextSerial(cardPrefix: string, seedNames?: string[]): number;
|
|
54
|
+
buildStoredName(displayName: string, serial: number, opts?: {
|
|
55
|
+
maxLen?: number;
|
|
56
|
+
}): string;
|
|
57
|
+
allocateStoredName(cardPrefix: string, displayName: string, opts?: {
|
|
58
|
+
seedNames?: string[];
|
|
59
|
+
maxLen?: number;
|
|
60
|
+
}): string;
|
|
61
|
+
}
|
|
62
|
+
interface CardFileMetadata {
|
|
63
|
+
name: string;
|
|
64
|
+
stored_name: string;
|
|
65
|
+
size: number | null;
|
|
66
|
+
mime_type: string | null;
|
|
67
|
+
path: string | null;
|
|
68
|
+
uploaded_at: string | null;
|
|
69
|
+
}
|
|
70
|
+
type CardFileLookupResult = {
|
|
71
|
+
ok: true;
|
|
72
|
+
file: CardFileMetadata;
|
|
73
|
+
} | {
|
|
74
|
+
ok: false;
|
|
75
|
+
reason: 'index_out_of_range' | 'missing_stored_name' | 'stale_reference';
|
|
76
|
+
};
|
|
77
|
+
interface CardFileMetadataStore {
|
|
78
|
+
read(cardData: unknown): CardFileMetadata[];
|
|
79
|
+
normalizeIncoming(payloadFiles: unknown, defaultUploadedAt?: string): CardFileMetadata[];
|
|
80
|
+
merge(cardData: Record<string, unknown>, incoming: CardFileMetadata[]): CardFileMetadata[];
|
|
81
|
+
resolve(cardData: unknown, index: number, expectedStoredName?: string | null): CardFileLookupResult;
|
|
82
|
+
}
|
|
83
|
+
declare function createArtifactsStore(blob: BlobStorage): ArtifactsStore;
|
|
84
|
+
declare function createChatArtifactsStore(store: ArtifactsStore, opts?: {
|
|
85
|
+
indexFileName?: string;
|
|
86
|
+
}): ChatArtifactsStore;
|
|
87
|
+
declare function createFileArtifactsStore(store: ArtifactsStore): FileArtifactsStore;
|
|
88
|
+
declare function createCardFileMetadataStore(): CardFileMetadataStore;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* artifacts-store-lib-public.ts
|
|
92
|
+
*
|
|
93
|
+
* Public API wrapper for ArtifactsStore, following CommandInput/CommandResult.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
interface ArtifactsStorePublic {
|
|
97
|
+
list(input: CommandInput): CommandResult<{
|
|
98
|
+
artifacts: ArtifactInfo[];
|
|
99
|
+
}>;
|
|
100
|
+
head(input: CommandInput): CommandResult<{
|
|
101
|
+
artifact: ArtifactInfo | null;
|
|
102
|
+
}>;
|
|
103
|
+
put(input: CommandInput): CommandResult<{
|
|
104
|
+
artifact: ArtifactInfo;
|
|
105
|
+
}>;
|
|
106
|
+
get(input: CommandInput): CommandResult<{
|
|
107
|
+
key: string;
|
|
108
|
+
contentType?: string;
|
|
109
|
+
size?: number;
|
|
110
|
+
text?: string;
|
|
111
|
+
bytes?: number[];
|
|
112
|
+
}>;
|
|
113
|
+
del(input: CommandInput): CommandResult<{
|
|
114
|
+
ok: true;
|
|
115
|
+
}>;
|
|
116
|
+
}
|
|
117
|
+
declare function createArtifactsStorePublic(store: ArtifactsStore): ArtifactsStorePublic;
|
|
118
|
+
|
|
119
|
+
export { type ArtifactsStorePublic as A, createArtifactsStorePublic as a, createCardFileMetadataStore as b, createArtifactsStore as c, createChatArtifactsStore as d, createFileArtifactsStore as e };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { C as CommandInput, a as CommandResult } from './board-live-cards-public-BnmRAbQV.cjs';
|
|
2
|
+
import { B as BlobStorage } from './storage-interface-BhAON-gW.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* artifacts-store-lib.ts
|
|
6
|
+
*
|
|
7
|
+
* Backend-neutral artifact store built on BlobStorage.
|
|
8
|
+
* Supports text + binary content, CRUD, listing, and lightweight metadata.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface ArtifactInfo {
|
|
12
|
+
key: string;
|
|
13
|
+
size?: number;
|
|
14
|
+
updatedAt?: string;
|
|
15
|
+
contentType?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ArtifactsStore {
|
|
18
|
+
exists(key: string): boolean;
|
|
19
|
+
putText(key: string, content: string, contentType?: string): ArtifactInfo;
|
|
20
|
+
putBytes(key: string, content: Uint8Array, contentType?: string): ArtifactInfo;
|
|
21
|
+
getText(key: string): string | null;
|
|
22
|
+
getBytes(key: string): Uint8Array | null;
|
|
23
|
+
head(key: string): ArtifactInfo | null;
|
|
24
|
+
list(prefix?: string): ArtifactInfo[];
|
|
25
|
+
remove(key: string): void;
|
|
26
|
+
}
|
|
27
|
+
interface ChatIndexRecord {
|
|
28
|
+
serial: number;
|
|
29
|
+
role: string;
|
|
30
|
+
stored_name: string;
|
|
31
|
+
path: string;
|
|
32
|
+
updated_at?: string | null;
|
|
33
|
+
}
|
|
34
|
+
interface ChatRecord extends ChatIndexRecord {
|
|
35
|
+
text: string;
|
|
36
|
+
}
|
|
37
|
+
interface ChatSignal {
|
|
38
|
+
count: number;
|
|
39
|
+
latest_mtime_ms: number;
|
|
40
|
+
processing: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface ChatArtifactsStore {
|
|
43
|
+
indexKey(cardPrefix: string): string;
|
|
44
|
+
loadIndex(cardPrefix: string): ChatIndexRecord[];
|
|
45
|
+
saveIndex(cardPrefix: string, records: ChatIndexRecord[]): void;
|
|
46
|
+
nextSerial(cardPrefix: string): number;
|
|
47
|
+
appendIndexRecord(cardPrefix: string, record: ChatIndexRecord): void;
|
|
48
|
+
readRecords(cardPrefix: string): ChatRecord[];
|
|
49
|
+
clear(cardPrefix: string): void;
|
|
50
|
+
readSignal(cardPrefix: string): ChatSignal;
|
|
51
|
+
}
|
|
52
|
+
interface FileArtifactsStore {
|
|
53
|
+
nextSerial(cardPrefix: string, seedNames?: string[]): number;
|
|
54
|
+
buildStoredName(displayName: string, serial: number, opts?: {
|
|
55
|
+
maxLen?: number;
|
|
56
|
+
}): string;
|
|
57
|
+
allocateStoredName(cardPrefix: string, displayName: string, opts?: {
|
|
58
|
+
seedNames?: string[];
|
|
59
|
+
maxLen?: number;
|
|
60
|
+
}): string;
|
|
61
|
+
}
|
|
62
|
+
interface CardFileMetadata {
|
|
63
|
+
name: string;
|
|
64
|
+
stored_name: string;
|
|
65
|
+
size: number | null;
|
|
66
|
+
mime_type: string | null;
|
|
67
|
+
path: string | null;
|
|
68
|
+
uploaded_at: string | null;
|
|
69
|
+
}
|
|
70
|
+
type CardFileLookupResult = {
|
|
71
|
+
ok: true;
|
|
72
|
+
file: CardFileMetadata;
|
|
73
|
+
} | {
|
|
74
|
+
ok: false;
|
|
75
|
+
reason: 'index_out_of_range' | 'missing_stored_name' | 'stale_reference';
|
|
76
|
+
};
|
|
77
|
+
interface CardFileMetadataStore {
|
|
78
|
+
read(cardData: unknown): CardFileMetadata[];
|
|
79
|
+
normalizeIncoming(payloadFiles: unknown, defaultUploadedAt?: string): CardFileMetadata[];
|
|
80
|
+
merge(cardData: Record<string, unknown>, incoming: CardFileMetadata[]): CardFileMetadata[];
|
|
81
|
+
resolve(cardData: unknown, index: number, expectedStoredName?: string | null): CardFileLookupResult;
|
|
82
|
+
}
|
|
83
|
+
declare function createArtifactsStore(blob: BlobStorage): ArtifactsStore;
|
|
84
|
+
declare function createChatArtifactsStore(store: ArtifactsStore, opts?: {
|
|
85
|
+
indexFileName?: string;
|
|
86
|
+
}): ChatArtifactsStore;
|
|
87
|
+
declare function createFileArtifactsStore(store: ArtifactsStore): FileArtifactsStore;
|
|
88
|
+
declare function createCardFileMetadataStore(): CardFileMetadataStore;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* artifacts-store-lib-public.ts
|
|
92
|
+
*
|
|
93
|
+
* Public API wrapper for ArtifactsStore, following CommandInput/CommandResult.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
interface ArtifactsStorePublic {
|
|
97
|
+
list(input: CommandInput): CommandResult<{
|
|
98
|
+
artifacts: ArtifactInfo[];
|
|
99
|
+
}>;
|
|
100
|
+
head(input: CommandInput): CommandResult<{
|
|
101
|
+
artifact: ArtifactInfo | null;
|
|
102
|
+
}>;
|
|
103
|
+
put(input: CommandInput): CommandResult<{
|
|
104
|
+
artifact: ArtifactInfo;
|
|
105
|
+
}>;
|
|
106
|
+
get(input: CommandInput): CommandResult<{
|
|
107
|
+
key: string;
|
|
108
|
+
contentType?: string;
|
|
109
|
+
size?: number;
|
|
110
|
+
text?: string;
|
|
111
|
+
bytes?: number[];
|
|
112
|
+
}>;
|
|
113
|
+
del(input: CommandInput): CommandResult<{
|
|
114
|
+
ok: true;
|
|
115
|
+
}>;
|
|
116
|
+
}
|
|
117
|
+
declare function createArtifactsStorePublic(store: ArtifactsStore): ArtifactsStorePublic;
|
|
118
|
+
|
|
119
|
+
export { type ArtifactsStorePublic as A, createArtifactsStorePublic as a, createCardFileMetadataStore as b, createArtifactsStore as c, createChatArtifactsStore as d, createFileArtifactsStore as e };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';function f(r){function a(e){return {status:"success",data:e}}function s(e){return {status:"fail",error:e}}function u(e){return {status:"error",error:e instanceof Error?e.message:String(e)}}return {list(e){try{let t=e.params?.prefix??"";return a({artifacts:r.list(t)})}catch(t){return u(t)}},head(e){try{let t=e.params?.key;return t?a({artifact:r.head(t)}):s("head requires params.key")}catch(t){return u(t)}},put(e){try{let t=e.params?.key,i=e.params?.contentType;if(!t)return s("put requires params.key");let n=e.body;if(typeof n=="string")return a({artifact:r.putText(t,n,i)});if(n&&typeof n=="object"&&typeof n.text=="string")return a({artifact:r.putText(t,n.text,i)});if(n&&typeof n=="object"&&Array.isArray(n.bytes)){let o=n.bytes,m=new Uint8Array(o.map(c=>Math.max(0,Math.min(255,Number(c)||0))));return a({artifact:r.putBytes(t,m,i)})}return s("put requires body as string, {text}, or {bytes:number[]}")}catch(t){return u(t)}},get(e){try{let t=e.params?.key,i=e.params?.as??"base64";if(!t)return s("get requires params.key");let n=r.head(t);if(!n)return s(`artifact "${t}" not found`);if(i==="text"){let m=r.getText(t);return m===null?s(`artifact "${t}" not found`):a({key:t,contentType:n.contentType,size:n.size,text:m})}let o=r.getBytes(t);return o===null?s(`artifact "${t}" not found`):a({key:t,contentType:n.contentType,size:n.size,bytes:[...o]})}catch(t){return u(t)}},del(e){try{let t=e.params?.key;return t?(r.remove(t),a({ok:!0})):s("del requires params.key")}catch(t){return u(t)}}}}exports.createArtifactsStorePublic=f;//# sourceMappingURL=artifacts-store-public.cjs.map
|
|
2
|
+
//# sourceMappingURL=artifacts-store-public.cjs.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './board-live-cards-public-BnmRAbQV.cjs';
|
|
2
|
+
export { A as ArtifactsStorePublic, a as createArtifactsStorePublic } from './artifacts-store-lib-public-DGa8BpJT.cjs';
|
|
3
|
+
import './storage-interface-BhAON-gW.cjs';
|
|
4
|
+
import './execution-refs.cjs';
|
|
5
|
+
import './types-BBhqYGhE.cjs';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './board-live-cards-public-CsmYrvpd.js';
|
|
2
|
+
export { A as ArtifactsStorePublic, a as createArtifactsStorePublic } from './artifacts-store-lib-public-BABrgFkV.js';
|
|
3
|
+
import './storage-interface-BhAON-gW.js';
|
|
4
|
+
import './execution-refs.js';
|
|
5
|
+
import './types-BBhqYGhE.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function f(r){function a(e){return {status:"success",data:e}}function s(e){return {status:"fail",error:e}}function u(e){return {status:"error",error:e instanceof Error?e.message:String(e)}}return {list(e){try{let t=e.params?.prefix??"";return a({artifacts:r.list(t)})}catch(t){return u(t)}},head(e){try{let t=e.params?.key;return t?a({artifact:r.head(t)}):s("head requires params.key")}catch(t){return u(t)}},put(e){try{let t=e.params?.key,i=e.params?.contentType;if(!t)return s("put requires params.key");let n=e.body;if(typeof n=="string")return a({artifact:r.putText(t,n,i)});if(n&&typeof n=="object"&&typeof n.text=="string")return a({artifact:r.putText(t,n.text,i)});if(n&&typeof n=="object"&&Array.isArray(n.bytes)){let o=n.bytes,m=new Uint8Array(o.map(c=>Math.max(0,Math.min(255,Number(c)||0))));return a({artifact:r.putBytes(t,m,i)})}return s("put requires body as string, {text}, or {bytes:number[]}")}catch(t){return u(t)}},get(e){try{let t=e.params?.key,i=e.params?.as??"base64";if(!t)return s("get requires params.key");let n=r.head(t);if(!n)return s(`artifact "${t}" not found`);if(i==="text"){let m=r.getText(t);return m===null?s(`artifact "${t}" not found`):a({key:t,contentType:n.contentType,size:n.size,text:m})}let o=r.getBytes(t);return o===null?s(`artifact "${t}" not found`):a({key:t,contentType:n.contentType,size:n.size,bytes:[...o]})}catch(t){return u(t)}},del(e){try{let t=e.params?.key;return t?(r.remove(t),a({ok:!0})):s("del requires params.key")}catch(t){return u(t)}}}}export{f as createArtifactsStorePublic};//# sourceMappingURL=artifacts-store-public.js.map
|
|
2
|
+
//# sourceMappingURL=artifacts-store-public.js.map
|