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
@@ -0,0 +1,321 @@
1
+ /**
2
+ * Event Graph — Core Types
3
+ *
4
+ * Type definitions for the stateless event-graph engine.
5
+ * Pure: f(state, event) → newState
6
+ */
7
+ interface GraphConfig {
8
+ id?: string;
9
+ settings: GraphSettings;
10
+ tasks: Record<string, TaskConfig>;
11
+ }
12
+ interface GraphSettings {
13
+ /** Completion strategy */
14
+ completion: CompletionStrategy;
15
+ /** Conflict resolution strategy */
16
+ conflict_strategy?: ConflictStrategy;
17
+ /** Execution mode */
18
+ execution_mode?: ExecutionMode;
19
+ /** Default refresh strategy for all tasks (default: 'data-changed') */
20
+ refreshStrategy?: RefreshStrategy;
21
+ /** Goal outputs — used with 'goal-reached' completion */
22
+ goal?: string[];
23
+ /** Max total scheduler iterations (safety limit, default: 1000) */
24
+ max_iterations?: number;
25
+ /** Timeout in ms (declared for drivers, not enforced by pure engine) */
26
+ timeout_ms?: number;
27
+ }
28
+ interface TaskConfig {
29
+ /** What this task needs to become eligible */
30
+ requires?: string[];
31
+ /** What this task produces on successful completion */
32
+ provides: string[];
33
+ /** Conditional provides based on handler result */
34
+ on?: Record<string, string[]>;
35
+ /** Tokens to inject into available outputs on failure */
36
+ on_failure?: string[];
37
+ /** Task execution method (informational — driver concern) */
38
+ method?: string;
39
+ /** Named task handler references — looked up in the handler registry at dispatch time */
40
+ taskHandlers?: string[];
41
+ /** Arbitrary task configuration (driver concern) */
42
+ config?: Record<string, unknown>;
43
+ /** Task priority (higher = preferred in conflict resolution) */
44
+ priority?: number;
45
+ /** Estimated duration in ms (used by duration-first strategy) */
46
+ estimatedDuration?: number;
47
+ /** Estimated cost (used by cost-optimized strategy) */
48
+ estimatedCost?: number;
49
+ /** Resource requirements (used by resource-aware strategy) */
50
+ estimatedResources?: Record<string, number>;
51
+ /** Retry configuration */
52
+ retry?: TaskRetryConfig;
53
+ /** Refresh strategy — controls when a completed task re-runs (default: 'data-changed') */
54
+ refreshStrategy?: RefreshStrategy;
55
+ /** Refresh interval in seconds — only used with 'time-based' strategy */
56
+ refreshInterval?: number;
57
+ /** Max executions cap (safety limit, optional) */
58
+ maxExecutions?: number;
59
+ /** Circuit breaker: max executions before breaking */
60
+ circuit_breaker?: TaskCircuitBreakerConfig;
61
+ /** Description */
62
+ description?: string;
63
+ /** LLM inference hints — opt-in metadata for AI-assisted completion detection */
64
+ inference?: {
65
+ /** Human-readable completion criteria */
66
+ criteria?: string;
67
+ /** Keywords to help the LLM understand the domain */
68
+ keywords?: string[];
69
+ /** Suggested checks for verification */
70
+ suggestedChecks?: string[];
71
+ /** Whether the LLM should attempt to auto-detect completion (default: false) */
72
+ autoDetectable?: boolean;
73
+ };
74
+ }
75
+ interface TaskRetryConfig {
76
+ max_attempts: number;
77
+ delay_ms?: number;
78
+ backoff_multiplier?: number;
79
+ }
80
+ interface TaskCircuitBreakerConfig {
81
+ /** Max executions before injecting break tokens */
82
+ max_executions: number;
83
+ /** Tokens to inject when breaker trips */
84
+ on_break: string[];
85
+ }
86
+ interface ExecutionConfig {
87
+ executionMode: ExecutionMode;
88
+ conflictStrategy: ConflictStrategy;
89
+ completionStrategy: CompletionStrategy;
90
+ }
91
+ type GraphEvent = TaskStartedEvent | TaskCompletedEvent | TaskFailedEvent | TaskProgressEvent | TaskRestartEvent | InjectTokensEvent | AgentActionEvent | TaskUpsertEvent | TaskRemovalEvent | NodeRequiresAddEvent | NodeRequiresRemoveEvent | NodeProvidesAddEvent | NodeProvidesRemoveEvent;
92
+ interface TaskStartedEvent {
93
+ type: 'task-started';
94
+ taskName: string;
95
+ timestamp: string;
96
+ executionId?: string;
97
+ }
98
+ interface TaskCompletedEvent {
99
+ type: 'task-completed';
100
+ taskName: string;
101
+ /** Handler result key — used for conditional routing via `on` */
102
+ result?: string;
103
+ /** Data payload from task execution */
104
+ data?: Record<string, unknown>;
105
+ /** Content hash of the output — used by 'data-changed' refresh strategy */
106
+ dataHash?: string;
107
+ timestamp: string;
108
+ executionId?: string;
109
+ }
110
+ interface TaskFailedEvent {
111
+ type: 'task-failed';
112
+ taskName: string;
113
+ error: string;
114
+ timestamp: string;
115
+ executionId?: string;
116
+ }
117
+ interface TaskProgressEvent {
118
+ type: 'task-progress';
119
+ taskName: string;
120
+ message?: string;
121
+ progress?: number;
122
+ /**
123
+ * Arbitrary update payload — used by source delivery to carry
124
+ * { bindTo, fetchedAt, dest } or { bindTo, failure, reason }.
125
+ * card-handler receives this via TaskHandlerInput.update.
126
+ */
127
+ update?: Record<string, unknown>;
128
+ timestamp: string;
129
+ executionId?: string;
130
+ }
131
+ interface TaskRestartEvent {
132
+ type: 'task-restart';
133
+ taskName: string;
134
+ timestamp: string;
135
+ executionId?: string;
136
+ }
137
+ interface InjectTokensEvent {
138
+ type: 'inject-tokens';
139
+ tokens: string[];
140
+ timestamp: string;
141
+ }
142
+ interface AgentActionEvent {
143
+ type: 'agent-action';
144
+ action: 'start' | 'stop' | 'pause' | 'resume';
145
+ timestamp: string;
146
+ config?: Partial<ExecutionConfig>;
147
+ }
148
+ interface TaskUpsertEvent {
149
+ type: 'task-upsert';
150
+ taskName: string;
151
+ taskConfig: TaskConfig;
152
+ timestamp: string;
153
+ }
154
+ interface TaskRemovalEvent {
155
+ type: 'task-removal';
156
+ taskName: string;
157
+ timestamp: string;
158
+ }
159
+ interface NodeRequiresAddEvent {
160
+ type: 'node-requires-add';
161
+ nodeName: string;
162
+ tokens: string[];
163
+ timestamp: string;
164
+ }
165
+ interface NodeRequiresRemoveEvent {
166
+ type: 'node-requires-remove';
167
+ nodeName: string;
168
+ tokens: string[];
169
+ timestamp: string;
170
+ }
171
+ interface NodeProvidesAddEvent {
172
+ type: 'node-provides-add';
173
+ nodeName: string;
174
+ tokens: string[];
175
+ timestamp: string;
176
+ }
177
+ interface NodeProvidesRemoveEvent {
178
+ type: 'node-provides-remove';
179
+ nodeName: string;
180
+ tokens: string[];
181
+ timestamp: string;
182
+ }
183
+ type CompletionStrategy = 'all-tasks-done' | 'all-outputs-done' | 'only-resolved' | 'goal-reached' | 'manual';
184
+ type ExecutionMode = 'dependency-mode' | 'eligibility-mode';
185
+ type ConflictStrategy = 'alphabetical' | 'priority-first' | 'duration-first' | 'cost-optimized' | 'resource-aware' | 'random-select' | 'user-choice' | 'parallel-all' | 'skip-conflicts' | 'round-robin';
186
+ type RefreshStrategy = 'data-changed' | 'epoch-changed' | 'time-based' | 'manual' | 'once';
187
+
188
+ /**
189
+ * board-live-cards-lib — Pure logic library for the board-live-cards CLI.
190
+ *
191
+ * Merged from:
192
+ * board-live-cards-all-stores.ts
193
+ * board-live-cards-lib-types.ts
194
+ * board-live-cards-lib-board-status.ts
195
+ * board-live-cards-lib-card-handler.ts
196
+ * board-live-cards-cli-board-commands.ts
197
+ * board-live-cards-cli-card-commands.ts
198
+ * board-live-cards-cli-callbacks.ts
199
+ *
200
+ * Zero platform imports. All storage is injected via adapter interfaces.
201
+ * Safe for Node, browser, and neutral (V8/PyMiniRacer) bundles.
202
+ */
203
+
204
+ interface LiveCard {
205
+ id: string;
206
+ [key: string]: unknown;
207
+ }
208
+ interface CardIndexEntry {
209
+ /** Storage-specific address (file path, Cosmos doc id, localStorage key). */
210
+ key: string;
211
+ /** Checksum of card content — computed by the adapter at write time. */
212
+ checksum: string;
213
+ updatedAt: string;
214
+ }
215
+ type CardIndex = Record<string, CardIndexEntry>;
216
+ type CardChecksumIndex = Record<string, string>;
217
+ interface CardStorageAdapter {
218
+ readIndex(): CardIndex | null;
219
+ writeIndex(index: CardIndex): void;
220
+ readCard(key: string): LiveCard | null;
221
+ /** Write card content; returns checksum of what was written. */
222
+ writeCard(key: string, card: LiveCard): string;
223
+ cardExists(key: string): boolean;
224
+ defaultCardKey(cardId: string): string;
225
+ }
226
+ interface CardStore {
227
+ readCard(id: string): LiveCard | null;
228
+ readCardKey(id: string): string | null;
229
+ readAllCards(): LiveCard[];
230
+ readChecksumIndex(): CardChecksumIndex;
231
+ changedSince(snapshotChecksumIndex: CardChecksumIndex): string[];
232
+ }
233
+ interface CardUpsertValidation {
234
+ ok: boolean;
235
+ error?: string;
236
+ }
237
+ interface CardAdminStore extends CardStore {
238
+ validateUpsert(id: string, cardKey: string): CardUpsertValidation;
239
+ writeCard(id: string, card: LiveCard, cardKey?: string): void;
240
+ patchCard(id: string, jsonPath: string, value: unknown): void;
241
+ removeCard(id: string): void;
242
+ readIndex(): CardIndex;
243
+ }
244
+ declare function createCardStore(adapter: CardStorageAdapter, onWarn?: (msg: string) => void): CardAdminStore;
245
+ interface JournalEntry {
246
+ id: string;
247
+ event: GraphEvent;
248
+ }
249
+ interface JournalStorageAdapter {
250
+ readAllEntries(): JournalEntry[];
251
+ appendEntry(entry: JournalEntry): void;
252
+ generateId(): string;
253
+ }
254
+ declare const SNAPSHOT_SCHEMA_VERSION_V1 = "v1";
255
+ declare const BOARD_GRAPH_KEY = "board/graph";
256
+ type OutputStoreEvent = {
257
+ kind: 'computed_values';
258
+ cardId: string;
259
+ values: Record<string, unknown>;
260
+ } | {
261
+ kind: 'data_object';
262
+ key: string;
263
+ payload: unknown;
264
+ } | {
265
+ kind: 'status';
266
+ status: unknown;
267
+ };
268
+ interface BoardStatusCard {
269
+ name: string;
270
+ status: string;
271
+ error?: {
272
+ message: string;
273
+ code?: string;
274
+ at?: string;
275
+ source?: 'task-runtime' | 'source-fetch' | 'timeout' | 'unknown';
276
+ };
277
+ requires: string[];
278
+ requires_satisfied: string[];
279
+ requires_missing: string[];
280
+ provides_declared: string[];
281
+ provides_runtime: string[];
282
+ blocked_by: string[];
283
+ unblocks: string[];
284
+ runtime: {
285
+ attempt_count: number;
286
+ restart_count: number;
287
+ in_progress_since: string | null;
288
+ last_transition_at: string | null;
289
+ last_completed_at: string | null;
290
+ last_restarted_at: string | null;
291
+ status_age_ms: number | null;
292
+ };
293
+ }
294
+ interface BoardStatusObject {
295
+ schema_version: 'v1';
296
+ meta: {
297
+ board: {
298
+ path: string;
299
+ };
300
+ };
301
+ summary: {
302
+ card_count: number;
303
+ completed: number;
304
+ eligible: number;
305
+ pending: number;
306
+ blocked: number;
307
+ unresolved: number;
308
+ failed?: number;
309
+ in_progress?: number;
310
+ orphan_cards?: number;
311
+ topology?: {
312
+ edge_count: number;
313
+ max_fan_out_card: string | null;
314
+ max_fan_out: number;
315
+ };
316
+ };
317
+ cards: BoardStatusCard[];
318
+ }
319
+ declare const EMPTY_CONFIG: GraphConfig;
320
+
321
+ export { type BoardStatusObject as B, type CardAdminStore as C, EMPTY_CONFIG as E, type JournalStorageAdapter as J, type LiveCard as L, type OutputStoreEvent as O, SNAPSHOT_SCHEMA_VERSION_V1 as S, BOARD_GRAPH_KEY as a, createCardStore as c };
@@ -1,8 +1,6 @@
1
- import { N as NotificationTransport } from '../../types-B1ZRa4aI.js';
2
- import { B as BoardPlatformAdapter } from '../../board-live-cards-public-hnZo0mAf.js';
3
- import { ExecutionRef } from '../../execution-refs.js';
4
- import '../../board-live-cards-lib-jM2uYG1v.js';
5
- import '../../types-BBhqYGhE.js';
1
+ import { B as BoardPlatformAdapter, N as NotificationTransport } from '../types-CziUxkiv.js';
2
+ import { E as ExecutionRef } from '../execution-interface-C_A6WCiK.js';
3
+ import '../board-live-cards-lib-tjYsPt5U.js';
6
4
 
7
5
  interface InMemoryBus {
8
6
  publish(event: unknown): void;
@@ -0,0 +1,3 @@
1
+ var y="b64:";function B(e){let t=new TextEncoder().encode(e),o=globalThis.Buffer,n;if(o)n=o.from(t).toString("base64");else if(typeof btoa=="function"){let l="";for(let i of t)l+=String.fromCharCode(i);n=btoa(l);}else throw new Error("No base64 encoder available in this runtime");return n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function T(e){let t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4),o=globalThis.Buffer;if(o)return o.from(t,"base64").toString("utf8");if(typeof atob=="function"){let n=atob(t),l=new Uint8Array(n.length);for(let i=0;i<n.length;i+=1)l[i]=n.charCodeAt(i);return new TextDecoder().decode(l)}throw new Error("No base64 decoder available in this runtime")}function g(e){return `${y}${B(JSON.stringify(e))}`}function d(e){if(!e.startsWith(y))throw new Error(`Invalid ref format (expected ${y}<base64url(json)>): ${e}`);let t;try{t=JSON.parse(T(e.slice(y.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 o=t;if(typeof o.kind!="string"||typeof o.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${e}`);return {kind:o.kind,value:o.value}}function h(e){if(e==null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return `[${e.map(h).join(",")}]`;let t=e;return `{${Object.keys(t).sort().map(n=>`${JSON.stringify(n)}:${h(t[n])}`).join(",")}}`}function p(e,t){let o=t>>>0;for(let n=0;n<e.length;n++)o^=e.charCodeAt(n),o=Math.imul(o,16777619)>>>0;return o}function k(e){let t=h(e),o=p(t,2166136261),n=p(t,3735928559),l=p(t,19088743),i=p(t,4277009102);return [o,n,l,i].map(r=>r.toString(16).padStart(8,"0")).join("")}function w(e){function t(i){return `${e}:blob:${i}`}let o=new TextEncoder;function n(i){if(typeof btoa=="function"){let r="";for(let s=0;s<i.length;s++)r+=String.fromCharCode(i[s]);return btoa(r)}return ""}function l(i){if(typeof atob=="function"){let r=atob(i),s=new Uint8Array(r.length);for(let a=0;a<r.length;a++)s[a]=r.charCodeAt(a);return s}return new Uint8Array}return {read(i){return globalThis.localStorage.getItem(t(i))},write(i,r){globalThis.localStorage.setItem(t(i),r);},exists(i){return globalThis.localStorage.getItem(t(i))!==null},remove(i){globalThis.localStorage.removeItem(t(i));},readBytes(i){let r=globalThis.localStorage.getItem(t(i));if(r===null)return null;try{let s=JSON.parse(r);if(s&&s.__kind==="bytes-b64"&&typeof s.data=="string")return l(s.data)}catch{}return o.encode(r)},writeBytes(i,r){let s=JSON.stringify({__kind:"bytes-b64",data:n(r)});globalThis.localStorage.setItem(t(i),s);},listKeys(i){let r=t(i??""),s=[];for(let a=0;a<globalThis.localStorage.length;a++){let u=globalThis.localStorage.key(a);u&&u.startsWith(r)&&s.push(u.slice(t("").length));}return s.sort()},stat(i){let r=globalThis.localStorage.getItem(t(i));if(r===null)return null;let s=o.encode(r).byteLength;try{let a=JSON.parse(r);a&&a.__kind==="bytes-b64"&&typeof a.data=="string"&&(s=l(a.data).byteLength);}catch{}return {key:i,size:s}}}}function m(e){function t(o){return `${e}:kv:${o}`}return {read(o){let n=globalThis.localStorage.getItem(t(o));if(n===null)return null;try{return JSON.parse(n)}catch{return null}},write(o,n){globalThis.localStorage.setItem(t(o),JSON.stringify(n));},delete(o){globalThis.localStorage.removeItem(t(o));},listKeys(o){let n=t(o??""),l=[];for(let i=0;i<globalThis.localStorage.length;i++){let r=globalThis.localStorage.key(i);r!==null&&r.startsWith(n)&&l.push(r.slice(t("").length));}return l}}}function S(e){function t(){let n=globalThis.localStorage.getItem(e);if(!n)return [];try{return JSON.parse(n)}catch{return []}}function o(n){globalThis.localStorage.setItem(e,JSON.stringify(n));}return {readAllEntries(){return t()},appendEntry(n){let l=t();l.push(n),o(l);},generateId(){return globalThis.crypto.randomUUID()}}}function J(){let e=false;return {tryAcquire(){return e?null:(e=true,()=>{e=false;})}}}var v=new Map;function x(e){let t=v.get(e);if(!t){let o=new Set;t={publish(n){for(let l of o)l(n);},subscribe(n){return o.add(n),()=>{o.delete(n);}}},v.set(e,t);}return t}function C(){return {async subscribe(e,t){return e.kind!=="in-memory-bus"?(console.warn(`[in-memory-transport] unsupported kind: ${e.kind}`),()=>{}):x(e.value).subscribe(n=>{let l=n;if(l&&l.kind==="notification-batch"&&Array.isArray(l.notifications)){for(let i of l.notifications)t(i);return}t(n);})}}}function N(e,t){let o=t?.callbackBaseUrl?{meta:"board-live-cards",howToRun:"http:post",whatToRun:t.callbackBaseUrl}:{meta:"board-live-cards",howToRun:"in-browser",whatToRun:g({kind:"in-browser",value:e})},n=new Map,l=new Map,i=J();return {kvStorage:r=>m(`${e}:${r}`),blobStorage:r=>w(r?`${e}:${r}`:e),journalAdapter:()=>S(`${e}:journal`),lock:i,selfRef:o,async dispatchExecution(r,s){if(r.howToRun==="http:post")try{let a=r.whatToRun,u=typeof a=="object"?a.value:d(a).value,c=await fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});return c.ok?{dispatched:!0}:{dispatched:!1,error:`HTTP ${c.status}: ${c.statusText}`}}catch(a){return {dispatched:false,error:a instanceof Error?a.message:String(a)}}if(r.howToRun==="http:get")try{let a=r.whatToRun,u=typeof a=="object"?a.value:d(a).value,c=new URLSearchParams(Object.entries(s).filter(([,f])=>f!=null).map(([f,A])=>[f,String(A)])),R=`${u}?${c.toString()}`,b=await fetch(R);return b.ok?{dispatched:!0}:{dispatched:!1,error:`HTTP ${b.status}: ${b.statusText}`}}catch(a){return {dispatched:false,error:a instanceof Error?a.message:String(a)}}if(r.howToRun==="in-browser"){let a=r.whatToRun,u=typeof a=="object"?a.value:d(a).value,c=n.get(u);return c?c(r,s):{dispatched:false,error:`No in-browser handler registered for: ${u}`}}return {dispatched:false,error:`Browser adapter: unsupported dispatch kind (got: ${r.howToRun})`}},resolveBlob(r){if(r.kind==="in-memory"){let u=l.get(r.value);if(u==null)throw new Error(`resolveBlob: in-memory blob not found: ${g(r)}`);return u}let a=w(e).read(r.value);if(a===null)throw new Error(`resolveBlob: blob not found: ${g(r)}`);return a},hashFn:k,genId:()=>globalThis.crypto.randomUUID().replace(/-/g,""),kvStorageForRef:r=>m(d(r).value),publishBoardChangeNotifications(r){if(!t?.notifyChannel||r.length===0)return;x(t.notifyChannel).publish({kind:"notification-batch",notifications:r});},onWarn:t?.onWarn,registerHandler(r,s){n.set(r,s);},writeMemoryBlob(r,s){return l.set(r,s),g({kind:"in-memory",value:r})}}}
2
+ export{N as createBrowserBoardPlatformAdapter,C as createInMemoryNotificationTransport,x as getInMemoryNotificationBus};//# sourceMappingURL=board-live-cards-browser-adapter.js.map
3
+ //# sourceMappingURL=board-live-cards-browser-adapter.js.map
@@ -1,5 +1,4 @@
1
- import { L as LiveCard } from '../../board-live-cards-lib-jM2uYG1v.js';
2
- import '../../types-BBhqYGhE.js';
1
+ import { L as LiveCard } from '../board-live-cards-lib-tjYsPt5U.js';
3
2
 
4
3
  /**
5
4
  * card-store-browser-api.ts
@@ -1,2 +1,2 @@
1
- import {createRequire}from'module';import'ajv-formats';var x=createRequire(import.meta.url);x("./jsonata-sync.cjs");var v=createRequire(import.meta.url);v("./jsonata-sync.cjs");function y(n,o){function e(){return n.readIndex()??{}}function r(t,s,i){let a=String(s||"").split(".").filter(Boolean);if(a.length===0)return i&&typeof i=="object"&&!Array.isArray(i)?i:{value:i};let u={...t},c=u;for(let d=0;d<a.length-1;d++){let l=a[d],f=c[l],m=f&&typeof f=="object"&&!Array.isArray(f)?{...f}:{};c[l]=m,c=m;}return c[a[a.length-1]]=i,u}return {readCard(t){let s=e()[t];return !s||!n.cardExists(s.key)?null:n.readCard(s.key)},readCardKey(t){return e()[t]?.key??null},readAllCards(){let t=[];for(let[s,i]of Object.entries(e())){if(!n.cardExists(i.key))continue;let a=n.readCard(i.key);a?t.push(a):o?.(`[card-store] could not read card "${s}" at key "${i.key}"`);}return t},readChecksumIndex(){let t={};for(let[s,i]of Object.entries(e()))t[s]=i.checksum;return t},changedSince(t){let s=e(),i=[];for(let[a,u]of Object.entries(s))t[a]!==u.checksum&&i.push(a);for(let a of Object.keys(t))s[a]||i.push(a);return i},validateUpsert(t,s){let i=e(),a=i[t],u=Object.entries(i).find(([,c])=>c.key===s);return a&&a.key!==s?{ok:false,error:`Card id "${t}" is already mapped to key "${a.key}", cannot remap to "${s}"`}:u&&u[0]!==t?{ok:false,error:`Key "${s}" is already mapped to card id "${u[0]}", cannot remap to "${t}"`}:{ok:true}},writeCard(t,s,i){let a=e(),u=i??a[t]?.key??n.defaultCardKey(t),c=n.writeCard(u,s);a[t]={key:u,checksum:c,updatedAt:new Date().toISOString()},n.writeIndex(a);},patchCard(t,s,i){let a=e(),u=a[t];if(!u||!n.cardExists(u.key))throw new Error(`card "${t}" not found`);let c=n.readCard(u.key);if(!c||typeof c!="object"||Array.isArray(c))throw new Error(`card "${t}" is not patchable`);let d=r(c,s,i),l=n.writeCard(u.key,d);a[t]={key:u.key,checksum:l,updatedAt:new Date().toISOString()},n.writeIndex(a);},removeCard(t){let s=e();s[t]&&(delete s[t],n.writeIndex(s));},readIndex(){return e()}}}function p(n){if(n==null||typeof n!="object")return JSON.stringify(n);if(Array.isArray(n))return `[${n.map(p).join(",")}]`;let o=n;return `{${Object.keys(o).sort().map(r=>`${JSON.stringify(r)}:${p(o[r])}`).join(",")}}`}function g(n,o){let e=o>>>0;for(let r=0;r<n.length;r++)e^=n.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return e}function E(n){let o=p(n),e=g(o,2166136261),r=g(o,3735928559),t=g(o,19088743),s=g(o,4277009102);return [e,r,t,s].map(i=>i.toString(16).padStart(8,"0")).join("")}function A(n){function o(e){return `${n}:kv:${e}`}return {read(e){let r=globalThis.localStorage.getItem(o(e));if(r===null)return null;try{return JSON.parse(r)}catch{return null}},write(e,r){globalThis.localStorage.setItem(o(e),JSON.stringify(r));},delete(e){globalThis.localStorage.removeItem(o(e));},listKeys(e){let r=o(e??""),t=[];for(let s=0;s<globalThis.localStorage.length;s++){let i=globalThis.localStorage.key(s);i!==null&&i.startsWith(r)&&t.push(i.slice(o("").length));}return t}}}function h(n,o){let e={...n};for(let[r,t]of Object.entries(o))t!==null&&typeof t=="object"&&!Array.isArray(t)&&e[r]!==null&&typeof e[r]=="object"&&!Array.isArray(e[r])?e[r]=h(e[r],t):e[r]=t;return e}function S(n,o,e){if(o.length===0)return n;let[r,...t]=o;if(t.length===0)return {...n,[r]:e};let s=n[r]!==null&&typeof n[r]=="object"&&!Array.isArray(n[r])?n[r]:{};return {...n,[r]:S(s,t,e)}}function _(n){let o=A(n);return {read:e=>o.read(e),get(e,r){let t=o.read(e);if(t===null)return null;let s=t;for(let i of r.split(".").filter(Boolean)){if(s===null||typeof s!="object"||Array.isArray(s))return null;s=s[i]??null;}return s??null},write:(e,r)=>o.write(e,r),delete:e=>o.delete(e),listKeys:e=>o.listKeys(e),shallowMerge(e,r){let t=o.read(e)??{};o.write(e,{...t,...r});},deepMerge(e,r){let t=o.read(e)??{};o.write(e,h(t,r));},patch(e,r,t){let s=o.read(e)??{},i=r.split(".").filter(Boolean);o.write(e,S(s,i,t));}}}function k(n){let o=_(n);return {readIndex(){return o.read("_index")},writeIndex(e){o.write("_index",e);},readCard(e){return o.read(e)},writeCard(e,r){return o.write(e,r),E(r)},cardExists(e){return o.read(e)!==null},defaultCardKey(e){return e}}}function he(n){let o=k(n),e=y(o);return {getCard(r){return e.readCard(r)},getAllCards(){return e.readAllCards()},upsertCard(r){let t=o.defaultCardKey(r.id);e.writeCard(r.id,r,t);},removeCard(r){e.removeCard(r);}}}export{he as createBrowserCardStoreApi};//# sourceMappingURL=card-store-browser-api.js.map
1
+ import {createRequire}from'module';import'ajv-formats';var C=createRequire(import.meta.url);C("./jsonata-sync.cjs");var v=createRequire(import.meta.url);v("./jsonata-sync.cjs");function y(n,o){function e(){return n.readIndex()??{}}function r(t,s,i){let a=String(s||"").split(".").filter(Boolean);if(a.length===0)return i&&typeof i=="object"&&!Array.isArray(i)?i:{value:i};let u={...t},c=u;for(let d=0;d<a.length-1;d++){let l=a[d],f=c[l],m=f&&typeof f=="object"&&!Array.isArray(f)?{...f}:{};c[l]=m,c=m;}return c[a[a.length-1]]=i,u}return {readCard(t){let s=e()[t];return !s||!n.cardExists(s.key)?null:n.readCard(s.key)},readCardKey(t){return e()[t]?.key??null},readAllCards(){let t=[];for(let[s,i]of Object.entries(e())){if(!n.cardExists(i.key))continue;let a=n.readCard(i.key);a?t.push(a):o?.(`[card-store] could not read card "${s}" at key "${i.key}"`);}return t},readChecksumIndex(){let t={};for(let[s,i]of Object.entries(e()))t[s]=i.checksum;return t},changedSince(t){let s=e(),i=[];for(let[a,u]of Object.entries(s))t[a]!==u.checksum&&i.push(a);for(let a of Object.keys(t))s[a]||i.push(a);return i},validateUpsert(t,s){let i=e(),a=i[t],u=Object.entries(i).find(([,c])=>c.key===s);return a&&a.key!==s?{ok:false,error:`Card id "${t}" is already mapped to key "${a.key}", cannot remap to "${s}"`}:u&&u[0]!==t?{ok:false,error:`Key "${s}" is already mapped to card id "${u[0]}", cannot remap to "${t}"`}:{ok:true}},writeCard(t,s,i){let a=e(),u=i??a[t]?.key??n.defaultCardKey(t),c=n.writeCard(u,s);a[t]={key:u,checksum:c,updatedAt:new Date().toISOString()},n.writeIndex(a);},patchCard(t,s,i){let a=e(),u=a[t];if(!u||!n.cardExists(u.key))throw new Error(`card "${t}" not found`);let c=n.readCard(u.key);if(!c||typeof c!="object"||Array.isArray(c))throw new Error(`card "${t}" is not patchable`);let d=r(c,s,i),l=n.writeCard(u.key,d);a[t]={key:u.key,checksum:l,updatedAt:new Date().toISOString()},n.writeIndex(a);},removeCard(t){let s=e();s[t]&&(delete s[t],n.writeIndex(s));},readIndex(){return e()}}}function p(n){if(n==null||typeof n!="object")return JSON.stringify(n);if(Array.isArray(n))return `[${n.map(p).join(",")}]`;let o=n;return `{${Object.keys(o).sort().map(r=>`${JSON.stringify(r)}:${p(o[r])}`).join(",")}}`}function g(n,o){let e=o>>>0;for(let r=0;r<n.length;r++)e^=n.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return e}function E(n){let o=p(n),e=g(o,2166136261),r=g(o,3735928559),t=g(o,19088743),s=g(o,4277009102);return [e,r,t,s].map(i=>i.toString(16).padStart(8,"0")).join("")}function A(n){function o(e){return `${n}:kv:${e}`}return {read(e){let r=globalThis.localStorage.getItem(o(e));if(r===null)return null;try{return JSON.parse(r)}catch{return null}},write(e,r){globalThis.localStorage.setItem(o(e),JSON.stringify(r));},delete(e){globalThis.localStorage.removeItem(o(e));},listKeys(e){let r=o(e??""),t=[];for(let s=0;s<globalThis.localStorage.length;s++){let i=globalThis.localStorage.key(s);i!==null&&i.startsWith(r)&&t.push(i.slice(o("").length));}return t}}}function h(n,o){let e={...n};for(let[r,t]of Object.entries(o))t!==null&&typeof t=="object"&&!Array.isArray(t)&&e[r]!==null&&typeof e[r]=="object"&&!Array.isArray(e[r])?e[r]=h(e[r],t):e[r]=t;return e}function S(n,o,e){if(o.length===0)return n;let[r,...t]=o;if(t.length===0)return {...n,[r]:e};let s=n[r]!==null&&typeof n[r]=="object"&&!Array.isArray(n[r])?n[r]:{};return {...n,[r]:S(s,t,e)}}function _(n){let o=A(n);return {read:e=>o.read(e),get(e,r){let t=o.read(e);if(t===null)return null;let s=t;for(let i of r.split(".").filter(Boolean)){if(s===null||typeof s!="object"||Array.isArray(s))return null;s=s[i]??null;}return s??null},write:(e,r)=>o.write(e,r),delete:e=>o.delete(e),listKeys:e=>o.listKeys(e),shallowMerge(e,r){let t=o.read(e)??{};o.write(e,{...t,...r});},deepMerge(e,r){let t=o.read(e)??{};o.write(e,h(t,r));},patch(e,r,t){let s=o.read(e)??{},i=r.split(".").filter(Boolean);o.write(e,S(s,i,t));}}}function k(n){let o=_(n);return {readIndex(){return o.read("_index")},writeIndex(e){o.write("_index",e);},readCard(e){return o.read(e)},writeCard(e,r){return o.write(e,r),E(r)},cardExists(e){return o.read(e)!==null},defaultCardKey(e){return e}}}function he(n){let o=k(n),e=y(o);return {getCard(r){return e.readCard(r)},getAllCards(){return e.readAllCards()},upsertCard(r){let t=o.defaultCardKey(r.id);e.writeCard(r.id,r,t);},removeCard(r){e.removeCard(r);}}}export{he as createBrowserCardStoreApi};//# sourceMappingURL=card-store-browser-api.js.map
2
2
  //# sourceMappingURL=card-store-browser-api.js.map
@@ -0,0 +1,284 @@
1
+ /**
2
+ * execution-interface.ts
3
+ *
4
+ * Pure module — no Node/platform imports. Safe for any runtime.
5
+ *
6
+ * Defines the portable descriptor types for invoking any executable target,
7
+ * regardless of transport (local process, HTTP endpoint, cloud function, etc.).
8
+ *
9
+ * Parallel to storage-interface.ts (which describes WHERE data lives), this
10
+ * module describes HOW to invoke a piece of logic.
11
+ *
12
+ * ────────────────────────────────────────────────────────────────────────────
13
+ * CORE CONCEPTS
14
+ * ────────────────────────────────────────────────────────────────────────────
15
+ *
16
+ * ExecutionRef — self-contained, serializable JSON descriptor for one invocation target.
17
+ * • howToRun — transport / runtime kind (discriminator)
18
+ * • whatToRun — address of the artifact (KindValueRef wire form: b64:<base64url(json)>)
19
+ * • argsMassaging — optional JSONata expressions that map logical args → physical call shape
20
+ * • meta — optional human-readable label (e.g. 'task-executor', 'chat-handler')
21
+ *
22
+ * ExecutionResult — standardized envelope returned by any invocation.
23
+ * • status: 'success' | 'fail' | 'error'
24
+ * • data — KindValueRef wire form pointing to output blob (on success)
25
+ * • error — human-readable message (on fail/error)
26
+ *
27
+ * ────────────────────────────────────────────────────────────────────────────
28
+ * howToRun VALUES
29
+ * ────────────────────────────────────────────────────────────────────────────
30
+ *
31
+ * 'local-node' node <whatToRun> [argv...]
32
+ * 'local-python' python <whatToRun> [argv...]
33
+ * 'local-process' execute <whatToRun> directly (shebang / pre-resolved binary)
34
+ * 'http:post' HTTP POST to <whatToRun>
35
+ * 'http:get' HTTP GET to <whatToRun>
36
+ * 'built-in' resolved by the adapter to a well-known internal implementation
37
+ *
38
+ * ────────────────────────────────────────────────────────────────────────────
39
+ * argsMassaging
40
+ * ────────────────────────────────────────────────────────────────────────────
41
+ *
42
+ * Each field is a JSONata expression evaluated against the caller's logical args object.
43
+ * If argsMassaging is omitted, the adapter uses its default mapping for the howToRun kind.
44
+ *
45
+ * Local transports (local-node, local-python, local-process):
46
+ * cmdTemplate — array of JSONata exprs, each producing one argv string
47
+ * stdinTemplate — JSONata expr producing the stdin payload object
48
+ *
49
+ * HTTP transports (http:post, http:get, azure-function, firebase, etc.):
50
+ * urlTemplate — JSONata expr producing the final URL string
51
+ * headerTemplate — JSONata expr producing the request headers object
52
+ * bodyTemplate — JSONata expr producing the request body object
53
+ *
54
+ * ────────────────────────────────────────────────────────────────────────────
55
+ * SERIALIZATION
56
+ * ────────────────────────────────────────────────────────────────────────────
57
+ *
58
+ * ExecutionRef is a plain JSON object — store it as-is on disk, in Cosmos, or any DB.
59
+ * No special encoding needed. parseExecutionRef / serializeExecutionRef are thin
60
+ * JSON wrappers provided for symmetry with storage-interface.
61
+ *
62
+ * ────────────────────────────────────────────────────────────────────────────
63
+ * USAGE EXAMPLES
64
+ * ────────────────────────────────────────────────────────────────────────────
65
+ *
66
+ * // Built-in source-cli task executor (resolved by adapter from cliDir):
67
+ * const builtIn: ExecutionRef = {
68
+ * meta: 'task-executor',
69
+ * howToRun: 'built-in',
70
+ * whatToRun: 'b64:<base64url({"kind":"built-in","value":"source-cli-task-executor"})>',
71
+ * };
72
+ *
73
+ * // External local-node task executor with default protocol args:
74
+ * const local: ExecutionRef = {
75
+ * meta: 'task-executor',
76
+ * howToRun: 'local-node',
77
+ * whatToRun: 'b64:<base64url({"kind":"fs-path","value":"/path/to/my-executor.js"})>',
78
+ * };
79
+ *
80
+ * // Azure Function task executor with custom arg mapping:
81
+ * const azureFn: ExecutionRef = {
82
+ * meta: 'task-executor',
83
+ * howToRun: 'http:post',
84
+ * whatToRun: 'b64:<base64url({"kind":"http-url","value":"https://myfn.azurewebsites.net/api/task-executor"})>',
85
+ * argsMassaging: {
86
+ * urlTemplate: "whatToRun & '?op=' & subcommand",
87
+ * headerTemplate: "{ 'Authorization': 'Bearer ' & token }",
88
+ * bodyTemplate: "{ 'inRef': inRef, 'outRef': outRef }",
89
+ * },
90
+ * };
91
+ *
92
+ * // Chat handler over HTTP with a different logical args shape:
93
+ * const chatHandler: ExecutionRef = {
94
+ * meta: 'chat-handler',
95
+ * howToRun: 'http:post',
96
+ * whatToRun: 'b64:<base64url({"kind":"http-url","value":"https://myfn.azurewebsites.net/api/chat"})>',
97
+ * argsMassaging: {
98
+ * bodyTemplate: "{ 'message': message, 'context': context, 'sessionId': sessionId }",
99
+ * },
100
+ * };
101
+ */
102
+ /**
103
+ * Optional JSONata-based transforms applied to the raw invoke result.
104
+ * Context for all expressions: `{ output: { result, data, error? } }`.
105
+ * All fields are optional.
106
+ */
107
+ interface OutputTransforms {
108
+ /**
109
+ * JSONata expression that produces the transition name string.
110
+ * @example "output.code = 200 ? 'success' : 'failure'"
111
+ */
112
+ resultExpr?: string;
113
+ /**
114
+ * JSONata expression that produces the data object.
115
+ * @example "{ 'value': output.body.value }"
116
+ */
117
+ dataTemplate?: string;
118
+ /**
119
+ * JSONata expression that produces the error string, or $undefined() to clear it.
120
+ * @example "output.code != 200 ? output.error_message : $undefined()"
121
+ */
122
+ errorExpr?: string;
123
+ }
124
+ /**
125
+ * Optional JSONata-based mapping from logical args → physical invocation shape.
126
+ *
127
+ * Each field is a JSONata expression string evaluated against the caller's
128
+ * logical args object (e.g. `{ inRef, outRef, errRef }` for a task-executor).
129
+ *
130
+ * If argsMassaging is omitted entirely, the execution adapter uses its default
131
+ * mapping for the given howToRun kind.
132
+ */
133
+ interface ArgsMassaging {
134
+ /**
135
+ * Array of JSONata expressions — each evaluates to one argv string.
136
+ * The resolved strings are appended after the base command.
137
+ *
138
+ * @example
139
+ * cmdTemplate: [
140
+ * "'run-source-fetch'",
141
+ * "'--in-ref'", "inRef",
142
+ * "'--out-ref'", "outRef",
143
+ * "'--err-ref'", "errRef",
144
+ * ]
145
+ */
146
+ cmdTemplate?: string[];
147
+ /**
148
+ * JSONata expression that produces the stdin payload object.
149
+ * Evaluated against the logical args.
150
+ * If omitted, `JSON.stringify(args)` is sent on stdin.
151
+ *
152
+ * @example
153
+ * stdinTemplate: "{ 'X': x, 'multiplier': 2 }"
154
+ */
155
+ stdinTemplate?: string;
156
+ /**
157
+ * JSONata expression that produces the final URL string.
158
+ * The input context includes 'whatToRun' (the base URL from the ref)
159
+ * plus all logical args.
160
+ *
161
+ * @example
162
+ * urlTemplate: "whatToRun & '?op=' & subcommand"
163
+ */
164
+ urlTemplate?: string;
165
+ /**
166
+ * JSONata expression that produces the request headers object.
167
+ * Merged on top of the default headers (`Content-Type: application/json`).
168
+ *
169
+ * @example
170
+ * headerTemplate: "{ 'Authorization': 'Bearer ' & token }"
171
+ */
172
+ headerTemplate?: string;
173
+ /**
174
+ * JSONata expression that produces the request body object.
175
+ * Evaluated against the logical args object.
176
+ *
177
+ * @example
178
+ * bodyTemplate: "{ 'inRef': inRef, 'outRef': outRef }"
179
+ */
180
+ bodyTemplate?: string;
181
+ }
182
+ /**
183
+ * Self-contained, serializable descriptor for invoking a target.
184
+ *
185
+ * Stores everything needed to make the physical call — transport kind,
186
+ * artifact address, and optional arg-mapping expressions.
187
+ * Serialize as plain JSON; no special wire encoding required.
188
+ */
189
+ interface ExecutionRef {
190
+ /**
191
+ * Optional human-readable label identifying the role of this invocation.
192
+ * Not used for dispatch — purely for logging and diagnostics.
193
+ * @example 'task-executor', 'chat-handler', 'board-live-cards'
194
+ */
195
+ meta?: string;
196
+ /**
197
+ * Transport and runtime kind — determines how whatToRun is invoked.
198
+ * @see module JSDoc for the full list of supported values.
199
+ */
200
+ howToRun: 'local-node' | 'local-python' | 'local-process' | 'http:post' | 'http:get' | 'built-in' | 'in-browser';
201
+ /**
202
+ * Address of the artifact to run. Two valid forms:
203
+ * - string: must be KindValueRef wire form `b64:<base64url(json)>` (programmatically generated via serializeRef)
204
+ * - object: `{ kind: string; value: string }` plain object (human-authored flow files — normalized by the handler factory)
205
+ * @example 'b64:<base64url({"kind":"fs-path","value":"/dist/cli/source-cli-task-executor.js"})>'
206
+ * @example { kind: 'http-url', value: '/api/workiq/ask' }
207
+ * @example { kind: 'fs-path', value: './my-handler.js' }
208
+ */
209
+ whatToRun: string | {
210
+ kind: string;
211
+ value: string;
212
+ };
213
+ /**
214
+ * Optional JSONata-based mapping from logical args → physical call shape.
215
+ * When omitted, the adapter applies its default protocol for the howToRun kind.
216
+ */
217
+ argsMassaging?: ArgsMassaging;
218
+ /**
219
+ * Optional JSONata-based transforms applied to the raw invoke result
220
+ * before it reaches the step-machine engine.
221
+ *
222
+ * Context for all expressions: `{ output: { result, data, error? } }`
223
+ * where `output` is the raw { result, data, error? } returned by invokeRefSync.
224
+ *
225
+ * All fields are optional — only defined ones override the raw value.
226
+ *
227
+ * @example
228
+ * outputTransforms:
229
+ * resultExpr: "output.code = 200 ? 'success' : 'failure'"
230
+ * dataTemplate: "{ 'value': output.body.value }"
231
+ * errorExpr: "output.code != 200 ? output.error_message : $undefined()"
232
+ */
233
+ outputTransforms?: OutputTransforms;
234
+ /**
235
+ * Opaque executor-specific configuration.
236
+ * For local transports, base64-encoded and passed as --extra <base64-json> in the argv.
237
+ * For HTTP transports, available in argsMassaging templates as the `extra` binding.
238
+ * Stored with the ref so it travels as a single unit with the invocation descriptor.
239
+ */
240
+ extra?: Record<string, unknown>;
241
+ }
242
+ /**
243
+ * Standardized result envelope returned by any execution.
244
+ *
245
+ * Replaces the implicit "file-exists = success, absent = failure" protocol
246
+ * with an explicit status field. The data ref points to the output blob.
247
+ */
248
+ interface ExecutionResult {
249
+ /** Outcome of the execution. */
250
+ status: 'success' | 'fail' | 'error';
251
+ /**
252
+ * KindValueRef wire form pointing to the output blob.
253
+ * Present only when status === 'success'.
254
+ */
255
+ data?: string;
256
+ /**
257
+ * Human-readable error or failure message.
258
+ * Present when status === 'fail' or 'error'.
259
+ */
260
+ error?: string;
261
+ }
262
+ /**
263
+ * Create an ExecutionRef from a script path string (e.g. from a --task-executor CLI arg).
264
+ * File extension determines howToRun:
265
+ * .js / .mjs → 'local-node'
266
+ * .py → 'local-python'
267
+ * other → 'local-process'
268
+ *
269
+ * @param scriptPath Absolute or relative path to the script / binary.
270
+ * @param extra Optional opaque executor config stored on the ref.
271
+ */
272
+ declare function executionRefFromScriptPath(scriptPath: string, extra?: Record<string, unknown>): ExecutionRef;
273
+ /**
274
+ * Serialize an ExecutionRef to a JSON string for storage.
275
+ * Plain JSON.stringify — no special encoding.
276
+ */
277
+ declare function serializeExecutionRef(ref: ExecutionRef): string;
278
+ /**
279
+ * Parse a JSON string back into an ExecutionRef.
280
+ * Throws if the string is not valid JSON or is missing required fields.
281
+ */
282
+ declare function parseExecutionRef(s: string): ExecutionRef;
283
+
284
+ export { type ExecutionRef as E, type ExecutionResult as a, executionRefFromScriptPath as e, parseExecutionRef as p, serializeExecutionRef as s };