@makaio/framework 1.0.0-dev-1784889676396 → 1.0.0-dev-1785347612784

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 (474) hide show
  1. package/dist/.makaio-build.json +3 -2
  2. package/dist/{account-identity-CP4DC0DL.mjs → account-identity-DFx8pwKL.mjs} +1 -1
  3. package/dist/{adapter-CYobxqN_.mjs → adapter-D5c5LrPN.mjs} +1 -1
  4. package/dist/adapters/claude/index.d.mts +200 -23
  5. package/dist/adapters/claude/index.mjs +3 -3
  6. package/dist/adapters/config/index.d.mts +2 -2
  7. package/dist/adapters/config/index.mjs +1 -1
  8. package/dist/adapters/index.d.mts +49 -4
  9. package/dist/adapters/index.mjs +3 -3
  10. package/dist/adapters/node.d.mts +1 -1
  11. package/dist/adapters/node.mjs +1 -1
  12. package/dist/{artifact-DCkizHkS.mjs → artifact-DGiXqb11.mjs} +1 -1
  13. package/dist/attempt-record-codec-CqO1_XnE.mjs +1 -0
  14. package/dist/{auth-C3NOWqTU.mjs → auth-DGEdiHF6.mjs} +1 -1
  15. package/dist/authority-state-bootstrap-GPL_tqaT.mjs +1 -0
  16. package/dist/bus/index.d.mts +20 -20
  17. package/dist/bus/index.mjs +1 -1
  18. package/dist/{canonical-model-EMRYCVjX.mjs → canonical-model-BAytQ4NV.mjs} +1 -1
  19. package/dist/capabilities-BQEp34ir.mjs +1 -0
  20. package/dist/{client-OYk0Ttck.mjs → client-DbS847wW.mjs} +1 -1
  21. package/dist/clients/index.d.mts +5 -3
  22. package/dist/clients/index.mjs +1 -1
  23. package/dist/clients/managed-install.d.mts +1 -1
  24. package/dist/clients/managed-install.mjs +1 -1
  25. package/dist/{compression-CZ_6fYq8.mjs → compression-74fFeBha.mjs} +1 -1
  26. package/dist/{config-namespace-DTA6EQL8.mjs → config-namespace-TVX-hG4I.mjs} +1 -1
  27. package/dist/{context-resolution-B9ANWbG0.d.mts → context-resolution-DmlreWPC.d.mts} +4 -2
  28. package/dist/contracts/adapter/index.d.mts +2 -2
  29. package/dist/contracts/adapter/index.mjs +1 -1
  30. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  31. package/dist/contracts/artifact/index.d.mts +2 -2
  32. package/dist/contracts/artifact/index.mjs +1 -1
  33. package/dist/contracts/auth/index.d.mts +2 -2
  34. package/dist/contracts/auth/index.mjs +1 -1
  35. package/dist/contracts/canonical-model/index.d.mts +1 -1
  36. package/dist/contracts/canonical-model/index.mjs +1 -1
  37. package/dist/contracts/capabilities/index.d.mts +2 -0
  38. package/dist/contracts/capabilities/index.mjs +1 -0
  39. package/dist/contracts/client/index.d.mts +2 -2
  40. package/dist/contracts/client/index.mjs +1 -1
  41. package/dist/contracts/common/index.d.mts +1 -1
  42. package/dist/contracts/config/index.d.mts +24 -2
  43. package/dist/contracts/config/index.mjs +1 -1
  44. package/dist/contracts/extension/index.d.mts +4 -4
  45. package/dist/contracts/extension/index.mjs +1 -1
  46. package/dist/contracts/facet/index.d.mts +1 -1
  47. package/dist/contracts/facet/index.mjs +1 -1
  48. package/dist/contracts/harness/index.d.mts +1 -1
  49. package/dist/contracts/harness/index.mjs +1 -1
  50. package/dist/contracts/host/index.d.mts +1 -1
  51. package/dist/contracts/host/index.mjs +1 -1
  52. package/dist/contracts/index.d.mts +1755 -9504
  53. package/dist/contracts/index.mjs +1 -1
  54. package/dist/contracts/materialization/index.d.mts +3 -3
  55. package/dist/contracts/materialization/index.mjs +1 -1
  56. package/dist/contracts/model-registry/index.d.mts +1 -1
  57. package/dist/contracts/model-registry/index.mjs +1 -1
  58. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  59. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  60. package/dist/contracts/platform/index.d.mts +1 -1
  61. package/dist/contracts/platform/index.mjs +1 -1
  62. package/dist/contracts/provider/index.d.mts +2 -2
  63. package/dist/contracts/provider/index.mjs +1 -1
  64. package/dist/contracts/session/index.d.mts +2 -2
  65. package/dist/contracts/session/index.mjs +1 -1
  66. package/dist/contracts/shared/index.d.mts +2 -2
  67. package/dist/contracts/shared/index.mjs +1 -1
  68. package/dist/contracts/skill/index.d.mts +1 -1
  69. package/dist/contracts/skill/index.mjs +1 -1
  70. package/dist/contracts/telemetry/index.d.mts +1 -1
  71. package/dist/contracts/telemetry/index.mjs +1 -1
  72. package/dist/contracts/timeout/index.d.mts +1 -1
  73. package/dist/contracts/timeout/index.mjs +1 -1
  74. package/dist/contracts/toast/index.mjs +1 -1
  75. package/dist/contracts/variant/index.d.mts +1 -1
  76. package/dist/contracts/variant/index.mjs +1 -1
  77. package/dist/contracts/worker-node/index.d.mts +2 -0
  78. package/dist/contracts/worker-node/index.mjs +1 -0
  79. package/dist/contracts/workflow/index.d.mts +3 -3
  80. package/dist/contracts/workflow/index.mjs +1 -1
  81. package/dist/{definition-K3m51lgO.mjs → definition-CJfiv8xm.mjs} +1 -1
  82. package/dist/{detached-extension-handle-BsywhHfk.mjs → detached-extension-handle-Ddfquy5_.mjs} +1 -1
  83. package/dist/drizzle/0030_remote-worker-execution.sql +6 -0
  84. package/dist/drizzle/meta/_journal.json +7 -0
  85. package/dist/execution-attempt-repository-DWXKY41_.d.mts +1056 -0
  86. package/dist/execution-target-Cf645pDj.mjs +1 -0
  87. package/dist/{extension-Cgg45Xk1.mjs → extension-DCA4pYrY.mjs} +1 -1
  88. package/dist/extension-hjOPs10e.mjs +1 -0
  89. package/dist/{filesystem-service-Cupz_Z7S.mjs → filesystem-service-DlP2HfDg.mjs} +1 -1
  90. package/dist/framework-packages-C3RWfJDk.mjs +1 -0
  91. package/dist/git/index.mjs +1 -1
  92. package/dist/{globby-DWp7V-P2.mjs → globby-1yCVCk8s.mjs} +1 -1
  93. package/dist/{handlers-cMBmexF4.mjs → handlers-CfnLyLfE.mjs} +1 -1
  94. package/dist/{harness-DflvHAGV.mjs → harness-DpwsFsE7.mjs} +1 -1
  95. package/dist/{hook-responses-Dg8wDvRo.d.mts → hook-responses-aQrArNz9.d.mts} +3 -3
  96. package/dist/index-B0Kf_OWi.d.mts +267 -0
  97. package/dist/{index-DRiTICBU.d.mts → index-BAXkicoQ.d.mts} +1 -1
  98. package/dist/{index-D43lQCHs.d.mts → index-BTRknOXo.d.mts} +319 -319
  99. package/dist/{index-CKO9S6oo.d.mts → index-Bc_JPASG.d.mts} +28 -10
  100. package/dist/{index-CtUTCAJ6.d.mts → index-Bl_Zcd3Q.d.mts} +11 -11
  101. package/dist/{index-Cw7_69gV.d.mts → index-CRvpVIqA.d.mts} +1 -1
  102. package/dist/{index-CjyfQ_vQ.d.mts → index-CVLeQeHw.d.mts} +8 -5
  103. package/dist/{index-BMx59xb7.d.mts → index-DGc25kcM.d.mts} +79 -73
  104. package/dist/{index-CnXXq6sW.d.mts → index-DIy9rArB.d.mts} +7 -7
  105. package/dist/index-DRrF9k9-.d.mts +7295 -0
  106. package/dist/{index-Chy9aknK.d.mts → index-Da7WJLiz.d.mts} +100 -100
  107. package/dist/{index-pjATMrvJ.d.mts → index-DkiTJM5p.d.mts} +693 -31
  108. package/dist/{index-Bs3CXR232.d.mts → index-Dtrd2wRg2.d.mts} +5 -5
  109. package/dist/{index-CvmWRumB.d.mts → index-DvlFDSVv.d.mts} +1009 -873
  110. package/dist/{index-BhXCCgJV2.d.mts → index-EjsSBQXy2.d.mts} +1 -1
  111. package/dist/{index-Bi5jFT9S.d.mts → index-F1KbFchC.d.mts} +16 -16
  112. package/dist/{index-jbgHR5J2.d.mts → index-GHASUiem.d.mts} +1 -1
  113. package/dist/{index-0Ju2i8gV.d.mts → index-SsBHjUqA.d.mts} +204 -165
  114. package/dist/{index-BDDbcWNI.d.mts → index-SwA1lwRe.d.mts} +336 -336
  115. package/dist/index-XZyMxxnU.d.mts +1602 -0
  116. package/dist/{index-Cw84_Dqi.d.mts → index-fmR2JNgJ.d.mts} +4 -4
  117. package/dist/{index-dkvGHN10.d.mts → index-wuOy_w7v.d.mts} +3 -3
  118. package/dist/kernel/cli/index.d.mts +2 -2
  119. package/dist/kernel/cli/index.mjs +1 -1
  120. package/dist/kernel/cli/register.d.mts +1 -1
  121. package/dist/kernel/cli/register.mjs +1 -1
  122. package/dist/kernel/cli/schemas.mjs +1 -1
  123. package/dist/kernel/extension/index.d.mts +1 -1
  124. package/dist/kernel/extension/index.mjs +1 -1
  125. package/dist/kernel/index.d.mts +14 -8
  126. package/dist/kernel/index.mjs +1 -1
  127. package/dist/kernel/namespace/index.d.mts +1 -1
  128. package/dist/kernel/namespace/index.mjs +1 -1
  129. package/dist/kernel/observability/index.d.mts +1 -1
  130. package/dist/kernel/observability/index.mjs +1 -1
  131. package/dist/kernel/providers/index.d.mts +1 -1
  132. package/dist/kernel/providers/index.mjs +1 -1
  133. package/dist/kernel/window/index.d.mts +1 -1
  134. package/dist/kernel/window/index.mjs +1 -1
  135. package/dist/{lib-BeMM738r.mjs → lib-C7-s68uf.mjs} +1 -1
  136. package/dist/{lib-B7TpTzkG.mjs → lib-DErgth_E.mjs} +2 -2
  137. package/dist/{load-extensions-BLdG90Zi.d.mts → load-extensions-BxsDB87B.d.mts} +1 -1
  138. package/dist/{load-extensions-CUmFCcYi.mjs → load-extensions-D0DfjYLC.mjs} +1 -1
  139. package/dist/{materialization-s8eR1eQ4.mjs → materialization-Jd198K3y.mjs} +1 -1
  140. package/dist/mcp-http-server/index.d.mts +305 -79
  141. package/dist/mcp-http-server/index.mjs +4 -4
  142. package/dist/model-BGgVmRnN.mjs +1 -0
  143. package/dist/modes-BheyN7SS.mjs +1 -0
  144. package/dist/{namespace-CriPb5wY.d.mts → namespace-BlHURT7i.d.mts} +20 -20
  145. package/dist/{namespace-DwQtzlY-.mjs → namespace-BqxtpNAn.mjs} +1 -1
  146. package/dist/{namespace-zOfq1Uhn.d.mts → namespace-CKOzDbvJ.d.mts} +9 -9
  147. package/dist/namespace-DJfUADSV.mjs +1 -0
  148. package/dist/{namespace-Bd49QmzS.d.mts → namespace-DWCEo-9M.d.mts} +0 -60
  149. package/dist/{namespace-CI313bRv.d.mts → namespace-ZwLlJNOH.d.mts} +152 -152
  150. package/dist/{native-session-supervisor-Bgz-Q1WH.mjs → native-session-supervisor-DRx0MX-d.mjs} +1 -1
  151. package/dist/node/bus-server/index.d.mts +1 -1
  152. package/dist/node/bus-server/index.mjs +1 -1
  153. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  154. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  155. package/dist/node/transports/index.d.mts +81 -9
  156. package/dist/node/transports/index.mjs +2 -2
  157. package/dist/{orchestrator-shared-CY7Tu7kZ.mjs → orchestrator-shared-BxmHCPvx.mjs} +1 -1
  158. package/dist/package-CNUPPcU1.mjs +7 -0
  159. package/dist/package-DWMxGfzK.d.mts +827 -0
  160. package/dist/{package-DKnzOvoR.mjs → package-Dft_RItb.mjs} +1 -1
  161. package/dist/package.json +1 -1
  162. package/dist/{packages-zDnokBpl.mjs → packages-DtEEP0Vt.mjs} +1 -1
  163. package/dist/{profile-BRi6K6am.mjs → profile-BTAI31Nt.mjs} +1 -1
  164. package/dist/{provider-context-DOsjOjiR.mjs → provider-context-Dq53Cgzz.mjs} +1 -1
  165. package/dist/{provider-context-BYkMl--1.mjs → provider-context-PZIQWcqQ.mjs} +1 -1
  166. package/dist/provider-operation-Cxoe2SUr.d.mts +207 -0
  167. package/dist/providers/index.mjs +1 -1
  168. package/dist/{registry-Dw6l7k3e.mjs → registry-wfF2uTty.mjs} +29 -29
  169. package/dist/{resolved-O2XXjTeu.mjs → resolved-DZgqql2Z.mjs} +1 -1
  170. package/dist/rules/index.d.mts +1 -1
  171. package/dist/rules/index.mjs +1 -1
  172. package/dist/rules/schemas.d.mts +1 -1
  173. package/dist/runtime-bun/index.mjs +1 -1
  174. package/dist/runtime-node/extension-discovery.d.mts +1 -1
  175. package/dist/runtime-node/extension-validation.d.mts +1 -1
  176. package/dist/runtime-node/extension-validation.mjs +1 -1
  177. package/dist/runtime-node/index.d.mts +4 -4
  178. package/dist/runtime-node/index.mjs +24 -24
  179. package/dist/runtime-node/makaio-config.d.mts +1 -1
  180. package/dist/runtime-node/makaio-config.mjs +1 -1
  181. package/dist/runtime-node/static/model-registry.yaml +348 -0
  182. package/dist/runtime-node/workflow-worker/index.d.mts +2 -2
  183. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  184. package/dist/runtime-node/workflow-worker/worker-entry.d.mts +7 -4
  185. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  186. package/dist/{schema-BI0aCHvV.mjs → schema-Dd-e89MO.mjs} +1 -1
  187. package/dist/{schema-BO9TgmOs.d.mts → schema-dz2TC5TT.d.mts} +1 -1
  188. package/dist/{schemas-BDC2Nqj1.d.mts → schemas-BQS3txU4.d.mts} +8 -8
  189. package/dist/schemas-CRB2O5zo.mjs +1 -0
  190. package/dist/{schemas-CbMWN9-z.d.mts → schemas-Cf68SmbJ.d.mts} +152 -152
  191. package/dist/{schemas-Dgj3WaOI.mjs → schemas-Cm09dXL4.mjs} +1 -1
  192. package/dist/{schemas-BJ8VMXhO.mjs → schemas-DaHQzpgm.mjs} +1 -1
  193. package/dist/{schemas-ChF2z4RB.d.mts → schemas-N6x2z7Lf.d.mts} +0 -45
  194. package/dist/schemas-tDf_WiC8.mjs +1 -0
  195. package/dist/selection-BNwTKEVT.mjs +1 -0
  196. package/dist/service-base/index.d.mts +47 -2
  197. package/dist/service-base/index.mjs +1 -1
  198. package/dist/services/adapter-runtime/index.d.mts +3 -3
  199. package/dist/services/adapter-runtime/index.mjs +1 -1
  200. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  201. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  202. package/dist/services/adapter-subsystem/index.d.mts +3 -3
  203. package/dist/services/adapter-subsystem/index.mjs +1 -1
  204. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  205. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  206. package/dist/services/agent-runtime/index.d.mts +2 -2
  207. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  208. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  209. package/dist/services/capability/index.d.mts +1 -1
  210. package/dist/services/capability/index.mjs +1 -1
  211. package/dist/services/codebase/index.d.mts +2 -2
  212. package/dist/services/codebase/namespace.d.mts +1 -1
  213. package/dist/services/codebase/schemas.d.mts +1 -1
  214. package/dist/services/compression/index.d.mts +2 -2
  215. package/dist/services/compression/namespace.d.mts +1 -1
  216. package/dist/services/compression/schemas.d.mts +1 -1
  217. package/dist/services/context-rules/index.d.mts +4 -4
  218. package/dist/services/context-rules/index.mjs +1 -1
  219. package/dist/services/execution-target/index.d.mts +4 -4
  220. package/dist/services/execution-target/index.mjs +1 -1
  221. package/dist/services/execution-target/namespace.d.mts +1 -1
  222. package/dist/services/execution-target/namespace.mjs +1 -1
  223. package/dist/services/execution-target/schemas.d.mts +1 -1
  224. package/dist/services/execution-target/schemas.mjs +1 -1
  225. package/dist/services/filesystem/index.d.mts +1 -1
  226. package/dist/services/filesystem/index.mjs +1 -1
  227. package/dist/services/filesystem/namespace.d.mts +6 -6
  228. package/dist/services/filesystem/schemas.d.mts +3 -3
  229. package/dist/services/git/namespace.d.mts +2 -2
  230. package/dist/services/git/namespace.mjs +1 -1
  231. package/dist/services/git/schemas.d.mts +2 -2
  232. package/dist/services/git/schemas.mjs +1 -1
  233. package/dist/services/harness/index.d.mts +3 -3
  234. package/dist/services/harness/index.mjs +1 -1
  235. package/dist/services/index.d.mts +157 -442
  236. package/dist/services/index.mjs +1 -1
  237. package/dist/services/log-import/browser.d.mts +2 -2
  238. package/dist/services/log-import/index.d.mts +2 -2
  239. package/dist/services/log-import/log-import.d.mts +1 -1
  240. package/dist/services/log-import/log-import.mjs +1 -1
  241. package/dist/services/log-import/namespace.mjs +1 -1
  242. package/dist/services/log-import/schemas.mjs +1 -1
  243. package/dist/services/materialization/index.d.mts +1 -1
  244. package/dist/services/materialization/index.mjs +1 -1
  245. package/dist/services/model-registry/index.d.mts +1 -1
  246. package/dist/services/model-registry/index.mjs +1 -1
  247. package/dist/services/preferences/index.d.mts +2 -2
  248. package/dist/services/preferences/schemas.d.mts +1 -1
  249. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  250. package/dist/services/provider-context/index.d.mts +1 -1
  251. package/dist/services/provider-context/index.mjs +1 -1
  252. package/dist/services/provider-runtime/index.mjs +1 -1
  253. package/dist/services/session/handlers/index.d.mts +1 -1
  254. package/dist/services/session/handlers/index.mjs +1 -1
  255. package/dist/services/session/index.d.mts +9 -9
  256. package/dist/services/session/index.mjs +1 -1
  257. package/dist/services/session/messages/namespace.d.mts +1 -1
  258. package/dist/services/session/messages/namespace.mjs +1 -1
  259. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  260. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  261. package/dist/services/session/session-events/namespace.d.mts +1 -1
  262. package/dist/services/session/session-events/namespace.mjs +1 -1
  263. package/dist/services/session/storage/namespace.d.mts +1 -1
  264. package/dist/services/session/storage/schema.d.mts +1 -1
  265. package/dist/services/session/testing/index.mjs +1 -1
  266. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  267. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  268. package/dist/services/session/turns/namespace.d.mts +1 -1
  269. package/dist/services/session/turns/namespace.mjs +1 -1
  270. package/dist/services/session-editor/index.d.mts +1 -1
  271. package/dist/services/session-editor/index.mjs +1 -1
  272. package/dist/services/settings/index.d.mts +3 -3
  273. package/dist/services/settings/index.mjs +1 -1
  274. package/dist/services/settings/namespace.d.mts +8 -8
  275. package/dist/services/settings/namespace.mjs +1 -1
  276. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  277. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  278. package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
  279. package/dist/services/settings/storage/index.d.mts +3 -3
  280. package/dist/services/settings/storage/index.mjs +1 -1
  281. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  282. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  283. package/dist/services/subagent/index.d.mts +1 -1
  284. package/dist/services/subagent/index.mjs +1 -1
  285. package/dist/services/subagent-template/index.d.mts +2 -2
  286. package/dist/services/subagent-template/namespace.d.mts +1 -1
  287. package/dist/services/subagent-template/schemas.d.mts +1 -1
  288. package/dist/services/tool-approval/index.d.mts +1 -1
  289. package/dist/services/tool-approval/index.mjs +1 -1
  290. package/dist/services/tools/index.d.mts +1 -1
  291. package/dist/services/tools/index.mjs +1 -1
  292. package/dist/services/tray-menu/index.d.mts +3 -3
  293. package/dist/services/tray-menu/index.mjs +1 -1
  294. package/dist/services/tray-menu/namespace.d.mts +1 -1
  295. package/dist/services/tray-menu/schemas.d.mts +1 -1
  296. package/dist/services/turn/index.d.mts +1 -1
  297. package/dist/services/turn/namespace.d.mts +1 -1
  298. package/dist/services/workflow-transitions/index.d.mts +2 -0
  299. package/dist/services/workflow-transitions/index.mjs +1 -0
  300. package/dist/{session-Carng3Yk.mjs → session-BOGCd18q.mjs} +1 -1
  301. package/dist/{session-idI1jk5X.mjs → session-BTFiDoGz.mjs} +1 -1
  302. package/dist/{session-lineage-Cte63dGx.d.mts → session-lineage-B_JW5LpF.d.mts} +1 -1
  303. package/dist/{shared-RP_KARKF.mjs → shared-BQ0CHIVy.mjs} +1 -1
  304. package/dist/{skill-CpNjWFuE.mjs → skill-BR6rkfLe.mjs} +1 -1
  305. package/dist/{src-XihJcAQS.mjs → src-DD0v-nIj.mjs} +1 -1
  306. package/dist/storage/drizzle/client.d.mts +1 -1
  307. package/dist/storage/drizzle/client.mjs +1 -1
  308. package/dist/storage/drizzle/index.d.mts +50 -2
  309. package/dist/storage/drizzle/index.mjs +1 -1
  310. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  311. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  312. package/dist/storage/handlers/index.d.mts +1 -1
  313. package/dist/storage/handlers/index.mjs +1 -1
  314. package/dist/testing/drizzle-harness.d.mts +44 -3
  315. package/dist/testing/drizzle-harness.mjs +1 -1
  316. package/dist/{tool-approval-service-fIZ9x0kL.mjs → tool-approval-service-kBA0fRzm.mjs} +1 -1
  317. package/dist/tools-PdG9fO1M.mjs +1 -0
  318. package/dist/{transition-BodgGLZx.d.mts → transition-cjK90Dyn.d.mts} +3 -42
  319. package/dist/{types-Bzxo7ATi.d.mts → types-BVHxx-H0.d.mts} +264 -264
  320. package/dist/{types-DBb5jY4Z.d.mts → types-CJ_QZ1yW.d.mts} +47 -3
  321. package/dist/{types-LspCUW09.d.mts → types-DMLDHFR9.d.mts} +1 -1
  322. package/dist/ui-kernel/index.d.mts +1 -1
  323. package/dist/ui-kernel/index.mjs +1 -1
  324. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  325. package/dist/utils/index.d.mts +18 -4
  326. package/dist/utils/index.mjs +1 -1
  327. package/dist/{version-BbWrAPld.mjs → version-CoCeMxDT.mjs} +1 -1
  328. package/dist/{view-builder-tU7iaxrk.d.mts → view-builder-DHwbHGY6.d.mts} +2 -1
  329. package/dist/visibility-qhGWmpSJ.mjs +1 -0
  330. package/dist/worker-node-Bl9_vqYi.mjs +1 -0
  331. package/dist/worker-node-DZTuT1DS.mjs +1 -0
  332. package/dist/workflow-BfDbgtIQ.mjs +1 -0
  333. package/dist/workflow-engine/execution-attempt-repository.d.mts +2 -0
  334. package/dist/workflow-engine/execution-attempt-repository.mjs +1 -0
  335. package/dist/workflow-engine/index.d.mts +619 -685
  336. package/dist/workflow-engine/index.mjs +1 -1
  337. package/dist/workflow-engine/package.d.mts +1 -1
  338. package/dist/workflow-engine/package.mjs +1 -1
  339. package/dist/workflow-engine/provider-operation.d.mts +2 -0
  340. package/dist/workflow-engine/provider-operation.mjs +1 -0
  341. package/dist/workflow-engine/testing/index.d.mts +146 -0
  342. package/dist/workflow-engine/testing/index.mjs +1 -0
  343. package/dist/workflow-engine/testing/sqlite.d.mts +22 -0
  344. package/dist/workflow-engine/testing/sqlite.mjs +130 -0
  345. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  346. package/dist/workflow-transitions-DSc45ixc.mjs +1 -0
  347. package/dist/workflow-worker-BN9XPxQO.mjs +1 -0
  348. package/package.json +20 -3
  349. package/dist/authority-state-bootstrap-C_-F_dtq.mjs +0 -1
  350. package/dist/execution-target-CsZXIvli.mjs +0 -1
  351. package/dist/extension-CjTu6mzW.mjs +0 -1
  352. package/dist/model-uE5IyUFJ.mjs +0 -1
  353. package/dist/namespace-C05pkLbN.mjs +0 -1
  354. package/dist/package-BSG1681x.d.mts +0 -427
  355. package/dist/package-DW1Upu8E.mjs +0 -7
  356. package/dist/schemas-BRxU_oqL.mjs +0 -1
  357. package/dist/schemas-C-J4W1ID.mjs +0 -1
  358. package/dist/selection-YRuVSdck.mjs +0 -1
  359. package/dist/tools-Cs2DwjCC.mjs +0 -1
  360. package/dist/visibility-Cb62p9bv.mjs +0 -1
  361. package/dist/workflow-BX-FxDb0.mjs +0 -1
  362. package/dist/workflow-worker-DR9qYOFc.mjs +0 -1
  363. /package/dist/{adapter-auth-runtime-DFBLXD5K.mjs → adapter-auth-runtime-DO-FVTXg.mjs} +0 -0
  364. /package/dist/{adapter-binding-Dfk_g-lP.d.mts → adapter-binding-DQchUtrK.d.mts} +0 -0
  365. /package/dist/{ajv-C8r45sFs.mjs → ajv-DD3SIL2i.mjs} +0 -0
  366. /package/dist/{attach-error-DCnzW-Yz.mjs → attach-error-C3tngg6J.mjs} +0 -0
  367. /package/dist/{await-trigger-UceeyCyi.mjs → await-trigger-I3lrepb8.mjs} +0 -0
  368. /package/dist/{base-orchestrator-5yH3l39s.d.mts → base-orchestrator-BilsQNW1.d.mts} +0 -0
  369. /package/dist/{capability-service-BzKBK0n2.mjs → capability-service-BqiLlRGA.mjs} +0 -0
  370. /package/dist/{client-DYEHDiJN.d.mts → client-B--e2qcU.d.mts} +0 -0
  371. /package/dist/{client-binary-version-verifier-C12PvQmz.d.mts → client-binary-version-verifier-CgjM_vGF.d.mts} +0 -0
  372. /package/dist/{client-binary-version-verifier-Dv7TGFxh.mjs → client-binary-version-verifier-taewmKTY.mjs} +0 -0
  373. /package/dist/{clients-namespace-DcFmhtLv.d.mts → clients-namespace-DfxjG2ZP.d.mts} +0 -0
  374. /package/dist/{config-namespace-DmP7NVju.d.mts → config-namespace-BCqvufbD.d.mts} +0 -0
  375. /package/dist/{create-static-mount-BLbqGmva.mjs → create-static-mount-bbQhTt6W.mjs} +0 -0
  376. /package/dist/{cross-spawn-BXxQUsPS.mjs → cross-spawn-B57KZuns.mjs} +0 -0
  377. /package/dist/{cursor-storage-DCj4uUxr.mjs → cursor-storage-DIFK_9hg.mjs} +0 -0
  378. /package/dist/{definition-BEvV7tbD.d.mts → definition-gnKgXU91.d.mts} +0 -0
  379. /package/dist/{definitions-C1pgx0Nq.mjs → definitions-xrrY0wgz.mjs} +0 -0
  380. /package/dist/{descriptor-to-package-VfB8lK5w.mjs → descriptor-to-package-DvF08krT.mjs} +0 -0
  381. /package/dist/{drizzle-oCH9H53q.mjs → drizzle-z_0SiGY8.mjs} +0 -0
  382. /package/dist/{esm-ClQELElL.mjs → esm-CltRnX8_.mjs} +0 -0
  383. /package/dist/{event-BOLVCfhH.mjs → event-CmVjR6Ib.mjs} +0 -0
  384. /package/dist/{extension-discovery-B6p3iZaV.d.mts → extension-discovery-CQRdbVQ6.d.mts} +0 -0
  385. /package/dist/{extension-namespace-vrh4ERXR.mjs → extension-namespace-Yu41YepM.mjs} +0 -0
  386. /package/dist/{facet-DqPBpqkl.mjs → facet-BCI00njh.mjs} +0 -0
  387. /package/dist/{filesystem-service-CGdboor3.d.mts → filesystem-service-CQ9yVkSz.d.mts} +0 -0
  388. /package/dist/{handler-GGOD_ofd.mjs → handler-Cbv9FqDO.mjs} +0 -0
  389. /package/dist/{host-BfgdjlII.mjs → host-Caq6ZfSJ.mjs} +0 -0
  390. /package/dist/{identity-BmEHHoBw.mjs → identity-D6guMtmi.mjs} +0 -0
  391. /package/dist/{index-DUf47Jn_.d.mts → index-BHw_bB_8.d.mts} +0 -0
  392. /package/dist/{index-DEchpaya.d.mts → index-BIdsFcQs2.d.mts} +0 -0
  393. /package/dist/{index-DquI_1X5.d.mts → index-BVRQEpAg.d.mts} +0 -0
  394. /package/dist/{index-Brdc35b-.d.mts → index-BaZeoZoS.d.mts} +0 -0
  395. /package/dist/{index-BSmwpgkR.d.mts → index-ByKi34v5.d.mts} +0 -0
  396. /package/dist/{index-oYGf2zIe.d.mts → index-CGZQVTid.d.mts} +0 -0
  397. /package/dist/{index-DaMfTvfz.d.mts → index-CWHfOz6d.d.mts} +0 -0
  398. /package/dist/{index-Bd1GC1kU2.d.mts → index-CjdRdsd0.d.mts} +0 -0
  399. /package/dist/{index-DYUxNOIX.d.mts → index-Cv-o5Krs.d.mts} +0 -0
  400. /package/dist/{index-DC0yVsYL.d.mts → index-DN4NOCqN2.d.mts} +0 -0
  401. /package/dist/{index-CcsJnJOD.d.mts → index-DR40QWlw.d.mts} +0 -0
  402. /package/dist/{index-BG9-vQHD.d.mts → index-DZunhZec.d.mts} +0 -0
  403. /package/dist/{index-BsBvs0aK.d.mts → index-DjgLchuQ.d.mts} +0 -0
  404. /package/dist/{index-pgYFJ5h6.d.mts → index-Dm1nUxCF.d.mts} +0 -0
  405. /package/dist/{index-7FjcxGlK.d.mts → index-DnG-QFpG.d.mts} +0 -0
  406. /package/dist/{index-C96LlS5m.d.mts → index-Ds5_rDEJ.d.mts} +0 -0
  407. /package/dist/{index-GYZs75UP.d.mts → index-dtsLKOID.d.mts} +0 -0
  408. /package/dist/{index-8fJ6dkzR.d.mts → index-gUhidukN.d.mts} +0 -0
  409. /package/dist/{index-BgpYhR2z.d.mts → index-jTaAHsul.d.mts} +0 -0
  410. /package/dist/{index-Ci3_i-WC2.d.mts → index-sS6KUlrx.d.mts} +0 -0
  411. /package/dist/{index-CFeY8lfU.d.mts → index-vA--0lOM.d.mts} +0 -0
  412. /package/dist/{index-BUYyZm5I.d.mts → index-vcSj12YQ.d.mts} +0 -0
  413. /package/dist/{index-CdEhEXlY.d.mts → index-ye0oklfU.d.mts} +0 -0
  414. /package/dist/{json-value-BwVdTylT.d.mts → json-value-Brslhqbm.d.mts} +0 -0
  415. /package/dist/{jsonl-transport-D8RBF0dK.mjs → jsonl-transport-bQl3JwIu.mjs} +0 -0
  416. /package/dist/{lib-3_xcE8J-.mjs → lib-DOBXZmYX.mjs} +0 -0
  417. /package/dist/{model-registry-CoegIvks.mjs → model-registry-CmgcPDH3.mjs} +0 -0
  418. /package/dist/{model-registry-BneK5SGo.mjs → model-registry-xyBKSye-.mjs} +0 -0
  419. /package/dist/{namespace-CDO4rY11.mjs → namespace-B8uKAzWJ.mjs} +0 -0
  420. /package/dist/{namespace-BsF9IxJ9.d.mts → namespace-BOkKoq34.d.mts} +0 -0
  421. /package/dist/{namespace-SQAGytmu.d.mts → namespace-Blp4c8GK.d.mts} +0 -0
  422. /package/dist/{namespace-BeED_Ojz.mjs → namespace-C-9si-fV.mjs} +0 -0
  423. /package/dist/{namespace-De9Mg3zv.d.mts → namespace-CErHuXtb.d.mts} +0 -0
  424. /package/dist/{namespace-BHj13hbA.mjs → namespace-CWGKCNZm.mjs} +0 -0
  425. /package/dist/{namespace-D7pE2QWv.mjs → namespace-CWUDFGOy.mjs} +0 -0
  426. /package/dist/{namespace-D9HNjIdc.d.mts → namespace-Cv1RFP7n.d.mts} +0 -0
  427. /package/dist/{namespace-BHliaabz.d.mts → namespace-DV-Hr9sZ.d.mts} +0 -0
  428. /package/dist/{namespace-lWlqWTKu.d.mts → namespace-GPA7zots.d.mts} +0 -0
  429. /package/dist/{namespace-DWwWnLBu.mjs → namespace-HO2J9sO8.mjs} +0 -0
  430. /package/dist/{namespace-C238RqwB.mjs → namespace-YxU1xf-K.mjs} +0 -0
  431. /package/dist/{namespace-BetqZA7Z.d.mts → namespace-YytVKIgI.d.mts} +0 -0
  432. /package/dist/{namespace-B9CYb9Gh.d.mts → namespace-jDhZjw-i.d.mts} +0 -0
  433. /package/dist/{namespace-BphMM6S82.d.mts → namespace-oz76ijOO2.d.mts} +0 -0
  434. /package/dist/{namespace-BSXHdCVh2.d.mts → namespace-tGRAod3o.d.mts} +0 -0
  435. /package/dist/{orchestrator-shared-BB6j8ezL.d.mts → orchestrator-shared-BHCv-l2O.d.mts} +0 -0
  436. /package/dist/{out-CFkI17mk.mjs → out-CvjtANXN.mjs} +0 -0
  437. /package/dist/{packages-DeIgn0Hn.d.mts → packages-BZ6pzFIq.d.mts} +0 -0
  438. /package/dist/{platform-CWhGFQFX.mjs → platform-Bv8llU9c.mjs} +0 -0
  439. /package/dist/{providers-CUnrif24.mjs → providers-Co5UszRH.mjs} +0 -0
  440. /package/dist/{providers-namespace-sPbGcZ6I.d.mts → providers-namespace-DjFkmvBR.d.mts} +0 -0
  441. /package/dist/{quick-lru-CTBjxfgD.mjs → quick-lru-CrOpWwrf.mjs} +0 -0
  442. /package/dist/{schema-cus0dJ81.mjs → schema-Db-y-09L.mjs} +0 -0
  443. /package/dist/{schema-introspection-BsWLmoFp.mjs → schema-introspection-DgWQCpwx.mjs} +0 -0
  444. /package/dist/{schemas-DYvvMd3c.d.mts → schemas-B1NWNASS.d.mts} +0 -0
  445. /package/dist/{schemas-CMyv7l7-.mjs → schemas-BGExwp3j.mjs} +0 -0
  446. /package/dist/{schemas-Dmij0PIc.d.mts → schemas-BO7uOum6.d.mts} +0 -0
  447. /package/dist/{schemas-BGS9RfqV.mjs → schemas-Bfxskx_2.mjs} +0 -0
  448. /package/dist/{schemas-B5tMYfhC.d.mts → schemas-BsVYZviy.d.mts} +0 -0
  449. /package/dist/{schemas-BKKpQC4X2.d.mts → schemas-BtZqovRH.d.mts} +0 -0
  450. /package/dist/{schemas-BAvt2HDy.d.mts → schemas-CQyRBqD6.d.mts} +0 -0
  451. /package/dist/{schemas-D55eXBgl.d.mts → schemas-CR8hSqTy.d.mts} +0 -0
  452. /package/dist/{schemas-CWxf_Yut.mjs → schemas-CqRm0i9a.mjs} +0 -0
  453. /package/dist/{schemas-CiWCNQ9a2.d.mts → schemas-CwbYk_kZ.d.mts} +0 -0
  454. /package/dist/{schemas-B4FyOOJj.d.mts → schemas-miYxK_Z1.d.mts} +0 -0
  455. /package/dist/{semver-D3Y7uMEb.mjs → semver-DlM8znk4.mjs} +0 -0
  456. /package/dist/{server-lifecycle-C-3OgoKi.d.mts → server-lifecycle-Dsq56aqC.d.mts} +0 -0
  457. /package/dist/{server-lifecycle-DV6NMsgH.mjs → server-lifecycle-kmQ5PUDv.mjs} +0 -0
  458. /package/dist/{shared-schemas-BNCPgGYP.mjs → shared-schemas-DXwyMCwZ.mjs} +0 -0
  459. /package/dist/{src-ftBp6GpR.mjs → src-CCu8TwL6.mjs} +0 -0
  460. /package/dist/{storage-namespace-B1GI4elv.mjs → storage-namespace-BSrv0vXR.mjs} +0 -0
  461. /package/dist/{storage-namespace-definition-V8sc3drq.d.mts → storage-namespace-definition-BvlX0QV_.d.mts} +0 -0
  462. /package/dist/{storage-namespace-definition-4UYuij1r.mjs → storage-namespace-definition-CkMKt7-I.mjs} +0 -0
  463. /package/dist/{storage-namespace-9N9R61pI.d.mts → storage-namespace-dfywhXR3.d.mts} +0 -0
  464. /package/dist/{supports-color-DwW9N6YC.mjs → supports-color-DUugCQsK.mjs} +0 -0
  465. /package/dist/{telemetry-B42EMbZt.mjs → telemetry-Pr3oP2rk.mjs} +0 -0
  466. /package/dist/{timeout-CvONPl0l.mjs → timeout-DWDhddRJ.mjs} +0 -0
  467. /package/dist/{tray-menu-service-Dgedanv-.mjs → tray-menu-service-BBLa-Rcv.mjs} +0 -0
  468. /package/dist/{types-DkFvBdIY.d.mts → types-BrcjaNPZ.d.mts} +0 -0
  469. /package/dist/{types-DVLq657Y.d.mts → types-DHmPneIO.d.mts} +0 -0
  470. /package/dist/{types-Bju4dmAg.d.mts → types-b54n1o57.d.mts} +0 -0
  471. /package/dist/{ui-config-B2L3Xgqo.mjs → ui-config-CyCdlns_.mjs} +0 -0
  472. /package/dist/{variant-ByI-RZua.mjs → variant-krjlTdJt.mjs} +0 -0
  473. /package/dist/{window-registry-Qcnvlhp7.d.mts → window-registry-BDnZLPVx.d.mts} +0 -0
  474. /package/dist/{window-registry-DsWnCc8z.mjs → window-registry-I-imZHV_.mjs} +0 -0
@@ -0,0 +1,827 @@
1
+ import { l as ProviderOperationOwnershipRecord, o as ProviderOperationClaimDecision, s as ProviderOperationMutationDecision } from "./provider-operation-Cxoe2SUr.mjs";
2
+ import { A as RecoverableAttemptRecord, C as ProvisioningClaimDecision, D as RecordProviderOperationUncertaintyInput, E as RecordInfrastructureFailureInput, M as TakeOverProviderOperationInput, O as RecordProvisionerIncarnationLostInput, S as ProvisioningAbsenceDecision, T as RecordAllocationTerminatedInput, a as BeginProvisioningInput, b as PendingAttemptAbandonmentDecision, f as ExecutionAttemptOutcomeDecision, h as ExecutionAttemptRepository, i as AllocationTerminationDecision, j as RenewProviderOperationClaimInput, k as RecordProvisioningAbsentInput, n as AllocationRefEvolution, o as DiscoveredAllocationDecision, p as ExecutionAttemptRecord, r as AllocationRefEvolutionDecision, t as AllocationRecordingDecision, v as HandoffProviderOperationInput, w as RecordAllocationInput, x as ProvisionerIncarnationLossDecision, y as InfrastructureFailureDecision } from "./execution-attempt-repository-DWXKY41_.mjs";
3
+ import { IMakaioBus } from "@makaio/framework/bus";
4
+ import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
5
+ import { IWorkflowRunner, IWorkflowTriggerTypeRegistry, LoopGateHandler, MakaioNodeExtension, StationHandler, StepRunnerBusAuth, StepRunnerPlatformDefaults, WorkerMaterializationSpec, WorkflowDefinition, WorkflowExecution, WorkflowRunContext, WorkflowRunResult } from "@makaio/framework/contracts";
6
+ import { BaseService } from "@makaio/framework/service-base";
7
+ import { MakaioDatabase } from "@makaio/framework/storage/drizzle";
8
+
9
+ //#region subsystems/workflow-engine/src/storage/handler.d.ts
10
+ /**
11
+ * Registers all Drizzle-based workflow storage handlers with the bus.
12
+ *
13
+ * Handles:
14
+ * - Definition CRUD: get, set, delete, list
15
+ * - Execution CRUD: getExecution, setExecution, updateExecution, listExecutions, listExecutionsByArtifactRefs
16
+ * - Frame CRUD: setFrame, getFrame, listFrames
17
+ * - Gate instance CRUD: setGateInstance, getGateInstance, listGateInstances
18
+ * - Span CRUD: setSpan, listSpans
19
+ * - Execution link CRUD: setExecutionLink, listExecutionLinks
20
+ * - Run context CRUD: setRunContext, getRunContext
21
+ * - WorkLog projection: execution/frame reads, stats, and changed events
22
+ * @param bus - MakaioBus instance for message handling
23
+ * @param db - Drizzle database instance
24
+ * @returns Cleanup function to unregister all handlers
25
+ */
26
+ declare function registerDrizzleWorkflowStorage(bus: IMakaioBus, db: MakaioDatabase): () => void;
27
+ //#endregion
28
+ //#region subsystems/workflow-engine/src/types.d.ts
29
+ /**
30
+ * Resolve a portable workspace identifier to an allowed local root directory.
31
+ *
32
+ * Returning `undefined` delegates resolution to the next registered resolver.
33
+ * @param workspaceId - Portable workspace identifier from a materialization spec.
34
+ * @returns Absolute allowed root, or `undefined` when this resolver does not own the identifier.
35
+ */
36
+ type WorkflowWorkspaceRootResolver = (workspaceId: string) => Promise<string | undefined>;
37
+ /**
38
+ * Configuration for the workflow executor.
39
+ */
40
+ interface ExecutorConfig {
41
+ /** Timeout for individual step execution in ms. */
42
+ stepTimeoutMs: number;
43
+ /** Cooldown between steps in ms. */
44
+ stepCooldownMs: number;
45
+ /** Bus server WebSocket URL for runner worker connections. */
46
+ busUrl?: string;
47
+ /** Bus authentication strategy for runner worker connections. */
48
+ busAuth: StepRunnerBusAuth;
49
+ /** Platform-level defaults (cwd, env) for runner process creation. */
50
+ platformDefaults: StepRunnerPlatformDefaults;
51
+ /** Grace period in ms before forceKill is issued after cooperative abort. */
52
+ cancelTimeoutMs: number;
53
+ /**
54
+ * Absolute path to the Makaio data-home directory.
55
+ *
56
+ * Used by the in-process executor to populate the ephemeral platform
57
+ * context exposed to station handlers. When omitted the executor derives
58
+ * a default from the `MAKAIO_HOME` environment variable or `~/.makaio`.
59
+ */
60
+ makaioHome?: string;
61
+ }
62
+ /**
63
+ * Input used by a host to resolve a durable workspace reference for a
64
+ * path-backed workflow start.
65
+ */
66
+ interface WorkflowMaterializationSpecResolution {
67
+ /** Durable execution identity being created. */
68
+ readonly executionId: string;
69
+ /** Definition identity selected for the execution. */
70
+ readonly workflowId: string;
71
+ /** Process-local path supplied by the start request or definition. */
72
+ readonly sourcePath: string;
73
+ /** Coordinator workspace root selected for the execution. */
74
+ readonly workspaceRoot: string;
75
+ }
76
+ /**
77
+ * Host seam for resolving an immutable workspace reference before a
78
+ * path-backed run context is persisted.
79
+ */
80
+ interface WorkflowMaterializationSpecResolver {
81
+ /** Resolve the portable materialization spec for one execution start. */
82
+ resolve(input: WorkflowMaterializationSpecResolution): Promise<WorkerMaterializationSpec | undefined>;
83
+ }
84
+ //#endregion
85
+ //#region subsystems/workflow-engine/src/execution-attempt-authority.d.ts
86
+ /**
87
+ * Execution attempt Authority service.
88
+ *
89
+ * Owns:
90
+ * - attempt ID generation (`crypto.randomUUID()`);
91
+ * - current-process waiters so runners can `await` a committed outcome;
92
+ * - idempotent workflow-state convergence for both `accepted` and `duplicate`.
93
+ *
94
+ * Delegates:
95
+ * - durable attempt creation, provider-operation ownership, allocation
96
+ * recording, and outcome commit decisions to the injected
97
+ * {@link ExecutionAttemptRepository}.
98
+ *
99
+ * The Authority never invents controller identity, lease policy, or fencing
100
+ * tokens, and never chooses a provider operation's obligation. It passes the
101
+ * host-owned claim context through and reports the repository's decision.
102
+ *
103
+ * **Waiter settlement invariant:** waiters settle only on converged
104
+ * outcomes (via {@link settleOutcome}) or on definitive rejection
105
+ * (`conflict`, `fenced`, infrastructure failure). A committed-but-unconverged
106
+ * outcome leaves the waiter pending so retries can converge and settle it.
107
+ * Recovery of committed-but-unconverged outcomes across process restarts
108
+ * is the host recovery coordinator's concern via the exported recovery
109
+ * operations.
110
+ *
111
+ * This service is stateless across process restarts. In-process waiters
112
+ * are lost on crash; the host recovery coordinator owns recovery decisions.
113
+ */
114
+ declare class ExecutionAttemptAuthority {
115
+ private readonly repository;
116
+ /**
117
+ * In-process waiters keyed by `executionAttemptId`.
118
+ *
119
+ * A waiter is created in {@link createAttempt} and settled via
120
+ * {@link settleOutcome} after convergence. Callers use
121
+ * {@link waitForOutcome} to obtain the promise.
122
+ */
123
+ private readonly waiters;
124
+ /**
125
+ * @param repository - Injected durable attempt persistence port.
126
+ */
127
+ constructor(repository: ExecutionAttemptRepository);
128
+ /**
129
+ * Create a new execution attempt with an Authority-generated ID.
130
+ *
131
+ * Persists the attempt through the repository and installs an in-process
132
+ * waiter for the committed outcome. Must be called before dispatch.
133
+ * @param executionId - Workflow execution identifier.
134
+ * @returns The persisted attempt record.
135
+ */
136
+ createAttempt(executionId: string): Promise<ExecutionAttemptRecord>;
137
+ /**
138
+ * Claim durable ownership of provider provisioning for an active attempt.
139
+ *
140
+ * Delegates directly to the repository immediately before a provider call.
141
+ * A `started` decision is the sole authorization for that call, and it
142
+ * carries the claim every subsequent provider-side record must present.
143
+ * @param input - Attempt identity, immutable provider binding, and initial claim context.
144
+ * @returns The durable provisioning ownership decision.
145
+ */
146
+ beginProvisioning(input: BeginProvisioningInput): Promise<ProvisioningClaimDecision>;
147
+ /**
148
+ * Read the current provider operation for an attempt.
149
+ * @param executionAttemptId - Attempt whose operation to read.
150
+ * @returns The ownership record, or `null` when provisioning never began.
151
+ */
152
+ getProviderOperation(executionAttemptId: string): Promise<ProviderOperationOwnershipRecord | null>;
153
+ /**
154
+ * Extend the lease of a currently held provider operation.
155
+ * @param input - Current claim and the new lease deadline.
156
+ * @returns The durable claim decision.
157
+ */
158
+ renewProviderOperationClaim(input: RenewProviderOperationClaimInput): Promise<ProviderOperationClaimDecision>;
159
+ /**
160
+ * Take ownership of an unowned or lease-expired provider operation.
161
+ * @param input - Attempt identity, requesting owner, observation time, and lease deadline.
162
+ * @returns The durable claim decision.
163
+ */
164
+ takeOverProviderOperation(input: TakeOverProviderOperationInput): Promise<ProviderOperationClaimDecision>;
165
+ /**
166
+ * Release a held provider operation without resolving it.
167
+ *
168
+ * The attempt keeps its durable state and stays remediable, so the local
169
+ * waiter is left untouched: handoff transfers control, it does not answer
170
+ * the workflow.
171
+ * @param input - Claim being released and optional bounded release evidence.
172
+ * @returns The durable mutation decision.
173
+ */
174
+ handoffProviderOperation(input: HandoffProviderOperationInput): Promise<ProviderOperationMutationDecision>;
175
+ /**
176
+ * Record that a provider observation stayed inconclusive.
177
+ *
178
+ * Non-terminal by construction: the waiter stays pending because the
179
+ * attempt still has no canonical answer.
180
+ * @param input - Claim and bounded evidence describing the retained uncertainty.
181
+ * @returns The durable mutation decision.
182
+ */
183
+ recordProviderOperationUncertainty(input: RecordProviderOperationUncertaintyInput): Promise<ProviderOperationMutationDecision>;
184
+ /**
185
+ * Record the provider allocation reference for a claimed operation.
186
+ * @param input - Claim and the validated allocation reference.
187
+ * @returns The durable allocation ownership decision.
188
+ */
189
+ recordAllocation(input: RecordAllocationInput): Promise<AllocationRecordingDecision>;
190
+ /**
191
+ * Record positively proven absence of any allocation for the attempt.
192
+ *
193
+ * A recorded absence settles the attempt as `abandoned`, so its waiter is
194
+ * rejected and removed. The bounded evidence is durable in the operation
195
+ * record; the local error only mirrors it for the in-process caller.
196
+ * @param input - Claim, owning execution, and bounded absence evidence.
197
+ * @returns The durable absence decision.
198
+ */
199
+ recordProvisioningAbsent(input: RecordProvisioningAbsentInput): Promise<ProvisioningAbsenceDecision>;
200
+ /**
201
+ * Close pre-allocation debt on proof that a provisioner incarnation is gone.
202
+ *
203
+ * A recorded loss settles the attempt as `abandoned`, so its waiter is
204
+ * rejected and removed. The bounded proof evidence is durable in the
205
+ * operation record; the local error only mirrors it for the in-process
206
+ * caller.
207
+ * @param input - Claim, owning execution, and the provisioner loss proof.
208
+ * @returns The durable provisioner-loss decision.
209
+ */
210
+ recordProvisionerIncarnationLost(input: RecordProvisionerIncarnationLostInput): Promise<ProvisionerIncarnationLossDecision>;
211
+ /**
212
+ * Record that a known allocation was confirmed terminated.
213
+ *
214
+ * Advances the operation to terminal convergence without settling the
215
+ * attempt, so the waiter stays pending until a canonical answer exists.
216
+ * @param input - Claim and bounded evidence supporting the termination.
217
+ * @returns The durable termination decision.
218
+ */
219
+ recordAllocationTerminated(input: RecordAllocationTerminatedInput): Promise<AllocationTerminationDecision>;
220
+ /**
221
+ * Retrieve the active attempt for a given execution.
222
+ *
223
+ * Delegates directly to the repository.
224
+ * @param executionId - Workflow execution identifier.
225
+ * @param executionAttemptId - Attempt identifier to look up.
226
+ * @returns The attempt record if active, or `null`.
227
+ */
228
+ getActiveAttempt(executionId: string, executionAttemptId: string): Promise<ExecutionAttemptRecord | null>;
229
+ /**
230
+ * Commit a terminal outcome for an attempt.
231
+ *
232
+ * Delegates the durable decision to the repository. For `conflict` and
233
+ * `fenced` decisions, the in-process waiter is rejected immediately because
234
+ * no convergence step follows. For `accepted` and `duplicate` decisions, the
235
+ * waiter is NOT settled here — the caller must invoke {@link settleOutcome}
236
+ * after workflow-state convergence succeeds.
237
+ * @param executionAttemptId - The attempt submitting the outcome.
238
+ * @param executionId - Workflow execution identifier.
239
+ * @param result - Terminal workflow result to commit.
240
+ * @returns The durable decision with the canonical outcome when applicable.
241
+ */
242
+ commitOutcome(executionAttemptId: string, executionId: string, result: WorkflowRunResult): Promise<ExecutionAttemptOutcomeDecision>;
243
+ /**
244
+ * Obtain the in-process promise for a committed outcome.
245
+ *
246
+ * Returns `undefined` when no waiter exists for the given attempt
247
+ * (e.g. after a process restart or for attempts created by other hosts).
248
+ * @param executionAttemptId - The attempt to wait for.
249
+ * @returns Promise that resolves with the canonical workflow result, or `undefined`.
250
+ */
251
+ waitForOutcome(executionAttemptId: string): Promise<WorkflowRunResult> | undefined;
252
+ /**
253
+ * Settle the in-process waiter after workflow-state convergence succeeds.
254
+ *
255
+ * Called by the outcome-submission handler only after the durable workflow
256
+ * transition has completed. This ensures runners observe the committed
257
+ * outcome only when canonical workflow state is consistent.
258
+ * @param executionAttemptId - The attempt whose waiter to settle.
259
+ * @param decision - The durable outcome decision (must be accepted or duplicate).
260
+ */
261
+ settleOutcome(executionAttemptId: string, decision: ExecutionAttemptOutcomeDecision): void;
262
+ /**
263
+ * Remove an in-process waiter without settling it.
264
+ *
265
+ * Used when the caller no longer needs to wait (e.g. cancellation before
266
+ * outcome submission).
267
+ * @param executionAttemptId - The attempt whose waiter should be removed.
268
+ */
269
+ discardWaiter(executionAttemptId: string): void;
270
+ /**
271
+ * Reject and remove an in-process waiter without making a durable attempt claim.
272
+ *
273
+ * Use only when local dispatch ownership cannot safely await canonical
274
+ * terminalization, such as an unconfirmed provider cleanup. The durable
275
+ * attempt remains unchanged for recovery or operator remediation.
276
+ * @param executionAttemptId - Attempt whose local waiter must be rejected.
277
+ * @param error - Local failure delivered to the current-process waiter.
278
+ */
279
+ rejectAndDiscardWaiter(executionAttemptId: string, error: Error): void;
280
+ /**
281
+ * Reject and remove a waiter with an error built only if one is waiting.
282
+ *
283
+ * Every durable transition that rejects a waiter is also the transition a
284
+ * remediating process runs after a restart, where by definition no waiter
285
+ * from the original dispatch survives. Building the `Error` — and capturing
286
+ * a stack for it — before looking would make that the common case, and it is
287
+ * the case where the error is never delivered to anyone.
288
+ * @param executionAttemptId - Attempt whose local waiter must be rejected.
289
+ * @param describeFailure - Builds the failure, called only when a waiter exists.
290
+ */
291
+ private rejectWaiterWith;
292
+ /**
293
+ * Whether the injected repository supports recovery operations.
294
+ *
295
+ * Recovery is one indivisible capability on the port, so this is one
296
+ * presence check rather than four: a repository either carries the
297
+ * {@link ExecutionAttemptRecoveryOperations} object or it does not.
298
+ * @returns `true` when the repository exposes its recovery operations.
299
+ */
300
+ get supportsRecovery(): boolean;
301
+ /**
302
+ * Look up an attempt by its identifier, regardless of active status.
303
+ *
304
+ * Delegates to the repository's `getAttemptWithAllocation` operation.
305
+ * Throws when the repository does not support recovery.
306
+ * @param executionAttemptId - The attempt to look up.
307
+ * @returns The attempt record, or `null` if no such attempt exists.
308
+ */
309
+ getAttemptWithAllocation(executionAttemptId: string): Promise<ExecutionAttemptRecord | null>;
310
+ /**
311
+ * Record an allocation that provider discovery found for the attempt.
312
+ *
313
+ * Delegates to the repository's `recordDiscoveredAllocation` operation.
314
+ * Throws when the repository does not support recovery.
315
+ * @param input - Claim and the discovered allocation reference.
316
+ * @returns The durable discovered-allocation decision.
317
+ */
318
+ recordDiscoveredAllocation(input: RecordAllocationInput): Promise<DiscoveredAllocationDecision>;
319
+ /**
320
+ * Compare-and-set update of the allocation reference for a claimed attempt.
321
+ *
322
+ * Validates that `currentRef` and `nextRef` share the same `providerId`
323
+ * before delegating to the repository. Provider identity must not change
324
+ * during correlation — only the opaque `providerData` evolves.
325
+ * @param input - CAS evolution input with current and next references.
326
+ * @returns The evolution decision.
327
+ */
328
+ evolveAllocationRef(input: AllocationRefEvolution): Promise<AllocationRefEvolutionDecision>;
329
+ /**
330
+ * List all recoverable (allocated, non-settled) attempts for an execution.
331
+ *
332
+ * Delegates to the repository's `getRecoverableAttempts` operation.
333
+ * Throws when the repository does not support recovery.
334
+ * @param executionId - Workflow execution identifier.
335
+ * @returns Allocated, non-settled attempts eligible for recovery, oldest first.
336
+ */
337
+ getRecoverableAttempts(executionId: string): Promise<readonly RecoverableAttemptRecord[]>;
338
+ /**
339
+ * Record a confirmed infrastructure failure for an allocated attempt.
340
+ *
341
+ * Delegates the durable decision to the repository. When the failure is
342
+ * recorded, rejects the in-process waiter (if any) so runners observe
343
+ * the infrastructure failure immediately.
344
+ * @param input - Claim and the owning execution.
345
+ * @returns The infrastructure failure decision.
346
+ */
347
+ recordInfrastructureFailure(input: RecordInfrastructureFailureInput): Promise<InfrastructureFailureDecision>;
348
+ /**
349
+ * Durably abandon a dispatch attempt that did not receive an allocation.
350
+ *
351
+ * The repository refuses to use this transition for allocated attempts so a
352
+ * dispatcher cannot silently strand live infrastructure.
353
+ * @param executionAttemptId - Attempt whose pre-allocation dispatch ended.
354
+ * @param executionId - Workflow execution identifier.
355
+ * @returns The durable abandonment decision.
356
+ */
357
+ abandonPendingAttempt(executionAttemptId: string, executionId: string): Promise<PendingAttemptAbandonmentDecision>;
358
+ /**
359
+ * Obtain the repository's recovery operations, or refuse the call.
360
+ * @param operation - The recovery operation being attempted.
361
+ * @returns The repository's recovery operations.
362
+ * @throws When the repository does not implement recovery operations.
363
+ */
364
+ private requireRecovery;
365
+ /**
366
+ * Install an in-process waiter for the given attempt.
367
+ * @param executionAttemptId - Attempt to install a waiter for.
368
+ */
369
+ private installWaiter;
370
+ /**
371
+ * Settle the in-process waiter based on a repository decision.
372
+ *
373
+ * For accepted/duplicate, resolves with the canonical outcome.
374
+ * For conflict/fenced, rejects with a descriptive error.
375
+ * @param executionAttemptId - Attempt whose waiter to settle.
376
+ * @param decision - The durable outcome decision from the repository.
377
+ */
378
+ private settleWaiterInternal;
379
+ }
380
+ //#endregion
381
+ //#region subsystems/workflow-engine/src/workflow-executor.d.ts
382
+ /**
383
+ * Core workflow executor service.
384
+ *
385
+ * Orchestrates workflow execution lifecycle:
386
+ * - Creates coordinator session for each execution
387
+ * - Executes steps via the mutable DAG scheduler
388
+ * - Spawns subagents for each step
389
+ * - Tracks progress and emits lifecycle events
390
+ * - Manages cancellation and cleanup
391
+ */
392
+ declare class WorkflowExecutor extends BaseService {
393
+ /** Drizzle storage handler registration for the composition root. */
394
+ static readonly storage: {
395
+ readonly drizzle: typeof registerDrizzleWorkflowStorage;
396
+ };
397
+ private readonly config;
398
+ private readonly activeExecutions;
399
+ private readonly executionTasks;
400
+ private readonly shellAbortControllers;
401
+ private readonly activeRunnerSteps;
402
+ private readonly gateTimeoutScheduler;
403
+ private readonly resumeDispatches;
404
+ /**
405
+ * Per-execution abort controllers used to cancel workflow-level runners.
406
+ * Keyed by execution ID; only populated when a {@link IWorkflowRunner} is used.
407
+ */
408
+ private readonly workflowAbortControllers;
409
+ private readonly successFinalizers;
410
+ private readonly durableLifecycleTransitions;
411
+ private readonly lifecyclePublications;
412
+ private readonly publishingLifecycleExecutions;
413
+ private readonly workflowRunner?;
414
+ private readonly executionAttemptAuthority?;
415
+ private readonly materializationSpecResolvers;
416
+ private triggerTypeRegistry?;
417
+ /**
418
+ * Create a new workflow executor.
419
+ * @param bus - The message bus for communication
420
+ * @param config - Optional partial configuration (merged with defaults)
421
+ * @param workflowRunner - Optional workflow-level runner for isolated execution
422
+ * @param executionAttemptAuthority - Optional Authority for WorkerNode dispatch runners
423
+ */
424
+ constructor(bus: IMakaioBus, config?: Partial<ExecutorConfig>, workflowRunner?: IWorkflowRunner, executionAttemptAuthority?: ExecutionAttemptAuthority);
425
+ /**
426
+ * Set the trigger type registry for listTriggerTypes support.
427
+ * @param registry - Trigger type registry instance
428
+ */
429
+ setTriggerTypeRegistry(registry: IWorkflowTriggerTypeRegistry): void;
430
+ /**
431
+ * Retrieve the registry set via {@link setTriggerTypeRegistry}.
432
+ *
433
+ * The composition root calls this after boot to wire
434
+ * `setWorkflowTriggerTypeRegistry` from `@makaio/kernel`.
435
+ * @returns The trigger type registry, or `undefined` if not yet set.
436
+ */
437
+ getTriggerTypeRegistry(): IWorkflowTriggerTypeRegistry | undefined;
438
+ /**
439
+ * Register a host resolver used to freeze workspace materialization before a
440
+ * path-backed execution is persisted.
441
+ * @param resolver - Host-owned resolver.
442
+ * @returns Idempotent cleanup that unregisters this resolver.
443
+ */
444
+ registerWorkflowMaterializationSpecResolver(resolver: WorkflowMaterializationSpecResolver): () => void;
445
+ /**
446
+ * Register one named finalizer eligible for compiled workflow success transitions.
447
+ *
448
+ * A workflow selects this registration through its immutable
449
+ * `successFinalizerId` definition field. Disposing the returned registration
450
+ * leaves already-claimed work recoverable only when the same ID is registered
451
+ * again on a later executor instance.
452
+ * @param finalizerId - Stable finalizer identity used by the durable claim.
453
+ * @returns Idempotent cleanup after any recoverable claims have been drained.
454
+ * @throws When another active registration already owns `finalizerId`.
455
+ */
456
+ registerSuccessFinalizer(finalizerId: string): Promise<() => void>;
457
+ /**
458
+ * Accept a terminal result from an authority-dispatched runner that was not
459
+ * launched through this executor's in-memory task registry.
460
+ *
461
+ * Durable execution and run-context rows remain the source of truth. The
462
+ * executor temporarily adopts a missing active entry and delegates to the
463
+ * same runner-result finalization path used by executor-owned tasks.
464
+ * @param executionId - Durable authority-owned execution identity.
465
+ * @param result - Correlated terminal runner result.
466
+ * @returns The durable status after acceptance, including pending success finalization.
467
+ */
468
+ acceptAuthorityRunnerResult(executionId: string, result: WorkflowRunResult): Promise<{
469
+ accepted: boolean;
470
+ status: WorkflowExecution['status'];
471
+ }>;
472
+ private resolveAuthorityRunnerReplay;
473
+ private loadAuthorityRunnerContext;
474
+ private registerAuthorityResultFinalizer;
475
+ /**
476
+ * Register all bus handlers via BaseService lifecycle.
477
+ * Called once by `init()` — idempotency is handled by BaseService.
478
+ */
479
+ protected onInit(): Promise<void>;
480
+ /**
481
+ * Release in-flight executions and abort shell processes.
482
+ * Called by `destroy()` before handler unsubscription.
483
+ */
484
+ protected onDestroy(): Promise<void>;
485
+ /**
486
+ * Build a {@link FinalizerDeps} bundle from current instance state.
487
+ *
488
+ * Extracted to avoid duplicating the same field enumeration across the cancel
489
+ * handler, the shutdown path, and the runner rejection catch path.
490
+ * @returns Finalizer dependency bundle.
491
+ */
492
+ private buildFinalizerDeps;
493
+ /**
494
+ * Build a {@link RunnerTaskDeps} bundle for delegating to
495
+ * {@link buildExecutionTask} or {@link buildFileExecutionTask}.
496
+ * @param workflowRunner - The runner instance to use (always defined at these call sites).
497
+ * @returns Runner task dependency bundle.
498
+ */
499
+ private buildRunnerTaskDeps;
500
+ /**
501
+ * Resolve the workspace root inherited from a parent session.
502
+ *
503
+ * Coordinator sessions are created with this target working directory so
504
+ * in-process shell steps and workflow-level workers share the same workspace.
505
+ *
506
+ * Throws when a `parentSessionId` is supplied but the session does not exist.
507
+ * The session create handler enforces the same invariant, but throwing here
508
+ * provides a cleaner error before any coordinator session is created.
509
+ * @param parentSessionId - Optional parent session identifier.
510
+ * @returns Parent session working directory, or the executor default cwd.
511
+ * @throws When `parentSessionId` is provided but the session is not found.
512
+ */
513
+ private resolveExecutionWorkspaceRoot;
514
+ /**
515
+ * Derive ephemeral platform fields from the current process environment.
516
+ *
517
+ * Delegates to the shared {@link resolveEphemeralPlatformFields} helper
518
+ * with config-specific overrides for workspace root and Makaio home.
519
+ * @returns Ephemeral platform fields for the current machine.
520
+ */
521
+ private resolveEphemeralPlatformFields;
522
+ /**
523
+ * Build the {@link StartExecutionDeps} bundle used by {@link startExecution}
524
+ * and {@link startFileExecution}.
525
+ * @returns Start execution dependency bundle.
526
+ */
527
+ private buildStartDeps;
528
+ /** Register execution control handlers (start, cancel). */
529
+ private registerExecutionHandlers;
530
+ /** Register timeout wakeup handlers for parked gates. */
531
+ private registerGateTimeoutHandlers;
532
+ /**
533
+ * Rebuild timeout wakeups for exit-based gates left waiting across executor restarts.
534
+ *
535
+ * Gate rows persist the effective timeout policy captured when the reviewer
536
+ * prompt opened, so rehydration does not depend on the current workflow
537
+ * definition or a definition snapshot being available. Expired deadlines are
538
+ * scheduled with zero delay and redispatched by the same persisted-gate
539
+ * timeout path used for live suspensions.
540
+ */
541
+ private rehydratePausedGateTimeouts;
542
+ /**
543
+ * Main execution loop — drives the primitive runtime over the workflow's
544
+ * root sequence node.
545
+ *
546
+ * Creates a per-execution `RuntimeContext` and `AbortController`, then
547
+ * delegates to {@link executeSequence} to walk the node tree. The abort
548
+ * controller is registered in `workflowAbortControllers` so the cancel
549
+ * handler can interrupt a running execution.
550
+ * @param executionId - The execution ID.
551
+ */
552
+ private runExecution;
553
+ /**
554
+ * Accept a gate response for an execution that is paused in storage.
555
+ *
556
+ * Checks that the execution is paused, the response targets a waiting gate
557
+ * frame directly or by a unique gate node, and the submitted resume data
558
+ * matches the persisted gate schema. On a valid response, updates the gate
559
+ * instance to its resolved state and triggers a resume dispatch via
560
+ * {@link resumePausedExecution}.
561
+ *
562
+ * Returns `false` without modifying state when the execution is not paused
563
+ * or the gate response is ambiguous or invalid, allowing the bus to continue
564
+ * to the next handler.
565
+ * @param payload - Gate response payload from the bus request context.
566
+ * @returns `true` when the gate was accepted and resume dispatched; `false` otherwise.
567
+ */
568
+ private respondToPausedGate;
569
+ /**
570
+ * Transition a paused execution back to running and re-dispatch it through
571
+ * the configured runner infrastructure.
572
+ * @param executionId - Execution to resume.
573
+ */
574
+ private resumePausedExecution;
575
+ /**
576
+ * Dispatch a paused execution once durable resume state is available.
577
+ * @param executionId - Execution to resume.
578
+ * @returns True when a runner task was launched.
579
+ */
580
+ private dispatchPausedExecutionResume;
581
+ }
582
+ //#endregion
583
+ //#region subsystems/workflow-engine/src/cron-trigger-evaluator.d.ts
584
+ /**
585
+ * Schedules and fires cron triggers for workflows on `'main-dev-machine'` role machines.
586
+ *
587
+ * On `init`, loads all workflow definitions with `cron` triggers and schedules
588
+ * them via croner. Subscribes to workflow CRUD events to keep the schedule
589
+ * index live.
590
+ *
591
+ * Each cron trigger fires `WorkflowSubjects.start` with the workflow ID and
592
+ * a `triggerPayload` containing the scheduled fire time.
593
+ *
594
+ * ## Role partitioning
595
+ *
596
+ * Only machines with role `'main-dev-machine'` should run this evaluator.
597
+ * Server-role machines rely on the relay-side `CronEvaluator` for routing.
598
+ * @example
599
+ * ```typescript
600
+ * if (machineRole === 'main-dev-machine') {
601
+ * const evaluator = new CronTriggerEvaluator(bus);
602
+ * await evaluator.init();
603
+ * // ...on shutdown:
604
+ * evaluator.destroy();
605
+ * }
606
+ * ```
607
+ */
608
+ declare class CronTriggerEvaluator {
609
+ private readonly bus;
610
+ private readonly cleanupFns;
611
+ private initialized;
612
+ /**
613
+ * Active cron jobs keyed by `{workflowId}:{triggerIndex}`.
614
+ */
615
+ private readonly jobs;
616
+ /**
617
+ * @param bus - The shared bus instance
618
+ */
619
+ constructor(bus: IMakaioBus);
620
+ /**
621
+ * Initialize the evaluator.
622
+ *
623
+ * Idempotent: calling `init()` on an already-initialized evaluator is a no-op.
624
+ */
625
+ init(): Promise<void>;
626
+ /**
627
+ * Destroy the evaluator, stopping all cron jobs and removing all subscriptions.
628
+ *
629
+ * Idempotent: calling `destroy()` on a non-initialized evaluator is a no-op.
630
+ */
631
+ destroy(): void;
632
+ activeJobCount(): number;
633
+ /**
634
+ * Load all existing workflow definitions and schedule their cron triggers.
635
+ */
636
+ private loadExistingTriggers;
637
+ /**
638
+ * Schedule all `cron` triggers found in a workflow definition.
639
+ * @param workflow - Workflow definition to schedule
640
+ */
641
+ private scheduleWorkflow;
642
+ /**
643
+ * Stop and remove all cron jobs for a given workflow.
644
+ * @param workflowId - Workflow identifier to unschedule
645
+ */
646
+ private unscheduleWorkflow;
647
+ /**
648
+ * Stop and remove a single cron job by key.
649
+ * @param key - Job key (`{workflowId}:{triggerIndex}`)
650
+ */
651
+ private stopJob;
652
+ /**
653
+ * Stop all active cron jobs and clear the jobs map.
654
+ */
655
+ private stopAllJobs;
656
+ /**
657
+ * Fire a cron trigger by requesting workflow start.
658
+ *
659
+ * Errors are logged but not propagated — cron jobs are fire-and-forget.
660
+ * @param workflowId - Workflow to start
661
+ * @param triggerIndex - Index of the trigger that fired
662
+ */
663
+ private fireTrigger;
664
+ }
665
+ //#endregion
666
+ //#region subsystems/workflow-engine/src/workflow-engine-service.d.ts
667
+ /**
668
+ * Options for constructing a {@link WorkflowEngineService}.
669
+ *
670
+ * All fields are optional — when omitted the service uses the in-process
671
+ * workflow scheduler and default executor config.
672
+ */
673
+ interface WorkflowEngineServiceOptions {
674
+ /**
675
+ * Workflow-level runner for dispatching full workflow executions to an
676
+ * isolated environment (worker thread pool, child process, container).
677
+ *
678
+ * When provided the executor delegates each new execution to this runner
679
+ * instead of running it in-process via the DAG scheduler.
680
+ * When omitted, execution falls back to the in-process DAG scheduler.
681
+ */
682
+ workflowRunner?: IWorkflowRunner;
683
+ /** Partial executor configuration merged with defaults. */
684
+ executorConfig?: Partial<ExecutorConfig>;
685
+ /**
686
+ * Injected execution attempt persistence port.
687
+ *
688
+ * Required when the workflow runner uses WorkerNode dispatch mode. The
689
+ * consuming host application provides the concrete implementation that owns
690
+ * durable attempt records and accept/duplicate/conflict/fence decisions.
691
+ *
692
+ * When omitted, the workflow engine operates without attempt tracking
693
+ * (framework-only, in-process, and Piscina modes).
694
+ */
695
+ executionAttemptRepository?: ExecutionAttemptRepository;
696
+ /**
697
+ * Pre-built execution attempt Authority.
698
+ *
699
+ * When provided, the service uses this Authority directly instead of
700
+ * constructing one from the repository. This allows the Authority to be
701
+ * shared with the runner that was constructed before this service.
702
+ *
703
+ * Takes precedence over `executionAttemptRepository` for Authority
704
+ * construction. When both are provided, the pre-built Authority is used
705
+ * and the repository is ignored.
706
+ */
707
+ executionAttemptAuthority?: ExecutionAttemptAuthority;
708
+ /** Host-owned resolvers that create portable specs for path-backed starts. */
709
+ workflowMaterializationSpecResolvers?: readonly WorkflowMaterializationSpecResolver[];
710
+ }
711
+ /**
712
+ * Workflow engine package service.
713
+ *
714
+ * Owns the boot lifecycle for the workflow executor and trigger evaluators so
715
+ * stored triggers become active during normal runtime package startup.
716
+ */
717
+ declare class WorkflowEngineService extends BaseService {
718
+ private readonly workflowExecutor;
719
+ private readonly busEventTriggerEvaluator;
720
+ private readonly cronTriggerEvaluator;
721
+ private readonly attemptAuthority;
722
+ private readonly workspaceRootResolvers;
723
+ /**
724
+ * @param bus - Shared runtime bus.
725
+ * @param options - Optional workflow runner and executor config overrides.
726
+ */
727
+ constructor(bus: IMakaioBus, options?: WorkflowEngineServiceOptions);
728
+ /**
729
+ * Executor owned by this package service.
730
+ * @returns Workflow executor instance.
731
+ */
732
+ get executor(): WorkflowExecutor;
733
+ /**
734
+ * Execution attempt Authority owned by this package service.
735
+ *
736
+ * Present only when an {@link ExecutionAttemptRepository} was injected at
737
+ * construction time (WorkerNode dispatch mode). Returns `undefined` for
738
+ * framework-only, in-process, and Piscina modes.
739
+ * @returns Authority instance, or `undefined` when no repository is injected.
740
+ */
741
+ get executionAttemptAuthority(): ExecutionAttemptAuthority | undefined;
742
+ /**
743
+ * Register a named workflow success finalizer with the owned executor.
744
+ *
745
+ * Compiled workflow definitions opt into this registration through their
746
+ * immutable `successFinalizerId`; registration alone never changes ordinary
747
+ * workflow completion behavior.
748
+ * @param finalizerId - Stable lifecycle-finalizer identity.
749
+ * @returns Idempotent cleanup that unregisters this exact registration.
750
+ */
751
+ registerSuccessFinalizer(finalizerId: string): Promise<() => void>;
752
+ /**
753
+ * Accept a terminal result for a durable authority-owned runner execution.
754
+ * @param executionId - Durable authority-owned execution identity.
755
+ * @param result - Correlated terminal result returned by the runner.
756
+ * @returns The current durable status after acceptance.
757
+ */
758
+ acceptAuthorityRunnerResult(executionId: string, result: Parameters<WorkflowExecutor['acceptAuthorityRunnerResult']>[1]): ReturnType<WorkflowExecutor['acceptAuthorityRunnerResult']>;
759
+ /**
760
+ * Cron evaluator owned by this package service.
761
+ * @returns Cron trigger evaluator instance.
762
+ */
763
+ get cronTriggers(): CronTriggerEvaluator;
764
+ /**
765
+ * Set the trigger type registry used by executor request handlers.
766
+ * @param registry - Trigger type registry instance.
767
+ */
768
+ setTriggerTypeRegistry(registry: IWorkflowTriggerTypeRegistry): void;
769
+ /**
770
+ * Retrieve the executor trigger type registry.
771
+ * @returns Trigger type registry, or `undefined` when none is set.
772
+ */
773
+ getTriggerTypeRegistry(): IWorkflowTriggerTypeRegistry | undefined;
774
+ /**
775
+ * Register a host resolver used to freeze a path-backed workflow's workspace
776
+ * reference before the durable run context is written.
777
+ * @param resolver - Host-owned resolver.
778
+ * @returns Idempotent cleanup that unregisters this resolver.
779
+ */
780
+ registerWorkflowMaterializationSpecResolver(resolver: WorkflowMaterializationSpecResolver): () => void;
781
+ /**
782
+ * Register a host-owned workspace-root resolver.
783
+ * @param resolver - Resolver to consult before the boot-level fallback resolver.
784
+ * @returns Idempotent cleanup that unregisters this exact resolver.
785
+ */
786
+ registerWorkspaceRootResolver(resolver: WorkflowWorkspaceRootResolver): () => void;
787
+ /**
788
+ * Resolve a portable workspace identifier through registered host resolvers.
789
+ * @param workspaceId - Portable workspace identifier from a materialization spec.
790
+ * @returns The first registered root, or `undefined` when no resolver recognizes the identifier.
791
+ */
792
+ resolveWorkspaceRoot(workspaceId: string): Promise<string | undefined>;
793
+ /**
794
+ * Initialize executor handlers before trigger evaluators can fire starts.
795
+ * @returns Promise that resolves once all child services are initialized.
796
+ */
797
+ protected onInit(): Promise<void>;
798
+ /**
799
+ * Tear down child services in reverse boot order.
800
+ * @returns Promise that resolves once all child services are destroyed.
801
+ */
802
+ private destroyOwnedServices;
803
+ }
804
+ //#endregion
805
+ //#region subsystems/workflow-engine/src/package.d.ts
806
+ /** Typed package token for retrieving the workflow engine package service. */
807
+ declare const WorkflowEngineToken: _$_makaio_contracts0.ExtensionToken<WorkflowEngineService>;
808
+ /**
809
+ * Create a workflow engine package manifest with optional runtime overrides.
810
+ *
811
+ * The returned manifest registers the `WorkflowEngineService` as the package
812
+ * service, wires Drizzle storage handlers, and forwards the provided options
813
+ * to the executor so that composition roots can inject a workflow-level runner
814
+ * or executor configuration (e.g. busUrl, busAuth, platformDefaults).
815
+ * @param options - Optional workflow runner and executor config overrides.
816
+ * @returns A `MakaioNodeExtension` manifest for the workflow engine subsystem.
817
+ */
818
+ declare function createWorkflowEnginePackage(options?: WorkflowEngineServiceOptions): MakaioNodeExtension<IMakaioBus>;
819
+ /**
820
+ * Default workflow engine package manifest (no runtime overrides).
821
+ *
822
+ * Equivalent to `createWorkflowEnginePackage()` with no arguments. Preserved
823
+ * for existing consumers that reference the static constant directly.
824
+ */
825
+ declare const workflowEnginePackage: MakaioNodeExtension<IMakaioBus>;
826
+ //#endregion
827
+ export { WorkflowEngineServiceOptions as a, WorkflowMaterializationSpecResolution as c, registerDrizzleWorkflowStorage as d, WorkflowEngineService as i, WorkflowMaterializationSpecResolver as l, createWorkflowEnginePackage as n, WorkflowExecutor as o, workflowEnginePackage as r, ExecutionAttemptAuthority as s, WorkflowEngineToken as t, WorkflowWorkspaceRootResolver as u };