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,254 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Graph-of-Graphs Example: URL Processing Pipeline
|
|
3
|
-
*
|
|
4
|
-
* Models the super-agent pattern: an outer event-graph orchestrates
|
|
5
|
-
* coarse pipeline stages. The "evidence-gathering" stage fans out into
|
|
6
|
-
* a batch where each URL item runs through its own inner event-graph DAG.
|
|
7
|
-
*
|
|
8
|
-
* Outer graph:
|
|
9
|
-
* prep → copy-inputs → evidence-batch → analyze → archive
|
|
10
|
-
*
|
|
11
|
-
* Inner graph (per URL):
|
|
12
|
-
* url-connects ──→ webpage-opens ──→ content-downloads → security-analyzer
|
|
13
|
-
* └──→ redirect-analyzer ─────────────────┘
|
|
14
|
-
*
|
|
15
|
-
* Demonstrates:
|
|
16
|
-
* - Event-graph as outer orchestrator
|
|
17
|
-
* - batch() with an inner event-graph processor
|
|
18
|
-
* - resolveVariables() for per-item config
|
|
19
|
-
* - resolveConfigTemplates() for DRY task configs
|
|
20
|
-
* - Parallel fan-out inside inner graph
|
|
21
|
-
*
|
|
22
|
-
* Run with: npx tsx examples/npm-libs/graph-of-graphs/url-processing-pipeline.ts
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
next, apply, createInitialExecutionState,
|
|
27
|
-
} from '../../src/event-graph/index.js';
|
|
28
|
-
import { batch } from '../../src/batch/index.js';
|
|
29
|
-
import { resolveVariables, resolveConfigTemplates } from '../../src/config/index.js';
|
|
30
|
-
import type { GraphConfig } from '../../src/event-graph/types.js';
|
|
31
|
-
|
|
32
|
-
// ============================================================================
|
|
33
|
-
// 1. Inner graph config — evidence gathering per URL
|
|
34
|
-
// Uses config-templates and ${ENTITY_ID} variables
|
|
35
|
-
// ============================================================================
|
|
36
|
-
|
|
37
|
-
const innerGraphTemplate: Record<string, unknown> = {
|
|
38
|
-
id: 'url-evidence-gatherer',
|
|
39
|
-
'config-templates': {
|
|
40
|
-
'PYTHON-TOOL': { cmd: 'python', timeout: 30000, cwd: '/workdata' },
|
|
41
|
-
},
|
|
42
|
-
settings: {
|
|
43
|
-
completion: 'only-dependency-resolved-outputs' as const,
|
|
44
|
-
conflict_strategy: 'alphabetical' as const,
|
|
45
|
-
},
|
|
46
|
-
tasks: {
|
|
47
|
-
'url-connects': {
|
|
48
|
-
provides: ['connection-evidence'],
|
|
49
|
-
config: {
|
|
50
|
-
'config-template': 'PYTHON-TOOL',
|
|
51
|
-
'cmd-args': 'url-connects.py ${ENTITY_ID}-input.json ${ENTITY_ID}-connection.json',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
'webpage-opens': {
|
|
55
|
-
requires: ['connection-evidence'],
|
|
56
|
-
provides: ['webpage-evidence'],
|
|
57
|
-
config: {
|
|
58
|
-
'config-template': 'PYTHON-TOOL',
|
|
59
|
-
'cmd-args': 'webpage-opens.py ${ENTITY_ID}-input.json ${ENTITY_ID}-webpage.json',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
'redirect-analyzer': {
|
|
63
|
-
requires: ['connection-evidence'],
|
|
64
|
-
provides: ['redirect-evidence'],
|
|
65
|
-
config: {
|
|
66
|
-
'config-template': 'PYTHON-TOOL',
|
|
67
|
-
'cmd-args': 'redirect-analyzer.py ${ENTITY_ID}-input.json ${ENTITY_ID}-redirect.json',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
'content-downloads': {
|
|
71
|
-
requires: ['webpage-evidence'],
|
|
72
|
-
provides: ['content-evidence'],
|
|
73
|
-
config: {
|
|
74
|
-
'config-template': 'PYTHON-TOOL',
|
|
75
|
-
'cmd-args': 'content-downloads.py ${ENTITY_ID}-input.json ${ENTITY_ID}-content.json',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
'security-analyzer': {
|
|
79
|
-
requires: ['content-evidence'],
|
|
80
|
-
provides: ['security-evidence'],
|
|
81
|
-
config: {
|
|
82
|
-
'config-template': 'PYTHON-TOOL',
|
|
83
|
-
'cmd-args': 'security-analyzer.py ${ENTITY_ID}-input.json ${ENTITY_ID}-security.json',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// ============================================================================
|
|
90
|
-
// 2. Outer graph — pipeline orchestration
|
|
91
|
-
// ============================================================================
|
|
92
|
-
|
|
93
|
-
const outerGraph: GraphConfig = {
|
|
94
|
-
id: 'url-processing-pipeline',
|
|
95
|
-
settings: {
|
|
96
|
-
completion: 'all-tasks-complete',
|
|
97
|
-
},
|
|
98
|
-
tasks: {
|
|
99
|
-
'prep-workdata': {
|
|
100
|
-
provides: ['workdata-prepared'],
|
|
101
|
-
},
|
|
102
|
-
'copy-input-files': {
|
|
103
|
-
requires: ['workdata-prepared'],
|
|
104
|
-
provides: ['input-files-copied'],
|
|
105
|
-
},
|
|
106
|
-
'evidence-gathering-batch': {
|
|
107
|
-
requires: ['input-files-copied'],
|
|
108
|
-
provides: ['evidence-complete'],
|
|
109
|
-
},
|
|
110
|
-
'analyze-results': {
|
|
111
|
-
requires: ['evidence-complete'],
|
|
112
|
-
provides: ['analysis-complete'],
|
|
113
|
-
},
|
|
114
|
-
'archive-results': {
|
|
115
|
-
requires: ['analysis-complete'],
|
|
116
|
-
provides: ['pipeline-done'],
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// ============================================================================
|
|
122
|
-
// 3. Simulated task executors
|
|
123
|
-
// ============================================================================
|
|
124
|
-
|
|
125
|
-
/** Simulate executing an inner graph task (in real life: spawn python, call API, etc.) */
|
|
126
|
-
async function executeInnerTask(taskName: string, entityId: string): Promise<string> {
|
|
127
|
-
await new Promise((r) => setTimeout(r, 10 + Math.random() * 30));
|
|
128
|
-
return 'success';
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/** Run one URL item through the inner evidence-gathering graph */
|
|
132
|
-
async function runInnerGraph(item: { id: string; url: string }) {
|
|
133
|
-
// Step 1: resolve templates (expand config-template references)
|
|
134
|
-
const templated = resolveConfigTemplates(innerGraphTemplate);
|
|
135
|
-
// Step 2: resolve variables (per-item ENTITY_ID)
|
|
136
|
-
const config = resolveVariables(templated, { ENTITY_ID: item.id }) as unknown as GraphConfig;
|
|
137
|
-
|
|
138
|
-
// Step 3: drive the inner event-graph
|
|
139
|
-
let state = createInitialExecutionState(config, `inner-${item.id}`);
|
|
140
|
-
const taskResults: Record<string, string> = {};
|
|
141
|
-
|
|
142
|
-
while (true) {
|
|
143
|
-
const { eligibleTasks, isComplete } = next(config, state);
|
|
144
|
-
if (isComplete) break;
|
|
145
|
-
if (eligibleTasks.length === 0) break; // stuck
|
|
146
|
-
|
|
147
|
-
// Run eligible tasks in parallel (they're independent by definition)
|
|
148
|
-
await Promise.all(
|
|
149
|
-
eligibleTasks.map(async (taskName) => {
|
|
150
|
-
state = apply(state, { type: 'task-started', taskName, timestamp: new Date().toISOString() }, config);
|
|
151
|
-
try {
|
|
152
|
-
const result = await executeInnerTask(taskName, item.id);
|
|
153
|
-
taskResults[taskName] = result;
|
|
154
|
-
state = apply(state, { type: 'task-completed', taskName, result, timestamp: new Date().toISOString() }, config);
|
|
155
|
-
} catch (err: any) {
|
|
156
|
-
state = apply(state, { type: 'task-failed', taskName, error: err.message, timestamp: new Date().toISOString() }, config);
|
|
157
|
-
}
|
|
158
|
-
}),
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return { entityId: item.id, tokens: state.availableOutputs, taskResults };
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// ============================================================================
|
|
166
|
-
// 4. Outer graph handlers
|
|
167
|
-
// ============================================================================
|
|
168
|
-
|
|
169
|
-
const urlItems = [
|
|
170
|
-
{ id: 'url-001', url: 'https://example.com/page1' },
|
|
171
|
-
{ id: 'url-002', url: 'https://example.com/page2' },
|
|
172
|
-
{ id: 'url-003', url: 'https://suspicious-site.xyz' },
|
|
173
|
-
{ id: 'url-004', url: 'https://example.com/page3' },
|
|
174
|
-
{ id: 'url-005', url: 'https://phishy-login.net/verify' },
|
|
175
|
-
{ id: 'url-006', url: 'https://example.com/page4' },
|
|
176
|
-
];
|
|
177
|
-
|
|
178
|
-
let pipelineContext: Record<string, unknown> = {};
|
|
179
|
-
|
|
180
|
-
const outerHandlers: Record<string, () => Promise<void>> = {
|
|
181
|
-
'prep-workdata': async () => {
|
|
182
|
-
console.log(' [prep] Creating fresh workdata directory');
|
|
183
|
-
await new Promise((r) => setTimeout(r, 20));
|
|
184
|
-
},
|
|
185
|
-
'copy-input-files': async () => {
|
|
186
|
-
console.log(` [copy] Processing ${urlItems.length} URL items`);
|
|
187
|
-
await new Promise((r) => setTimeout(r, 20));
|
|
188
|
-
},
|
|
189
|
-
'evidence-gathering-batch': async () => {
|
|
190
|
-
console.log(` [evidence-batch] Running ${urlItems.length} items through inner graph (concurrency: 3)`);
|
|
191
|
-
const result = await batch(urlItems, {
|
|
192
|
-
concurrency: 3,
|
|
193
|
-
processor: runInnerGraph,
|
|
194
|
-
onItemComplete: (item, res) => {
|
|
195
|
-
console.log(` ✓ ${item.id}: ${res.tokens.length} tokens collected — [${res.tokens.join(', ')}]`);
|
|
196
|
-
},
|
|
197
|
-
onItemError: (item, err) => {
|
|
198
|
-
console.log(` ✗ ${item.id}: ${err.message}`);
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
pipelineContext['evidenceResults'] = result;
|
|
202
|
-
console.log(` [evidence-batch] Done: ${result.completed}/${result.total} succeeded (${result.durationMs}ms)`);
|
|
203
|
-
},
|
|
204
|
-
'analyze-results': async () => {
|
|
205
|
-
console.log(' [analyze] Comparing evidence against expected grades');
|
|
206
|
-
await new Promise((r) => setTimeout(r, 20));
|
|
207
|
-
},
|
|
208
|
-
'archive-results': async () => {
|
|
209
|
-
console.log(' [archive] Moving results to output directory');
|
|
210
|
-
await new Promise((r) => setTimeout(r, 20));
|
|
211
|
-
},
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
// ============================================================================
|
|
215
|
-
// 5. Drive the outer graph
|
|
216
|
-
// ============================================================================
|
|
217
|
-
|
|
218
|
-
async function main() {
|
|
219
|
-
console.log('=== URL Processing Pipeline (Graph-of-Graphs) ===\n');
|
|
220
|
-
console.log(`Outer graph: ${Object.keys(outerGraph.tasks).length} stages`);
|
|
221
|
-
console.log(`Inner graph: ${Object.keys(innerGraphTemplate.tasks as any).length} evidence tasks per URL`);
|
|
222
|
-
console.log(`URL items: ${urlItems.length}\n`);
|
|
223
|
-
|
|
224
|
-
let state = createInitialExecutionState(outerGraph, 'pipeline-run-1');
|
|
225
|
-
const now = () => new Date().toISOString();
|
|
226
|
-
|
|
227
|
-
while (true) {
|
|
228
|
-
const { eligibleTasks, isComplete } = next(outerGraph, state);
|
|
229
|
-
if (isComplete) break;
|
|
230
|
-
if (eligibleTasks.length === 0) {
|
|
231
|
-
console.log('\nPipeline stuck!');
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Run eligible outer tasks (sequential or parallel depending on graph shape)
|
|
236
|
-
await Promise.all(
|
|
237
|
-
eligibleTasks.map(async (taskName) => {
|
|
238
|
-
console.log(`\n▶ ${taskName}`);
|
|
239
|
-
state = apply(state, { type: 'task-started', taskName, timestamp: now() }, outerGraph);
|
|
240
|
-
try {
|
|
241
|
-
await outerHandlers[taskName]();
|
|
242
|
-
state = apply(state, { type: 'task-completed', taskName, timestamp: now() }, outerGraph);
|
|
243
|
-
} catch (err: any) {
|
|
244
|
-
state = apply(state, { type: 'task-failed', taskName, error: err.message, timestamp: now() }, outerGraph);
|
|
245
|
-
}
|
|
246
|
-
}),
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
console.log('\n=== Pipeline Complete ===');
|
|
251
|
-
console.log('Available tokens:', state.availableOutputs);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
main().catch(console.error);
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inference Example: Azure Deployment Pipeline
|
|
3
|
-
*
|
|
4
|
-
* Demonstrates LLM-assisted completion detection for a CI/CD workflow.
|
|
5
|
-
* The graph has 3 checkpoints. After deployment, the LLM analyzes
|
|
6
|
-
* logs and determines what's complete.
|
|
7
|
-
*
|
|
8
|
-
* Run with: npx tsx examples/npm-libs/inference/azure-deployment.ts
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
createLiveGraph,
|
|
13
|
-
schedule,
|
|
14
|
-
} from '../../src/continuous-event-graph/index.js';
|
|
15
|
-
import {
|
|
16
|
-
inferAndApply,
|
|
17
|
-
buildInferencePrompt,
|
|
18
|
-
} from '../../src/inference/index.js';
|
|
19
|
-
import type { InferenceAdapter } from '../../src/inference/index.js';
|
|
20
|
-
import type { GraphConfig } from '../../src/continuous-event-graph/types.js';
|
|
21
|
-
|
|
22
|
-
// ============================================================================
|
|
23
|
-
// 1. Define the graph with inference hints
|
|
24
|
-
// ============================================================================
|
|
25
|
-
|
|
26
|
-
const config: GraphConfig = {
|
|
27
|
-
settings: { completion: 'all-tasks' },
|
|
28
|
-
tasks: {
|
|
29
|
-
'infra-provisioned': {
|
|
30
|
-
provides: ['infra-ready'],
|
|
31
|
-
description: 'Azure infrastructure setup',
|
|
32
|
-
inference: {
|
|
33
|
-
criteria: 'All Azure resources provisioned successfully',
|
|
34
|
-
keywords: ['azure', 'resource-group', 'provisioning', 'deployment'],
|
|
35
|
-
suggestedChecks: [
|
|
36
|
-
'scan logs for "Deployment Succeeded"',
|
|
37
|
-
'verify resource group exists',
|
|
38
|
-
],
|
|
39
|
-
autoDetectable: true,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
'app-deployed': {
|
|
43
|
-
requires: ['infra-ready'],
|
|
44
|
-
provides: ['app-ready'],
|
|
45
|
-
description: 'Application code deployed and running',
|
|
46
|
-
inference: {
|
|
47
|
-
criteria: 'Application health check returns HTTP 200',
|
|
48
|
-
keywords: ['nodejs', 'health-check', 'deploy'],
|
|
49
|
-
suggestedChecks: ['HTTP 200 from /health endpoint'],
|
|
50
|
-
autoDetectable: true,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
'monitoring-enabled': {
|
|
54
|
-
requires: ['app-ready'],
|
|
55
|
-
provides: ['monitored'],
|
|
56
|
-
description: 'Metrics and alerts configured',
|
|
57
|
-
inference: {
|
|
58
|
-
criteria: 'Application Insights receiving metrics and alerts configured',
|
|
59
|
-
keywords: ['monitoring', 'metrics', 'alerts', 'insights'],
|
|
60
|
-
suggestedChecks: ['verify metrics flowing', 'test alert rules'],
|
|
61
|
-
autoDetectable: true,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// ============================================================================
|
|
68
|
-
// 2. Create a mock LLM adapter (swap with real OpenAI/Azure/Anthropic in prod)
|
|
69
|
-
// ============================================================================
|
|
70
|
-
|
|
71
|
-
const mockDeploymentAdapter: InferenceAdapter = {
|
|
72
|
-
analyze: async (prompt: string) => {
|
|
73
|
-
// In production, this would call your LLM:
|
|
74
|
-
// const response = await openai.chat.completions.create({ model: 'gpt-4o', messages: [...] });
|
|
75
|
-
// return response.choices[0].message.content;
|
|
76
|
-
|
|
77
|
-
console.log('\n📝 Prompt sent to LLM (first 200 chars):');
|
|
78
|
-
console.log(prompt.substring(0, 200) + '...\n');
|
|
79
|
-
|
|
80
|
-
// Simulated LLM response based on deployment logs
|
|
81
|
-
return JSON.stringify([
|
|
82
|
-
{
|
|
83
|
-
taskName: 'infra-provisioned',
|
|
84
|
-
confidence: 0.95,
|
|
85
|
-
reasoning: 'Deployment log explicitly states "Deployment Succeeded" and lists all provisioned resources including App Service, Storage, and Application Insights.',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
taskName: 'app-deployed',
|
|
89
|
-
confidence: 0.88,
|
|
90
|
-
reasoning: 'Health check endpoint returned HTTP 200 OK. The app appears to be running successfully.',
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
taskName: 'monitoring-enabled',
|
|
94
|
-
confidence: 0.15,
|
|
95
|
-
reasoning: 'No evidence of metrics flowing or alerts being configured. The Application Insights resource exists but may not be receiving data yet.',
|
|
96
|
-
},
|
|
97
|
-
]);
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// ============================================================================
|
|
102
|
-
// 3. Run the inference pipeline
|
|
103
|
-
// ============================================================================
|
|
104
|
-
|
|
105
|
-
async function main() {
|
|
106
|
-
let live = createLiveGraph(config);
|
|
107
|
-
console.log('=== Azure Deployment Pipeline with LLM Inference ===');
|
|
108
|
-
console.log('Initial schedule:', schedule(live).eligible);
|
|
109
|
-
|
|
110
|
-
// The deployment logs arrive (this would come from your CI/CD system)
|
|
111
|
-
const deploymentLogs = `
|
|
112
|
-
[2025-11-16T10:30:00Z] Azure CLI: Deployment Succeeded
|
|
113
|
-
[2025-11-16T10:30:01Z] Resource Group: swarmx-rg-001 (eastus)
|
|
114
|
-
[2025-11-16T10:30:02Z] Resources: App Service Plan, Web App, Application Insights, Storage Account
|
|
115
|
-
[2025-11-16T10:31:00Z] App deployed to: https://swarmx-webapp-prod.azurewebsites.net
|
|
116
|
-
[2025-11-16T10:31:05Z] Health check: GET /health → HTTP 200 OK
|
|
117
|
-
`.trim();
|
|
118
|
-
|
|
119
|
-
// Ask the LLM to analyze the evidence
|
|
120
|
-
const result = await inferAndApply(live, mockDeploymentAdapter, {
|
|
121
|
-
threshold: 0.8,
|
|
122
|
-
context: deploymentLogs,
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// Report
|
|
126
|
-
console.log('\n=== LLM Analysis Results ===');
|
|
127
|
-
console.log(`Analyzed nodes: ${result.inference.analyzedNodes.join(', ')}`);
|
|
128
|
-
|
|
129
|
-
console.log('\n Applied (above threshold):');
|
|
130
|
-
for (const s of result.applied) {
|
|
131
|
-
console.log(` ✅ ${s.taskName} (${(s.confidence * 100).toFixed(0)}%): ${s.reasoning}`);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
console.log('\n Skipped (below threshold):');
|
|
135
|
-
for (const s of result.skipped) {
|
|
136
|
-
console.log(` ⏭️ ${s.taskName} (${(s.confidence * 100).toFixed(0)}%): ${s.reasoning}`);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Updated graph state
|
|
140
|
-
live = result.live;
|
|
141
|
-
console.log('\n=== Updated Graph State ===');
|
|
142
|
-
console.log('infra-provisioned:', live.state.tasks['infra-provisioned'].status);
|
|
143
|
-
console.log('app-deployed:', live.state.tasks['app-deployed'].status);
|
|
144
|
-
console.log('monitoring-enabled:', live.state.tasks['monitoring-enabled'].status);
|
|
145
|
-
console.log('Now eligible:', schedule(live).eligible);
|
|
146
|
-
console.log('Available tokens:', live.state.availableOutputs);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
main().catch(console.error);
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inference Example: GitHub Copilot CLI
|
|
3
|
-
*
|
|
4
|
-
* Uses createCliAdapter to pipe prompts directly to `copilot --allow-all`
|
|
5
|
-
* via stdin and capture the LLM response from stdout.
|
|
6
|
-
*
|
|
7
|
-
* Prerequisites:
|
|
8
|
-
* - GitHub Copilot CLI installed (comes with VS Code / GitHub Copilot extension)
|
|
9
|
-
* - `copilot` available on PATH
|
|
10
|
-
*
|
|
11
|
-
* Run with: npx tsx examples/npm-libs/inference/copilot-cli.ts
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { createLiveGraph, schedule } from '../../src/continuous-event-graph/index.js';
|
|
15
|
-
import {
|
|
16
|
-
buildInferencePrompt,
|
|
17
|
-
inferCompletions,
|
|
18
|
-
applyInferences,
|
|
19
|
-
createCliAdapter,
|
|
20
|
-
} from '../../src/inference/index.js';
|
|
21
|
-
import type { GraphConfig } from '../../src/continuous-event-graph/types.js';
|
|
22
|
-
|
|
23
|
-
// ============================================================================
|
|
24
|
-
// 1. Create a Copilot adapter — just 4 lines
|
|
25
|
-
// ============================================================================
|
|
26
|
-
|
|
27
|
-
const copilotAdapter = createCliAdapter({
|
|
28
|
-
command: 'copilot',
|
|
29
|
-
args: () => ['--allow-all'],
|
|
30
|
-
stdin: true, // pipe prompt via stdin (handles long prompts)
|
|
31
|
-
timeout: 120_000, // copilot can be slow on first call
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// ============================================================================
|
|
35
|
-
// 2. Define a deployment pipeline with inference hints
|
|
36
|
-
// ============================================================================
|
|
37
|
-
|
|
38
|
-
const config: GraphConfig = {
|
|
39
|
-
settings: { completion: 'all-tasks' },
|
|
40
|
-
tasks: {
|
|
41
|
-
'code-reviewed': {
|
|
42
|
-
provides: ['review-done'],
|
|
43
|
-
description: 'Code review completed and approved',
|
|
44
|
-
inference: {
|
|
45
|
-
criteria: 'PR has at least 2 approvals and no blocking comments',
|
|
46
|
-
keywords: ['pull-request', 'approval', 'code-review'],
|
|
47
|
-
autoDetectable: true,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
'tests-passed': {
|
|
51
|
-
requires: ['review-done'],
|
|
52
|
-
provides: ['tests-green'],
|
|
53
|
-
description: 'All CI tests passing with adequate coverage',
|
|
54
|
-
inference: {
|
|
55
|
-
criteria: 'CI pipeline green, all tests pass, coverage > 80%',
|
|
56
|
-
keywords: ['ci', 'tests', 'pipeline', 'coverage'],
|
|
57
|
-
autoDetectable: true,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
'security-scan-clean': {
|
|
61
|
-
requires: ['review-done'],
|
|
62
|
-
provides: ['security-ok'],
|
|
63
|
-
description: 'Security scanning reveals no critical issues',
|
|
64
|
-
inference: {
|
|
65
|
-
criteria: 'No critical or high severity vulnerabilities found',
|
|
66
|
-
keywords: ['security', 'scan', 'vulnerability', 'CVE'],
|
|
67
|
-
autoDetectable: true,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
'deployed-staging': {
|
|
71
|
-
requires: ['tests-green', 'security-ok'],
|
|
72
|
-
provides: ['staging-live'],
|
|
73
|
-
description: 'Deployed to staging and health checks passing',
|
|
74
|
-
inference: {
|
|
75
|
-
criteria: 'Staging URL returns HTTP 200 with expected version',
|
|
76
|
-
keywords: ['staging', 'deployment', 'health-check'],
|
|
77
|
-
autoDetectable: true,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// ============================================================================
|
|
84
|
-
// 3. Run the pipeline
|
|
85
|
-
// ============================================================================
|
|
86
|
-
|
|
87
|
-
async function main() {
|
|
88
|
-
const live = createLiveGraph(config);
|
|
89
|
-
|
|
90
|
-
// Show the generated prompt
|
|
91
|
-
const prompt = buildInferencePrompt(live, {
|
|
92
|
-
context: [
|
|
93
|
-
'Current state of PR #42:',
|
|
94
|
-
'- Code review: 3 approvals from team leads, 0 open comments',
|
|
95
|
-
'- CI pipeline: 120/120 tests pass, code coverage 87%',
|
|
96
|
-
'- Security scan: 0 critical, 0 high vulnerabilities',
|
|
97
|
-
].join('\n'),
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
console.log('=== Prompt ===');
|
|
101
|
-
console.log(prompt.slice(0, 500) + '...');
|
|
102
|
-
console.log(`(${prompt.length} chars total)\n`);
|
|
103
|
-
|
|
104
|
-
// Ask Copilot to infer which tasks are complete
|
|
105
|
-
console.log('Calling copilot CLI...');
|
|
106
|
-
const result = await inferCompletions(live, copilotAdapter, {
|
|
107
|
-
context: [
|
|
108
|
-
'Current state of PR #42:',
|
|
109
|
-
'- Code review: 3 approvals from team leads, 0 open comments',
|
|
110
|
-
'- CI pipeline: 120/120 tests pass, code coverage 87%',
|
|
111
|
-
'- Security scan: 0 critical, 0 high vulnerabilities',
|
|
112
|
-
].join('\n'),
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
console.log('=== Inference Results ===');
|
|
116
|
-
for (const s of result.suggestions) {
|
|
117
|
-
console.log(` ${s.taskName}: ${(s.confidence * 100).toFixed(0)}% — ${s.reasoning}`);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Apply suggestions above 70% confidence
|
|
121
|
-
const updated = applyInferences(live, result, 0.7);
|
|
122
|
-
|
|
123
|
-
const applied = result.suggestions.filter(s => s.confidence >= 0.7);
|
|
124
|
-
const skipped = result.suggestions.filter(s => s.confidence < 0.7);
|
|
125
|
-
|
|
126
|
-
console.log('\n=== After Applying (threshold 70%) ===');
|
|
127
|
-
console.log('Applied:', applied.map(s => s.taskName).join(', ') || '(none)');
|
|
128
|
-
console.log('Skipped:', skipped.map(s => s.taskName).join(', ') || '(none)');
|
|
129
|
-
|
|
130
|
-
for (const [name, state] of Object.entries(updated.state.tasks)) {
|
|
131
|
-
console.log(` ${name}: ${state.status}`);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const next = schedule(updated);
|
|
135
|
-
console.log('\nNewly eligible:', next.eligible.join(', ') || '(none)');
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
main().catch(console.error);
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inference Example: Data Pipeline with Evidence Accumulation
|
|
3
|
-
*
|
|
4
|
-
* Demonstrates iterative inference — run the LLM multiple times as
|
|
5
|
-
* new evidence arrives. Each round may unlock more tasks.
|
|
6
|
-
*
|
|
7
|
-
* Run with: npx tsx examples/npm-libs/inference/data-pipeline.ts
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
createLiveGraph,
|
|
12
|
-
injectTokens,
|
|
13
|
-
schedule,
|
|
14
|
-
} from '../../src/continuous-event-graph/index.js';
|
|
15
|
-
import {
|
|
16
|
-
inferAndApply,
|
|
17
|
-
} from '../../src/inference/index.js';
|
|
18
|
-
import type { InferenceAdapter } from '../../src/inference/index.js';
|
|
19
|
-
import type { GraphConfig } from '../../src/continuous-event-graph/types.js';
|
|
20
|
-
|
|
21
|
-
// ============================================================================
|
|
22
|
-
// 1. Define a data processing pipeline
|
|
23
|
-
// ============================================================================
|
|
24
|
-
|
|
25
|
-
const config: GraphConfig = {
|
|
26
|
-
settings: { completion: 'all-tasks' },
|
|
27
|
-
tasks: {
|
|
28
|
-
'data-ingested': {
|
|
29
|
-
provides: ['raw-data'],
|
|
30
|
-
description: 'Raw data landed in blob storage',
|
|
31
|
-
inference: {
|
|
32
|
-
criteria: 'CSV/JSON files present in data-lake/raw/ folder',
|
|
33
|
-
keywords: ['blob-storage', 'data-lake', 'csv', 'json', 'ingestion'],
|
|
34
|
-
autoDetectable: true,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
'schema-validated': {
|
|
38
|
-
requires: ['raw-data'],
|
|
39
|
-
provides: ['validated-data'],
|
|
40
|
-
description: 'Data schema validation passed',
|
|
41
|
-
inference: {
|
|
42
|
-
criteria: 'Schema validation passed with 0 errors',
|
|
43
|
-
keywords: ['schema', 'validation', 'data-quality'],
|
|
44
|
-
suggestedChecks: ['check validation report for error_count = 0'],
|
|
45
|
-
autoDetectable: true,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
'transformed': {
|
|
49
|
-
requires: ['validated-data'],
|
|
50
|
-
provides: ['clean-data'],
|
|
51
|
-
description: 'Data transformed and cleaned',
|
|
52
|
-
inference: {
|
|
53
|
-
criteria: 'Transform job completed, output in data-lake/clean/',
|
|
54
|
-
keywords: ['transform', 'etl', 'spark', 'clean-data'],
|
|
55
|
-
autoDetectable: true,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
'loaded-to-warehouse': {
|
|
59
|
-
requires: ['clean-data'],
|
|
60
|
-
provides: ['warehouse-ready'],
|
|
61
|
-
description: 'Data loaded into analytics warehouse',
|
|
62
|
-
inference: {
|
|
63
|
-
criteria: 'Row count in warehouse matches expected count',
|
|
64
|
-
keywords: ['warehouse', 'snowflake', 'bigquery', 'load'],
|
|
65
|
-
suggestedChecks: ['compare row counts', 'check for null PKs'],
|
|
66
|
-
autoDetectable: true,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// ============================================================================
|
|
73
|
-
// 2. Simulate evidence arriving in waves
|
|
74
|
-
// ============================================================================
|
|
75
|
-
|
|
76
|
-
async function main() {
|
|
77
|
-
let live = createLiveGraph(config);
|
|
78
|
-
console.log('=== Data Pipeline with Iterative Inference ===\n');
|
|
79
|
-
|
|
80
|
-
// --- Wave 1: Ingestion evidence ---
|
|
81
|
-
console.log('📥 Wave 1: Ingestion logs arrive');
|
|
82
|
-
|
|
83
|
-
let round1Adapter: InferenceAdapter = {
|
|
84
|
-
analyze: async () => JSON.stringify([
|
|
85
|
-
{ taskName: 'data-ingested', confidence: 0.92, reasoning: '45 CSV files found in data-lake/raw/2025-11-16/' },
|
|
86
|
-
{ taskName: 'schema-validated', confidence: 0.1, reasoning: 'No validation report found yet' },
|
|
87
|
-
]),
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
let result = await inferAndApply(live, round1Adapter, {
|
|
91
|
-
threshold: 0.8,
|
|
92
|
-
context: 'Blob storage event: 45 files uploaded to data-lake/raw/2025-11-16/',
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
live = result.live;
|
|
96
|
-
console.log(` Applied: ${result.applied.map(s => s.taskName).join(', ') || 'none'}`);
|
|
97
|
-
console.log(` Schedule: ${schedule(live).eligible.join(', ')}`);
|
|
98
|
-
|
|
99
|
-
// --- Wave 2: Validation report ---
|
|
100
|
-
console.log('\n📋 Wave 2: Validation report generated');
|
|
101
|
-
|
|
102
|
-
let round2Adapter: InferenceAdapter = {
|
|
103
|
-
analyze: async () => JSON.stringify([
|
|
104
|
-
{ taskName: 'schema-validated', confidence: 0.96, reasoning: 'Validation report: 0 errors, 45 files passed, 3 warnings (non-blocking)' },
|
|
105
|
-
{ taskName: 'transformed', confidence: 0.05, reasoning: 'No transform job output detected' },
|
|
106
|
-
]),
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
result = await inferAndApply(live, round2Adapter, {
|
|
110
|
-
threshold: 0.8,
|
|
111
|
-
context: 'Validation report: {errors: 0, passed: 45, warnings: 3, status: "PASS"}',
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
live = result.live;
|
|
115
|
-
console.log(` Applied: ${result.applied.map(s => s.taskName).join(', ') || 'none'}`);
|
|
116
|
-
console.log(` Schedule: ${schedule(live).eligible.join(', ')}`);
|
|
117
|
-
|
|
118
|
-
// --- Wave 3: Transform + Load evidence ---
|
|
119
|
-
console.log('\n🔄 Wave 3: Transform and load complete');
|
|
120
|
-
|
|
121
|
-
let round3Adapter: InferenceAdapter = {
|
|
122
|
-
analyze: async () => JSON.stringify([
|
|
123
|
-
{ taskName: 'transformed', confidence: 0.91, reasoning: 'Spark job completed, 45 parquet files in data-lake/clean/' },
|
|
124
|
-
{ taskName: 'loaded-to-warehouse', confidence: 0.87, reasoning: 'Warehouse row count 1.2M matches expected, no null PKs' },
|
|
125
|
-
]),
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
result = await inferAndApply(live, round3Adapter, {
|
|
129
|
-
threshold: 0.8,
|
|
130
|
-
context: 'Spark job: COMPLETED (45→45 files). Warehouse load: 1,200,000 rows, 0 null PKs.',
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
live = result.live;
|
|
134
|
-
console.log(` Applied: ${result.applied.map(s => s.taskName).join(', ') || 'none'}`);
|
|
135
|
-
|
|
136
|
-
// --- Final state ---
|
|
137
|
-
console.log('\n=== Final Pipeline State ===');
|
|
138
|
-
for (const [name, state] of Object.entries(live.state.tasks)) {
|
|
139
|
-
console.log(` ${name}: ${state.status}`);
|
|
140
|
-
}
|
|
141
|
-
console.log(` Tokens: ${live.state.availableOutputs.join(', ')}`);
|
|
142
|
-
console.log(` All complete: ${Object.values(live.state.tasks).every(t => t.status === 'completed')}`);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
main().catch(console.error);
|