@makaio/framework 1.0.0-dev-1787670559522 → 1.0.0-dev-1787949057928

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 (527) hide show
  1. package/README.md +2 -0
  2. package/dist/.makaio-build.json +2 -2
  3. package/dist/{account-identity-DGpXd8h_.mjs → account-identity-B3vLwm9O.mjs} +1 -1
  4. package/dist/adapter-Dz1fX5Wa.mjs +1 -0
  5. package/dist/adapter-subsystem/index.d.mts +118 -76
  6. package/dist/adapter-subsystem/index.mjs +1 -1
  7. package/dist/adapters/claude/index.d.mts +5 -5
  8. package/dist/adapters/config/index.d.mts +1 -1
  9. package/dist/adapters/config/index.mjs +1 -1
  10. package/dist/adapters/index.d.mts +73 -53
  11. package/dist/adapters/index.mjs +6 -6
  12. package/dist/adapters/node.d.mts +1 -1
  13. package/dist/adapters/node.mjs +1 -1
  14. package/dist/adapters/stream-session/index.mjs +1 -1
  15. package/dist/{artifact-k3veR4Yx.mjs → artifact-Btbuib48.mjs} +1 -1
  16. package/dist/attach-error-Cb3GbeKe.mjs +1 -0
  17. package/dist/{auth-A1K_7q-8.mjs → auth-C6tVtaOX.mjs} +1 -1
  18. package/dist/{authority-state-bootstrap-YwtEImIB.mjs → authority-state-bootstrap-CLYus369.mjs} +1 -1
  19. package/dist/{automation-trigger-CuSdQwir.mjs → automation-trigger-ByjNlClm.mjs} +1 -1
  20. package/dist/bus/index.d.mts +22 -4
  21. package/dist/bus/index.mjs +1 -1
  22. package/dist/{bus-CqgrphNE.mjs → bus-D6NoBhIV.mjs} +1 -1
  23. package/dist/bus-UgFdHybD.mjs +1 -0
  24. package/dist/caller-owned-adapter-stub-C1M7FKrv.mjs +1 -0
  25. package/dist/{canonical-model-DJASlL4m.mjs → canonical-model-DXOvCaVg.mjs} +1 -1
  26. package/dist/capabilities-BUwuA7XX.mjs +1 -0
  27. package/dist/capability-j3NekkIu.mjs +1 -0
  28. package/dist/{client-BL5__WT0.mjs → client-BkznbdsO.mjs} +1 -1
  29. package/dist/clients/index.d.mts +1 -1
  30. package/dist/clients/index.mjs +1 -1
  31. package/dist/clients/managed-install.d.mts +1 -1
  32. package/dist/clients/managed-install.mjs +1 -1
  33. package/dist/code-execution/worker-entry.d.mts +21 -0
  34. package/dist/code-execution/worker-entry.mjs +1 -0
  35. package/dist/code-execution-Ckmn8OZu.mjs +1 -0
  36. package/dist/code-execution-CweDSWco.mjs +1 -0
  37. package/dist/code-execution-DqkQjKa1.mjs +1 -0
  38. package/dist/{compression-BbttSqm8.mjs → compression-CtgeVLpP.mjs} +1 -1
  39. package/dist/{config-namespace-CyzeLWSg.mjs → config-namespace-CjWvw8ij.mjs} +1 -1
  40. package/dist/{context-resolution-ya9TXKg-.d.mts → context-resolution-841T7jBI.d.mts} +1 -1
  41. package/dist/contracts/adapter/index.d.mts +3 -3
  42. package/dist/contracts/adapter/index.mjs +1 -1
  43. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  44. package/dist/contracts/artifact/index.d.mts +2 -2
  45. package/dist/contracts/artifact/index.mjs +1 -1
  46. package/dist/contracts/auth/index.d.mts +2 -2
  47. package/dist/contracts/auth/index.mjs +1 -1
  48. package/dist/contracts/automation-trigger/index.d.mts +3 -3
  49. package/dist/contracts/automation-trigger/index.mjs +1 -1
  50. package/dist/contracts/canonical-model/index.d.mts +1 -1
  51. package/dist/contracts/canonical-model/index.mjs +1 -1
  52. package/dist/contracts/capabilities/index.d.mts +1 -1
  53. package/dist/contracts/capabilities/index.mjs +1 -1
  54. package/dist/contracts/client/index.d.mts +2 -2
  55. package/dist/contracts/client/index.mjs +1 -1
  56. package/dist/contracts/code-execution/index.d.mts +2 -0
  57. package/dist/contracts/code-execution/index.mjs +1 -0
  58. package/dist/contracts/common/index.d.mts +1 -1
  59. package/dist/contracts/config/index.d.mts +1 -1
  60. package/dist/contracts/config/index.mjs +1 -1
  61. package/dist/contracts/extension/index.d.mts +5 -5
  62. package/dist/contracts/extension/index.mjs +1 -1
  63. package/dist/contracts/facet/index.d.mts +1 -1
  64. package/dist/contracts/facet/index.mjs +1 -1
  65. package/dist/contracts/harness/index.d.mts +1 -1
  66. package/dist/contracts/harness/index.mjs +1 -1
  67. package/dist/contracts/host/index.d.mts +1 -1
  68. package/dist/contracts/host/index.mjs +1 -1
  69. package/dist/contracts/index.d.mts +62 -52
  70. package/dist/contracts/index.mjs +1 -1
  71. package/dist/contracts/materialization/index.d.mts +3 -3
  72. package/dist/contracts/materialization/index.mjs +1 -1
  73. package/dist/contracts/model-registry/index.d.mts +1 -1
  74. package/dist/contracts/model-registry/index.mjs +1 -1
  75. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  76. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  77. package/dist/contracts/platform/index.d.mts +1 -1
  78. package/dist/contracts/platform/index.mjs +1 -1
  79. package/dist/contracts/provider/index.d.mts +2 -2
  80. package/dist/contracts/provider/index.mjs +1 -1
  81. package/dist/contracts/reaction/index.d.mts +1 -1
  82. package/dist/contracts/reaction/index.mjs +1 -1
  83. package/dist/contracts/session/index.d.mts +3 -3
  84. package/dist/contracts/session/index.mjs +1 -1
  85. package/dist/contracts/shared/index.d.mts +3 -3
  86. package/dist/contracts/shared/index.mjs +1 -1
  87. package/dist/contracts/skill/index.d.mts +1 -1
  88. package/dist/contracts/skill/index.mjs +1 -1
  89. package/dist/contracts/telemetry/index.d.mts +1 -1
  90. package/dist/contracts/telemetry/index.mjs +1 -1
  91. package/dist/contracts/timeout/index.d.mts +1 -1
  92. package/dist/contracts/timeout/index.mjs +1 -1
  93. package/dist/contracts/toast/index.mjs +1 -1
  94. package/dist/contracts/variant/index.d.mts +1 -1
  95. package/dist/contracts/variant/index.mjs +1 -1
  96. package/dist/contracts/worker-node/index.d.mts +1 -1
  97. package/dist/contracts/worker-node/index.mjs +1 -1
  98. package/dist/contracts/workflow/index.d.mts +2 -2
  99. package/dist/contracts/workflow/index.mjs +1 -1
  100. package/dist/{contribution-BB5bjx3f.d.mts → contribution-CUHLVLsT.d.mts} +2 -2
  101. package/dist/core/index.d.mts +25 -2
  102. package/dist/{definition-CDg-Jq1T.mjs → definition-BH4QLGLI.mjs} +1 -1
  103. package/dist/{definition-BYgHlmMw.d.mts → definition-DyGImhyi.d.mts} +1 -1
  104. package/dist/{detached-extension-handle-DKd17UB6.mjs → detached-extension-handle-D0aI0pJA.mjs} +1 -1
  105. package/dist/drizzle/0034_m_msha1388.sql +41 -0
  106. package/dist/drizzle/0035_m_mshgj6x7.sql +40 -0
  107. package/dist/drizzle/0036_m_msivwbgm.sql +1 -0
  108. package/dist/drizzle/0037_runtime_instance_incarnation_counter.sql +6 -0
  109. package/dist/drizzle/meta/_journal.json +28 -0
  110. package/dist/event-B8ELuk6k.mjs +1 -0
  111. package/dist/{execution-attempt-repository-DFyAnchJ.d.mts → execution-attempt-repository-BJ2W6wwx.d.mts} +1 -1
  112. package/dist/{execution-target-ByNwZh5-.mjs → execution-target-H0RWV7Py.mjs} +1 -1
  113. package/dist/{extension-DUmibvMk.mjs → extension-Bfkr2DBs.mjs} +1 -1
  114. package/dist/{extension-DMdmj9gi.mjs → extension-Cz39YNXy.mjs} +1 -1
  115. package/dist/{extension-discovery-Fhps4icD.d.mts → extension-discovery-Dhu3WplO.d.mts} +9 -1
  116. package/dist/{filesystem-service-FAtd9gWH.mjs → filesystem-service-CiUw0YN5.mjs} +1 -1
  117. package/dist/framework-packages-BHgul8Kl.mjs +1 -0
  118. package/dist/git/index.mjs +2 -2
  119. package/dist/{globby-BBLuT_vy.mjs → globby-QBDqstzq.mjs} +1 -1
  120. package/dist/handlers-BsHAFtye.mjs +57 -0
  121. package/dist/{harness-KxbWGL4I.mjs → harness-YQ2ewID9.mjs} +1 -1
  122. package/dist/{hook-responses-uCXAICTU.d.mts → hook-responses-9Ywsqzzq.d.mts} +1 -1
  123. package/dist/identity-OjRlG6dZ.mjs +1 -0
  124. package/dist/{index-CfiCJPP6.d.mts → index-B0VO0rAl.d.mts} +1 -1
  125. package/dist/{index-DI7-tIL3.d.mts → index-B0yMCJW8.d.mts} +39 -14
  126. package/dist/{index-CER64zYO.d.mts → index-B9io6JAL.d.mts} +15 -15
  127. package/dist/{index-CqQYgsbB.d.mts → index-BNzUyVwV.d.mts} +513 -170
  128. package/dist/{index-1UcQWrZy.d.mts → index-BUwDmh1I.d.mts} +142 -142
  129. package/dist/{index-CM75k-Ff.d.mts → index-BkbnC65b.d.mts} +189 -17
  130. package/dist/index-Bqk0pJBQ2.d.mts +138 -0
  131. package/dist/{index-C-JzEkqs.d.mts → index-C146Eq_J.d.mts} +535 -1801
  132. package/dist/{index-C__EQfKa.d.mts → index-CIEycZrt.d.mts} +1 -1
  133. package/dist/{index-DxYDRoDE2.d.mts → index-CMekqu_D.d.mts} +28 -8
  134. package/dist/{index-nydhGvXa.d.mts → index-CPRQ4dWX.d.mts} +0 -23
  135. package/dist/{index-BSQ30wYP.d.mts → index-CPi0UpRh.d.mts} +1 -1
  136. package/dist/{index-BtdK8HeH.d.mts → index-CVNbBtA-.d.mts} +72 -197
  137. package/dist/{index-BMVZs6pm.d.mts → index-CYjgoYeX.d.mts} +3 -3
  138. package/dist/{index-CSN_0sCo.d.mts → index-CmwAJ8-5.d.mts} +1 -1
  139. package/dist/index-Cny5RvjO.d.mts +800 -0
  140. package/dist/{index-B0xJgTi-.d.mts → index-D8D-yibS2.d.mts} +4 -4
  141. package/dist/index-DHnSLGP4.d.mts +268 -0
  142. package/dist/index-DQ8o3JGi.d.mts +132 -0
  143. package/dist/index-DWBkiiXH.d.mts +18 -0
  144. package/dist/{index-cPqSpWQC.d.mts → index-DfUpqwBa2.d.mts} +16 -16
  145. package/dist/index-Dg11JxKZ.d.mts +496 -0
  146. package/dist/{index-Bl7KWFod.d.mts → index-NUByQvlg.d.mts} +15 -15
  147. package/dist/{index-e4Txan9i.d.mts → index-cLB38AWX.d.mts} +64 -64
  148. package/dist/json-value-BBZ6uGwc.mjs +1 -0
  149. package/dist/json-value-DPqb-SJ8.d.mts +177 -0
  150. package/dist/kernel/cli/index.d.mts +2 -2
  151. package/dist/kernel/cli/index.mjs +1 -1
  152. package/dist/kernel/cli/register.d.mts +1 -1
  153. package/dist/kernel/cli/register.mjs +1 -1
  154. package/dist/kernel/cli/schemas.mjs +1 -1
  155. package/dist/kernel/extension/index.d.mts +1 -1
  156. package/dist/kernel/extension/index.mjs +1 -1
  157. package/dist/kernel/index.d.mts +5 -5
  158. package/dist/kernel/index.mjs +1 -1
  159. package/dist/kernel/namespace/index.d.mts +1 -1
  160. package/dist/kernel/namespace/index.mjs +1 -1
  161. package/dist/kernel/observability/index.d.mts +1 -1
  162. package/dist/kernel/observability/index.mjs +1 -1
  163. package/dist/kernel/providers/index.d.mts +1 -1
  164. package/dist/kernel/providers/index.mjs +1 -1
  165. package/dist/kernel/window/index.d.mts +1 -1
  166. package/dist/kernel/window/index.mjs +1 -1
  167. package/dist/{lib-CnOAtohU.mjs → lib-BpGvHZye.mjs} +2 -2
  168. package/dist/{lib-B_rJ6r0T.mjs → lib-Cm-uEoC1.mjs} +1 -1
  169. package/dist/{load-extensions-DUpaMQ7G.d.mts → load-extensions-BQoXaHhR.d.mts} +1 -1
  170. package/dist/{load-extensions-CW9uzNR5.mjs → load-extensions-DG5LvPyM.mjs} +1 -1
  171. package/dist/{materialization-CcpCDhXh.mjs → materialization-lVd9_-jr.mjs} +1 -1
  172. package/dist/mcp-http-server/index.mjs +1 -1
  173. package/dist/model-DrzPt3ou.mjs +1 -0
  174. package/dist/{namespace-B7bntOB8.mjs → namespace-BL7lHlmg.mjs} +1 -1
  175. package/dist/{namespace-BgEiY7r1.d.mts → namespace-BNp7n_gu.d.mts} +3 -3
  176. package/dist/{namespace-DSlfFhB1.d.mts → namespace-BRuHzhPo.d.mts} +154 -2
  177. package/dist/{namespace-ChnRTUG4.d.mts → namespace-C06lJSuj.d.mts} +6 -6
  178. package/dist/{namespace-C6CVEGH8.d.mts → namespace-DknCutQZ.d.mts} +50 -0
  179. package/dist/namespace-sCPb79-7.mjs +1 -0
  180. package/dist/{native-session-supervisor-fZYPUk0-.mjs → native-session-supervisor-LKio8XZn.mjs} +1 -1
  181. package/dist/node/bus-server/index.d.mts +1 -1
  182. package/dist/node/bus-server/index.mjs +1 -1
  183. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  184. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  185. package/dist/npm-package-name-DuTYVICk.mjs +1 -0
  186. package/dist/orchestrator-shared-BGlN-m-V.mjs +1 -0
  187. package/dist/{orchestrator-shared-B-KRW1Z0.d.mts → orchestrator-shared-CNHSImNY.d.mts} +9 -10
  188. package/dist/ownership-memory-handler-BpGdR_uG.mjs +1 -0
  189. package/dist/ownership-recovery-guard-DyW5vGBr.mjs +1 -0
  190. package/dist/{package-ypz4rKvn.mjs → package-B01gmu75.mjs} +1 -1
  191. package/dist/{package-Bf3hyuzs.d.mts → package-BNFTUFLB.d.mts} +2 -2
  192. package/dist/package-DttKA9wN.mjs +1 -0
  193. package/dist/{package-CddkNbZI.mjs → package-JtjbO-Oi.mjs} +1 -1
  194. package/dist/package.json +1 -1
  195. package/dist/{profile-BtznZlq3.mjs → profile-N5qGUpF0.mjs} +1 -1
  196. package/dist/{provider-context-Dh-VOOYF.mjs → provider-context-CG42JlP9.mjs} +1 -1
  197. package/dist/{provider-context-BrLZYnDW.mjs → provider-context-zTDSH2x9.mjs} +1 -1
  198. package/dist/{reaction-BS0k4eNN.mjs → reaction-D3TNwPK8.mjs} +1 -1
  199. package/dist/{registry-BO_bOoky.mjs → registry-Dk12tAfv.mjs} +1 -1
  200. package/dist/{resolved-DMByz1_2.mjs → resolved-sq8RXNDf.mjs} +1 -1
  201. package/dist/rules/index.d.mts +1 -1
  202. package/dist/rules/index.mjs +1 -1
  203. package/dist/rules/schemas.d.mts +1 -1
  204. package/dist/rules/schemas.mjs +1 -1
  205. package/dist/runtime-bun/index.mjs +1 -1
  206. package/dist/runtime-node/code-execution/index.d.mts +3 -0
  207. package/dist/runtime-node/code-execution/index.mjs +1 -0
  208. package/dist/runtime-node/extension-discovery.d.mts +2 -2
  209. package/dist/runtime-node/extension-discovery.mjs +1 -1
  210. package/dist/runtime-node/extension-validation.d.mts +1 -1
  211. package/dist/runtime-node/extension-validation.mjs +1 -1
  212. package/dist/runtime-node/index.d.mts +6 -4
  213. package/dist/runtime-node/index.mjs +24 -24
  214. package/dist/runtime-node/makaio-config.d.mts +1 -1
  215. package/dist/runtime-node/makaio-config.mjs +1 -1
  216. package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
  217. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  218. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  219. package/dist/{schema-DKTzriEY.d.mts → schema-B3Pf7JP7.d.mts} +250 -3
  220. package/dist/{schema-DBG7Jq5_.mjs → schema-Dq-7si8u.mjs} +1 -1
  221. package/dist/{schemas-DvMbcABQ.d.mts → schemas-BAv9RB9M.d.mts} +4 -4
  222. package/dist/{schemas-DSkBOdx_.mjs → schemas-BfO5jkrL.mjs} +1 -1
  223. package/dist/{schemas-B7zo7Zcx.d.mts → schemas-C1mxTfd7.d.mts} +60 -4
  224. package/dist/schemas-C3kyQWGf.mjs +1 -0
  225. package/dist/{schemas-B3bfVYcL.d.mts → schemas-CF8QwRqt.d.mts} +2 -0
  226. package/dist/{schemas-DZH9lpxs.d.mts → schemas-OWvBn7AH.d.mts} +4 -4
  227. package/dist/{schemas-CsjN7cmM.mjs → schemas-QWDnauKX.mjs} +1 -1
  228. package/dist/schemas-TK29KWx-.mjs +1 -0
  229. package/dist/schemas-_2Syo_01.mjs +1 -0
  230. package/dist/scoped-bus-DoPmCJeM.mjs +1 -0
  231. package/dist/{selection-7Ku8DBnh.mjs → selection-DL3ric7K.mjs} +1 -1
  232. package/dist/services/adapter-runtime/index.d.mts +4 -4
  233. package/dist/services/adapter-runtime/index.mjs +1 -1
  234. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  235. package/dist/services/adapter-runtime/schemas.d.mts +2 -2
  236. package/dist/services/adapter-runtime/schemas.mjs +1 -1
  237. package/dist/services/adapter-subsystem/index.d.mts +3 -3
  238. package/dist/services/adapter-subsystem/index.mjs +1 -1
  239. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  240. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  241. package/dist/services/agent-runtime/index.d.mts +2 -2
  242. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  243. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  244. package/dist/services/automation-trigger/index.mjs +1 -1
  245. package/dist/services/capability/index.d.mts +3 -2
  246. package/dist/services/capability/index.mjs +1 -1
  247. package/dist/services/code-execution/index.d.mts +2 -0
  248. package/dist/services/code-execution/index.mjs +1 -0
  249. package/dist/services/codebase/index.d.mts +2 -2
  250. package/dist/services/codebase/namespace.d.mts +1 -1
  251. package/dist/services/codebase/schemas.d.mts +1 -1
  252. package/dist/services/compression/index.d.mts +2 -2
  253. package/dist/services/compression/namespace.d.mts +1 -1
  254. package/dist/services/compression/schemas.d.mts +1 -1
  255. package/dist/services/context-rules/index.d.mts +1 -1
  256. package/dist/services/context-rules/index.mjs +1 -1
  257. package/dist/services/execution-target/index.d.mts +3 -3
  258. package/dist/services/execution-target/index.mjs +1 -1
  259. package/dist/services/execution-target/namespace.d.mts +1 -1
  260. package/dist/services/execution-target/namespace.mjs +1 -1
  261. package/dist/services/execution-target/schemas.d.mts +1 -1
  262. package/dist/services/execution-target/schemas.mjs +1 -1
  263. package/dist/services/filesystem/index.d.mts +1 -1
  264. package/dist/services/filesystem/index.mjs +1 -1
  265. package/dist/services/filesystem/namespace.d.mts +6 -6
  266. package/dist/services/filesystem/schemas.d.mts +3 -3
  267. package/dist/services/git/namespace.d.mts +18 -0
  268. package/dist/services/git/namespace.mjs +1 -1
  269. package/dist/services/git/schemas.d.mts +10 -1
  270. package/dist/services/git/schemas.mjs +1 -1
  271. package/dist/services/harness/index.mjs +1 -1
  272. package/dist/services/index.d.mts +160 -60
  273. package/dist/services/index.mjs +1 -1
  274. package/dist/services/log-import/browser.d.mts +2 -2
  275. package/dist/services/log-import/index.d.mts +2 -2
  276. package/dist/services/log-import/log-import.d.mts +1 -1
  277. package/dist/services/log-import/log-import.mjs +1 -1
  278. package/dist/services/log-import/namespace.mjs +1 -1
  279. package/dist/services/log-import/schemas.mjs +1 -1
  280. package/dist/services/materialization/index.d.mts +1 -1
  281. package/dist/services/materialization/index.mjs +1 -1
  282. package/dist/services/model-registry/index.d.mts +1 -1
  283. package/dist/services/model-registry/index.mjs +1 -1
  284. package/dist/services/preferences/index.d.mts +2 -2
  285. package/dist/services/preferences/schemas.d.mts +1 -1
  286. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  287. package/dist/services/provider-context/index.d.mts +1 -1
  288. package/dist/services/provider-context/index.mjs +1 -1
  289. package/dist/services/provider-runtime/index.mjs +1 -1
  290. package/dist/services/session/handlers/index.d.mts +1 -1
  291. package/dist/services/session/handlers/index.mjs +1 -1
  292. package/dist/services/session/index.d.mts +10 -10
  293. package/dist/services/session/index.mjs +1 -1
  294. package/dist/services/session/messages/namespace.d.mts +1 -1
  295. package/dist/services/session/messages/namespace.mjs +1 -1
  296. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  297. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  298. package/dist/services/session/session-events/namespace.d.mts +1 -1
  299. package/dist/services/session/session-events/namespace.mjs +1 -1
  300. package/dist/services/session/storage/namespace.d.mts +1 -1
  301. package/dist/services/session/storage/schema.d.mts +2 -2
  302. package/dist/services/session/storage/schema.mjs +1 -1
  303. package/dist/services/session/testing/index.d.mts +22 -1
  304. package/dist/services/session/testing/index.mjs +38 -14
  305. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  306. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  307. package/dist/services/session/turns/namespace.d.mts +1 -1
  308. package/dist/services/session/turns/namespace.mjs +1 -1
  309. package/dist/services/session-editor/index.d.mts +1 -1
  310. package/dist/services/session-editor/index.mjs +1 -1
  311. package/dist/services/settings/index.d.mts +3 -3
  312. package/dist/services/settings/index.mjs +1 -1
  313. package/dist/services/settings/namespace.d.mts +4 -4
  314. package/dist/services/settings/namespace.mjs +1 -1
  315. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  316. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  317. package/dist/services/settings/storage/index.d.mts +3 -3
  318. package/dist/services/settings/storage/index.mjs +1 -1
  319. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  320. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  321. package/dist/services/subagent/index.d.mts +1 -1
  322. package/dist/services/subagent/index.mjs +1 -1
  323. package/dist/services/subagent-template/index.d.mts +2 -2
  324. package/dist/services/subagent-template/namespace.d.mts +1 -1
  325. package/dist/services/subagent-template/schemas.d.mts +1 -1
  326. package/dist/services/tool-approval/index.d.mts +1 -1
  327. package/dist/services/tool-approval/index.mjs +1 -1
  328. package/dist/services/tools/index.d.mts +1 -1
  329. package/dist/services/tools/index.mjs +1 -1
  330. package/dist/services/tray-menu/index.d.mts +3 -3
  331. package/dist/services/tray-menu/index.mjs +1 -1
  332. package/dist/services/tray-menu/namespace.d.mts +1 -1
  333. package/dist/services/tray-menu/schemas.d.mts +1 -1
  334. package/dist/services/turn/index.d.mts +1 -1
  335. package/dist/services/turn/namespace.d.mts +1 -1
  336. package/dist/services/workflow-transitions/index.d.mts +1 -1
  337. package/dist/services/workflow-transitions/index.mjs +1 -1
  338. package/dist/session-BOpTI79g.mjs +1 -0
  339. package/dist/session-CXOPk3yg.mjs +95 -0
  340. package/dist/{shared-BFVuCDPx.mjs → shared-B9AWRm9A.mjs} +1 -1
  341. package/dist/{skill-C1D51nhh.mjs → skill-DGNtc_ww.mjs} +1 -1
  342. package/dist/{src-xbmzokNe.mjs → src-BmSQ3rlz.mjs} +1 -1
  343. package/dist/storage/drizzle/client.d.mts +1 -1
  344. package/dist/storage/drizzle/client.mjs +1 -1
  345. package/dist/storage/drizzle/index.d.mts +41 -2
  346. package/dist/storage/drizzle/index.mjs +1 -1
  347. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  348. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  349. package/dist/storage/handlers/index.d.mts +1 -1
  350. package/dist/storage/handlers/index.mjs +1 -1
  351. package/dist/tool-approval-service-BFDOFUGC.mjs +1 -0
  352. package/dist/{tools-DxwHox1a.mjs → tools-DWKWX3eV.mjs} +1 -1
  353. package/dist/{transition-C_Ka6b0-.d.mts → transition-D3zUBTPc.d.mts} +6 -6
  354. package/dist/{types-BNjPhj_a.d.mts → types-CtDGkyLx2.d.mts} +1 -1
  355. package/dist/types-Cwza95hS.mjs +1 -0
  356. package/dist/{types-CwvN4uN2.d.mts → types-DcxBYlPA.d.mts} +3018 -38
  357. package/dist/types-DnK6Wa_Y.d.mts +260 -0
  358. package/dist/{types-ClpEaoAm.d.mts → types-OKJCOjme.d.mts} +24 -4
  359. package/dist/ui-kernel/index.d.mts +1 -1
  360. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  361. package/dist/utils/index.d.mts +22 -1
  362. package/dist/utils/index.mjs +2 -2
  363. package/dist/utils/project-manifest.mjs +1 -1
  364. package/dist/{version-BfNnVAGr.mjs → version-BYeVh1pI.mjs} +1 -1
  365. package/dist/{view-builder-KYsPqV-5.d.mts → view-builder-B0j9p5C0.d.mts} +4 -4
  366. package/dist/{visibility-Dl1o2I01.mjs → visibility-DtDLRBdr.mjs} +1 -1
  367. package/dist/worker-node-CjuQb9hl.mjs +1 -0
  368. package/dist/{worker-node-DJ41Tr-F.mjs → worker-node-Dtf9ilsR.mjs} +1 -1
  369. package/dist/workflow-C4mck_NW.mjs +1 -0
  370. package/dist/workflow-engine/execution-attempt-repository.d.mts +1 -1
  371. package/dist/workflow-engine/index.d.mts +88 -88
  372. package/dist/workflow-engine/index.mjs +1 -1
  373. package/dist/workflow-engine/package.d.mts +1 -1
  374. package/dist/workflow-engine/package.mjs +1 -1
  375. package/dist/workflow-engine/provider-operation.d.mts +1 -1
  376. package/dist/workflow-engine/testing/index.d.mts +2 -2
  377. package/dist/workflow-engine/testing/index.mjs +1 -1
  378. package/dist/workflow-engine/testing/sqlite.d.mts +1 -1
  379. package/dist/workflow-engine/testing/sqlite.mjs +1 -1
  380. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  381. package/dist/{workflow-transitions-DM0fN_eP.mjs → workflow-transitions-c_VQbyV0.mjs} +1 -1
  382. package/dist/workflow-worker-aNbdgqml.mjs +1 -0
  383. package/package.json +18 -1
  384. package/dist/adapter-BkdJaOOG.mjs +0 -1
  385. package/dist/agent-namespace-D51PODFf.mjs +0 -1
  386. package/dist/attach-error-BSlc7JfL.mjs +0 -1
  387. package/dist/bus-BIj0_aG6.mjs +0 -1
  388. package/dist/capabilities-Bqckjh7G.mjs +0 -1
  389. package/dist/capability-service-CJHNkjvm.mjs +0 -1
  390. package/dist/event-DR8U9Efx.mjs +0 -1
  391. package/dist/framework-packages-D_2hBZ-p.mjs +0 -1
  392. package/dist/handlers-2yd00VEq.mjs +0 -57
  393. package/dist/identity-DC3Pk0ps.mjs +0 -1
  394. package/dist/index-OsbtyMgx2.d.mts +0 -98
  395. package/dist/json-value-C1RGgS0a.d.mts +0 -72
  396. package/dist/json-value-D57aJhVn.mjs +0 -1
  397. package/dist/model-ZH3L1dPW.mjs +0 -1
  398. package/dist/namespace-CxrOLeeP.mjs +0 -1
  399. package/dist/orchestrator-shared-CTCZc6Vl.mjs +0 -1
  400. package/dist/ownership-memory-handler-Bblp93YC.mjs +0 -1
  401. package/dist/schemas-BqD8LlQw.mjs +0 -1
  402. package/dist/schemas-CvHFbzdy.mjs +0 -1
  403. package/dist/schemas-DplrlAyR.mjs +0 -1
  404. package/dist/scoped-bus-ClwTWqX8.mjs +0 -1
  405. package/dist/session-BMy2kRpX.mjs +0 -90
  406. package/dist/session-Cipx34j6.mjs +0 -1
  407. package/dist/tool-approval-service-BVgN9Q1r.mjs +0 -1
  408. package/dist/worker-node-BDOYPEpi.mjs +0 -1
  409. package/dist/workflow-Hzc5jlnV.mjs +0 -1
  410. package/dist/workflow-worker-DARC7UZl.mjs +0 -1
  411. /package/dist/{adapter-auth-runtime-D9Lnl7cc.mjs → adapter-auth-runtime-DHHppU4f.mjs} +0 -0
  412. /package/dist/{adapter-binding-B-FBoCys.d.mts → adapter-binding-CATvmGuz.d.mts} +0 -0
  413. /package/dist/{ajv-L5fKxaia.mjs → ajv-krzJXh1X.mjs} +0 -0
  414. /package/dist/{attempt-record-codec-DaFLKR5C.mjs → attempt-record-codec-BYfYkj4M.mjs} +0 -0
  415. /package/dist/{await-trigger-ph1S0zVI.mjs → await-trigger-Bkg2BQfg.mjs} +0 -0
  416. /package/dist/{base-orchestrator-D9u4NyiM.d.mts → base-orchestrator-B4YW6z_Q.d.mts} +0 -0
  417. /package/dist/{index-Ol9RBB0W2.d.mts → capability-service-BW1-teFU.d.mts} +0 -0
  418. /package/dist/{client-4ihewPUm.d.mts → client-BG0WX5Vz.d.mts} +0 -0
  419. /package/dist/{client-binary-version-verifier-DJajc_Ff.mjs → client-binary-version-verifier-0lCKZOTg.mjs} +0 -0
  420. /package/dist/{client-binary-version-verifier-jDDZ64Ah.d.mts → client-binary-version-verifier-lcv83Hq3.d.mts} +0 -0
  421. /package/dist/{clients-namespace-DFWuUawf.d.mts → clients-namespace-DLAjOTTb.d.mts} +0 -0
  422. /package/dist/{config-namespace-D1kyZj0B.d.mts → config-namespace-CH7sJZ4f.d.mts} +0 -0
  423. /package/dist/{create-static-mount-9tnGpIeK.mjs → create-static-mount-DxuixuLZ.mjs} +0 -0
  424. /package/dist/{cross-spawn-BIgueAqr.mjs → cross-spawn-CZygZJMH.mjs} +0 -0
  425. /package/dist/{cursor-storage-ROWfiTh1.mjs → cursor-storage-bsc9lZKk.mjs} +0 -0
  426. /package/dist/{definition-DB-kKc0d.d.mts → definition-BrgzUuFk.d.mts} +0 -0
  427. /package/dist/{definitions-CF6YmEhL.mjs → definitions-CRpdnHYM.mjs} +0 -0
  428. /package/dist/{descriptor-to-package-BecVCopf.mjs → descriptor-to-package-CcjdoWP4.mjs} +0 -0
  429. /package/dist/{drizzle-CPv3vdTE.mjs → drizzle-Bzc-OGVI.mjs} +0 -0
  430. /package/dist/{esm-CBFWM8u_.mjs → esm-i-S5TW72.mjs} +0 -0
  431. /package/dist/{extension-context-DzB7ydM3.d.mts → extension-context-QmFuHdq5.d.mts} +0 -0
  432. /package/dist/{extension-namespace-B554RmCp.mjs → extension-namespace-QoTTwKPt.mjs} +0 -0
  433. /package/dist/{extension-package-provenance-Dh_-Z-tE.mjs → extension-package-provenance-aYrZuS4W.mjs} +0 -0
  434. /package/dist/{facet-DVsW12iF.mjs → facet-BnMh7Jyc.mjs} +0 -0
  435. /package/dist/{filesystem-service-Cm2RHKBa.d.mts → filesystem-service-ZJ43SbBi.d.mts} +0 -0
  436. /package/dist/{handler-Bqlk-6BY.mjs → handler-DF1fVDpf.mjs} +0 -0
  437. /package/dist/{host-k5yoyKHg.mjs → host-B-_ntOMH.mjs} +0 -0
  438. /package/dist/{index--atUpi5l2.d.mts → index-8NdPPzUh2.d.mts} +0 -0
  439. /package/dist/{index-DwLRZscE.d.mts → index-8y4hT9WL.d.mts} +0 -0
  440. /package/dist/{index-C7HcDpHE.d.mts → index-B-3I98nw.d.mts} +0 -0
  441. /package/dist/{index-BcvqDfcN.d.mts → index-B2Y1Wvbh.d.mts} +0 -0
  442. /package/dist/{index-BRCrFirq.d.mts → index-B4svZC6L.d.mts} +0 -0
  443. /package/dist/{index-CQuRTeRa.d.mts → index-B5dP8rj6.d.mts} +0 -0
  444. /package/dist/{index-CRmE88hi.d.mts → index-BC-6qNeo.d.mts} +0 -0
  445. /package/dist/{index-CxSSdIZz.d.mts → index-BFWvT0NG.d.mts} +0 -0
  446. /package/dist/{index-DP3o_13U.d.mts → index-BM56936c.d.mts} +0 -0
  447. /package/dist/{index-BVcQcphK.d.mts → index-BMRB9yhF.d.mts} +0 -0
  448. /package/dist/{index-bIe_57cL.d.mts → index-BTEJfzjE.d.mts} +0 -0
  449. /package/dist/{index-DgOfgjx3.d.mts → index-BfV8U4XX.d.mts} +0 -0
  450. /package/dist/{index-DBadVauL.d.mts → index-BmevAPME2.d.mts} +0 -0
  451. /package/dist/{index-OADt3xlS.d.mts → index-BuMsrli0.d.mts} +0 -0
  452. /package/dist/{index-BJAB-BW_.d.mts → index-C4V8Pmi4.d.mts} +0 -0
  453. /package/dist/{index-aoxdnhJ42.d.mts → index-CL0Jo1b92.d.mts} +0 -0
  454. /package/dist/{index-CvW9_SzR.d.mts → index-CVpaGijY.d.mts} +0 -0
  455. /package/dist/{index-E4SET1AA.d.mts → index-CmbkCxj-.d.mts} +0 -0
  456. /package/dist/{index-BgGe9WZz.d.mts → index-CqdMbYmR.d.mts} +0 -0
  457. /package/dist/{index-BQprJNA_.d.mts → index-D037TVsm.d.mts} +0 -0
  458. /package/dist/{index-BeENojSx2.d.mts → index-DgspOUa72.d.mts} +0 -0
  459. /package/dist/{index-42UdYStR.d.mts → index-Ek4y8M9J2.d.mts} +0 -0
  460. /package/dist/{index-Beo_Ik8-.d.mts → index-VzLAV0Yt.d.mts} +0 -0
  461. /package/dist/{index-BSbGB23v.d.mts → index-jxPncqWZ2.d.mts} +0 -0
  462. /package/dist/{index-Bqm0ahTQ.d.mts → index-kzIjbrS02.d.mts} +0 -0
  463. /package/dist/{index-BJMezANn.d.mts → index-l01zsChf.d.mts} +0 -0
  464. /package/dist/{index-CK3f0bAL.d.mts → index-pvX-BIpr2.d.mts} +0 -0
  465. /package/dist/{jsonl-transport-Bp_6pB2a.mjs → jsonl-transport-Cyyh5Wje.mjs} +0 -0
  466. /package/dist/{lib-Bwdd2m81.mjs → lib-BqV8hYtk.mjs} +0 -0
  467. /package/dist/{model-registry-yURX738J.mjs → model-registry-C9rFu3kV.mjs} +0 -0
  468. /package/dist/{model-registry-Y854mUml.mjs → model-registry-Cixxx2jv.mjs} +0 -0
  469. /package/dist/{modes-DmUsjHdV.mjs → modes-DwsJ3yVl.mjs} +0 -0
  470. /package/dist/{namespace-ByP1Iipi.d.mts → namespace-B0ftHlK3.d.mts} +0 -0
  471. /package/dist/{namespace-C1D77w7U.d.mts → namespace-BGRHcrmp.d.mts} +0 -0
  472. /package/dist/{namespace-Bi3CmYQy.d.mts → namespace-BUYDmd0r.d.mts} +0 -0
  473. /package/dist/{namespace-CkBbNFSU.mjs → namespace-BW3Bfu9h.mjs} +0 -0
  474. /package/dist/{namespace-DX1Ec15L.d.mts → namespace-BdAK0lD8.d.mts} +0 -0
  475. /package/dist/{namespace-Dgg0uoe6.d.mts → namespace-CPG6u60N.d.mts} +0 -0
  476. /package/dist/{namespace-BusZERU8.d.mts → namespace-CVFaZv8x.d.mts} +0 -0
  477. /package/dist/{namespace-yREpGJgG.d.mts → namespace-DBO1OzYB.d.mts} +0 -0
  478. /package/dist/{namespace-CrDlawqu.d.mts → namespace-DOezqDti.d.mts} +0 -0
  479. /package/dist/{namespace-CfIW0hpQ.mjs → namespace-DiwqpB-c.mjs} +0 -0
  480. /package/dist/{namespace-s2y_NFKf.d.mts → namespace-DqZweTbX.d.mts} +0 -0
  481. /package/dist/{namespace-CFjdyNXG.mjs → namespace-Du0accdE.mjs} +0 -0
  482. /package/dist/{namespace-BFqkUTJp.mjs → namespace-NXm_zvL1.mjs} +0 -0
  483. /package/dist/{namespace-B9FEGuEu.mjs → namespace-jVTsuZHX.mjs} +0 -0
  484. /package/dist/{namespace-DwZwGXgF.d.mts → namespace-l-HG1rLF.d.mts} +0 -0
  485. /package/dist/{namespace-DbNWsPFY.mjs → namespace-tjoxekmf.mjs} +0 -0
  486. /package/dist/{out-DrhwCgqM.mjs → out-8bOYN6EF.mjs} +0 -0
  487. /package/dist/{package-CBdvjyyZ.mjs → package-EGTn-Ng1.mjs} +0 -0
  488. /package/dist/{packages-FBv3fAOR.mjs → packages-Bp124-gx.mjs} +0 -0
  489. /package/dist/{packages-N3-2Kl-Y.d.mts → packages-CxPMEg8D.d.mts} +0 -0
  490. /package/dist/{platform-BrsMv_S3.mjs → platform-CxyYPrkf.mjs} +0 -0
  491. /package/dist/{provider-operation-DJ_TLZFf.d.mts → provider-operation-DbdyFwNm.d.mts} +0 -0
  492. /package/dist/{providers-CCcn4Ndp.mjs → providers-C-eekMxD.mjs} +0 -0
  493. /package/dist/{providers-namespace-DeJBh6MP.d.mts → providers-namespace-CfZKp-C0.d.mts} +0 -0
  494. /package/dist/{quick-lru-uwB0hP-y.mjs → quick-lru-CCEnf7y6.mjs} +0 -0
  495. /package/dist/{schema-jIapW8Kb.mjs → schema-C0opCPww.mjs} +0 -0
  496. /package/dist/{schema-introspection-C1wvklj9.mjs → schema-introspection-6-r_KEJQ.mjs} +0 -0
  497. /package/dist/{schemas-CeUI2i5j.d.mts → schemas-B50oWBuj.d.mts} +0 -0
  498. /package/dist/{schemas-CD0wOQxx.d.mts → schemas-B6Q-qdmn.d.mts} +0 -0
  499. /package/dist/{schemas-DgwEVUt-.mjs → schemas-B8hKbBwI.mjs} +0 -0
  500. /package/dist/{schemas-sMoRnBdZ.d.mts → schemas-BGvkTiCx.d.mts} +0 -0
  501. /package/dist/{schemas-BNdiVBWh.mjs → schemas-BivbWRkG.mjs} +0 -0
  502. /package/dist/{schemas-Cg-Kwp8c.d.mts → schemas-ChmQldVH.d.mts} +0 -0
  503. /package/dist/{schemas-VbB1FTxx.d.mts → schemas-D7ScxLrf.d.mts} +0 -0
  504. /package/dist/{schemas-Cv3rR9Sz.d.mts → schemas-Pe892GgN.d.mts} +0 -0
  505. /package/dist/{schemas-qA279_j_.d.mts → schemas-bfZNpl0B.d.mts} +0 -0
  506. /package/dist/{schemas-mLpOfMoN.mjs → schemas-scyC2tFF.mjs} +0 -0
  507. /package/dist/{semver-DTXuyLcK.mjs → semver-BI7kTNsY.mjs} +0 -0
  508. /package/dist/{server-lifecycle-DKx_fWlq.mjs → server-lifecycle-B_OZnoe-.mjs} +0 -0
  509. /package/dist/{server-lifecycle-C_8iKgat.d.mts → server-lifecycle-L8zja8t8.d.mts} +0 -0
  510. /package/dist/{session-lineage-D5E142LU.d.mts → session-lineage-bUkd3fqx.d.mts} +0 -0
  511. /package/dist/{shared-schemas-aahW97QW.mjs → shared-schemas-CQ6blrEW.mjs} +0 -0
  512. /package/dist/{src-DHqsl5Pg.mjs → src-BacfeiI4.mjs} +0 -0
  513. /package/dist/{storage-namespace-Dz2jsssp.mjs → storage-namespace-BZce8kkW.mjs} +0 -0
  514. /package/dist/{storage-namespace-Tf3P5yJ5.d.mts → storage-namespace-YmE8XCCL.d.mts} +0 -0
  515. /package/dist/{storage-namespace-definition-CDef0E20.mjs → storage-namespace-definition-Cca-zwXU.mjs} +0 -0
  516. /package/dist/{supports-color-i7OTnKcZ.mjs → supports-color-SV_FgSN2.mjs} +0 -0
  517. /package/dist/{telemetry-BvCBUjFg.mjs → telemetry-BqoC87F-.mjs} +0 -0
  518. /package/dist/{timeout-B0nYjLc8.mjs → timeout-DVlN2Zhy.mjs} +0 -0
  519. /package/dist/{tray-menu-service-Deo6yyP8.mjs → tray-menu-service-eVVxgPLc.mjs} +0 -0
  520. /package/dist/{types-xCdGghb2.d.mts → types-BlB23n4f.d.mts} +0 -0
  521. /package/dist/{types-CNS55jvt.d.mts → types-DdpSEmTO.d.mts} +0 -0
  522. /package/dist/{types-Ce6LL25v.d.mts → types-tyv0B605.d.mts} +0 -0
  523. /package/dist/{ui-config-BIyGzMNL.mjs → ui-config-B35GloSX.mjs} +0 -0
  524. /package/dist/{variant-B4uWdxW7.mjs → variant-Dwnge3J_.mjs} +0 -0
  525. /package/dist/{window-registry-CoBJq3u4.mjs → window-registry-CKiMJjId.mjs} +0 -0
  526. /package/dist/{window-registry-BLtVx3Iw.d.mts → window-registry-Pcf35cac.d.mts} +0 -0
  527. /package/dist/{zod-json-schema-BAGAFfCN.mjs → zod-json-schema-Dixc-B1T.mjs} +0 -0
@@ -0,0 +1,260 @@
1
+ import { z } from "zod";
2
+ import { CodeExecutionFailedOutcomeCode, JsonValue } from "@makaio/framework/contracts";
3
+
4
+ //#region runtimes/node/src/code-execution/types.d.ts
5
+ /** Default maximum number of virtual files a submitted program may contain. */
6
+ declare const CODE_EXECUTION_DEFAULT_MAX_PROGRAM_FILES = 256;
7
+ /** Default maximum aggregate UTF-8 size of a submitted program's sources, in bytes (5 MiB). */
8
+ declare const CODE_EXECUTION_DEFAULT_MAX_SOURCE_BYTES: number;
9
+ /** Default maximum serialized JSON size of a handler result, in bytes (1 MiB). */
10
+ declare const CODE_EXECUTION_DEFAULT_MAX_RESULT_BYTES: number;
11
+ /**
12
+ * Default maximum serialized JSON size of an invocation's arguments, in bytes (1 MiB).
13
+ *
14
+ * The argument is the one part of a request no other budget measures, and it is
15
+ * retained for longer than any of them: a queued invocation holds it from
16
+ * admission until dispatch, and the pool then structured-clones it into the
17
+ * worker. Bounding it is what keeps a burst of large arguments from costing the
18
+ * host more than the configured concurrency implies.
19
+ *
20
+ * Matched to {@link CODE_EXECUTION_DEFAULT_MAX_RESULT_BYTES} deliberately: both
21
+ * bound one JSON value crossing the same thread boundary, in opposite
22
+ * directions, so a host that raises one usually means the pair.
23
+ */
24
+ declare const CODE_EXECUTION_DEFAULT_MAX_ARGUMENT_BYTES: number;
25
+ /** Default maximum number of concurrently executing worker threads. */
26
+ declare const CODE_EXECUTION_DEFAULT_MAX_CONCURRENCY = 4;
27
+ /**
28
+ * Default maximum number of invocations allowed to wait for an execution slot.
29
+ *
30
+ * Concurrency bounds what executes; this bounds what is *retained while
31
+ * waiting*. A queued invocation holds its whole request — up to
32
+ * {@link CODE_EXECUTION_DEFAULT_MAX_SOURCE_BYTES} of sources and
33
+ * {@link CODE_EXECUTION_DEFAULT_MAX_ARGUMENT_BYTES} of arguments — from arrival
34
+ * until dispatch, and its deadline is the caller's rather than the provider's,
35
+ * so an unbounded queue makes the host's retained memory a function of the
36
+ * arrival rate. Refusing past the cap keeps it a function of configuration.
37
+ *
38
+ * 16 is four times {@link CODE_EXECUTION_DEFAULT_MAX_CONCURRENCY}, so an
39
+ * ordinary burst still queues and is served rather than being refused, while
40
+ * the worst-case retained request set stays a small multiple of what the
41
+ * executing invocations already hold.
42
+ */
43
+ declare const CODE_EXECUTION_DEFAULT_MAX_QUEUED_INVOCATIONS = 16;
44
+ /** Default idle duration after which unused worker threads are reaped, in milliseconds. */
45
+ declare const CODE_EXECUTION_DEFAULT_IDLE_TIMEOUT_MS = 30000;
46
+ /**
47
+ * Default number of invocations a worker thread serves before it is retired.
48
+ *
49
+ * Every invocation adds a module graph to its worker's ESM module map, and Node
50
+ * never evicts one: the record is keyed by URL, and each invocation imports a
51
+ * freshly materialized program under a URL that has never been seen before. A
52
+ * worker that is never idle long enough to be reaped therefore grows without
53
+ * bound. Retiring it after a fixed number of invocations is what turns that
54
+ * into a bounded working set.
55
+ *
56
+ * 64 trades the two costs against each other: retirement pays one worker spawn
57
+ * and one TypeScript-loader bootstrap, which is worth amortizing, while the
58
+ * accumulated graphs of 64 bounded programs are not.
59
+ */
60
+ declare const CODE_EXECUTION_DEFAULT_MAX_INVOCATIONS_PER_WORKER = 64;
61
+ /**
62
+ * Composition options for the Piscina-backed CodeExecution provider.
63
+ *
64
+ * Every option is host-owned: the provider never derives capability, package
65
+ * availability, or environment from the submitted program.
66
+ */
67
+ interface PiscinaCodeExecutionProviderOptions {
68
+ /**
69
+ * Provider identifier, bounded by the public CodeExecution identifier limit.
70
+ * @defaultValue `'piscina-code-execution'`
71
+ */
72
+ readonly id?: string;
73
+ /** Human-readable provider name. @defaultValue `'Local (Piscina)'` */
74
+ readonly displayName?: string;
75
+ /** Selection priority among matching providers; higher wins. @defaultValue 0 */
76
+ readonly priority?: number;
77
+ /** Maximum concurrent worker threads. @defaultValue {@link CODE_EXECUTION_DEFAULT_MAX_CONCURRENCY} */
78
+ readonly maxConcurrency?: number;
79
+ /**
80
+ * Invocations allowed to wait for an execution slot before the provider
81
+ * refuses further work.
82
+ *
83
+ * {@link maxConcurrency} bounds what executes; this bounds what is retained
84
+ * while waiting. A queued invocation holds its sources and its arguments from
85
+ * arrival until dispatch, under the caller's deadline rather than the
86
+ * provider's, so without this bound a burst of valid requests would grow the
87
+ * host's retained memory with the arrival rate.
88
+ *
89
+ * An invocation that arrives at a full queue is refused immediately — it is
90
+ * never enqueued — and reported as `provider_unavailable`. Zero disables
91
+ * queueing entirely: only what fits into a free slot right away is admitted.
92
+ * @defaultValue {@link CODE_EXECUTION_DEFAULT_MAX_QUEUED_INVOCATIONS}
93
+ */
94
+ readonly maxQueuedInvocations?: number;
95
+ /**
96
+ * Idle duration before worker threads are reaped, in milliseconds.
97
+ * @defaultValue {@link CODE_EXECUTION_DEFAULT_IDLE_TIMEOUT_MS}
98
+ */
99
+ readonly idleTimeoutMs?: number;
100
+ /**
101
+ * Invocations a worker thread serves before it is retired and replaced.
102
+ *
103
+ * Idle reaping alone does not bound a worker's memory: a pool that is
104
+ * continuously busy never goes idle, and every invocation permanently adds a
105
+ * module graph to its worker's ESM module map. This bound is what makes the
106
+ * working set a function of the configured value rather than of uptime.
107
+ *
108
+ * Enforced as a strict upper bound per thread, and reached sooner when
109
+ * {@link maxConcurrency} is above one — a whole generation of workers is
110
+ * retired together once the *generation* has served this many invocations, so
111
+ * no thread in it can have served more.
112
+ * @defaultValue {@link CODE_EXECUTION_DEFAULT_MAX_INVOCATIONS_PER_WORKER}
113
+ */
114
+ readonly maxInvocationsPerWorker?: number;
115
+ /**
116
+ * Environment variables visible to worker threads.
117
+ *
118
+ * Defaults to an empty object rather than the host process environment, so
119
+ * host secrets are not handed to executed code by accident. Node built-ins
120
+ * and filesystem access stay available regardless — this provider runs
121
+ * trusted code only and the environment is not a sandbox.
122
+ *
123
+ * Configured values are stripped from diagnostics before those can reach a
124
+ * contract failure, but only above a minimum length: a value of three
125
+ * characters or fewer occurs in ordinary prose, so redacting it would mangle
126
+ * the diagnostic it is meant to protect. Such a value is therefore **not**
127
+ * redacted and can appear verbatim in a bus-bound message — do not place a
128
+ * secret in an environment value that short. The length is measured on the
129
+ * whitespace-collapsed value, which is the form diagnostics are matched in.
130
+ *
131
+ * The resolved worker entry's own loader variables are applied *after* these,
132
+ * so a value here that happens to name one of them does not take effect: that
133
+ * loader is what bounds which ordinary packages a submitted program resolves,
134
+ * and it is provider-owned rather than host-configurable.
135
+ */
136
+ readonly environment?: Readonly<Record<string, string>>;
137
+ /**
138
+ * Ordinary bare package names the program may import, mapped to absolute
139
+ * package root directories.
140
+ *
141
+ * These packages are linked into the materialized program, and a resolve
142
+ * guard in the worker rejects every *other* ordinary import — including one
143
+ * an ambient `node_modules` above the temporary program root would otherwise
144
+ * satisfy. So the map is the whole truth about which packages a program can
145
+ * reach by name, on any host.
146
+ *
147
+ * It bounds bare specifiers and nothing else. Node built-ins, absolute and
148
+ * `file:` specifiers, and direct filesystem access all remain available to
149
+ * the executed code, and a configured package's own dependencies resolve
150
+ * within that package as usual — configuring a package vouches for what it
151
+ * depends on. This is a resolution boundary, not an isolation boundary.
152
+ */
153
+ readonly packageRoots?: Readonly<Record<string, string>>;
154
+ /** Maximum number of virtual files per program. @defaultValue {@link CODE_EXECUTION_DEFAULT_MAX_PROGRAM_FILES} */
155
+ readonly maxProgramFiles?: number;
156
+ /**
157
+ * Maximum aggregate UTF-8 source size per program, in bytes.
158
+ * @defaultValue {@link CODE_EXECUTION_DEFAULT_MAX_SOURCE_BYTES}
159
+ */
160
+ readonly maxSourceBytes?: number;
161
+ /**
162
+ * Maximum serialized JSON size of a handler result, in bytes.
163
+ * @defaultValue {@link CODE_EXECUTION_DEFAULT_MAX_RESULT_BYTES}
164
+ */
165
+ readonly maxResultBytes?: number;
166
+ /**
167
+ * Maximum serialized JSON size of an invocation's arguments, in bytes.
168
+ *
169
+ * Enforced before the invocation waits for an admission slot, and reported as
170
+ * `invalid_program`: the argument is part of what was submitted, so an
171
+ * over-budget one is a rejected request rather than a provider fault.
172
+ * @defaultValue {@link CODE_EXECUTION_DEFAULT_MAX_ARGUMENT_BYTES}
173
+ */
174
+ readonly maxArgumentBytes?: number;
175
+ }
176
+ /**
177
+ * Structured-clone-safe task handed to the worker entry for one invocation.
178
+ *
179
+ * The task carries only resolved primitives and JSON values. TypeScript
180
+ * transpilation and module loading happen in the worker thread, so no
181
+ * program source and no live host object crosses the boundary.
182
+ */
183
+ interface CodeExecutionWorkerTask {
184
+ /**
185
+ * `file:` URL of the generated module that re-exports the program's entry namespace.
186
+ *
187
+ * Not the program's entry module itself. Importing that directly would let a
188
+ * program exporting a callable `then` hijack the import promise; see
189
+ * {@link CODE_EXECUTION_ENTRY_NAMESPACE_EXPORT}, which names the export this
190
+ * module carries the entry namespace on.
191
+ */
192
+ readonly entryNamespaceUrl: string;
193
+ /** `file:` URL used as the importing parent for the scoped import. */
194
+ readonly parentUrl: string;
195
+ /**
196
+ * `file:` URL prefixes identifying the modules the import allowlist applies to.
197
+ *
198
+ * Every spelling of the program root, each ending in a slash. Everything the
199
+ * worker resolves for its own module graph sits outside these prefixes and is
200
+ * therefore unaffected. More than one prefix is required because the module
201
+ * loader reports a module reached through a symlinked prefix by its real
202
+ * path, which is a different spelling of the same root.
203
+ */
204
+ readonly programRootUrls: readonly string[];
205
+ /**
206
+ * Ordinary bare package names the program is allowed to import.
207
+ *
208
+ * Carried per task rather than read from the worker's environment because the
209
+ * allowlist is a property of the host's composition, and the worker must be
210
+ * able to enforce it without knowing how the provider was configured. Node
211
+ * resolves a bare specifier by walking up from the importing module, so
212
+ * linking these packages into the program root is not by itself an
213
+ * allowlist — an ancestor `node_modules` would satisfy an unlisted import.
214
+ */
215
+ readonly allowedPackages: readonly string[];
216
+ /** Name of the export invoked on the entry module. */
217
+ readonly exportName: string;
218
+ /** JSON-safe value passed to the invoked export as its single argument. */
219
+ readonly arguments: JsonValue;
220
+ /** Per-invocation TypeScript loader namespace, isolating module caches between invocations. */
221
+ readonly namespace: string;
222
+ /** Maximum serialized JSON size of the handler result, in bytes. */
223
+ readonly maxResultBytes: number;
224
+ /**
225
+ * Values to strip from diagnostics before they leave the worker.
226
+ *
227
+ * Carries the materialized program paths for this invocation plus the
228
+ * host-configured values the provider knows are sensitive. Redacting in the
229
+ * worker as well as in the host keeps a long diagnostic from being truncated
230
+ * around a value the host would then no longer be able to match.
231
+ */
232
+ readonly redactedPaths: readonly string[];
233
+ }
234
+ /** Worker outcome for an invocation whose export returned a JSON-safe value the host revalidates after transfer. */
235
+ interface CodeExecutionWorkerCompletedOutcome {
236
+ /** Discriminant for a completed invocation. */
237
+ readonly kind: 'completed';
238
+ /** JSON-safe value validated by the worker and revalidated by the host after transfer. */
239
+ readonly value: JsonValue;
240
+ }
241
+ /** Worker outcome for an invocation that failed inside the worker thread. */
242
+ interface CodeExecutionWorkerFailedOutcome {
243
+ /** Discriminant for a failed invocation. */
244
+ readonly kind: 'failed';
245
+ /** Stable failure classification, already narrowed to a `failed` outcome code. */
246
+ readonly code: CodeExecutionFailedOutcomeCode;
247
+ /** Sanitized, bounded summary of what went wrong. */
248
+ readonly message: string;
249
+ }
250
+ /**
251
+ * Discriminated envelope the worker entry returns for every invocation.
252
+ *
253
+ * The worker resolves rather than rejects for expected failures so that only
254
+ * small, clone-safe values cross the thread boundary. Timeouts and
255
+ * cancellations are not represented here: those are observed by the host
256
+ * thread through the effective abort signal.
257
+ */
258
+ type CodeExecutionWorkerOutcome = CodeExecutionWorkerCompletedOutcome | CodeExecutionWorkerFailedOutcome;
259
+ //#endregion
260
+ export { CODE_EXECUTION_DEFAULT_MAX_PROGRAM_FILES as a, CODE_EXECUTION_DEFAULT_MAX_SOURCE_BYTES as c, PiscinaCodeExecutionProviderOptions as d, CODE_EXECUTION_DEFAULT_MAX_INVOCATIONS_PER_WORKER as i, CodeExecutionWorkerOutcome as l, CODE_EXECUTION_DEFAULT_MAX_ARGUMENT_BYTES as n, CODE_EXECUTION_DEFAULT_MAX_QUEUED_INVOCATIONS as o, CODE_EXECUTION_DEFAULT_MAX_CONCURRENCY as r, CODE_EXECUTION_DEFAULT_MAX_RESULT_BYTES as s, CODE_EXECUTION_DEFAULT_IDLE_TIMEOUT_MS as t, CodeExecutionWorkerTask as u };
@@ -1145,10 +1145,10 @@ declare class GenerationRetirementLedger {
1145
1145
  * without it, a synchronous retirement would silently claim what an asynchronous
1146
1146
  * one has to prove.
1147
1147
  *
1148
- * A no-op in effect, because {@link supersede} already booked the generation as
1149
- * unproven. It is kept as an explicit statement of intent: a caller that never
1150
- * intends to wait says so, rather than leaving the reader to infer it from the
1151
- * absence of a `retire`.
1148
+ * The caller still does not wait, but the ledger continues observing the end it
1149
+ * already holds. Once that promise fulfils, the generation is proven retired and
1150
+ * no longer caps later teardowns. A rejected observation remains unproven: it
1151
+ * did not establish that the resource ended.
1152
1152
  * @param generation - Generation returned by {@link supersede}.
1153
1153
  */
1154
1154
  abandon(generation: SupersededGeneration): void;
@@ -2232,6 +2232,22 @@ declare class AgentTeardownArbiter {
2232
2232
  * @returns Whether a replacement is installed for it
2233
2233
  */
2234
2234
  hasReplacementInFlight(agentId: string): boolean;
2235
+ /**
2236
+ * Whether any teardown or replacement still owns lifecycle work.
2237
+ * @returns Whether this adapter instance still has an active lifecycle flight
2238
+ */
2239
+ hasLifecycleWorkInFlight(): boolean;
2240
+ /**
2241
+ * Enumerate identities with a replacement that still owns post-settlement work.
2242
+ *
2243
+ * The registry normally discovers teardown subjects through its live entries.
2244
+ * An expired replacement wait deliberately removes that entry before the
2245
+ * replacement retires, though, so instance shutdown must include these
2246
+ * replacement-only identities in its accounting without trying to close their
2247
+ * runtimes out from under the replacement.
2248
+ * @returns Agent identities whose replacements have not retired
2249
+ */
2250
+ replacementAgentIdsInFlight(): IterableIterator<string>;
2235
2251
  /**
2236
2252
  * Admit a connector replacement, or refuse it.
2237
2253
  *
@@ -2638,6 +2654,10 @@ interface BaseAgentConnectorConfig<TBus extends ScopedBus<string> = ScopedBus<st
2638
2654
  * @typeParam TConnector - The connector type (for proper factory return typing)
2639
2655
  */
2640
2656
  interface AIAgentConfig<TBus extends ScopedBus<string> = ScopedBus<string>, TConnector extends AIAgentConnector<TBus> = AIAgentConnector<TBus>> extends Omit<AgentIdentity, 'adapterSessionId'>, AgentRuntimeInput {
2657
+ /** Stable machine identity of the adapter runtime hosting this agent. */
2658
+ machineId: string;
2659
+ /** Exact authority incarnation hosting this agent's adapter runtime. */
2660
+ ownerInstanceId: string;
2641
2661
  /** Adapter-specific session identifier for multi-turn conversations */
2642
2662
  adapterSessionId?: string;
2643
2663
  /** Makaio session identifier */
@@ -1,4 +1,4 @@
1
- import { r as PageSurfaceConfig, s as SurfaceId } from "../schemas-CD0wOQxx.mjs";
1
+ import { r as PageSurfaceConfig, s as SurfaceId } from "../schemas-B6Q-qdmn.mjs";
2
2
  import * as _$zod from "zod";
3
3
  import { z } from "zod";
4
4
  import * as _$_makaio_core0 from "@makaio/framework/core";
@@ -1,2 +1,2 @@
1
- import { a as SurfaceCapabilitySchema, c as SurfaceIdSchema, i as SurfaceCapability, l as isPageVisibleOnSurface, n as PageSchemas, o as SurfaceDeclaration, r as PageSurfaceConfig, s as SurfaceId, t as PageMetadata } from "../../schemas-CD0wOQxx.mjs";
1
+ import { a as SurfaceCapabilitySchema, c as SurfaceIdSchema, i as SurfaceCapability, l as isPageVisibleOnSurface, n as PageSchemas, o as SurfaceDeclaration, r as PageSurfaceConfig, s as SurfaceId, t as PageMetadata } from "../../schemas-B6Q-qdmn.mjs";
2
2
  export { PageMetadata, PageSchemas, PageSurfaceConfig, SurfaceCapability, SurfaceCapabilitySchema, SurfaceDeclaration, SurfaceId, SurfaceIdSchema, isPageVisibleOnSurface };
@@ -163,6 +163,27 @@ declare function normalizeBusSecret(raw: string | undefined): string | undefined
163
163
  */
164
164
  declare function isBunRuntime(): boolean;
165
165
  //#endregion
166
+ //#region packages/utils/src/npm-package-name.d.ts
167
+ /**
168
+ * Maximum character length of an npm package name.
169
+ *
170
+ * npm limits package names to 214 ASCII characters. This utility deliberately
171
+ * accepts the portable registry-name subset used where a package name becomes
172
+ * part of a filesystem path; it does not parse npm's broader specifier syntax.
173
+ */
174
+ declare const NPM_PACKAGE_NAME_MAX_LENGTH = 214;
175
+ /**
176
+ * Determine whether a value has the ordinary npm package-name spelling.
177
+ *
178
+ * Local paths, git URLs, tags, versions, and subpaths are npm specifiers, not
179
+ * package names, and are intentionally rejected here.
180
+ * @param value - Candidate package name.
181
+ * Length is deliberately separate: callers can retain their own error message
182
+ * for a syntactically valid name that exceeds {@link NPM_PACKAGE_NAME_MAX_LENGTH}.
183
+ * @returns Whether the value has npm's ordinary package-name syntax.
184
+ */
185
+ declare function isNpmPackageName(value: string): boolean;
186
+ //#endregion
166
187
  //#region packages/utils/src/safe-stringify.d.ts
167
188
  /**
168
189
  * JSON-stringify a value, handling BigInt and circular references gracefully.
@@ -368,4 +389,4 @@ interface TimeoutSignal {
368
389
  */
369
390
  declare function createTimeoutSignal(timeoutMs: number): TimeoutSignal;
370
391
  //#endregion
371
- export { CLI_COMMAND_ABORT_SIGNALS, CLI_COMMAND_SIGNAL_EXIT_CODES, CLI_EXIT_CODES, type CliCommandErrorKind, DEFAULT_TIMEOUTS, DeferredPromise, type RequiredTimeoutConfig, SerialLane, TIMEOUT_CATEGORIES, type TimeoutCategory, type TimeoutConfig, type TimeoutLayer, type TimeoutLayerInput, type TimeoutSignal, type TimeoutSources, type TrackedTimeoutConfig, canonicalStringify, classifyCliCommandError, createTimeoutSignal, deepFreeze, explainAllTimeouts, explainTimeout, extractJson, getErrorString, isBunRuntime, isRecord, normalizeBusSecret, readStdin, resolveCliSignalExitCode, resolveTimeouts, safeStringify };
392
+ export { CLI_COMMAND_ABORT_SIGNALS, CLI_COMMAND_SIGNAL_EXIT_CODES, CLI_EXIT_CODES, type CliCommandErrorKind, DEFAULT_TIMEOUTS, DeferredPromise, NPM_PACKAGE_NAME_MAX_LENGTH, type RequiredTimeoutConfig, SerialLane, TIMEOUT_CATEGORIES, type TimeoutCategory, type TimeoutConfig, type TimeoutLayer, type TimeoutLayerInput, type TimeoutSignal, type TimeoutSources, type TrackedTimeoutConfig, canonicalStringify, classifyCliCommandError, createTimeoutSignal, deepFreeze, explainAllTimeouts, explainTimeout, extractJson, getErrorString, isBunRuntime, isNpmPackageName, isRecord, normalizeBusSecret, readStdin, resolveCliSignalExitCode, resolveTimeouts, safeStringify };
@@ -1,2 +1,2 @@
1
- function e(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var t=class{deferred=e();isTracked=!1;getPromise(){return this.isTracked=!0,this.deferred.promise}resolve(e){this.deferred.resolve(e)}reject(e){this.isTracked&&this.deferred.reject(e)}};const n={failure:1,timeout:124,abort:130},r=[`SIGINT`,`SIGTERM`,`SIGHUP`],i={SIGINT:130,SIGTERM:143,SIGHUP:129};async function a(e){if(process.stdin.isTTY)return null;if(e?.aborted===!0)throw c(e.reason);let t=[],n=process.stdin,r=(async()=>{for await(let e of n)t.push(Buffer.from(e));return Buffer.concat(t).toString(`utf-8`)})();if(r.catch(()=>void 0),e===void 0)return await r;let i,a=new Promise((t,r)=>{i=()=>{let t=c(e.reason);n.destroy(t),r(t)},e.addEventListener(`abort`,i,{once:!0})});try{return await Promise.race([r,a])}finally{i!==void 0&&e.removeEventListener(`abort`,i)}}function o(e){return e instanceof Error&&e.name===`OnceAbortError`?`abort`:e instanceof Error&&e.name===`OnceTimeoutError`?`timeout`:`failure`}function s(e){return typeof e==`string`&&Object.hasOwn(i,e)?i[e]:void 0}function c(e){let t=Error(e===void 0?`Command aborted`:String(e));return t.name=`OnceAbortError`,t}function l(e){let t=JSON.stringify(e,(e,t)=>{if(typeof t==`object`&&t&&!Array.isArray(t)){let e=Object.create(null);for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t});if(t===void 0)throw TypeError(`canonicalStringify requires a top-level JSON-serializable value`);return t}function u(e){if(typeof e==`object`&&e){for(let t of Object.values(e))u(t);return Object.freeze(e)}return e}function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e){let t=e.indexOf(`{`),n=e.lastIndexOf(`}`);return t===-1||n===-1||n<=t?e:e.slice(t,n+1)}function p(e){if(!e)return`Unknown error`;if(typeof e==`string`)return e;try{return e instanceof Error?e.message?String(e.message):`Unknown error`:String(e)||`Unknown error`}catch{return`Unknown error`}}function m(e){if(e===void 0)return;let t=e.trim();if(t===``)throw Error(`MAKAIO_BUS_SECRET is set but empty after trimming; refusing to use an empty secret`);return t}function h(){return globalThis.Bun!==void 0}function g(e){if(e===void 0)return`null`;let t=[];try{return JSON.stringify(e,function(e,n){if(typeof n==`bigint`)return n.toString();for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(typeof n==`object`&&n){if(t.includes(n))return`[Circular]`;t.push(n)}return n})??JSON.stringify(String(e))??`"[Unserializable]"`}catch{try{return JSON.stringify(String(e))??`"[Unserializable]"`}catch{return`"[Unserializable]"`}}}var _=class{tail=Promise.resolve();run(e){let t=this.tail.then(e);return this.tail=t.then(()=>void 0,()=>void 0),t}};const v={initialization:3e4,acknowledgement:3e4,completion:6e4,toolApproval:5e3,eventWait:1e4},y=[`initialization`,`acknowledgement`,`completion`,`toolApproval`,`eventWait`];function b(e){let t={...v},n={};for(let e of y)n[e]={layer:`global`,source:`DEFAULT_TIMEOUTS`};for(let{layer:r,source:i,config:a}of e)if(a)for(let e of y){let o=a[e];o!==void 0&&(t[e]=o,n[e]={layer:r,source:i})}return{values:t,sources:n}}function x(e,t){let{layer:n,source:r}=e.sources[t];return`${t}=${e.values[t]}ms (from ${n}: ${r})`}function S(e){return y.map(t=>x(e,t)).join(`
2
- `)}function C(e){let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}export{r as CLI_COMMAND_ABORT_SIGNALS,i as CLI_COMMAND_SIGNAL_EXIT_CODES,n as CLI_EXIT_CODES,v as DEFAULT_TIMEOUTS,t as DeferredPromise,_ as SerialLane,y as TIMEOUT_CATEGORIES,l as canonicalStringify,o as classifyCliCommandError,C as createTimeoutSignal,u as deepFreeze,S as explainAllTimeouts,x as explainTimeout,f as extractJson,p as getErrorString,h as isBunRuntime,d as isRecord,m as normalizeBusSecret,a as readStdin,s as resolveCliSignalExitCode,b as resolveTimeouts,g as safeStringify};
1
+ import{n as e,t}from"../npm-package-name-DuTYVICk.mjs";function n(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var r=class{deferred=n();isTracked=!1;getPromise(){return this.isTracked=!0,this.deferred.promise}resolve(e){this.deferred.resolve(e)}reject(e){this.isTracked&&this.deferred.reject(e)}};const i={failure:1,timeout:124,abort:130},a=[`SIGINT`,`SIGTERM`,`SIGHUP`],o={SIGINT:130,SIGTERM:143,SIGHUP:129};async function s(e){if(process.stdin.isTTY)return null;if(e?.aborted===!0)throw u(e.reason);let t=[],n=process.stdin,r=(async()=>{for await(let e of n)t.push(Buffer.from(e));return Buffer.concat(t).toString(`utf-8`)})();if(r.catch(()=>void 0),e===void 0)return await r;let i,a=new Promise((t,r)=>{i=()=>{let t=u(e.reason);n.destroy(t),r(t)},e.addEventListener(`abort`,i,{once:!0})});try{return await Promise.race([r,a])}finally{i!==void 0&&e.removeEventListener(`abort`,i)}}function c(e){return e instanceof Error&&e.name===`OnceAbortError`?`abort`:e instanceof Error&&e.name===`OnceTimeoutError`?`timeout`:`failure`}function l(e){return typeof e==`string`&&Object.hasOwn(o,e)?o[e]:void 0}function u(e){let t=Error(e===void 0?`Command aborted`:String(e));return t.name=`OnceAbortError`,t}function d(e){let t=JSON.stringify(e,(e,t)=>{if(typeof t==`object`&&t&&!Array.isArray(t)){let e=Object.create(null);for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t});if(t===void 0)throw TypeError(`canonicalStringify requires a top-level JSON-serializable value`);return t}function f(e){if(typeof e==`object`&&e){for(let t of Object.values(e))f(t);return Object.freeze(e)}return e}function p(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function m(e){let t=e.indexOf(`{`),n=e.lastIndexOf(`}`);return t===-1||n===-1||n<=t?e:e.slice(t,n+1)}function h(e){if(!e)return`Unknown error`;if(typeof e==`string`)return e;try{return e instanceof Error?e.message?String(e.message):`Unknown error`:String(e)||`Unknown error`}catch{return`Unknown error`}}function g(e){if(e===void 0)return;let t=e.trim();if(t===``)throw Error(`MAKAIO_BUS_SECRET is set but empty after trimming; refusing to use an empty secret`);return t}function _(){return globalThis.Bun!==void 0}function v(e){if(e===void 0)return`null`;let t=[];try{return JSON.stringify(e,function(e,n){if(typeof n==`bigint`)return n.toString();for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(typeof n==`object`&&n){if(t.includes(n))return`[Circular]`;t.push(n)}return n})??JSON.stringify(String(e))??`"[Unserializable]"`}catch{try{return JSON.stringify(String(e))??`"[Unserializable]"`}catch{return`"[Unserializable]"`}}}var y=class{tail=Promise.resolve();run(e){let t=this.tail.then(e);return this.tail=t.then(()=>void 0,()=>void 0),t}};const b={initialization:3e4,acknowledgement:3e4,completion:6e4,toolApproval:5e3,eventWait:1e4},x=[`initialization`,`acknowledgement`,`completion`,`toolApproval`,`eventWait`];function S(e){let t={...b},n={};for(let e of x)n[e]={layer:`global`,source:`DEFAULT_TIMEOUTS`};for(let{layer:r,source:i,config:a}of e)if(a)for(let e of x){let o=a[e];o!==void 0&&(t[e]=o,n[e]={layer:r,source:i})}return{values:t,sources:n}}function C(e,t){let{layer:n,source:r}=e.sources[t];return`${t}=${e.values[t]}ms (from ${n}: ${r})`}function w(e){return x.map(t=>C(e,t)).join(`
2
+ `)}function T(e){let t=new AbortController,n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}export{a as CLI_COMMAND_ABORT_SIGNALS,o as CLI_COMMAND_SIGNAL_EXIT_CODES,i as CLI_EXIT_CODES,b as DEFAULT_TIMEOUTS,r as DeferredPromise,t as NPM_PACKAGE_NAME_MAX_LENGTH,y as SerialLane,x as TIMEOUT_CATEGORIES,d as canonicalStringify,c as classifyCliCommandError,T as createTimeoutSignal,f as deepFreeze,w as explainAllTimeouts,C as explainTimeout,m as extractJson,h as getErrorString,_ as isBunRuntime,e as isNpmPackageName,p as isRecord,g as normalizeBusSecret,s as readStdin,l as resolveCliSignalExitCode,S as resolveTimeouts,v as safeStringify};
@@ -1 +1 @@
1
- import{MAKAIO_PROJECT_DIR as e}from"./scope-paths.mjs";import{z as t}from"zod";import n from"node:fs/promises";import r from"node:path";import{randomUUID as i}from"node:crypto";const a=`manifest.json`,o=r.join(e,a),s=`makaio/project-manifest/v1`,c=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/u,l=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u;function u(e){if(e.startsWith(`@`)){let t=e.indexOf(`@`,1);return t===-1?e:e.slice(0,t)}let t=e.indexOf(`@`);return t===-1?e:e.slice(0,t)}function d(e){let t=u(e),n=t.length<e.length?e.slice(t.length+1):``;if(t.length===0||n.length===0)throw Error(`Project manifest extension specs must include an exact version: ${e}`);if(!l.test(t)||t.length>214)throw Error(`Project manifest extension specs must use npm package names: ${e}`);if(!c.test(n))throw Error(`Project manifest extension specs must use exact semantic versions: ${e}`);return{packageName:t,version:n,spec:e}}function f(e,t){return d(`${e}@${t}`).spec}function p(e,t){let n=new Map(t.map(e=>[e.name,e.version])),r=[],i=[],a=[];for(let t of e){let e=d(t),o=n.get(e.packageName);o===void 0?i.push(e):o===e.version?r.push({manifest:e,installedVersion:o}):a.push({manifest:e,installedVersion:o})}return{satisfied:r,missing:i,mismatched:a}}const m=t.string().superRefine((e,t)=>{try{d(e)}catch(e){t.addIssue({code:`custom`,message:e instanceof Error?e.message:String(e)})}}),h=t.object({$schema:t.string().optional(),extensions:t.array(m).default([])}).passthrough();async function g(e){let t=r.resolve(e);for(;;){let e=r.join(t,o),[n,i]=await Promise.all([y(e),y(r.join(t,`.git`))]);if(n)return e;if(i)return null;let a=r.dirname(t);if(a===t)return null;t=a}}async function _(e){let t=await n.readFile(e,`utf-8`);return h.parse(JSON.parse(t))}async function v(e,t){let a=h.parse(t);await n.mkdir(r.dirname(e),{recursive:!0});let o=`${e}.${process.pid}.${Date.now()}.${i()}.tmp`;await n.writeFile(o,`${JSON.stringify(a,null,2)}\n`,`utf-8`);try{await n.rename(o,e)}catch(e){throw await n.unlink(o).catch(()=>void 0),e}}async function y(e){try{return await n.access(e),!0}catch{return!1}}export{a as PROJECT_MANIFEST_BASENAME,o as PROJECT_MANIFEST_FILE,s as PROJECT_MANIFEST_SCHEMA_ID,h as ProjectManifestSchema,p as compareProjectManifestExtensions,u as extractNpmPackageName,g as findProjectManifestPath,f as formatExactExtensionSpec,d as parseExactExtensionSpec,y as pathExists,_ as readProjectManifest,v as writeProjectManifest};
1
+ import{n as e}from"../npm-package-name-DuTYVICk.mjs";import{MAKAIO_PROJECT_DIR as t}from"./scope-paths.mjs";import{z as n}from"zod";import r from"node:fs/promises";import i from"node:path";import{randomUUID as a}from"node:crypto";const o=`manifest.json`,s=i.join(t,o),c=`makaio/project-manifest/v1`,l=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/u;function u(e){if(e.startsWith(`@`)){let t=e.indexOf(`@`,1);return t===-1?e:e.slice(0,t)}let t=e.indexOf(`@`);return t===-1?e:e.slice(0,t)}function d(t){let n=u(t),r=n.length<t.length?t.slice(n.length+1):``;if(n.length===0||r.length===0)throw Error(`Project manifest extension specs must include an exact version: ${t}`);if(!e(n)||n.length>214)throw Error(`Project manifest extension specs must use npm package names: ${t}`);if(!l.test(r))throw Error(`Project manifest extension specs must use exact semantic versions: ${t}`);return{packageName:n,version:r,spec:t}}function f(e,t){return d(`${e}@${t}`).spec}function p(e,t){let n=new Map(t.map(e=>[e.name,e.version])),r=[],i=[],a=[];for(let t of e){let e=d(t),o=n.get(e.packageName);o===void 0?i.push(e):o===e.version?r.push({manifest:e,installedVersion:o}):a.push({manifest:e,installedVersion:o})}return{satisfied:r,missing:i,mismatched:a}}const m=n.string().superRefine((e,t)=>{try{d(e)}catch(e){t.addIssue({code:`custom`,message:e instanceof Error?e.message:String(e)})}}),h=n.object({$schema:n.string().optional(),extensions:n.array(m).default([])}).passthrough();async function g(e){let t=i.resolve(e);for(;;){let e=i.join(t,s),[n,r]=await Promise.all([y(e),y(i.join(t,`.git`))]);if(n)return e;if(r)return null;let a=i.dirname(t);if(a===t)return null;t=a}}async function _(e){let t=await r.readFile(e,`utf-8`);return h.parse(JSON.parse(t))}async function v(e,t){let n=h.parse(t);await r.mkdir(i.dirname(e),{recursive:!0});let o=`${e}.${process.pid}.${Date.now()}.${a()}.tmp`;await r.writeFile(o,`${JSON.stringify(n,null,2)}\n`,`utf-8`);try{await r.rename(o,e)}catch(e){throw await r.unlink(o).catch(()=>void 0),e}}async function y(e){try{return await r.access(e),!0}catch{return!1}}export{o as PROJECT_MANIFEST_BASENAME,s as PROJECT_MANIFEST_FILE,c as PROJECT_MANIFEST_SCHEMA_ID,h as ProjectManifestSchema,p as compareProjectManifestExtensions,u as extractNpmPackageName,g as findProjectManifestPath,f as formatExactExtensionSpec,d as parseExactExtensionSpec,y as pathExists,_ as readProjectManifest,v as writeProjectManifest};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-DTipWd-i.mjs";import{t}from"./semver-DTXuyLcK.mjs";import{z as n}from"zod";var r=e(t(),1);const i=n.string().min(1).refine(e=>e.trim().length>0&&(0,r.validRange)(e)!==null,{message:`Must be a valid semver range (e.g. ">=1.0.0 <2.0.0", "^1.5.0")`});function a(e,t){return(0,r.satisfies)(e,t,{includePrerelease:!0})}function o(e){let t=(0,r.validRange)(e);return t===`*`||t===`>=0.0.0`||t===`>=0.0.0-0`}const s=n.string().min(1).refine(e=>(0,r.valid)(e)!==null&&!e.startsWith(`v`),{message:`Must be a valid semver version (e.g. "1.0.0")`});export{a as i,i as n,o as r,s as t};
1
+ import{o as e}from"./chunk-DTipWd-i.mjs";import{t}from"./semver-BI7kTNsY.mjs";import{z as n}from"zod";var r=e(t(),1);const i=n.string().min(1).refine(e=>e.trim().length>0&&(0,r.validRange)(e)!==null,{message:`Must be a valid semver range (e.g. ">=1.0.0 <2.0.0", "^1.5.0")`});function a(e,t){return(0,r.satisfies)(e,t,{includePrerelease:!0})}function o(e){let t=(0,r.validRange)(e);return t===`*`||t===`>=0.0.0`||t===`>=0.0.0-0`}const s=n.string().min(1).refine(e=>(0,r.valid)(e)!==null&&!e.startsWith(`v`),{message:`Must be a valid semver version (e.g. "1.0.0")`});export{a as i,i as n,o as r,s as t};
@@ -1,4 +1,4 @@
1
- import { _ as SurfaceBindingRegistration, a as ResolvedArtifactContextWire$1, q as ArtifactRevision$1, z as ArtifactRelation } from "./context-resolution-ya9TXKg-.mjs";
1
+ import { _ as SurfaceBindingRegistration, a as ResolvedArtifactContextWire$1, q as ArtifactRevision$1, z as ArtifactRelation } from "./context-resolution-841T7jBI.mjs";
2
2
  import { z } from "zod";
3
3
  import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
4
4
 
@@ -220,7 +220,7 @@ declare const ArtifactViewEvidenceSectionSchema: z.ZodObject<{
220
220
  declare const ArtifactViewRawSectionSchema: z.ZodObject<{
221
221
  type: z.ZodLiteral<"raw">;
222
222
  title: z.ZodString;
223
- json: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
223
+ json: z.ZodType<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue>>;
224
224
  }, z.core.$strip>;
225
225
  /**
226
226
  * Code section: source code or structured text with a language hint.
@@ -302,7 +302,7 @@ declare const ArtifactViewSectionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
302
302
  }, z.core.$strip>, z.ZodObject<{
303
303
  type: z.ZodLiteral<"raw">;
304
304
  title: z.ZodString;
305
- json: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
305
+ json: z.ZodType<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue>>;
306
306
  }, z.core.$strip>, z.ZodObject<{
307
307
  type: z.ZodLiteral<"code">;
308
308
  title: z.ZodString;
@@ -409,7 +409,7 @@ declare const ArtifactViewModelSchema$1: z.ZodObject<{
409
409
  }, z.core.$strip>, z.ZodObject<{
410
410
  type: z.ZodLiteral<"raw">;
411
411
  title: z.ZodString;
412
- json: z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>;
412
+ json: z.ZodType<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, _$_makaio_contracts0.JsonValue>>;
413
413
  }, z.core.$strip>, z.ZodObject<{
414
414
  type: z.ZodLiteral<"code">;
415
415
  title: z.ZodString;
@@ -1 +1 @@
1
- import{n as e,t}from"./modes-DmUsjHdV.mjs";import{z as n}from"zod";const r=n.enum([`none`,`low`,`medium`,`high`,`extra-high`]),i=n.union([n.number(),n.string()]),a=n.object({none:i,low:i,medium:i,high:i,"extra-high":i}).partial(),o=n.object({modes:n.array(n.enum(t)).nonempty(),vocabularyBiasing:n.boolean().optional()}),s=n.object({modes:n.array(n.enum(e)).nonempty(),voiceSelection:n.boolean().optional(),voiceInstructions:n.boolean().optional(),outputFormats:n.array(n.string()).optional()}),c=n.object({vision:n.boolean().optional(),toolCalling:n.boolean().optional(),parallelToolCalls:n.boolean().optional(),structuredOutput:n.boolean().optional(),pdfUpload:n.boolean().optional(),speechToText:o.optional(),textToSpeech:s.optional()}),l=n.object({inputPerMillion:n.number(),inputCachedPerMillion:n.number().optional(),cacheWritePerMillion:n.number().optional(),outputPerMillion:n.number()}),u=n.object({multiplier:n.number()}),d=n.object({token:l.optional(),request:u.optional()}),f=n.object({maxOutputTokens:n.number().optional(),capabilities:c.optional(),pricing:d.optional(),includedInSubscription:n.boolean().optional(),description:n.string().optional()}),p=n.object({name:n.string(),friendlyName:n.string().optional(),family:n.string().optional(),contextWindowSize:n.number(),labId:n.string(),supportedReasoningLevels:a.optional(),metadata:f.optional()}),m=p,h=n.enum([`disabled`,`enabled`,`visible`]),g=n.enum([`allowlist`,`show-all`]);function _(e,t,n){return n?.[e]??(t===`allowlist`?`disabled`:`visible`)}export{r as a,p as i,h as n,m as o,_ as r,a as s,g as t};
1
+ import{n as e,t}from"./modes-DwsJ3yVl.mjs";import{z as n}from"zod";const r=n.enum([`none`,`low`,`medium`,`high`,`extra-high`]),i=n.union([n.number(),n.string()]),a=n.object({none:i,low:i,medium:i,high:i,"extra-high":i}).partial(),o=n.object({modes:n.array(n.enum(t)).nonempty(),vocabularyBiasing:n.boolean().optional()}),s=n.object({modes:n.array(n.enum(e)).nonempty(),voiceSelection:n.boolean().optional(),voiceInstructions:n.boolean().optional(),outputFormats:n.array(n.string()).optional()}),c=n.object({vision:n.boolean().optional(),toolCalling:n.boolean().optional(),parallelToolCalls:n.boolean().optional(),structuredOutput:n.boolean().optional(),pdfUpload:n.boolean().optional(),speechToText:o.optional(),textToSpeech:s.optional()}),l=n.object({inputPerMillion:n.number(),inputCachedPerMillion:n.number().optional(),cacheWritePerMillion:n.number().optional(),outputPerMillion:n.number()}),u=n.object({multiplier:n.number()}),d=n.object({token:l.optional(),request:u.optional()}),f=n.object({maxOutputTokens:n.number().optional(),capabilities:c.optional(),pricing:d.optional(),includedInSubscription:n.boolean().optional(),description:n.string().optional()}),p=n.object({name:n.string(),friendlyName:n.string().optional(),family:n.string().optional(),contextWindowSize:n.number(),labId:n.string(),supportedReasoningLevels:a.optional(),metadata:f.optional()}),m=p,h=n.enum([`disabled`,`enabled`,`visible`]),g=n.enum([`allowlist`,`show-all`]);function _(e,t,n){return n?.[e]??(t===`allowlist`?`disabled`:`visible`)}export{r as a,p as i,h as n,m as o,_ as r,a as s,g as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./json-value-BBZ6uGwc.mjs";import{n as t}from"./capability-j3NekkIu.mjs";import{z as n}from"zod";const r=n.enum([`wait-in-process`,`exit-and-redispatch`,`exit-and-resume`]),i=`worker-node`,a=`makaio.runtime-node.piscina-local`,o=1,s=n.object({version:n.literal(1),providerId:n.string().min(1),providerData:e}).strict(),c={source:128,code:64,summary:512,observedAt:64},l=n.object({source:n.string().min(1).max(c.source),summary:n.string().min(1).max(c.summary),observedAt:n.iso.datetime({offset:!0}).max(c.observedAt),code:n.string().min(1).max(c.code).optional()}).strict(),u=`exhaustive-search-unavailable`,d=`no-allocation-observed`,f=`ambiguous-allocation-match`,p=`pre-request-rejection`,m=[`unknown`,`provisioning`,`ready`,`running`,`suspended`,`terminal`,`absent`],h=n.enum(m),g=n.object({state:h,allocationRef:s,evidence:e.optional()}),_=[`local-directory`,`workspace-snapshot`],v=n.enum(_),y=n.string().min(1).refine(e=>!e.startsWith(`/`)&&!/^[A-Za-z]:[/\\]/.test(e),{message:`sourcePath must be relative (no leading / or drive letter)`}),b=n.object({kind:n.literal(`local-directory`),workspaceId:n.string().min(1),rootDigest:n.string().min(1),sourcePath:y}).strict(),x=n.object({kind:n.literal(`workspace-snapshot`),snapshotId:n.string().min(1),digest:n.string().min(1),sourcePath:y}).strict(),S=n.discriminatedUnion(`kind`,[b,x]),C=/^sha(?:256|384|512)-[A-Za-z0-9+/]+=*$/,w=n.object({packageName:n.string().min(1),version:n.string().min(1),entrypoint:n.string().min(1).refine(e=>!e.includes(`node_modules`)&&!e.startsWith(`/`)&&!/^[A-Za-z]:[/\\]/.test(e),{message:`entrypoint must be package-relative (no node_modules, no absolute path)`}),integrity:n.string().min(1).refine(e=>C.test(e),{message:`integrity must be a valid SRI hash (sha256-..., sha384-..., or sha512-...)`})}).strict(),T=n.object({maxRuntimeMs:n.number().int().positive().optional(),persistentStorage:n.boolean(),customCapabilities:n.array(n.string().min(1)).default([]),suspensionStrategy:r.default(`wait-in-process`),supportsRecovery:n.boolean().default(!1),materializationModes:n.array(v).min(1).default([`local-directory`])}),E=n.object({maxRuntimeMs:n.number().int().positive().optional(),persistentStorage:n.boolean().optional(),customCapabilities:n.array(n.string().min(1)).default([]),recoverableAllocation:n.boolean().optional(),materializationModes:n.array(v).optional()}),D=[`provisioner-process-bound`,`provider-managed`],O=n.enum(D),k=[`found`,`confirmed-absent`,`unknown`],A=n.discriminatedUnion(`kind`,[n.object({kind:n.literal(`found`),allocationRef:s}).strict(),n.object({kind:n.literal(`confirmed-absent`),evidence:l}).strict(),n.object({kind:n.literal(`unknown`),evidence:l}).strict()]),j=n.enum([`accepted`,`duplicate`,`conflict`,`fenced`]);var M=class extends Error{constructor(e){super(e),this.name=`ProviderAllocationRefError`}};function N(e,t){let n=s.shape.providerId.parse(e);return{build:e=>{let r=t.parse(e);return{version:1,providerId:n,providerData:s.shape.providerData.parse(r)}},parse:e=>{if(e.version!==1)throw new M(`Unsupported allocation ref version ${String(e.version)}, expected 1`);if(e.providerId!==n)throw new M(`Allocation ref provider '${e.providerId}' does not match this provider '${n}'`);let r=t.safeParse(e.providerData);if(!r.success)throw new M(`Invalid provider data in allocation ref: ${r.error.message}`);return r.data}}}function P(e,t){if(e.length<=t)return e;let n=e.slice(0,t-1),r=n.charCodeAt(n.length-1);return`${r>=55296&&r<=56319?n.slice(0,-1):n}…`}function F(e,t,n){let r=c.summary;return l.parse({source:e,summary:P(n,r),observedAt:new Date().toISOString(),...t===void 0?{}:{code:t}})}function I(e,n){return e.emit(t.register,{capabilityId:i,provider:n})}function L(e,n){return e.emit(t.unregister,{capabilityId:i,providerId:n})}export{E as A,c as C,S as D,w as E,r as M,O,A as S,i as T,j as _,N as a,k as b,g as c,l as d,u as f,d as g,v as h,M as i,x as j,T as k,h as l,_ as m,L as n,m as o,b as p,F as r,f as s,I as t,a as u,p as v,D as w,s as x,o as y};
@@ -1 +1 @@
1
- import{t as e}from"./json-value-D57aJhVn.mjs";import{A as t,_ as n,x as r}from"./worker-node-BDOYPEpi.mjs";import{G as i,H as a,V as o}from"./workflow-Hzc5jlnV.mjs";import{z as s}from"zod";import{createBusNamespace as c}from"@makaio/framework/core";const l=s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),environment:s.string().min(1),metadata:e.optional()}),u=s.object({executionAttemptId:s.string().min(1),config:i,manifest:o.optional(),requirements:t.optional(),metadata:e.optional()}),d=s.object({executionAttemptId:s.string().min(1),allocationRef:r}).strict(),f={dispatch:{request:u,response:d},"control.attempt-ready":s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),adapters:s.array(s.string().min(1)).default([])}).strict(),"control.outcome.submit":{request:s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),result:a}).strict().superRefine((e,t)=>{e.result.executionId!==e.executionId&&t.addIssue({code:s.ZodIssueCode.custom,path:[`result`,`executionId`],message:`result.executionId must match executionId`})}),response:s.object({decision:n}).strict()},"control.bootstrap.claim":{request:s.object({executionId:s.string().min(1),executionAttemptId:s.string().min(1)}).strict(),response:s.object({busUrl:s.string().min(1),busAuthSecret:s.string().min(1)}).strict()},"lifecycle.provisioning":l,"lifecycle.booting":l,"lifecycle.ready":l.extend({adapters:s.array(s.string().min(1)).default([])}),"lifecycle.busy":l,"lifecycle.completed":l,"lifecycle.failed":l.extend({error:s.string().min(1)}),"lifecycle.terminated":l.extend({reason:s.string().optional()}),"lifecycle.paused":l.extend({pausedAtGateId:s.string().min(1),pausedAtFrameId:s.string().min(1)})},p=`worker-bootstrap`,m=c(`worker-node`,f),h=m.subjects;export{d as a,u as i,m as n,f as o,h as r,p as t};
1
+ import{n as e}from"./json-value-BBZ6uGwc.mjs";import{A as t,_ as n,x as r}from"./worker-node-CjuQb9hl.mjs";import{G as i,H as a,V as o}from"./workflow-C4mck_NW.mjs";import{z as s}from"zod";import{createBusNamespace as c}from"@makaio/framework/core";const l=s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),environment:s.string().min(1),metadata:e.optional()}),u=s.object({executionAttemptId:s.string().min(1),config:i,manifest:o.optional(),requirements:t.optional(),metadata:e.optional()}),d=s.object({executionAttemptId:s.string().min(1),allocationRef:r}).strict(),f={dispatch:{request:u,response:d},"control.attempt-ready":s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),adapters:s.array(s.string().min(1)).default([])}).strict(),"control.outcome.submit":{request:s.object({executionAttemptId:s.string().min(1),executionId:s.string().min(1),result:a}).strict().superRefine((e,t)=>{e.result.executionId!==e.executionId&&t.addIssue({code:s.ZodIssueCode.custom,path:[`result`,`executionId`],message:`result.executionId must match executionId`})}),response:s.object({decision:n}).strict()},"control.bootstrap.claim":{request:s.object({executionId:s.string().min(1),executionAttemptId:s.string().min(1)}).strict(),response:s.object({busUrl:s.string().min(1),busAuthSecret:s.string().min(1)}).strict()},"lifecycle.provisioning":l,"lifecycle.booting":l,"lifecycle.ready":l.extend({adapters:s.array(s.string().min(1)).default([])}),"lifecycle.busy":l,"lifecycle.completed":l,"lifecycle.failed":l.extend({error:s.string().min(1)}),"lifecycle.terminated":l.extend({reason:s.string().optional()}),"lifecycle.paused":l.extend({pausedAtGateId:s.string().min(1),pausedAtFrameId:s.string().min(1)})},p=`worker-bootstrap`,m=c(`worker-node`,f),h=m.subjects;export{d as a,u as i,m as n,f as o,h as r,p as t};
@@ -0,0 +1 @@
1
+ import{h as e,m as t,s as n}from"./schemas-C3kyQWGf.mjs";import{a as r,i,n as a,o}from"./json-value-BBZ6uGwc.mjs";import{t as s}from"./zod-json-schema-Dixc-B1T.mjs";import"./artifact-Btbuib48.mjs";import{a as c}from"./visibility-DtDLRBdr.mjs";import"./model-DrzPt3ou.mjs";import{t as l}from"./provider-context-zTDSH2x9.mjs";import{a as u,o as d}from"./schemas-QWDnauKX.mjs";import{A as f,D as p,E as ee,M as te}from"./worker-node-CjuQb9hl.mjs";import{r as ne}from"./schemas-BfO5jkrL.mjs";import{z as m}from"zod";import{createBusNamespace as h,getFullSubjectForSubjectDefinition as re,observability as g,splitSubjectKey as ie}from"@makaio/framework/core";const _=m.object({kind:m.string().min(1),id:m.string().min(1)});function ae(e){return`${se(e.kind)}:${se(e.id)}`}function oe(e){let t=ce(e);if(t<1)throw Error(`Invalid artifact ref key: ${e}`);let n=le(e.slice(t+1));if(n.length===0)throw Error(`Invalid artifact ref key (empty id): ${e}`);return{kind:le(e.slice(0,t)),id:n}}function se(e){return e.replace(/\\/g,`\\\\`).replace(/:/g,`\\:`)}function ce(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(t){t=!1;continue}if(r===`\\`){t=!0;continue}if(r===`:`)return n}return-1}function le(e){let t=``,n=!1;for(let r of e){if(n){if(r!==`\\`&&r!==`:`)throw Error(`Invalid artifact ref key component: ${e}`);t+=r,n=!1;continue}if(r===`\\`){n=!0;continue}t+=r}if(n)throw Error(`Invalid artifact ref key component: ${e}`);return t}const ue=m.enum([`completed`,`failed`,`cancelled`]),de=m.object({status:ue,completedAt:m.number().int().nonnegative(),error:m.string().min(1).optional(),reason:m.string().min(1).optional()}).strict(),fe=m.object({executionId:m.string().min(1),workflowId:m.string().min(1),finalizerId:m.string().min(1),transitionKey:m.string().min(1),claimToken:m.string().min(1),intent:de,claimedAt:m.number().int().nonnegative()}).strict(),pe=m.object({accepted:m.boolean()}).strict(),me=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/,v=m.string().regex(me,`Workflow finalizer IDs must be lowercase dot, dash, or underscore separated names.`),y=m.string().regex(me,`Workflow delegate result finalizer IDs must be lowercase dot, dash, or underscore separated names.`),he=m.object({toolName:m.string().min(1),outcome:m.enum([`success`,`failure`]).optional(),artifact:m.object({kind:m.string().min(1),id:m.string().min(1),revision:m.string().min(1)}).strict().optional()}).strict().superRefine((e,t)=>{e.artifact!==void 0&&e.outcome!==`success`&&t.addIssue({code:`custom`,path:[`artifact`],message:`requires an explicit successful outcome`})}),ge=m.object({durationMs:m.number().int().nonnegative(),inputTokens:m.number().int().nonnegative().optional(),outputTokens:m.number().int().nonnegative().optional(),cachedInputTokens:m.number().int().nonnegative().optional(),toolCallCount:m.number().int().nonnegative().optional(),binding:m.object({adapterName:m.string().min(1),providerConfigId:m.string().min(1).optional(),providerDefinitionId:m.string().min(1).optional(),model:m.string().min(1).optional(),auth:m.object({mode:m.enum([`explicit`,`inferred`,`none`]),owner:m.enum([`provider`,`client`]),methodId:m.string().min(1)}).strict().optional()}).strict()}).strict(),b=m.object({executionId:m.string().min(1),workflowId:m.string().min(1),frameId:m.string().min(1),nodeId:m.string().min(1),nodeType:m.enum([`delegate-agent`,`delegate-role`]),rawResult:o,toolObservations:m.array(he),economics:ge.optional()}).strict(),_e=b.extend({finalizerId:y}).strict(),x=m.object({output:o}).strict();function ve(e){if(!v.safeParse(e).success)throw Error(`Invalid workflow finalizer ID: "${e}"`);let t=`workflow-finalizer:${e}`,n=h(t,{finalize:{request:fe,response:pe}});return{namespaceDomain:t,namespace:n,subjects:n.subjects}}function ye(e){if(!y.safeParse(e).success)throw Error(`Invalid workflow delegate result finalizer ID: "${e}"`);let t=`workflow-delegate-finalizer:${e}`,n=h(t,{finalize:{request:b,response:x}});return{namespaceDomain:t,namespace:n,subjects:n.subjects}}const S=m.union([m.string(),m.number(),m.boolean(),m.null()]),be=m.union([S,m.object({$in:m.array(S)}).strict(),m.object({$ne:S}).strict(),m.object({$exists:m.boolean()}).strict(),m.object({$startsWith:m.string()}).strict(),m.object({$endsWith:m.string()}).strict()]),xe=m.record(m.string(),be),Se=m.object({kind:ne,params:i,filter:xe.optional(),filterExpression:m.string().optional()}),C=m.discriminatedUnion(`type`,[m.object({type:m.literal(`global`)}).strict(),m.object({type:m.literal(`workspace`),id:m.string().min(1)}).strict(),m.object({type:m.literal(`session`),id:m.string().min(1)}).strict(),m.object({type:m.literal(`external`),kind:m.string().min(1),id:m.string().min(1)}).strict()]),w=m.string().min(1),T=m.object({kind:m.string().min(1),schemaVersion:m.string().min(1),scope:e,resolve:m.string().min(1).optional(),create:m.string().min(1).optional(),statusPath:m.string().min(1).optional()}),Ce=m.object({kind:m.string().min(1),schemaVersion:m.string().min(1),scope:e,dataExpression:m.string().optional()}),we=m.object({file:m.string().min(1),line:m.number().int().positive().optional(),column:m.number().int().positive().optional()}),E=m.enum([`station`,`delegate-agent`,`delegate-role`,`parallel`,`gate`,`iterate`,`iterate-chain`,`loop`,`sequence`]),Te=m.enum([`all-settled`,`fail-fast`]),D=m.object({id:m.string().min(1),when:w.optional(),skip:w.optional(),writes:m.array(Ce).optional()}),O=m.lazy(()=>m.discriminatedUnion(`type`,[A,Ee,De,Oe,ke,Ae,je,Ne,k])),k=D.extend({type:m.literal(`sequence`),nodes:m.lazy(()=>m.array(O))}),A=D.extend({type:m.literal(`station`),prompt:m.string().min(1),role:m.string().min(1).optional(),outputSchema:r.optional(),timeoutMs:m.number().int().positive().optional(),completion:u.optional()}),Ee=D.extend({type:m.literal(`delegate-agent`),agentId:m.string().min(1),inputExpression:m.string().optional(),outputSchema:r.optional(),allowedTools:m.array(m.string()).optional(),completion:u.optional(),resultFinalizerId:y.optional()}),De=D.extend({type:m.literal(`delegate-role`),role:m.string().min(1),prompt:m.string().min(1),outputSchema:r.optional(),allowedTools:m.array(m.string()).optional(),resultFinalizerId:y.optional(),timeoutMs:m.number().int().positive().optional(),completion:u.optional()}),Oe=D.extend({type:m.literal(`parallel`),mode:Te.optional(),branches:m.record(m.string().min(1),m.lazy(()=>k))}),ke=D.extend({type:m.literal(`gate`),prompt:m.string().min(1),title:m.string().optional(),autoAction:m.enum([`approve`,`reject`]),timeoutMs:m.number().int().positive().nullable(),resumeSchema:r.optional()}),Ae=D.extend({type:m.literal(`iterate`),collection:m.string().min(1),body:m.lazy(()=>k),concurrency:m.number().int().nonnegative().optional()}),je=D.extend({type:m.literal(`iterate-chain`),collection:m.string().min(1),body:m.lazy(()=>k)}),Me=m.discriminatedUnion(`kind`,[m.object({kind:m.literal(`pass`)}).strict(),m.object({kind:m.literal(`loop`)}).strict(),m.object({kind:m.literal(`escalate`),reason:m.string().min(1)}).strict()]),Ne=D.extend({type:m.literal(`loop`),maxRounds:m.number().int().positive(),body:m.lazy(()=>k),gate:m.object({handler:m.string().min(1),input:m.string().min(1).optional(),config:o.optional(),escalation:m.object({title:m.string().optional(),prompt:m.string().min(1),resumeSchema:r.optional(),autoAction:m.enum([`approve`,`reject`]).default(`reject`),timeoutMs:m.number().int().positive().nullable().default(null)}).strict().optional()}).strict()}),Pe=m.object({factoryId:m.string().min(1),preview:m.array(m.lazy(()=>O)).optional(),sourceLocation:we.optional()}),Fe=m.discriminatedUnion(`kind`,[m.object({kind:m.literal(`editor`)}).strict(),m.object({kind:m.literal(`extension`),extension:m.string().min(1),externalId:m.string().min(1).optional(),syncedAt:m.string().datetime().optional(),metadata:a.default({})}).strict()]),Ie=m.object({schema:r,initial:o.optional()}),Le=m.discriminatedUnion(`kind`,[m.object({kind:m.literal(`path`),path:m.string().min(1)}).strict(),m.object({kind:m.literal(`source`),filename:m.string().min(1),source:m.string()}).strict(),m.object({kind:m.literal(`definition`),workflowId:m.string().min(1)}).strict()]),j=m.object({id:m.string().min(1),name:m.string().optional(),description:m.string().optional(),inputSchema:r.optional(),configSchema:r.optional(),outputSchema:r.optional(),state:Ie.optional(),artifact:T.optional(),root:k,triggers:m.array(Se).optional(),scope:C.default({type:`global`}),canvasLayout:m.record(m.string(),o).optional(),source:Fe.optional(),executableSource:Le.optional(),requirements:f.optional(),successFinalizerId:v.optional()}),M=m.enum([`pending`,`running`,`paused`,`finalizing`,`completed`,`failed`,`cancelled`]),N=m.object({id:m.string(),workflowId:m.string(),coordinatorSessionId:m.string().optional(),status:M,inputs:o,config:a.optional(),startedAt:m.number(),completedAt:m.number().optional(),error:m.string().optional(),reason:m.string().optional(),triggerPayload:a.optional(),scope:C,artifactRef:_.optional()}),Re=m.object({frameId:m.string(),nodeId:m.string(),nodeType:E,path:m.array(m.string()),parentFrameId:m.string().optional(),status:m.enum([`pending`,`running`,`waiting`,`completed`,`failed`,`skipped`,`cancelled`]),attempt:m.number().int().nonnegative().default(0),iteration:m.number().int().nonnegative().optional(),branchKey:m.string().optional(),output:o.optional(),error:m.string().optional(),startedAt:m.number().optional(),completedAt:m.number().optional()}),P=m.enum([`waiting`,`resumed`,`rejected`,`timed-out`,`cancelled`]),ze=m.object({executionId:m.string(),nodeId:m.string(),frameId:m.string(),schema:r,prompt:m.string().optional(),status:P,autoAction:m.enum([`approve`,`reject`]),timeoutMs:m.number().int().positive().nullable(),resumeData:o.optional(),reason:m.string().optional(),createdAt:m.number(),resolvedAt:m.number().optional()}),F=m.object({adapterName:m.string().min(1),providerConfigId:m.string().min(1).optional(),model:m.string().optional(),reasoningEffort:c.optional(),harnessId:m.string().optional(),systemPrompt:m.string().optional(),contextMode:d.optional(),providerContext:l.optional(),adapterConfig:a.optional(),tools:m.array(m.string()).optional(),disallowedTools:m.array(m.string()).optional(),allowedDirectories:m.array(m.string()).optional(),completion:u.optional()}),Be=F,Ve=m.object({scope:C.optional()}),He=m.object({startedAt:m.number(),id:m.string()}),Ue=1,We=500,Ge=50,Ke=m.object({workflowId:m.string().min(1).optional(),scope:C.optional(),status:M.optional(),artifactRef:_.optional(),limit:m.number().int().min(1).max(500).default(50),cursor:He.optional()}).refine(e=>e.workflowId!==void 0||e.scope!==void 0||e.artifactRef!==void 0,{message:`Either workflowId, scope, or artifactRef is required.`}),qe=200,Je=100,Ye=10,Xe=m.object({refs:m.array(_).min(1).max(200),limitPerRef:m.number().int().min(1).max(100).default(10)}),Ze=m.object({executionId:m.string().min(1).optional(),status:P.optional(),limit:m.number().int().min(1).max(500).default(50)}).refine(e=>e.executionId!==void 0||e.status!==void 0,{message:`Either executionId or status is required.`}),I=m.enum([`station`,`delegate-agent`,`delegate-role`,`gate`]),Qe=m.enum([`station`]),$e=m.object({input:m.number().int().nonnegative(),output:m.number().int().nonnegative(),cached:m.number().int().nonnegative().optional()}),et=m.object({duration:m.number().nonnegative(),tokenUsage:$e.optional(),estimatedCost:m.number().nonnegative().optional(),toolCalls:m.number().int().nonnegative().optional()}),tt=m.discriminatedUnion(`kind`,[m.object({kind:m.literal(`none`)}).strict(),m.object({kind:m.literal(`hmac`),secret:m.string().min(1)}).strict()]),nt=m.object({cwd:m.string().min(1),env:m.record(m.string(),m.string()).optional()}),rt=m.object({executionId:m.string().min(1),stepId:m.string().min(1),reason:m.string().optional()});function it(e){let t=ie(e);if(t===void 0)throw Error(`Invalid step cancel subject: ${e}`);return{subject:t.subject,$meta:{namespace:t.namespace,isRequest:!1,payload:{},local:!1,channel:!1}}}const at=m.object({executionId:m.string().min(1),reason:m.string().optional()});function ot(e){let t=ie(e);if(t===void 0)throw Error(`Invalid workflow cancel subject: ${e}`);return{subject:t.subject,$meta:{namespace:t.namespace,isRequest:!1,payload:{},local:!1,channel:!1}}}const st=m.object({stepId:m.string().min(1),executionId:m.string().min(1),workflowId:m.string().min(1),coordinatorSessionId:m.string().min(1),stepType:Qe,stepDefinition:A,resolvedInputs:a,busUrl:m.string().optional(),busAuth:tt.default({kind:`none`}),platformDefaults:nt,cancelSubject:m.string().min(1)}).superRefine((e,t)=>{e.stepType!==e.stepDefinition.type&&t.addIssue({code:`custom`,path:[`stepDefinition`,`type`],message:`stepDefinition.type must match stepType (${e.stepType})`})}),ct=`Workflow cancelled`,lt=m.object({status:m.enum([`completed`,`failed`]),output:o.optional(),error:m.string().optional(),telemetry:et}),ut=m.enum([`running`,`completed`,`failed`,`skipped`]),dt=m.object({executionId:m.string().min(1),frameId:m.string().min(1),stepId:m.string().min(1),stepType:I,status:ut,startedAt:m.number().optional(),completedAt:m.number().optional(),durationMs:m.number().nonnegative().optional(),inputTokens:m.number().int().nonnegative().optional(),outputTokens:m.number().int().nonnegative().optional(),estimatedCost:m.number().nonnegative().optional(),toolCallCount:m.number().int().nonnegative().optional(),input:m.string().optional(),output:m.string().optional()}),ft=m.enum([`triggered-by`,`feedback-loop`,`rerun-of`]),L=m.object({sourceExecutionId:m.string().min(1),targetExecutionId:m.string().min(1),linkType:ft,metadata:m.record(m.string(),m.unknown()).optional()}),pt=m.object({sourceExecutionId:m.string().min(1).optional(),targetExecutionId:m.string().min(1).optional()}).refine(e=>e.sourceExecutionId!==void 0||e.targetExecutionId!==void 0,{message:`Either sourceExecutionId or targetExecutionId is required.`}),mt={RUN_CONTEXT_NOT_FOUND:`WORKFLOW_RUN_CONTEXT_NOT_FOUND`,SNAPSHOT_UNAVAILABLE:`WORKFLOW_SNAPSHOT_UNAVAILABLE`,SOURCE_MISMATCH:`WORKFLOW_SOURCE_MISMATCH`,NOT_EXECUTABLE:`WORKFLOW_NOT_EXECUTABLE`,HANDLER_UNAVAILABLE:`WORKFLOW_HANDLER_UNAVAILABLE`};var ht=class extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`WorkflowError`}};const R=m.string().refine(e=>e===``||e.startsWith(`/`),{message:`JSON Patch paths must be empty or start with "/".`}),gt=m.object({op:m.enum([`add`,`replace`,`test`]),path:R,value:o}).strict(),_t=m.object({op:m.literal(`remove`),path:R}).strict(),vt=m.object({op:m.enum([`move`,`copy`]),path:R,from:R}).strict(),z=m.discriminatedUnion(`op`,[gt,_t,vt]),yt=m.object({type:m.literal(`artifact-query`),query:n,select:m.enum([`latest`,`all`]),optional:m.boolean().optional()}),bt=m.object({type:m.literal(`bus-request`),subject:m.string().min(1),payload:m.record(m.string(),m.unknown()).optional(),optional:m.boolean().optional()}),xt=m.discriminatedUnion(`type`,[yt,bt]),St=m.object({type:m.literal(`artifact`),kind:m.string().min(1),schemaVersion:m.string().min(1),scope:e,metadata:m.record(m.string(),m.unknown()).optional()}),Ct=m.object({type:m.literal(`bus-event`),subject:m.string().min(1),payload:m.record(m.string(),m.unknown()).optional()}),wt=m.discriminatedUnion(`type`,[St,Ct]),Tt=m.object({content:m.string(),metadata:m.record(m.string(),m.unknown()).optional()}),Et=m.object({sources:m.record(m.string(),Tt)}),Dt=m.discriminatedUnion(`kind`,[m.object({kind:m.literal(`none`)}).strict(),m.object({kind:m.literal(`hmac`),secret:m.string().min(1)}).strict()]),Ot=m.discriminatedUnion(`kind`,[m.object({kind:m.literal(`path`),path:m.string().min(1)}).strict(),m.object({kind:m.literal(`source`),filename:m.string().min(1),source:m.string()}).strict(),m.object({kind:m.literal(`definition`),workflowId:m.string().min(1)}).strict()]),B=m.enum([`immediate`,`await-trigger`]),kt=m.object({source:Ot,definition:j.optional(),executionId:m.string().min(1),workflowId:m.string().min(1),triggerPayload:a.default({}),triggerMode:B.optional(),inputs:o.default({}),config:a.optional(),artifactRef:_.optional(),scope:C.default({type:`global`}),busUrl:m.string().optional(),busAuth:Dt.default({kind:`none`}),env:m.record(m.string(),m.string()).default({}),coordinatorSessionId:m.string().min(1),cancelSubject:m.string().min(1),suspensionStrategy:te.default(`wait-in-process`),terminalAuthority:m.enum([`worker`,`authority`]).optional(),materializationSpec:p.optional()}),V=m.object({executionId:m.string().min(1),workflowId:m.string().min(1)}),At=m.discriminatedUnion(`status`,[V.extend({status:m.literal(`completed`),artifact:t.optional()}).strict(),V.extend({status:m.literal(`failed`),error:m.string().min(1)}).strict(),V.extend({status:m.literal(`cancelled`),reason:m.string().min(1).optional()}).strict(),V.extend({status:m.literal(`paused`),pausedAtGateId:m.string().min(1),pausedAtFrameId:m.string().min(1)}).strict()]),jt=m.object({contributionRefs:m.array(ee)}).strict(),Mt=m.discriminatedUnion(`kind`,[m.object({kind:m.literal(`path`),path:m.string().min(1).refine(e=>!e.startsWith(`/`)&&!/^[A-Za-z]:[/\\]/.test(e),{message:`path must be workspace-relative (no leading / or drive letter)`})}).strict(),m.object({kind:m.literal(`source`),filename:m.string().min(1),source:m.string()}).strict(),m.object({kind:m.literal(`definition`),workflowId:m.string().min(1)}).strict()]),Nt=m.object({executionId:m.string().min(1),workflowId:m.string().min(1),source:Mt,definitionSnapshot:j.optional(),workerManifest:jt.default({contributionRefs:[]}),inputs:o.default({}),config:a.optional(),scope:C.default({type:`global`}),triggerPayload:a.default({}),triggerMode:B.optional(),artifactRef:_.optional(),coordinatorSessionId:m.string().min(1),dispatchMetadata:a.optional(),cancelSubject:m.string().min(1),env:m.record(m.string(),m.string()).default({}),createdAt:m.number(),suspensionStrategy:te.default(`wait-in-process`),terminalAuthority:m.enum([`worker`,`authority`]).optional(),materializationSpec:p.optional()}).superRefine((e,t)=>{e.source.kind===`definition`&&e.definitionSnapshot===void 0&&t.addIssue({code:m.ZodIssueCode.custom,path:[`definitionSnapshot`],message:`definitionSnapshot is required when source.kind is "definition"`}),e.source.kind===`path`?e.materializationSpec===void 0?t.addIssue({code:m.ZodIssueCode.custom,path:[`materializationSpec`],message:`materializationSpec is required when source.kind is "path"`}):e.materializationSpec.sourcePath!==e.source.path&&t.addIssue({code:m.ZodIssueCode.custom,path:[`materializationSpec`,`sourcePath`],message:`materializationSpec.sourcePath must match source.path`}):e.materializationSpec!==void 0&&t.addIssue({code:m.ZodIssueCode.custom,path:[`materializationSpec`],message:`materializationSpec is only valid when source.kind is "path"`})}),H=m.object({executionId:m.string().min(1),workflowId:m.string().min(1),workflowName:m.string().optional(),status:m.enum([`pending`,`running`,`paused`,`finalizing`,`completed`,`failed`,`cancelled`]),startedAt:m.number(),completedAt:m.number().optional(),durationMs:m.number().nonnegative().optional(),totalInputTokens:m.number().int().nonnegative().optional(),totalOutputTokens:m.number().int().nonnegative().optional(),totalEstimatedCost:m.number().nonnegative().optional(),error:m.string().optional(),failedNodeId:m.string().optional()}),Pt=m.object({executionId:m.string().min(1),frameId:m.string().min(1),nodeId:m.string().min(1),nodeType:E,path:m.array(m.string()),status:m.enum([`pending`,`running`,`waiting`,`completed`,`failed`,`skipped`,`cancelled`]),attempt:m.number().int().nonnegative(),iteration:m.number().int().nonnegative().optional(),branchKey:m.string().optional(),startedAt:m.number().optional(),completedAt:m.number().optional(),durationMs:m.number().nonnegative().optional(),inputTokens:m.number().int().nonnegative().optional(),outputTokens:m.number().int().nonnegative().optional(),estimatedCost:m.number().nonnegative().optional(),error:m.string().optional()}),Ft=m.object({executionId:m.string().min(1),frameId:m.string().min(1),nodeId:m.string().min(1),artifact:T,revision:m.string().min(1).optional(),writtenAt:m.number()}),It=m.object({executionId:m.string().min(1),nodeId:m.string().min(1),frameId:m.string().min(1),status:m.enum([`waiting`,`resumed`,`rejected`,`timed-out`,`cancelled`]),prompt:m.string().optional(),openedAt:m.number(),resolvedAt:m.number().optional(),resumeData:o.optional()}),Lt=m.object({executionId:m.string().min(1),inputTokens:m.number().int().nonnegative(),outputTokens:m.number().int().nonnegative(),cachedTokens:m.number().int().nonnegative().optional(),estimatedCost:m.number().nonnegative(),byModel:m.record(m.string(),m.object({inputTokens:m.number().int().nonnegative(),outputTokens:m.number().int().nonnegative(),estimatedCost:m.number().nonnegative()})).optional()}),Rt=m.object({total:m.number().int().nonnegative(),byStatus:m.object({pending:m.number().int().nonnegative(),running:m.number().int().nonnegative(),paused:m.number().int().nonnegative(),finalizing:m.number().int().nonnegative(),completed:m.number().int().nonnegative(),failed:m.number().int().nonnegative(),cancelled:m.number().int().nonnegative()}),totalDurationMs:m.number().nonnegative(),totalInputTokens:m.number().int().nonnegative(),totalOutputTokens:m.number().int().nonnegative(),totalEstimatedCost:m.number().nonnegative()}),zt=m.object({executionId:m.string().min(1),frameId:m.string().min(1),factoryId:m.string().min(1),materializedNodeIds:m.array(m.string().min(1)),factoryInput:r.optional(),materializedAt:m.number()}),Bt=`wfx-ext-`,Vt=m.object({frameId:m.string().min(1).optional(),nodeId:m.string().min(1),nodeType:I,path:m.array(m.string().min(1)).optional(),attempt:m.number().int().nonnegative().default(0),iteration:m.number().int().nonnegative().optional(),branchKey:m.string().min(1).optional(),startedAt:m.number().int().nonnegative().optional()}).strict(),Ht=m.object({frameId:m.string().min(1),nodeId:m.string().min(1),nodeType:I,path:m.array(m.string().min(1)),attempt:m.number().int().nonnegative().default(0),iteration:m.number().int().nonnegative().optional(),branchKey:m.string().min(1).optional(),startedAt:m.number().int().nonnegative(),durationMs:m.number().int().nonnegative().optional()}).strict(),Ut=m.object({executionId:m.string().startsWith(Bt,{message:`executionId must use the wfx-ext- prefix`}).optional(),name:m.string().min(1),startedAt:m.number().int().nonnegative().optional(),scope:C.optional(),artifactRef:_.optional(),input:o.optional(),triggerPayload:a.optional(),frame:Vt.optional()}).superRefine((e,t)=>{e.executionId!==void 0&&e.startedAt===void 0&&t.addIssue({code:m.ZodIssueCode.custom,message:`startedAt is required when executionId is supplied`,path:[`startedAt`]})}),Wt=m.object({executionId:m.string().min(1),status:m.enum([`completed`,`failed`,`cancelled`]),error:m.string().min(1).optional(),reason:m.string().min(1).optional(),completedAt:m.number().nonnegative().overwrite(e=>Math.trunc(e)).optional(),frame:Ht.optional()}).superRefine((e,t)=>{if(e.status===`failed`&&e.error===void 0&&t.addIssue({code:m.ZodIssueCode.custom,message:`status 'failed' requires a non-empty 'error' message`,path:[`error`]}),e.status===`cancelled`&&e.reason===void 0&&t.addIssue({code:m.ZodIssueCode.custom,message:`status 'cancelled' requires a non-empty 'reason' string`,path:[`reason`]}),e.status===`completed`&&e.error!==void 0&&t.addIssue({code:m.ZodIssueCode.custom,message:`status 'completed' must not carry an 'error'`,path:[`error`]}),e.status===`completed`&&e.reason!==void 0&&t.addIssue({code:m.ZodIssueCode.custom,message:`status 'completed' must not carry a 'reason'`,path:[`reason`]}),e.frame!==void 0&&e.completedAt===void 0&&t.addIssue({code:m.ZodIssueCode.custom,message:`completedAt is required when frame metadata is supplied`,path:[`completedAt`]}),e.frame!==void 0&&e.completedAt!==void 0){let n=e.completedAt-e.frame.startedAt;n<0&&t.addIssue({code:m.ZodIssueCode.custom,message:`completedAt must not precede frame.startedAt`,path:[`completedAt`]}),e.frame.durationMs!==void 0&&e.frame.durationMs!==n&&t.addIssue({code:m.ZodIssueCode.custom,message:`frame.durationMs must equal completedAt - frame.startedAt`,path:[`frame`,`durationMs`]})}}),Gt=m.object({message:m.string().min(1),details:m.string().min(1).optional(),kind:m.string().min(1).optional(),metadata:o.optional()}).strict(),U=m.object({executionId:m.string(),stepId:m.string(),stepType:m.enum([`station`,`delegate-agent`,`delegate-role`,`gate`])}),W=U.extend({stepType:m.literal(`gate`)}),Kt=m.discriminatedUnion(`source`,[W.extend({frameId:m.string(),action:m.enum([`approve`,`reject`]),source:m.literal(`user`),reason:m.string().optional()}),W.extend({frameId:m.string(),action:m.enum([`approve`,`reject`]),source:m.literal(`timeout`)}),W.extend({frameId:m.string(),source:m.literal(`cancelled`)})]),qt=W.extend({workflowId:m.string(),workflowName:m.string(),title:m.string(),message:m.string(),autoAction:m.enum([`approve`,`reject`]),timeoutMs:m.number().nullable(),openedAt:m.number()}),Jt={getDefinition:{request:m.object({id:m.string()}),response:m.object({workflow:j.nullable()})},setDefinition:{request:m.object({workflow:j}),response:m.object({id:m.string()})},deleteDefinition:{request:m.object({id:m.string()}),response:m.object({deleted:m.boolean()})},listDefinitions:{request:Ve,response:m.object({workflows:m.array(j)})},"definition.created":j,"definition.updated":j,"definition.deleted":m.object({id:m.string()}),start:{request:m.object({workflowId:m.string(),input:o.optional(),config:o.optional(),artifactRef:_.optional(),scope:C.optional(),parentSessionId:m.string().optional(),triggerPayload:a.optional()}),response:m.object({executionId:m.string()})},rerun:{request:m.object({executionId:m.string().min(1),mode:m.enum([`snapshot`,`current`]),input:o.optional(),config:o.optional(),artifactRef:_.optional(),scope:C.optional(),parentSessionId:m.string().optional(),triggerPayload:a.optional(),reason:m.string().min(1).optional()}),response:m.object({executionId:m.string()})},cancel:{request:m.object({executionId:m.string(),reason:m.string().optional()}),response:m.object({cancelled:m.boolean()})},bootstrapAuthorityState:{request:m.object({executionId:m.string().min(1),terminalAuthority:m.literal(`authority`),definition:j}).strict(),response:m.object({persisted:m.boolean()})},acceptAuthorityRunnerResult:{request:m.object({executionId:m.string().min(1),result:At.refine(e=>e.status!==`paused`,{message:`Authority runner results must be terminal`})}).strict().superRefine((e,t)=>{e.result.executionId!==e.executionId&&t.addIssue({code:m.ZodIssueCode.custom,path:[`result`,`executionId`],message:`result.executionId must match executionId`})}),response:m.object({accepted:m.boolean(),status:M})},finalizeDelegateResult:{request:_e,response:x},getExecution:{request:m.object({executionId:m.string()}),response:m.object({execution:N.nullable()})},listExecutions:{request:Ke,response:m.object({executions:m.array(N)})},listExecutionsByArtifactRefs:{request:Xe,response:m.object({executionsByRef:m.record(m.string(),m.array(N))})},listSpans:{request:m.object({executionId:m.string()}),response:m.object({spans:m.array(dt)})},listGateInstances:{request:Ze,response:m.object({gates:m.array(ze)})},setExecutionLink:{request:m.object({link:L}),response:m.object({id:m.string()})},listExecutionLinks:{request:pt,response:m.object({links:m.array(L)})},listFrames:{request:m.object({executionId:m.string().min(1)}),response:m.object({frames:m.array(Re)})},runFile:{request:m.object({filePath:m.string().min(1),materializationSpec:p.optional(),triggerPayload:a.optional(),triggerMode:B.default(`immediate`),scope:C.optional()}),response:m.object({executionId:m.string()})},registerExternalExecution:{request:Ut,response:m.object({executionId:m.string(),frameId:m.string().optional()})},completeExternalExecution:{request:Wt,response:m.object({success:m.boolean()})},resolveRole:{request:m.object({roleId:m.string().min(1)}),response:F},resolveAgent:{request:m.object({agentId:m.string().min(1)}),response:Be},getRunContext:{request:m.object({executionId:m.string().min(1)}),response:Nt},"execution.started":m.object({executionId:m.string(),workflowId:m.string(),coordinatorSessionId:m.string().optional(),startedAt:m.number().nonnegative().optional(),artifactRef:_.optional()}),"execution.completed":m.object({executionId:m.string(),workflowId:m.string(),totalDuration:m.number(),completedAt:m.number().nonnegative().optional(),transitionKey:m.string().min(1).optional()}),"execution.failed":m.object({executionId:m.string(),workflowId:m.string(),error:m.string(),failedStepId:m.string().optional(),completedAt:m.number().nonnegative().optional(),transitionKey:m.string().min(1).optional()}),"execution.cancelled":m.object({executionId:m.string(),workflowId:m.string(),reason:m.string().optional(),completedAt:m.number().nonnegative().optional(),transitionKey:m.string().min(1).optional()}),"execution.progress":m.object({executionId:m.string().min(1),workflowId:m.string().min(1),frameId:m.string().min(1),nodeId:m.string().min(1),progress:Gt,emittedAt:m.number().int().nonnegative()}),"execution.paused":g.schema(m.object({executionId:m.string(),workflowId:m.string(),pausedAtGateId:m.string().min(1),pausedAtFrameId:m.string().min(1)}),{traceAll:!0}),"step.beforeStart":U,"step.started":U.extend({sessionId:m.string().optional(),subagentId:m.string().optional()}),"step.completed":U.extend({result:o.optional(),duration:m.number()}),"step.failed":U.extend({error:m.string()}),"step.skipped":U.extend({reason:m.string().optional(),condition:m.string().optional()}),"gate.requested":qt,"gate.awaitApproval":{request:qt,response:m.object({action:m.enum([`approve`,`reject`]),source:m.enum([`user`,`timeout`]),reason:m.string().optional()})},"gate.respond":{request:m.object({executionId:m.string(),gateId:m.string(),action:m.enum([`approve`,`reject`]),frameId:m.string().optional(),resumeData:o,reason:m.string().optional()}),response:m.object({accepted:m.boolean()})},"gate.resolved":Kt,"frame.started":m.object({executionId:m.string(),frameId:m.string(),nodeId:m.string(),nodeType:E,path:m.array(m.string()),parentFrameId:m.string().optional(),startedAt:m.number().nonnegative().optional()}),"frame.completed":m.object({executionId:m.string(),frameId:m.string(),nodeId:m.string(),output:o.optional(),duration:m.number().nonnegative().optional(),completedAt:m.number().nonnegative().optional()}),"frame.failed":m.object({executionId:m.string(),frameId:m.string(),nodeId:m.string(),error:m.string(),duration:m.number().nonnegative().optional(),completedAt:m.number().nonnegative().optional()}),"frame.sessionLinked":m.object({executionId:g.attribute(m.string(),`makaio.execution.id`),frameId:g.attribute(m.string(),`makaio.frame.id`),sessionId:g.attribute(m.string(),`makaio.session.id`)}).strict(),"gate.suspended":m.object({executionId:m.string(),frameId:m.string(),nodeId:m.string(),schema:r,prompt:m.string().optional(),title:m.string().optional(),autoAction:m.enum([`approve`,`reject`]),timeoutMs:m.number().nullable(),openedAt:m.number()}),"gate.resumed":m.object({executionId:m.string(),frameId:m.string(),nodeId:m.string(),resumeData:o}),"dynamic.materialized":m.object({executionId:m.string(),frameId:m.string(),factoryId:m.string().min(1),materializedNodes:m.number().int().nonnegative()}),"artifact.updated":m.object({executionId:m.string(),frameId:m.string(),artifactRef:m.object({kind:m.string().min(1),id:m.string().min(1)}),paths:m.array(m.string()),operation:m.string().min(1),revision:m.string().min(1).optional()}),"worklog.get":{request:m.object({executionId:m.string().min(1)}),response:m.object({summary:H.nullable()})},"worklog.frame.get":{request:m.object({frameId:m.string().min(1)}),response:m.object({frame:Pt.nullable()})},"worklog.list":{request:m.object({workflowId:m.string().min(1).optional(),status:M.optional(),limit:m.number().int().positive().optional(),offset:m.number().int().nonnegative().optional()}),response:m.object({items:m.array(H),total:m.number().int().nonnegative()})},"worklog.stats":{request:m.object({workflowId:m.string().min(1).optional(),since:m.number().int().nonnegative().optional(),until:m.number().int().nonnegative().optional()}),response:m.object({stats:Rt})},"worklog.changed":m.object({executionId:m.string().min(1)}),"state.get":{request:m.object({executionId:m.string().min(1)}),response:m.object({executionId:m.string().min(1),sequence:m.number().int().nonnegative(),value:o})},"state.patch":{request:m.object({executionId:m.string().min(1),expectedSequence:m.number().int().nonnegative(),patch:m.array(z),nextValue:o}),response:m.object({executionId:m.string().min(1),sequence:m.number().int().positive(),value:o})},"state.updated":m.object({executionId:m.string().min(1),sequence:m.number().int().positive(),patch:m.array(z),value:o,updatedAt:m.number().int().positive()})},Yt=h(`workflow`,Jt),Xt=Yt.subjects;function Zt(e,t){G(e,t,void 0,0,[],`root`,void 0,void 0)}function G(e,t,n,r,i,a,o,s){let c={parent:n,depth:r,ancestors:i,relationship:a,...o!==void 0&&{index:o},...s!==void 0&&{branchKey:s}};if(t.enter?.(e,c)===!1)return;let l=[...i,e.id],u=r+1;switch(e.type){case`sequence`:{let n=e;for(let r=0;r<n.nodes.length;r++)G(n.nodes[r],t,e,u,l,`sequence-child`,r,void 0);break}case`parallel`:{let n=e;for(let[r,i]of Object.entries(n.branches))G(i,t,e,u,l,`parallel-branch`,void 0,r);break}case`iterate`:G(e.body,t,e,u,l,`iterate-body`,void 0,void 0);break;case`iterate-chain`:G(e.body,t,e,u,l,`iterate-chain-body`,void 0,void 0);break;case`loop`:G(e.body,t,e,u,l,`loop-body`,void 0,void 0);break}t.leave?.(e,c)}function Qt(e){switch(e){case`station`:case`delegate-agent`:case`delegate-role`:case`gate`:return`leaf`;case`parallel`:case`iterate`:case`iterate-chain`:case`loop`:return`control`;case`sequence`:return`structural`}}function $t(e,t,n){return e===`parallel-branch`&&t!==void 0?[{kind:`branch`,key:t}]:e===`sequence-child`&&n!==void 0?[{kind:`index`,value:n}]:e===`iterate-body`||e===`iterate-chain-body`||e===`loop-body`?[{kind:`body`}]:[]}function en(e){return e.replace(/\\/g,`\\\\`).replace(/\//g,`\\/`)}function tn(e){return e.map(e=>{switch(e.kind){case`node`:return`n:${en(e.id)}`;case`branch`:return`b:${en(e.key)}`;case`index`:return`i:${e.value}`;case`body`:return`body`}}).join(`/`)}function nn(e){let t=[],n=[],r=new Map,i=[],a=[],o=[];return Zt(e.root,{enter(e,s){let c=$t(s.relationship,s.branchKey,s.index),l={kind:`node`,id:e.id};i.push(...c,l),o.push(c.length+1);let u=[...i],d=tn(u),f=a.at(-1);if(t.push({key:d,nodeId:e.id,type:e.type,role:Qt(e.type),path:u,parentKey:f,...s.branchKey!==void 0&&{branchKey:s.branchKey}}),f!==void 0&&s.parent!==void 0)switch(s.parent.type){case`sequence`:{n.push({sourceKey:f,targetKey:d,kind:`contains`});let e=r.get(f);e!==void 0&&n.push({sourceKey:e,targetKey:d,kind:`sequence`}),r.set(f,d);break}case`parallel`:n.push({sourceKey:f,targetKey:d,kind:`branch`});break;case`iterate`:case`iterate-chain`:case`loop`:n.push({sourceKey:f,targetKey:d,kind:`body`});break;default:n.push({sourceKey:f,targetKey:d,kind:`contains`});break}a.push(d)},leave(){let e=o.pop()??0;i.splice(i.length-e,e),a.pop()}}),{nodes:t,edges:n}}const rn=`makaio.bus-event`,an=`makaio.cron`,on=`UTC`;function K(e,t,n){return{kind:e,params:t,...n.filter!==void 0&&{filter:n.filter},...n.filterExpression!==void 0&&{filterExpression:n.filterExpression}}}function sn(e,t){let n=i.parse(t.params);return e.paramsSchema.parse(n),K(e.kind,n,t)}function cn(e){return K(rn,{subject:re(e.subject)},e)}const ln=m.object({schedule:m.string().min(1),timezone:m.string().min(1).default(`UTC`)});function un(e){return K(an,ln.parse(e),{})}function q(e){return J(e.body.nodes,e.id)}function J(e,t){for(let n of e){if(n.type===`loop`)return`Nested loop '${n.id}' found inside loop '${t}' — V1 does not support nested loops`;if(n.type===`sequence`){let e=J(n.nodes,t);if(e)return e}if(n.type===`parallel`)for(let e of Object.values(n.branches)){let n=J(e.nodes,t);if(n)return n}if(n.type===`iterate`||n.type===`iterate-chain`){let e=n.body,r=J(e.nodes,t);if(r)return r}}}const Y=new WeakMap,dn=new WeakMap;function X(e,t,n){let r=Y.get(e);if(r!==void 0&&t.set(e.id,r),e.type===`sequence`)for(let r of e.nodes)X(r,t,n);else if(e.type===`parallel`)for(let r of Object.values(e.branches))X(r,t,n);else if(e.type===`iterate`)X(e.body,t,n);else if(e.type===`iterate-chain`)X(e.body,t,n);else if(e.type===`loop`){if(n!==void 0){let t=dn.get(e);t!==void 0&&n.set(e.gate.handler,t)}X(e.body,t,n)}}function fn(e,t,n){let r={id:e,type:`station`,prompt:e,...n?.when!==void 0&&{when:n.when},...n?.skip!==void 0&&{skip:n.skip}};return Y.set(r,t),r}function pn(e,t,n){return{id:e,type:`delegate-agent`,agentId:t.agentId,...t.inputExpression!==void 0&&{inputExpression:t.inputExpression},...t.outputSchema!==void 0&&{outputSchema:t.outputSchema},...t.allowedTools!==void 0&&{allowedTools:t.allowedTools},...t.completion!==void 0&&{completion:t.completion},...t.resultFinalizerId!==void 0&&{resultFinalizerId:t.resultFinalizerId},...n?.when!==void 0&&{when:n.when},...n?.skip!==void 0&&{skip:n.skip}}}function mn(e,t,n){return{id:e,type:`delegate-role`,role:t,prompt:n?.prompt??e,...n?.when!==void 0&&{when:n.when},...n?.skip!==void 0&&{skip:n.skip},...n?.outputSchema!==void 0&&{outputSchema:n.outputSchema},...n?.timeoutMs!==void 0&&{timeoutMs:n.timeoutMs},...n?.completion!==void 0&&{completion:n.completion},...n?.allowedTools!==void 0&&{allowedTools:n.allowedTools},...n?.resultFinalizerId!==void 0&&{resultFinalizerId:n.resultFinalizerId}}}function hn(e,t){return{id:e,type:`gate`,prompt:t.prompt,autoAction:t.autoAction,timeoutMs:t.timeoutMs,...t.title!==void 0&&{title:t.title},...t.resume!==void 0&&{resumeSchema:s(t.resume)}}}function gn(e,t,n){let r=`${e}__item`,i={id:r,type:`station`,prompt:r},a={id:e,type:`iterate`,collection:n.collection,body:{id:`${e}__body`,type:`sequence`,nodes:[i]},...n.concurrency!==void 0&&{concurrency:n.concurrency},...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}};return Y.set(i,t),a}function _n(e,t,n){return{id:e,type:`iterate-chain`,collection:n.collection,body:{id:`${e}__body`,type:`sequence`,nodes:t},...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}}}function vn(e,t,n){let r={id:e,type:`loop`,maxRounds:n.maxRounds,body:{id:`${e}__body`,type:`sequence`,nodes:t},gate:yn(n),...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}},i=q(r);if(i!==void 0)throw Error(i);return dn.set(r,n.gate.evaluate),r}function yn(e){let t=e.gate.escalation;return{handler:e.gate.handler,...e.gate.input!==void 0&&{input:e.gate.input},...e.gate.config!==void 0&&{config:e.gate.config},...t!==void 0&&{escalation:{prompt:t.prompt,autoAction:t.autoAction??`reject`,timeoutMs:t.timeoutMs??null,...t.title!==void 0&&{title:t.title},...t.resumeSchema!==void 0&&{resumeSchema:t.resumeSchema}}}}}function Z(e,t){if(e.has(t))throw Error(`Duplicate step ID: ${t}`);e.add(t)}function Q(e,t){if(Z(e,t.id),t.type===`sequence`)for(let n of t.nodes)Q(e,n);else if(t.type===`parallel`)for(let n of Object.values(t.branches))Q(e,n);else (t.type===`iterate`||t.type===`iterate-chain`||t.type===`loop`)&&Q(e,t.body)}function bn(e,t,n,r,i){let a={};return t.forEach((t,o)=>{if(t.id.length===0)throw Error(`parallel branch at index ${o} has an empty ID`);let s=t.id,c=`${e}__${s}`;Q(n,t),Z(n,c),X(t,r,i),a[s]={id:c,type:`sequence`,nodes:[t]}}),a}function xn(e,t,n,r,i){let a=`${e}__body`,o=`${e}__item`;Z(r,a),Z(r,o),i.set(o,t);let s={id:o,type:`station`,prompt:o};return{id:e,type:`iterate`,collection:n.collection,body:{id:a,type:`sequence`,nodes:[s]},...n.concurrency!==void 0&&{concurrency:n.concurrency},...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}}}function Sn(e,t,n){return t.resume!==void 0&&(n[e]=t.resume),{id:e,type:`gate`,prompt:t.prompt,autoAction:t.autoAction,timeoutMs:t.timeoutMs,...t.title!==void 0&&{title:t.title},...t.resume!==void 0&&{resumeSchema:s(t.resume)}}}function Cn(e,t,n,r,i,a){let o=`${e}__body`;Z(r,o);for(let e of t)Q(r,e),X(e,i,a);return{id:e,type:`iterate-chain`,collection:n.collection,body:{id:o,type:`sequence`,nodes:t},...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}}}function wn(e,t,n,r,i,a){let o=`${e}__body`;Z(r,o);for(let e of t)Q(r,e),X(e,i,a);let s={id:e,type:`loop`,maxRounds:n.maxRounds,body:{id:o,type:`sequence`,nodes:t},gate:yn(n),...n.when!==void 0&&{when:n.when},...n.skip!==void 0&&{skip:n.skip}},c=q(s);if(c!==void 0)throw Error(c);return a.set(n.gate.handler,n.gate.evaluate),s}function Tn(e,t){e.input=n=>(t.zodSchemas.input=n,t.definition.inputSchema=s(n),e),e.config=n=>(t.zodSchemas.config=n,t.definition.configSchema=s(n),e),e.output=n=>(t.zodSchemas.output=n,t.definition.outputSchema=s(n),e),e.artifact=n=>(n.schema!==void 0&&(t.zodSchemas.artifact=n.schema),t.definition.artifact={kind:n.kind,schemaVersion:n.schemaVersion,scope:n.scope,...n.resolve!==void 0&&{resolve:n.resolve},...n.create!==void 0&&{create:n.create},...n.statusPath!==void 0&&{statusPath:n.statusPath}},e),e.state=e=>(t.definition.state={schema:e.schema,...e.initial!==void 0&&{initial:e.initial}},$(t))}function En(e,t){let{rootNodes:n,runtimeHandlers:r,runtimeLoopGates:i,registeredIds:a,zodGates:o}=t;e.station=(t,i,o)=>(Z(a,t),n.push({id:t,type:`station`,prompt:t,...o?.when!==void 0&&{when:o.when},...o?.skip!==void 0&&{skip:o.skip}}),r.set(t,i),e),e.delegateToAgent=(t,r,i)=>(Z(a,t),n.push(pn(t,r,i)),e),e.delegateToRole=(t,r,i)=>(Z(a,t),n.push(mn(t,r,i)),e),e.parallel=(t,o,s)=>(Z(a,t),n.push({id:t,type:`parallel`,mode:o.mode??`all-settled`,branches:bn(t,s,a,r,i),...o.when!==void 0&&{when:o.when},...o.skip!==void 0&&{skip:o.skip}}),e),e.gate=(t,r)=>(Z(a,t),n.push(Sn(t,r,o)),e),e.iterate=(t,i,o)=>(Z(a,t),n.push(xn(t,i,o,a,r)),e),e.iterateChain=(t,o,s)=>(Z(a,t),n.push(Cn(t,o,s,a,r,i)),e),e.loop=(t,o,s)=>(Z(a,t),n.push(wn(t,o,s,a,r,i)),e),e.addNode=e=>Dn(e,a,r,i,n)}function Dn(e,t,n,r,i){Q(t,e),X(e,n,r),i.push(e)}function $(e){let t={id:e.definition.id,definition:e.definition,runtimeHandlers:e.runtimeHandlers,runtimeFactories:e.runtimeFactories,runtimeLoopGates:e.runtimeLoopGates,source:void 0,get zodSchemas(){return e.zodSchemas},addTrigger(t){return e.triggers.push(t),$(e)}};return Tn(t,e),En(t,e),t}function On(e,t){let n=[],r=new Map,i=new Map,a=new Set,o={},s={gates:o},c=new Map,l=t?.triggers?[...t.triggers]:[];return $({rootNodes:n,runtimeHandlers:r,runtimeFactories:c,runtimeLoopGates:i,registeredIds:a,zodGates:o,zodSchemas:s,definition:{id:e,...t?.name!==void 0&&{name:t.name},...t?.description!==void 0&&{description:t.description},...t?.successFinalizerId!==void 0&&{successFinalizerId:v.parse(t.successFinalizerId)},root:{id:`${e}__root`,type:`sequence`,nodes:n},triggers:l,scope:{type:`global`}},triggers:l})}function kn(e){if(e.workflows.length===0)throw Error(`defineWorkflowBundle: workflows must not be empty`);return{workflows:Object.freeze([...e.workflows])}}const An=m.enum([`artifact.created`,`artifact.revised`,`artifact.status.changed`]),jn=m.record(m.string(),o),Mn=m.object({type:m.string().min(1),input:m.record(m.string(),o).optional()}),Nn=m.object({id:m.string().min(1),description:m.string().optional(),on:An,when:jn.optional(),action:Mn,enabled:m.boolean().default(!0)});export{xt as $,D as $t,Ht as A,M as At,Nt as B,Ee as Bt,Zt as C,_ as Cn,Je as Ct,Xt as D,Ue as Dt,Jt as E,We as Et,H as F,Ce as Ft,kt as G,Re as Gt,At as H,Pe as Ht,Pt as I,Se as It,yt as J,P as Jt,Ot as K,ze as Kt,It as L,w as Lt,Ut as M,Ze as Mt,Ft as N,Me as Nt,Wt as O,He as Ot,zt as P,T as Pt,wt as Q,Ne as Qt,Rt as R,Fe as Rt,nn as S,ve as Sn,Ye as St,Gt as T,ae as Tn,Ge as Tt,B as U,N as Ut,jt as V,De as Vt,Dt as W,C as Wt,bt as X,Ae as Xt,Ct as Y,je as Yt,Et as Z,Ve as Zt,cn as _,pe as _n,at as _t,kn as a,F as an,L as at,un as b,ue as bn,it as bt,mn as c,Ie as cn,ut as ct,_n as d,_e as dn,lt as dt,O as en,Tt as et,vn as f,b as fn,tt as ft,rn as g,fe as gn,ct as gt,sn as h,he as hn,$e as ht,Nn as i,Be as in,pt as it,Vt as j,Xe as jt,Bt as k,Ke as kt,hn as l,A as ln,rt as lt,q as m,y as mn,et as mt,jn as n,Te as nn,ht as nt,On as o,k as on,ft as ot,fn as p,x as pn,nt as pt,St as q,ke as qt,An as r,Oe as rn,mt as rt,pn as s,we as sn,dt as st,Mn as t,E as tn,z as tt,gn as u,ge as un,st as ut,an as v,de as vn,Qe as vt,Yt as w,oe as wn,qe as wt,on as x,ye as xn,ot as xt,ln as y,v as yn,I as yt,Lt as z,j as zt};
@@ -1,2 +1,2 @@
1
- import { A as RecoverableAttemptRecord, C as ProvisioningClaimDecision, D as RecordProviderOperationUncertaintyInput, E as RecordInfrastructureFailureInput, M as TakeOverProviderOperationInput, N as sameAllocationRef, O as RecordProvisionerIncarnationLostInput, P as sameWorkflowResult, S as ProvisioningAbsenceDecision, T as RecordAllocationTerminatedInput, _ as ExecutionAttemptStatus, a as BeginProvisioningInput, b as PendingAttemptAbandonmentDecision, c as EXECUTION_ATTEMPT_SETTLEMENT_KINDS, d as ExecutionAttemptOutcomeCommit, f as ExecutionAttemptOutcomeDecision, g as ExecutionAttemptSettlementKind, h as ExecutionAttemptRepository, i as AllocationTerminationDecision, j as RenewProviderOperationClaimInput, k as RecordProvisioningAbsentInput, l as EXECUTION_ATTEMPT_STATUSES, m as ExecutionAttemptRecoveryOperations, n as AllocationRefEvolution, o as DiscoveredAllocationDecision, p as ExecutionAttemptRecord, r as AllocationRefEvolutionDecision, s as DuplicateExecutionAttemptError, t as AllocationRecordingDecision, u as ExecutionAttemptCreate, v as HandoffProviderOperationInput, w as RecordAllocationInput, x as ProvisionerIncarnationLossDecision, y as InfrastructureFailureDecision } from "../execution-attempt-repository-DFyAnchJ.mjs";
1
+ import { A as RecoverableAttemptRecord, C as ProvisioningClaimDecision, D as RecordProviderOperationUncertaintyInput, E as RecordInfrastructureFailureInput, M as TakeOverProviderOperationInput, N as sameAllocationRef, O as RecordProvisionerIncarnationLostInput, P as sameWorkflowResult, S as ProvisioningAbsenceDecision, T as RecordAllocationTerminatedInput, _ as ExecutionAttemptStatus, a as BeginProvisioningInput, b as PendingAttemptAbandonmentDecision, c as EXECUTION_ATTEMPT_SETTLEMENT_KINDS, d as ExecutionAttemptOutcomeCommit, f as ExecutionAttemptOutcomeDecision, g as ExecutionAttemptSettlementKind, h as ExecutionAttemptRepository, i as AllocationTerminationDecision, j as RenewProviderOperationClaimInput, k as RecordProvisioningAbsentInput, l as EXECUTION_ATTEMPT_STATUSES, m as ExecutionAttemptRecoveryOperations, n as AllocationRefEvolution, o as DiscoveredAllocationDecision, p as ExecutionAttemptRecord, r as AllocationRefEvolutionDecision, s as DuplicateExecutionAttemptError, t as AllocationRecordingDecision, u as ExecutionAttemptCreate, v as HandoffProviderOperationInput, w as RecordAllocationInput, x as ProvisionerIncarnationLossDecision, y as InfrastructureFailureDecision } from "../execution-attempt-repository-BJ2W6wwx.mjs";
2
2
  export { AllocationRecordingDecision, AllocationRefEvolution, AllocationRefEvolutionDecision, AllocationTerminationDecision, BeginProvisioningInput, DiscoveredAllocationDecision, DuplicateExecutionAttemptError, EXECUTION_ATTEMPT_SETTLEMENT_KINDS, EXECUTION_ATTEMPT_STATUSES, ExecutionAttemptCreate, ExecutionAttemptOutcomeCommit, ExecutionAttemptOutcomeDecision, ExecutionAttemptRecord, ExecutionAttemptRecoveryOperations, ExecutionAttemptRepository, ExecutionAttemptSettlementKind, ExecutionAttemptStatus, HandoffProviderOperationInput, InfrastructureFailureDecision, PendingAttemptAbandonmentDecision, ProvisionerIncarnationLossDecision, ProvisioningAbsenceDecision, ProvisioningClaimDecision, RecordAllocationInput, RecordAllocationTerminatedInput, RecordInfrastructureFailureInput, RecordProviderOperationUncertaintyInput, RecordProvisionerIncarnationLostInput, RecordProvisioningAbsentInput, RecoverableAttemptRecord, RenewProviderOperationClaimInput, TakeOverProviderOperationInput, sameAllocationRef, sameWorkflowResult };