yaml-flow 7.1.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 -3309
- 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/{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/{dist/cli → cli}/node/artifacts-store-cli.js +2 -2
- package/cli/node/batch-runner-cli.js +3 -0
- package/cli/node/board-live-cards-cli.js +15 -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/cli/node/step-machine-cli.d.ts +7 -0
- package/cli/node/step-machine-cli.js +5 -0
- package/{dist/board-live-cards-public-5n1-syA3.d.cts → cli/types-CziUxkiv.d.ts} +68 -5
- 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 → board}/demo-server-config.json +0 -1
- package/examples/{example-board → board}/demo-server.js +23 -48
- package/examples/{example-board → board}/demo-shell-with-server.html +3 -3
- package/examples/{example-board → board}/demo-task-executor.js +71 -24
- 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-CK_J8uv0.d.ts → lib/board-live-cards-public-CsmYrvpd.d.ts} +142 -76
- 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/{dist/storage-refs.cjs → lib/board-worker-adapter.cjs} +2 -2
- package/{dist/storage-refs.d.cts → lib/board-worker-adapter.d.cts} +4 -3
- package/{dist/storage-refs.d.ts → lib/board-worker-adapter.d.ts} +4 -3
- package/{dist/storage-refs.js → lib/board-worker-adapter.js} +2 -2
- 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/{dist → lib}/execution-refs.d.cts +29 -10
- package/{dist → lib}/execution-refs.d.ts +29 -10
- 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 +14 -1
- package/{dist → lib}/step-machine-public/index.d.ts +14 -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-HGDTWIun.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-CU3DjTKL.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.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.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.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.map +0 -1
- 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 -3
- package/dist/step-machine-public/index.cjs.map +0 -1
- package/dist/step-machine-public/index.js +0 -3
- package/dist/step-machine-public/index.js.map +0 -1
- package/dist/storage-refs.cjs.map +0 -1
- 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 -370
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-http-test.py +0 -398
- 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/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/cli → cli}/browser-api/board-live-cards-browser-adapter.js +0 -0
- /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/cli → cli}/node/card-store-cli.js +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/{dist/cli → cli}/node/source-cli-task-executor.js +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 → board}/cards/cardT-market-prices.json +0 -0
- /package/examples/{example-board → board}/cards/cardT-portfolio-value.json +0 -0
- /package/examples/{example-board → board}/cards/cardT-portfolio.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}/execution-refs.cjs +0 -0
- /package/{dist → lib}/execution-refs.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
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { readStdinJson, runBoardCli, runCardStoreCliWithInput, toFsRef, writeFailure, writeResult } from './_board-cli.js';
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
const input = await readStdinJson();
|
|
7
|
-
const boardDir = String(input.BOARD_DIR ?? '').trim();
|
|
8
|
-
const cards = Array.isArray(input.CARDS) ? input.CARDS : [];
|
|
9
|
-
|
|
10
|
-
if (!boardDir || cards.length === 0) {
|
|
11
|
-
writeFailure('BOARD_DIR and CARDS (array) are required');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const baseRef = toFsRef(boardDir);
|
|
15
|
-
|
|
16
|
-
// Write all cards to the card store in one call
|
|
17
|
-
runCardStoreCliWithInput(
|
|
18
|
-
['set', '--store-ref', baseRef],
|
|
19
|
-
JSON.stringify(cards),
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
// Upsert all cards at once
|
|
23
|
-
runBoardCli(['upsert-card', '--base-ref', baseRef, '--all']);
|
|
24
|
-
|
|
25
|
-
writeResult({
|
|
26
|
-
board_dir: boardDir,
|
|
27
|
-
cards_added: cards.length,
|
|
28
|
-
});
|
|
29
|
-
} catch (error) {
|
|
30
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
31
|
-
writeFailure(message);
|
|
32
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { readStdinJson, runBoardCli, toFsRef, writeFailure, writeResult } from './_board-cli.js';
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
const input = await readStdinJson();
|
|
7
|
-
const boardDir = String(input.BOARD_DIR ?? '').trim();
|
|
8
|
-
|
|
9
|
-
if (!boardDir) {
|
|
10
|
-
writeFailure('BOARD_DIR is required');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
runBoardCli([
|
|
14
|
-
'init',
|
|
15
|
-
'--base-ref', toFsRef(boardDir),
|
|
16
|
-
'--card-store-ref', toFsRef(boardDir),
|
|
17
|
-
'--outputs-store-ref', toFsRef(boardDir),
|
|
18
|
-
]);
|
|
19
|
-
writeResult({
|
|
20
|
-
board_dir: boardDir,
|
|
21
|
-
message: `initialized ${boardDir}`,
|
|
22
|
-
});
|
|
23
|
-
} catch (error) {
|
|
24
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
25
|
-
writeFailure(message);
|
|
26
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { readStdinJson, runBoardCli, toFsRef, writeFailure, writeResult } from './_board-cli.js';
|
|
4
|
-
|
|
5
|
-
function sleep(ms) {
|
|
6
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
const input = await readStdinJson();
|
|
11
|
-
const boardDir = String(input.BOARD_DIR ?? '').trim();
|
|
12
|
-
const expectedCardCount = Number(input.EXPECTED_CARD_COUNT ?? 0);
|
|
13
|
-
const timeoutMs = Number(input.TIMEOUT_MS ?? 30000);
|
|
14
|
-
const pollMs = Number(input.POLL_MS ?? 500);
|
|
15
|
-
|
|
16
|
-
if (!boardDir || expectedCardCount <= 0) {
|
|
17
|
-
writeFailure('BOARD_DIR and EXPECTED_CARD_COUNT are required');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const started = Date.now();
|
|
21
|
-
|
|
22
|
-
while (Date.now() - started < timeoutMs) {
|
|
23
|
-
const statusJson = runBoardCli(['status', '--base-ref', toFsRef(boardDir)], { capture: true });
|
|
24
|
-
let cards = [];
|
|
25
|
-
try {
|
|
26
|
-
cards = JSON.parse(statusJson)?.data?.cards ?? [];
|
|
27
|
-
} catch { /* ignore parse errors */ }
|
|
28
|
-
|
|
29
|
-
const completedCount = cards.filter(c => c.status === 'completed').length;
|
|
30
|
-
|
|
31
|
-
if (cards.length >= expectedCardCount && completedCount >= expectedCardCount) {
|
|
32
|
-
writeResult({
|
|
33
|
-
all_completed: true,
|
|
34
|
-
card_count: cards.length,
|
|
35
|
-
completed_count: completedCount,
|
|
36
|
-
});
|
|
37
|
-
process.exit(0);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
await sleep(pollMs);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Timeout — exit non-zero
|
|
44
|
-
process.stderr.write(`timed out waiting for ${expectedCardCount} cards to complete`);
|
|
45
|
-
process.exit(1);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
48
|
-
writeFailure(message);
|
|
49
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
|
-
import * as path from 'node:path';
|
|
5
|
-
import { readStdinJson, writeFailure, writeResult } from './_board-cli.js';
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
const input = await readStdinJson();
|
|
9
|
-
const boardDirInput = String(input.BOARD_DIR ?? '').trim();
|
|
10
|
-
|
|
11
|
-
if (!boardDirInput) {
|
|
12
|
-
writeFailure('BOARD_DIR is required');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const boardDir = path.resolve(boardDirInput);
|
|
16
|
-
fs.rmSync(boardDir, { recursive: true, force: true });
|
|
17
|
-
|
|
18
|
-
writeResult({
|
|
19
|
-
board_dir: boardDir,
|
|
20
|
-
reset: true,
|
|
21
|
-
});
|
|
22
|
-
} catch (error) {
|
|
23
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
24
|
-
writeFailure(message);
|
|
25
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { readStdinJson, runBoardCli, toFsRef, writeFailure, writeResult } from './_board-cli.js';
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
const input = await readStdinJson();
|
|
7
|
-
const boardDir = String(input.BOARD_DIR ?? '').trim();
|
|
8
|
-
const task = String(input.TASK ?? '').trim();
|
|
9
|
-
|
|
10
|
-
if (!boardDir || !task) {
|
|
11
|
-
writeFailure('BOARD_DIR and TASK are required');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
runBoardCli(['retrigger', '--base-ref', toFsRef(boardDir), '--id', task]);
|
|
15
|
-
|
|
16
|
-
writeResult({
|
|
17
|
-
task,
|
|
18
|
-
retriggered: true,
|
|
19
|
-
});
|
|
20
|
-
} catch (error) {
|
|
21
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
22
|
-
writeFailure(message);
|
|
23
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { readStdinJson, runBoardCli, toFsRef, writeFailure, writeResult } from './_board-cli.js';
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
const input = await readStdinJson();
|
|
7
|
-
const boardDir = String(input.BOARD_DIR ?? '').trim();
|
|
8
|
-
|
|
9
|
-
if (!boardDir) {
|
|
10
|
-
writeFailure('BOARD_DIR is required');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const status = runBoardCli(['status', '--base-ref', toFsRef(boardDir)], { capture: true });
|
|
14
|
-
|
|
15
|
-
writeResult({
|
|
16
|
-
status,
|
|
17
|
-
});
|
|
18
|
-
} catch (error) {
|
|
19
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
20
|
-
writeFailure(message);
|
|
21
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
|
-
import * as path from 'node:path';
|
|
5
|
-
import { readStdinJson, runBoardCli, runCardStoreCliWithInput, toFsRef, writeFailure, writeResult } from './_board-cli.js';
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
const input = await readStdinJson();
|
|
9
|
-
const boardDir = String(input.BOARD_DIR ?? '').trim();
|
|
10
|
-
const cardsDir = String(input.CARDS_DIR ?? '').trim();
|
|
11
|
-
const holdings = input.HOLDINGS;
|
|
12
|
-
|
|
13
|
-
if (!boardDir || !cardsDir || !Array.isArray(holdings)) {
|
|
14
|
-
writeFailure('BOARD_DIR, CARDS_DIR and HOLDINGS array are required');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const cardPath = path.join(cardsDir, 'portfolio-form.json');
|
|
18
|
-
const raw = fs.readFileSync(cardPath, 'utf-8');
|
|
19
|
-
const card = JSON.parse(raw);
|
|
20
|
-
card.card_data = card.card_data ?? {};
|
|
21
|
-
card.card_data.holdings = holdings;
|
|
22
|
-
fs.writeFileSync(cardPath, `${JSON.stringify(card, null, 2)}\n`, 'utf-8');
|
|
23
|
-
|
|
24
|
-
const baseRef = toFsRef(boardDir);
|
|
25
|
-
runCardStoreCliWithInput(
|
|
26
|
-
['set', '--store-ref', baseRef],
|
|
27
|
-
JSON.stringify(card),
|
|
28
|
-
);
|
|
29
|
-
runBoardCli(['upsert-card', '--base-ref', baseRef, '--card-id', card.id, '--restart']);
|
|
30
|
-
|
|
31
|
-
writeResult({
|
|
32
|
-
saved: true,
|
|
33
|
-
holdings_count: holdings.length,
|
|
34
|
-
});
|
|
35
|
-
} catch (error) {
|
|
36
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
37
|
-
writeFailure(message);
|
|
38
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { readStdinJson, runBoardCli, toFsRef, writeFailure, writeResult } from './_board-cli.js';
|
|
4
|
-
|
|
5
|
-
function sleep(ms) {
|
|
6
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
const input = await readStdinJson();
|
|
11
|
-
const boardDir = String(input.BOARD_DIR ?? '').trim();
|
|
12
|
-
const tasks = Array.isArray(input.COMPLETION_TASKS) ? input.COMPLETION_TASKS : [];
|
|
13
|
-
const label = String(input.LABEL ?? 'WAIT');
|
|
14
|
-
const timeoutMs = Number(input.TIMEOUT_MS ?? 30000);
|
|
15
|
-
const pollMs = Number(input.POLL_MS ?? 500);
|
|
16
|
-
|
|
17
|
-
if (!boardDir || tasks.length === 0) {
|
|
18
|
-
writeFailure('BOARD_DIR and COMPLETION_TASKS are required');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const started = Date.now();
|
|
22
|
-
|
|
23
|
-
while (Date.now() - started < timeoutMs) {
|
|
24
|
-
const statusJson = runBoardCli(['status', '--base-ref', toFsRef(boardDir)], { capture: true });
|
|
25
|
-
let cards = [];
|
|
26
|
-
try {
|
|
27
|
-
cards = JSON.parse(statusJson)?.data?.cards ?? [];
|
|
28
|
-
} catch { /* ignore parse errors */ }
|
|
29
|
-
const complete = tasks.every((task) => cards.some(c => c.name === task && c.status === 'completed'));
|
|
30
|
-
|
|
31
|
-
if (complete) {
|
|
32
|
-
writeResult({
|
|
33
|
-
label,
|
|
34
|
-
completed: true,
|
|
35
|
-
});
|
|
36
|
-
process.exit(0);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
await sleep(pollMs);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Timeout — exit non-zero
|
|
43
|
-
process.stderr.write(`${label}: timed out waiting for completion`);
|
|
44
|
-
process.exit(1);
|
|
45
|
-
} catch (error) {
|
|
46
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
47
|
-
writeFailure(message);
|
|
48
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
|
-
import * as path from 'node:path';
|
|
5
|
-
import { readStdinJson, writeFailure, writeResult } from './_board-cli.js';
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
const input = await readStdinJson();
|
|
9
|
-
const boardDirInput = String(input.BOARD_DIR ?? '').trim();
|
|
10
|
-
const tmpFileName = String(input.TMP_FILE_NAME ?? '').trim() || 'tmp_file1';
|
|
11
|
-
const prices = input.PRICES;
|
|
12
|
-
|
|
13
|
-
if (!boardDirInput || !prices || typeof prices !== 'object' || Array.isArray(prices)) {
|
|
14
|
-
writeFailure('BOARD_DIR and PRICES object are required');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const boardDir = path.resolve(boardDirInput);
|
|
18
|
-
const payload = JSON.stringify(prices);
|
|
19
|
-
const tmpFile = path.join(boardDir, tmpFileName);
|
|
20
|
-
|
|
21
|
-
fs.mkdirSync(path.dirname(tmpFile), { recursive: true });
|
|
22
|
-
fs.writeFileSync(tmpFile, payload, 'utf-8');
|
|
23
|
-
|
|
24
|
-
writeResult({
|
|
25
|
-
wrote: true,
|
|
26
|
-
tmp_file: tmpFile,
|
|
27
|
-
});
|
|
28
|
-
} catch (error) {
|
|
29
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
30
|
-
writeFailure(message);
|
|
31
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"""Shared helpers for step-machine portfolio-tracker pycli handlers.
|
|
2
|
-
|
|
3
|
-
Each handler reads a JSON object from stdin and writes a JSON object to stdout.
|
|
4
|
-
Result schema: {"result": "success" | "failure" | "timeout", "data"?: {...}, "error"?: "..."}
|
|
5
|
-
"""
|
|
6
|
-
from __future__ import annotations
|
|
7
|
-
|
|
8
|
-
import json
|
|
9
|
-
import base64
|
|
10
|
-
import os
|
|
11
|
-
import subprocess
|
|
12
|
-
import sys
|
|
13
|
-
from pathlib import Path
|
|
14
|
-
from typing import Any
|
|
15
|
-
|
|
16
|
-
# Repo root layout (standalone or source tree):
|
|
17
|
-
# <root>/pycli/main/board_live_cards_pycli.py
|
|
18
|
-
# <root>/pycli/main/card_store_pycli.py
|
|
19
|
-
# <root>/dist/pycli/quickjs-board-runtime.global.js
|
|
20
|
-
_HERE = Path(__file__).resolve().parent
|
|
21
|
-
_REPO_ROOT = _HERE.parents[4]
|
|
22
|
-
|
|
23
|
-
BOARD_PYCLI = _REPO_ROOT / "pycli" / "main" / "board_live_cards_pycli.py"
|
|
24
|
-
CARD_STORE_PYCLI = _REPO_ROOT / "pycli" / "main" / "card_store_pycli.py"
|
|
25
|
-
QUICKJS_BUNDLE = _REPO_ROOT / "dist" / "pycli" / "quickjs-board-runtime.global.js"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def read_stdin_json() -> dict[str, Any]:
|
|
29
|
-
raw = sys.stdin.read()
|
|
30
|
-
if not raw.strip():
|
|
31
|
-
return {}
|
|
32
|
-
return json.loads(raw)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def write_result(payload: dict[str, Any]) -> None:
|
|
36
|
-
sys.stdout.write(json.dumps(payload, ensure_ascii=True))
|
|
37
|
-
sys.stdout.flush()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def write_failure(message: str) -> None:
|
|
41
|
-
write_result({"result": "failure", "error": message})
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def _hidden_kwargs() -> dict[str, Any]:
|
|
45
|
-
kwargs: dict[str, Any] = {}
|
|
46
|
-
if os.name == "nt":
|
|
47
|
-
startupinfo = subprocess.STARTUPINFO()
|
|
48
|
-
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
|
49
|
-
kwargs["startupinfo"] = startupinfo
|
|
50
|
-
kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW
|
|
51
|
-
return kwargs
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def to_fs_ref(value: str) -> str:
|
|
55
|
-
payload = json.dumps({"kind": "fs-path", "value": value}, separators=(",", ":")).encode("utf-8")
|
|
56
|
-
return "b64:" + base64.urlsafe_b64encode(payload).decode("ascii").rstrip("=")
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def _normalize_args(args: list[str]) -> list[str]:
|
|
60
|
-
return list(args)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def run_board_pycli(args: list[str], *, capture: bool = False) -> str:
|
|
64
|
-
cmd = [sys.executable, str(BOARD_PYCLI), *_normalize_args(args), "--bundle", str(QUICKJS_BUNDLE)]
|
|
65
|
-
proc = subprocess.run(
|
|
66
|
-
cmd,
|
|
67
|
-
capture_output=True,
|
|
68
|
-
text=True,
|
|
69
|
-
check=False,
|
|
70
|
-
**_hidden_kwargs(),
|
|
71
|
-
)
|
|
72
|
-
if proc.returncode != 0:
|
|
73
|
-
msg = (proc.stderr or proc.stdout or "no output").strip()
|
|
74
|
-
raise RuntimeError(f"board_live_cards_pycli failed ({proc.returncode}): {msg}")
|
|
75
|
-
return proc.stdout if capture else ""
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def run_board_pycli_with_input(args: list[str], input_json: str) -> str:
|
|
79
|
-
cmd = [sys.executable, str(BOARD_PYCLI), *_normalize_args(args), "--bundle", str(QUICKJS_BUNDLE)]
|
|
80
|
-
proc = subprocess.run(
|
|
81
|
-
cmd,
|
|
82
|
-
input=input_json,
|
|
83
|
-
capture_output=True,
|
|
84
|
-
text=True,
|
|
85
|
-
check=False,
|
|
86
|
-
**_hidden_kwargs(),
|
|
87
|
-
)
|
|
88
|
-
if proc.returncode != 0:
|
|
89
|
-
msg = (proc.stderr or proc.stdout or "no output").strip()
|
|
90
|
-
raise RuntimeError(f"board_live_cards_pycli failed ({proc.returncode}): {msg}")
|
|
91
|
-
return proc.stdout
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
def run_card_store_pycli_with_input(args: list[str], input_json: str) -> str:
|
|
95
|
-
cmd = [sys.executable, str(CARD_STORE_PYCLI), *_normalize_args(args)]
|
|
96
|
-
proc = subprocess.run(
|
|
97
|
-
cmd,
|
|
98
|
-
input=input_json,
|
|
99
|
-
capture_output=True,
|
|
100
|
-
text=True,
|
|
101
|
-
check=False,
|
|
102
|
-
**_hidden_kwargs(),
|
|
103
|
-
)
|
|
104
|
-
if proc.returncode != 0:
|
|
105
|
-
msg = (proc.stderr or proc.stdout or "no output").strip()
|
|
106
|
-
raise RuntimeError(f"card_store_pycli failed ({proc.returncode}): {msg}")
|
|
107
|
-
return proc.stdout
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Write all cards to card-store and upsert them onto the board (pycli)."""
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import json
|
|
6
|
-
import sys
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
10
|
-
from _board_pycli import ( # noqa: E402
|
|
11
|
-
read_stdin_json,
|
|
12
|
-
run_board_pycli,
|
|
13
|
-
run_card_store_pycli_with_input,
|
|
14
|
-
to_fs_ref,
|
|
15
|
-
write_failure,
|
|
16
|
-
write_result,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def main() -> int:
|
|
21
|
-
try:
|
|
22
|
-
payload = read_stdin_json()
|
|
23
|
-
board_dir = str(payload.get("BOARD_DIR", "")).strip()
|
|
24
|
-
cards = payload.get("CARDS")
|
|
25
|
-
if not isinstance(cards, list):
|
|
26
|
-
cards = []
|
|
27
|
-
|
|
28
|
-
if not board_dir or not cards:
|
|
29
|
-
write_failure("BOARD_DIR and CARDS (array) are required")
|
|
30
|
-
return 0
|
|
31
|
-
|
|
32
|
-
base_ref = to_fs_ref(board_dir)
|
|
33
|
-
|
|
34
|
-
run_card_store_pycli_with_input(
|
|
35
|
-
["set", "--store-ref", base_ref],
|
|
36
|
-
json.dumps(cards, ensure_ascii=True),
|
|
37
|
-
)
|
|
38
|
-
run_board_pycli(["upsert-card", "--base-ref", base_ref, "--all"])
|
|
39
|
-
|
|
40
|
-
write_result({
|
|
41
|
-
"result": "success",
|
|
42
|
-
"data": {"board_dir": board_dir, "count": len(cards)},
|
|
43
|
-
})
|
|
44
|
-
return 0
|
|
45
|
-
except Exception as exc:
|
|
46
|
-
write_failure(str(exc))
|
|
47
|
-
return 0
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if __name__ == "__main__":
|
|
51
|
-
raise SystemExit(main())
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Initialize the board with card-store and outputs-store refs (pycli)."""
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import sys
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
9
|
-
from _board_pycli import ( # noqa: E402
|
|
10
|
-
read_stdin_json,
|
|
11
|
-
run_board_pycli,
|
|
12
|
-
to_fs_ref,
|
|
13
|
-
write_failure,
|
|
14
|
-
write_result,
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def main() -> int:
|
|
19
|
-
try:
|
|
20
|
-
payload = read_stdin_json()
|
|
21
|
-
board_dir = str(payload.get("BOARD_DIR", "")).strip()
|
|
22
|
-
if not board_dir:
|
|
23
|
-
write_failure("BOARD_DIR is required")
|
|
24
|
-
return 0
|
|
25
|
-
|
|
26
|
-
base_ref = to_fs_ref(board_dir)
|
|
27
|
-
run_board_pycli([
|
|
28
|
-
"init",
|
|
29
|
-
"--base-ref", base_ref,
|
|
30
|
-
"--card-store-ref", base_ref,
|
|
31
|
-
"--outputs-store-ref", base_ref,
|
|
32
|
-
])
|
|
33
|
-
|
|
34
|
-
write_result({
|
|
35
|
-
"result": "success",
|
|
36
|
-
"data": {"board_dir": board_dir, "message": f"initialized {board_dir}"},
|
|
37
|
-
})
|
|
38
|
-
return 0
|
|
39
|
-
except Exception as exc:
|
|
40
|
-
write_failure(str(exc))
|
|
41
|
-
return 0
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if __name__ == "__main__":
|
|
45
|
-
raise SystemExit(main())
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Poll board status until all expected cards reach `completed` (pycli)."""
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import json
|
|
6
|
-
import sys
|
|
7
|
-
import time
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
11
|
-
from _board_pycli import ( # noqa: E402
|
|
12
|
-
read_stdin_json,
|
|
13
|
-
run_board_pycli,
|
|
14
|
-
to_fs_ref,
|
|
15
|
-
write_failure,
|
|
16
|
-
write_result,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def main() -> int:
|
|
21
|
-
try:
|
|
22
|
-
payload = read_stdin_json()
|
|
23
|
-
board_dir = str(payload.get("BOARD_DIR", "")).strip()
|
|
24
|
-
expected = int(payload.get("EXPECTED_CARD_COUNT") or 0)
|
|
25
|
-
timeout_ms = int(payload.get("TIMEOUT_MS") or 30_000)
|
|
26
|
-
poll_ms = int(payload.get("POLL_MS") or 500)
|
|
27
|
-
|
|
28
|
-
if not board_dir or expected <= 0:
|
|
29
|
-
write_failure("BOARD_DIR and EXPECTED_CARD_COUNT are required")
|
|
30
|
-
return 0
|
|
31
|
-
|
|
32
|
-
base_ref = to_fs_ref(board_dir)
|
|
33
|
-
deadline = time.monotonic() + (timeout_ms / 1000)
|
|
34
|
-
|
|
35
|
-
while time.monotonic() < deadline:
|
|
36
|
-
raw = run_board_pycli(["status", "--base-ref", base_ref], capture=True)
|
|
37
|
-
cards = []
|
|
38
|
-
try:
|
|
39
|
-
cards = json.loads(raw).get("data", {}).get("cards", []) or []
|
|
40
|
-
except Exception:
|
|
41
|
-
cards = []
|
|
42
|
-
|
|
43
|
-
completed = [c for c in cards if c.get("status") == "completed"]
|
|
44
|
-
if len(cards) >= expected and len(completed) >= expected:
|
|
45
|
-
write_result({
|
|
46
|
-
"result": "success",
|
|
47
|
-
"data": {
|
|
48
|
-
"completed": True,
|
|
49
|
-
"card_count": len(cards),
|
|
50
|
-
"completed_count": len(completed),
|
|
51
|
-
},
|
|
52
|
-
})
|
|
53
|
-
return 0
|
|
54
|
-
|
|
55
|
-
time.sleep(poll_ms / 1000)
|
|
56
|
-
|
|
57
|
-
write_result({
|
|
58
|
-
"result": "timeout",
|
|
59
|
-
"data": {
|
|
60
|
-
"completed": False,
|
|
61
|
-
"error": f"timed out waiting for {expected} cards to complete",
|
|
62
|
-
},
|
|
63
|
-
})
|
|
64
|
-
return 0
|
|
65
|
-
except Exception as exc:
|
|
66
|
-
write_failure(str(exc))
|
|
67
|
-
return 0
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if __name__ == "__main__":
|
|
71
|
-
raise SystemExit(main())
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Reset (rm -rf) the board runtime directory."""
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import shutil
|
|
6
|
-
import sys
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
10
|
-
from _board_pycli import read_stdin_json, write_failure, write_result # noqa: E402
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def main() -> int:
|
|
14
|
-
try:
|
|
15
|
-
payload = read_stdin_json()
|
|
16
|
-
board_dir_input = str(payload.get("BOARD_DIR", "")).strip()
|
|
17
|
-
if not board_dir_input:
|
|
18
|
-
write_failure("BOARD_DIR is required")
|
|
19
|
-
return 0
|
|
20
|
-
|
|
21
|
-
board_dir = Path(board_dir_input).resolve()
|
|
22
|
-
if board_dir.exists():
|
|
23
|
-
shutil.rmtree(board_dir, ignore_errors=True)
|
|
24
|
-
|
|
25
|
-
write_result({
|
|
26
|
-
"result": "success",
|
|
27
|
-
"data": {"board_dir": str(board_dir), "reset": True},
|
|
28
|
-
})
|
|
29
|
-
return 0
|
|
30
|
-
except Exception as exc:
|
|
31
|
-
write_failure(str(exc))
|
|
32
|
-
return 0
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if __name__ == "__main__":
|
|
36
|
-
raise SystemExit(main())
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
id: inline-python-demo
|
|
2
|
-
settings:
|
|
3
|
-
start_step: greet
|
|
4
|
-
max_total_steps: 5
|
|
5
|
-
|
|
6
|
-
steps:
|
|
7
|
-
greet:
|
|
8
|
-
description: Build a greeting message using Python inline handler
|
|
9
|
-
handler:
|
|
10
|
-
inline: greet_user
|
|
11
|
-
transitions:
|
|
12
|
-
success: add
|
|
13
|
-
|
|
14
|
-
add:
|
|
15
|
-
description: Add two numbers with Python inline handler
|
|
16
|
-
expects_data: [a, b]
|
|
17
|
-
produces_data: [total]
|
|
18
|
-
handler:
|
|
19
|
-
inline: add_numbers
|
|
20
|
-
transitions:
|
|
21
|
-
success: done
|
|
22
|
-
|
|
23
|
-
terminal_states:
|
|
24
|
-
done:
|
|
25
|
-
return_intent: success
|
|
26
|
-
return_artifacts: [message, total]
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def greet_user(input_obj, ctx=None):
|
|
5
|
-
payload = input_obj if isinstance(input_obj, dict) else {}
|
|
6
|
-
name = payload.get("name", "world")
|
|
7
|
-
return {
|
|
8
|
-
"result": "success",
|
|
9
|
-
"data": {
|
|
10
|
-
"message": f"Hello, {name}!",
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def add_numbers(input_obj, ctx=None):
|
|
16
|
-
payload = input_obj if isinstance(input_obj, dict) else {}
|
|
17
|
-
a = payload.get("a", 0)
|
|
18
|
-
b = payload.get("b", 0)
|
|
19
|
-
try:
|
|
20
|
-
total = float(a) + float(b)
|
|
21
|
-
except Exception:
|
|
22
|
-
return {
|
|
23
|
-
"result": "failure",
|
|
24
|
-
"data": {"error": f"Cannot add values: a={a!r}, b={b!r}"},
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if total.is_integer():
|
|
28
|
-
total = int(total)
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
"result": "success",
|
|
32
|
-
"data": {"total": total},
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
handlers = {
|
|
37
|
-
"greet_user": greet_user,
|
|
38
|
-
"add_numbers": add_numbers,
|
|
39
|
-
}
|