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.
Files changed (386) hide show
  1. package/browser/asset-integrity.json +8 -4
  2. package/browser/board-livecards-client.js +1 -1
  3. package/browser/board-livecards-localstorage.js +5 -5
  4. package/browser/live-cards.js +19 -3309
  5. package/cli/board-live-cards-lib-tjYsPt5U.d.ts +321 -0
  6. package/{dist/cli → cli}/browser-api/board-live-cards-browser-adapter.d.ts +3 -5
  7. package/{dist/cli → cli}/browser-api/card-store-browser-api.d.ts +1 -2
  8. package/{dist/cli → cli}/browser-api/card-store-browser-api.js +1 -1
  9. package/cli/execution-interface-C_A6WCiK.d.ts +284 -0
  10. package/{dist/cli → cli}/node/artifacts-store-cli.js +2 -2
  11. package/cli/node/batch-runner-cli.js +3 -0
  12. package/cli/node/board-live-cards-cli.js +15 -0
  13. package/{dist/cli → cli}/node/execution-adapter.d.ts +3 -3
  14. package/cli/node/execution-adapter.js +3 -0
  15. package/{dist/cli → cli}/node/fs-board-adapter.d.ts +24 -11
  16. package/cli/node/fs-board-adapter.js +14 -0
  17. package/cli/node/step-machine-cli.d.ts +7 -0
  18. package/cli/node/step-machine-cli.js +5 -0
  19. package/{dist/board-live-cards-public-5n1-syA3.d.cts → cli/types-CziUxkiv.d.ts} +68 -5
  20. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/card-store-ref.json +1 -0
  21. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/chat-handler.json +1 -0
  22. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/outputs-store-ref.json +1 -0
  23. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/task-executor.json +1 -0
  24. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/graph.json +29 -0
  25. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/lastJournalProcessedId.json +1 -0
  26. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime-out/.outputs/status.json +25 -0
  27. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-market-prices/computed_values.json +67 -0
  28. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio/computed_values.json +1 -0
  29. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio-value/computed_values.json +52 -0
  30. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/holdings.json +22 -0
  31. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/positions.json +46 -0
  32. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/quotes.json +35 -0
  33. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/status.json +113 -0
  34. package/examples/{example-board → board}/demo-server-config.json +0 -1
  35. package/examples/{example-board → board}/demo-server.js +23 -48
  36. package/examples/{example-board → board}/demo-shell-with-server.html +3 -3
  37. package/examples/{example-board → board}/demo-task-executor.js +71 -24
  38. package/examples/board/gandalf-cards/card-source-kinds.json +36 -0
  39. package/examples/board/gandalf-cards/cards/_index.json +7 -0
  40. package/examples/board/gandalf-cards/cards/card-source-kinds.json +64 -0
  41. package/examples/board/source-def-flows/copilot.flow.json +33 -0
  42. package/examples/board/source-def-flows/mock.flow.json +35 -0
  43. package/examples/board/source-def-flows/url-list.flow.json +33 -0
  44. package/examples/board/source-def-flows/url.flow.json +33 -0
  45. package/examples/board/source-def-flows/workiq.flow.json +34 -0
  46. package/examples/board/source-def-handlers/copilot-source-handler.js +141 -0
  47. package/examples/board/source-def-handlers/http-source-handler.js +145 -0
  48. package/examples/board/source_def_flows.json +249 -0
  49. package/examples/board/test/demo-http-test.js +317 -0
  50. package/examples/{example-board → board-local}/demo-shell-localstorage.html +4 -4
  51. package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/handlers}/portfolio-tracker-fetch-prices.js +1 -1
  52. package/examples/{browser/boards/portfolio-tracker/portfolio-tracker-public.js → portfolio-tracker/portfolio-tracker.js} +11 -14
  53. package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/test}/portfolio-t4.js +32 -50
  54. package/lib/artifacts-store-lib-public-BABrgFkV.d.ts +119 -0
  55. package/lib/artifacts-store-lib-public-DGa8BpJT.d.cts +119 -0
  56. package/lib/artifacts-store-public.cjs +2 -0
  57. package/lib/artifacts-store-public.d.cts +5 -0
  58. package/lib/artifacts-store-public.d.ts +5 -0
  59. package/lib/artifacts-store-public.js +2 -0
  60. package/lib/board-live-cards-node.cjs +14 -0
  61. package/{dist/cli/node/execution-adapter.d.cts → lib/board-live-cards-node.d.cts} +45 -85
  62. package/lib/board-live-cards-node.d.ts +134 -0
  63. package/lib/board-live-cards-node.js +14 -0
  64. package/lib/board-live-cards-public-BnmRAbQV.d.cts +383 -0
  65. package/{dist/board-live-cards-public-CK_J8uv0.d.ts → lib/board-live-cards-public-CsmYrvpd.d.ts} +142 -76
  66. package/lib/board-live-cards-public.cjs +3 -0
  67. package/lib/board-live-cards-public.d.cts +4 -0
  68. package/lib/board-live-cards-public.d.ts +4 -0
  69. package/lib/board-live-cards-public.js +3 -0
  70. package/lib/board-live-cards-server-runtime.cjs +9 -0
  71. package/lib/board-live-cards-server-runtime.d.cts +6 -0
  72. package/lib/board-live-cards-server-runtime.d.ts +6 -0
  73. package/lib/board-live-cards-server-runtime.js +9 -0
  74. package/lib/board-livegraph-runtime/index.cjs +3 -0
  75. package/{dist → lib}/board-livegraph-runtime/index.d.cts +1 -2
  76. package/{dist → lib}/board-livegraph-runtime/index.d.ts +1 -2
  77. package/lib/board-livegraph-runtime/index.js +3 -0
  78. package/{dist/storage-refs.cjs → lib/board-worker-adapter.cjs} +2 -2
  79. package/{dist/storage-refs.d.cts → lib/board-worker-adapter.d.cts} +4 -3
  80. package/{dist/storage-refs.d.ts → lib/board-worker-adapter.d.ts} +4 -3
  81. package/{dist/storage-refs.js → lib/board-worker-adapter.js} +2 -2
  82. package/{dist → lib}/card-compute/index.cjs +1 -1
  83. package/{dist → lib}/card-compute/index.js +1 -1
  84. package/lib/card-store-public.cjs +2 -0
  85. package/lib/card-store-public.d.cts +61 -0
  86. package/lib/card-store-public.d.ts +61 -0
  87. package/lib/card-store-public.js +2 -0
  88. package/lib/card-validation.cjs +10 -0
  89. package/lib/card-validation.d.cts +35 -0
  90. package/lib/card-validation.d.ts +35 -0
  91. package/lib/card-validation.js +10 -0
  92. package/{dist/constants-oCEbNpul.d.ts → lib/constants-BPVLb3Es.d.ts} +1 -1
  93. package/{dist/constants-BzZUyYlp.d.cts → lib/constants-DXxsRN9y.d.cts} +1 -1
  94. package/{dist → lib}/continuous-event-graph/index.cjs +2 -2
  95. package/{dist → lib}/continuous-event-graph/index.d.cts +3 -5
  96. package/{dist → lib}/continuous-event-graph/index.d.ts +3 -5
  97. package/{dist → lib}/continuous-event-graph/index.js +2 -2
  98. package/{dist → lib}/event-graph/index.d.cts +2 -2
  99. package/{dist → lib}/event-graph/index.d.ts +2 -2
  100. package/{dist → lib}/execution-refs.d.cts +29 -10
  101. package/{dist → lib}/execution-refs.d.ts +29 -10
  102. package/lib/index.cjs +25 -0
  103. package/{dist → lib}/index.d.cts +7 -8
  104. package/{dist → lib}/index.d.ts +7 -8
  105. package/lib/index.js +25 -0
  106. package/{dist/live-cards-bridge-BXbVTsna.d.cts → lib/live-cards-bridge-DC_ZU0eS.d.ts} +134 -3
  107. package/{dist/live-cards-bridge-Ds28XR15.d.ts → lib/live-cards-bridge-b25aAVvE.d.cts} +134 -3
  108. package/lib/loader-CuuLjxVA.d.cts +42 -0
  109. package/lib/loader-Zborm2pq.d.ts +42 -0
  110. package/lib/server-runtime/index.cjs +9 -0
  111. package/{dist → lib}/server-runtime/index.d.cts +4 -4
  112. package/{dist → lib}/server-runtime/index.d.ts +4 -4
  113. package/lib/server-runtime/index.js +9 -0
  114. package/lib/step-machine/index.d.cts +64 -0
  115. package/lib/step-machine/index.d.ts +64 -0
  116. package/lib/step-machine-public/index.cjs +5 -0
  117. package/{dist → lib}/step-machine-public/index.d.cts +14 -1
  118. package/{dist → lib}/step-machine-public/index.d.ts +14 -1
  119. package/lib/step-machine-public/index.js +5 -0
  120. package/lib/storage-interface-BhAON-gW.d.cts +84 -0
  121. package/lib/storage-interface-BhAON-gW.d.ts +84 -0
  122. package/lib/stores/index.cjs +3 -0
  123. package/lib/stores/index.d.cts +4 -0
  124. package/lib/stores/index.d.ts +4 -0
  125. package/lib/stores/index.js +3 -0
  126. package/lib/stores/kv.cjs +3 -0
  127. package/lib/stores/kv.d.cts +32 -0
  128. package/lib/stores/kv.d.ts +32 -0
  129. package/lib/stores/kv.js +3 -0
  130. package/{dist → lib}/stores/memory.d.cts +1 -1
  131. package/{dist → lib}/stores/memory.d.ts +1 -1
  132. package/{dist/types-HGDTWIun.d.ts → lib/types-CBxkYuLY.d.ts} +2 -1
  133. package/{dist/types-ycun84cq.d.cts → lib/types-DQ1bKuB1.d.cts} +11 -0
  134. package/{dist/types-ycun84cq.d.ts → lib/types-DQ1bKuB1.d.ts} +11 -0
  135. package/{dist/types-CU3DjTKL.d.cts → lib/types-DkFvgxwq.d.cts} +2 -1
  136. package/package.json +79 -119
  137. package/board-live-cards-cli.js +0 -37
  138. package/browser/board-livecards-client.js.map +0 -1
  139. package/browser/board-livecards-localstorage.js.map +0 -1
  140. package/browser/board-livegraph-engine.js +0 -3
  141. package/browser/board-livegraph-engine.js.map +0 -1
  142. package/browser/card-compute.js +0 -266
  143. package/browser/compute-jsonata.js.map +0 -1
  144. package/card-store.js +0 -37
  145. package/dist/batch/index.cjs.map +0 -1
  146. package/dist/batch/index.js.map +0 -1
  147. package/dist/board-live-cards-lib-Bg6EvCo5.d.cts +0 -136
  148. package/dist/board-live-cards-lib-jM2uYG1v.d.ts +0 -136
  149. package/dist/board-livegraph-runtime/index.cjs +0 -3
  150. package/dist/board-livegraph-runtime/index.cjs.map +0 -1
  151. package/dist/board-livegraph-runtime/index.js +0 -3
  152. package/dist/board-livegraph-runtime/index.js.map +0 -1
  153. package/dist/card-compute/index.cjs.map +0 -1
  154. package/dist/card-compute/index.js.map +0 -1
  155. package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs +0 -3
  156. package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs.map +0 -1
  157. package/dist/cli/browser-api/board-live-cards-browser-adapter.d.cts +0 -37
  158. package/dist/cli/browser-api/board-live-cards-browser-adapter.js.map +0 -1
  159. package/dist/cli/browser-api/card-store-browser-api.cjs +0 -2
  160. package/dist/cli/browser-api/card-store-browser-api.cjs.map +0 -1
  161. package/dist/cli/browser-api/card-store-browser-api.d.cts +0 -26
  162. package/dist/cli/browser-api/card-store-browser-api.js.map +0 -1
  163. package/dist/cli/node/artifacts-store-cli.cjs +0 -11
  164. package/dist/cli/node/artifacts-store-cli.cjs.map +0 -1
  165. package/dist/cli/node/artifacts-store-cli.d.cts +0 -8
  166. package/dist/cli/node/artifacts-store-cli.js.map +0 -1
  167. package/dist/cli/node/board-live-cards-cli.cjs +0 -15
  168. package/dist/cli/node/board-live-cards-cli.cjs.map +0 -1
  169. package/dist/cli/node/board-live-cards-cli.d.cts +0 -20
  170. package/dist/cli/node/board-live-cards-cli.js +0 -15
  171. package/dist/cli/node/board-live-cards-cli.js.map +0 -1
  172. package/dist/cli/node/card-store-cli.cjs +0 -8
  173. package/dist/cli/node/card-store-cli.cjs.map +0 -1
  174. package/dist/cli/node/card-store-cli.d.cts +0 -15
  175. package/dist/cli/node/card-store-cli.js.map +0 -1
  176. package/dist/cli/node/execution-adapter.cjs +0 -3
  177. package/dist/cli/node/execution-adapter.cjs.map +0 -1
  178. package/dist/cli/node/execution-adapter.js +0 -3
  179. package/dist/cli/node/execution-adapter.js.map +0 -1
  180. package/dist/cli/node/fs-board-adapter.cjs +0 -14
  181. package/dist/cli/node/fs-board-adapter.cjs.map +0 -1
  182. package/dist/cli/node/fs-board-adapter.d.cts +0 -204
  183. package/dist/cli/node/fs-board-adapter.js +0 -14
  184. package/dist/cli/node/fs-board-adapter.js.map +0 -1
  185. package/dist/cli/node/source-cli-task-executor.cjs +0 -11
  186. package/dist/cli/node/source-cli-task-executor.cjs.map +0 -1
  187. package/dist/cli/node/source-cli-task-executor.js.map +0 -1
  188. package/dist/config/index.cjs.map +0 -1
  189. package/dist/config/index.js.map +0 -1
  190. package/dist/continuous-event-graph/index.cjs.map +0 -1
  191. package/dist/continuous-event-graph/index.js.map +0 -1
  192. package/dist/event-graph/index.cjs.map +0 -1
  193. package/dist/event-graph/index.js.map +0 -1
  194. package/dist/execution-refs.cjs.map +0 -1
  195. package/dist/execution-refs.js.map +0 -1
  196. package/dist/index.cjs +0 -30
  197. package/dist/index.cjs.map +0 -1
  198. package/dist/index.js +0 -30
  199. package/dist/index.js.map +0 -1
  200. package/dist/inference/index.cjs +0 -7
  201. package/dist/inference/index.cjs.map +0 -1
  202. package/dist/inference/index.d.cts +0 -229
  203. package/dist/inference/index.d.ts +0 -229
  204. package/dist/inference/index.js +0 -7
  205. package/dist/inference/index.js.map +0 -1
  206. package/dist/server-runtime/index.cjs +0 -9
  207. package/dist/server-runtime/index.cjs.map +0 -1
  208. package/dist/server-runtime/index.js +0 -9
  209. package/dist/server-runtime/index.js.map +0 -1
  210. package/dist/step-machine/index.cjs.map +0 -1
  211. package/dist/step-machine/index.d.cts +0 -102
  212. package/dist/step-machine/index.d.ts +0 -102
  213. package/dist/step-machine/index.js.map +0 -1
  214. package/dist/step-machine-public/index.cjs +0 -3
  215. package/dist/step-machine-public/index.cjs.map +0 -1
  216. package/dist/step-machine-public/index.js +0 -3
  217. package/dist/step-machine-public/index.js.map +0 -1
  218. package/dist/storage-refs.cjs.map +0 -1
  219. package/dist/storage-refs.js.map +0 -1
  220. package/dist/stores/file.cjs +0 -2
  221. package/dist/stores/file.cjs.map +0 -1
  222. package/dist/stores/file.d.cts +0 -36
  223. package/dist/stores/file.d.ts +0 -36
  224. package/dist/stores/file.js +0 -2
  225. package/dist/stores/file.js.map +0 -1
  226. package/dist/stores/index.cjs +0 -2
  227. package/dist/stores/index.cjs.map +0 -1
  228. package/dist/stores/index.d.cts +0 -4
  229. package/dist/stores/index.d.ts +0 -4
  230. package/dist/stores/index.js +0 -2
  231. package/dist/stores/index.js.map +0 -1
  232. package/dist/stores/localStorage.cjs +0 -2
  233. package/dist/stores/localStorage.cjs.map +0 -1
  234. package/dist/stores/localStorage.d.cts +0 -34
  235. package/dist/stores/localStorage.d.ts +0 -34
  236. package/dist/stores/localStorage.js +0 -2
  237. package/dist/stores/localStorage.js.map +0 -1
  238. package/dist/stores/memory.cjs.map +0 -1
  239. package/dist/stores/memory.js.map +0 -1
  240. package/dist/types-CHSdoAAA.d.cts +0 -135
  241. package/dist/types-CoW0gQl3.d.ts +0 -135
  242. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-fetch-prices.py +0 -201
  243. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-http-test.js +0 -370
  244. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-http-test.py +0 -398
  245. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +0 -196
  246. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.js +0 -300
  247. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.py +0 -617
  248. package/examples/browser/boards/portfolio-tracker/portfolio-tracker.py +0 -366
  249. package/examples/browser/livecards-browser/index.html +0 -41
  250. package/examples/browser/step-machine-browser/index.html +0 -367
  251. package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/.runtime-out +0 -1
  252. package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/board-graph.json +0 -32
  253. package/examples/cli/step-machine-cli/portfolio-tracker/cards/holdings-table.json +0 -22
  254. package/examples/cli/step-machine-cli/portfolio-tracker/cards/portfolio-form.json +0 -43
  255. package/examples/cli/step-machine-cli/portfolio-tracker/cards/portfolio-value.json +0 -15
  256. package/examples/cli/step-machine-cli/portfolio-tracker/cards/price-fetch.json +0 -15
  257. package/examples/cli/step-machine-cli/portfolio-tracker/fetch-prices.js +0 -48
  258. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -125
  259. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +0 -32
  260. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +0 -26
  261. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/poll-status-cli.js +0 -49
  262. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +0 -25
  263. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +0 -23
  264. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/status-cli.js +0 -21
  265. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +0 -38
  266. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +0 -48
  267. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +0 -31
  268. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/_board_pycli.py +0 -107
  269. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/add-cards.py +0 -51
  270. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/init-board.py +0 -45
  271. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/poll-status.py +0 -71
  272. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/reset-board-dir.py +0 -36
  273. package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-demo.flow.yaml +0 -26
  274. package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-handlers.py +0 -39
  275. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker-pycli.flow.yaml +0 -80
  276. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +0 -76
  277. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +0 -44
  278. package/examples/cli/step-machine-cli/portfolio-tracker/run-inline-python-demo-pycli.py +0 -43
  279. package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker-pycli.py +0 -77
  280. package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +0 -28
  281. package/examples/cli/step-machine-demo/jsonata-init-board-cli.js +0 -31
  282. package/examples/cli/step-machine-demo/jsonata-init-board.flow.yaml +0 -54
  283. package/examples/cli/step-machine-demo/one-step-cli-only.flow.yaml +0 -21
  284. package/examples/cli/step-machine-demo/step-cli-echo-y.js +0 -15
  285. package/examples/cli/step-machine-demo/step2-double-cli.js +0 -33
  286. package/examples/cli/step-machine-demo/two-step-math.flow.yaml +0 -93
  287. package/examples/cli/step-machine-demo/two-step-mixed.flow.yaml +0 -43
  288. package/examples/example-board/agent-instructions-cardlayout.md +0 -56
  289. package/examples/example-board/agent-instructions.md +0 -834
  290. package/examples/example-board/demo-shell.html +0 -63
  291. package/examples/index.html +0 -785
  292. package/examples/npm-libs/batch/batch-step-machine.ts +0 -121
  293. package/examples/npm-libs/continuous-event-graph/live-cards-board.ts +0 -215
  294. package/examples/npm-libs/continuous-event-graph/live-portfolio-dashboard.ts +0 -555
  295. package/examples/npm-libs/continuous-event-graph/portfolio-tracker.ts +0 -287
  296. package/examples/npm-libs/continuous-event-graph/reactive-monitoring.ts +0 -265
  297. package/examples/npm-libs/continuous-event-graph/reactive-pipeline.ts +0 -168
  298. package/examples/npm-libs/continuous-event-graph/soc-incident-board.ts +0 -287
  299. package/examples/npm-libs/continuous-event-graph/stock-dashboard.ts +0 -229
  300. package/examples/npm-libs/event-graph/ci-cd-pipeline.ts +0 -243
  301. package/examples/npm-libs/event-graph/executor-diamond.ts +0 -165
  302. package/examples/npm-libs/event-graph/executor-pipeline.ts +0 -161
  303. package/examples/npm-libs/event-graph/research-pipeline.ts +0 -137
  304. package/examples/npm-libs/flows/ai-conversation.yaml +0 -116
  305. package/examples/npm-libs/flows/order-processing.yaml +0 -143
  306. package/examples/npm-libs/flows/simple-greeting.yaml +0 -54
  307. package/examples/npm-libs/graph-of-graphs/multi-stage-etl.ts +0 -307
  308. package/examples/npm-libs/graph-of-graphs/url-processing-pipeline.ts +0 -254
  309. package/examples/npm-libs/inference/azure-deployment.ts +0 -149
  310. package/examples/npm-libs/inference/copilot-cli.ts +0 -138
  311. package/examples/npm-libs/inference/data-pipeline.ts +0 -145
  312. package/examples/npm-libs/inference/pluggable-adapters.ts +0 -254
  313. package/examples/npm-libs/node/ai-conversation.ts +0 -195
  314. package/examples/npm-libs/node/simple-greeting.ts +0 -101
  315. package/examples/step-machine-cli/portfolio-tracker/cards/holdings-table.json +0 -22
  316. package/examples/step-machine-cli/portfolio-tracker/cards/portfolio-form.json +0 -43
  317. package/examples/step-machine-cli/portfolio-tracker/cards/portfolio-value.json +0 -15
  318. package/examples/step-machine-cli/portfolio-tracker/cards/price-fetch.json +0 -15
  319. package/examples/step-machine-cli/portfolio-tracker/fetch-prices.js +0 -48
  320. package/examples/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -57
  321. package/examples/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +0 -27
  322. package/examples/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +0 -25
  323. package/examples/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +0 -29
  324. package/examples/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +0 -27
  325. package/examples/step-machine-cli/portfolio-tracker/handlers/status-cli.js +0 -25
  326. package/examples/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +0 -37
  327. package/examples/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +0 -53
  328. package/examples/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +0 -35
  329. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker-task-executor.cjs +0 -96
  330. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +0 -227
  331. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +0 -38
  332. package/examples/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +0 -28
  333. package/step-machine-cli.js +0 -407
  334. /package/{dist/cli → cli}/browser-api/board-live-cards-browser-adapter.js +0 -0
  335. /package/{dist/board-livegraph-runtime → cli/browser-api}/jsonata-sync.cjs +0 -0
  336. /package/{dist/cli → cli}/node/artifacts-store-cli.d.ts +0 -0
  337. /package/{dist/cli/node/source-cli-task-executor.d.cts → cli/node/batch-runner-cli.d.ts} +0 -0
  338. /package/{dist/cli → cli}/node/board-live-cards-cli.d.ts +0 -0
  339. /package/{dist/cli → cli}/node/card-store-cli.d.ts +0 -0
  340. /package/{dist/cli → cli}/node/card-store-cli.js +0 -0
  341. /package/{dist/card-compute → cli/node}/jsonata-sync.cjs +0 -0
  342. /package/{dist/cli → cli}/node/source-cli-task-executor.d.ts +0 -0
  343. /package/{dist/cli → cli}/node/source-cli-task-executor.js +0 -0
  344. /package/examples/{example-board → board}/cards/card-concentration.json +0 -0
  345. /package/examples/{example-board → board}/cards/card-my-identity.json +0 -0
  346. /package/examples/{example-board → board}/cards/card-portfolio-action.json +0 -0
  347. /package/examples/{example-board → board}/cards/card-portfolio-intelligence.json +0 -0
  348. /package/examples/{example-board → board}/cards/card-portfolio-risks.json +0 -0
  349. /package/examples/{example-board → board}/cards/card-rebalance-impact.json +0 -0
  350. /package/examples/{example-board → board}/cards/card-rebalance-sim.json +0 -0
  351. /package/examples/{example-board → board}/cards/cardT-market-prices.json +0 -0
  352. /package/examples/{example-board → board}/cards/cardT-portfolio-value.json +0 -0
  353. /package/examples/{example-board → board}/cards/cardT-portfolio.json +0 -0
  354. /package/examples/{example-board → board}/demo-chat-handler.js +0 -0
  355. /package/examples/{example-board → board}/scripts/copilot_wrapper.bat +0 -0
  356. /package/examples/{example-board → board}/scripts/copilot_wrapper_helper.ps1 +0 -0
  357. /package/examples/{example-board → board}/scripts/workiq_wrapper.mjs +0 -0
  358. /package/examples/{browser/boards/portfolio-tracker → board/test}/portfolio-tracker-sse-worker.js +0 -0
  359. /package/{dist → lib}/batch/index.cjs +0 -0
  360. /package/{dist → lib}/batch/index.d.cts +0 -0
  361. /package/{dist → lib}/batch/index.d.ts +0 -0
  362. /package/{dist → lib}/batch/index.js +0 -0
  363. /package/{dist/cli/browser-api → lib/board-livegraph-runtime}/jsonata-sync.cjs +0 -0
  364. /package/{dist → lib}/card-compute/index.d.cts +0 -0
  365. /package/{dist → lib}/card-compute/index.d.ts +0 -0
  366. /package/{dist/cli/node → lib/card-compute}/jsonata-sync.cjs +0 -0
  367. /package/{dist → lib}/config/index.cjs +0 -0
  368. /package/{dist → lib}/config/index.d.cts +0 -0
  369. /package/{dist → lib}/config/index.d.ts +0 -0
  370. /package/{dist → lib}/config/index.js +0 -0
  371. /package/{dist → lib}/continuous-event-graph/jsonata-sync.cjs +0 -0
  372. /package/{dist → lib}/event-graph/index.cjs +0 -0
  373. /package/{dist → lib}/event-graph/index.js +0 -0
  374. /package/{dist → lib}/execution-refs.cjs +0 -0
  375. /package/{dist → lib}/execution-refs.js +0 -0
  376. /package/{dist → lib}/jsonata-sync.cjs +0 -0
  377. /package/{dist → lib}/server-runtime/jsonata-sync.cjs +0 -0
  378. /package/{dist → lib}/step-machine/index.cjs +0 -0
  379. /package/{dist → lib}/step-machine/index.js +0 -0
  380. /package/{dist → lib}/step-machine-public/jsonata-sync.cjs +0 -0
  381. /package/{dist → lib}/stores/memory.cjs +0 -0
  382. /package/{dist → lib}/stores/memory.js +0 -0
  383. /package/{dist → lib}/types-BBhqYGhE.d.cts +0 -0
  384. /package/{dist → lib}/types-BBhqYGhE.d.ts +0 -0
  385. /package/{dist → lib}/validate-BAVzUJWa.d.ts +0 -0
  386. /package/{dist → lib}/validate-Dbu7ygys.d.cts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/stores/memory.ts","../../src/stores/localStorage.ts","../../src/stores/file.ts"],"names":["MemoryStore","runId","state","key","value","runData","LocalStorageStore","options","runs","raw","filtered","id","allData","keysToRemove","i","FileStore","err","f"],"mappings":"AASO,IAAMA,CAAAA,CAAN,KAA8C,CAC3C,IAAA,CAAsC,IAAI,GAAA,CAC1C,IAAA,CAA6C,IAAI,GAAA,CAEzD,MAAM,YAAA,CAAaC,EAAeC,CAAAA,CAAwC,CACxE,KAAK,IAAA,CAAK,GAAA,CAAID,EAAO,CAAE,GAAGC,CAAM,CAAC,EACnC,CAEA,MAAM,YAAA,CAAaD,CAAAA,CAAiD,CAClE,IAAMC,CAAAA,CAAQ,KAAK,IAAA,CAAK,GAAA,CAAID,CAAK,CAAA,CACjC,OAAOC,CAAAA,CAAQ,CAAE,GAAGA,CAAM,EAAI,IAChC,CAEA,MAAM,cAAA,CAAeD,CAAAA,CAA8B,CACjD,IAAA,CAAK,IAAA,CAAK,MAAA,CAAOA,CAAK,CAAA,CACtB,IAAA,CAAK,KAAK,MAAA,CAAOA,CAAK,EACxB,CAEA,MAAM,OAAA,CAAQA,CAAAA,CAAeE,CAAAA,CAAaC,CAAAA,CAA+B,CAClE,IAAA,CAAK,IAAA,CAAK,IAAIH,CAAK,CAAA,EACtB,KAAK,IAAA,CAAK,GAAA,CAAIA,CAAAA,CAAO,EAAE,CAAA,CAEzB,IAAMI,CAAAA,CAAU,IAAA,CAAK,KAAK,GAAA,CAAIJ,CAAK,EACnCI,CAAAA,CAAQF,CAAG,CAAA,CAAIC,EACjB,CAEA,MAAM,QAAQH,CAAAA,CAAeE,CAAAA,CAA+B,CAC1D,OAAO,IAAA,CAAK,IAAA,CAAK,IAAIF,CAAK,CAAA,GAAIE,CAAG,CACnC,CAEA,MAAM,WAAWF,CAAAA,CAAiD,CAChE,OAAO,CAAE,GAAI,KA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A,EAAKA,EAAE,OAAA,CAAQ,WAAA,CAAa,EAAE,CAAC,CACxC,CAAA,MAASD,EAAc,CACrB,GAAKA,EAA8B,IAAA,GAAS,QAAA,CAC1C,OAAO,EAAC,CAEV,MAAMA,CACR,CACF,CAKA,MAAM,QAAA,EAA0B,CAC9B,MAAM,IAAA,CAAK,aAAA,GACX,IAAMR,CAAAA,CAAO,MAAM,IAAA,CAAK,QAAA,EAAS,CACjC,MAAM,OAAA,CAAQ,GAAA,CAAIA,CAAAA,CAAK,GAAA,CAAIP,CAAAA,EAAS,IAAA,CAAK,eAAeA,CAAK,CAAC,CAAC,EACjE,CACF","file":"index.js","sourcesContent":["/**\n * yaml-flow - Memory Store\n * \n * In-memory store implementation. Works in both browser and Node.js.\n * Data is lost when the process exits - use for testing or short-lived flows.\n */\n\nimport type { StepMachineStore, StepMachineState } from '../step-machine/types.js';\n\nexport class MemoryStore implements StepMachineStore {\n private runs: Map<string, StepMachineState> = new Map();\n private data: Map<string, Record<string, unknown>> = new Map();\n\n async saveRunState(runId: string, state: StepMachineState): Promise<void> {\n this.runs.set(runId, { ...state });\n }\n\n async loadRunState(runId: string): Promise<StepMachineState | null> {\n const state = this.runs.get(runId);\n return state ? { ...state } : null;\n }\n\n async deleteRunState(runId: string): Promise<void> {\n this.runs.delete(runId);\n this.data.delete(runId);\n }\n\n async setData(runId: string, key: string, value: unknown): Promise<void> {\n if (!this.data.has(runId)) {\n this.data.set(runId, {});\n }\n const runData = this.data.get(runId)!;\n runData[key] = value;\n }\n\n async getData(runId: string, key: string): Promise<unknown> {\n return this.data.get(runId)?.[key];\n }\n\n async getAllData(runId: string): Promise<Record<string, unknown>> {\n return { ...(this.data.get(runId) ?? {}) };\n }\n\n async clearData(runId: string): Promise<void> {\n this.data.delete(runId);\n }\n\n async listRuns(): Promise<string[]> {\n return Array.from(this.runs.keys());\n }\n\n /**\n * Clear all data (useful for testing)\n */\n clear(): void {\n this.runs.clear();\n this.data.clear();\n }\n}\n","/**\n * yaml-flow - LocalStorage Store\n * \n * Browser localStorage-based store implementation.\n * Data persists across page reloads but is limited to ~5MB per origin.\n */\n\nimport type { StepMachineStore, StepMachineState } from '../step-machine/types.js';\n\nexport interface LocalStorageStoreOptions {\n /** Key prefix for namespacing (default: 'yamlflow') */\n prefix?: string;\n}\n\nexport class LocalStorageStore implements StepMachineStore {\n private prefix: string;\n\n constructor(options: LocalStorageStoreOptions = {}) {\n this.prefix = options.prefix ?? 'yamlflow';\n \n // Ensure localStorage is available\n if (typeof localStorage === 'undefined') {\n throw new Error('LocalStorageStore requires localStorage (browser environment)');\n }\n }\n\n private runKey(runId: string): string {\n return `${this.prefix}:run:${runId}`;\n }\n\n private dataKey(runId: string): string {\n return `${this.prefix}:data:${runId}`;\n }\n\n private indexKey(): string {\n return `${this.prefix}:runs`;\n }\n\n async saveRunState(runId: string, state: StepMachineState): Promise<void> {\n localStorage.setItem(this.runKey(runId), JSON.stringify(state));\n \n // Update run index\n const runs = await this.listRuns();\n if (!runs.includes(runId)) {\n runs.push(runId);\n localStorage.setItem(this.indexKey(), JSON.stringify(runs));\n }\n }\n\n async loadRunState(runId: string): Promise<StepMachineState | null> {\n const raw = localStorage.getItem(this.runKey(runId));\n return raw ? JSON.parse(raw) : null;\n }\n\n async deleteRunState(runId: string): Promise<void> {\n localStorage.removeItem(this.runKey(runId));\n localStorage.removeItem(this.dataKey(runId));\n \n // Update run index\n const runs = await this.listRuns();\n const filtered = runs.filter(id => id !== runId);\n localStorage.setItem(this.indexKey(), JSON.stringify(filtered));\n }\n\n async setData(runId: string, key: string, value: unknown): Promise<void> {\n const allData = await this.getAllData(runId);\n allData[key] = value;\n localStorage.setItem(this.dataKey(runId), JSON.stringify(allData));\n }\n\n async getData(runId: string, key: string): Promise<unknown> {\n const allData = await this.getAllData(runId);\n return allData[key];\n }\n\n async getAllData(runId: string): Promise<Record<string, unknown>> {\n const raw = localStorage.getItem(this.dataKey(runId));\n return raw ? JSON.parse(raw) : {};\n }\n\n async clearData(runId: string): Promise<void> {\n localStorage.removeItem(this.dataKey(runId));\n }\n\n async listRuns(): Promise<string[]> {\n const raw = localStorage.getItem(this.indexKey());\n return raw ? JSON.parse(raw) : [];\n }\n\n /**\n * Clear all flow data from localStorage\n */\n clearAll(): void {\n const keysToRemove: string[] = [];\n \n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i);\n if (key?.startsWith(this.prefix + ':')) {\n keysToRemove.push(key);\n }\n }\n \n keysToRemove.forEach(key => localStorage.removeItem(key));\n }\n}\n","/**\n * yaml-flow - File Store\n * \n * File-system based store for Node.js environments.\n * Stores each run as a JSON file in the specified directory.\n */\n\nimport type { StepMachineStore, StepMachineState } from '../step-machine/types.js';\n\nexport interface FileStoreOptions {\n /** Directory path for storing flow data */\n directory: string;\n}\n\nexport class FileStore implements StepMachineStore {\n private directory: string;\n private fs: typeof import('fs/promises') | null = null;\n private path: typeof import('path') | null = null;\n\n constructor(options: FileStoreOptions) {\n this.directory = options.directory;\n }\n\n private async ensureModules(): Promise<void> {\n if (!this.fs || !this.path) {\n // Dynamic import for Node.js modules\n this.fs = await import('fs/promises');\n this.path = await import('path');\n \n // Ensure directory exists\n await this.fs.mkdir(this.directory, { recursive: true });\n }\n }\n\n private runPath(runId: string): string {\n return this.path!.join(this.directory, `${runId}.run.json`);\n }\n\n private dataPath(runId: string): string {\n return this.path!.join(this.directory, `${runId}.data.json`);\n }\n\n async saveRunState(runId: string, state: StepMachineState): Promise<void> {\n await this.ensureModules();\n await this.fs!.writeFile(\n this.runPath(runId),\n JSON.stringify(state, null, 2),\n 'utf-8'\n );\n }\n\n async loadRunState(runId: string): Promise<StepMachineState | null> {\n await this.ensureModules();\n try {\n const raw = await this.fs!.readFile(this.runPath(runId), 'utf-8');\n return JSON.parse(raw);\n } catch (err: unknown) {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n return null;\n }\n throw err;\n }\n }\n\n async deleteRunState(runId: string): Promise<void> {\n await this.ensureModules();\n try {\n await this.fs!.unlink(this.runPath(runId));\n } catch (err: unknown) {\n if ((err as NodeJS.ErrnoException).code !== 'ENOENT') throw err;\n }\n try {\n await this.fs!.unlink(this.dataPath(runId));\n } catch (err: unknown) {\n if ((err as NodeJS.ErrnoException).code !== 'ENOENT') throw err;\n }\n }\n\n async setData(runId: string, key: string, value: unknown): Promise<void> {\n await this.ensureModules();\n const allData = await this.getAllData(runId);\n allData[key] = value;\n await this.fs!.writeFile(\n this.dataPath(runId),\n JSON.stringify(allData, null, 2),\n 'utf-8'\n );\n }\n\n async getData(runId: string, key: string): Promise<unknown> {\n const allData = await this.getAllData(runId);\n return allData[key];\n }\n\n async getAllData(runId: string): Promise<Record<string, unknown>> {\n await this.ensureModules();\n try {\n const raw = await this.fs!.readFile(this.dataPath(runId), 'utf-8');\n return JSON.parse(raw);\n } catch (err: unknown) {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n return {};\n }\n throw err;\n }\n }\n\n async clearData(runId: string): Promise<void> {\n await this.ensureModules();\n try {\n await this.fs!.unlink(this.dataPath(runId));\n } catch (err: unknown) {\n if ((err as NodeJS.ErrnoException).code !== 'ENOENT') throw err;\n }\n }\n\n async listRuns(): Promise<string[]> {\n await this.ensureModules();\n try {\n const files = await this.fs!.readdir(this.directory);\n return files\n .filter(f => f.endsWith('.run.json'))\n .map(f => f.replace('.run.json', ''));\n } catch (err: unknown) {\n if ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n return [];\n }\n throw err;\n }\n }\n\n /**\n * Clear all flow data from directory\n */\n async clearAll(): Promise<void> {\n await this.ensureModules();\n const runs = await this.listRuns();\n await Promise.all(runs.map(runId => this.deleteRunState(runId)));\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- 'use strict';var i=class{prefix;constructor(t={}){if(this.prefix=t.prefix??"yamlflow",typeof localStorage>"u")throw new Error("LocalStorageStore requires localStorage (browser environment)")}runKey(t){return `${this.prefix}:run:${t}`}dataKey(t){return `${this.prefix}:data:${t}`}indexKey(){return `${this.prefix}:runs`}async saveRunState(t,e){localStorage.setItem(this.runKey(t),JSON.stringify(e));let r=await this.listRuns();r.includes(t)||(r.push(t),localStorage.setItem(this.indexKey(),JSON.stringify(r)));}async loadRunState(t){let e=localStorage.getItem(this.runKey(t));return e?JSON.parse(e):null}async deleteRunState(t){localStorage.removeItem(this.runKey(t)),localStorage.removeItem(this.dataKey(t));let r=(await this.listRuns()).filter(a=>a!==t);localStorage.setItem(this.indexKey(),JSON.stringify(r));}async setData(t,e,r){let a=await this.getAllData(t);a[e]=r,localStorage.setItem(this.dataKey(t),JSON.stringify(a));}async getData(t,e){return (await this.getAllData(t))[e]}async getAllData(t){let e=localStorage.getItem(this.dataKey(t));return e?JSON.parse(e):{}}async clearData(t){localStorage.removeItem(this.dataKey(t));}async listRuns(){let t=localStorage.getItem(this.indexKey());return t?JSON.parse(t):[]}clearAll(){let t=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r?.startsWith(this.prefix+":")&&t.push(r);}t.forEach(e=>localStorage.removeItem(e));}};exports.LocalStorageStore=i;//# sourceMappingURL=localStorage.cjs.map
2
- //# sourceMappingURL=localStorage.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/stores/localStorage.ts"],"names":["LocalStorageStore","options","runId","state","runs","raw","filtered","id","key","value","allData","keysToRemove","i"],"mappings":"aAcO,IAAMA,CAAAA,CAAN,KAAoD,CACjD,MAAA,CAER,YAAYC,CAAAA,CAAoC,EAAC,CAAG,CAIlD,GAHA,IAAA,CAAK,MAAA,CAASA,CAAAA,CAAQ,QAAU,UAAA,CAG5B,OAAO,YAAA,CAAiB,GAAA,CAC1B,MAAM,IAAI,KAAA,CAAM,+DAA+D,CAEnF,CAEQ,MAAA,CAAOC,CAAAA,CAAuB,CACpC,OAAO,CAAA,EAAG,IAAA,CAAK,MAAM,CAAA,KAAA,EAAQA,CAAK,CAAA,CACpC,CAEQ,OAAA,CAAQA,CAAAA,CAAuB,CACrC,OAAO,CAAA,EAA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,EAC1D,CACF","file":"localStorage.cjs","sourcesContent":["/**\n * yaml-flow - LocalStorage Store\n * \n * Browser localStorage-based store implementation.\n * Data persists across page reloads but is limited to ~5MB per origin.\n */\n\nimport type { StepMachineStore, StepMachineState } from '../step-machine/types.js';\n\nexport interface LocalStorageStoreOptions {\n /** Key prefix for namespacing (default: 'yamlflow') */\n prefix?: string;\n}\n\nexport class LocalStorageStore implements StepMachineStore {\n private prefix: string;\n\n constructor(options: LocalStorageStoreOptions = {}) {\n this.prefix = options.prefix ?? 'yamlflow';\n \n // Ensure localStorage is available\n if (typeof localStorage === 'undefined') {\n throw new Error('LocalStorageStore requires localStorage (browser environment)');\n }\n }\n\n private runKey(runId: string): string {\n return `${this.prefix}:run:${runId}`;\n }\n\n private dataKey(runId: string): string {\n return `${this.prefix}:data:${runId}`;\n }\n\n private indexKey(): string {\n return `${this.prefix}:runs`;\n }\n\n async saveRunState(runId: string, state: StepMachineState): Promise<void> {\n localStorage.setItem(this.runKey(runId), JSON.stringify(state));\n \n // Update run index\n const runs = await this.listRuns();\n if (!runs.includes(runId)) {\n runs.push(runId);\n localStorage.setItem(this.indexKey(), JSON.stringify(runs));\n }\n }\n\n async loadRunState(runId: string): Promise<StepMachineState | null> {\n const raw = localStorage.getItem(this.runKey(runId));\n return raw ? JSON.parse(raw) : null;\n }\n\n async deleteRunState(runId: string): Promise<void> {\n localStorage.removeItem(this.runKey(runId));\n localStorage.removeItem(this.dataKey(runId));\n \n // Update run index\n const runs = await this.listRuns();\n const filtered = runs.filter(id => id !== runId);\n localStorage.setItem(this.indexKey(), JSON.stringify(filtered));\n }\n\n async setData(runId: string, key: string, value: unknown): Promise<void> {\n const allData = await this.getAllData(runId);\n allData[key] = value;\n localStorage.setItem(this.dataKey(runId), JSON.stringify(allData));\n }\n\n async getData(runId: string, key: string): Promise<unknown> {\n const allData = await this.getAllData(runId);\n return allData[key];\n }\n\n async getAllData(runId: string): Promise<Record<string, unknown>> {\n const raw = localStorage.getItem(this.dataKey(runId));\n return raw ? JSON.parse(raw) : {};\n }\n\n async clearData(runId: string): Promise<void> {\n localStorage.removeItem(this.dataKey(runId));\n }\n\n async listRuns(): Promise<string[]> {\n const raw = localStorage.getItem(this.indexKey());\n return raw ? JSON.parse(raw) : [];\n }\n\n /**\n * Clear all flow data from localStorage\n */\n clearAll(): void {\n const keysToRemove: string[] = [];\n \n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i);\n if (key?.startsWith(this.prefix + ':')) {\n keysToRemove.push(key);\n }\n }\n \n keysToRemove.forEach(key => localStorage.removeItem(key));\n }\n}\n"]}
@@ -1,34 +0,0 @@
1
- import { l as StepMachineStore, k as StepMachineState } from '../types-ycun84cq.cjs';
2
-
3
- /**
4
- * yaml-flow - LocalStorage Store
5
- *
6
- * Browser localStorage-based store implementation.
7
- * Data persists across page reloads but is limited to ~5MB per origin.
8
- */
9
-
10
- interface LocalStorageStoreOptions {
11
- /** Key prefix for namespacing (default: 'yamlflow') */
12
- prefix?: string;
13
- }
14
- declare class LocalStorageStore implements StepMachineStore {
15
- private prefix;
16
- constructor(options?: LocalStorageStoreOptions);
17
- private runKey;
18
- private dataKey;
19
- private indexKey;
20
- saveRunState(runId: string, state: StepMachineState): Promise<void>;
21
- loadRunState(runId: string): Promise<StepMachineState | null>;
22
- deleteRunState(runId: string): Promise<void>;
23
- setData(runId: string, key: string, value: unknown): Promise<void>;
24
- getData(runId: string, key: string): Promise<unknown>;
25
- getAllData(runId: string): Promise<Record<string, unknown>>;
26
- clearData(runId: string): Promise<void>;
27
- listRuns(): Promise<string[]>;
28
- /**
29
- * Clear all flow data from localStorage
30
- */
31
- clearAll(): void;
32
- }
33
-
34
- export { LocalStorageStore, type LocalStorageStoreOptions };
@@ -1,34 +0,0 @@
1
- import { l as StepMachineStore, k as StepMachineState } from '../types-ycun84cq.js';
2
-
3
- /**
4
- * yaml-flow - LocalStorage Store
5
- *
6
- * Browser localStorage-based store implementation.
7
- * Data persists across page reloads but is limited to ~5MB per origin.
8
- */
9
-
10
- interface LocalStorageStoreOptions {
11
- /** Key prefix for namespacing (default: 'yamlflow') */
12
- prefix?: string;
13
- }
14
- declare class LocalStorageStore implements StepMachineStore {
15
- private prefix;
16
- constructor(options?: LocalStorageStoreOptions);
17
- private runKey;
18
- private dataKey;
19
- private indexKey;
20
- saveRunState(runId: string, state: StepMachineState): Promise<void>;
21
- loadRunState(runId: string): Promise<StepMachineState | null>;
22
- deleteRunState(runId: string): Promise<void>;
23
- setData(runId: string, key: string, value: unknown): Promise<void>;
24
- getData(runId: string, key: string): Promise<unknown>;
25
- getAllData(runId: string): Promise<Record<string, unknown>>;
26
- clearData(runId: string): Promise<void>;
27
- listRuns(): Promise<string[]>;
28
- /**
29
- * Clear all flow data from localStorage
30
- */
31
- clearAll(): void;
32
- }
33
-
34
- export { LocalStorageStore, type LocalStorageStoreOptions };
@@ -1,2 +0,0 @@
1
- var i=class{prefix;constructor(t={}){if(this.prefix=t.prefix??"yamlflow",typeof localStorage>"u")throw new Error("LocalStorageStore requires localStorage (browser environment)")}runKey(t){return `${this.prefix}:run:${t}`}dataKey(t){return `${this.prefix}:data:${t}`}indexKey(){return `${this.prefix}:runs`}async saveRunState(t,e){localStorage.setItem(this.runKey(t),JSON.stringify(e));let r=await this.listRuns();r.includes(t)||(r.push(t),localStorage.setItem(this.indexKey(),JSON.stringify(r)));}async loadRunState(t){let e=localStorage.getItem(this.runKey(t));return e?JSON.parse(e):null}async deleteRunState(t){localStorage.removeItem(this.runKey(t)),localStorage.removeItem(this.dataKey(t));let r=(await this.listRuns()).filter(a=>a!==t);localStorage.setItem(this.indexKey(),JSON.stringify(r));}async setData(t,e,r){let a=await this.getAllData(t);a[e]=r,localStorage.setItem(this.dataKey(t),JSON.stringify(a));}async getData(t,e){return (await this.getAllData(t))[e]}async getAllData(t){let e=localStorage.getItem(this.dataKey(t));return e?JSON.parse(e):{}}async clearData(t){localStorage.removeItem(this.dataKey(t));}async listRuns(){let t=localStorage.getItem(this.indexKey());return t?JSON.parse(t):[]}clearAll(){let t=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r?.startsWith(this.prefix+":")&&t.push(r);}t.forEach(e=>localStorage.removeItem(e));}};export{i as LocalStorageStore};//# sourceMappingURL=localStorage.js.map
2
- //# sourceMappingURL=localStorage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/stores/localStorage.ts"],"names":["LocalStorageStore","options","runId","state","runs","raw","filtered","id","key","value","allData","keysToRemove","i"],"mappings":"AAcO,IAAMA,CAAAA,CAAN,KAAoD,CACjD,MAAA,CAER,YAAYC,CAAAA,CAAoC,EAAC,CAAG,CAIlD,GAHA,IAAA,CAAK,MAAA,CAASA,CAAAA,CAAQ,QAAU,UAAA,CAG5B,OAAO,YAAA,CAAiB,GAAA,CAC1B,MAAM,IAAI,KAAA,CAAM,+DAA+D,CAEnF,CAEQ,MAAA,CAAOC,CAAAA,CAAuB,CACpC,OAAO,CAAA,EAAG,IAAA,CAAK,MAAM,CAAA,KAAA,EAAQA,CAAK,CAAA,CACpC,CAEQ,OAAA,CAAQA,CAAAA,CAAuB,CACrC,OAAO,CAAA,EAAG,IAAA,CAAK,MAAM,CAAA,MAAA,EAASA,CAAK,CAAA,CACrC,CAEQ,QAAA,EAAmB,CACzB,OAAO,CAAA,EAAG,KAAK,MAAM,CAAA,KAAA,CACvB,CAEA,MAAM,YAAA,CAAaA,CAAAA,CAAeC,CAAAA,CAAwC,CACxE,aAAa,OAAA,CAAQ,IAAA,CAAK,MAAA,CAAOD,CAAK,EAAG,IAAA,CAAK,SAAA,CAAUC,CAAK,CAAC,EAG9D,IAAMC,CAAAA,CAAO,MAAM,IAAA,CAAK,QAAA,EAAS,CAC5BA,CAAAA,CAAK,QAAA,CAASF,CAAK,CAAA,GACtBE,CAAAA,CAAK,IAAA,CAAKF,CAAK,CAAA,CACf,YAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,UAAS,CAAG,IAAA,CAAK,SAAA,CAAUE,CAAI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AAMA,CAAG,EAAI,EACjC,CAEA,MAAM,SAAA,CAAUH,CAAAA,CAA8B,CAC5C,YAAA,CAAa,WAAW,IAAA,CAAK,OAAA,CAAQA,CAAK,CAAC,EAC7C,CAEA,MAAM,QAAA,EAA8B,CAClC,IAAMG,CAAAA,CAAM,YAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,QAAA,EAAU,CAAA,CAChD,OAAOA,CAAAA,CAAM,IAAA,CAAK,KAAA,CAAMA,CAAG,EAAI,EACjC,CAKA,QAAA,EAAiB,CACf,IAAMM,CAAAA,CAAyB,EAAC,CAEhC,IAAA,IAASC,CAAAA,CAAI,CAAA,CAAGA,CAAAA,CAAI,aAAa,MAAA,CAAQA,CAAAA,EAAAA,CAAK,CAC5C,IAAMJ,CAAAA,CAAM,YAAA,CAAa,GAAA,CAAII,CAAC,EAC1BJ,CAAAA,EAAK,UAAA,CAAW,IAAA,CAAK,MAAA,CAAS,GAAG,CAAA,EACnCG,CAAAA,CAAa,IAAA,CAAKH,CAAG,EAEzB,CAEAG,CAAAA,CAAa,OAAA,CAAQH,GAAO,YAAA,CAAa,UAAA,CAAWA,CAAG,CAAC,EAC1D,CACF","file":"localStorage.js","sourcesContent":["/**\n * yaml-flow - LocalStorage Store\n * \n * Browser localStorage-based store implementation.\n * Data persists across page reloads but is limited to ~5MB per origin.\n */\n\nimport type { StepMachineStore, StepMachineState } from '../step-machine/types.js';\n\nexport interface LocalStorageStoreOptions {\n /** Key prefix for namespacing (default: 'yamlflow') */\n prefix?: string;\n}\n\nexport class LocalStorageStore implements StepMachineStore {\n private prefix: string;\n\n constructor(options: LocalStorageStoreOptions = {}) {\n this.prefix = options.prefix ?? 'yamlflow';\n \n // Ensure localStorage is available\n if (typeof localStorage === 'undefined') {\n throw new Error('LocalStorageStore requires localStorage (browser environment)');\n }\n }\n\n private runKey(runId: string): string {\n return `${this.prefix}:run:${runId}`;\n }\n\n private dataKey(runId: string): string {\n return `${this.prefix}:data:${runId}`;\n }\n\n private indexKey(): string {\n return `${this.prefix}:runs`;\n }\n\n async saveRunState(runId: string, state: StepMachineState): Promise<void> {\n localStorage.setItem(this.runKey(runId), JSON.stringify(state));\n \n // Update run index\n const runs = await this.listRuns();\n if (!runs.includes(runId)) {\n runs.push(runId);\n localStorage.setItem(this.indexKey(), JSON.stringify(runs));\n }\n }\n\n async loadRunState(runId: string): Promise<StepMachineState | null> {\n const raw = localStorage.getItem(this.runKey(runId));\n return raw ? JSON.parse(raw) : null;\n }\n\n async deleteRunState(runId: string): Promise<void> {\n localStorage.removeItem(this.runKey(runId));\n localStorage.removeItem(this.dataKey(runId));\n \n // Update run index\n const runs = await this.listRuns();\n const filtered = runs.filter(id => id !== runId);\n localStorage.setItem(this.indexKey(), JSON.stringify(filtered));\n }\n\n async setData(runId: string, key: string, value: unknown): Promise<void> {\n const allData = await this.getAllData(runId);\n allData[key] = value;\n localStorage.setItem(this.dataKey(runId), JSON.stringify(allData));\n }\n\n async getData(runId: string, key: string): Promise<unknown> {\n const allData = await this.getAllData(runId);\n return allData[key];\n }\n\n async getAllData(runId: string): Promise<Record<string, unknown>> {\n const raw = localStorage.getItem(this.dataKey(runId));\n return raw ? JSON.parse(raw) : {};\n }\n\n async clearData(runId: string): Promise<void> {\n localStorage.removeItem(this.dataKey(runId));\n }\n\n async listRuns(): Promise<string[]> {\n const raw = localStorage.getItem(this.indexKey());\n return raw ? JSON.parse(raw) : [];\n }\n\n /**\n * Clear all flow data from localStorage\n */\n clearAll(): void {\n const keysToRemove: string[] = [];\n \n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i);\n if (key?.startsWith(this.prefix + ':')) {\n keysToRemove.push(key);\n }\n }\n \n keysToRemove.forEach(key => localStorage.removeItem(key));\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/stores/memory.ts"],"names":["MemoryStore","runId","state","key","value","runData"],"mappings":"aASO,IAAMA,CAAAA,CAAN,KAA8C,CAC3C,IAAA,CAAsC,IAAI,G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KAAA,EAAc,CACZ,IAAA,CAAK,IAAA,CAAK,OAAM,CAChB,IAAA,CAAK,IAAA,CAAK,KAAA,GACZ,CACF","file":"memory.cjs","sourcesContent":["/**\n * yaml-flow - Memory Store\n * \n * In-memory store implementation. Works in both browser and Node.js.\n * Data is lost when the process exits - use for testing or short-lived flows.\n */\n\nimport type { StepMachineStore, StepMachineState } from '../step-machine/types.js';\n\nexport class MemoryStore implements StepMachineStore {\n private runs: Map<string, StepMachineState> = new Map();\n private data: Map<string, Record<string, unknown>> = new Map();\n\n async saveRunState(runId: string, state: StepMachineState): Promise<void> {\n this.runs.set(runId, { ...state });\n }\n\n async loadRunState(runId: string): Promise<StepMachineState | null> {\n const state = this.runs.get(runId);\n return state ? { ...state } : null;\n }\n\n async deleteRunState(runId: string): Promise<void> {\n this.runs.delete(runId);\n this.data.delete(runId);\n }\n\n async setData(runId: string, key: string, value: unknown): Promise<void> {\n if (!this.data.has(runId)) {\n this.data.set(runId, {});\n }\n const runData = this.data.get(runId)!;\n runData[key] = value;\n }\n\n async getData(runId: string, key: string): Promise<unknown> {\n return this.data.get(runId)?.[key];\n }\n\n async getAllData(runId: string): Promise<Record<string, unknown>> {\n return { ...(this.data.get(runId) ?? {}) };\n }\n\n async clearData(runId: string): Promise<void> {\n this.data.delete(runId);\n }\n\n async listRuns(): Promise<string[]> {\n return Array.from(this.runs.keys());\n }\n\n /**\n * Clear all data (useful for testing)\n */\n clear(): void {\n this.runs.clear();\n this.data.clear();\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/stores/memory.ts"],"names":["MemoryStore","runId","state","key","value","runData"],"mappings":"AASO,IAAMA,CAAAA,CAAN,KAA8C,CAC3C,IAAA,CAAsC,IAAI,GAAA,CAC1C,IAAA,CAA6C,IAAI,GAAA,CAEzD,MAAM,YAAA,CAAaC,CAAAA,CAAeC,CAAAA,CAAwC,CACxE,KAAK,IAAA,CAAK,GAAA,CAAID,CAAAA,CAAO,CAAE,GAAGC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works in both browser and Node.js.\n * Data is lost when the process exits - use for testing or short-lived flows.\n */\n\nimport type { StepMachineStore, StepMachineState } from '../step-machine/types.js';\n\nexport class MemoryStore implements StepMachineStore {\n private runs: Map<string, StepMachineState> = new Map();\n private data: Map<string, Record<string, unknown>> = new Map();\n\n async saveRunState(runId: string, state: StepMachineState): Promise<void> {\n this.runs.set(runId, { ...state });\n }\n\n async loadRunState(runId: string): Promise<StepMachineState | null> {\n const state = this.runs.get(runId);\n return state ? { ...state } : null;\n }\n\n async deleteRunState(runId: string): Promise<void> {\n this.runs.delete(runId);\n this.data.delete(runId);\n }\n\n async setData(runId: string, key: string, value: unknown): Promise<void> {\n if (!this.data.has(runId)) {\n this.data.set(runId, {});\n }\n const runData = this.data.get(runId)!;\n runData[key] = value;\n }\n\n async getData(runId: string, key: string): Promise<unknown> {\n return this.data.get(runId)?.[key];\n }\n\n async getAllData(runId: string): Promise<Record<string, unknown>> {\n return { ...(this.data.get(runId) ?? {}) };\n }\n\n async clearData(runId: string): Promise<void> {\n this.data.delete(runId);\n }\n\n async listRuns(): Promise<string[]> {\n return Array.from(this.runs.keys());\n }\n\n /**\n * Clear all data (useful for testing)\n */\n clear(): void {\n this.runs.clear();\n this.data.clear();\n }\n}\n"]}
@@ -1,135 +0,0 @@
1
- import { G as GraphConfig, c as ExecutionState, T as TaskConfig, e as GraphEngineStore } from './types-BBhqYGhE.cjs';
2
-
3
- /**
4
- * Continuous Event Graph — Types
5
- *
6
- * A long-lived, evolving event-graph where both config and state
7
- * mutate over time. The single `LiveGraph` type bundles them.
8
- *
9
- * Events are shared with event-graph (task-started, task-completed, etc.).
10
- * Graph mutations (addNode, removeNode, etc.) are unique to this mode.
11
- */
12
-
13
- /**
14
- * The single evolving object for a continuous-mode graph.
15
- * Bundles config + state so they can't get out of sync.
16
- */
17
- interface LiveGraph {
18
- /** The current graph configuration (evolves as nodes are added/removed) */
19
- config: GraphConfig;
20
- /** The current execution state (evolves as events arrive) */
21
- state: ExecutionState;
22
- }
23
- interface ScheduleResult {
24
- /** Tasks ready to dispatch now — all requires satisfied */
25
- eligible: string[];
26
- /** Tasks waiting on tokens that some producer will eventually provide (normal) */
27
- pending: PendingTask[];
28
- /** Tasks waiting on tokens that NO task can produce (caller's problem) */
29
- unresolved: UnresolvedDependency[];
30
- /** Tasks waiting on tokens whose producer FAILED (caller's problem) */
31
- blocked: BlockedTask[];
32
- /** Token conflicts: multiple tasks produce the same token */
33
- conflicts: Record<string, string[]>;
34
- }
35
- interface PendingTask {
36
- taskName: string;
37
- /** Tokens this task needs that haven't been produced yet but have a viable producer */
38
- waitingOn: string[];
39
- }
40
- interface UnresolvedDependency {
41
- taskName: string;
42
- /** Tokens this task needs that no task in the graph can produce */
43
- missingTokens: string[];
44
- }
45
- interface BlockedTask {
46
- taskName: string;
47
- /** Tokens this task needs whose only producer has failed */
48
- failedTokens: string[];
49
- /** The tasks that failed and would have produced those tokens */
50
- failedProducers: string[];
51
- }
52
- interface LiveGraphHealth {
53
- /** Total number of tasks in the graph */
54
- totalNodes: number;
55
- /** Task counts by status */
56
- running: number;
57
- completed: number;
58
- failed: number;
59
- waiting: number;
60
- notStarted: number;
61
- /** Number of disabled (inactivated) nodes */
62
- disabled: number;
63
- /** Number of tasks with unresolvable dependencies */
64
- unresolvedCount: number;
65
- /** Number of tasks whose producer has failed */
66
- blockedCount: number;
67
- /** Tokens that no task produces (open dependencies) */
68
- openDependencies: string[];
69
- /** Cycles detected in the current graph (if any) */
70
- cycles: string[][];
71
- /** Tokens produced by multiple tasks */
72
- conflictTokens: string[];
73
- }
74
- interface NodeInfo {
75
- /** Node name */
76
- name: string;
77
- /** The task configuration */
78
- config: TaskConfig;
79
- /** The current runtime state */
80
- state: GraphEngineStore;
81
- }
82
- interface LiveGraphSnapshot {
83
- /** Schema version for forward compatibility */
84
- version: number;
85
- /** The graph config at snapshot time */
86
- config: GraphConfig;
87
- /** The execution state at snapshot time */
88
- state: ExecutionState;
89
- /** ISO timestamp of when the snapshot was taken */
90
- snapshotAt: string;
91
- }
92
- interface UnreachableTokensResult {
93
- tokens: {
94
- /** The token that cannot be produced */
95
- token: string;
96
- /** Why it's unreachable */
97
- reason: 'no-producer' | 'all-producers-failed' | 'transitive';
98
- /** Tasks that could produce it (but are themselves unreachable/failed) */
99
- producers: string[];
100
- }[];
101
- }
102
- interface UnreachableNodesResult {
103
- nodes: {
104
- /** The node that can never become eligible */
105
- nodeName: string;
106
- /** Unreachable tokens this node requires (empty if the node itself is failed/disabled) */
107
- missingTokens: string[];
108
- }[];
109
- }
110
- interface UpstreamResult {
111
- /** The target node being inspected */
112
- nodeName: string;
113
- /** All upstream nodes that transitively feed into the target */
114
- nodes: {
115
- nodeName: string;
116
- /** Tokens this node provides that are in the dependency chain */
117
- providesTokens: string[];
118
- }[];
119
- /** All tokens in the upstream dependency chain */
120
- tokens: string[];
121
- }
122
- interface DownstreamResult {
123
- /** The target node being inspected */
124
- nodeName: string;
125
- /** All downstream nodes that transitively depend on the target */
126
- nodes: {
127
- nodeName: string;
128
- /** Tokens this node requires that are in the dependency chain */
129
- requiresTokens: string[];
130
- }[];
131
- /** All tokens in the downstream dependency chain */
132
- tokens: string[];
133
- }
134
-
135
- export type { BlockedTask as B, DownstreamResult as D, LiveGraph as L, NodeInfo as N, PendingTask as P, ScheduleResult as S, UnreachableNodesResult as U, LiveGraphHealth as a, LiveGraphSnapshot as b, UnreachableTokensResult as c, UnresolvedDependency as d, UpstreamResult as e };
@@ -1,135 +0,0 @@
1
- import { G as GraphConfig, c as ExecutionState, T as TaskConfig, e as GraphEngineStore } from './types-BBhqYGhE.js';
2
-
3
- /**
4
- * Continuous Event Graph — Types
5
- *
6
- * A long-lived, evolving event-graph where both config and state
7
- * mutate over time. The single `LiveGraph` type bundles them.
8
- *
9
- * Events are shared with event-graph (task-started, task-completed, etc.).
10
- * Graph mutations (addNode, removeNode, etc.) are unique to this mode.
11
- */
12
-
13
- /**
14
- * The single evolving object for a continuous-mode graph.
15
- * Bundles config + state so they can't get out of sync.
16
- */
17
- interface LiveGraph {
18
- /** The current graph configuration (evolves as nodes are added/removed) */
19
- config: GraphConfig;
20
- /** The current execution state (evolves as events arrive) */
21
- state: ExecutionState;
22
- }
23
- interface ScheduleResult {
24
- /** Tasks ready to dispatch now — all requires satisfied */
25
- eligible: string[];
26
- /** Tasks waiting on tokens that some producer will eventually provide (normal) */
27
- pending: PendingTask[];
28
- /** Tasks waiting on tokens that NO task can produce (caller's problem) */
29
- unresolved: UnresolvedDependency[];
30
- /** Tasks waiting on tokens whose producer FAILED (caller's problem) */
31
- blocked: BlockedTask[];
32
- /** Token conflicts: multiple tasks produce the same token */
33
- conflicts: Record<string, string[]>;
34
- }
35
- interface PendingTask {
36
- taskName: string;
37
- /** Tokens this task needs that haven't been produced yet but have a viable producer */
38
- waitingOn: string[];
39
- }
40
- interface UnresolvedDependency {
41
- taskName: string;
42
- /** Tokens this task needs that no task in the graph can produce */
43
- missingTokens: string[];
44
- }
45
- interface BlockedTask {
46
- taskName: string;
47
- /** Tokens this task needs whose only producer has failed */
48
- failedTokens: string[];
49
- /** The tasks that failed and would have produced those tokens */
50
- failedProducers: string[];
51
- }
52
- interface LiveGraphHealth {
53
- /** Total number of tasks in the graph */
54
- totalNodes: number;
55
- /** Task counts by status */
56
- running: number;
57
- completed: number;
58
- failed: number;
59
- waiting: number;
60
- notStarted: number;
61
- /** Number of disabled (inactivated) nodes */
62
- disabled: number;
63
- /** Number of tasks with unresolvable dependencies */
64
- unresolvedCount: number;
65
- /** Number of tasks whose producer has failed */
66
- blockedCount: number;
67
- /** Tokens that no task produces (open dependencies) */
68
- openDependencies: string[];
69
- /** Cycles detected in the current graph (if any) */
70
- cycles: string[][];
71
- /** Tokens produced by multiple tasks */
72
- conflictTokens: string[];
73
- }
74
- interface NodeInfo {
75
- /** Node name */
76
- name: string;
77
- /** The task configuration */
78
- config: TaskConfig;
79
- /** The current runtime state */
80
- state: GraphEngineStore;
81
- }
82
- interface LiveGraphSnapshot {
83
- /** Schema version for forward compatibility */
84
- version: number;
85
- /** The graph config at snapshot time */
86
- config: GraphConfig;
87
- /** The execution state at snapshot time */
88
- state: ExecutionState;
89
- /** ISO timestamp of when the snapshot was taken */
90
- snapshotAt: string;
91
- }
92
- interface UnreachableTokensResult {
93
- tokens: {
94
- /** The token that cannot be produced */
95
- token: string;
96
- /** Why it's unreachable */
97
- reason: 'no-producer' | 'all-producers-failed' | 'transitive';
98
- /** Tasks that could produce it (but are themselves unreachable/failed) */
99
- producers: string[];
100
- }[];
101
- }
102
- interface UnreachableNodesResult {
103
- nodes: {
104
- /** The node that can never become eligible */
105
- nodeName: string;
106
- /** Unreachable tokens this node requires (empty if the node itself is failed/disabled) */
107
- missingTokens: string[];
108
- }[];
109
- }
110
- interface UpstreamResult {
111
- /** The target node being inspected */
112
- nodeName: string;
113
- /** All upstream nodes that transitively feed into the target */
114
- nodes: {
115
- nodeName: string;
116
- /** Tokens this node provides that are in the dependency chain */
117
- providesTokens: string[];
118
- }[];
119
- /** All tokens in the upstream dependency chain */
120
- tokens: string[];
121
- }
122
- interface DownstreamResult {
123
- /** The target node being inspected */
124
- nodeName: string;
125
- /** All downstream nodes that transitively depend on the target */
126
- nodes: {
127
- nodeName: string;
128
- /** Tokens this node requires that are in the dependency chain */
129
- requiresTokens: string[];
130
- }[];
131
- /** All tokens in the downstream dependency chain */
132
- tokens: string[];
133
- }
134
-
135
- export type { BlockedTask as B, DownstreamResult as D, LiveGraph as L, NodeInfo as N, PendingTask as P, ScheduleResult as S, UnreachableNodesResult as U, LiveGraphHealth as a, LiveGraphSnapshot as b, UnreachableTokensResult as c, UnresolvedDependency as d, UpstreamResult as e };
@@ -1,201 +0,0 @@
1
- #!/usr/bin/env python3
2
- """portfolio-tracker-fetch-prices.py
3
-
4
- Task executor for the portfolio board demo.
5
- Handles run-source-fetch requests for source_defs with kind: "mock-quotes".
6
- Generates random prices (2dp, 10.00-999.99) for each projected ticker.
7
-
8
- Subcommands:
9
- run-source-fetch --in-ref <::kind::value> --out-ref <::kind::value> --err-ref <::kind::value>
10
- validate-source-def --in <source.json>
11
- describe-capabilities
12
-
13
- Uses the public storage adapter for all storage and callback operations.
14
- The executor does NOT contain transport-specific callback logic.
15
- """
16
-
17
- from __future__ import annotations
18
-
19
- import argparse
20
- import json
21
- import os
22
- import random
23
- import sys
24
- import time
25
- from typing import Any
26
-
27
- # Add pycli to path so we can import the public storage adapter.
28
- _REPO_ROOT = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', '..', '..'))
29
- if _REPO_ROOT not in sys.path:
30
- sys.path.insert(0, _REPO_ROOT)
31
-
32
- from pycli.sub.public_storage_adapter import ( # noqa: E402
33
- parse_ref,
34
- serialize_ref,
35
- blob_storage_for_ref,
36
- report_complete,
37
- report_failed,
38
- KindValueRef,
39
- )
40
-
41
-
42
- def _parse_ref_str(ref: str) -> KindValueRef:
43
- """Convenience: parse a CLI ref string."""
44
- return parse_ref(ref)
45
-
46
-
47
- def validate_source_def(source_def: dict[str, Any]) -> dict[str, Any]:
48
- errors: list[str] = []
49
-
50
- if source_def.get("kind") != "mock-quotes":
51
- errors.append(f"kind must be \"mock-quotes\"; got \"{source_def.get('kind')}\".")
52
- if not isinstance(source_def.get("bindTo"), str) or not source_def.get("bindTo"):
53
- errors.append("bindTo is required and must be a string.")
54
- if not isinstance(source_def.get("outputFile"), str) or not source_def.get("outputFile"):
55
- errors.append("outputFile is required and must be a string.")
56
- projections = source_def.get("projections")
57
- if not isinstance(projections, dict) or not isinstance(projections.get("tickers"), str):
58
- errors.append("projections.tickers is required and must be a JSONata expression string.")
59
-
60
- return {"ok": len(errors) == 0, "errors": errors}
61
-
62
-
63
- def cmd_validate_source_def(args: argparse.Namespace) -> int:
64
- if not os.path.exists(args.input):
65
- print(json.dumps({"ok": False, "errors": [f"Input file not found: {args.input}"]}))
66
- return 1
67
-
68
- try:
69
- with open(args.input, "r", encoding="utf-8") as f:
70
- source_def = json.load(f)
71
- except Exception as e:
72
- print(json.dumps({"ok": False, "errors": [f"Cannot parse source file: {e}"]}))
73
- return 1
74
-
75
- result = validate_source_def(source_def if isinstance(source_def, dict) else {})
76
- print(json.dumps(result))
77
- return 0 if result["ok"] else 1
78
-
79
-
80
- def cmd_describe_capabilities(_: argparse.Namespace) -> int:
81
- capabilities = {
82
- "version": "1.0",
83
- "executor": "portfolio-tracker-fetch-prices",
84
- "subcommands": ["run-source-fetch", "validate-source-def", "describe-capabilities"],
85
- "sourceKinds": {
86
- "mock-quotes": {
87
- "description": "Generates random mock market prices (10.00-999.99) for each ticker in _projections.tickers.",
88
- "inputSchema": {
89
- "kind": {"type": "string", "required": True, "description": "Must be \"mock-quotes\"."},
90
- "bindTo": {"type": "string", "required": True, "description": "Token name for the output binding."},
91
- "outputFile": {"type": "string", "required": True, "description": "Relative path to write prices JSON."},
92
- "projections": {
93
- "type": "object",
94
- "required": True,
95
- "properties": {
96
- "tickers": {
97
- "type": "string",
98
- "required": True,
99
- "description": "JSONata expression resolving to a string[] of ticker symbols.",
100
- }
101
- },
102
- },
103
- },
104
- "outputShape": "{ [ticker: string]: number }",
105
- }
106
- },
107
- }
108
- print(json.dumps(capabilities, indent=2, ensure_ascii=True))
109
- return 0
110
-
111
-
112
- def cmd_run_source_fetch(args: argparse.Namespace) -> int:
113
- in_ref = _parse_ref_str(args.in_ref)
114
- out_ref = _parse_ref_str(args.out_ref)
115
- err_ref = _parse_ref_str(args.err_ref)
116
-
117
- in_storage = blob_storage_for_ref(in_ref)
118
- out_storage = blob_storage_for_ref(out_ref)
119
- err_storage = blob_storage_for_ref(err_ref)
120
-
121
- raw_in = in_storage.read(in_ref.value)
122
- if not raw_in:
123
- print(f"[portfolio-tracker-fetch-prices] input envelope not found at: {args.in_ref}", file=sys.stderr)
124
- return 1
125
-
126
- envelope = json.loads(raw_in)
127
- callback = envelope.get("callback") if isinstance(envelope, dict) else None
128
-
129
- def safe_fail(msg: str) -> int:
130
- try:
131
- err_storage.write(err_ref.value, msg)
132
- except Exception:
133
- pass
134
- if isinstance(callback, dict):
135
- try:
136
- report_failed(callback, msg)
137
- return 0
138
- except Exception as e:
139
- print(f"[portfolio-tracker-fetch-prices] callback fail: {e}", file=sys.stderr)
140
- return 1
141
- return 1
142
-
143
- try:
144
- source_def = envelope.get("source_def") if isinstance(envelope, dict) else None
145
- if not isinstance(source_def, dict):
146
- source_def = envelope if isinstance(envelope, dict) else {}
147
-
148
- if source_def.get("kind") != "mock-quotes":
149
- raise ValueError(f"Unsupported source kind: expected \"mock-quotes\", got \"{source_def.get('kind')}\"")
150
-
151
- projections = source_def.get("_projections")
152
- tickers = projections.get("tickers") if isinstance(projections, dict) else None
153
- if not isinstance(tickers, list):
154
- raise ValueError("sourceDef._projections.tickers is missing or not an array")
155
-
156
- time.sleep(0.2 + random.random() * 0.1)
157
-
158
- prices: dict[str, float] = {}
159
- for ticker in tickers:
160
- prices[str(ticker)] = round(10 + random.random() * 989.99, 2)
161
-
162
- out_storage.write(out_ref.value, json.dumps(prices, ensure_ascii=True))
163
- print(f"[portfolio-tracker-fetch-prices] wrote prices for: {', '.join([str(t) for t in tickers])}")
164
-
165
- if isinstance(callback, dict):
166
- report_complete(callback, out_ref)
167
- return 0
168
- except Exception as e:
169
- msg = str(e)
170
- print(f"[portfolio-tracker-fetch-prices] error: {msg}", file=sys.stderr)
171
- return safe_fail(msg)
172
-
173
-
174
- def build_parser() -> argparse.ArgumentParser:
175
- parser = argparse.ArgumentParser(prog="portfolio-tracker-fetch-prices")
176
- sub = parser.add_subparsers(dest="command", required=True)
177
-
178
- run_cmd = sub.add_parser("run-source-fetch")
179
- run_cmd.add_argument("--in-ref", required=True)
180
- run_cmd.add_argument("--out-ref", required=True)
181
- run_cmd.add_argument("--err-ref", required=True)
182
- run_cmd.set_defaults(handler=cmd_run_source_fetch)
183
-
184
- val_cmd = sub.add_parser("validate-source-def")
185
- val_cmd.add_argument("--in", dest="input", required=True)
186
- val_cmd.set_defaults(handler=cmd_validate_source_def)
187
-
188
- cap_cmd = sub.add_parser("describe-capabilities")
189
- cap_cmd.set_defaults(handler=cmd_describe_capabilities)
190
-
191
- return parser
192
-
193
-
194
- def main(argv: list[str] | None = None) -> int:
195
- parser = build_parser()
196
- args = parser.parse_args(argv)
197
- return args.handler(args)
198
-
199
-
200
- if __name__ == "__main__":
201
- raise SystemExit(main())