yaml-flow 7.0.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) 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 -3307
  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/cli/browser-api/board-live-cards-browser-adapter.js +3 -0
  8. package/{dist/cli → cli}/browser-api/card-store-browser-api.d.ts +1 -2
  9. package/{dist/cli → cli}/browser-api/card-store-browser-api.js +1 -1
  10. package/cli/execution-interface-C_A6WCiK.d.ts +284 -0
  11. package/cli/node/artifacts-store-cli.js +11 -0
  12. package/cli/node/batch-runner-cli.js +3 -0
  13. package/cli/node/board-live-cards-cli.js +15 -0
  14. package/cli/node/card-store-cli.js +8 -0
  15. package/{dist/cli → cli}/node/execution-adapter.d.ts +3 -3
  16. package/cli/node/execution-adapter.js +3 -0
  17. package/{dist/cli → cli}/node/fs-board-adapter.d.ts +24 -11
  18. package/cli/node/fs-board-adapter.js +14 -0
  19. package/{dist/cli → cli}/node/source-cli-task-executor.js +2 -2
  20. package/cli/node/step-machine-cli.d.ts +7 -0
  21. package/cli/node/step-machine-cli.js +5 -0
  22. package/{dist/board-live-cards-public-CW5074xr.d.cts → cli/types-CziUxkiv.d.ts} +69 -7
  23. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/card-store-ref.json +1 -0
  24. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/chat-handler.json +1 -0
  25. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/outputs-store-ref.json +1 -0
  26. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/task-executor.json +1 -0
  27. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/graph.json +29 -0
  28. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/lastJournalProcessedId.json +1 -0
  29. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime-out/.outputs/status.json +25 -0
  30. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-market-prices/computed_values.json +67 -0
  31. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio/computed_values.json +1 -0
  32. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio-value/computed_values.json +52 -0
  33. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/holdings.json +22 -0
  34. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/positions.json +46 -0
  35. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/quotes.json +35 -0
  36. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/status.json +113 -0
  37. package/examples/{example-board/cards/card-market-prices.json → board/cards/cardT-market-prices.json} +2 -2
  38. package/examples/{example-board/cards/card-portfolio.json → board/cards/cardT-portfolio.json} +3 -13
  39. package/examples/{example-board → board}/demo-server-config.json +0 -1
  40. package/examples/{example-board → board}/demo-server.js +70 -72
  41. package/examples/{example-board → board}/demo-shell-with-server.html +3 -3
  42. package/examples/{example-board → board}/demo-task-executor.js +75 -32
  43. package/examples/board/gandalf-cards/card-source-kinds.json +36 -0
  44. package/examples/board/gandalf-cards/cards/_index.json +7 -0
  45. package/examples/board/gandalf-cards/cards/card-source-kinds.json +64 -0
  46. package/examples/board/source-def-flows/copilot.flow.json +33 -0
  47. package/examples/board/source-def-flows/mock.flow.json +35 -0
  48. package/examples/board/source-def-flows/url-list.flow.json +33 -0
  49. package/examples/board/source-def-flows/url.flow.json +33 -0
  50. package/examples/board/source-def-flows/workiq.flow.json +34 -0
  51. package/examples/board/source-def-handlers/copilot-source-handler.js +141 -0
  52. package/examples/board/source-def-handlers/http-source-handler.js +145 -0
  53. package/examples/board/source_def_flows.json +249 -0
  54. package/examples/board/test/demo-http-test.js +317 -0
  55. package/examples/{example-board → board-local}/demo-shell-localstorage.html +4 -4
  56. package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/handlers}/portfolio-tracker-fetch-prices.js +1 -1
  57. package/examples/{browser/boards/portfolio-tracker/portfolio-tracker-public.js → portfolio-tracker/portfolio-tracker.js} +11 -14
  58. package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/test}/portfolio-t4.js +32 -50
  59. package/lib/artifacts-store-lib-public-BABrgFkV.d.ts +119 -0
  60. package/lib/artifacts-store-lib-public-DGa8BpJT.d.cts +119 -0
  61. package/lib/artifacts-store-public.cjs +2 -0
  62. package/lib/artifacts-store-public.d.cts +5 -0
  63. package/lib/artifacts-store-public.d.ts +5 -0
  64. package/lib/artifacts-store-public.js +2 -0
  65. package/lib/board-live-cards-node.cjs +14 -0
  66. package/{dist/cli/node/execution-adapter.d.cts → lib/board-live-cards-node.d.cts} +45 -85
  67. package/lib/board-live-cards-node.d.ts +134 -0
  68. package/lib/board-live-cards-node.js +14 -0
  69. package/lib/board-live-cards-public-BnmRAbQV.d.cts +383 -0
  70. package/{dist/board-live-cards-public-hnZo0mAf.d.ts → lib/board-live-cards-public-CsmYrvpd.d.ts} +142 -77
  71. package/lib/board-live-cards-public.cjs +3 -0
  72. package/lib/board-live-cards-public.d.cts +4 -0
  73. package/lib/board-live-cards-public.d.ts +4 -0
  74. package/lib/board-live-cards-public.js +3 -0
  75. package/lib/board-live-cards-server-runtime.cjs +9 -0
  76. package/lib/board-live-cards-server-runtime.d.cts +6 -0
  77. package/lib/board-live-cards-server-runtime.d.ts +6 -0
  78. package/lib/board-live-cards-server-runtime.js +9 -0
  79. package/lib/board-livegraph-runtime/index.cjs +3 -0
  80. package/{dist → lib}/board-livegraph-runtime/index.d.cts +1 -2
  81. package/{dist → lib}/board-livegraph-runtime/index.d.ts +1 -2
  82. package/lib/board-livegraph-runtime/index.js +3 -0
  83. package/lib/board-worker-adapter.cjs +10 -0
  84. package/{dist/storage-refs.d.cts → lib/board-worker-adapter.d.cts} +5 -5
  85. package/{dist/storage-refs.d.ts → lib/board-worker-adapter.d.ts} +5 -5
  86. package/lib/board-worker-adapter.js +10 -0
  87. package/{dist → lib}/card-compute/index.cjs +1 -1
  88. package/{dist → lib}/card-compute/index.js +1 -1
  89. package/lib/card-store-public.cjs +2 -0
  90. package/lib/card-store-public.d.cts +61 -0
  91. package/lib/card-store-public.d.ts +61 -0
  92. package/lib/card-store-public.js +2 -0
  93. package/lib/card-validation.cjs +10 -0
  94. package/lib/card-validation.d.cts +35 -0
  95. package/lib/card-validation.d.ts +35 -0
  96. package/lib/card-validation.js +10 -0
  97. package/{dist/constants-oCEbNpul.d.ts → lib/constants-BPVLb3Es.d.ts} +1 -1
  98. package/{dist/constants-BzZUyYlp.d.cts → lib/constants-DXxsRN9y.d.cts} +1 -1
  99. package/{dist → lib}/continuous-event-graph/index.cjs +2 -2
  100. package/{dist → lib}/continuous-event-graph/index.d.cts +3 -5
  101. package/{dist → lib}/continuous-event-graph/index.d.ts +3 -5
  102. package/{dist → lib}/continuous-event-graph/index.js +2 -2
  103. package/{dist → lib}/event-graph/index.d.cts +2 -2
  104. package/{dist → lib}/event-graph/index.d.ts +2 -2
  105. package/lib/execution-refs.cjs +3 -0
  106. package/{dist → lib}/execution-refs.d.cts +38 -14
  107. package/{dist → lib}/execution-refs.d.ts +38 -14
  108. package/lib/execution-refs.js +3 -0
  109. package/lib/index.cjs +25 -0
  110. package/{dist → lib}/index.d.cts +7 -8
  111. package/{dist → lib}/index.d.ts +7 -8
  112. package/lib/index.js +25 -0
  113. package/{dist/live-cards-bridge-BXbVTsna.d.cts → lib/live-cards-bridge-DC_ZU0eS.d.ts} +134 -3
  114. package/{dist/live-cards-bridge-Ds28XR15.d.ts → lib/live-cards-bridge-b25aAVvE.d.cts} +134 -3
  115. package/lib/loader-CuuLjxVA.d.cts +42 -0
  116. package/lib/loader-Zborm2pq.d.ts +42 -0
  117. package/lib/server-runtime/index.cjs +9 -0
  118. package/{dist → lib}/server-runtime/index.d.cts +4 -4
  119. package/{dist → lib}/server-runtime/index.d.ts +4 -4
  120. package/lib/server-runtime/index.js +9 -0
  121. package/lib/step-machine/index.d.cts +64 -0
  122. package/lib/step-machine/index.d.ts +64 -0
  123. package/lib/step-machine-public/index.cjs +5 -0
  124. package/{dist → lib}/step-machine-public/index.d.cts +21 -1
  125. package/{dist → lib}/step-machine-public/index.d.ts +21 -1
  126. package/lib/step-machine-public/index.js +5 -0
  127. package/lib/storage-interface-BhAON-gW.d.cts +84 -0
  128. package/lib/storage-interface-BhAON-gW.d.ts +84 -0
  129. package/lib/stores/index.cjs +3 -0
  130. package/lib/stores/index.d.cts +4 -0
  131. package/lib/stores/index.d.ts +4 -0
  132. package/lib/stores/index.js +3 -0
  133. package/lib/stores/kv.cjs +3 -0
  134. package/lib/stores/kv.d.cts +32 -0
  135. package/lib/stores/kv.d.ts +32 -0
  136. package/lib/stores/kv.js +3 -0
  137. package/{dist → lib}/stores/memory.d.cts +1 -1
  138. package/{dist → lib}/stores/memory.d.ts +1 -1
  139. package/{dist/types-B1ZRa4aI.d.ts → lib/types-CBxkYuLY.d.ts} +2 -1
  140. package/{dist/types-ycun84cq.d.cts → lib/types-DQ1bKuB1.d.cts} +11 -0
  141. package/{dist/types-ycun84cq.d.ts → lib/types-DQ1bKuB1.d.ts} +11 -0
  142. package/{dist/types-BxEFcVK9.d.cts → lib/types-DkFvgxwq.d.cts} +2 -1
  143. package/package.json +79 -119
  144. package/board-live-cards-cli.js +0 -37
  145. package/browser/board-livecards-client.js.map +0 -1
  146. package/browser/board-livecards-localstorage.js.map +0 -1
  147. package/browser/board-livegraph-engine.js +0 -3
  148. package/browser/board-livegraph-engine.js.map +0 -1
  149. package/browser/card-compute.js +0 -266
  150. package/browser/compute-jsonata.js.map +0 -1
  151. package/card-store.js +0 -37
  152. package/dist/batch/index.cjs.map +0 -1
  153. package/dist/batch/index.js.map +0 -1
  154. package/dist/board-live-cards-lib-Bg6EvCo5.d.cts +0 -136
  155. package/dist/board-live-cards-lib-jM2uYG1v.d.ts +0 -136
  156. package/dist/board-livegraph-runtime/index.cjs +0 -3
  157. package/dist/board-livegraph-runtime/index.cjs.map +0 -1
  158. package/dist/board-livegraph-runtime/index.js +0 -3
  159. package/dist/board-livegraph-runtime/index.js.map +0 -1
  160. package/dist/card-compute/index.cjs.map +0 -1
  161. package/dist/card-compute/index.js.map +0 -1
  162. package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs +0 -3
  163. package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs.map +0 -1
  164. package/dist/cli/browser-api/board-live-cards-browser-adapter.d.cts +0 -37
  165. package/dist/cli/browser-api/board-live-cards-browser-adapter.js +0 -3
  166. package/dist/cli/browser-api/board-live-cards-browser-adapter.js.map +0 -1
  167. package/dist/cli/browser-api/card-store-browser-api.cjs +0 -2
  168. package/dist/cli/browser-api/card-store-browser-api.cjs.map +0 -1
  169. package/dist/cli/browser-api/card-store-browser-api.d.cts +0 -26
  170. package/dist/cli/browser-api/card-store-browser-api.js.map +0 -1
  171. package/dist/cli/node/artifacts-store-cli.cjs +0 -11
  172. package/dist/cli/node/artifacts-store-cli.cjs.map +0 -1
  173. package/dist/cli/node/artifacts-store-cli.d.cts +0 -8
  174. package/dist/cli/node/artifacts-store-cli.js +0 -11
  175. package/dist/cli/node/artifacts-store-cli.js.map +0 -1
  176. package/dist/cli/node/board-live-cards-cli.cjs +0 -15
  177. package/dist/cli/node/board-live-cards-cli.cjs.map +0 -1
  178. package/dist/cli/node/board-live-cards-cli.d.cts +0 -20
  179. package/dist/cli/node/board-live-cards-cli.js +0 -15
  180. package/dist/cli/node/board-live-cards-cli.js.map +0 -1
  181. package/dist/cli/node/card-store-cli.cjs +0 -8
  182. package/dist/cli/node/card-store-cli.cjs.map +0 -1
  183. package/dist/cli/node/card-store-cli.d.cts +0 -15
  184. package/dist/cli/node/card-store-cli.js +0 -8
  185. package/dist/cli/node/card-store-cli.js.map +0 -1
  186. package/dist/cli/node/execution-adapter.cjs +0 -3
  187. package/dist/cli/node/execution-adapter.cjs.map +0 -1
  188. package/dist/cli/node/execution-adapter.js +0 -3
  189. package/dist/cli/node/execution-adapter.js.map +0 -1
  190. package/dist/cli/node/fs-board-adapter.cjs +0 -14
  191. package/dist/cli/node/fs-board-adapter.cjs.map +0 -1
  192. package/dist/cli/node/fs-board-adapter.d.cts +0 -204
  193. package/dist/cli/node/fs-board-adapter.js +0 -14
  194. package/dist/cli/node/fs-board-adapter.js.map +0 -1
  195. package/dist/cli/node/source-cli-task-executor.cjs +0 -11
  196. package/dist/cli/node/source-cli-task-executor.cjs.map +0 -1
  197. package/dist/cli/node/source-cli-task-executor.js.map +0 -1
  198. package/dist/config/index.cjs.map +0 -1
  199. package/dist/config/index.js.map +0 -1
  200. package/dist/continuous-event-graph/index.cjs.map +0 -1
  201. package/dist/continuous-event-graph/index.js.map +0 -1
  202. package/dist/event-graph/index.cjs.map +0 -1
  203. package/dist/event-graph/index.js.map +0 -1
  204. package/dist/execution-refs.cjs +0 -3
  205. package/dist/execution-refs.cjs.map +0 -1
  206. package/dist/execution-refs.js +0 -3
  207. package/dist/execution-refs.js.map +0 -1
  208. package/dist/index.cjs +0 -30
  209. package/dist/index.cjs.map +0 -1
  210. package/dist/index.js +0 -30
  211. package/dist/index.js.map +0 -1
  212. package/dist/inference/index.cjs +0 -7
  213. package/dist/inference/index.cjs.map +0 -1
  214. package/dist/inference/index.d.cts +0 -229
  215. package/dist/inference/index.d.ts +0 -229
  216. package/dist/inference/index.js +0 -7
  217. package/dist/inference/index.js.map +0 -1
  218. package/dist/server-runtime/index.cjs +0 -9
  219. package/dist/server-runtime/index.cjs.map +0 -1
  220. package/dist/server-runtime/index.js +0 -9
  221. package/dist/server-runtime/index.js.map +0 -1
  222. package/dist/step-machine/index.cjs.map +0 -1
  223. package/dist/step-machine/index.d.cts +0 -102
  224. package/dist/step-machine/index.d.ts +0 -102
  225. package/dist/step-machine/index.js.map +0 -1
  226. package/dist/step-machine-public/index.cjs +0 -2
  227. package/dist/step-machine-public/index.cjs.map +0 -1
  228. package/dist/step-machine-public/index.js +0 -2
  229. package/dist/step-machine-public/index.js.map +0 -1
  230. package/dist/storage-refs.cjs +0 -10
  231. package/dist/storage-refs.cjs.map +0 -1
  232. package/dist/storage-refs.js +0 -10
  233. package/dist/storage-refs.js.map +0 -1
  234. package/dist/stores/file.cjs +0 -2
  235. package/dist/stores/file.cjs.map +0 -1
  236. package/dist/stores/file.d.cts +0 -36
  237. package/dist/stores/file.d.ts +0 -36
  238. package/dist/stores/file.js +0 -2
  239. package/dist/stores/file.js.map +0 -1
  240. package/dist/stores/index.cjs +0 -2
  241. package/dist/stores/index.cjs.map +0 -1
  242. package/dist/stores/index.d.cts +0 -4
  243. package/dist/stores/index.d.ts +0 -4
  244. package/dist/stores/index.js +0 -2
  245. package/dist/stores/index.js.map +0 -1
  246. package/dist/stores/localStorage.cjs +0 -2
  247. package/dist/stores/localStorage.cjs.map +0 -1
  248. package/dist/stores/localStorage.d.cts +0 -34
  249. package/dist/stores/localStorage.d.ts +0 -34
  250. package/dist/stores/localStorage.js +0 -2
  251. package/dist/stores/localStorage.js.map +0 -1
  252. package/dist/stores/memory.cjs.map +0 -1
  253. package/dist/stores/memory.js.map +0 -1
  254. package/dist/types-CHSdoAAA.d.cts +0 -135
  255. package/dist/types-CoW0gQl3.d.ts +0 -135
  256. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-fetch-prices.py +0 -201
  257. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-http-test.js +0 -357
  258. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +0 -196
  259. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.js +0 -300
  260. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.py +0 -617
  261. package/examples/browser/boards/portfolio-tracker/portfolio-tracker.py +0 -366
  262. package/examples/browser/livecards-browser/index.html +0 -41
  263. package/examples/browser/step-machine-browser/index.html +0 -367
  264. package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/.runtime-out +0 -1
  265. package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/board-graph.json +0 -32
  266. package/examples/cli/step-machine-cli/portfolio-tracker/cards/holdings-table.json +0 -22
  267. package/examples/cli/step-machine-cli/portfolio-tracker/cards/portfolio-form.json +0 -43
  268. package/examples/cli/step-machine-cli/portfolio-tracker/cards/portfolio-value.json +0 -15
  269. package/examples/cli/step-machine-cli/portfolio-tracker/cards/price-fetch.json +0 -15
  270. package/examples/cli/step-machine-cli/portfolio-tracker/fetch-prices.js +0 -48
  271. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -125
  272. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +0 -32
  273. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +0 -26
  274. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/poll-status-cli.js +0 -49
  275. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +0 -25
  276. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +0 -23
  277. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/status-cli.js +0 -21
  278. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +0 -38
  279. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +0 -48
  280. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +0 -31
  281. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/_board_pycli.py +0 -107
  282. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/add-cards.py +0 -51
  283. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/init-board.py +0 -45
  284. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/poll-status.py +0 -71
  285. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/reset-board-dir.py +0 -36
  286. package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-demo.flow.yaml +0 -26
  287. package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-handlers.py +0 -39
  288. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker-pycli.flow.yaml +0 -80
  289. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +0 -76
  290. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +0 -44
  291. package/examples/cli/step-machine-cli/portfolio-tracker/run-inline-python-demo-pycli.py +0 -43
  292. package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker-pycli.py +0 -77
  293. package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +0 -28
  294. package/examples/cli/step-machine-demo/jsonata-init-board-cli.js +0 -31
  295. package/examples/cli/step-machine-demo/jsonata-init-board.flow.yaml +0 -54
  296. package/examples/cli/step-machine-demo/one-step-cli-only.flow.yaml +0 -21
  297. package/examples/cli/step-machine-demo/step-cli-echo-y.js +0 -15
  298. package/examples/cli/step-machine-demo/step2-double-cli.js +0 -33
  299. package/examples/cli/step-machine-demo/two-step-math.flow.yaml +0 -93
  300. package/examples/cli/step-machine-demo/two-step-mixed.flow.yaml +0 -43
  301. package/examples/example-board/agent-instructions-cardlayout.md +0 -56
  302. package/examples/example-board/agent-instructions.md +0 -834
  303. package/examples/example-board/cards/_index.json +0 -47
  304. package/examples/example-board/demo-shell.html +0 -63
  305. package/examples/index.html +0 -785
  306. package/examples/npm-libs/batch/batch-step-machine.ts +0 -121
  307. package/examples/npm-libs/continuous-event-graph/live-cards-board.ts +0 -215
  308. package/examples/npm-libs/continuous-event-graph/live-portfolio-dashboard.ts +0 -555
  309. package/examples/npm-libs/continuous-event-graph/portfolio-tracker.ts +0 -287
  310. package/examples/npm-libs/continuous-event-graph/reactive-monitoring.ts +0 -265
  311. package/examples/npm-libs/continuous-event-graph/reactive-pipeline.ts +0 -168
  312. package/examples/npm-libs/continuous-event-graph/soc-incident-board.ts +0 -287
  313. package/examples/npm-libs/continuous-event-graph/stock-dashboard.ts +0 -229
  314. package/examples/npm-libs/event-graph/ci-cd-pipeline.ts +0 -243
  315. package/examples/npm-libs/event-graph/executor-diamond.ts +0 -165
  316. package/examples/npm-libs/event-graph/executor-pipeline.ts +0 -161
  317. package/examples/npm-libs/event-graph/research-pipeline.ts +0 -137
  318. package/examples/npm-libs/flows/ai-conversation.yaml +0 -116
  319. package/examples/npm-libs/flows/order-processing.yaml +0 -143
  320. package/examples/npm-libs/flows/simple-greeting.yaml +0 -54
  321. package/examples/npm-libs/graph-of-graphs/multi-stage-etl.ts +0 -307
  322. package/examples/npm-libs/graph-of-graphs/url-processing-pipeline.ts +0 -254
  323. package/examples/npm-libs/inference/azure-deployment.ts +0 -149
  324. package/examples/npm-libs/inference/copilot-cli.ts +0 -138
  325. package/examples/npm-libs/inference/data-pipeline.ts +0 -145
  326. package/examples/npm-libs/inference/pluggable-adapters.ts +0 -254
  327. package/examples/npm-libs/node/ai-conversation.ts +0 -195
  328. package/examples/npm-libs/node/simple-greeting.ts +0 -101
  329. package/examples/step-machine-cli/portfolio-tracker/cards/holdings-table.json +0 -22
  330. package/examples/step-machine-cli/portfolio-tracker/cards/portfolio-form.json +0 -43
  331. package/examples/step-machine-cli/portfolio-tracker/cards/portfolio-value.json +0 -15
  332. package/examples/step-machine-cli/portfolio-tracker/cards/price-fetch.json +0 -15
  333. package/examples/step-machine-cli/portfolio-tracker/fetch-prices.js +0 -48
  334. package/examples/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -57
  335. package/examples/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +0 -27
  336. package/examples/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +0 -25
  337. package/examples/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +0 -29
  338. package/examples/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +0 -27
  339. package/examples/step-machine-cli/portfolio-tracker/handlers/status-cli.js +0 -25
  340. package/examples/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +0 -37
  341. package/examples/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +0 -53
  342. package/examples/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +0 -35
  343. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker-task-executor.cjs +0 -96
  344. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +0 -227
  345. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +0 -38
  346. package/examples/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +0 -28
  347. package/step-machine-cli.js +0 -407
  348. /package/{dist/board-livegraph-runtime → cli/browser-api}/jsonata-sync.cjs +0 -0
  349. /package/{dist/cli → cli}/node/artifacts-store-cli.d.ts +0 -0
  350. /package/{dist/cli/node/source-cli-task-executor.d.cts → cli/node/batch-runner-cli.d.ts} +0 -0
  351. /package/{dist/cli → cli}/node/board-live-cards-cli.d.ts +0 -0
  352. /package/{dist/cli → cli}/node/card-store-cli.d.ts +0 -0
  353. /package/{dist/card-compute → cli/node}/jsonata-sync.cjs +0 -0
  354. /package/{dist/cli → cli}/node/source-cli-task-executor.d.ts +0 -0
  355. /package/examples/{example-board → board}/cards/card-concentration.json +0 -0
  356. /package/examples/{example-board → board}/cards/card-my-identity.json +0 -0
  357. /package/examples/{example-board → board}/cards/card-portfolio-action.json +0 -0
  358. /package/examples/{example-board → board}/cards/card-portfolio-intelligence.json +0 -0
  359. /package/examples/{example-board → board}/cards/card-portfolio-risks.json +0 -0
  360. /package/examples/{example-board → board}/cards/card-rebalance-impact.json +0 -0
  361. /package/examples/{example-board → board}/cards/card-rebalance-sim.json +0 -0
  362. /package/examples/{example-board/cards/card-portfolio-value.json → board/cards/cardT-portfolio-value.json} +0 -0
  363. /package/examples/{example-board → board}/demo-chat-handler.js +0 -0
  364. /package/examples/{example-board → board}/scripts/copilot_wrapper.bat +0 -0
  365. /package/examples/{example-board → board}/scripts/copilot_wrapper_helper.ps1 +0 -0
  366. /package/examples/{example-board → board}/scripts/workiq_wrapper.mjs +0 -0
  367. /package/examples/{browser/boards/portfolio-tracker → board/test}/portfolio-tracker-sse-worker.js +0 -0
  368. /package/{dist → lib}/batch/index.cjs +0 -0
  369. /package/{dist → lib}/batch/index.d.cts +0 -0
  370. /package/{dist → lib}/batch/index.d.ts +0 -0
  371. /package/{dist → lib}/batch/index.js +0 -0
  372. /package/{dist/cli/browser-api → lib/board-livegraph-runtime}/jsonata-sync.cjs +0 -0
  373. /package/{dist → lib}/card-compute/index.d.cts +0 -0
  374. /package/{dist → lib}/card-compute/index.d.ts +0 -0
  375. /package/{dist/cli/node → lib/card-compute}/jsonata-sync.cjs +0 -0
  376. /package/{dist → lib}/config/index.cjs +0 -0
  377. /package/{dist → lib}/config/index.d.cts +0 -0
  378. /package/{dist → lib}/config/index.d.ts +0 -0
  379. /package/{dist → lib}/config/index.js +0 -0
  380. /package/{dist → lib}/continuous-event-graph/jsonata-sync.cjs +0 -0
  381. /package/{dist → lib}/event-graph/index.cjs +0 -0
  382. /package/{dist → lib}/event-graph/index.js +0 -0
  383. /package/{dist → lib}/jsonata-sync.cjs +0 -0
  384. /package/{dist → lib}/server-runtime/jsonata-sync.cjs +0 -0
  385. /package/{dist → lib}/step-machine/index.cjs +0 -0
  386. /package/{dist → lib}/step-machine/index.js +0 -0
  387. /package/{dist → lib}/step-machine-public/jsonata-sync.cjs +0 -0
  388. /package/{dist → lib}/stores/memory.cjs +0 -0
  389. /package/{dist → lib}/stores/memory.js +0 -0
  390. /package/{dist → lib}/types-BBhqYGhE.d.cts +0 -0
  391. /package/{dist → lib}/types-BBhqYGhE.d.ts +0 -0
  392. /package/{dist → lib}/validate-BAVzUJWa.d.ts +0 -0
  393. /package/{dist → lib}/validate-Dbu7ygys.d.cts +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import*as l from'fs';import*as d from'path';import {execFileSync,spawnSync}from'child_process';function b(e){if(e.startsWith("::fs-path::"))return {kind:"fs-path",value:e.slice(11)};if(!e.startsWith("b64:"))throw new Error(`Invalid ref format (expected b64:<base64url(json)>): ${e}`);let n=e.slice(4),o=n.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-n.length%4)%4),t;try{t=JSON.parse(Buffer.from(o,"base64").toString("utf8"));}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${e}`)}if(!t||typeof t!="object")throw new Error(`Invalid ref format (expected object payload): ${e}`);let r=t;if(typeof r.kind!="string"||typeof r.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${e}`);return {kind:r.kind,value:r.value}}function I(e){return `b64:${Buffer.from(JSON.stringify(e),"utf8").toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}`}function P(){return {read(e){if(!l.existsSync(e))return null;try{return l.readFileSync(e,"utf-8")}catch{return null}},write(e,n){l.mkdirSync(d.dirname(e),{recursive:true}),l.writeFileSync(e,n,"utf-8");}}}function x(e){if(e.kind==="fs-path")return P();throw new Error(`Unsupported storage kind: "${e.kind}". Supported kinds: fs-path`)}function y(e){try{return b(e).value}catch{return e}}function _(e){let n=e.extra?.notifyChannel;return typeof n=="string"&&n.length>0?n:void 0}function O(e){if(!e.endsWith(".ts"))return {cmd:process.execPath,args:[e]};let n=d.dirname(e),o=[];for(let r=1;r<=5;r++){let s=d.join(n,...Array(r).fill(".."),"node_modules");o.push(d.join(s,"tsx","dist","cli.mjs")),o.push(d.join(s,".bin","tsx"));}let t=o.find(r=>l.existsSync(r));return t?{cmd:process.execPath,args:[t,e]}:{cmd:"npx",args:["tsx",e]}}function F(e,n){let{token:o,via:t}=e;if(t.howToRun==="local-node"||t.howToRun==="local-process"){let r=y(t.whatToRun),{cmd:s,args:p}=O(r),u=_(t),f=[...p,"source-data-fetched","--ref",I(n),"--token",o,...u?["--notify-channel",u]:[]],i=spawnSync(s,f,{encoding:"utf-8",windowsHide:true});if(i.status!==0)throw new Error(`reportComplete: board CLI exited ${i.status}: ${i.stderr?.trim()}`);return}if(t.howToRun==="http:post"){let r=y(t.whatToRun),s=JSON.stringify({status:"complete",ref:I(n),token:o});q(r,s);return}throw new Error(`reportComplete: unsupported via.howToRun "${t.howToRun}"`)}function j(e,n){let{token:o,via:t}=e;if(t.howToRun==="local-node"||t.howToRun==="local-process"){let r=y(t.whatToRun),{cmd:s,args:p}=O(r),u=_(t),f=[...p,"source-data-fetch-failure","--token",o,"--reason",n,...u?["--notify-channel",u]:[]],i=spawnSync(s,f,{encoding:"utf-8",windowsHide:true});if(i.status!==0)throw new Error(`reportFailed: board CLI exited ${i.status}: ${i.stderr?.trim()}`);return}if(t.howToRun==="http:post"){let r=y(t.whatToRun),s=JSON.stringify({status:"failed",reason:n,token:o});q(r,s);return}throw new Error(`reportFailed: unsupported via.howToRun "${t.howToRun}"`)}function q(e,n){let o=`
2
+ import*as l from'fs';import*as d from'path';import {execFileSync,spawnSync}from'child_process';function b(e){if(!e.startsWith("b64:"))throw new Error(`Invalid ref format (expected b64:<base64url(json)>): ${e}`);let n=e.slice(4),o=n.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-n.length%4)%4),t;try{t=JSON.parse(Buffer.from(o,"base64").toString("utf8"));}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${e}`)}if(!t||typeof t!="object")throw new Error(`Invalid ref format (expected object payload): ${e}`);let r=t;if(typeof r.kind!="string"||typeof r.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${e}`);return {kind:r.kind,value:r.value}}function I(e){return `b64:${Buffer.from(JSON.stringify(e),"utf8").toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}`}function P(){return {read(e){if(!l.existsSync(e))return null;try{return l.readFileSync(e,"utf-8")}catch{return null}},write(e,n){l.mkdirSync(d.dirname(e),{recursive:true}),l.writeFileSync(e,n,"utf-8");}}}function x(e){if(e.kind==="fs-path")return P();throw new Error(`Unsupported storage kind: "${e.kind}". Supported kinds: fs-path`)}function y(e){return b(e).value}function _(e){let n=e.extra?.notifyChannel;return typeof n=="string"&&n.length>0?n:void 0}function O(e){if(!e.endsWith(".ts"))return {cmd:process.execPath,args:[e]};let n=d.dirname(e),o=[];for(let r=1;r<=5;r++){let s=d.join(n,...Array(r).fill(".."),"node_modules");o.push(d.join(s,"tsx","dist","cli.mjs")),o.push(d.join(s,".bin","tsx"));}let t=o.find(r=>l.existsSync(r));return t?{cmd:process.execPath,args:[t,e]}:{cmd:"npx",args:["tsx",e]}}function F(e,n){let{token:o,via:t}=e;if(t.howToRun==="local-node"||t.howToRun==="local-process"){let r=y(t.whatToRun),{cmd:s,args:p}=O(r),u=_(t),f=[...p,"source-data-fetched","--ref",I(n),"--token",o,...u?["--notify-channel",u]:[]],i=spawnSync(s,f,{encoding:"utf-8",windowsHide:true});if(i.status!==0)throw new Error(`reportComplete: board CLI exited ${i.status}: ${i.stderr?.trim()}`);return}if(t.howToRun==="http:post"){let r=y(t.whatToRun),s=JSON.stringify({status:"complete",ref:I(n),token:o});q(r,s);return}throw new Error(`reportComplete: unsupported via.howToRun "${t.howToRun}"`)}function j(e,n){let{token:o,via:t}=e;if(t.howToRun==="local-node"||t.howToRun==="local-process"){let r=y(t.whatToRun),{cmd:s,args:p}=O(r),u=_(t),f=[...p,"source-data-fetch-failure","--token",o,"--reason",n,...u?["--notify-channel",u]:[]],i=spawnSync(s,f,{encoding:"utf-8",windowsHide:true});if(i.status!==0)throw new Error(`reportFailed: board CLI exited ${i.status}: ${i.stderr?.trim()}`);return}if(t.howToRun==="http:post"){let r=y(t.whatToRun),s=JSON.stringify({status:"failed",reason:n,token:o});q(r,s);return}throw new Error(`reportFailed: unsupported via.howToRun "${t.howToRun}"`)}function q(e,n){let o=`
3
3
  const {request} = require(new URL('${e}').protocol === 'https:' ? 'https' : 'http');
4
4
  const h = ${JSON.stringify({"Content-Type":"application/json","Content-Length":Buffer.byteLength(n)})};
5
5
  const u = new URL('${e}');
@@ -7,5 +7,5 @@ import*as l from'fs';import*as d from'path';import {execFileSync,spawnSync}from'
7
7
  req.on('error', e => { process.stderr.write(e.message); process.exit(1); });
8
8
  req.write(${JSON.stringify(n)});
9
9
  req.end();
10
- `,t=spawnSync(process.execPath,["-e",o],{encoding:"utf-8",windowsHide:true});if(t.status!==0)throw new Error(`http-post failed: ${t.stderr?.trim()}`)}function W(e){let n=[],o="",t=false,r=false;for(let s of e){if(s==="'"&&!r){t=!t;continue}if(s==='"'&&!t){r=!r;continue}s===" "&&!t&&!r?o&&(n.push(o),o=""):o+=s;}return o&&n.push(o),n}function H(e){if(process.platform!=="win32"||d.isAbsolute(e)||e.includes("/")||e.includes("\\"))return e;let n=process.env.PATH??"";for(let o of n.split(d.delimiter))for(let t of [".cmd",".bat"]){let r=d.join(o,e+t);if(l.existsSync(r))return r}return e}function z(e){let n=e.indexOf("--in-ref"),o=e.indexOf("--out-ref"),t=e.indexOf("--err-ref"),r=n!==-1?e[n+1]:void 0,s=o!==-1?e[o+1]:void 0,p=t!==-1?e[t+1]:void 0;(!r||!s)&&(console.error("[source-cli-task-executor] Usage: run-source-fetch --in-ref <b64-ref> --out-ref <b64-ref> [--err-ref <b64-ref>]"),process.exit(1));let u,f,i;try{u=b(r),f=b(s),p&&(i=b(p));}catch(c){console.error(`[source-cli-task-executor] invalid ref: ${c.message}`),process.exit(1);}let D=x(u),A=x(f),T=i?x(i):void 0;function h(c,C){if(T&&i)try{T.write(i.value,c);}catch{}if(console.error(`[source-cli-task-executor] ${c}`),C)try{j(C,c);}catch{}process.exit(1);}let $=D.read(u.value);$===null&&h(`Input not found: ${r}`);let w;try{w=JSON.parse($);}catch(c){h(`Cannot parse input envelope: ${c.message}`);}let g=w.source_def!=null?w.callback:void 0,a=w.source_def??w;(!a.cli||typeof a.cli!="string")&&h("source_def missing required field: cli (source-cli-task-executor only handles source.cli)",g);let K=typeof a.timeout=="number"?a.timeout:12e4,k=typeof a.boardDir=="string"&&a.boardDir?a.boardDir:void 0,V=k??process.cwd(),N=typeof a.bindTo=="string"?a.bindTo:"unknown",R=W(a.cli);R.length===0&&h("source_def.cli is empty",g);let J=H(R[0]),L=R.slice(1);console.log(`[source-cli-task-executor] ${N}: ${a.cli}`);let E;try{E=execFileSync(J,L,{shell:!1,encoding:"utf-8",timeout:K,cwd:V,env:{...process.env,...k?{BOARD_DIR:k}:{}},maxBuffer:50*1024*1024});}catch(c){h(`cli execution failed: ${c.message}`,g);}try{A.write(f.value,E.trim());}catch(c){h(`Cannot write output: ${c.message}`,g);}if(g)try{F(g,f);}catch(c){console.error(`[source-cli-task-executor] reportComplete failed: ${c.message}`),process.exit(1);}}var Q={version:"1.0",executor:"source-cli-task-executor",subcommands:["run-source-fetch","describe-capabilities"],sourceKinds:{cli:{description:"Execute a shell command (source_def.cli) synchronously and capture stdout as the source data.",inputSchema:{cli:{type:"string",required:true,description:"Command string to execute. Quoted arguments are supported. Runs via execFileSync (no shell)."},timeout:{type:"number",required:false,description:"Execution timeout in milliseconds (default: 120000)."},cwd:{type:"string",required:false,description:"Working directory for the command (default: process.cwd())."},boardDir:{type:"string",required:false,description:"Injected as BOARD_DIR environment variable."}},outputShape:"string \u2014 trimmed stdout of the command."}}},S=process.argv[2];S==="run-source-fetch"?z(process.argv.slice(3)):S==="describe-capabilities"?console.log(JSON.stringify(Q,null,2)):(console.warn(`[source-cli-task-executor] Unknown subcommand: ${S??"(none)"}`),process.exit(1));//# sourceMappingURL=source-cli-task-executor.js.map
10
+ `,t=spawnSync(process.execPath,["-e",o],{encoding:"utf-8",windowsHide:true});if(t.status!==0)throw new Error(`http-post failed: ${t.stderr?.trim()}`)}function H(e){let n=[],o="",t=false,r=false;for(let s of e){if(s==="'"&&!r){t=!t;continue}if(s==='"'&&!t){r=!r;continue}s===" "&&!t&&!r?o&&(n.push(o),o=""):o+=s;}return o&&n.push(o),n}function W(e){if(process.platform!=="win32"||d.isAbsolute(e)||e.includes("/")||e.includes("\\"))return e;let n=process.env.PATH??"";for(let o of n.split(d.delimiter))for(let t of [".cmd",".bat"]){let r=d.join(o,e+t);if(l.existsSync(r))return r}return e}function z(e){let n=e.indexOf("--in-ref"),o=e.indexOf("--out-ref"),t=e.indexOf("--err-ref"),r=n!==-1?e[n+1]:void 0,s=o!==-1?e[o+1]:void 0,p=t!==-1?e[t+1]:void 0;(!r||!s)&&(console.error("[source-cli-task-executor] Usage: run-source-fetch --in-ref <b64-ref> --out-ref <b64-ref> [--err-ref <b64-ref>]"),process.exit(1));let u,f,i;try{u=b(r),f=b(s),p&&(i=b(p));}catch(c){console.error(`[source-cli-task-executor] invalid ref: ${c.message}`),process.exit(1);}let D=x(u),A=x(f),T=i?x(i):void 0;function h(c,C){if(T&&i)try{T.write(i.value,c);}catch{}if(console.error(`[source-cli-task-executor] ${c}`),C)try{j(C,c);}catch{}process.exit(1);}let $=D.read(u.value);$===null&&h(`Input not found: ${r}`);let w;try{w=JSON.parse($);}catch(c){h(`Cannot parse input envelope: ${c.message}`);}let g=w.source_def!=null?w.callback:void 0,a=w.source_def??w;(!a.cli||typeof a.cli!="string")&&h("source_def missing required field: cli (source-cli-task-executor only handles source.cli)",g);let K=typeof a.timeout=="number"?a.timeout:12e4,k=typeof a.boardDir=="string"&&a.boardDir?a.boardDir:void 0,V=k??process.cwd(),N=typeof a.bindTo=="string"?a.bindTo:"unknown",R=H(a.cli);R.length===0&&h("source_def.cli is empty",g);let J=W(R[0]),L=R.slice(1);console.log(`[source-cli-task-executor] ${N}: ${a.cli}`);let E;try{E=execFileSync(J,L,{shell:!1,encoding:"utf-8",timeout:K,cwd:V,env:{...process.env,...k?{BOARD_DIR:k}:{}},maxBuffer:50*1024*1024});}catch(c){h(`cli execution failed: ${c.message}`,g);}try{A.write(f.value,E.trim());}catch(c){h(`Cannot write output: ${c.message}`,g);}if(g)try{F(g,f);}catch(c){console.error(`[source-cli-task-executor] reportComplete failed: ${c.message}`),process.exit(1);}}var Q={version:"1.0",executor:"source-cli-task-executor",subcommands:["run-source-fetch","describe-capabilities"],sourceKinds:{cli:{description:"Execute a shell command (source_def.cli) synchronously and capture stdout as the source data.",inputSchema:{cli:{type:"string",required:true,description:"Command string to execute. Quoted arguments are supported. Runs via execFileSync (no shell)."},timeout:{type:"number",required:false,description:"Execution timeout in milliseconds (default: 120000)."},cwd:{type:"string",required:false,description:"Working directory for the command (default: process.cwd())."},boardDir:{type:"string",required:false,description:"Injected as BOARD_DIR environment variable."}},outputShape:"string \u2014 trimmed stdout of the command."}}},S=process.argv[2];S==="run-source-fetch"?z(process.argv.slice(3)):S==="describe-capabilities"?console.log(JSON.stringify(Q,null,2)):(console.warn(`[source-cli-task-executor] Unknown subcommand: ${S??"(none)"}`),process.exit(1));//# sourceMappingURL=source-cli-task-executor.js.map
11
11
  //# sourceMappingURL=source-cli-task-executor.js.map
@@ -0,0 +1,7 @@
1
+ declare class CliExitError extends Error {
2
+ readonly code: number;
3
+ constructor(code: number, message?: string);
4
+ }
5
+ declare function cli(args: string[]): Promise<void>;
6
+
7
+ export { CliExitError, cli };
@@ -0,0 +1,5 @@
1
+ import*as m from'fs';import {existsSync}from'fs';import*as R from'path';import {dirname,resolve}from'path';import'ajv-formats';import {createRequire}from'module';import {fileURLToPath}from'url';import {spawn,execFile,execFileSync}from'child_process';import*as St from'os';import'net';import {randomUUID}from'crypto';import'proper-lockfile';function I(e,t,r,n){let s=e.steps[r];if(!s)throw new Error(`Step "${r}" not found in flow configuration`);if(n.result==="failure"&&s.retry){let i=t.retryCounts[r]??0;if(i<s.retry.max_attempts)return {newState:{...t,retryCounts:{...t.retryCounts,[r]:i+1},updatedAt:Date.now()},nextStep:r,isTerminal:false,isCircuitBroken:false,shouldRetry:true}}let o=s.failure_transitions?.[n.result]??s.transitions[n.result];if(!o)throw new Error(`No transition defined for result "${n.result}" in step "${r}"`);let a=!!e.terminal_states[o];return {newState:{...t,currentStep:o,stepHistory:[...t.stepHistory,r],retryCounts:{...t.retryCounts,[r]:0},updatedAt:Date.now()},nextStep:o,isTerminal:a,isCircuitBroken:false,shouldRetry:false}}function N(e,t,r){let n=e.steps[r];if(!n?.circuit_breaker)return {broken:false,newState:{...t,iterationCounts:{...t.iterationCounts,[r]:(t.iterationCounts[r]??0)+1},updatedAt:Date.now()}};let s=t.iterationCounts[r]??0;return s>=n.circuit_breaker.max_iterations?{broken:true,redirectStep:n.circuit_breaker.on_open,newState:{...t,currentStep:n.circuit_breaker.on_open,updatedAt:Date.now()}}:{broken:false,newState:{...t,iterationCounts:{...t.iterationCounts,[r]:s+1},updatedAt:Date.now()}}}function L(e,t,r){let n=e.steps[t];if(!n)throw new Error(`Step "${t}" not found`);if(n.expects_data){let s={};for(let o of n.expects_data)s[o]=r[o];return s}return {...r}}function K(e,t){if(e===false||e===void 0)return {};if(typeof e=="string")return {[e]:t[e]};if(Array.isArray(e)){let r={};for(let n of e)r[n]=t[n];return r}return {}}function q(e,t){let r=Date.now();return {runId:t,flowId:e.id??"unnamed",currentStep:e.settings.start_step,status:"running",stepHistory:[],iterationCounts:{},retryCounts:{},startedAt:r,updatedAt:r}}var k=class{runs=new Map;data=new Map;async saveRunState(t,r){this.runs.set(t,{...r});}async loadRunState(t){let r=this.runs.get(t);return r?{...r}:null}async deleteRunState(t){this.runs.delete(t),this.data.delete(t);}async setData(t,r,n){this.data.has(t)||this.data.set(t,{});let s=this.data.get(t);s[r]=n;}async getData(t,r){return this.data.get(t)?.[r]}async getAllData(t){return {...this.data.get(t)??{}}}async clearData(t){this.data.delete(t);}async listRuns(){return Array.from(this.runs.keys())}clear(){this.runs.clear(),this.data.clear();}};function Ft(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return (e==="x"?t:t&3|8).toString(16)})}var O=class{flow;handlers;store;components;options;listeners=new Map;aborted=false;constructor(t,r,n={}){this.flow=t,this.handlers=new Map(Object.entries(r)),this.store=n.store??new k,this.components=n.components??{},this.options=n,n.signal&&n.signal.addEventListener("abort",()=>{this.aborted=true;}),this.validateFlow();}validateFlow(){let{settings:t,steps:r,terminal_states:n}=this.flow;if(!t?.start_step)throw new Error("Flow must have settings.start_step defined");if(!r||Object.keys(r).length===0)throw new Error("Flow must have at least one step defined");if(!n||Object.keys(n).length===0)throw new Error("Flow must have at least one terminal_state defined");if(!r[t.start_step]&&!n[t.start_step])throw new Error(`Start step "${t.start_step}" not found`);for(let[s,o]of Object.entries(r)){for(let[a,i]of Object.entries(o.transitions))if(!r[i]&&!n[i])throw new Error(`Step "${s}" transition "${a}" points to unknown step "${i}"`);if(o.failure_transitions){for(let[a,i]of Object.entries(o.failure_transitions))if(!r[i]&&!n[i])throw new Error(`Step "${s}" failure_transition "${a}" points to unknown step "${i}"`)}}}on(t,r){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r);}off(t,r){this.listeners.get(t)?.delete(r);}emit(t){let r=this.listeners.get(t.type);if(r)for(let n of r)try{n(t);}catch{}}sleep(t){return new Promise(r=>setTimeout(r,t))}async run(t){let r=Ft(),n=q(this.flow,r);if(await this.store.saveRunState(r,n),t)for(let[s,o]of Object.entries(t))await this.store.setData(r,s,o);this.emit({type:"flow:start",runId:r,timestamp:n.startedAt,data:{initialData:t??{}}});try{return await this.executeLoop(r,n)}catch(s){let o=s instanceof Error?s:new Error(String(s));return this.emit({type:"flow:error",runId:r,timestamp:Date.now(),data:{error:o.message}}),this.options.onError?.(o),n={...n,status:"failed",updatedAt:Date.now()},await this.store.saveRunState(r,n),{runId:r,status:"failed",data:await this.store.getAllData(r),finalStep:n.currentStep,stepHistory:n.stepHistory,durationMs:Date.now()-n.startedAt,error:o}}}async resume(t){let r=await this.store.loadRunState(t);if(!r)throw new Error(`No run found with ID: ${t}`);if(r.status==="completed"||r.status==="failed")throw new Error(`Cannot resume a ${r.status} run`);let n={...r,status:"running",pausedAt:void 0,updatedAt:Date.now()};return await this.store.saveRunState(t,n),this.emit({type:"flow:resumed",runId:t,timestamp:Date.now(),data:{currentStep:n.currentStep}}),this.executeLoop(t,n)}async pause(t){let r=await this.store.loadRunState(t);if(!r)throw new Error(`No run found with ID: ${t}`);let n={...r,status:"paused",pausedAt:Date.now(),updatedAt:Date.now()};await this.store.saveRunState(t,n),this.emit({type:"flow:paused",runId:t,timestamp:Date.now(),data:{currentStep:n.currentStep}});}async executeLoop(t,r){let n=this.flow.settings.max_total_steps??100,s=this.flow.settings.timeout_ms,o=r,a=0;for(;a<n;){if(this.aborted)return o={...o,status:"cancelled",updatedAt:Date.now()},await this.store.saveRunState(t,o),{runId:t,status:"cancelled",data:await this.store.getAllData(t),finalStep:o.currentStep,stepHistory:o.stepHistory,durationMs:Date.now()-o.startedAt};if(s&&Date.now()-o.startedAt>s)return o={...o,status:"completed",updatedAt:Date.now()},await this.store.saveRunState(t,o),{runId:t,status:"timeout",intent:"timeout",data:await this.store.getAllData(t),finalStep:o.currentStep,stepHistory:o.stepHistory,durationMs:Date.now()-o.startedAt};let i=o.currentStep,l=this.flow.terminal_states[i];if(l){o={...o,status:"completed",updatedAt:Date.now()},await this.store.saveRunState(t,o);let p=await this.store.getAllData(t),g={runId:t,status:"completed",intent:l.return_intent,data:K(l.return_artifacts,p),finalStep:i,stepHistory:o.stepHistory,durationMs:Date.now()-o.startedAt};return this.emit({type:"flow:complete",runId:t,timestamp:Date.now(),data:{...g}}),this.options.onComplete?.(g),g}let c=N(this.flow,o,i);if(c.broken){o=c.newState,await this.store.saveRunState(t,o),a++;continue}o=c.newState;let d=await this.store.getAllData(t),u=L(this.flow,i,d),f={runId:t,stepName:i,components:this.components,store:this.store,signal:this.options.signal,emit:(p,g)=>{this.emit({type:"step:complete",runId:t,timestamp:Date.now(),data:{event:p,payload:g}});}};this.emit({type:"step:start",runId:t,timestamp:Date.now(),data:{step:i,input:u}});let h;try{let p=this.handlers.get(i);if(!p)throw new Error(`No handler registered for step "${i}"`);h=await p(u,f);}catch(p){let g=p instanceof Error?p:new Error(String(p));this.emit({type:"step:error",runId:t,timestamp:Date.now(),data:{step:i,error:g.message}}),h={result:"failure",data:{error:g.message}};}if(h.data)for(let[p,g]of Object.entries(h.data))await this.store.setData(t,p,g);this.emit({type:"step:complete",runId:t,timestamp:Date.now(),data:{step:i,result:h.result}}),this.options.onStep?.(i,h);let w=I(this.flow,o,i,h);if(o=w.newState,w.shouldRetry){await this.store.saveRunState(t,o);let p=this.flow.steps[i];if(p.retry?.delay_ms){let g=o.retryCounts[i]??0,x=p.retry.backoff_multiplier?p.retry.delay_ms*Math.pow(p.retry.backoff_multiplier,g-1):p.retry.delay_ms;await this.sleep(x);}a++;continue}await this.store.saveRunState(t,o),this.emit({type:"transition",runId:t,timestamp:Date.now(),data:{from:i,to:o.currentStep,result:h.result}}),this.options.onTransition?.(i,o.currentStep),a++;}return o={...o,status:"completed",updatedAt:Date.now()},await this.store.saveRunState(t,o),{runId:t,status:"max_iterations",intent:"max_iterations",data:await this.store.getAllData(t),finalStep:o.currentStep,stepHistory:o.stepHistory,durationMs:Date.now()-o.startedAt}}};function _(e,t,r){return new O(e,t,r)}async function U(e){return (await import('yaml')).parse(e)}async function Tt(e){let t=await fetch(e);if(!t.ok)throw new Error(`Failed to load flow from ${e}: ${t.statusText}`);let r=t.headers.get("content-type")??"",n=await t.text();return r.includes("json")||e.endsWith(".json")?JSON.parse(n):U(n)}async function Pt(e){let r=await(await import('fs/promises')).readFile(e,"utf-8");return e.endsWith(".json")?JSON.parse(r):U(r)}function tt(e){let t=[];if(!e||typeof e!="object")return ["Flow must be an object"];let r=e;if(!r.settings||typeof r.settings!="object"?t.push('Flow must have a "settings" object'):typeof r.settings.start_step!="string"&&t.push("settings.start_step must be a string"),!r.steps||typeof r.steps!="object")t.push('Flow must have a "steps" object');else {let n=r.steps;for(let[s,o]of Object.entries(n)){if(!o||typeof o!="object"){t.push(`Step "${s}" must be an object`);continue}let a=o;(!a.transitions||typeof a.transitions!="object")&&t.push(`Step "${s}" must have a "transitions" object`),a.failure_transitions!==void 0&&typeof a.failure_transitions!="object"&&t.push(`Step "${s}" failure_transitions must be an object when provided`);}}if(!r.terminal_states||typeof r.terminal_states!="object")t.push('Flow must have a "terminal_states" object');else {let n=r.terminal_states;for(let[s,o]of Object.entries(n)){if(!o||typeof o!="object"){t.push(`Terminal state "${s}" must be an object`);continue}typeof o.return_intent!="string"&&t.push(`Terminal state "${s}" must have a "return_intent" string`);}}return t}async function H(e){let t;typeof e=="string"?e.startsWith("http://")||e.startsWith("https://")?t=await Tt(e):e.includes("{")?t=JSON.parse(e):t=await Pt(e):t=e;let r=tt(t);if(r.length>0)throw new Error(`Invalid step flow configuration:
2
+ - ${r.join(`
3
+ - `)}`);return t}function V(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function et(e){return atob(e.replace(/-/g,"+").replace(/_/g,"/"))}var j=class{constructor(t){this.kv=t;}kv;stateKey(t){return `state_${V(t)}`}dataPrefix(t){return `data_${V(t)}_`}dataKey(t,r){return `${this.dataPrefix(t)}${V(r)}`}async saveRunState(t,r){this.kv.write(this.stateKey(t),r);}async loadRunState(t){let r=this.kv.read(this.stateKey(t));return r!=null&&typeof r=="object"?r:null}async deleteRunState(t){this.kv.delete(this.stateKey(t));for(let r of this.kv.listKeys(this.dataPrefix(t)))this.kv.delete(r);}async setData(t,r,n){this.kv.write(this.dataKey(t,r),n);}async getData(t,r){return this.kv.read(this.dataKey(t,r))}async getAllData(t){let r=this.dataPrefix(t),n={};for(let s of this.kv.listKeys(r))n[et(s.slice(r.length))]=this.kv.read(s);return n}async clearData(t){for(let r of this.kv.listKeys(this.dataPrefix(t)))this.kv.delete(r);}async listRuns(){return this.kv.listKeys("state_").map(t=>et(t.slice(6)))}};var nt=dirname(fileURLToPath(import.meta.url)),Jt=createRequire(import.meta.url);function Dt(){let e=resolve(nt,"./jsonata-sync.cjs");return existsSync(e)?e:resolve(nt,"../card-compute/jsonata-sync.cjs")}var $=Jt(Dt());function st(e,t){if(!e||typeof e!="object")throw new Error(`[step-machine-public] Step "${t}" returned a non-object result.`);let r=e,n=r.result??r.status;if(typeof n=="string"&&n.trim().length>0){let s=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?{...r.data}:{},o=typeof r.error=="string"?r.error:void 0;return o&&!("error"in s)&&(s.error=o),{result:n,data:s,...o?{error:o}:{}}}return {result:"success",data:{...r}}}function ot(e,t){if(!t||t.length===0)return e;let r={};for(let n of t)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function z(e,t){return async(r,n)=>{let s=await e(r,n),o=st(s,n?.stepName??"unknown");return {result:o.result,data:ot(o.data,t),...o.error?{error:o.error}:{}}}}function it(e,t,r){if(!t||t.length===0)return null;for(let n of t)try{if(!$(n).evaluate(e))return {result:"failure",data:{error:`[${r}] input validation failed: ${n}`}}}catch(s){let o=s instanceof Error?s.message:String(s);return {result:"failure",data:{error:`[${r}] input validation error on "${n}": ${o}`}}}return null}function W(e,t,r){return !t||t.length===0?e:async(n,s)=>{let o=it(n,t,r);return o||e(n,s)}}var ct=dirname(fileURLToPath(import.meta.url)),Kt=createRequire(import.meta.url);function qt(){let e=resolve(ct,"./jsonata-sync.cjs");return existsSync(e)?e:resolve(ct,"../../card-compute/jsonata-sync.cjs")}var v=Kt(qt());function ut(e,t,r){if(!e||typeof e!="object")return {};let n={};if(Array.isArray(e.cmdTemplate)){let s=[];for(let o of e.cmdTemplate)try{s.push(String(v(o).evaluate(t)));}catch(a){let i=a instanceof Error?a.message:String(a);throw new Error(`[${r}] argsMassaging.cmdTemplate failed on "${o}": ${i}`)}n.cmdArgs=s;}if(typeof e.stdinTemplate=="string")try{n.stdin=v(e.stdinTemplate).evaluate(t);}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`[${r}] argsMassaging.stdinTemplate failed: ${o}`)}if(typeof e.urlTemplate=="string")try{n.url=String(v(e.urlTemplate).evaluate(t));}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`[${r}] argsMassaging.urlTemplate failed: ${o}`)}if(typeof e.headerTemplate=="string")try{let s=v(e.headerTemplate).evaluate(t);if(typeof s!="object"||s===null)throw new Error(`headerTemplate must produce an object, got: ${JSON.stringify(s)}`);n.headers=s;}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`[${r}] argsMassaging.headerTemplate failed: ${o}`)}if(typeof e.bodyTemplate=="string")try{n.body=v(e.bodyTemplate).evaluate(t);}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`[${r}] argsMassaging.bodyTemplate failed: ${o}`)}return n}function lt(e,t,r){if(!e||typeof e!="object")return t;let n={output:t},s=t.result,o=t.data,a=t.error;if(typeof e.resultExpr=="string")try{let i=v(e.resultExpr).evaluate(n);if(typeof i!="string"||!i.trim())throw new Error(`resultExpr did not produce a non-empty string (got ${JSON.stringify(i)})`);s=i;}catch(i){let l=i instanceof Error?i.message:String(i);throw new Error(`[${r}] outputTransforms.resultExpr failed: ${l}`)}if(typeof e.dataTemplate=="string")try{let i=v(e.dataTemplate).evaluate(n);if(!i||typeof i!="object"||Array.isArray(i))throw new Error(`dataTemplate did not produce an object (got ${JSON.stringify(i)})`);o=i;}catch(i){let l=i instanceof Error?i.message:String(i);throw new Error(`[${r}] outputTransforms.dataTemplate failed: ${l}`)}if(typeof e.errorExpr=="string")try{let i=v(e.errorExpr).evaluate(n);a=i!=null?String(i):void 0;}catch(i){let l=i instanceof Error?i.message:String(i);throw new Error(`[${r}] outputTransforms.errorExpr failed: ${l}`)}return a!==void 0?{result:s,data:o,error:a}:{result:s,data:o}}var J="b64:";function Ut(e){let t=new TextEncoder().encode(e),r=globalThis.Buffer,n;if(r)n=r.from(t).toString("base64");else if(typeof btoa=="function"){let s="";for(let o of t)s+=String.fromCharCode(o);n=btoa(s);}else throw new Error("No base64 encoder available in this runtime");return n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function Vt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4),r=globalThis.Buffer;if(r)return r.from(t,"base64").toString("utf8");if(typeof atob=="function"){let n=atob(t),s=new Uint8Array(n.length);for(let o=0;o<n.length;o+=1)s[o]=n.charCodeAt(o);return new TextDecoder().decode(s)}throw new Error("No base64 decoder available in this runtime")}function D(e){return `${J}${Ut(JSON.stringify(e))}`}function G(e){if(!e.startsWith(J))throw new Error(`Invalid ref format (expected ${J}<base64url(json)>): ${e}`);let t;try{t=JSON.parse(Vt(e.slice(J.length)));}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${e}`)}if(!t||typeof t!="object")throw new Error(`Invalid ref format (expected object payload): ${e}`);let r=t;if(typeof r.kind!="string"||typeof r.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${e}`);return {kind:r.kind,value:r.value}}function pt(e){return !!e&&typeof e=="object"&&e.type==="compute-jsonata"&&Array.isArray(e.expr)&&e.expr.length>0}function dt(e){if(!e||typeof e!="object")return false;let t=e;if(t.type!=="ref"||typeof t.howToRun!="string")return false;if(typeof t.whatToRun=="string")return true;if(t.whatToRun&&typeof t.whatToRun=="object"){let r=t.whatToRun;return typeof r.kind=="string"&&typeof r.value=="string"}return false}function zt(e){if(typeof e=="string"){let t=e.indexOf("=");if(t<1)throw new Error(`[step-machine-public] Invalid compute expression (missing "="): "${e}"`);return {bindTo:e.slice(0,t).trim(),expr:e.slice(t+1).trim()}}if(e&&typeof e=="object"&&typeof e.bindTo=="string"&&typeof e.expr=="string")return e;throw new Error(`[step-machine-public] Invalid compute step: ${JSON.stringify(e)}`)}function Wt(e,t,r){let n=t.split("."),s=e;for(let o=0;o<n.length-1;o++){let a=n[o];(s[a]==null||typeof s[a]!="object")&&(s[a]={}),s=s[a];}s[n[n.length-1]]=r;}function ft(e,t,r){let n=e.expr.map(zt);return async s=>{let o=s&&typeof s=="object"&&!Array.isArray(s)?{...s}:{},a={},i={expects_data:o,data:a,...r?{config:r}:{}},l,c;for(let d of n)try{let u=$(d.expr).evaluate(i);if(d.bindTo==="result")l=u!=null?String(u):"success";else if(d.bindTo==="error")c=u!=null?String(u):void 0;else if(d.bindTo.startsWith("data."))Wt(a,d.bindTo.slice(5),u);else return {result:"failure",data:{},error:`[${t}] invalid bindTo "${d.bindTo}": must be "result", "error", or start with "data."`}}catch(u){let f=u instanceof Error?u.message:String(u);return {result:"failure",data:{},error:`[${t}] compute "${d.bindTo}" failed: ${f}`}}return l===void 0?{result:"failure",data:{},error:`[${t}] compute-jsonata: no "result" binding declared \u2014 add '- result = "success"' to expr`}:c?{result:l,data:a,error:c}:{result:l,data:a}}}function gt(e,t,r,n){let{type:s,...o}=e,a={...o,whatToRun:typeof o.whatToRun=="object"?D(o.whatToRun):o.whatToRun};return async i=>{let l=i&&typeof i=="object"&&!Array.isArray(i)?{...i}:{};n&&(l.config=n);try{let c=await r(a,l);if(!e.outputTransforms)return c;try{return lt(e.outputTransforms,c,t)}catch(d){let u=d instanceof Error?d.message:String(d);return {result:"failure",data:{},error:u}}}catch(c){let d=c instanceof Error?c.message:String(c);return {result:"failure",data:{error:`[step-machine-public] step "${t}" invoke threw: ${d}`}}}}}function mt(){return async e=>({result:"success",data:e&&typeof e=="object"&&!Array.isArray(e)?e:{}})}function Gt(e,t,r){return async(n,s)=>{let o=n?.[t.items];if(!Array.isArray(o))return {result:"failure",data:{},error:`[${r}] forEach: "${t.items}" is not an array (got ${typeof o})`};let a=o,i=t.collectAs??`${t.items}_results`;if(a.length===0)return {result:"success",data:{[i]:[]}};let{[t.items]:l,...c}=n,d=Math.max(1,t.concurrency??1),u=new Array(a.length),f=0,h=0,w=0;return await new Promise(p=>{function g(){for(;f<d&&h<a.length;){let x=h++;f++;let P={...c,[t.as]:a[x]};e(P,s).then(S=>{u[x]=S;}).catch(S=>{let y=S instanceof Error?S.message:String(S);u[x]={result:"failure",data:{},error:y};}).finally(()=>{f--,u[x]?.result==="failure"&&w++,h>=a.length&&f===0?p():g();});}f===0&&h>=a.length&&p();}g();}),w>0?{result:"failure",data:{errors:u.filter(g=>g.result==="failure").map(g=>g.error)},error:`[${r}] forEach: ${w}/${a.length} items failed`}:{result:"success",data:{[i]:u.map(p=>p.data)}}}}function ht(e,t,r){let n=Array.isArray(t?.produces_data)?t?.produces_data:void 0,s=Array.isArray(t?.input_validations)?t?.input_validations:void 0,o=t?.config??void 0,a=t?.handler,i;return pt(a)?i=ft(a,e,o):dt(a)?i=gt(a,e,r.invoke,o):i=mt(),t?.forEach&&(i=Gt(i,t.forEach,e)),W(z(i,n),s,e)}function X(e,t){let r={};for(let[n,s]of Object.entries(e.steps??{}))r[n]=ht(n,s,t);return r}function Zt(e){if(typeof e=="object"&&e!==null){let{command:r,args:n=[],...s}=e,o=wt(r,n);return {...s,command:o.command,args:o.args}}let t=xt(e);if(t.length===0)throw new Error(`Empty command spec: ${JSON.stringify(e)}`);return wt(t[0],t.slice(1))}function wt(e,t){return /^(node|node\.exe)$/i.test(e)?{command:process.execPath,args:t}:/\.m?js$/i.test(e)?{command:process.execPath,args:[e,...t]}:{command:e,args:t}}function xt(e){let t=[],r="",n=null;for(let s of e.trim()){if(n){s===n?n=null:r+=s;continue}if(s==='"'||s==="'"){n=s;continue}if(/\s/.test(s)){r&&(t.push(r),r="");continue}r+=s;}if(n)throw new Error(`Unterminated quote in command: ${e}`);return r&&t.push(r),t}function Y(e){return process.platform==="win32"&&/\.(cmd|bat)$/i.test(e)}function vt(e,t){let{command:r,args:n=[],cwd:s,env:o,timeoutMs:a}=e;return execFileSync(r,n,{shell:Y(r),timeout:a,encoding:t?.encoding??"utf-8",cwd:s,windowsHide:true,env:o?{...process.env,...o}:void 0,input:t?.input})}function te(e,t){let{command:r,args:n=[],cwd:s,env:o,timeoutMs:a=3e4}=e;execFile(r,n,{shell:Y(r),encoding:"utf8",windowsHide:true,timeout:a,maxBuffer:10*1024*1024,cwd:s,env:o?{...process.env,...o}:void 0},(i,l,c)=>t(i??null,l,c));}R.join(St.tmpdir(),".board-live-cards-git-bash-cache.json");function Rt(e){let{command:t,args:r=[]}=e;if(process.platform==="win32"){spawn(t,r,{detached:true,stdio:"ignore",windowsHide:true,shell:Y(t)}).unref();return}spawn(t,r,{detached:true,stdio:"ignore"}).unref();}function kt(e,t,r){let n=R.join(e,"board-live-cards-cli.js");if(m.existsSync(n))return {cmd:process.execPath,args:[n,t,...r]};let s=R.join(e,"board-live-cards-cli.ts"),o=R.join(e,"..","..","node_modules","tsx","dist","cli.mjs"),a=R.join(e,"..","..","node_modules",".bin","tsx"),i=m.existsSync(o)?o:a;return m.existsSync(s)&&m.existsSync(i)?{cmd:process.execPath,args:[i,s,t,...r]}:{cmd:process.platform==="win32"?"npx.cmd":"npx",args:["tsx",s,t,...r]}}function bt(){return {executeSync(e,t,r){return vt({command:e,args:t,cwd:r?.cwd,timeoutMs:r?.timeout,env:r?.env},{encoding:r?.encoding,input:r?.input})},executeAsync(e,t,r){te({command:e,args:t},r);},resolveInvocation(e,t){let r=Zt({command:e,args:t});return {cmd:r.command,args:r.args??[]}},splitCommand:xt,spawnDetached(e,t){Rt({command:e,args:t});}}}function ee(e,t){let r=typeof e=="object"?e.value:G(e).value;switch(r){case "source-cli-task-executor":{let n=R.join(t,"source-cli-task-executor.js");if(m.existsSync(n))return {command:process.execPath,args:[n]};let s=R.join(t,"source-cli-task-executor.ts"),o=R.join(t,"..","..","node_modules","tsx","dist","cli.mjs"),a=R.join(t,"..","..","node_modules",".bin","tsx"),i=m.existsSync(o)?o:a;return m.existsSync(s)&&m.existsSync(i)?{command:process.execPath,args:[i,s]}:{command:process.execPath,args:[n]}}case "board-live-cards":{let{cmd:n,args:s}=kt(t,"_",[]);return {command:n,args:s}}default:throw new Error(`resolveBuiltIn: unknown built-in name "${r}". Supported: source-cli-task-executor, board-live-cards`)}}function re(e,t){if(e.howToRun==="built-in"){let{command:n,args:s}=ee(e.whatToRun,t);return {command:n,baseArgs:s}}let r=typeof e.whatToRun=="object"?e.whatToRun.value:G(e.whatToRun).value;switch(e.howToRun){case "local-node":return {command:process.execPath,baseArgs:[r]};case "local-python":return {command:process.platform==="win32"?"python":"python3",baseArgs:[r]};case "local-process":return {command:r,baseArgs:[]};default:throw new Error(`resolveBaseInvocation: howToRun "${e.howToRun}" is not a local transport`)}}function ne(e,t){return re(e,t)}function se(e){let t=e.trim();if(!t)throw new Error("empty stdout");try{return JSON.parse(t)}catch{let r=t.split(/\r?\n/).filter(Boolean),n=r[r.length-1];return JSON.parse(n)}}function Et(e,t,r){let n=r?.label??"invokeRefSync",s=r?.cliDir??r?.cwd??process.cwd(),o;try{o=ut(e.argsMassaging,t,n);}catch(u){return {result:"failure",data:{error:u instanceof Error?u.message:String(u)}}}let a;try{a=ne(e,s);}catch(u){let f=u instanceof Error?u.message:String(u);return {result:"failure",data:{error:`[${n}] ref resolution failed: ${f}`}}}let i=[...a.baseArgs,...o.cmdArgs??[]],l=JSON.stringify(o.stdin??t),c=bt(),d;try{d=c.executeSync(a.command,i,{timeout:r?.timeoutMs??3e4,encoding:"utf-8",cwd:r?.cwd,input:l});}catch(u){let f=u,h=(f.stderr?String(f.stderr):"").trim(),w=typeof f.status=="number"?f.status:"unknown",p=h||f.message;return {result:"failure",data:{error:`[${n}] ref exited with status ${w}${p?`: ${p}`:""}`}}}try{let u=se(d);return {result:"success",data:u&&typeof u=="object"&&!Array.isArray(u)?u:{stdout:u}}}catch{return {result:"success",data:{stdout:d.trim()}}}}function ie(e,t){if(process.platform!=="win32"){m.renameSync(e,t);return}let r=[10,20,40,80,160];for(let n=0;n<=r.length;n++)try{m.renameSync(e,t);return}catch(s){let o=s.code;if((o==="EPERM"||o==="EBUSY")&&n<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[n]);continue}throw s}}function At(e){function t(n){return R.join(e,...n.split("/"))+".json"}function r(n,s,o,a){if(m.existsSync(n))for(let i of m.readdirSync(n,{withFileTypes:true})){let l=s?`${s}/${i.name}`:i.name;if(i.isDirectory()){r(R.join(n,i.name),l,o,a);continue}if(!i.isFile()||!i.name.endsWith(".json"))continue;let c=l.replace(/\.json$/,"");(!o||c.startsWith(o))&&a.push(c);}}return {read(n){let s=t(n);if(!m.existsSync(s))return null;try{return JSON.parse(m.readFileSync(s,"utf-8"))}catch{return null}},write(n,s){let o=t(n),a=`${o}.${process.pid}.${randomUUID()}.tmp`;m.mkdirSync(R.dirname(o),{recursive:true}),m.writeFileSync(a,JSON.stringify(s,null,2),"utf-8"),ie(a,o);},delete(n){let s=t(n);try{m.existsSync(s)&&m.unlinkSync(s);}catch{}},listKeys(n){let s=[];return r(e,"",n,s),s.sort()}}}var B=class extends Error{constructor(r,n){super(n);this.code=r;this.name="CliExitError";}code},ae=".pause";async function Hr(e){let t=ce(e);if(t.help||e.length===0)throw he(),new B(e.length===0?1:0);let{flowArg:r,dataArg:n,storeArg:s,storeDirArg:o,resumeRequested:a,pauseRequested:i,statusRequested:l}=t;if((i||l)&&(n||a||r))throw new Error("[step-machine-cli] --pause and --status are store-level operations. Do not provide flow, data, or --resume.");if(a&&n)throw new Error("[step-machine-cli] --initial-data cannot be combined with --resume.");let c=ue(s,o);if(l){await de(c);return}if(i){await le(c);return}if(!r)throw new Error("[step-machine-cli] Flow path is required for run/resume operations.");let d=$t(r),u=R.dirname(d),f=fe(n),{store:h}=c,w=await H(d),p=me(w,u);jt(c);let g=new AbortController,x=false,P=_(w,p,{store:h,signal:g.signal,onStep:()=>{!x&&Z(c)&&(x=true,g.abort());}}),S;if(a){if(S=await Ct(c),!S){console.warn("[step-machine-cli] No paused run found in store directory."),console.log(JSON.stringify({status:"noop",reason:"no-paused-run"},null,2));return}}else c.storeType==="file"&&!f&&(S=await Ct(c));let y=S?await P.resume(S):await P.run(f);if(x&&y.status==="cancelled"){let M=await pe(h,y.runId);jt(c),console.log(JSON.stringify({runId:y.runId,status:"paused",currentStep:M?.currentStep,pausedAt:M?.pausedAt,stepHistory:y.stepHistory,data:y.data},null,2));return}if(y.status!=="completed"){let M=y.error?.message??y.intent??y.status;throw console.error(`[step-machine-cli] Run failed: ${M}`),new B(1)}console.log(JSON.stringify({runId:y.runId,status:y.status,intent:y.intent,finalStep:y.finalStep,stepHistory:y.stepHistory,data:y.data},null,2));}function ce(e){let t=new Set(["--initial-data","--store","--store-dir"]),r={},n=[],s=false,o=false,a=false,i=false;for(let l=0;l<e.length;l++){let c=e[l];if(c==="-h"||c==="--help"){s=true;continue}if(c==="--resume"){o=true;continue}if(c==="--pause"){a=true;continue}if(c==="--status"){i=true;continue}if(t.has(c)){let d=e[l+1];if(!d||d.startsWith("--"))throw new Error(`[step-machine-cli] Missing value for ${c}.`);r[c]=d,l++;continue}if(c.startsWith("--"))throw new Error(`[step-machine-cli] Unknown flag: ${c}`);n.push(c);}if([o,a,i].filter(Boolean).length>1)throw new Error("[step-machine-cli] Use only one of --resume, --pause, or --status at a time.");return {help:s,flowArg:n[0],dataArg:r["--initial-data"],storeArg:String(r["--store"]??"memory").toLowerCase(),storeDirArg:r["--store-dir"],resumeRequested:o,pauseRequested:a,statusRequested:i}}function $t(e){return R.isAbsolute(e)?e:R.resolve(process.cwd(),e)}function ue(e,t){if(e!=="memory"&&e!=="file")throw new Error(`[step-machine-cli] Invalid --store value "${e}". Expected "memory" or "file".`);if(e==="memory")return {storeType:e,storeDir:void 0,pauseFilePath:void 0,store:new k};if(!t||t.trim().length===0)throw new Error("[step-machine-cli] --store file requires --store-dir <directory>.");let r=$t(t);return {storeType:e,storeDir:r,pauseFilePath:R.join(r,ae),store:new j(At(r))}}async function Q(e){if(!e.listRuns)return [];let t=await e.listRuns(),r=[];for(let n of t){let s=await e.loadRunState(n);s&&r.push(s);}return r.sort((n,s)=>(s.updatedAt??s.startedAt??0)-(n.updatedAt??n.startedAt??0)),r}function Z(e){return e.storeType!=="file"||!e.pauseFilePath?false:m.existsSync(e.pauseFilePath)}function jt(e){Z(e)&&m.unlinkSync(e.pauseFilePath);}async function le(e){if(e.storeType!=="file"||!e.pauseFilePath)throw new Error("[step-machine-cli] --pause requires --store file --store-dir <directory>.");let t=await Q(e.store);if(t.length===0){console.warn("[step-machine-cli] No runs found in store directory. Pause is a no-op."),console.log(JSON.stringify({status:"noop",reason:"no-runs"},null,2));return}if(!t.find(n=>n.status==="running")){console.warn("[step-machine-cli] No running run found. Pause is a no-op."),console.log(JSON.stringify({status:"noop",reason:"no-running-run"},null,2));return}m.mkdirSync(e.storeDir,{recursive:true}),m.writeFileSync(e.pauseFilePath,JSON.stringify({requestedAt:Date.now()}),"utf-8"),console.log(JSON.stringify({status:"pause-requested",storeDir:e.storeDir},null,2));}async function Ct(e){let r=(await Q(e.store)).filter(n=>n.status==="paused");if(r.length!==0)return r.length>1&&console.warn("[step-machine-cli] Multiple paused runs found; resuming the most recently updated run."),r[0].runId}async function pe(e,t){let r=await e.loadRunState(t);if(!r)return null;let n={...r,status:"paused",pausedAt:Date.now(),updatedAt:Date.now()};return await e.saveRunState(t,n),n}async function de(e){if(e.storeType!=="file")throw new Error("[step-machine-cli] --status requires --store file --store-dir <directory>.");let t=await Q(e.store),r={store:"file",storeDir:e.storeDir,pauseRequested:Z(e),totalRuns:t.length,runs:t.map(n=>({runId:n.runId,status:n.status,currentStep:n.currentStep,startedAt:n.startedAt,updatedAt:n.updatedAt,pausedAt:n.pausedAt}))};console.log(JSON.stringify(r,null,2));}function fe(e){if(e)try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Initial data must be a JSON object.");return t}catch(t){let r=t instanceof Error?t.message:String(t);throw new Error(`[step-machine-cli] Invalid --initial-data value: ${r}`)}}function ge(e){if(!e||typeof e!="object")return e;let t=e;if(typeof t.whatToRun!="string"||!t.whatToRun.startsWith("b64:"))return e;try{let r=t.whatToRun.slice(4),n=r+"=".repeat((4-r.length%4)%4),s=Buffer.from(n.replace(/-/g,"+").replace(/_/g,"/"),"base64").toString("utf8"),o=JSON.parse(s);return !o||typeof o!="object"||typeof o.value!="string"?e:{...t,whatToRun:o}}catch{return e}}function me(e,t){return X(e,{invoke:(n,s)=>Et(ge(n),s,{cliDir:t,cwd:t})})}function he(){console.error("Usage: step-machine-cli <step-flow.yaml> [--initial-data <json>] [--store <memory|file>] [--store-dir <directory>] [--resume]"),console.error(" step-machine-cli --store file --store-dir <directory> --pause"),console.error(" step-machine-cli --store file --store-dir <directory> --status"),console.error(""),console.error("Example:"),console.error(' step-machine-cli examples/cli/step-machine-demo/two-step-math.flow.yaml --initial-data "{"a":3,"b":4}"'),console.error(" step-machine-cli ./flow.yaml --store file --store-dir ./.runs"),console.error(" step-machine-cli ./flow.yaml --store file --store-dir ./.runs --resume"),console.error(" step-machine-cli --store file --store-dir ./.runs --pause"),console.error(" step-machine-cli --store file --store-dir ./.runs --status");}
4
+ export{B as CliExitError,Hr as cli};//# sourceMappingURL=step-machine-cli.js.map
5
+ //# sourceMappingURL=step-machine-cli.js.map
@@ -1,5 +1,5 @@
1
- import { ExecutionRef } from './execution-refs.cjs';
2
- import { L as LiveCard, B as BoardStatusObject, J as JournalStorageAdapter, O as OutputStoreEvent } from './board-live-cards-lib-Bg6EvCo5.cjs';
1
+ import { E as ExecutionRef } from './execution-interface-C_A6WCiK.js';
2
+ import { L as LiveCard, B as BoardStatusObject, J as JournalStorageAdapter, O as OutputStoreEvent } from './board-live-cards-lib-tjYsPt5U.js';
3
3
 
4
4
  /**
5
5
  * storage-interface.ts
@@ -60,8 +60,7 @@ interface KindValueRef {
60
60
  }
61
61
  /** Serialize a KindValueRef to the wire format: b64:<base64url(json)> */
62
62
  declare function serializeRef(ref: KindValueRef): string;
63
- /** Parse a wire-format ref string (b64:<base64url(json)>) into a KindValueRef.
64
- * Also accepts the legacy ::fs-path::<path> format for backward compatibility. */
63
+ /** Parse a wire-format ref string (b64:<base64url(json)>) into a KindValueRef. */
65
64
  declare function parseRef(s: string): KindValueRef;
66
65
  interface KVStorage {
67
66
  /** Returns the stored value, or null if the key does not exist. */
@@ -267,6 +266,7 @@ interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
267
266
  */
268
267
  invokeExecutorSync(ref: ExecutionRef, subcommand: string, args: string[], opts?: {
269
268
  timeout?: number;
269
+ input?: string;
270
270
  }): string;
271
271
  /** Schema-only card validator (no executor invocation). */
272
272
  validateSchema(card: Record<string, unknown>): {
@@ -285,8 +285,8 @@ interface BoardLiveCardsNonCorePublic {
285
285
  isValid: boolean;
286
286
  issues: string[];
287
287
  }>>;
288
- /** body: { "card-content": <card> } — card JSON arrives via stdin */
289
- validateTmpCard(input: CommandInput): CommandResult<{
288
+ /** body: { "card-content": <card> } — card JSON arrives via stdin; validates schema + JSONata + provides refs + source_defs (executor, if configured) */
289
+ validateCardPreflight(input: CommandInput): CommandResult<{
290
290
  cardId: string;
291
291
  isValid: boolean;
292
292
  issues: string[];
@@ -295,6 +295,20 @@ interface BoardLiveCardsNonCorePublic {
295
295
  probeSource(input: CommandInput): CommandResult;
296
296
  /** body: { sourceDef, mockProjections }; params: outRef? */
297
297
  probeTmpSource(input: CommandInput): CommandResult;
298
+ /** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — card JSON arrives via stdin; no board state needed */
299
+ probeSourcePreflight(input: CommandInput): CommandResult;
300
+ /** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — evaluates compute expressions with supplied data; no board state needed */
301
+ evalCardCompute(input: CommandInput): CommandResult<{
302
+ cardId: string;
303
+ ok: boolean;
304
+ computed_values: Record<string, unknown>;
305
+ errors: Array<{
306
+ bindTo: string;
307
+ error: string;
308
+ }>;
309
+ }>;
310
+ /** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — full cycle: validate → resolve projections → probe sources → compute */
311
+ simulateCardCycle(input: CommandInput): CommandResult;
298
312
  /** no params needed */
299
313
  describeTaskExecutorCapabilities(input: CommandInput): CommandResult;
300
314
  /**
@@ -315,4 +329,52 @@ interface BoardLiveCardsNonCorePublic {
315
329
  }
316
330
  declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter): BoardLiveCardsNonCorePublic;
317
331
 
318
- export { type BoardPlatformAdapter as B, type CommandInput as C, type KVStorage as K, type BlobStorage as a, type BoardChangeNotification as b, type BoardLiveCardsPublic as c, type CommandResult as d, type KindValueRef as e, type BoardNonCorePlatformAdapter as f, type BoardLiveCardsNonCorePublic as g, createBoardLiveCardsNonCorePublic as h, createBoardLiveCardsPublic as i, parseRef as p, serializeRef as s };
332
+ /**
333
+ * server-runtime/types.ts
334
+ *
335
+ * Platform-free adapter interfaces for the board server runtime.
336
+ *
337
+ * The runtime (index.ts) imports ONLY this file and board-live-cards-public
338
+ * for its dependencies — no node:fs, node:net, node:child_process, etc.
339
+ *
340
+ * Hosts (demo-server, Azure Function, Firebase Function) provide implementations
341
+ * of these interfaces when constructing the runtime.
342
+ */
343
+
344
+ interface InvocationAdapter {
345
+ /**
346
+ * Fire-and-forget invocation of an ExecutionRef with args.
347
+ * Used for chat-handler dispatch, and potentially task-executor / inference-adapter.
348
+ * Returns a promise that resolves when the invocation is dispatched (not completed).
349
+ */
350
+ invoke(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
351
+ dispatched: boolean;
352
+ error?: string;
353
+ }>;
354
+ /**
355
+ * Optional synchronous describe call — asks the target to identify itself.
356
+ * Used for pre-init validation (e.g. confirming a chat-handler reports kind='chat-handler').
357
+ * Hosts that pre-register capabilities at deploy time may omit this.
358
+ */
359
+ describe?(ref: ExecutionRef): Promise<DescribeEnvelope | null>;
360
+ }
361
+ interface NotificationTransport {
362
+ /**
363
+ * Start listening for events on a notification endpoint identified by a kind-ref.
364
+ * The ref kind determines the transport mechanism:
365
+ * ::named-pipe::/tmp/board-x.sock
366
+ * ::firestore-watch::collections/board-x/notifications
367
+ * ::signalr::https://x.service.signalr.net/hub/board-x
368
+ * onEvent is called with parsed JSON notification objects.
369
+ * Returns a teardown function.
370
+ */
371
+ subscribe(ref: KindValueRef, onEvent: (event: unknown) => void): Promise<() => void>;
372
+ }
373
+ interface DescribeEnvelope {
374
+ name: string;
375
+ kind: 'task-executor' | 'chat-handler' | 'inference-adapter';
376
+ protocolVersion: string;
377
+ supports?: string[];
378
+ }
379
+
380
+ export { type BoardPlatformAdapter as B, type CommandInput as C, type DescribeEnvelope as D, type InvocationAdapter as I, type KindValueRef as K, type NotificationTransport as N, type CommandResult as a, type BlobStorage as b, type BoardNonCorePlatformAdapter as c, type BoardLiveCardsNonCorePublic as d, type BoardLiveCardsPublic as e, createBoardLiveCardsNonCorePublic as f, createBoardLiveCardsPublic as g, parseRef as p, serializeRef as s };
@@ -0,0 +1 @@
1
+ "b64:eyJraW5kIjoiZnMtcGF0aCIsInZhbHVlIjoiL2hvbWUvcnVubmVyL3dvcmsveWFtbC1mbG93L3lhbWwtZmxvdy9wdWJsaWMtZXhhbXBsZXMvYm9hcmQvLmRlbW8tc2V0dXAvcnVuLTE3Nzg2NDM3MDMxNTEtMzM2MC1kb3BucHYvYm9hcmQtZGVmYXVsdC9nYW5kYWxmLXJ1bnRpbWUvY2FyZHMvc3RvcmUifQ"
@@ -0,0 +1 @@
1
+ "{\"howToRun\":\"local-node\",\"whatToRun\":\"b64:eyJraW5kIjoiZnMtcGF0aCIsInZhbHVlIjoiL2hvbWUvcnVubmVyL3dvcmsveWFtbC1mbG93L3lhbWwtZmxvdy9wdWJsaWMtZXhhbXBsZXMvYm9hcmQvZGVtby1jaGF0LWhhbmRsZXIuanMifQ\",\"meta\":\"chat-handler\"}"
@@ -0,0 +1 @@
1
+ "b64:eyJraW5kIjoiZnMtcGF0aCIsInZhbHVlIjoiL2hvbWUvcnVubmVyL3dvcmsveWFtbC1mbG93L3lhbWwtZmxvdy9wdWJsaWMtZXhhbXBsZXMvYm9hcmQvLmRlbW8tc2V0dXAvcnVuLTE3Nzg2NDM3MDMxNTEtMzM2MC1kb3BucHYvYm9hcmQtZGVmYXVsdC9nYW5kYWxmLXJ1bnRpbWUtb3V0Ly5vdXRwdXRzIn0"
@@ -0,0 +1 @@
1
+ "{\"howToRun\":\"local-node\",\"whatToRun\":\"b64:eyJraW5kIjoiZnMtcGF0aCIsInZhbHVlIjoiL2hvbWUvcnVubmVyL3dvcmsveWFtbC1mbG93L3lhbWwtZmxvdy9wdWJsaWMtZXhhbXBsZXMvYm9hcmQvZGVtby10YXNrLWV4ZWN1dG9yLmpzIn0\",\"meta\":\"task-executor\"}"
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": 1,
3
+ "config": {
4
+ "settings": {
5
+ "completion": "manual",
6
+ "refreshStrategy": "data-changed"
7
+ },
8
+ "tasks": {}
9
+ },
10
+ "state": {
11
+ "status": "running",
12
+ "tasks": {},
13
+ "availableOutputs": [],
14
+ "stuckDetection": {
15
+ "is_stuck": false,
16
+ "stuck_description": null,
17
+ "outputs_unresolvable": [],
18
+ "tasks_blocked": []
19
+ },
20
+ "lastUpdated": "2026-05-13T03:41:43.304Z",
21
+ "executionId": "live-1778643703304",
22
+ "executionConfig": {
23
+ "executionMode": "eligibility-mode",
24
+ "conflictStrategy": "alphabetical",
25
+ "completionStrategy": "manual"
26
+ }
27
+ },
28
+ "snapshotAt": "2026-05-13T03:41:43.304Z"
29
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "schema_version": "v1",
3
+ "meta": {
4
+ "board": {
5
+ "path": "b64:eyJraW5kIjoiZnMtcGF0aCIsInZhbHVlIjoiL2hvbWUvcnVubmVyL3dvcmsveWFtbC1mbG93L3lhbWwtZmxvdy9wdWJsaWMtZXhhbXBsZXMvYm9hcmQvLmRlbW8tc2V0dXAvcnVuLTE3Nzg2NDM3MDMxNTEtMzM2MC1kb3BucHYvYm9hcmQtZGVmYXVsdC9nYW5kYWxmLXJ1bnRpbWUifQ"
6
+ }
7
+ },
8
+ "summary": {
9
+ "card_count": 0,
10
+ "completed": 0,
11
+ "eligible": 0,
12
+ "pending": 0,
13
+ "blocked": 0,
14
+ "unresolved": 0,
15
+ "failed": 0,
16
+ "in_progress": 0,
17
+ "orphan_cards": 0,
18
+ "topology": {
19
+ "edge_count": 0,
20
+ "max_fan_out_card": null,
21
+ "max_fan_out": 0
22
+ }
23
+ },
24
+ "cards": []
25
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "normalizedQuotes": {
3
+ "quoteResponse": {
4
+ "result": [
5
+ {
6
+ "symbol": "AAPL",
7
+ "shortName": "Apple Inc.",
8
+ "regularMarketPrice": 294.8,
9
+ "regularMarketChange": 2.1200000000000045,
10
+ "regularMarketChangePercent": 0.7243405767391022
11
+ },
12
+ {
13
+ "symbol": "NVDA",
14
+ "shortName": "NVIDIA Corporation",
15
+ "regularMarketPrice": 220.78,
16
+ "regularMarketChange": 1.3400000000000034,
17
+ "regularMarketChangePercent": 0.6106452788917259
18
+ },
19
+ {
20
+ "symbol": "GOOG",
21
+ "shortName": "Alphabet Inc.",
22
+ "regularMarketPrice": 383.82,
23
+ "regularMarketChange": -2.9499999999999886,
24
+ "regularMarketChangePercent": -0.7627272022131987
25
+ },
26
+ {
27
+ "symbol": "MSFT",
28
+ "shortName": "Microsoft Corporation",
29
+ "regularMarketPrice": 407.77,
30
+ "regularMarketChange": -4.890000000000043,
31
+ "regularMarketChangePercent": -1.1849949110648095
32
+ }
33
+ ],
34
+ "error": null
35
+ }
36
+ },
37
+ "prices": [
38
+ {
39
+ "ticker": "AAPL",
40
+ "name": "Apple Inc.",
41
+ "price": 294.8,
42
+ "change": 2.12,
43
+ "chg_pct": 0.72
44
+ },
45
+ {
46
+ "ticker": "NVDA",
47
+ "name": "NVIDIA Corporation",
48
+ "price": 220.78,
49
+ "change": 1.34,
50
+ "chg_pct": 0.61
51
+ },
52
+ {
53
+ "ticker": "GOOG",
54
+ "name": "Alphabet Inc.",
55
+ "price": 383.82,
56
+ "change": -2.95,
57
+ "chg_pct": -0.76
58
+ },
59
+ {
60
+ "ticker": "MSFT",
61
+ "name": "Microsoft Corporation",
62
+ "price": 407.77,
63
+ "change": -4.89,
64
+ "chg_pct": -1.18
65
+ }
66
+ ]
67
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "positions": [
3
+ {
4
+ "ticker": "AAPL",
5
+ "quantity": 10,
6
+ "cost_basis": 150,
7
+ "price": 294.8,
8
+ "value": 2948,
9
+ "gain_$": 1448,
10
+ "gain_%": 96.53,
11
+ "chg_$": 21.2,
12
+ "chg_pct": 0.72
13
+ },
14
+ {
15
+ "ticker": "NVDA",
16
+ "quantity": 5,
17
+ "cost_basis": 310,
18
+ "price": 220.78,
19
+ "value": 1103.9,
20
+ "gain_$": -446.1,
21
+ "gain_%": -28.78,
22
+ "chg_$": 6.7,
23
+ "chg_pct": 0.61
24
+ },
25
+ {
26
+ "ticker": "GOOG",
27
+ "quantity": 3,
28
+ "cost_basis": 33,
29
+ "price": 383.82,
30
+ "value": 1151.46,
31
+ "gain_$": 1052.46,
32
+ "gain_%": 1063.09,
33
+ "chg_$": -8.85,
34
+ "chg_pct": -0.76
35
+ },
36
+ {
37
+ "ticker": "MSFT",
38
+ "quantity": 1,
39
+ "cost_basis": 100,
40
+ "price": 407.77,
41
+ "value": 407.77,
42
+ "gain_$": 307.77,
43
+ "gain_%": 307.77,
44
+ "chg_$": -4.89,
45
+ "chg_pct": -1.18
46
+ }
47
+ ],
48
+ "totalValue": 5611.13,
49
+ "gainers": 2,
50
+ "losers": 2,
51
+ "gainersLosers": "2 up · 2 down"
52
+ }
@@ -0,0 +1,22 @@
1
+ [
2
+ {
3
+ "ticker": "AAPL",
4
+ "quantity": 10,
5
+ "cost_basis": 150
6
+ },
7
+ {
8
+ "ticker": "NVDA",
9
+ "quantity": 5,
10
+ "cost_basis": 310
11
+ },
12
+ {
13
+ "ticker": "GOOG",
14
+ "quantity": 3,
15
+ "cost_basis": 33
16
+ },
17
+ {
18
+ "ticker": "MSFT",
19
+ "quantity": 1,
20
+ "cost_basis": 100
21
+ }
22
+ ]
@@ -0,0 +1,46 @@
1
+ [
2
+ {
3
+ "ticker": "AAPL",
4
+ "quantity": 10,
5
+ "cost_basis": 150,
6
+ "price": 294.8,
7
+ "value": 2948,
8
+ "gain_$": 1448,
9
+ "gain_%": 96.53,
10
+ "chg_$": 21.2,
11
+ "chg_pct": 0.72
12
+ },
13
+ {
14
+ "ticker": "NVDA",
15
+ "quantity": 5,
16
+ "cost_basis": 310,
17
+ "price": 220.78,
18
+ "value": 1103.9,
19
+ "gain_$": -446.1,
20
+ "gain_%": -28.78,
21
+ "chg_$": 6.7,
22
+ "chg_pct": 0.61
23
+ },
24
+ {
25
+ "ticker": "GOOG",
26
+ "quantity": 3,
27
+ "cost_basis": 33,
28
+ "price": 383.82,
29
+ "value": 1151.46,
30
+ "gain_$": 1052.46,
31
+ "gain_%": 1063.09,
32
+ "chg_$": -8.85,
33
+ "chg_pct": -0.76
34
+ },
35
+ {
36
+ "ticker": "MSFT",
37
+ "quantity": 1,
38
+ "cost_basis": 100,
39
+ "price": 407.77,
40
+ "value": 407.77,
41
+ "gain_$": 307.77,
42
+ "gain_%": 307.77,
43
+ "chg_$": -4.89,
44
+ "chg_pct": -1.18
45
+ }
46
+ ]
@@ -0,0 +1,35 @@
1
+ {
2
+ "quoteResponse": {
3
+ "result": [
4
+ {
5
+ "symbol": "AAPL",
6
+ "shortName": "Apple Inc.",
7
+ "regularMarketPrice": 294.8,
8
+ "regularMarketChange": 2.1200000000000045,
9
+ "regularMarketChangePercent": 0.7243405767391022
10
+ },
11
+ {
12
+ "symbol": "NVDA",
13
+ "shortName": "NVIDIA Corporation",
14
+ "regularMarketPrice": 220.78,
15
+ "regularMarketChange": 1.3400000000000034,
16
+ "regularMarketChangePercent": 0.6106452788917259
17
+ },
18
+ {
19
+ "symbol": "GOOG",
20
+ "shortName": "Alphabet Inc.",
21
+ "regularMarketPrice": 383.82,
22
+ "regularMarketChange": -2.9499999999999886,
23
+ "regularMarketChangePercent": -0.7627272022131987
24
+ },
25
+ {
26
+ "symbol": "MSFT",
27
+ "shortName": "Microsoft Corporation",
28
+ "regularMarketPrice": 407.77,
29
+ "regularMarketChange": -4.890000000000043,
30
+ "regularMarketChangePercent": -1.1849949110648095
31
+ }
32
+ ],
33
+ "error": null
34
+ }
35
+ }