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,834 +0,0 @@
|
|
|
1
|
-
# Agent Instructions — Authoring yaml-flow Boards & Cards
|
|
2
|
-
|
|
3
|
-
## What Is This?
|
|
4
|
-
|
|
5
|
-
A **board** is a `board.yaml` file plus a folder of **card** JSON files. Cards are purely declarative — the runtime (board-livegraph-runtime) owns all state mutation and reactivity. Cards never imperative-call each other; they declare data dependencies and the runtime handles everything.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Board File (`board.yaml`)
|
|
10
|
-
|
|
11
|
-
```yaml
|
|
12
|
-
name: My Dashboard
|
|
13
|
-
desc: Short description
|
|
14
|
-
|
|
15
|
-
connects:
|
|
16
|
-
- id: my-db
|
|
17
|
-
type: script # or: http
|
|
18
|
-
url: https://... # for http type
|
|
19
|
-
desc: Human description
|
|
20
|
-
|
|
21
|
-
vocabulary:
|
|
22
|
-
tokens:
|
|
23
|
-
healthy: { color: "green", label: "Healthy" }
|
|
24
|
-
warning: { color: "orange", label: "Warning" }
|
|
25
|
-
alert: { color: "red", label: "Alert" }
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
`connects` entries describe available data connections. Their fields are passed to the task-executor and are not schema-enforced beyond `id` and `type`.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Card File Structure
|
|
33
|
-
|
|
34
|
-
```json
|
|
35
|
-
{
|
|
36
|
-
"id": "my-card",
|
|
37
|
-
"meta": { "title": "Card Title", "tags": ["tag1"], "desc": "What this card does" },
|
|
38
|
-
|
|
39
|
-
"requires": ["token-a", "token-b"],
|
|
40
|
-
|
|
41
|
-
"source_defs": [
|
|
42
|
-
{ "bindTo": "raw", "outputFile": "my-card-raw.json", /* task-executor fields */ }
|
|
43
|
-
],
|
|
44
|
-
|
|
45
|
-
"compute": [
|
|
46
|
-
{ "bindTo": "result", "expr": "/* JSONata expression */" }
|
|
47
|
-
],
|
|
48
|
-
|
|
49
|
-
"provides": [
|
|
50
|
-
{ "bindTo": "published-token", "ref": "computed_values.result" }
|
|
51
|
-
],
|
|
52
|
-
|
|
53
|
-
"view": {
|
|
54
|
-
"elements": [ /* see Element Kinds below */ ],
|
|
55
|
-
"layout": {
|
|
56
|
-
"board": { "col": 4, "order": 1 },
|
|
57
|
-
"canvas": { "x": 50, "y": 50, "w": 280, "h": 180 }
|
|
58
|
-
},
|
|
59
|
-
"features": { "refresh": true, "chat": true }
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
"card_data": { /* initial mutable state */ }
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Strict Compute Order (within a card)
|
|
69
|
-
|
|
70
|
-
### Stage 1 — Sources
|
|
71
|
-
- **Runs first.** Parameterised by `requires.*` and `card_data.*` only.
|
|
72
|
-
- Each entry: `{ "bindTo": "key", "outputFile": "cache.json", ...customFields }`
|
|
73
|
-
- `bindTo` → key under `fetched_sources`
|
|
74
|
-
- `outputFile` → where the fetched result is cached
|
|
75
|
-
- `customFields` → interpreted by the registered **task-executor** (examples: `mock`, `copilot`, `http`, `script`)
|
|
76
|
-
- Produces: `fetched_sources.*`
|
|
77
|
-
- **`source_defs` is NOT a valid data namespace** — it is the config array of source definitions. Use `fetched_sources.*` to reference fetched data.
|
|
78
|
-
|
|
79
|
-
### Stage 2 — Compute
|
|
80
|
-
- **Runs after source_defs.** Reads `requires.*`, `fetched_sources.*`, `card_data.*`.
|
|
81
|
-
- Each entry: `{ "bindTo": "key", "expr": "<JSONata>" }`
|
|
82
|
-
- Produces: `computed_values.*`
|
|
83
|
-
|
|
84
|
-
### Stage 3 — Views & Provides
|
|
85
|
-
- **Resolved last.** Can reference all four namespaces:
|
|
86
|
-
`requires.*`, `fetched_sources.*`, `card_data.*`, `computed_values.*`
|
|
87
|
-
- `view.elements[].data.bind` paths are resolved here.
|
|
88
|
-
- `provides[].ref` paths are resolved here and published to the graph.
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## provides / requires — The Dependency Graph
|
|
93
|
-
|
|
94
|
-
```json
|
|
95
|
-
// Publishing a token:
|
|
96
|
-
"provides": [
|
|
97
|
-
{ "bindTo": "orders", "ref": "fetched_sources.raw" },
|
|
98
|
-
{ "bindTo": "regionTotals","ref": "computed_values.byRegion" },
|
|
99
|
-
{ "bindTo": "my-card", "ref": "card_data" }
|
|
100
|
-
]
|
|
101
|
-
|
|
102
|
-
// Consuming tokens:
|
|
103
|
-
"requires": ["orders", "selections", "my-card"]
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
- `provides` maps a token key to a dot-path inside this card's own namespaces.
|
|
107
|
-
- `requires` is a plain array of token key strings.
|
|
108
|
-
- In compute/source expressions, consumed tokens are at `requires.<key>`.
|
|
109
|
-
- For hyphenated keys, use JSONata `$lookup(requires, 'my-card')`.
|
|
110
|
-
- **These declarations are the only wiring needed** — the runtime builds the reactive DAG automatically.
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## Reactivity
|
|
115
|
-
|
|
116
|
-
Every card is a live entity. Any of these events triggers automatic recompute of all downstream dependents in dependency order:
|
|
117
|
-
- A source finishes fetching (`fetched_sources` changes)
|
|
118
|
-
- User edits `card_data` via a form/filter/todo/actions element
|
|
119
|
-
- An upstream card's `provides` value changes
|
|
120
|
-
- A card definition is updated via server API from the UI
|
|
121
|
-
|
|
122
|
-
**Authors never trigger recompute manually — just declare the data shape.**
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## Task Completion
|
|
127
|
-
|
|
128
|
-
Task completion is determined by one rule: **a card is complete when all non-optional `source_defs[]` have been fetched**.
|
|
129
|
-
|
|
130
|
-
If completion requires a judgment call — e.g. "is the data sufficient?", "does this narrative indicate done?" — model it as data using the standard source → compute → provides chain (see LLM source pattern below). The card is complete when that source has been fetched.
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Element Kinds Reference
|
|
135
|
-
|
|
136
|
-
### `metric`
|
|
137
|
-
Single KPI value.
|
|
138
|
-
```json
|
|
139
|
-
{ "kind": "metric", "label": "Revenue", "data": { "bind": "computed_values.total" } }
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### `badge`
|
|
143
|
-
Colour-coded status pill using Bootstrap colour names (`success`, `warning`, `danger`, `info`, `secondary`).
|
|
144
|
-
```json
|
|
145
|
-
{ "kind": "badge", "data": { "bind": "computed_values.health", "colorMap": { "Healthy": "success", "Low": "danger" } } }
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### `text`
|
|
149
|
-
Plain or styled text. `style`: `muted`, `muted-italic`. Use `hideIfEmpty: true` to suppress if blank.
|
|
150
|
-
```json
|
|
151
|
-
{ "kind": "text", "label": "Note", "style": "muted-italic", "data": { "bind": "card_data.note", "hideIfEmpty": true } }
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### `list`
|
|
155
|
-
Ordered list from an array. Optional `template` for string interpolation: `"{field1} — {field2}"`.
|
|
156
|
-
```json
|
|
157
|
-
{ "kind": "list", "data": { "bind": "computed_values.topItems", "template": "{name} — ${amount}" } }
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### `table`
|
|
161
|
-
Data table. `columns` selects fields. `sortable: true` enables click-to-sort. `maxRows` caps display.
|
|
162
|
-
```json
|
|
163
|
-
{ "kind": "table", "data": { "bind": "fetched_sources.raw", "columns": ["id","name","value"], "sortable": true, "maxRows": 20 } }
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### `editable-table`
|
|
167
|
-
Inline-editable table. Each cell is an `<input>`; changes save on blur. `writeTo` persists the updated array back to `card_data`. `columns` controls which fields appear. Optional `schema.properties` per column sets `type` (`number`/`integer` renders a numeric input). `addRow` (default `true`) shows a "+ Add row" button; `deleteRow` (default `true`) shows per-row delete buttons.
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"kind": "editable-table",
|
|
171
|
-
"label": "Holdings",
|
|
172
|
-
"data": {
|
|
173
|
-
"bind": "card_data.holdings",
|
|
174
|
-
"writeTo": "card_data.holdings",
|
|
175
|
-
"columns": ["ticker", "quantity"],
|
|
176
|
-
"schema": {
|
|
177
|
-
"properties": {
|
|
178
|
-
"quantity": { "type": "number" }
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
Pair with a `provides` pointing at `card_data.holdings` so downstream cards receive the live array. Use `addRow: false` / `deleteRow: false` to make the table append-only or read-fixed-length.
|
|
185
|
-
|
|
186
|
-
### `chart`
|
|
187
|
-
Chart.js chart. `chartType`: `bar`, `line`, `pie`, `doughnut`, etc. `chartOptions` passed to Chart.js.
|
|
188
|
-
```json
|
|
189
|
-
{ "kind": "chart", "label": "By Region", "data": { "bind": "computed_values.regionCounts", "chartType": "bar", "chartOptions": { "indexAxis": "x" } } }
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### `filter`
|
|
193
|
-
Interactive filter controls. `writeTo` persists selections into `card_data`. `fields` is a JSON Schema describing the filter fields.
|
|
194
|
-
```json
|
|
195
|
-
{
|
|
196
|
-
"kind": "filter",
|
|
197
|
-
"data": {
|
|
198
|
-
"bind": "computed_values",
|
|
199
|
-
"writeTo": "card_data.fieldValues",
|
|
200
|
-
"fields": {
|
|
201
|
-
"type": "object",
|
|
202
|
-
"properties": {
|
|
203
|
-
"region": { "type": "string", "title": "Region" },
|
|
204
|
-
"product": { "type": "string", "title": "Product" }
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
Pair with a `provides` to publish `card_data.fieldValues` as a named token for downstream cards.
|
|
211
|
-
|
|
212
|
-
### `form`
|
|
213
|
-
Full editable form. `writeTo` path in `card_data`. `fields` is a JSON Schema (supports `enum`, `type`, `minimum`, `maximum`, `required`, etc.).
|
|
214
|
-
```json
|
|
215
|
-
{
|
|
216
|
-
"kind": "form",
|
|
217
|
-
"label": "Settings",
|
|
218
|
-
"data": {
|
|
219
|
-
"writeTo": "card_data.prefs",
|
|
220
|
-
"fields": {
|
|
221
|
-
"type": "object",
|
|
222
|
-
"properties": {
|
|
223
|
-
"region": { "type": "string", "title": "Region", "enum": ["North","South","East","West"] },
|
|
224
|
-
"limit": { "type": "number", "title": "Limit", "minimum": 0 }
|
|
225
|
-
},
|
|
226
|
-
"required": ["region"]
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### `todo`
|
|
233
|
-
Interactive checklist. Items are `{ text, done }` objects stored in `card_data`.
|
|
234
|
-
```json
|
|
235
|
-
{ "kind": "todo", "label": "Tasks", "data": { "bind": "card_data.items", "writeTo": "card_data.items", "placeholder": "Add a task…" } }
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### `actions`
|
|
239
|
-
Button row. Events bubble to the board-level chat/action handler. `style` is a Bootstrap colour name.
|
|
240
|
-
```json
|
|
241
|
-
{
|
|
242
|
-
"kind": "actions",
|
|
243
|
-
"label": "Workflow",
|
|
244
|
-
"data": {
|
|
245
|
-
"buttons": [
|
|
246
|
-
{ "id": "approve", "label": "Approve", "style": "success" },
|
|
247
|
-
{ "id": "escalate", "label": "Escalate", "style": "danger" }
|
|
248
|
-
]
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### `markdown`
|
|
254
|
-
Free-text Markdown rendered in the card. Typically bound to a `card_data` string field.
|
|
255
|
-
```json
|
|
256
|
-
{ "kind": "markdown", "data": { "bind": "card_data.content" } }
|
|
257
|
-
```
|
|
258
|
-
Set initial content in `card_data.content`.
|
|
259
|
-
|
|
260
|
-
### `narrative`
|
|
261
|
-
AI-generated streaming text. Bind to a `fetched_sources` path populated by a `copilot` source.
|
|
262
|
-
```json
|
|
263
|
-
{ "kind": "narrative", "data": { "bind": "fetched_sources.raw" } }
|
|
264
|
-
```
|
|
265
|
-
Pair with `"features": { "refresh": true, "chat": true }` in `view`.
|
|
266
|
-
|
|
267
|
-
### `notes`
|
|
268
|
-
Editable free-text notes field (similar to markdown but editable by the user).
|
|
269
|
-
|
|
270
|
-
### `alert`
|
|
271
|
-
Alert/callout display element.
|
|
272
|
-
|
|
273
|
-
### `custom`
|
|
274
|
-
Custom element kind — behaviour defined by the host application.
|
|
275
|
-
|
|
276
|
-
### `ref`
|
|
277
|
-
Indirection element that resolves its rendered kind at runtime from any namespace variable. The card author declares the data source (`bind`) and where to look up the view definition (`viewBind`). The resolved view definition can come from `card_data` (user-selectable UI), `fetched_sources` (LLM-suggested), `requires` (cross-card), or `computed_values`.
|
|
278
|
-
|
|
279
|
-
**Resolved value shape:**
|
|
280
|
-
- A **string** — used directly as the element kind: `"table"`, `"chart"`, `"editable-table"`, etc.
|
|
281
|
-
- An **object** — `{ kind, label, data: { columns, chartType, chartOptions, writeTo, ... } }` — merged with the static elemDef (static fields always win, so card authors can fence LLM suggestions).
|
|
282
|
-
- `null`/`undefined` — falls back to `fallbackKind` or shape inference (`array→table`, `string→text`, `object→narrative`).
|
|
283
|
-
|
|
284
|
-
**Allowed kind values** (whitelist; unknown values fall to `table`):
|
|
285
|
-
`table`, `editable-table`, `chart`, `metric`, `list`, `badge`, `text`, `narrative`, `markdown`, `form`, `filter`, `todo`, `alert`
|
|
286
|
-
|
|
287
|
-
```json
|
|
288
|
-
{ "kind": "ref",
|
|
289
|
-
"label": "Trade Data",
|
|
290
|
-
"data": {
|
|
291
|
-
"bind": "fetched_sources.rebalance.proposed_trades",
|
|
292
|
-
"viewBind": "card_data.display_mode",
|
|
293
|
-
"fallbackKind": "table"
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
**Pattern 1 — User-selectable view (selector pattern)**
|
|
299
|
-
|
|
300
|
-
Pair a `form` element with a `ref` element. The form writes the chosen kind into `card_data`; the `ref` reads it back. The user can switch between table, chart, etc. with no card JSON changes:
|
|
301
|
-
|
|
302
|
-
```json
|
|
303
|
-
{ "kind": "form",
|
|
304
|
-
"data": {
|
|
305
|
-
"writeTo": "card_data.display_mode",
|
|
306
|
-
"fields": {
|
|
307
|
-
"type": "object",
|
|
308
|
-
"properties": {
|
|
309
|
-
"kind": { "type": "string", "title": "Display as",
|
|
310
|
-
"enum": ["table", "chart", "editable-table"] }
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
{ "kind": "ref",
|
|
316
|
-
"data": {
|
|
317
|
-
"bind": "fetched_sources.rebalance.proposed_trades",
|
|
318
|
-
"viewBind": "card_data.display_mode",
|
|
319
|
-
"fallbackKind": "table"
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
Note: `card_data.display_mode` can be a plain string (`"chart"`) or an object (`{ "kind": "chart", ... }`). Both are handled.
|
|
325
|
-
|
|
326
|
-
**Pattern 2 — LLM-suggested view (source carries `_view`)**
|
|
327
|
-
|
|
328
|
-
The LLM source response includes a `_view` key alongside the data. The `ref` element reads `_view` from the source namespace. The LLM decides chart vs table vs editable-table at runtime based on what the data looks like:
|
|
329
|
-
|
|
330
|
-
```json
|
|
331
|
-
// LLM returns:
|
|
332
|
-
{ "proposed_trades": [ {"ticker": "AAPL", "trade_value": 1084} ],
|
|
333
|
-
"_view": { "kind": "chart", "data": { "chartType": "bar", "columns": ["ticker","trade_value"] } }
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
// Card element:
|
|
337
|
-
{ "kind": "ref",
|
|
338
|
-
"data": {
|
|
339
|
-
"bind": "fetched_sources.rebalance.proposed_trades",
|
|
340
|
-
"viewBind": "fetched_sources.rebalance._view",
|
|
341
|
-
"fallbackKind": "table"
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
Add this to the `copilot` prompt template to instruct the LLM:
|
|
347
|
-
```
|
|
348
|
-
Return JSON with shape:
|
|
349
|
-
{
|
|
350
|
-
"<data_key>": [ ... ],
|
|
351
|
-
"_view": {
|
|
352
|
-
"kind": "editable-table" | "table" | "chart",
|
|
353
|
-
"data": {
|
|
354
|
-
// for editable-table: { "writeTo": "card_data.<key>", "columns": ["field1","field2"] }
|
|
355
|
-
// for chart: { "chartType": "bar" | "line" | "pie", "columns": ["labelField","valueField"] }
|
|
356
|
-
// for table: { "columns": ["field1","field2"] }
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
Choose kind based on data shape and user intent.
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
The `_view` key is ignored by any card that reads only `<data_key>` — it is inert to downstream cards.
|
|
364
|
-
|
|
365
|
-
**Pattern 3 — Cross-card view hint (view definition flows as a token)**
|
|
366
|
-
|
|
367
|
-
Card A provides both its data and the view hint as separate tokens. Card B requires both and uses `ref` to render whatever Card A’s LLM suggested:
|
|
368
|
-
|
|
369
|
-
```json
|
|
370
|
-
// Card A provides:
|
|
371
|
-
"provides": [
|
|
372
|
-
{ "bindTo": "trade_data", "ref": "fetched_sources.rebalance.proposed_trades" },
|
|
373
|
-
{ "bindTo": "trade_view", "ref": "fetched_sources.rebalance._view" }
|
|
374
|
-
]
|
|
375
|
-
|
|
376
|
-
// Card B requires and renders:
|
|
377
|
-
"requires": ["trade_data", "trade_view"],
|
|
378
|
-
"view": {
|
|
379
|
-
"elements": [
|
|
380
|
-
{ "kind": "ref",
|
|
381
|
-
"data": {
|
|
382
|
-
"bind": "requires.trade_data",
|
|
383
|
-
"viewBind": "requires.trade_view",
|
|
384
|
-
"fallbackKind": "table"
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
]
|
|
388
|
-
}
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
Card B’s author does not need to know what kind Card A’s LLM will choose. The view decision propagates through the token graph.
|
|
392
|
-
|
|
393
|
-
---
|
|
394
|
-
|
|
395
|
-
## Common Card Patterns
|
|
396
|
-
|
|
397
|
-
### Root source card
|
|
398
|
-
```
|
|
399
|
-
source_defs[mock/http/script] → fetched_sources.raw
|
|
400
|
-
provides: [{ bindTo: "orders", ref: "fetched_sources.raw" }]
|
|
401
|
-
view: table showing the raw data
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
### Compute chain card
|
|
405
|
-
```
|
|
406
|
-
requires: ["orders"]
|
|
407
|
-
compute: JSONata aggregation → computed_values.result
|
|
408
|
-
provides: [{ bindTo: "regionTotals", ref: "computed_values.result" }]
|
|
409
|
-
view: table or metric
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
### Multi-level chain (4 levels example)
|
|
413
|
-
```
|
|
414
|
-
card-source provides "orders"
|
|
415
|
-
card-totals requires "orders" provides "regionTotals"
|
|
416
|
-
card-top requires "regionTotals" provides "topRegion"
|
|
417
|
-
card-alert requires "topRegion", "regionTotals" (no further provides)
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
### Filter → filtered table
|
|
421
|
-
```
|
|
422
|
-
card-filter provides "selections" (src: card_data.fieldValues)
|
|
423
|
-
card-table requires "orders", "selections"
|
|
424
|
-
compute: $filter(requires.orders, fn → match selections)
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
### Form → dependent card
|
|
428
|
-
```
|
|
429
|
-
card-form provides "card-ex-form" (src: card_data)
|
|
430
|
-
card-child requires "card-ex-form"
|
|
431
|
-
compute: $lookup(requires, 'card-ex-form').prefs.field
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
### LLM verdict card (completion gating via source)
|
|
435
|
-
```
|
|
436
|
-
requires: ["some-data"]
|
|
437
|
-
source_defs: [{ bindTo: "verdict", outputFile: "...", copilot: { prompt_template: "..." } }]
|
|
438
|
-
compute: [{ bindTo: "isReady", expr: "fetched_sources.verdict.isTaskCompleted" }]
|
|
439
|
-
provides: [{ bindTo: "readiness-verdict", ref: "fetched_sources.verdict" }]
|
|
440
|
-
view: badge(computed_values.isReady, colorMap) + text(fetched_sources.verdict.reason)
|
|
441
|
-
```
|
|
442
|
-
The task executor calls the LLM, writes `{ isTaskCompleted: bool, reason: string }` to `--out`.
|
|
443
|
-
The card is complete when the source is fetched. Downstream cards `requires: ["readiness-verdict"]`.
|
|
444
|
-
|
|
445
|
-
### User-selectable view (selector + ref)
|
|
446
|
-
```
|
|
447
|
-
source_defs: fetch data into fetched_sources.raw
|
|
448
|
-
view:
|
|
449
|
-
form writeTo:card_data.display_mode (enum: table, chart, editable-table)
|
|
450
|
-
ref bind:fetched_sources.raw viewBind:card_data.display_mode fallbackKind:table
|
|
451
|
-
```
|
|
452
|
-
User picks the display kind from a dropdown; the `ref` element re-renders immediately.
|
|
453
|
-
No card JSON changes needed — the form + ref pair handles all switching.
|
|
454
|
-
|
|
455
|
-
### LLM-suggested view
|
|
456
|
-
```
|
|
457
|
-
source_defs: copilot source returns { data: [...], _view: { kind, data: {...} } }
|
|
458
|
-
view:
|
|
459
|
-
ref bind:fetched_sources.raw.data viewBind:fetched_sources.raw._view fallbackKind:table
|
|
460
|
-
```
|
|
461
|
-
LLM decides chart vs table vs editable-table at runtime. `_view` is ignored by downstream
|
|
462
|
-
cards that only read `data`. Card author can fence with static `columns` in the ref element data.
|
|
463
|
-
|
|
464
|
-
### Cross-card view propagation
|
|
465
|
-
```
|
|
466
|
-
Card A provides: trade_data (fetched_sources.rebalance.proposed_trades)
|
|
467
|
-
+ trade_view (fetched_sources.rebalance._view)
|
|
468
|
-
Card B requires: trade_data, trade_view
|
|
469
|
-
view: ref bind:requires.trade_data viewBind:requires.trade_view
|
|
470
|
-
```
|
|
471
|
-
Card B author writes no view knowledge — Card A's LLM drives the rendering decision for both cards.
|
|
472
|
-
|
|
473
|
-
---
|
|
474
|
-
|
|
475
|
-
## Card Design Principles & Layout
|
|
476
|
-
|
|
477
|
-
See [agent-instructions-cardlayout.md](agent-instructions-cardlayout.md).
|
|
478
|
-
|
|
479
|
-
---
|
|
480
|
-
|
|
481
|
-
## Source `customFields` and the Task Executor
|
|
482
|
-
|
|
483
|
-
Every field on a source entry beyond `bindTo` and `outputFile` is a **customField**. The runtime passes the entire source object unchanged to the registered task executor — the executor is the sole interpreter of these fields.
|
|
484
|
-
|
|
485
|
-
> **Key principle:** The card author and the task executor author must agree on which customFields are supported. If a card uses `"http": {...}` but the executor only handles `"mock"` and `"copilot"`, the source fetch will fail. The executor must be designed to handle every source kind combination used in your board's cards.
|
|
486
|
-
|
|
487
|
-
Common customField conventions (demo executor supports `mock` and `copilot`):
|
|
488
|
-
|
|
489
|
-
| Field | Meaning |
|
|
490
|
-
|---|---|
|
|
491
|
-
| `"mock": "key"` | Reads from `mock.db` by key — local dev only |
|
|
492
|
-
| `"copilot": { "prompt_template": "...", "args": {} }` | LLM call; `{{key}}` interpolated from `_projections` (named data projections declared in `projections`), then explicit `args` |
|
|
493
|
-
| `"prompt_template": "..."` | Shorthand top-level LLM call (equivalent to `copilot.prompt_template`) |
|
|
494
|
-
| `"http": { "url": "...", "method": "GET" }` | HTTP/REST — implement in your executor |
|
|
495
|
-
| `"graphapi": { "query": "..." }` | Microsoft Graph API — implement in your executor |
|
|
496
|
-
| `"script": { "path": "...", "args": {} }` | Local script — implement in your executor |
|
|
497
|
-
| `"teams"`, `"mail"`, `"incidentdb"` | Any domain integration — define in your executor |
|
|
498
|
-
|
|
499
|
-
Sources can access upstream data via the `projections` property — named JSONata projections from `card_data` or `requires` that the engine evaluates before invoking the executor. The executor receives `_projections` containing the resolved values. See [source_defs projections](#source_defs-projections) and [Task Executor Protocol](#task-executor-protocol) for details.
|
|
500
|
-
|
|
501
|
-
### source_defs projections
|
|
502
|
-
|
|
503
|
-
The optional `projections` map lets a source definition declare which upstream data it needs. Each key maps to a JSONata expression rooted at `card_data` or `requires`. The engine evaluates these before invoking the executor and attaches the results as `_projections` on the source payload.
|
|
504
|
-
|
|
505
|
-
```json
|
|
506
|
-
"source_defs": [
|
|
507
|
-
{
|
|
508
|
-
"bindTo": "quotes",
|
|
509
|
-
"outputFile": "quotes.json",
|
|
510
|
-
"projections": {
|
|
511
|
-
"holdings": "requires.holdings",
|
|
512
|
-
"url_list": "requires.holdings.ticker.('https://query1.finance.yahoo.com/v8/finance/chart/' & $ & '?interval=1d&range=1d')"
|
|
513
|
-
},
|
|
514
|
-
"url-list": {
|
|
515
|
-
"cacheTimeout": 3600
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
]
|
|
519
|
-
```
|
|
520
|
-
|
|
521
|
-
**Rules:**
|
|
522
|
-
- Only `card_data` and `requires` are valid namespaces in `projections` expressions
|
|
523
|
-
- `fetched_sources`, `computed_values`, and `source_defs` are **forbidden** in projections
|
|
524
|
-
- Full JSONata syntax is supported (same as `compute[].expr`)
|
|
525
|
-
- Sources without `projections` receive `_projections: {}` — executor must handle empty projections gracefully
|
|
526
|
-
- `tickersFrom: "refKey.fieldName"` reads from `_projections[refKey]` — the `projections` key must exist
|
|
527
|
-
|
|
528
|
-
### Optional source field
|
|
529
|
-
- `optionalForCompletionGating: true` — marks this source as optional for default task-completion gating. If set, the card can complete even if this source hasn't been fetched yet.
|
|
530
|
-
|
|
531
|
-
### Discovering supported source kinds
|
|
532
|
-
|
|
533
|
-
Rather than guessing which source `customFields` the registered executor supports, query it directly:
|
|
534
|
-
|
|
535
|
-
```bash
|
|
536
|
-
node board-live-cards-cli.js describe-task-executor-capabilities --rg <boardDir>
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
This invokes the executor's `describe-capabilities` subcommand and prints its capabilities JSON to stdout. The output includes:
|
|
540
|
-
- **`sourceKinds`** — every source kind the executor handles (e.g. `mock`, `copilot`, `workiq`, `url`, `url-list`), each with:
|
|
541
|
-
- `description` — what the kind does
|
|
542
|
-
- `inputSchema` — the exact `customFields` the executor expects on the source entry
|
|
543
|
-
- `outputShape` — the shape of the JSON written to `--out`
|
|
544
|
-
- `example` — sample input/output pair
|
|
545
|
-
- **`extraSchema`** — fields available via `--extra` (board topology context)
|
|
546
|
-
- **`subcommands`** — supported subcommands (typically `run-source-fetch` + `describe-capabilities`)
|
|
547
|
-
|
|
548
|
-
**Use this before authoring a card** to confirm the executor handles your intended source kind and to discover the correct field names and types. If the kind is missing from the output, the executor needs extending before the card will work.
|
|
549
|
-
|
|
550
|
-
Example output (excerpt):
|
|
551
|
-
```json
|
|
552
|
-
{
|
|
553
|
-
"sourceKinds": {
|
|
554
|
-
"mock": {
|
|
555
|
-
"description": "Look up a key in a hardcoded MOCK_DB dictionary.",
|
|
556
|
-
"inputSchema": { "mock": { "type": "string", "required": true } }
|
|
557
|
-
},
|
|
558
|
-
"copilot": {
|
|
559
|
-
"description": "Invoke GitHub Copilot CLI with an interpolated prompt template.",
|
|
560
|
-
"inputSchema": {
|
|
561
|
-
"copilot": { "type": "object", "properties": { "prompt_template": { "type": "string" } } }
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
## LLM Calls — Use a Source
|
|
569
|
-
|
|
570
|
-
**All LLM calls belong in source_defs[], handled by the task executor.** There is one mechanism for external calls — source_defs.
|
|
571
|
-
|
|
572
|
-
To incorporate LLM reasoning into a card:
|
|
573
|
-
|
|
574
|
-
1. Add a source entry with a `copilot` (or equivalent) customField and an `outputFile`.
|
|
575
|
-
2. The task executor calls the LLM and writes the result JSON to `--out`.
|
|
576
|
-
3. Card compute reads `fetched_sources.<bindTo>` and derives tokens from it.
|
|
577
|
-
4. The card provides those tokens downstream like any other.
|
|
578
|
-
|
|
579
|
-
```json
|
|
580
|
-
"source_defs": [
|
|
581
|
-
{
|
|
582
|
-
"bindTo": "verdict",
|
|
583
|
-
"outputFile": "my-card-verdict.json",
|
|
584
|
-
"copilot": {
|
|
585
|
-
"prompt_template": "Given this data: {{positions}} — is the portfolio sufficiently diversified? Return JSON: { \"isTaskCompleted\": bool, \"reason\": string }"
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
]
|
|
589
|
-
```
|
|
590
|
-
|
|
591
|
-
If the LLM needs computed values (which compute first), chain two cards: Card A computes → Card B `requires` Card A's provides → Card B's source calls the LLM with those values.
|
|
592
|
-
|
|
593
|
-
> **One mechanism for everything.** Sources → compute → provides is the complete model. Every card an agent authors follows this shape regardless of whether the data comes from a database, an API, or an LLM.
|
|
594
|
-
|
|
595
|
-
---
|
|
596
|
-
|
|
597
|
-
## Validating Cards
|
|
598
|
-
|
|
599
|
-
### CLI (recommended for authoring)
|
|
600
|
-
```bash
|
|
601
|
-
# Validate a single card
|
|
602
|
-
node board-live-cards-cli.js validate-card --card cards/my-card.json
|
|
603
|
-
|
|
604
|
-
# Validate all cards matching a glob
|
|
605
|
-
node board-live-cards-cli.js validate-card --card-glob "cards/*.json"
|
|
606
|
-
```
|
|
607
|
-
Checks JSON Schema structure, JSONata expression syntax in `compute[].expr`, and `provides[].ref` namespace validity. Reports per-file OK/FAIL with detailed errors. Exits with code 1 if any card fails.
|
|
608
|
-
|
|
609
|
-
### Programmatic
|
|
610
|
-
```typescript
|
|
611
|
-
import { validateLiveCardSchema } from 'yaml-flow/card-compute';
|
|
612
|
-
// or for the most thorough check:
|
|
613
|
-
import { validateLiveCardDefinition } from 'yaml-flow/src/card-compute/schema-validator.js';
|
|
614
|
-
|
|
615
|
-
const result = validateLiveCardDefinition(cardObject);
|
|
616
|
-
if (!result.ok) {
|
|
617
|
-
console.error(result.errors); // string[]
|
|
618
|
-
}
|
|
619
|
-
```
|
|
620
|
-
|
|
621
|
-
| Function | Validates |
|
|
622
|
-
|---|---|
|
|
623
|
-
| `validateLiveCardDefinition` | Full structural + schema check (most thorough, used by CLI) |
|
|
624
|
-
| `validateLiveCardSchema` | AJV JSON Schema check against `schema/live-cards.schema.json` |
|
|
625
|
-
| `validateLiveCardRuntimeExpressions` | JSONata expression syntax in `compute[].expr` |
|
|
626
|
-
| `validateLiveCard` | Basic structural shape check |
|
|
627
|
-
|
|
628
|
-
### Schema reference
|
|
629
|
-
When in doubt about allowed fields, consult:
|
|
630
|
-
- `yaml-flow/schema/live-cards.schema.json` — canonical JSON Schema for cards
|
|
631
|
-
- `yaml-flow/browser/live-cards.schema.json` — browser-bundled copy (same content)
|
|
632
|
-
|
|
633
|
-
### What the validator checks
|
|
634
|
-
- `id` required, non-empty string
|
|
635
|
-
- `card_data` required, must be an object
|
|
636
|
-
- `requires` must be array of strings (if present)
|
|
637
|
-
- `provides` must be array of `{ bindTo: string, ref: string }` (if present)
|
|
638
|
-
- `provides[].ref` must start with a valid namespace: `card_data`, `requires`, `fetched_sources`, or `computed_values`
|
|
639
|
-
- `compute[]` each entry must have `bindTo` + `expr` strings; `expr` must be valid JSONata
|
|
640
|
-
- `source_defs[]` each entry must have `bindTo` + `outputFile` strings; both must be unique across the array
|
|
641
|
-
- `view.elements` required, non-empty; each element must have a valid `kind`
|
|
642
|
-
- Top-level unknown keys are flagged as errors
|
|
643
|
-
- Valid element `kind` values: `metric`, `table`, `editable-table`, `chart`, `form`, `filter`, `list`, `notes`, `todo`, `alert`, `narrative`, `badge`, `text`, `markdown`, `ref`, `custom`
|
|
644
|
-
|
|
645
|
-
---
|
|
646
|
-
|
|
647
|
-
## mock.db
|
|
648
|
-
|
|
649
|
-
A JSON file at the board root keyed by mock name. Used by `"mock": "key"` source_defs. Replace with real task-executor integrations in production.
|
|
650
|
-
|
|
651
|
-
---
|
|
652
|
-
|
|
653
|
-
## Task Executor Protocol
|
|
654
|
-
|
|
655
|
-
The task executor is a **card-source-driven** component — its behaviour is determined entirely by the `customFields` defined on each card's `source_defs[]` entries. One executor is registered for the whole board, but it must know how to handle every source kind (`mock`, `copilot`, `http`, `graphapi`, etc.) used by any card on the board. The executor is the only handler where the card's source definition directly drives what the handler needs to do. It is registered once per board:
|
|
656
|
-
|
|
657
|
-
```bash
|
|
658
|
-
node board-live-cards-cli.js init ./my-board --task-executor ./my-executor.js
|
|
659
|
-
# stores path in <boardDir>/.task-executor
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
### Invocation
|
|
663
|
-
|
|
664
|
-
```bash
|
|
665
|
-
node <executor.js> run-source-fetch --in <source.json> --out <result.json> [--err <error.txt>]
|
|
666
|
-
```
|
|
667
|
-
|
|
668
|
-
- **`--in`** — path to a JSON file containing a single source object (one entry from `source_defs[]`), enriched by the runtime with extra context fields:
|
|
669
|
-
|
|
670
|
-
```json
|
|
671
|
-
{
|
|
672
|
-
"bindTo": "raw",
|
|
673
|
-
"outputFile": "my-card-raw.json",
|
|
674
|
-
"cwd": "/absolute/path/to/board",
|
|
675
|
-
"boardDir": "/absolute/path/to/board",
|
|
676
|
-
"_projections": { "holdings": [ ... ], "threshold": 0.05 },
|
|
677
|
-
/* ...any other customFields from the card source definition */
|
|
678
|
-
}
|
|
679
|
-
```
|
|
680
|
-
|
|
681
|
-
- `_projections` — resolved values for all entries declared in the source's `projections` map (evaluated from `card_data`/`requires` before executor invocation). Empty object `{}` if `projections` was not declared.
|
|
682
|
-
|
|
683
|
-
- **`--out`** — path to write the fetched value as raw JSON (any shape; stored under `fetched_sources.<bindTo>`)
|
|
684
|
-
- **`--err`** — optional path to write a plain-text error message on failure
|
|
685
|
-
|
|
686
|
-
### Supported source kinds (by convention)
|
|
687
|
-
|
|
688
|
-
| `customField` | Meaning |
|
|
689
|
-
|---|---|
|
|
690
|
-
| `"mock": "key"` | Lookup `key` in `mock.db` — local dev |
|
|
691
|
-
| `"copilot": { "prompt_template": "..." }` | LLM call; supports `{{key}}` interpolation against `_projections` |
|
|
692
|
-
| `"http": { "url": "...", "method": "GET" }` | HTTP/REST fetch |
|
|
693
|
-
| `"graphapi": { "query": "..." }` | Microsoft Graph API query |
|
|
694
|
-
| `"script": { "path": "...", "args": {} }` | Run a local script |
|
|
695
|
-
| `"teams"`, `"mail"`, `"incidentdb"` | Custom integrations in your executor |
|
|
696
|
-
|
|
697
|
-
All customFields are executor-defined — the runtime passes them through unchanged.
|
|
698
|
-
|
|
699
|
-
### Exit codes
|
|
700
|
-
- **0** — success; runtime reads `--out`
|
|
701
|
-
- **non-zero** — failure; runtime reads `--err` if present
|
|
702
|
-
|
|
703
|
-
### Probing a source before deploying
|
|
704
|
-
|
|
705
|
-
Before adding a card to a running board, agents should validate that each source can actually be fetched. Use the `probe-source` command — it reads the card file, extracts the source at the chosen index, builds the exact same `--in` payload the runtime would build, invokes the registered executor, and reports pass/fail.
|
|
706
|
-
|
|
707
|
-
```bash
|
|
708
|
-
node board-live-cards-cli.js probe-source \
|
|
709
|
-
--card cards/cardT-market-prices.json \
|
|
710
|
-
--source-idx 0 \
|
|
711
|
-
--rg <boardRuntimeDir> \
|
|
712
|
-
--mock-projections '{"holdings":[{"ticker":"AAPL","quantity":10},{"ticker":"MSFT","quantity":5}]}'
|
|
713
|
-
```
|
|
714
|
-
|
|
715
|
-
| Flag | Required | Description |
|
|
716
|
-
|---|---|---|
|
|
717
|
-
| `--card <card.json>` | yes | Path to the card file to probe |
|
|
718
|
-
| `--source-idx <n>` | no (default 0) | 0-based index into `source_defs[]` |
|
|
719
|
-
| `--source-bind <name>` | no | Select source by `bindTo` name instead of index |
|
|
720
|
-
| `--mock-projections <json>` | no | JSON string (or `@file.json`) providing the `_projections` values the source needs. If omitted, `_projections` is `{}`. |
|
|
721
|
-
| `--rg <boardDir>` | no | Board runtime directory used to locate `.task-executor`. Defaults to the card file's directory. |
|
|
722
|
-
| `--out <result.json>` | no | Write the raw fetch result to this path |
|
|
723
|
-
|
|
724
|
-
**Output:** the command prints a human-readable report ending with a machine-readable `[probe-source:result]` JSON line. Exit `0` = `PROBE_PASS`, exit `1` = `PROBE_FAIL`.
|
|
725
|
-
|
|
726
|
-
**`--mock-projections` is the agent's responsibility.** Craft the minimal payload that exercises the source — for example, if the card declares `"projections": { "holdings": "requires.holdings" }` and the source uses `tickersFrom: "holdings.ticker"`, supply `{"holdings":[{"ticker":"AAPL","quantity":1}]}`.
|
|
727
|
-
|
|
728
|
-
**Workflow for agents authoring a new card:**
|
|
729
|
-
1. **Discover available source kinds** — run `describe-task-executor-capabilities` to see exactly which source kinds the registered executor supports, their required `customFields`, and expected output shapes. Only use source kinds present in this output.
|
|
730
|
-
```bash
|
|
731
|
-
node board-live-cards-cli.js describe-task-executor-capabilities --rg <boardDir>
|
|
732
|
-
```
|
|
733
|
-
2. **Author the card JSON** with `source_defs[]`, `compute[]`, `provides[]`, and `view` using only the source kinds confirmed in step 1.
|
|
734
|
-
3. **Validate the card structure** — run `validate-card` to catch schema errors, invalid JSONata expressions, and namespace violations before attempting any live fetch.
|
|
735
|
-
```bash
|
|
736
|
-
node board-live-cards-cli.js validate-card --card cards/my-card.json
|
|
737
|
-
```
|
|
738
|
-
Fix any reported errors and re-run until validation passes.
|
|
739
|
-
4. **Probe each source** — run `probe-source` with representative `--mock-projections` data to confirm the executor can successfully fetch each source.
|
|
740
|
-
5. If `PROBE_PASS` → proceed with `upsert-card`.
|
|
741
|
-
6. If `PROBE_FAIL` → inspect the error, fix the source definition or executor, retry from step 3.
|
|
742
|
-
|
|
743
|
-
**Workflow for agents editing an existing card:**
|
|
744
|
-
1. Make the change to the card JSON.
|
|
745
|
-
2. **Validate immediately** — run `validate-card` after every edit.
|
|
746
|
-
```bash
|
|
747
|
-
node board-live-cards-cli.js validate-card --card cards/my-card.json
|
|
748
|
-
```
|
|
749
|
-
3. If validation fails, fix the reported errors and re-run — repeat until the card is clean.
|
|
750
|
-
4. If the change touches a `source_defs[]` entry, also run `probe-source` to confirm the source still fetches correctly before deploying.
|
|
751
|
-
|
|
752
|
-
---
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
---
|
|
757
|
-
|
|
758
|
-
## Chat Handler Protocol
|
|
759
|
-
|
|
760
|
-
The chat handler is a **universal LLM component** — it does not depend on card source_defs, card model fields, or board state. Its sole job is: read the conversation, call the LLM, write the response.
|
|
761
|
-
|
|
762
|
-
Enable chat on a card by setting `"chat": true` in the card's `view.features`:
|
|
763
|
-
```json
|
|
764
|
-
"view": {
|
|
765
|
-
"features": { "chat": true }
|
|
766
|
-
}
|
|
767
|
-
```
|
|
768
|
-
|
|
769
|
-
Register once per board:
|
|
770
|
-
```bash
|
|
771
|
-
node board-live-cards-cli.js init ./my-board --chat-handler ./my-chat-handler.js
|
|
772
|
-
# stores path in <boardDir>/.chat-handler
|
|
773
|
-
```
|
|
774
|
-
|
|
775
|
-
### Invocation
|
|
776
|
-
|
|
777
|
-
```bash
|
|
778
|
-
node <handler.js> --boardId <id> --cardId <id> --extraEncJson <base64json>
|
|
779
|
-
```
|
|
780
|
-
|
|
781
|
-
- **`--boardId`** — board identifier
|
|
782
|
-
- **`--cardId`** — the specific card where the user clicked the chat button
|
|
783
|
-
- **`--extraEncJson`** — base64-encoded JSON: `{ boardSetupRoot, boardRuntimeDir, runtimeStatusDir, cardsDir, chatDir, chatProcessingMarkerKey, lastChatFile, serverUrl? }`
|
|
784
|
-
- `boardSetupRoot` — absolute board setup root (parent of runtime/surface/runtime-out)
|
|
785
|
-
- `boardRuntimeDir` — relative runtime path (for example `runtime`)
|
|
786
|
-
- `runtimeStatusDir` — relative runtime-out path
|
|
787
|
-
- `cardsDir` — relative cards root path (for example `surface/tmp-cards`)
|
|
788
|
-
- `chatDir` — absolute path to the directory holding all chat message files for this card
|
|
789
|
-
- `chatProcessingMarkerKey` — relative key for `.processing` marker under cardsDir (for example `card-portfolio/.processing`)
|
|
790
|
-
- `lastChatFile` — filename of the user message just written (e.g. `007_user.txt`)
|
|
791
|
-
- `serverUrl` — optional base URL of the hosting server
|
|
792
|
-
|
|
793
|
-
### Chat message files
|
|
794
|
-
|
|
795
|
-
Messages are stored as serial-numbered `.txt` files in `chatDir`:
|
|
796
|
-
- `001_user.txt`, `002-assistant.txt`, `003_user.txt`, … (alternating)
|
|
797
|
-
- The handler reads **all** files to reconstruct conversation history, writes the next `<serial>-assistant.txt`
|
|
798
|
-
|
|
799
|
-
### What the handler must do
|
|
800
|
-
|
|
801
|
-
1. Read all `*_user.txt` / `*-assistant.txt` files from `chatDir` (sorted) → conversation history
|
|
802
|
-
2. Build a system prompt scoped to `cardId` / `boardId` as grounding context
|
|
803
|
-
3. Call the LLM directly (e.g. Copilot CLI) with `cwd: boardSetupRoot` — running from board setup root gives natural file context for runtime, cards, and outputs
|
|
804
|
-
4. Write the response to `<nextSerial>-assistant.txt` in `chatDir`
|
|
805
|
-
5. Remove `.processing` marker using `chatProcessingMarkerKey` (fallback: `chatDir/.processing`)
|
|
806
|
-
|
|
807
|
-
### System prompt guidance
|
|
808
|
-
|
|
809
|
-
The chat is always scoped to the card where the chat button is embedded. The LLM should:
|
|
810
|
-
- Help the user understand, explore, or act on **that card's data**
|
|
811
|
-
- Be concise — this is an inline embedded chat, not a full conversation window
|
|
812
|
-
- Reference specific values when answering
|
|
813
|
-
- Ask one short clarifying question if intent is ambiguous
|
|
814
|
-
|
|
815
|
-
```javascript
|
|
816
|
-
// Minimal system prompt example:
|
|
817
|
-
`You are a helpful assistant embedded in a live data card (card: "${cardId}", board: "${boardId}").
|
|
818
|
-
Help the user understand and act on the data shown in this card.
|
|
819
|
-
Be concise. Ground answers in the card's data context.`
|
|
820
|
-
```
|
|
821
|
-
|
|
822
|
-
### LLM invocation
|
|
823
|
-
|
|
824
|
-
Call Copilot CLI directly from `boardSetupRoot` — same pattern as `demo-task-executor.js`:
|
|
825
|
-
```javascript
|
|
826
|
-
execFileSync(copilotBin, ['--allow-all'], {
|
|
827
|
-
input: fullPrompt,
|
|
828
|
-
encoding: 'utf-8',
|
|
829
|
-
cwd: boardSetupRoot, // ← run from setup root for natural file context
|
|
830
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
831
|
-
});
|
|
832
|
-
```
|
|
833
|
-
|
|
834
|
-
No rule-based fallback needed. If the LLM fails, write a short acknowledgment message so the user sees something rather than silence.
|