@nanobpm/nano-agent-graph-engine 0.0.0-stage → 0.18.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 (270) hide show
  1. package/.claude-plugin/marketplace.json +20 -0
  2. package/.claude-plugin/plugin.json +21 -0
  3. package/.mcp.json +8 -0
  4. package/README.md +526 -2
  5. package/dist/cli.js +55833 -0
  6. package/dist/explorer-app.html +196 -0
  7. package/dist/explorer.html +196 -0
  8. package/dist/guide.md +147 -0
  9. package/dist/index.js +1262 -0
  10. package/dist/layout-thread.js +12857 -0
  11. package/dist/nanobpmn_engine_bg.wasm +0 -0
  12. package/dist/step-thread.js +55 -0
  13. package/dist/typecheck/agent-graph-engine/agents.d.ts +120 -0
  14. package/dist/typecheck/agent-graph-engine/index.d.ts +124 -0
  15. package/dist/typecheck/agent-graph-engine/input.d.ts +57 -0
  16. package/dist/typecheck/agent-graph-engine/paths.d.ts +35 -0
  17. package/dist/typecheck/lib.decorators.d.ts +384 -0
  18. package/dist/typecheck/lib.decorators.legacy.d.ts +22 -0
  19. package/dist/typecheck/lib.es2015.collection.d.ts +147 -0
  20. package/dist/typecheck/lib.es2015.core.d.ts +597 -0
  21. package/dist/typecheck/lib.es2015.d.ts +28 -0
  22. package/dist/typecheck/lib.es2015.generator.d.ts +77 -0
  23. package/dist/typecheck/lib.es2015.iterable.d.ts +605 -0
  24. package/dist/typecheck/lib.es2015.promise.d.ts +81 -0
  25. package/dist/typecheck/lib.es2015.proxy.d.ts +128 -0
  26. package/dist/typecheck/lib.es2015.reflect.d.ts +144 -0
  27. package/dist/typecheck/lib.es2015.symbol.d.ts +46 -0
  28. package/dist/typecheck/lib.es2015.symbol.wellknown.d.ts +326 -0
  29. package/dist/typecheck/lib.es2016.array.include.d.ts +116 -0
  30. package/dist/typecheck/lib.es2016.d.ts +21 -0
  31. package/dist/typecheck/lib.es2016.full.d.ts +23 -0
  32. package/dist/typecheck/lib.es2016.intl.d.ts +31 -0
  33. package/dist/typecheck/lib.es2017.arraybuffer.d.ts +21 -0
  34. package/dist/typecheck/lib.es2017.d.ts +26 -0
  35. package/dist/typecheck/lib.es2017.date.d.ts +31 -0
  36. package/dist/typecheck/lib.es2017.full.d.ts +23 -0
  37. package/dist/typecheck/lib.es2017.intl.d.ts +44 -0
  38. package/dist/typecheck/lib.es2017.object.d.ts +49 -0
  39. package/dist/typecheck/lib.es2017.sharedmemory.d.ts +135 -0
  40. package/dist/typecheck/lib.es2017.string.d.ts +45 -0
  41. package/dist/typecheck/lib.es2017.typedarrays.d.ts +53 -0
  42. package/dist/typecheck/lib.es2018.asyncgenerator.d.ts +77 -0
  43. package/dist/typecheck/lib.es2018.asynciterable.d.ts +53 -0
  44. package/dist/typecheck/lib.es2018.d.ts +24 -0
  45. package/dist/typecheck/lib.es2018.full.d.ts +24 -0
  46. package/dist/typecheck/lib.es2018.intl.d.ts +83 -0
  47. package/dist/typecheck/lib.es2018.promise.d.ts +30 -0
  48. package/dist/typecheck/lib.es2018.regexp.d.ts +37 -0
  49. package/dist/typecheck/lib.es2019.array.d.ts +79 -0
  50. package/dist/typecheck/lib.es2019.d.ts +24 -0
  51. package/dist/typecheck/lib.es2019.full.d.ts +24 -0
  52. package/dist/typecheck/lib.es2019.intl.d.ts +23 -0
  53. package/dist/typecheck/lib.es2019.object.d.ts +33 -0
  54. package/dist/typecheck/lib.es2019.string.d.ts +37 -0
  55. package/dist/typecheck/lib.es2019.symbol.d.ts +24 -0
  56. package/dist/typecheck/lib.es2020.bigint.d.ts +765 -0
  57. package/dist/typecheck/lib.es2020.d.ts +27 -0
  58. package/dist/typecheck/lib.es2020.date.d.ts +42 -0
  59. package/dist/typecheck/lib.es2020.full.d.ts +24 -0
  60. package/dist/typecheck/lib.es2020.intl.d.ts +474 -0
  61. package/dist/typecheck/lib.es2020.number.d.ts +28 -0
  62. package/dist/typecheck/lib.es2020.promise.d.ts +47 -0
  63. package/dist/typecheck/lib.es2020.sharedmemory.d.ts +99 -0
  64. package/dist/typecheck/lib.es2020.string.d.ts +44 -0
  65. package/dist/typecheck/lib.es2020.symbol.wellknown.d.ts +41 -0
  66. package/dist/typecheck/lib.es2021.d.ts +23 -0
  67. package/dist/typecheck/lib.es2021.full.d.ts +24 -0
  68. package/dist/typecheck/lib.es2021.intl.d.ts +166 -0
  69. package/dist/typecheck/lib.es2021.promise.d.ts +48 -0
  70. package/dist/typecheck/lib.es2021.string.d.ts +33 -0
  71. package/dist/typecheck/lib.es2021.weakref.d.ts +78 -0
  72. package/dist/typecheck/lib.es2022.array.d.ts +121 -0
  73. package/dist/typecheck/lib.es2022.d.ts +25 -0
  74. package/dist/typecheck/lib.es2022.error.d.ts +75 -0
  75. package/dist/typecheck/lib.es2022.full.d.ts +24 -0
  76. package/dist/typecheck/lib.es2022.intl.d.ts +145 -0
  77. package/dist/typecheck/lib.es2022.object.d.ts +26 -0
  78. package/dist/typecheck/lib.es2022.regexp.d.ts +39 -0
  79. package/dist/typecheck/lib.es2022.string.d.ts +25 -0
  80. package/dist/typecheck/lib.es2023.array.d.ts +924 -0
  81. package/dist/typecheck/lib.es2023.collection.d.ts +21 -0
  82. package/dist/typecheck/lib.es2023.d.ts +22 -0
  83. package/dist/typecheck/lib.es2023.full.d.ts +24 -0
  84. package/dist/typecheck/lib.es2023.intl.d.ts +56 -0
  85. package/dist/typecheck/lib.es2024.arraybuffer.d.ts +65 -0
  86. package/dist/typecheck/lib.es2024.collection.d.ts +29 -0
  87. package/dist/typecheck/lib.es2024.d.ts +26 -0
  88. package/dist/typecheck/lib.es2024.full.d.ts +24 -0
  89. package/dist/typecheck/lib.es2024.object.d.ts +29 -0
  90. package/dist/typecheck/lib.es2024.promise.d.ts +35 -0
  91. package/dist/typecheck/lib.es2024.regexp.d.ts +25 -0
  92. package/dist/typecheck/lib.es2024.sharedmemory.d.ts +68 -0
  93. package/dist/typecheck/lib.es2024.string.d.ts +29 -0
  94. package/dist/typecheck/lib.es5.d.ts +4601 -0
  95. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/client.d.ts +169 -0
  96. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/declarative.d.ts +365 -0
  97. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/envelope.d.ts +77 -0
  98. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/imperative.d.ts +32 -0
  99. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/index.d.ts +14 -0
  100. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/io-mapping.d.ts +32 -0
  101. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/layout.d.ts +35 -0
  102. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/boundary.d.ts +63 -0
  103. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/branch.d.ts +11 -0
  104. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/break.d.ts +8 -0
  105. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/continue.d.ts +8 -0
  106. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/end.d.ts +40 -0
  107. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/forEach.d.ts +37 -0
  108. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/human.d.ts +44 -0
  109. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/index.d.ts +15 -0
  110. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/loop.d.ts +9 -0
  111. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/parallel.d.ts +9 -0
  112. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/race.d.ts +54 -0
  113. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/registry.d.ts +33 -0
  114. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/run.d.ts +12 -0
  115. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/signal.d.ts +11 -0
  116. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/switch.d.ts +11 -0
  117. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/task.d.ts +82 -0
  118. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/timer.d.ts +9 -0
  119. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/diff.d.ts +8 -0
  120. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/index.d.ts +8 -0
  121. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/normalize.d.ts +19 -0
  122. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/parity.d.ts +28 -0
  123. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/xml.d.ts +17 -0
  124. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/types.d.ts +146 -0
  125. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/worker.d.ts +92 -0
  126. package/dist/typecheck/node_modules/@nanobpm/workflow/dist/xml.d.ts +14 -0
  127. package/dist/typecheck/node_modules/@nanobpm/workflow/package.json +65 -0
  128. package/dist/typecheck/node_modules/@nanobpm/workflow/src/bpmn-auto-layout.d.ts +10 -0
  129. package/dist/typecheck/node_modules/@types/node/assert/strict.d.ts +68 -0
  130. package/dist/typecheck/node_modules/@types/node/assert.d.ts +1077 -0
  131. package/dist/typecheck/node_modules/@types/node/async_hooks.d.ts +711 -0
  132. package/dist/typecheck/node_modules/@types/node/buffer.buffer.d.ts +471 -0
  133. package/dist/typecheck/node_modules/@types/node/buffer.d.ts +1800 -0
  134. package/dist/typecheck/node_modules/@types/node/child_process.d.ts +1361 -0
  135. package/dist/typecheck/node_modules/@types/node/cluster.d.ts +432 -0
  136. package/dist/typecheck/node_modules/@types/node/console.d.ts +93 -0
  137. package/dist/typecheck/node_modules/@types/node/constants.d.ts +14 -0
  138. package/dist/typecheck/node_modules/@types/node/crypto.d.ts +3964 -0
  139. package/dist/typecheck/node_modules/@types/node/dgram.d.ts +652 -0
  140. package/dist/typecheck/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
  141. package/dist/typecheck/node_modules/@types/node/dns/promises.d.ts +497 -0
  142. package/dist/typecheck/node_modules/@types/node/dns.d.ts +876 -0
  143. package/dist/typecheck/node_modules/@types/node/domain.d.ts +150 -0
  144. package/dist/typecheck/node_modules/@types/node/events.d.ts +1008 -0
  145. package/dist/typecheck/node_modules/@types/node/ffi.d.ts +500 -0
  146. package/dist/typecheck/node_modules/@types/node/fs/promises.d.ts +1477 -0
  147. package/dist/typecheck/node_modules/@types/node/fs.d.ts +4803 -0
  148. package/dist/typecheck/node_modules/@types/node/globals.d.ts +150 -0
  149. package/dist/typecheck/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  150. package/dist/typecheck/node_modules/@types/node/http.d.ts +2218 -0
  151. package/dist/typecheck/node_modules/@types/node/http2.d.ts +2498 -0
  152. package/dist/typecheck/node_modules/@types/node/https.d.ts +400 -0
  153. package/dist/typecheck/node_modules/@types/node/index.d.ts +116 -0
  154. package/dist/typecheck/node_modules/@types/node/inspector/promises.d.ts +35 -0
  155. package/dist/typecheck/node_modules/@types/node/inspector.d.ts +265 -0
  156. package/dist/typecheck/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  157. package/dist/typecheck/node_modules/@types/node/module.d.ts +726 -0
  158. package/dist/typecheck/node_modules/@types/node/net.d.ts +1074 -0
  159. package/dist/typecheck/node_modules/@types/node/os.d.ts +498 -0
  160. package/dist/typecheck/node_modules/@types/node/package.json +140 -0
  161. package/dist/typecheck/node_modules/@types/node/path/posix.d.ts +8 -0
  162. package/dist/typecheck/node_modules/@types/node/path/win32.d.ts +8 -0
  163. package/dist/typecheck/node_modules/@types/node/path.d.ts +178 -0
  164. package/dist/typecheck/node_modules/@types/node/perf_hooks.d.ts +617 -0
  165. package/dist/typecheck/node_modules/@types/node/process.d.ts +2269 -0
  166. package/dist/typecheck/node_modules/@types/node/punycode.d.ts +89 -0
  167. package/dist/typecheck/node_modules/@types/node/querystring.d.ts +139 -0
  168. package/dist/typecheck/node_modules/@types/node/quic.d.ts +2191 -0
  169. package/dist/typecheck/node_modules/@types/node/readline/promises.d.ts +158 -0
  170. package/dist/typecheck/node_modules/@types/node/readline.d.ts +508 -0
  171. package/dist/typecheck/node_modules/@types/node/repl.d.ts +420 -0
  172. package/dist/typecheck/node_modules/@types/node/sea.d.ts +47 -0
  173. package/dist/typecheck/node_modules/@types/node/sqlite.d.ts +1140 -0
  174. package/dist/typecheck/node_modules/@types/node/stream/consumers.d.ts +114 -0
  175. package/dist/typecheck/node_modules/@types/node/stream/iter.d.ts +449 -0
  176. package/dist/typecheck/node_modules/@types/node/stream/promises.d.ts +211 -0
  177. package/dist/typecheck/node_modules/@types/node/stream/web.d.ts +320 -0
  178. package/dist/typecheck/node_modules/@types/node/stream.d.ts +1806 -0
  179. package/dist/typecheck/node_modules/@types/node/string_decoder.d.ts +27 -0
  180. package/dist/typecheck/node_modules/@types/node/test/reporters.d.ts +60 -0
  181. package/dist/typecheck/node_modules/@types/node/test.d.ts +2558 -0
  182. package/dist/typecheck/node_modules/@types/node/timers/promises.d.ts +93 -0
  183. package/dist/typecheck/node_modules/@types/node/timers.d.ts +149 -0
  184. package/dist/typecheck/node_modules/@types/node/tls.d.ts +1232 -0
  185. package/dist/typecheck/node_modules/@types/node/trace_events.d.ts +103 -0
  186. package/dist/typecheck/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +467 -0
  187. package/dist/typecheck/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  188. package/dist/typecheck/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  189. package/dist/typecheck/node_modules/@types/node/ts5.6/index.d.ts +118 -0
  190. package/dist/typecheck/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  191. package/dist/typecheck/node_modules/@types/node/ts5.7/index.d.ts +118 -0
  192. package/dist/typecheck/node_modules/@types/node/tty.d.ts +226 -0
  193. package/dist/typecheck/node_modules/@types/node/url.d.ts +556 -0
  194. package/dist/typecheck/node_modules/@types/node/util/types.d.ts +558 -0
  195. package/dist/typecheck/node_modules/@types/node/util.d.ts +1680 -0
  196. package/dist/typecheck/node_modules/@types/node/v8.d.ts +1059 -0
  197. package/dist/typecheck/node_modules/@types/node/vfs.d.ts +211 -0
  198. package/dist/typecheck/node_modules/@types/node/vm.d.ts +1137 -0
  199. package/dist/typecheck/node_modules/@types/node/wasi.d.ts +131 -0
  200. package/dist/typecheck/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  201. package/dist/typecheck/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  202. package/dist/typecheck/node_modules/@types/node/web-globals/console.d.ts +9 -0
  203. package/dist/typecheck/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  204. package/dist/typecheck/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
  205. package/dist/typecheck/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  206. package/dist/typecheck/node_modules/@types/node/web-globals/events.d.ts +106 -0
  207. package/dist/typecheck/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  208. package/dist/typecheck/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  209. package/dist/typecheck/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  210. package/dist/typecheck/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  211. package/dist/typecheck/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  212. package/dist/typecheck/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  213. package/dist/typecheck/node_modules/@types/node/web-globals/streams.d.ts +119 -0
  214. package/dist/typecheck/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  215. package/dist/typecheck/node_modules/@types/node/web-globals/url.d.ts +24 -0
  216. package/dist/typecheck/node_modules/@types/node/worker_threads.d.ts +672 -0
  217. package/dist/typecheck/node_modules/@types/node/zlib/iter.d.ts +131 -0
  218. package/dist/typecheck/node_modules/@types/node/zlib.d.ts +1364 -0
  219. package/dist/typecheck/node_modules/undici-types/agent.d.ts +30 -0
  220. package/dist/typecheck/node_modules/undici-types/api.d.ts +43 -0
  221. package/dist/typecheck/node_modules/undici-types/balanced-pool.d.ts +30 -0
  222. package/dist/typecheck/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  223. package/dist/typecheck/node_modules/undici-types/cache.d.ts +36 -0
  224. package/dist/typecheck/node_modules/undici-types/client-stats.d.ts +15 -0
  225. package/dist/typecheck/node_modules/undici-types/client.d.ts +134 -0
  226. package/dist/typecheck/node_modules/undici-types/connector.d.ts +37 -0
  227. package/dist/typecheck/node_modules/undici-types/content-type.d.ts +21 -0
  228. package/dist/typecheck/node_modules/undici-types/cookies.d.ts +30 -0
  229. package/dist/typecheck/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  230. package/dist/typecheck/node_modules/undici-types/dispatcher.d.ts +253 -0
  231. package/dist/typecheck/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
  232. package/dist/typecheck/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  233. package/dist/typecheck/node_modules/undici-types/errors.d.ts +187 -0
  234. package/dist/typecheck/node_modules/undici-types/eventsource.d.ts +66 -0
  235. package/dist/typecheck/node_modules/undici-types/fetch.d.ts +235 -0
  236. package/dist/typecheck/node_modules/undici-types/formdata.d.ts +108 -0
  237. package/dist/typecheck/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  238. package/dist/typecheck/node_modules/undici-types/global-origin.d.ts +7 -0
  239. package/dist/typecheck/node_modules/undici-types/h2c-client.d.ts +73 -0
  240. package/dist/typecheck/node_modules/undici-types/handlers.d.ts +16 -0
  241. package/dist/typecheck/node_modules/undici-types/header.d.ts +165 -0
  242. package/dist/typecheck/node_modules/undici-types/index.d.ts +93 -0
  243. package/dist/typecheck/node_modules/undici-types/interceptors.d.ts +80 -0
  244. package/dist/typecheck/node_modules/undici-types/mock-agent.d.ts +68 -0
  245. package/dist/typecheck/node_modules/undici-types/mock-call-history.d.ts +111 -0
  246. package/dist/typecheck/node_modules/undici-types/mock-client.d.ts +27 -0
  247. package/dist/typecheck/node_modules/undici-types/mock-errors.d.ts +12 -0
  248. package/dist/typecheck/node_modules/undici-types/mock-interceptor.d.ts +98 -0
  249. package/dist/typecheck/node_modules/undici-types/mock-pool.d.ts +27 -0
  250. package/dist/typecheck/node_modules/undici-types/package.json +55 -0
  251. package/dist/typecheck/node_modules/undici-types/patch.d.ts +29 -0
  252. package/dist/typecheck/node_modules/undici-types/pool-stats.d.ts +19 -0
  253. package/dist/typecheck/node_modules/undici-types/pool.d.ts +39 -0
  254. package/dist/typecheck/node_modules/undici-types/proxy-agent.d.ts +36 -0
  255. package/dist/typecheck/node_modules/undici-types/readable.d.ts +68 -0
  256. package/dist/typecheck/node_modules/undici-types/retry-agent.d.ts +8 -0
  257. package/dist/typecheck/node_modules/undici-types/retry-handler.d.ts +125 -0
  258. package/dist/typecheck/node_modules/undici-types/round-robin-pool.d.ts +39 -0
  259. package/dist/typecheck/node_modules/undici-types/snapshot-agent.d.ts +113 -0
  260. package/dist/typecheck/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  261. package/dist/typecheck/node_modules/undici-types/util.d.ts +18 -0
  262. package/dist/typecheck/node_modules/undici-types/utility.d.ts +7 -0
  263. package/dist/typecheck/node_modules/undici-types/webidl.d.ts +346 -0
  264. package/dist/typecheck/node_modules/undici-types/websocket.d.ts +188 -0
  265. package/dist/typecheck/ts.cjs +446 -0
  266. package/hooks/hooks.json +30 -0
  267. package/hooks/mod.js +461 -0
  268. package/package.json +80 -4
  269. package/skills/agent-graph/SKILL.md +47 -0
  270. package/skills/agent-graph-authoring/SKILL.md +147 -0
@@ -0,0 +1,32 @@
1
+ /** A single Zeebe I/O mapping entry — a FEEL `source` copied to/from a process
2
+ * variable `target`. */
3
+ export interface HumanIoEntry {
4
+ /** FEEL expression evaluated for the mapping (e.g. `=orderId`). */
5
+ source: string;
6
+ /** The process variable the value is written to. */
7
+ target: string;
8
+ }
9
+ /** A `<zeebe:ioMapping>`: input mappings applied on activation and output
10
+ * mappings applied on completion. */
11
+ export interface HumanIoMapping {
12
+ input?: HumanIoEntry[];
13
+ output?: HumanIoEntry[];
14
+ }
15
+ /** A present, non-empty, non-whitespace-only string — the shape every id /
16
+ * assignment / mapping-expression field must have. A blank value would emit a
17
+ * meaningless BPMN attribute (an empty ioMapping source/target, formId,
18
+ * assignee, …) that fails or misbehaves at deploy/run time, so we fail fast at
19
+ * build. Non-blank values are kept verbatim — FEEL expressions are never
20
+ * trimmed or normalized. */
21
+ export declare function isNonBlankString(v: unknown): v is string;
22
+ /** Validate an optional io mapping at authoring time. `label` is the node's
23
+ * self-description (e.g. `human("decide")` or `task("record")`) so the thrown
24
+ * message names the offending step. An `undefined` mapping is allowed (no
25
+ * ioMapping is emitted); a non-object / array value, or a malformed entry, fails
26
+ * fast. */
27
+ export declare function assertIoMapping(label: string, io: HumanIoMapping | undefined): void;
28
+ /** Emit a single `<zeebe:ioMapping>` (inputs then outputs) for the mapping, or
29
+ * the empty string when it has no entries. The 8-space element / 10-space entry
30
+ * indentation matches both the user-task and service-task emission, so a caller
31
+ * can splice the result straight into either `<bpmn:extensionElements>`. */
32
+ export declare function renderIoMapping(io: HumanIoMapping | undefined): string;
@@ -0,0 +1,35 @@
1
+ import type { DeclarativeFlow } from "./types.js";
2
+ /**
3
+ * Generate BPMN diagram interchange (DI) for a BPMN XML string using bpmn-io's
4
+ * `bpmn-auto-layout`, returning the same model with an auto-laid-out diagram
5
+ * (`bpmndi:BPMNDiagram`). Works on DI-less *or* already-laid-out input, and
6
+ * preserves `zeebe:` extension elements (task definitions, message
7
+ * subscriptions) through the round-trip.
8
+ *
9
+ * Requires the optional peer dependency `bpmn-auto-layout` to be installed; a
10
+ * clear error is thrown if it is missing.
11
+ */
12
+ export declare function layoutBpmn(bpmnXml: string): Promise<string>;
13
+ /**
14
+ * bpmn-auto-layout 2 draws a sub-process EXPANDED (its steps inline, on the
15
+ * main diagram) only when the input's own DI says `isExpanded="true"`; otherwise
16
+ * it collapses it onto a drill-down plane, which hides the steps — e.g. a
17
+ * multi-step `forEach` body — from anyone reading the diagram. A code-first
18
+ * model has no DI, so seed a minimal diagram that marks each embedded
19
+ * sub-process expanded (one plane per process). Input that already has a
20
+ * diagram is returned untouched: its expanded/collapsed choices are the author's.
21
+ * Only the `bpmn:` prefix our emitters write is recognised; other input passes
22
+ * through and lays out as before. Exported for tests only (not re-exported
23
+ * from the package index).
24
+ */
25
+ export declare function seedExpandedSubProcesses(bpmnXml: string): string;
26
+ /**
27
+ * Derive an executable BPMN model from a declarative flow AND auto-generate its
28
+ * diagram (DI), so the model opens rendered in a modeller/viewer. Convenience
29
+ * over `layoutBpmn(declarativeToBpmn(flow))`; async because layout is async. The
30
+ * semantic model stays authoritative — see `declarativeToBpmn` for the DI-less
31
+ * model the engine actually runs.
32
+ *
33
+ * Requires the optional peer dependency `bpmn-auto-layout` to be installed.
34
+ */
35
+ export declare function declarativeToLayoutedBpmn(flow: DeclarativeFlow): Promise<string>;
@@ -0,0 +1,63 @@
1
+ import type { Block } from "../declarative.js";
2
+ /** Options for `.boundary(...)`: an attached timer SLA on the preceding activity.
3
+ * - `timer` — the timeout: an ISO-8601 duration (`PT24H`, `P1DT6H`) or a FEEL
4
+ * `=`-expression (`=escalationSlaTimeout`); the duration need not be a literal.
5
+ * - `onTimeout` — the escalation body run when the timer elapses. By default its
6
+ * danglers converge with the activity's normal continuation; with
7
+ * `fireAndForget: true` the body is capped by an end event instead (see below).
8
+ * - `interrupting` — whether firing cancels the host activity. Defaults to
9
+ * `true` (an interrupting boundary; `cancelActivity` omitted, the BPMN default).
10
+ * Pass `false` for a non-interrupting boundary (`cancelActivity="false"`).
11
+ * - `fireAndForget` — when `true`, the `onTimeout` escalation body is a
12
+ * NON-CONVERGING escape path: its danglers terminate in a `<bpmn:endEvent>`
13
+ * rather than merging back into the host activity's continuation. This is the
14
+ * correct model for a non-interrupting reviewer nudge (an SLA side-effect that
15
+ * ends its own token and must NOT re-enter the reviewed activity). Defaults to
16
+ * `false` (the converging boundary). Typically paired with
17
+ * `interrupting: false`.
18
+ * - `name` — an optional label for the boundary event. */
19
+ export interface BoundaryOptions<C extends object = object> {
20
+ timer: string;
21
+ onTimeout: Block<C>;
22
+ interrupting?: boolean;
23
+ fireAndForget?: boolean;
24
+ name?: string;
25
+ }
26
+ declare module "../types.js" {
27
+ interface FlowNodeRegistry {
28
+ boundary: {
29
+ kind: "boundary";
30
+ /** The derived element id of the activity this boundary attaches to. */
31
+ attachedTo: string;
32
+ /** The timeout — an ISO-8601 duration or a FEEL `=`-expression. */
33
+ timer: string;
34
+ /** Whether firing cancels the host (interrupting). */
35
+ interrupting: boolean;
36
+ /** When true, the escalation body is capped by an end event and does NOT
37
+ * converge with the host activity's continuation (fire-and-forget). */
38
+ fireAndForget: boolean;
39
+ /** The escalation body wired from the boundary event's outgoing flow. */
40
+ onTimeout: FlowNode[];
41
+ /** Optional boundary-event label. */
42
+ label?: string;
43
+ };
44
+ }
45
+ }
46
+ declare module "../declarative.js" {
47
+ interface FlowBuilder<C extends object> {
48
+ /**
49
+ * Attach an interrupting timer boundary event (an SLA) to the PRECEDING
50
+ * activity (a `run`/`task`). When `timer` elapses, the activity is
51
+ * cancelled (for an interrupting boundary) and the token routes to the
52
+ * `onTimeout` escalation body; that body then converges with the activity's
53
+ * normal continuation. `timer` is an ISO-8601 duration or a FEEL
54
+ * `=`-expression. Chains as `w.run(...).boundary({ timer, onTimeout })`.
55
+ *
56
+ * Pass `fireAndForget: true` for a NON-CONVERGING escape path: the
57
+ * `onTimeout` body is capped by a `<bpmn:endEvent>` and contributes no
58
+ * danglers to the host continuation — the correct model for a
59
+ * non-interrupting reviewer nudge (typically with `interrupting: false`).
60
+ */
61
+ boundary(opts: BoundaryOptions<C>): FlowBuilder<C>;
62
+ }
63
+ }
@@ -0,0 +1,11 @@
1
+ declare module "../types.js" {
2
+ interface FlowNodeRegistry {
3
+ branch: {
4
+ kind: "branch";
5
+ condition: string;
6
+ then: FlowNode[];
7
+ else?: FlowNode[];
8
+ };
9
+ }
10
+ }
11
+ export {};
@@ -0,0 +1,8 @@
1
+ declare module "../types.js" {
2
+ interface FlowNodeRegistry {
3
+ break: {
4
+ kind: "break";
5
+ };
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,8 @@
1
+ declare module "../types.js" {
2
+ interface FlowNodeRegistry {
3
+ continue: {
4
+ kind: "continue";
5
+ };
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,40 @@
1
+ declare module "../types.js" {
2
+ interface FlowNodeRegistry {
3
+ /** `name` is the element id when given; otherwise one is generated at emit. */
4
+ end: {
5
+ kind: "end";
6
+ name?: string;
7
+ terminate: boolean;
8
+ };
9
+ }
10
+ }
11
+ /** Options for {@link FlowBuilder.end}. */
12
+ export interface EndOptions {
13
+ /** End the WHOLE instance, cancelling every other active path (parallel
14
+ * branches, waits, jobs), not just this one — a BPMN terminate end event.
15
+ * Inside a `forEach` body it ends that item's child only. Default `false`. */
16
+ terminate?: boolean;
17
+ }
18
+ declare module "../declarative.js" {
19
+ interface FlowBuilder<C extends object> {
20
+ /**
21
+ * End this path here (a BPMN end event). Nothing may follow it in the same
22
+ * block. Without `terminate`, only this token ends: other active paths keep
23
+ * running and the instance completes when the last one ends. With
24
+ * `{ terminate: true }`, the whole instance ends at once and every other
25
+ * active path is cancelled. `name` is the element id (optional; a generated
26
+ * `End_<n>` otherwise).
27
+ * ```ts
28
+ * w.switch("decision", {
29
+ * abandon: (b) => b.run("close-pr", closePr).end("abandoned", { terminate: true }),
30
+ * default: (b) => b.run("merge", merge),
31
+ * });
32
+ * ```
33
+ * A plain `end()` inside a `parallel` branch is rejected: the AND-join would
34
+ * wait for that branch forever. Use `{ terminate: true }` there.
35
+ */
36
+ end(name?: string, opts?: EndOptions): FlowBuilder<C>;
37
+ /** `w.end({ terminate: true })` — an unnamed end with options. */
38
+ end(opts: EndOptions): FlowBuilder<C>;
39
+ }
40
+ }
@@ -0,0 +1,37 @@
1
+ import type { FlowNode } from "../types.js";
2
+ /** The `forEach` node shape (its `FlowNode` variant). */
3
+ interface ForEachNode {
4
+ kind: "forEach";
5
+ /** FEEL expression evaluating to the list to fan out over. */
6
+ collection: string;
7
+ /** Variable each item is bound to in the child's scope (`inputElement`). */
8
+ itemVar: string;
9
+ body: FlowNode[];
10
+ /** Run children one at a time (sequential MI) instead of all at once. */
11
+ sequential?: boolean;
12
+ /** List variable that each child's `outputElement` is collected into. */
13
+ outputCollection?: string;
14
+ /** FEEL expression producing each child's contribution to `outputCollection`. */
15
+ outputElement?: string;
16
+ /** FEEL boolean that, once true, completes the body early. */
17
+ completionCondition?: string;
18
+ /** Label for the multi-step body's sub-process (what the box does, on the diagram). */
19
+ name?: string;
20
+ }
21
+ declare module "../types.js" {
22
+ interface FlowNodeRegistry {
23
+ forEach: ForEachNode;
24
+ }
25
+ }
26
+ /** `forEach` options — the single definition `FlowBuilder.forEach` uses too. */
27
+ export interface ForEachOpts {
28
+ /** Label the multi-step body's sub-process, e.g. "Review & challenge each file".
29
+ * A single-step body has no box of its own (the MI is lifted onto the step,
30
+ * which keeps its own name), so the label does not apply there. */
31
+ name?: string;
32
+ sequential?: boolean;
33
+ outputCollection?: string;
34
+ outputElement?: string;
35
+ completionCondition?: string;
36
+ }
37
+ export {};
@@ -0,0 +1,44 @@
1
+ import type { HumanIoMapping } from "../io-mapping.js";
2
+ export type { HumanIoEntry, HumanIoMapping } from "../io-mapping.js";
3
+ /** Options for {@link FlowBuilder.human}. `form` is the `zeebe:formDefinition`
4
+ * form id; `assignee` / `candidateGroups` populate a `zeebe:assignmentDefinition`
5
+ * (supply either or both); `io` populates a `zeebe:ioMapping`. */
6
+ export interface HumanOptions {
7
+ /** The `zeebe:formDefinition` form id bound to this task. */
8
+ form: string;
9
+ /** A single assignee (a static user id or a FEEL expression like
10
+ * `=escalationAssignee`). */
11
+ assignee?: string;
12
+ /** The candidate groups allowed to claim the task (a static group id or a FEEL
13
+ * expression). */
14
+ candidateGroups?: string;
15
+ /** Input/output variable mappings. */
16
+ io?: HumanIoMapping;
17
+ }
18
+ /** The `human` node shape (its `FlowNode` variant). */
19
+ interface HumanNode {
20
+ kind: "human";
21
+ name: string;
22
+ form: string;
23
+ assignee?: string;
24
+ candidateGroups?: string;
25
+ io?: HumanIoMapping;
26
+ }
27
+ declare module "../types.js" {
28
+ interface FlowNodeRegistry {
29
+ human: HumanNode;
30
+ }
31
+ }
32
+ declare module "../declarative.js" {
33
+ interface FlowBuilder<C extends object> {
34
+ /**
35
+ * A human-in-the-loop approval step (a BPMN `<bpmn:userTask>` with the Zeebe
36
+ * user-task marker). `opts.form` binds a `zeebe:formDefinition`; the optional
37
+ * `assignee` / `candidateGroups` populate a `zeebe:assignmentDefinition`
38
+ * (either or both), and `io` populates a `zeebe:ioMapping`. Resume it from a
39
+ * task list / the Zeebe user-task API; the token waits durably until the task
40
+ * is completed.
41
+ */
42
+ human<K extends string>(name: K, opts: HumanOptions): FlowBuilder<C>;
43
+ }
44
+ }
@@ -0,0 +1,15 @@
1
+ import "./boundary.js";
2
+ import "./branch.js";
3
+ import "./break.js";
4
+ import "./continue.js";
5
+ import "./end.js";
6
+ import "./forEach.js";
7
+ import "./human.js";
8
+ import "./loop.js";
9
+ import "./parallel.js";
10
+ import "./race.js";
11
+ import "./run.js";
12
+ import "./signal.js";
13
+ import "./switch.js";
14
+ import "./task.js";
15
+ import "./timer.js";
@@ -0,0 +1,9 @@
1
+ declare module "../types.js" {
2
+ interface FlowNodeRegistry {
3
+ loop: {
4
+ kind: "loop";
5
+ body: FlowNode[];
6
+ };
7
+ }
8
+ }
9
+ export {};
@@ -0,0 +1,9 @@
1
+ declare module "../types.js" {
2
+ interface FlowNodeRegistry {
3
+ parallel: {
4
+ kind: "parallel";
5
+ branches: FlowNode[][];
6
+ };
7
+ }
8
+ }
9
+ export {};
@@ -0,0 +1,54 @@
1
+ import type { FlowNode } from "../types.js";
2
+ import type { Block } from "../declarative.js";
3
+ /** One arm of a {@link FlowBuilder.race}: exactly one waited-for event — a
4
+ * `signal` (a message catch correlated on a process variable) OR a `timer` (a
5
+ * delay `{ after }` or an instant `{ at }`) — plus the `do` body that runs when
6
+ * that event wins the race. */
7
+ export type RaceArm = ({
8
+ signal: {
9
+ correlationKey: string;
10
+ };
11
+ } | {
12
+ timer: {
13
+ after: string;
14
+ } | {
15
+ at: string;
16
+ };
17
+ }) & {
18
+ do: Block;
19
+ };
20
+ /** A compiled race arm: its catch event (a `signal` or `timer` `FlowNode`, reused
21
+ * from the built-ins) and the body that runs when it wins. */
22
+ interface CompiledArm {
23
+ event: FlowNode;
24
+ body: FlowNode[];
25
+ }
26
+ declare module "../types.js" {
27
+ interface FlowNodeRegistry {
28
+ race: {
29
+ kind: "race";
30
+ arms: CompiledArm[];
31
+ };
32
+ }
33
+ }
34
+ declare module "../declarative.js" {
35
+ interface FlowBuilder<C extends object> {
36
+ /**
37
+ * A first-of event race — a BPMN event-based gateway. Each named arm waits on
38
+ * exactly one event: a `signal` (a durable message catch correlated on a
39
+ * process variable) or a `timer` (`{ after }` a delay, or `{ at }` an
40
+ * instant). The engine arms every catch at once; the FIRST to fire wins, its
41
+ * arm's `do` body runs, and the losing catch events are cancelled. Every arm's
42
+ * body converges on whatever follows the race.
43
+ *
44
+ * ```ts
45
+ * w.race({
46
+ * "review-ready": { signal: { correlationKey: "prKey" }, do: (b) => b.run("re-review", reReview) },
47
+ * "review-timeout": { timer: { after: "=reviewWaitTimeout" }, do: (b) => b.run("escalate", escalate) },
48
+ * });
49
+ * ```
50
+ */
51
+ race(arms: Record<string, RaceArm>): FlowBuilder<C>;
52
+ }
53
+ }
54
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { FlowNode } from "../types.js";
2
+ import type { BuildApi, BuilderMethod, Edge, EmitApi, LoopCtx } from "../declarative.js";
3
+ /** Recurse the tree walker into a node's nested bodies (see `walkNodes`). */
4
+ export type WalkRecurse = (body: FlowNode[]) => void;
5
+ /** The three handlers a flow-node kind contributes. `N` is the kind's own
6
+ * `FlowNode` variant (narrowed from the union by the registry key). */
7
+ export interface NodeKindHandlers<N extends FlowNode = FlowNode> {
8
+ /** Factory for the `FlowBuilder` method that appends this kind's node. Given
9
+ * the per-body {@link BuildApi}, returns the method installed on the builder
10
+ * as `w.<builderMethod ?? kind>`. Omit for a kind with no authoring method. */
11
+ build?: (api: BuildApi) => BuilderMethod;
12
+ /** The builder method name, when it differs from the kind (defaults to the
13
+ * kind). */
14
+ builderMethod?: string;
15
+ /** Depth-first recursion into the node's nested bodies. Omit for a leaf. */
16
+ walk?: (node: N, recurse: WalkRecurse) => void;
17
+ /** Emit this node into the BPMN graph, returning the outgoing (dangling)
18
+ * edges its continuation attaches to. */
19
+ emit: (node: N, incoming: Edge[], loop: LoopCtx | null, api: EmitApi) => Edge[];
20
+ }
21
+ /** Register the handlers for one flow-node kind. Called once, at module import
22
+ * time, from `src/nodes/<kind>.ts`. */
23
+ export declare function registerNodeKind<K extends FlowNode["kind"]>(kind: K, handlers: NodeKindHandlers<Extract<FlowNode, {
24
+ kind: K;
25
+ }>>): void;
26
+ /** The handlers registered for a kind, or `undefined` if none. */
27
+ export declare function nodeKind(kind: string): NodeKindHandlers | undefined;
28
+ /** The registered kind, or a thrown error naming the unknown kind — used by the
29
+ * emitter, which cannot proceed without a handler. */
30
+ export declare function requireNodeKind(kind: string): NodeKindHandlers;
31
+ /** Every registered kind + its handlers, in registration order. Used by
32
+ * `makeBuilder` to install each kind's builder method. */
33
+ export declare function eachNodeKind(): Iterable<[string, NodeKindHandlers]>;
@@ -0,0 +1,12 @@
1
+ import type { HumanIoMapping } from "../io-mapping.js";
2
+ declare module "../types.js" {
3
+ interface FlowNodeRegistry {
4
+ run: {
5
+ kind: "run";
6
+ name: string;
7
+ envelopes?: NodeEnvelopes;
8
+ io?: HumanIoMapping;
9
+ timeoutMs?: number;
10
+ };
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ import type { Envelope } from "../envelope.js";
2
+ declare module "../types.js" {
3
+ interface FlowNodeRegistry {
4
+ signal: {
5
+ kind: "signal";
6
+ name: string;
7
+ correlationKey: string;
8
+ payload?: Envelope;
9
+ };
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ declare module "../types.js" {
2
+ interface FlowNodeRegistry {
3
+ switch: {
4
+ kind: "switch";
5
+ subject: string;
6
+ cases: SwitchCase[];
7
+ default?: FlowNode[];
8
+ };
9
+ }
10
+ }
11
+ export {};
@@ -0,0 +1,82 @@
1
+ import type { HumanIoMapping } from "../io-mapping.js";
2
+ /** Binds an LLM prompt resource to an agent service task. Emits, alongside the
3
+ * task's `zeebe:taskDefinition` capability token, a
4
+ * `<zeebe:linkedResources><zeebe:linkedResource resourceId=… bindingType=…
5
+ * resourceType="GenericScript" linkName="prompt"/></zeebe:linkedResources>`
6
+ * extension — the shape the nano-workforce agent tasks use to attach a prompt
7
+ * script to the worker that services the job. */
8
+ export interface PromptBinding {
9
+ /** The `GenericScript` resource id bound as the prompt (the linkedResource
10
+ * `resourceId`, e.g. `"retro.md"`). Required and non-empty. */
11
+ resourceId: string;
12
+ /** The linkedResource `bindingType` — how the engine resolves the resource
13
+ * version at deploy time. Defaults to `"latest"`. */
14
+ bindingType?: string;
15
+ /** Optional prompt addendum: a FEEL expression (or literal) fed to the worker
16
+ * through a `<zeebe:ioMapping><zeebe:input source=… target="appendPrompt"/>`
17
+ * input, the convention the agent tasks use to append runtime context to the
18
+ * bound prompt. Omitted → no `ioMapping` is emitted. */
19
+ append?: string;
20
+ }
21
+ declare module "../types.js" {
22
+ interface FlowNodeRegistry {
23
+ task: {
24
+ kind: "task";
25
+ name: string;
26
+ envelopes?: NodeEnvelopes;
27
+ jobType?: string;
28
+ /** The agent prompt binding, when the task is an LLM-agent service task. */
29
+ prompt?: PromptBinding;
30
+ /** Whether the task is an AGENT service task, emitting the engine-native
31
+ * AgentTask marker `<zeebe:agentDefinition agentType="external" />`
32
+ * (issue #597). Resolved at authoring time: an explicit `agent` option
33
+ * wins, otherwise it is `true` exactly when a `prompt` is bound. */
34
+ agent?: boolean;
35
+ /** An explicit `<zeebe:ioMapping>` on the service task — arbitrary input
36
+ * (and output) variable mappings, using the shared ioMapping shape. When a
37
+ * `prompt.append` is ALSO present it is folded into this single mapping as
38
+ * an extra `appendPrompt` input (no duplicate `ioMapping` element). */
39
+ io?: HumanIoMapping;
40
+ };
41
+ }
42
+ }
43
+ declare module "../declarative.js" {
44
+ interface FlowBuilder<C extends object> {
45
+ /**
46
+ * An AGENT external service task: as `task`, but additionally binds an LLM
47
+ * `prompt` resource to the worker via a `zeebe:linkedResource`
48
+ * (`resourceType="GenericScript" linkName="prompt"`). Pair it with a
49
+ * `{ jobType }` capability token (e.g. `senior:retro`) so an agent pool
50
+ * services it. `prompt.append` (optional) feeds a FEEL expression to the
51
+ * worker through a `zeebe:ioMapping` `appendPrompt` input. `io` (optional)
52
+ * adds arbitrary input/output variable mappings to the SAME `zeebe:ioMapping`.
53
+ */
54
+ task<K extends string>(name: K, opts: {
55
+ jobType?: string;
56
+ prompt: PromptBinding;
57
+ agent?: boolean;
58
+ io?: HumanIoMapping;
59
+ }): FlowBuilder<C>;
60
+ /**
61
+ * A PROMPT-LESS agent external service task: as `task`, but `agent: true`
62
+ * emits the AgentTask marker `<zeebe:agentDefinition agentType="external" />`
63
+ * (the nano-workforce agent-task signal, issue #597) without binding a
64
+ * prompt resource — the worker is steered by its inputs alone.
65
+ */
66
+ task<K extends string>(name: K, opts: {
67
+ jobType?: string;
68
+ agent: boolean;
69
+ io?: HumanIoMapping;
70
+ }): FlowBuilder<C>;
71
+ }
72
+ }
73
+ /** Whether a `task` node carries an extension delta (agent marker, prompt
74
+ * binding, or io mapping) that only this module's emitter renders. The SINGLE
75
+ * predicate any other emitter (e.g. `forEach`'s single-task fast path) must
76
+ * consult before rendering the task shell itself, so a new delta can never be
77
+ * silently dropped by a bypass. */
78
+ export declare function hasTaskExtensions(node: {
79
+ agent?: boolean;
80
+ prompt?: PromptBinding;
81
+ io?: HumanIoMapping;
82
+ }): boolean;
@@ -0,0 +1,9 @@
1
+ declare module "../types.js" {
2
+ interface FlowNodeRegistry {
3
+ timer: {
4
+ kind: "timer";
5
+ name: string;
6
+ } & TimerAt;
7
+ }
8
+ }
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { CanonicalModel } from "./normalize.js";
2
+ /** True when two canonical models are structurally equal (all three multisets
3
+ * match). */
4
+ export declare function modelsEqual(expected: CanonicalModel, actual: CanonicalModel): boolean;
5
+ /** Render a legible red/green structural diff, or `""` when the two models are
6
+ * structurally equal. `-`/red is the `expected` (golden) side, `+`/green the
7
+ * `actual` (derived) side. */
8
+ export declare function diffModels(expected: CanonicalModel, actual: CanonicalModel): string;
@@ -0,0 +1,8 @@
1
+ export { normalize } from "./normalize.js";
2
+ export type { CanonicalModel } from "./normalize.js";
3
+ export { assertDerivationParity, deploySmoke } from "./parity.js";
4
+ export type { DerivedInput, DeploySmokeOptions, DeploySmokeResult } from "./parity.js";
5
+ export { diffModels, modelsEqual } from "./diff.js";
6
+ export { parseXml, localName } from "./xml.js";
7
+ export type { XmlElement } from "./xml.js";
8
+ export { isFlowBuilder, assemblyFailureMessage } from "../declarative.js";
@@ -0,0 +1,19 @@
1
+ /** The id-agnostic, order-agnostic semantic structure of a BPMN model. Two
2
+ * models are structurally equal iff their three multisets are equal. */
3
+ export interface CanonicalModel {
4
+ /** Semantic descriptor of every flow node (task/gateway/event/subProcess),
5
+ * sorted. Each carries its type, definition, and edge-degree signature. */
6
+ nodes: string[];
7
+ /** Every sequence flow as `«fromNode» =[tag]=> «toNode»`, plus structural
8
+ * attach (boundary→host) and containment (subProcess→child) edges, sorted. */
9
+ flows: string[];
10
+ /** The full semantic identity of every message a catch event subscribes to,
11
+ * sorted (deduped): the serialized `<bpmn:message>` definition — its name plus
12
+ * the `zeebe:subscription correlationKey` and any `zeebe:properties` envelope —
13
+ * so a differing correlation key or envelope is a structural difference. */
14
+ messages: string[];
15
+ }
16
+ /** Normalize a BPMN XML document to its canonical semantic model. Strips DI and
17
+ * canonicalizes ids, child ordering, and sequence-flow ids so only semantic
18
+ * structure remains. */
19
+ export declare function normalize(bpmnXml: string): CanonicalModel;
@@ -0,0 +1,28 @@
1
+ import { WorkflowClient } from "../client.js";
2
+ import type { DeclarativeFlow, DeployResult, Workflow } from "../types.js";
3
+ /** A derived flow, or the derived BPMN XML directly. */
4
+ export type DerivedInput = DeclarativeFlow | string;
5
+ /** Derive `derived`'s BPMN, normalize it and the golden at `goldenBpmnPath`, and
6
+ * assert structural equality. Throws with a legible structural diff on
7
+ * mismatch. Returns silently on parity. */
8
+ export declare function assertDerivationParity(derived: DerivedInput, goldenBpmnPath: string): void;
9
+ /** Options for {@link deploySmoke}. Supply a pre-built `client`, a `baseUrl`
10
+ * (a client is built for you), or rely on the `WORKFLOW_GATEWAY_URL` env var. */
11
+ export interface DeploySmokeOptions {
12
+ client?: WorkflowClient;
13
+ baseUrl?: string;
14
+ token?: string;
15
+ transport?: "auto" | "falcon" | "rest";
16
+ }
17
+ /** The outcome of a {@link deploySmoke}: either a completed deployment, or a
18
+ * skip because no engine was reachable. */
19
+ export interface DeploySmokeResult {
20
+ deployed: boolean;
21
+ skipped: boolean;
22
+ reason?: string;
23
+ result?: DeployResult;
24
+ }
25
+ /** Deploy `model` to the engine and assert the deployment is accepted. Resolves
26
+ * a skip (never throws) when no engine is reachable, so it is safe to call in
27
+ * unit-only CI; it throws only when a reachable engine REJECTS the model. */
28
+ export declare function deploySmoke(model: Workflow, opts?: DeploySmokeOptions): Promise<DeploySmokeResult>;
@@ -0,0 +1,17 @@
1
+ /** A parsed XML element. `attrs` preserves declared attributes (entity-decoded);
2
+ * `children` are child elements in document order; `text` is the concatenated
3
+ * direct text content (trimmed), used for elements like `conditionExpression`. */
4
+ export interface XmlElement {
5
+ /** The qualified name as written, e.g. `bpmn:serviceTask` or `process`. */
6
+ name: string;
7
+ attrs: Record<string, string>;
8
+ children: XmlElement[];
9
+ text: string;
10
+ }
11
+ /** The local (un-prefixed) name of an element or attribute. */
12
+ export declare function localName(qualified: string): string;
13
+ /** Parse an XML document into its root element. Throws on a malformed document
14
+ * (unbalanced tags, no root, or more than one top-level element). Comments,
15
+ * CDATA, the `<?xml?>` prolog and other processing instructions are handled;
16
+ * CDATA content contributes to `text`. */
17
+ export declare function parseXml(xml: string): XmlElement;