yaml-flow 7.1.0 → 8.0.1

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 (389) 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 +4 -4
  4. package/browser/live-cards.js +19 -3309
  5. package/cli/board-live-cards-lib-tjYsPt5U.d.ts +321 -0
  6. package/{dist/cli → cli}/browser-api/board-live-cards-browser-adapter.d.ts +3 -5
  7. package/{dist/cli → cli}/browser-api/card-store-browser-api.d.ts +1 -2
  8. package/{dist/cli → cli}/browser-api/card-store-browser-api.js +1 -1
  9. package/cli/execution-interface-ftO1W7Po.d.ts +286 -0
  10. package/{dist/cli → cli}/node/artifacts-store-cli.js +2 -2
  11. package/cli/node/batch-runner-cli.js +3 -0
  12. package/cli/node/board-live-cards-cli.js +15 -0
  13. package/{dist/cli → cli}/node/card-store-cli.js +1 -1
  14. package/{dist/cli → cli}/node/execution-adapter.d.ts +49 -4
  15. package/cli/node/execution-adapter.js +3 -0
  16. package/{dist/cli → cli}/node/fs-board-adapter.d.ts +24 -11
  17. package/cli/node/fs-board-adapter.js +14 -0
  18. package/cli/node/step-machine-cli.d.ts +7 -0
  19. package/cli/node/step-machine-cli.js +5 -0
  20. package/{dist/board-live-cards-public-5n1-syA3.d.cts → cli/types-C2YQXFwo.d.ts} +68 -5
  21. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/gandalf-runtime/.config/card-store-ref.json +1 -0
  22. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/gandalf-runtime/.config/chat-handler.json +1 -0
  23. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/gandalf-runtime/.config/outputs-store-ref.json +1 -0
  24. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/gandalf-runtime/.config/task-executor.json +1 -0
  25. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/gandalf-runtime/.state-snapshot/board/graph.json +29 -0
  26. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/gandalf-runtime/.state-snapshot/board/lastJournalProcessedId.json +1 -0
  27. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/gandalf-runtime-out/.outputs/status.json +25 -0
  28. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/runtime-out/.outputs/cards/card-market-prices/computed_values.json +67 -0
  29. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/runtime-out/.outputs/cards/card-portfolio/computed_values.json +1 -0
  30. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/runtime-out/.outputs/cards/card-portfolio-value/computed_values.json +52 -0
  31. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/runtime-out/.outputs/data-objects/holdings.json +22 -0
  32. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/runtime-out/.outputs/data-objects/positions.json +46 -0
  33. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/runtime-out/.outputs/data-objects/quotes.json +35 -0
  34. package/examples/board/.demo-setup/run-1778665078572-3466-a8ay4k/board-default/runtime-out/.outputs/status.json +113 -0
  35. package/examples/{example-board → board}/demo-server-config.json +0 -1
  36. package/examples/{example-board → board}/demo-server.js +23 -48
  37. package/examples/{example-board → board}/demo-shell-with-server.html +3 -3
  38. package/examples/{example-board → board}/demo-task-executor.js +71 -24
  39. package/examples/board/gandalf-cards/card-source-kinds.json +36 -0
  40. package/examples/board/gandalf-cards/cards/_index.json +7 -0
  41. package/examples/board/gandalf-cards/cards/card-source-kinds.json +64 -0
  42. package/examples/board/source-def-flows/copilot.flow.json +33 -0
  43. package/examples/board/source-def-flows/mock.flow.json +35 -0
  44. package/examples/board/source-def-flows/url-list.flow.json +33 -0
  45. package/examples/board/source-def-flows/url.flow.json +33 -0
  46. package/examples/board/source-def-flows/workiq.flow.json +34 -0
  47. package/examples/board/source-def-handlers/copilot-source-handler.js +141 -0
  48. package/examples/board/source-def-handlers/http-source-handler.js +145 -0
  49. package/examples/board/source_def_flows.json +249 -0
  50. package/examples/board/test/demo-http-test.js +317 -0
  51. package/examples/{example-board → board-local}/demo-shell-localstorage.html +4 -4
  52. package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/handlers}/portfolio-tracker-fetch-prices.js +1 -1
  53. package/examples/{browser/boards/portfolio-tracker/portfolio-tracker-public.js → portfolio-tracker/portfolio-tracker.js} +11 -14
  54. package/examples/{browser/boards/portfolio-tracker → portfolio-tracker/test}/portfolio-t4.js +32 -50
  55. package/lib/artifacts-store-lib-public-BABrgFkV.d.ts +119 -0
  56. package/lib/artifacts-store-lib-public-DGa8BpJT.d.cts +119 -0
  57. package/lib/artifacts-store-public.cjs +2 -0
  58. package/lib/artifacts-store-public.d.cts +5 -0
  59. package/lib/artifacts-store-public.d.ts +5 -0
  60. package/lib/artifacts-store-public.js +2 -0
  61. package/lib/board-live-cards-node.cjs +14 -0
  62. package/lib/board-live-cards-node.d.cts +178 -0
  63. package/lib/board-live-cards-node.d.ts +178 -0
  64. package/lib/board-live-cards-node.js +14 -0
  65. package/lib/board-live-cards-public-BnmRAbQV.d.cts +383 -0
  66. package/{dist/board-live-cards-public-CK_J8uv0.d.ts → lib/board-live-cards-public-CsmYrvpd.d.ts} +142 -76
  67. package/lib/board-live-cards-public.cjs +3 -0
  68. package/lib/board-live-cards-public.d.cts +4 -0
  69. package/lib/board-live-cards-public.d.ts +4 -0
  70. package/lib/board-live-cards-public.js +3 -0
  71. package/lib/board-live-cards-server-runtime.cjs +9 -0
  72. package/lib/board-live-cards-server-runtime.d.cts +6 -0
  73. package/lib/board-live-cards-server-runtime.d.ts +6 -0
  74. package/lib/board-live-cards-server-runtime.js +9 -0
  75. package/lib/board-livegraph-runtime/index.cjs +3 -0
  76. package/{dist → lib}/board-livegraph-runtime/index.d.cts +1 -2
  77. package/{dist → lib}/board-livegraph-runtime/index.d.ts +1 -2
  78. package/lib/board-livegraph-runtime/index.js +3 -0
  79. package/{dist/storage-refs.cjs → lib/board-worker-adapter.cjs} +2 -2
  80. package/{dist/storage-refs.d.cts → lib/board-worker-adapter.d.cts} +4 -3
  81. package/{dist/storage-refs.d.ts → lib/board-worker-adapter.d.ts} +4 -3
  82. package/{dist/storage-refs.js → lib/board-worker-adapter.js} +2 -2
  83. package/{dist → lib}/card-compute/index.cjs +1 -1
  84. package/{dist → lib}/card-compute/index.js +1 -1
  85. package/lib/card-store-public.cjs +2 -0
  86. package/lib/card-store-public.d.cts +61 -0
  87. package/lib/card-store-public.d.ts +61 -0
  88. package/lib/card-store-public.js +2 -0
  89. package/lib/card-validation.cjs +10 -0
  90. package/lib/card-validation.d.cts +35 -0
  91. package/lib/card-validation.d.ts +35 -0
  92. package/lib/card-validation.js +10 -0
  93. package/{dist/constants-oCEbNpul.d.ts → lib/constants-BPVLb3Es.d.ts} +1 -1
  94. package/{dist/constants-BzZUyYlp.d.cts → lib/constants-DXxsRN9y.d.cts} +1 -1
  95. package/{dist → lib}/continuous-event-graph/index.cjs +2 -2
  96. package/{dist → lib}/continuous-event-graph/index.d.cts +3 -5
  97. package/{dist → lib}/continuous-event-graph/index.d.ts +3 -5
  98. package/{dist → lib}/continuous-event-graph/index.js +2 -2
  99. package/{dist → lib}/event-graph/index.d.cts +2 -2
  100. package/{dist → lib}/event-graph/index.d.ts +2 -2
  101. package/lib/execution-refs.cjs +3 -0
  102. package/{dist → lib}/execution-refs.d.cts +33 -12
  103. package/{dist → lib}/execution-refs.d.ts +33 -12
  104. package/lib/execution-refs.js +3 -0
  105. package/lib/index.cjs +25 -0
  106. package/{dist → lib}/index.d.cts +7 -8
  107. package/{dist → lib}/index.d.ts +7 -8
  108. package/lib/index.js +25 -0
  109. package/{dist/live-cards-bridge-BXbVTsna.d.cts → lib/live-cards-bridge-DC_ZU0eS.d.ts} +134 -3
  110. package/{dist/live-cards-bridge-Ds28XR15.d.ts → lib/live-cards-bridge-b25aAVvE.d.cts} +134 -3
  111. package/lib/loader-CuuLjxVA.d.cts +42 -0
  112. package/lib/loader-Zborm2pq.d.ts +42 -0
  113. package/lib/server-runtime/index.cjs +9 -0
  114. package/{dist → lib}/server-runtime/index.d.cts +4 -4
  115. package/{dist → lib}/server-runtime/index.d.ts +4 -4
  116. package/lib/server-runtime/index.js +9 -0
  117. package/lib/step-machine/index.d.cts +64 -0
  118. package/lib/step-machine/index.d.ts +64 -0
  119. package/lib/step-machine-public/index.cjs +5 -0
  120. package/{dist → lib}/step-machine-public/index.d.cts +14 -1
  121. package/{dist → lib}/step-machine-public/index.d.ts +14 -1
  122. package/lib/step-machine-public/index.js +5 -0
  123. package/lib/storage-interface-BhAON-gW.d.cts +84 -0
  124. package/lib/storage-interface-BhAON-gW.d.ts +84 -0
  125. package/lib/stores/index.cjs +3 -0
  126. package/lib/stores/index.d.cts +4 -0
  127. package/lib/stores/index.d.ts +4 -0
  128. package/lib/stores/index.js +3 -0
  129. package/lib/stores/kv.cjs +3 -0
  130. package/lib/stores/kv.d.cts +32 -0
  131. package/lib/stores/kv.d.ts +32 -0
  132. package/lib/stores/kv.js +3 -0
  133. package/{dist → lib}/stores/memory.d.cts +1 -1
  134. package/{dist → lib}/stores/memory.d.ts +1 -1
  135. package/{dist/types-HGDTWIun.d.ts → lib/types-CBxkYuLY.d.ts} +2 -1
  136. package/{dist/types-ycun84cq.d.cts → lib/types-DQ1bKuB1.d.cts} +11 -0
  137. package/{dist/types-ycun84cq.d.ts → lib/types-DQ1bKuB1.d.ts} +11 -0
  138. package/{dist/types-CU3DjTKL.d.cts → lib/types-DkFvgxwq.d.cts} +2 -1
  139. package/package.json +79 -119
  140. package/board-live-cards-cli.js +0 -37
  141. package/browser/board-livecards-client.js.map +0 -1
  142. package/browser/board-livecards-localstorage.js.map +0 -1
  143. package/browser/board-livegraph-engine.js +0 -3
  144. package/browser/board-livegraph-engine.js.map +0 -1
  145. package/browser/card-compute.js +0 -266
  146. package/browser/compute-jsonata.js.map +0 -1
  147. package/card-store.js +0 -37
  148. package/dist/batch/index.cjs.map +0 -1
  149. package/dist/batch/index.js.map +0 -1
  150. package/dist/board-live-cards-lib-Bg6EvCo5.d.cts +0 -136
  151. package/dist/board-live-cards-lib-jM2uYG1v.d.ts +0 -136
  152. package/dist/board-livegraph-runtime/index.cjs +0 -3
  153. package/dist/board-livegraph-runtime/index.cjs.map +0 -1
  154. package/dist/board-livegraph-runtime/index.js +0 -3
  155. package/dist/board-livegraph-runtime/index.js.map +0 -1
  156. package/dist/card-compute/index.cjs.map +0 -1
  157. package/dist/card-compute/index.js.map +0 -1
  158. package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs +0 -3
  159. package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs.map +0 -1
  160. package/dist/cli/browser-api/board-live-cards-browser-adapter.d.cts +0 -37
  161. package/dist/cli/browser-api/board-live-cards-browser-adapter.js.map +0 -1
  162. package/dist/cli/browser-api/card-store-browser-api.cjs +0 -2
  163. package/dist/cli/browser-api/card-store-browser-api.cjs.map +0 -1
  164. package/dist/cli/browser-api/card-store-browser-api.d.cts +0 -26
  165. package/dist/cli/browser-api/card-store-browser-api.js.map +0 -1
  166. package/dist/cli/node/artifacts-store-cli.cjs +0 -11
  167. package/dist/cli/node/artifacts-store-cli.cjs.map +0 -1
  168. package/dist/cli/node/artifacts-store-cli.d.cts +0 -8
  169. package/dist/cli/node/artifacts-store-cli.js.map +0 -1
  170. package/dist/cli/node/board-live-cards-cli.cjs +0 -15
  171. package/dist/cli/node/board-live-cards-cli.cjs.map +0 -1
  172. package/dist/cli/node/board-live-cards-cli.d.cts +0 -20
  173. package/dist/cli/node/board-live-cards-cli.js +0 -15
  174. package/dist/cli/node/board-live-cards-cli.js.map +0 -1
  175. package/dist/cli/node/card-store-cli.cjs +0 -8
  176. package/dist/cli/node/card-store-cli.cjs.map +0 -1
  177. package/dist/cli/node/card-store-cli.d.cts +0 -15
  178. package/dist/cli/node/card-store-cli.js.map +0 -1
  179. package/dist/cli/node/execution-adapter.cjs +0 -3
  180. package/dist/cli/node/execution-adapter.cjs.map +0 -1
  181. package/dist/cli/node/execution-adapter.d.cts +0 -174
  182. package/dist/cli/node/execution-adapter.js +0 -3
  183. package/dist/cli/node/execution-adapter.js.map +0 -1
  184. package/dist/cli/node/fs-board-adapter.cjs +0 -14
  185. package/dist/cli/node/fs-board-adapter.cjs.map +0 -1
  186. package/dist/cli/node/fs-board-adapter.d.cts +0 -204
  187. package/dist/cli/node/fs-board-adapter.js +0 -14
  188. package/dist/cli/node/fs-board-adapter.js.map +0 -1
  189. package/dist/cli/node/source-cli-task-executor.cjs +0 -11
  190. package/dist/cli/node/source-cli-task-executor.cjs.map +0 -1
  191. package/dist/cli/node/source-cli-task-executor.js.map +0 -1
  192. package/dist/config/index.cjs.map +0 -1
  193. package/dist/config/index.js.map +0 -1
  194. package/dist/continuous-event-graph/index.cjs.map +0 -1
  195. package/dist/continuous-event-graph/index.js.map +0 -1
  196. package/dist/event-graph/index.cjs.map +0 -1
  197. package/dist/event-graph/index.js.map +0 -1
  198. package/dist/execution-refs.cjs +0 -3
  199. package/dist/execution-refs.cjs.map +0 -1
  200. package/dist/execution-refs.js +0 -3
  201. package/dist/execution-refs.js.map +0 -1
  202. package/dist/index.cjs +0 -30
  203. package/dist/index.cjs.map +0 -1
  204. package/dist/index.js +0 -30
  205. package/dist/index.js.map +0 -1
  206. package/dist/inference/index.cjs +0 -7
  207. package/dist/inference/index.cjs.map +0 -1
  208. package/dist/inference/index.d.cts +0 -229
  209. package/dist/inference/index.d.ts +0 -229
  210. package/dist/inference/index.js +0 -7
  211. package/dist/inference/index.js.map +0 -1
  212. package/dist/server-runtime/index.cjs +0 -9
  213. package/dist/server-runtime/index.cjs.map +0 -1
  214. package/dist/server-runtime/index.js +0 -9
  215. package/dist/server-runtime/index.js.map +0 -1
  216. package/dist/step-machine/index.cjs.map +0 -1
  217. package/dist/step-machine/index.d.cts +0 -102
  218. package/dist/step-machine/index.d.ts +0 -102
  219. package/dist/step-machine/index.js.map +0 -1
  220. package/dist/step-machine-public/index.cjs +0 -3
  221. package/dist/step-machine-public/index.cjs.map +0 -1
  222. package/dist/step-machine-public/index.js +0 -3
  223. package/dist/step-machine-public/index.js.map +0 -1
  224. package/dist/storage-refs.cjs.map +0 -1
  225. package/dist/storage-refs.js.map +0 -1
  226. package/dist/stores/file.cjs +0 -2
  227. package/dist/stores/file.cjs.map +0 -1
  228. package/dist/stores/file.d.cts +0 -36
  229. package/dist/stores/file.d.ts +0 -36
  230. package/dist/stores/file.js +0 -2
  231. package/dist/stores/file.js.map +0 -1
  232. package/dist/stores/index.cjs +0 -2
  233. package/dist/stores/index.cjs.map +0 -1
  234. package/dist/stores/index.d.cts +0 -4
  235. package/dist/stores/index.d.ts +0 -4
  236. package/dist/stores/index.js +0 -2
  237. package/dist/stores/index.js.map +0 -1
  238. package/dist/stores/localStorage.cjs +0 -2
  239. package/dist/stores/localStorage.cjs.map +0 -1
  240. package/dist/stores/localStorage.d.cts +0 -34
  241. package/dist/stores/localStorage.d.ts +0 -34
  242. package/dist/stores/localStorage.js +0 -2
  243. package/dist/stores/localStorage.js.map +0 -1
  244. package/dist/stores/memory.cjs.map +0 -1
  245. package/dist/stores/memory.js.map +0 -1
  246. package/dist/types-CHSdoAAA.d.cts +0 -135
  247. package/dist/types-CoW0gQl3.d.ts +0 -135
  248. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-fetch-prices.py +0 -201
  249. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-http-test.js +0 -370
  250. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-http-test.py +0 -398
  251. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +0 -196
  252. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.js +0 -300
  253. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.py +0 -617
  254. package/examples/browser/boards/portfolio-tracker/portfolio-tracker.py +0 -366
  255. package/examples/browser/livecards-browser/index.html +0 -41
  256. package/examples/browser/step-machine-browser/index.html +0 -367
  257. package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/.runtime-out +0 -1
  258. package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/board-graph.json +0 -32
  259. package/examples/cli/step-machine-cli/portfolio-tracker/cards/holdings-table.json +0 -22
  260. package/examples/cli/step-machine-cli/portfolio-tracker/cards/portfolio-form.json +0 -43
  261. package/examples/cli/step-machine-cli/portfolio-tracker/cards/portfolio-value.json +0 -15
  262. package/examples/cli/step-machine-cli/portfolio-tracker/cards/price-fetch.json +0 -15
  263. package/examples/cli/step-machine-cli/portfolio-tracker/fetch-prices.js +0 -48
  264. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -125
  265. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +0 -32
  266. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +0 -26
  267. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/poll-status-cli.js +0 -49
  268. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +0 -25
  269. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +0 -23
  270. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/status-cli.js +0 -21
  271. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +0 -38
  272. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +0 -48
  273. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +0 -31
  274. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/_board_pycli.py +0 -107
  275. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/add-cards.py +0 -51
  276. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/init-board.py +0 -45
  277. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/poll-status.py +0 -71
  278. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/reset-board-dir.py +0 -36
  279. package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-demo.flow.yaml +0 -26
  280. package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-handlers.py +0 -39
  281. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker-pycli.flow.yaml +0 -80
  282. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +0 -76
  283. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +0 -44
  284. package/examples/cli/step-machine-cli/portfolio-tracker/run-inline-python-demo-pycli.py +0 -43
  285. package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker-pycli.py +0 -77
  286. package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +0 -28
  287. package/examples/cli/step-machine-demo/jsonata-init-board-cli.js +0 -31
  288. package/examples/cli/step-machine-demo/jsonata-init-board.flow.yaml +0 -54
  289. package/examples/cli/step-machine-demo/one-step-cli-only.flow.yaml +0 -21
  290. package/examples/cli/step-machine-demo/step-cli-echo-y.js +0 -15
  291. package/examples/cli/step-machine-demo/step2-double-cli.js +0 -33
  292. package/examples/cli/step-machine-demo/two-step-math.flow.yaml +0 -93
  293. package/examples/cli/step-machine-demo/two-step-mixed.flow.yaml +0 -43
  294. package/examples/example-board/agent-instructions-cardlayout.md +0 -56
  295. package/examples/example-board/agent-instructions.md +0 -834
  296. package/examples/example-board/demo-shell.html +0 -63
  297. package/examples/index.html +0 -785
  298. package/examples/npm-libs/batch/batch-step-machine.ts +0 -121
  299. package/examples/npm-libs/continuous-event-graph/live-cards-board.ts +0 -215
  300. package/examples/npm-libs/continuous-event-graph/live-portfolio-dashboard.ts +0 -555
  301. package/examples/npm-libs/continuous-event-graph/portfolio-tracker.ts +0 -287
  302. package/examples/npm-libs/continuous-event-graph/reactive-monitoring.ts +0 -265
  303. package/examples/npm-libs/continuous-event-graph/reactive-pipeline.ts +0 -168
  304. package/examples/npm-libs/continuous-event-graph/soc-incident-board.ts +0 -287
  305. package/examples/npm-libs/continuous-event-graph/stock-dashboard.ts +0 -229
  306. package/examples/npm-libs/event-graph/ci-cd-pipeline.ts +0 -243
  307. package/examples/npm-libs/event-graph/executor-diamond.ts +0 -165
  308. package/examples/npm-libs/event-graph/executor-pipeline.ts +0 -161
  309. package/examples/npm-libs/event-graph/research-pipeline.ts +0 -137
  310. package/examples/npm-libs/flows/ai-conversation.yaml +0 -116
  311. package/examples/npm-libs/flows/order-processing.yaml +0 -143
  312. package/examples/npm-libs/flows/simple-greeting.yaml +0 -54
  313. package/examples/npm-libs/graph-of-graphs/multi-stage-etl.ts +0 -307
  314. package/examples/npm-libs/graph-of-graphs/url-processing-pipeline.ts +0 -254
  315. package/examples/npm-libs/inference/azure-deployment.ts +0 -149
  316. package/examples/npm-libs/inference/copilot-cli.ts +0 -138
  317. package/examples/npm-libs/inference/data-pipeline.ts +0 -145
  318. package/examples/npm-libs/inference/pluggable-adapters.ts +0 -254
  319. package/examples/npm-libs/node/ai-conversation.ts +0 -195
  320. package/examples/npm-libs/node/simple-greeting.ts +0 -101
  321. package/examples/step-machine-cli/portfolio-tracker/cards/holdings-table.json +0 -22
  322. package/examples/step-machine-cli/portfolio-tracker/cards/portfolio-form.json +0 -43
  323. package/examples/step-machine-cli/portfolio-tracker/cards/portfolio-value.json +0 -15
  324. package/examples/step-machine-cli/portfolio-tracker/cards/price-fetch.json +0 -15
  325. package/examples/step-machine-cli/portfolio-tracker/fetch-prices.js +0 -48
  326. package/examples/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -57
  327. package/examples/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +0 -27
  328. package/examples/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +0 -25
  329. package/examples/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +0 -29
  330. package/examples/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +0 -27
  331. package/examples/step-machine-cli/portfolio-tracker/handlers/status-cli.js +0 -25
  332. package/examples/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +0 -37
  333. package/examples/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +0 -53
  334. package/examples/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +0 -35
  335. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker-task-executor.cjs +0 -96
  336. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +0 -227
  337. package/examples/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +0 -38
  338. package/examples/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +0 -28
  339. package/step-machine-cli.js +0 -407
  340. /package/{dist/cli → cli}/browser-api/board-live-cards-browser-adapter.js +0 -0
  341. /package/{dist/board-livegraph-runtime → cli/browser-api}/jsonata-sync.cjs +0 -0
  342. /package/{dist/cli → cli}/node/artifacts-store-cli.d.ts +0 -0
  343. /package/{dist/cli/node/source-cli-task-executor.d.cts → cli/node/batch-runner-cli.d.ts} +0 -0
  344. /package/{dist/cli → cli}/node/board-live-cards-cli.d.ts +0 -0
  345. /package/{dist/cli → cli}/node/card-store-cli.d.ts +0 -0
  346. /package/{dist/card-compute → cli/node}/jsonata-sync.cjs +0 -0
  347. /package/{dist/cli → cli}/node/source-cli-task-executor.d.ts +0 -0
  348. /package/{dist/cli → cli}/node/source-cli-task-executor.js +0 -0
  349. /package/examples/{example-board → board}/cards/card-concentration.json +0 -0
  350. /package/examples/{example-board → board}/cards/card-my-identity.json +0 -0
  351. /package/examples/{example-board → board}/cards/card-portfolio-action.json +0 -0
  352. /package/examples/{example-board → board}/cards/card-portfolio-intelligence.json +0 -0
  353. /package/examples/{example-board → board}/cards/card-portfolio-risks.json +0 -0
  354. /package/examples/{example-board → board}/cards/card-rebalance-impact.json +0 -0
  355. /package/examples/{example-board → board}/cards/card-rebalance-sim.json +0 -0
  356. /package/examples/{example-board → board}/cards/cardT-market-prices.json +0 -0
  357. /package/examples/{example-board → board}/cards/cardT-portfolio-value.json +0 -0
  358. /package/examples/{example-board → board}/cards/cardT-portfolio.json +0 -0
  359. /package/examples/{example-board → board}/demo-chat-handler.js +0 -0
  360. /package/examples/{example-board → board}/scripts/copilot_wrapper.bat +0 -0
  361. /package/examples/{example-board → board}/scripts/copilot_wrapper_helper.ps1 +0 -0
  362. /package/examples/{example-board → board}/scripts/workiq_wrapper.mjs +0 -0
  363. /package/examples/{browser/boards/portfolio-tracker → board/test}/portfolio-tracker-sse-worker.js +0 -0
  364. /package/{dist → lib}/batch/index.cjs +0 -0
  365. /package/{dist → lib}/batch/index.d.cts +0 -0
  366. /package/{dist → lib}/batch/index.d.ts +0 -0
  367. /package/{dist → lib}/batch/index.js +0 -0
  368. /package/{dist/cli/browser-api → lib/board-livegraph-runtime}/jsonata-sync.cjs +0 -0
  369. /package/{dist → lib}/card-compute/index.d.cts +0 -0
  370. /package/{dist → lib}/card-compute/index.d.ts +0 -0
  371. /package/{dist/cli/node → lib/card-compute}/jsonata-sync.cjs +0 -0
  372. /package/{dist → lib}/config/index.cjs +0 -0
  373. /package/{dist → lib}/config/index.d.cts +0 -0
  374. /package/{dist → lib}/config/index.d.ts +0 -0
  375. /package/{dist → lib}/config/index.js +0 -0
  376. /package/{dist → lib}/continuous-event-graph/jsonata-sync.cjs +0 -0
  377. /package/{dist → lib}/event-graph/index.cjs +0 -0
  378. /package/{dist → lib}/event-graph/index.js +0 -0
  379. /package/{dist → lib}/jsonata-sync.cjs +0 -0
  380. /package/{dist → lib}/server-runtime/jsonata-sync.cjs +0 -0
  381. /package/{dist → lib}/step-machine/index.cjs +0 -0
  382. /package/{dist → lib}/step-machine/index.js +0 -0
  383. /package/{dist → lib}/step-machine-public/jsonata-sync.cjs +0 -0
  384. /package/{dist → lib}/stores/memory.cjs +0 -0
  385. /package/{dist → lib}/stores/memory.js +0 -0
  386. /package/{dist → lib}/types-BBhqYGhE.d.cts +0 -0
  387. /package/{dist → lib}/types-BBhqYGhE.d.ts +0 -0
  388. /package/{dist → lib}/validate-BAVzUJWa.d.ts +0 -0
  389. /package/{dist → lib}/validate-Dbu7ygys.d.cts +0 -0
@@ -1,254 +0,0 @@
1
- /**
2
- * Inference Example: Pluggable LLM Adapters
3
- *
4
- * Shows how to create adapters for different LLM providers.
5
- * Each adapter implements InferenceAdapter.analyze(prompt) → string.
6
- *
7
- * Run with: npx tsx examples/npm-libs/inference/pluggable-adapters.ts
8
- */
9
-
10
- import {
11
- createLiveGraph,
12
- schedule,
13
- } from '../../src/continuous-event-graph/index.js';
14
- import {
15
- inferCompletions,
16
- applyInferences,
17
- buildInferencePrompt,
18
- createCliAdapter,
19
- createHttpAdapter,
20
- } from '../../src/inference/index.js';
21
- import type { InferenceAdapter } from '../../src/inference/index.js';
22
- import type { GraphConfig } from '../../src/continuous-event-graph/types.js';
23
-
24
- // ============================================================================
25
- // 1. Adapter Examples (uncomment the one for your LLM provider)
26
- // ============================================================================
27
-
28
- /**
29
- * OpenAI Adapter
30
- * npm install openai
31
- */
32
- function createOpenAIAdapter(apiKey: string, model = 'gpt-4o'): InferenceAdapter {
33
- return {
34
- analyze: async (prompt: string) => {
35
- // import OpenAI from 'openai';
36
- // const client = new OpenAI({ apiKey });
37
- // const response = await client.chat.completions.create({
38
- // model,
39
- // messages: [{ role: 'user', content: prompt }],
40
- // temperature: 0.1, // low temperature for deterministic analysis
41
- // });
42
- // return response.choices[0].message.content ?? '[]';
43
-
44
- // Mock for demo
45
- return '[]';
46
- },
47
- };
48
- }
49
-
50
- /**
51
- * Azure OpenAI Adapter
52
- * npm install openai
53
- */
54
- function createAzureOpenAIAdapter(
55
- endpoint: string,
56
- apiKey: string,
57
- deployment: string,
58
- ): InferenceAdapter {
59
- return {
60
- analyze: async (prompt: string) => {
61
- // import OpenAI from 'openai';
62
- // const client = new OpenAI({
63
- // apiKey,
64
- // baseURL: `${endpoint}/openai/deployments/${deployment}`,
65
- // defaultQuery: { 'api-version': '2024-02-15-preview' },
66
- // defaultHeaders: { 'api-key': apiKey },
67
- // });
68
- // const response = await client.chat.completions.create({
69
- // model: deployment,
70
- // messages: [{ role: 'user', content: prompt }],
71
- // temperature: 0.1,
72
- // });
73
- // return response.choices[0].message.content ?? '[]';
74
-
75
- return '[]';
76
- },
77
- };
78
- }
79
-
80
- /**
81
- * Anthropic (Claude) Adapter
82
- * npm install @anthropic-ai/sdk
83
- */
84
- function createAnthropicAdapter(apiKey: string, model = 'claude-sonnet-4-20250514'): InferenceAdapter {
85
- return {
86
- analyze: async (prompt: string) => {
87
- // import Anthropic from '@anthropic-ai/sdk';
88
- // const client = new Anthropic({ apiKey });
89
- // const response = await client.messages.create({
90
- // model,
91
- // max_tokens: 1024,
92
- // messages: [{ role: 'user', content: prompt }],
93
- // });
94
- // return response.content[0].type === 'text' ? response.content[0].text : '[]';
95
-
96
- return '[]';
97
- },
98
- };
99
- }
100
-
101
- /**
102
- * Local/Custom Adapter — call any HTTP endpoint
103
- */
104
- function createCustomAdapter(url: string, headers: Record<string, string> = {}): InferenceAdapter {
105
- return {
106
- analyze: async (prompt: string) => {
107
- const response = await fetch(url, {
108
- method: 'POST',
109
- headers: { 'Content-Type': 'application/json', ...headers },
110
- body: JSON.stringify({ prompt }),
111
- });
112
- const data = await response.json() as { response?: string };
113
- return data.response ?? '[]';
114
- },
115
- };
116
- }
117
-
118
- // ============================================================================
119
- // 1b. Built-in Adapter Factories (no boilerplate needed)
120
- // ============================================================================
121
-
122
- /**
123
- * Ollama via CLI — runs models locally
124
- * Install: https://ollama.com
125
- */
126
- const ollamaCliAdapter = createCliAdapter({
127
- command: 'ollama',
128
- args: (prompt) => ['run', 'llama3', prompt],
129
- });
130
-
131
- /**
132
- * Ollama via HTTP — same model, HTTP interface
133
- * Start with: ollama serve
134
- */
135
- const ollamaHttpAdapter = createHttpAdapter({
136
- url: 'http://localhost:11434/api/generate',
137
- buildBody: (prompt) => ({ model: 'llama3', prompt, stream: false }),
138
- extractResponse: (json) => json.response as string,
139
- });
140
-
141
- /**
142
- * llm CLI — Simon Willison's LLM tool
143
- * Install: pip install llm
144
- */
145
- const llmCliAdapter = createCliAdapter({
146
- command: 'llm',
147
- args: () => ['--no-stream'],
148
- stdin: true, // pipe prompt via stdin (better for long prompts)
149
- });
150
-
151
- /**
152
- * GitHub Copilot CLI — use gh copilot for inference
153
- * Install: gh extension install github/gh-copilot
154
- */
155
- const ghCopilotAdapter = createCliAdapter({
156
- command: 'gh',
157
- args: (prompt) => ['copilot', 'suggest', '-t', 'shell', prompt],
158
- timeout: 30_000,
159
- });
160
-
161
- /**
162
- * Custom script adapter — run your own wrapper script
163
- * The script receives the prompt as argument (or stdin) and prints JSON to stdout
164
- */
165
- const customScriptAdapter = createCliAdapter({
166
- command: 'python',
167
- args: (prompt) => ['scripts/infer.py', '--json', prompt],
168
- cwd: '/path/to/project',
169
- env: { MODEL: 'gpt-4o', TEMPERATURE: '0.1' },
170
- timeout: 60_000,
171
- });
172
-
173
- // ============================================================================
174
- // 2. Demo: Use the prompt builder standalone
175
- // ============================================================================
176
-
177
- const config: GraphConfig = {
178
- settings: { completion: 'all-tasks' },
179
- tasks: {
180
- 'code-reviewed': {
181
- provides: ['review-done'],
182
- description: 'Code review completed by team lead',
183
- inference: {
184
- criteria: 'PR approved with at least 2 approvals and no open comments',
185
- keywords: ['pull-request', 'code-review', 'approval'],
186
- suggestedChecks: ['check PR status for "approved"', 'verify no open comments'],
187
- autoDetectable: true,
188
- },
189
- },
190
- 'tests-passed': {
191
- requires: ['review-done'],
192
- provides: ['tests-green'],
193
- description: 'CI pipeline tests all passing',
194
- inference: {
195
- criteria: 'All CI checks green, code coverage above 80%',
196
- keywords: ['ci', 'tests', 'coverage', 'pipeline'],
197
- suggestedChecks: ['check CI status', 'verify coverage report'],
198
- autoDetectable: true,
199
- },
200
- },
201
- 'deployed-staging': {
202
- requires: ['tests-green'],
203
- provides: ['staging-live'],
204
- description: 'Deployed to staging environment',
205
- inference: {
206
- criteria: 'Staging URL returns HTTP 200 with correct version',
207
- keywords: ['staging', 'deployment', 'version'],
208
- autoDetectable: true,
209
- },
210
- },
211
- },
212
- };
213
-
214
- async function main() {
215
- const live = createLiveGraph(config);
216
-
217
- // Just build the prompt — useful for debugging or using with your own LLM code
218
- const prompt = buildInferencePrompt(live, {
219
- context: 'PR #142: 3 approvals, 0 open comments. CI: all 47 tests pass, coverage 84%.',
220
- });
221
-
222
- console.log('=== Generated LLM Prompt ===');
223
- console.log(prompt);
224
- console.log('\n=== End Prompt ===');
225
- console.log(`\nPrompt length: ${prompt.length} characters`);
226
- console.log('This prompt can be sent to any LLM provider.');
227
-
228
- // Demo: use a mock adapter to show the full flow
229
- const mockAdapter: InferenceAdapter = {
230
- analyze: async () => JSON.stringify([
231
- { taskName: 'code-reviewed', confidence: 0.97, reasoning: '3 approvals, 0 open comments — PR is clearly approved.' },
232
- { taskName: 'tests-passed', confidence: 0.92, reasoning: '47/47 tests pass, coverage 84% exceeds 80% threshold.' },
233
- ]),
234
- };
235
-
236
- const result = await inferCompletions(live, mockAdapter, {
237
- context: 'PR #142: 3 approvals, 0 open comments. CI: all 47 tests pass, coverage 84%.',
238
- });
239
-
240
- console.log('\n=== Inference Results ===');
241
- for (const s of result.suggestions) {
242
- console.log(` ${s.taskName}: ${(s.confidence * 100).toFixed(0)}% — ${s.reasoning}`);
243
- }
244
-
245
- // Apply above threshold
246
- const updated = applyInferences(live, result, 0.9);
247
- console.log('\n=== After Applying (threshold 90%) ===');
248
- for (const [name, state] of Object.entries(updated.state.tasks)) {
249
- console.log(` ${name}: ${state.status}`);
250
- }
251
- console.log(' Eligible:', schedule(updated).eligible);
252
- }
253
-
254
- main().catch(console.error);
@@ -1,195 +0,0 @@
1
- /**
2
- * Node.js Example: AI Conversation with External API
3
- *
4
- * Demonstrates a more complex flow with:
5
- * - Component injection (AI client)
6
- * - Retry logic
7
- * - Circuit breakers
8
- * - Event handling
9
- *
10
- * Run with: npx ts-node examples/npm-libs/node/ai-conversation.ts
11
- */
12
-
13
- import { createEngine, loadFlow, MemoryStore } from '../../src/index.js';
14
- import type { StepInput, StepContext, StepResult } from '../../src/index.js';
15
- import { fileURLToPath } from 'url';
16
- import { dirname, join } from 'path';
17
-
18
- const __filename = fileURLToPath(import.meta.url);
19
- const __dirname = dirname(__filename);
20
-
21
- // Simulated AI client (replace with actual OpenAI/Anthropic client)
22
- const mockAIClient = {
23
- async generateResponse(prompt: string, history: string[]): Promise<{ text: string; confidence: number }> {
24
- // Simulate API latency
25
- await new Promise(resolve => setTimeout(resolve, 100));
26
-
27
- // Simulate occasional low confidence
28
- const confidence = Math.random() > 0.3 ? 0.85 : 0.4;
29
-
30
- return {
31
- text: `AI Response to: "${prompt}" (simulated)`,
32
- confidence,
33
- };
34
- },
35
- };
36
-
37
- // Define step handlers
38
- const handlers = {
39
- async generate_response(input: StepInput, ctx: StepContext): Promise<StepResult> {
40
- const userMessage = input.user_message as string;
41
- const history = (input.conversation_history as string[]) || [];
42
-
43
- // Access injected AI client from components
44
- const ai = ctx.components.aiClient as typeof mockAIClient;
45
-
46
- console.log(`[generate] Processing: "${userMessage}"`);
47
-
48
- try {
49
- const response = await ai.generateResponse(userMessage, history);
50
-
51
- return {
52
- result: 'success',
53
- data: {
54
- ai_response: response.text,
55
- confidence_score: response.confidence,
56
- },
57
- };
58
- } catch (error) {
59
- console.log('[generate] API call failed, will retry...');
60
- return { result: 'failure' };
61
- }
62
- },
63
-
64
- async validate_response(input: StepInput, ctx: StepContext): Promise<StepResult> {
65
- const response = input.ai_response as string;
66
- const confidence = input.confidence_score as number;
67
-
68
- console.log(`[validate] Confidence: ${(confidence * 100).toFixed(1)}%`);
69
-
70
- // Check quality criteria
71
- if (confidence >= 0.7 && response.length > 10) {
72
- return {
73
- result: 'valid',
74
- data: {
75
- validation_result: 'passed',
76
- validation_feedback: null,
77
- },
78
- };
79
- }
80
-
81
- return {
82
- result: 'needs_refinement',
83
- data: {
84
- validation_result: 'needs_improvement',
85
- validation_feedback: confidence < 0.7
86
- ? 'Low confidence - regenerate with more context'
87
- : 'Response too short',
88
- },
89
- };
90
- },
91
-
92
- async refine_response(input: StepInput, ctx: StepContext): Promise<StepResult> {
93
- const feedback = input.validation_feedback as string;
94
- const userMessage = input.user_message as string;
95
-
96
- console.log(`[refine] Refining based on: ${feedback}`);
97
-
98
- const ai = ctx.components.aiClient as typeof mockAIClient;
99
-
100
- // Enhanced prompt with feedback
101
- const enhancedPrompt = `${userMessage} (Note: ${feedback})`;
102
- const response = await ai.generateResponse(enhancedPrompt, []);
103
-
104
- return {
105
- result: 'success',
106
- data: {
107
- ai_response: response.text + ' [refined]',
108
- confidence_score: Math.min(response.confidence + 0.2, 0.95), // Boost confidence
109
- },
110
- };
111
- },
112
-
113
- async check_approval(input: StepInput, ctx: StepContext): Promise<StepResult> {
114
- const response = input.ai_response as string;
115
-
116
- console.log(`[approval] Response ready: "${response}"`);
117
-
118
- // Simulate user approval (in real app, this would wait for user input)
119
- const userApproves = Math.random() > 0.3;
120
-
121
- if (userApproves) {
122
- console.log('[approval] User approved!');
123
- return {
124
- result: 'approved',
125
- data: {
126
- user_approved: true,
127
- user_feedback: null,
128
- },
129
- };
130
- }
131
-
132
- console.log('[approval] User rejected, requesting changes');
133
- return {
134
- result: 'rejected',
135
- data: {
136
- user_approved: false,
137
- user_feedback: 'Please make it more concise',
138
- },
139
- };
140
- },
141
-
142
- async incorporate_feedback(input: StepInput, ctx: StepContext): Promise<StepResult> {
143
- const response = input.ai_response as string;
144
- const feedback = input.user_feedback as string;
145
-
146
- console.log(`[feedback] Incorporating: "${feedback}"`);
147
-
148
- return {
149
- result: 'success',
150
- data: {
151
- ai_response: response.replace(' [refined]', '') + ' [user-adjusted]',
152
- confidence_score: 0.9,
153
- },
154
- };
155
- },
156
- };
157
-
158
- async function main() {
159
- // Load the AI conversation flow
160
- const flowPath = join(__dirname, '../flows/ai-conversation.yaml');
161
- const flow = await loadFlow(flowPath);
162
-
163
- console.log('=== AI Conversation Flow Demo ===\n');
164
-
165
- // Create engine with AI client component
166
- const engine = createEngine(flow, handlers, {
167
- store: new MemoryStore(),
168
- components: {
169
- aiClient: mockAIClient,
170
- },
171
- onTransition: (from, to) => {
172
- console.log(` >> ${from} -> ${to}`);
173
- },
174
- });
175
-
176
- // Subscribe to events
177
- engine.on('step:error', (event) => {
178
- console.log(` !! Error in step: ${event.data.step}`);
179
- });
180
-
181
- // Run the flow
182
- const result = await engine.run({
183
- user_message: 'Explain quantum computing in simple terms',
184
- conversation_history: [],
185
- });
186
-
187
- console.log('\n=== Flow Complete ===');
188
- console.log('Status:', result.status);
189
- console.log('Intent:', result.intent);
190
- console.log('Final Response:', result.data.ai_response);
191
- console.log('Steps taken:', result.stepHistory.length);
192
- console.log('Duration:', result.durationMs, 'ms');
193
- }
194
-
195
- main().catch(console.error);
@@ -1,101 +0,0 @@
1
- /**
2
- * Node.js Example: Simple Greeting Flow
3
- *
4
- * Demonstrates basic usage with file-based persistence.
5
- *
6
- * Run with: npx ts-node examples/npm-libs/node/simple-greeting.ts
7
- * Or after build: node examples/npm-libs/node/simple-greeting.js
8
- */
9
-
10
- import { createEngine, loadFlow, FileStore } from '../../src/index.js';
11
- import type { StepInput, StepContext, StepResult } from '../../src/index.js';
12
- import { fileURLToPath } from 'url';
13
- import { dirname, join } from 'path';
14
-
15
- const __filename = fileURLToPath(import.meta.url);
16
- const __dirname = dirname(__filename);
17
-
18
- // Define step handlers as pure functions
19
- const handlers = {
20
- async greet(input: StepInput, ctx: StepContext): Promise<StepResult> {
21
- const userName = (input.initial_name as string) || 'World';
22
-
23
- console.log(`[${ctx.stepName}] Generating greeting for: ${userName}`);
24
-
25
- return {
26
- result: 'success',
27
- data: {
28
- greeting: 'Hello',
29
- user_name: userName,
30
- },
31
- };
32
- },
33
-
34
- async validate(input: StepInput, ctx: StepContext): Promise<StepResult> {
35
- const { greeting, user_name } = input;
36
-
37
- console.log(`[${ctx.stepName}] Validating: ${greeting} ${user_name}`);
38
-
39
- const isValid = typeof greeting === 'string' &&
40
- greeting.length > 0 &&
41
- typeof user_name === 'string';
42
-
43
- if (!isValid) {
44
- return { result: 'invalid', data: { is_valid: false } };
45
- }
46
-
47
- return {
48
- result: 'success',
49
- data: { is_valid: true },
50
- };
51
- },
52
-
53
- async personalize(input: StepInput, ctx: StepContext): Promise<StepResult> {
54
- const { greeting, user_name } = input;
55
-
56
- const finalMessage = `${greeting}, ${user_name}! Welcome to yaml-flow.`;
57
-
58
- console.log(`[${ctx.stepName}] Created message: ${finalMessage}`);
59
-
60
- return {
61
- result: 'success',
62
- data: { final_message: finalMessage },
63
- };
64
- },
65
- };
66
-
67
- async function main() {
68
- // Load flow from YAML file
69
- const flowPath = join(__dirname, '../flows/simple-greeting.yaml');
70
- const flow = await loadFlow(flowPath);
71
-
72
- console.log('Loaded flow:', flow.id ?? 'simple-greeting');
73
- console.log('Steps:', Object.keys(flow.steps).join(', '));
74
- console.log('---');
75
-
76
- // Create engine with file-based persistence
77
- const engine = createEngine(flow, handlers, {
78
- store: new FileStore({ directory: './flow-data' }),
79
- onStep: (step, result) => {
80
- console.log(`Step completed: ${step} -> ${result.result}`);
81
- },
82
- onTransition: (from, to) => {
83
- console.log(`Transition: ${from} -> ${to}`);
84
- },
85
- });
86
-
87
- // Run the flow
88
- const result = await engine.run({
89
- initial_name: 'Developer',
90
- });
91
-
92
- console.log('---');
93
- console.log('Flow Result:');
94
- console.log(' Status:', result.status);
95
- console.log(' Intent:', result.intent);
96
- console.log(' Data:', result.data);
97
- console.log(' Steps:', result.stepHistory.join(' -> '));
98
- console.log(' Duration:', result.durationMs, 'ms');
99
- }
100
-
101
- main().catch(console.error);
@@ -1,22 +0,0 @@
1
- {
2
- "id": "holdings-table",
3
- "meta": { "title": "Holdings Table" },
4
- "requires": ["holdings", "prices"],
5
- "provides": [{ "bindTo": "table", "ref": "computed_values.table" }],
6
- "card_data": {},
7
- "compute": [
8
- {
9
- "bindTo": "table",
10
- "expr": "{ \"rows\": $map(requires.holdings, function($h) { { \"symbol\": $h.symbol, \"qty\": $h.qty, \"price\": $lookup(requires.prices, $h.symbol), \"value\": $h.qty * $lookup(requires.prices, $h.symbol) } }) }"
11
- }
12
- ],
13
- "view": {
14
- "elements": [
15
- {
16
- "kind": "table",
17
- "label": "Portfolio Positions",
18
- "data": { "bind": "computed_values.table.rows", "columns": ["symbol", "qty", "price", "value"] }
19
- }
20
- ]
21
- }
22
- }
@@ -1,43 +0,0 @@
1
- {
2
- "id": "portfolio-form",
3
- "meta": {
4
- "title": "Portfolio Holdings Form"
5
- },
6
- "provides": [
7
- {
8
- "bindTo": "holdings",
9
- "ref": "card_data.holdings"
10
- }
11
- ],
12
- "card_data": {
13
- "holdings": [
14
- {
15
- "symbol": "AAPL",
16
- "qty": 50
17
- },
18
- {
19
- "symbol": "MSFT",
20
- "qty": 30
21
- },
22
- {
23
- "symbol": "GOOG",
24
- "qty": 100
25
- }
26
- ]
27
- },
28
- "view": {
29
- "elements": [
30
- {
31
- "kind": "table",
32
- "label": "Holdings",
33
- "data": {
34
- "bind": "card_data.holdings",
35
- "columns": [
36
- "symbol",
37
- "qty"
38
- ]
39
- }
40
- }
41
- ]
42
- }
43
- }
@@ -1,15 +0,0 @@
1
- {
2
- "id": "portfolio-value",
3
- "meta": { "title": "Portfolio Total Value" },
4
- "requires": ["table"],
5
- "provides": [{ "bindTo": "totalValue", "ref": "computed_values.totalValue" }],
6
- "card_data": {},
7
- "compute": [
8
- { "bindTo": "totalValue", "expr": "$sum(requires.table.rows.value)" }
9
- ],
10
- "view": {
11
- "elements": [
12
- { "kind": "metric", "label": "Total Portfolio Value", "data": { "bind": "computed_values.totalValue" } }
13
- ]
14
- }
15
- }
@@ -1,15 +0,0 @@
1
- {
2
- "id": "price-fetch",
3
- "meta": { "title": "Fetch Market Prices" },
4
- "requires": ["holdings"],
5
- "provides": [{ "bindTo": "prices", "ref": "fetched_sources.prices" }],
6
- "card_data": {},
7
- "source_defs": [
8
- { "cli": "node ../fetch-prices.js --tmp-file-name tmp_file1", "bindTo": "prices", "outputFile": "prices.json" }
9
- ],
10
- "view": {
11
- "elements": [
12
- { "kind": "table", "label": "Market Prices", "data": { "bind": "fetched_sources.prices" } }
13
- ]
14
- }
15
- }
@@ -1,48 +0,0 @@
1
- /**
2
- * fetch-prices.js
3
- * Polls for tmp_file1 payload and outputs JSON to stdout once available.
4
- */
5
- import * as fs from 'node:fs';
6
- import * as path from 'node:path';
7
-
8
- function getArgValue(flagName) {
9
- const idx = process.argv.indexOf(flagName);
10
- if (idx < 0) return undefined;
11
- return process.argv[idx + 1];
12
- }
13
-
14
- const envBoardDir = (process.env.BOARD_DIR ?? '').trim();
15
- const tmpFileName = String(getArgValue('--tmp-file-name') ?? process.env.TMP_FILE_NAME ?? 'tmp_file1').trim();
16
- const tmpFilePath = envBoardDir ? path.join(envBoardDir, tmpFileName) : '';
17
-
18
- if (!tmpFilePath) {
19
- console.error('BOARD_DIR environment variable is required for fetch-prices.js');
20
- process.exit(1);
21
- }
22
-
23
- function getReadableTmpFile() {
24
- if (!fs.existsSync(tmpFilePath)) return undefined;
25
- const content = fs.readFileSync(tmpFilePath, 'utf-8').trim();
26
- if (!content) return undefined;
27
- return { tmpFile: tmpFilePath, content };
28
- }
29
-
30
- function waitForFile(timeoutMs = 120000) {
31
- const started = Date.now();
32
- const interval = setInterval(() => {
33
- if (Date.now() - started > timeoutMs) {
34
- clearInterval(interval);
35
- console.error('Timed out waiting for tmp_file1 market prices input.');
36
- process.exit(1);
37
- }
38
-
39
- const ready = getReadableTmpFile();
40
- if (!ready) return;
41
-
42
- clearInterval(interval);
43
- fs.writeFileSync(ready.tmpFile, '', 'utf-8');
44
- process.stdout.write(`${ready.content}\n`);
45
- }, 250);
46
- }
47
-
48
- waitForFile();