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

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 (473) 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 +204 -27
  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.mjs +1 -1
  17. package/dist/{canonical-model-EMRYCVjX.mjs → canonical-model-BAytQ4NV.mjs} +1 -1
  18. package/dist/capabilities-BQEp34ir.mjs +1 -0
  19. package/dist/{client-OYk0Ttck.mjs → client-DbS847wW.mjs} +1 -1
  20. package/dist/clients/index.d.mts +5 -3
  21. package/dist/clients/index.mjs +1 -1
  22. package/dist/clients/managed-install.d.mts +1 -1
  23. package/dist/clients/managed-install.mjs +1 -1
  24. package/dist/{compression-CZ_6fYq8.mjs → compression-74fFeBha.mjs} +1 -1
  25. package/dist/{config-namespace-DTA6EQL8.mjs → config-namespace-TVX-hG4I.mjs} +1 -1
  26. package/dist/{context-resolution-B9ANWbG0.d.mts → context-resolution-BQBk4Ish.d.mts} +6 -4
  27. package/dist/contracts/adapter/index.d.mts +2 -2
  28. package/dist/contracts/adapter/index.mjs +1 -1
  29. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  30. package/dist/contracts/artifact/index.d.mts +2 -2
  31. package/dist/contracts/artifact/index.mjs +1 -1
  32. package/dist/contracts/auth/index.d.mts +2 -2
  33. package/dist/contracts/auth/index.mjs +1 -1
  34. package/dist/contracts/canonical-model/index.d.mts +1 -1
  35. package/dist/contracts/canonical-model/index.mjs +1 -1
  36. package/dist/contracts/capabilities/index.d.mts +2 -0
  37. package/dist/contracts/capabilities/index.mjs +1 -0
  38. package/dist/contracts/client/index.d.mts +2 -2
  39. package/dist/contracts/client/index.mjs +1 -1
  40. package/dist/contracts/common/index.d.mts +1 -1
  41. package/dist/contracts/config/index.d.mts +24 -2
  42. package/dist/contracts/config/index.mjs +1 -1
  43. package/dist/contracts/extension/index.d.mts +4 -4
  44. package/dist/contracts/extension/index.mjs +1 -1
  45. package/dist/contracts/facet/index.d.mts +1 -1
  46. package/dist/contracts/facet/index.mjs +1 -1
  47. package/dist/contracts/harness/index.d.mts +1 -1
  48. package/dist/contracts/harness/index.mjs +1 -1
  49. package/dist/contracts/host/index.d.mts +1 -1
  50. package/dist/contracts/host/index.mjs +1 -1
  51. package/dist/contracts/index.d.mts +1682 -9431
  52. package/dist/contracts/index.mjs +1 -1
  53. package/dist/contracts/materialization/index.d.mts +3 -3
  54. package/dist/contracts/materialization/index.mjs +1 -1
  55. package/dist/contracts/model-registry/index.d.mts +1 -1
  56. package/dist/contracts/model-registry/index.mjs +1 -1
  57. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  58. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  59. package/dist/contracts/platform/index.d.mts +1 -1
  60. package/dist/contracts/platform/index.mjs +1 -1
  61. package/dist/contracts/provider/index.d.mts +2 -2
  62. package/dist/contracts/provider/index.mjs +1 -1
  63. package/dist/contracts/session/index.d.mts +2 -2
  64. package/dist/contracts/session/index.mjs +1 -1
  65. package/dist/contracts/shared/index.d.mts +2 -2
  66. package/dist/contracts/shared/index.mjs +1 -1
  67. package/dist/contracts/skill/index.d.mts +1 -1
  68. package/dist/contracts/skill/index.mjs +1 -1
  69. package/dist/contracts/telemetry/index.d.mts +1 -1
  70. package/dist/contracts/telemetry/index.mjs +1 -1
  71. package/dist/contracts/timeout/index.d.mts +1 -1
  72. package/dist/contracts/timeout/index.mjs +1 -1
  73. package/dist/contracts/toast/index.mjs +1 -1
  74. package/dist/contracts/variant/index.d.mts +1 -1
  75. package/dist/contracts/variant/index.mjs +1 -1
  76. package/dist/contracts/worker-node/index.d.mts +2 -0
  77. package/dist/contracts/worker-node/index.mjs +1 -0
  78. package/dist/contracts/workflow/index.d.mts +3 -3
  79. package/dist/contracts/workflow/index.mjs +1 -1
  80. package/dist/{definition-K3m51lgO.mjs → definition-CJfiv8xm.mjs} +1 -1
  81. package/dist/{detached-extension-handle-BsywhHfk.mjs → detached-extension-handle-Ddfquy5_.mjs} +1 -1
  82. package/dist/drizzle/0030_remote-worker-execution.sql +6 -0
  83. package/dist/drizzle/meta/_journal.json +7 -0
  84. package/dist/execution-attempt-repository-DWXKY41_.d.mts +1056 -0
  85. package/dist/execution-target-Cf645pDj.mjs +1 -0
  86. package/dist/{extension-Cgg45Xk1.mjs → extension-DCA4pYrY.mjs} +1 -1
  87. package/dist/extension-hjOPs10e.mjs +1 -0
  88. package/dist/{filesystem-service-Cupz_Z7S.mjs → filesystem-service-DlP2HfDg.mjs} +1 -1
  89. package/dist/framework-packages-C3RWfJDk.mjs +1 -0
  90. package/dist/git/index.mjs +1 -1
  91. package/dist/{globby-DWp7V-P2.mjs → globby-1yCVCk8s.mjs} +1 -1
  92. package/dist/{handlers-cMBmexF4.mjs → handlers-CfnLyLfE.mjs} +1 -1
  93. package/dist/{harness-DflvHAGV.mjs → harness-DpwsFsE7.mjs} +1 -1
  94. package/dist/{index-BhXCCgJV2.d.mts → index-4fE_hUP02.d.mts} +1 -1
  95. package/dist/{index-BMx59xb7.d.mts → index-8gKx-OVP.d.mts} +13 -7
  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-CnXXq6sW.d.mts → index-BC79QrGC.d.mts} +10 -10
  99. package/dist/{index-CvmWRumB.d.mts → index-BQLUVXIB.d.mts} +1024 -888
  100. package/dist/{index-CKO9S6oo.d.mts → index-BXD3kEs_.d.mts} +28 -10
  101. package/dist/{index-DUf47Jn_.d.mts → index-BskPjMet.d.mts} +8 -8
  102. package/dist/{index-CjyfQ_vQ.d.mts → index-CL-0NeQW.d.mts} +8 -5
  103. package/dist/{index-Cw7_69gV.d.mts → index-CRvpVIqA.d.mts} +1 -1
  104. package/dist/{index-7FjcxGlK.d.mts → index-CUvNKYkV.d.mts} +1 -1
  105. package/dist/{index-CtUTCAJ6.d.mts → index-CVaRZoiu.d.mts} +4 -4
  106. package/dist/{index-Cw84_Dqi.d.mts → index-CnMu8BQl.d.mts} +4 -4
  107. package/dist/{index-DaMfTvfz.d.mts → index-DA9g2A5P.d.mts} +1 -1
  108. package/dist/{index-Bi5jFT9S.d.mts → index-DJAmSnuh.d.mts} +12 -12
  109. package/dist/{index-pjATMrvJ.d.mts → index-DkiTJM5p.d.mts} +693 -31
  110. package/dist/{index-jbgHR5J2.d.mts → index-GHASUiem.d.mts} +1 -1
  111. package/dist/{index-BDDbcWNI.d.mts → index-HsTxm-R3.d.mts} +3 -3
  112. package/dist/{index-Bs3CXR232.d.mts → index-I5YG-qrb2.d.mts} +6 -6
  113. package/dist/{index-0Ju2i8gV.d.mts → index-SsBHjUqA.d.mts} +204 -165
  114. package/dist/index-XZyMxxnU.d.mts +1602 -0
  115. package/dist/{index-dkvGHN10.d.mts → index-brqfk9JQ.d.mts} +6 -6
  116. package/dist/{index-D43lQCHs.d.mts → index-q0Tiqems.d.mts} +131 -131
  117. package/dist/index-w_FmghjT.d.mts +7295 -0
  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-DwQtzlY-.mjs → namespace-BqxtpNAn.mjs} +1 -1
  145. package/dist/{namespace-BHliaabz.d.mts → namespace-DBm9K23m.d.mts} +6 -6
  146. package/dist/{namespace-zOfq1Uhn.d.mts → namespace-DI4Yx_xu.d.mts} +27 -27
  147. package/dist/namespace-DJfUADSV.mjs +1 -0
  148. package/dist/{namespace-BphMM6S82.d.mts → namespace-DPgxPa8m2.d.mts} +1 -1
  149. package/dist/{namespace-Bd49QmzS.d.mts → namespace-DWCEo-9M.d.mts} +0 -60
  150. package/dist/{namespace-CriPb5wY.d.mts → namespace-jPUGV-b2.d.mts} +42 -42
  151. package/dist/{native-session-supervisor-Bgz-Q1WH.mjs → native-session-supervisor-DRx0MX-d.mjs} +1 -1
  152. package/dist/node/bus-server/index.d.mts +1 -1
  153. package/dist/node/bus-server/index.mjs +1 -1
  154. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  155. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  156. package/dist/node/transports/index.d.mts +81 -9
  157. package/dist/node/transports/index.mjs +2 -2
  158. package/dist/{orchestrator-shared-CY7Tu7kZ.mjs → orchestrator-shared-BxmHCPvx.mjs} +1 -1
  159. package/dist/package-CNUPPcU1.mjs +7 -0
  160. package/dist/package-DWMxGfzK.d.mts +827 -0
  161. package/dist/{package-DKnzOvoR.mjs → package-Dft_RItb.mjs} +1 -1
  162. package/dist/package.json +1 -1
  163. package/dist/{packages-zDnokBpl.mjs → packages-DtEEP0Vt.mjs} +1 -1
  164. package/dist/{profile-BRi6K6am.mjs → profile-BTAI31Nt.mjs} +1 -1
  165. package/dist/{provider-context-DOsjOjiR.mjs → provider-context-Dq53Cgzz.mjs} +1 -1
  166. package/dist/{provider-context-BYkMl--1.mjs → provider-context-PZIQWcqQ.mjs} +1 -1
  167. package/dist/provider-operation-Cxoe2SUr.d.mts +207 -0
  168. package/dist/providers/index.mjs +1 -1
  169. package/dist/{registry-Dw6l7k3e.mjs → registry-wfF2uTty.mjs} +29 -29
  170. package/dist/{resolved-O2XXjTeu.mjs → resolved-DZgqql2Z.mjs} +1 -1
  171. package/dist/rules/index.d.mts +1 -1
  172. package/dist/rules/index.mjs +1 -1
  173. package/dist/rules/schemas.d.mts +1 -1
  174. package/dist/runtime-bun/index.mjs +1 -1
  175. package/dist/runtime-node/extension-discovery.d.mts +1 -1
  176. package/dist/runtime-node/extension-validation.d.mts +1 -1
  177. package/dist/runtime-node/extension-validation.mjs +1 -1
  178. package/dist/runtime-node/index.d.mts +4 -4
  179. package/dist/runtime-node/index.mjs +24 -24
  180. package/dist/runtime-node/makaio-config.d.mts +1 -1
  181. package/dist/runtime-node/makaio-config.mjs +1 -1
  182. package/dist/runtime-node/static/model-registry.yaml +348 -0
  183. package/dist/runtime-node/workflow-worker/index.d.mts +2 -2
  184. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  185. package/dist/runtime-node/workflow-worker/worker-entry.d.mts +7 -4
  186. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  187. package/dist/{schema-BO9TgmOs.d.mts → schema-Bwr_NrOS.d.mts} +2 -2
  188. package/dist/{schema-BI0aCHvV.mjs → schema-Dd-e89MO.mjs} +1 -1
  189. package/dist/{schemas-B5tMYfhC.d.mts → schemas-C4yUXs4G.d.mts} +4 -4
  190. package/dist/schemas-CRB2O5zo.mjs +1 -0
  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-BDC2Nqj1.d.mts → schemas-ENwK6jmV.d.mts} +14 -14
  194. package/dist/{schemas-ChF2z4RB.d.mts → schemas-N6x2z7Lf.d.mts} +0 -45
  195. package/dist/schemas-tDf_WiC8.mjs +1 -0
  196. package/dist/selection-BNwTKEVT.mjs +1 -0
  197. package/dist/service-base/index.d.mts +47 -2
  198. package/dist/service-base/index.mjs +1 -1
  199. package/dist/services/adapter-runtime/index.d.mts +3 -3
  200. package/dist/services/adapter-runtime/index.mjs +1 -1
  201. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  202. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  203. package/dist/services/adapter-subsystem/index.d.mts +3 -3
  204. package/dist/services/adapter-subsystem/index.mjs +1 -1
  205. package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
  206. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  207. package/dist/services/agent-runtime/index.d.mts +2 -2
  208. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  209. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  210. package/dist/services/capability/index.d.mts +1 -1
  211. package/dist/services/capability/index.mjs +1 -1
  212. package/dist/services/codebase/index.d.mts +2 -2
  213. package/dist/services/codebase/namespace.d.mts +1 -1
  214. package/dist/services/codebase/schemas.d.mts +1 -1
  215. package/dist/services/compression/index.d.mts +2 -2
  216. package/dist/services/compression/namespace.d.mts +1 -1
  217. package/dist/services/compression/schemas.d.mts +1 -1
  218. package/dist/services/context-rules/index.d.mts +7 -7
  219. package/dist/services/context-rules/index.mjs +1 -1
  220. package/dist/services/execution-target/index.d.mts +4 -4
  221. package/dist/services/execution-target/index.mjs +1 -1
  222. package/dist/services/execution-target/namespace.d.mts +1 -1
  223. package/dist/services/execution-target/namespace.mjs +1 -1
  224. package/dist/services/execution-target/schemas.d.mts +1 -1
  225. package/dist/services/execution-target/schemas.mjs +1 -1
  226. package/dist/services/filesystem/index.d.mts +1 -1
  227. package/dist/services/filesystem/index.mjs +1 -1
  228. package/dist/services/git/namespace.d.mts +2 -2
  229. package/dist/services/git/namespace.mjs +1 -1
  230. package/dist/services/git/schemas.d.mts +2 -2
  231. package/dist/services/git/schemas.mjs +1 -1
  232. package/dist/services/harness/index.d.mts +3 -3
  233. package/dist/services/harness/index.mjs +1 -1
  234. package/dist/services/index.d.mts +86 -371
  235. package/dist/services/index.mjs +1 -1
  236. package/dist/services/log-import/browser.d.mts +2 -2
  237. package/dist/services/log-import/index.d.mts +2 -2
  238. package/dist/services/log-import/log-import.d.mts +1 -1
  239. package/dist/services/log-import/log-import.mjs +1 -1
  240. package/dist/services/log-import/namespace.d.mts +2 -2
  241. package/dist/services/log-import/namespace.mjs +1 -1
  242. package/dist/services/log-import/schemas.d.mts +1 -1
  243. package/dist/services/log-import/schemas.mjs +1 -1
  244. package/dist/services/materialization/index.d.mts +1 -1
  245. package/dist/services/materialization/index.mjs +1 -1
  246. package/dist/services/model-registry/index.d.mts +1 -1
  247. package/dist/services/model-registry/index.mjs +1 -1
  248. package/dist/services/preferences/index.d.mts +2 -2
  249. package/dist/services/preferences/schemas.d.mts +1 -1
  250. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  251. package/dist/services/provider-context/index.d.mts +1 -1
  252. package/dist/services/provider-context/index.mjs +1 -1
  253. package/dist/services/provider-runtime/index.mjs +1 -1
  254. package/dist/services/session/handlers/index.d.mts +1 -1
  255. package/dist/services/session/handlers/index.mjs +1 -1
  256. package/dist/services/session/index.d.mts +9 -9
  257. package/dist/services/session/index.mjs +1 -1
  258. package/dist/services/session/messages/namespace.d.mts +1 -1
  259. package/dist/services/session/messages/namespace.mjs +1 -1
  260. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  261. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  262. package/dist/services/session/session-events/namespace.d.mts +1 -1
  263. package/dist/services/session/session-events/namespace.mjs +1 -1
  264. package/dist/services/session/storage/namespace.d.mts +1 -1
  265. package/dist/services/session/storage/schema.d.mts +1 -1
  266. package/dist/services/session/testing/index.mjs +1 -1
  267. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  268. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  269. package/dist/services/session/turns/namespace.d.mts +1 -1
  270. package/dist/services/session/turns/namespace.mjs +1 -1
  271. package/dist/services/session-editor/index.d.mts +1 -1
  272. package/dist/services/session-editor/index.mjs +1 -1
  273. package/dist/services/settings/index.d.mts +3 -3
  274. package/dist/services/settings/index.mjs +1 -1
  275. package/dist/services/settings/namespace.d.mts +14 -14
  276. package/dist/services/settings/namespace.mjs +1 -1
  277. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  278. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  279. package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
  280. package/dist/services/settings/storage/index.d.mts +3 -3
  281. package/dist/services/settings/storage/index.mjs +1 -1
  282. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  283. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  284. package/dist/services/subagent/index.d.mts +1 -1
  285. package/dist/services/subagent/index.mjs +1 -1
  286. package/dist/services/subagent-template/index.d.mts +2 -2
  287. package/dist/services/subagent-template/namespace.d.mts +1 -1
  288. package/dist/services/subagent-template/schemas.d.mts +1 -1
  289. package/dist/services/tool-approval/index.d.mts +1 -1
  290. package/dist/services/tool-approval/index.mjs +1 -1
  291. package/dist/services/tools/index.d.mts +1 -1
  292. package/dist/services/tools/index.mjs +1 -1
  293. package/dist/services/tray-menu/index.d.mts +3 -3
  294. package/dist/services/tray-menu/index.mjs +1 -1
  295. package/dist/services/tray-menu/namespace.d.mts +1 -1
  296. package/dist/services/tray-menu/schemas.d.mts +1 -1
  297. package/dist/services/turn/index.d.mts +1 -1
  298. package/dist/services/turn/namespace.d.mts +1 -1
  299. package/dist/services/workflow-transitions/index.d.mts +2 -0
  300. package/dist/services/workflow-transitions/index.mjs +1 -0
  301. package/dist/{session-Carng3Yk.mjs → session-BOGCd18q.mjs} +1 -1
  302. package/dist/{session-idI1jk5X.mjs → session-BTFiDoGz.mjs} +1 -1
  303. package/dist/{session-lineage-Cte63dGx.d.mts → session-lineage-B_JW5LpF.d.mts} +1 -1
  304. package/dist/{shared-RP_KARKF.mjs → shared-BQ0CHIVy.mjs} +1 -1
  305. package/dist/{skill-CpNjWFuE.mjs → skill-BR6rkfLe.mjs} +1 -1
  306. package/dist/{src-XihJcAQS.mjs → src-DD0v-nIj.mjs} +1 -1
  307. package/dist/storage/drizzle/client.d.mts +1 -1
  308. package/dist/storage/drizzle/client.mjs +1 -1
  309. package/dist/storage/drizzle/index.d.mts +50 -2
  310. package/dist/storage/drizzle/index.mjs +1 -1
  311. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  312. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  313. package/dist/storage/handlers/index.d.mts +1 -1
  314. package/dist/storage/handlers/index.mjs +1 -1
  315. package/dist/testing/drizzle-harness.d.mts +44 -3
  316. package/dist/testing/drizzle-harness.mjs +1 -1
  317. package/dist/{tool-approval-service-fIZ9x0kL.mjs → tool-approval-service-kBA0fRzm.mjs} +1 -1
  318. package/dist/tools-PdG9fO1M.mjs +1 -0
  319. package/dist/{transition-BodgGLZx.d.mts → transition-DuVzKt8-.d.mts} +3 -42
  320. package/dist/{types-LspCUW09.d.mts → types-B1MNcwgH.d.mts} +1 -1
  321. package/dist/{types-Bzxo7ATi.d.mts → types-BqVAOzJP.d.mts} +48 -48
  322. package/dist/{types-DBb5jY4Z.d.mts → types-CJ_QZ1yW.d.mts} +47 -3
  323. package/dist/ui-kernel/index.d.mts +1 -1
  324. package/dist/ui-kernel/index.mjs +1 -1
  325. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  326. package/dist/utils/index.d.mts +18 -4
  327. package/dist/utils/index.mjs +1 -1
  328. package/dist/{version-BbWrAPld.mjs → version-CoCeMxDT.mjs} +1 -1
  329. package/dist/{view-builder-tU7iaxrk.d.mts → view-builder-CvoSL2oL.d.mts} +2 -1
  330. package/dist/visibility-qhGWmpSJ.mjs +1 -0
  331. package/dist/worker-node-Bl9_vqYi.mjs +1 -0
  332. package/dist/worker-node-DZTuT1DS.mjs +1 -0
  333. package/dist/workflow-BfDbgtIQ.mjs +1 -0
  334. package/dist/workflow-engine/execution-attempt-repository.d.mts +2 -0
  335. package/dist/workflow-engine/execution-attempt-repository.mjs +1 -0
  336. package/dist/workflow-engine/index.d.mts +619 -685
  337. package/dist/workflow-engine/index.mjs +1 -1
  338. package/dist/workflow-engine/package.d.mts +1 -1
  339. package/dist/workflow-engine/package.mjs +1 -1
  340. package/dist/workflow-engine/provider-operation.d.mts +2 -0
  341. package/dist/workflow-engine/provider-operation.mjs +1 -0
  342. package/dist/workflow-engine/testing/index.d.mts +146 -0
  343. package/dist/workflow-engine/testing/index.mjs +1 -0
  344. package/dist/workflow-engine/testing/sqlite.d.mts +22 -0
  345. package/dist/workflow-engine/testing/sqlite.mjs +130 -0
  346. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  347. package/dist/workflow-transitions-DSc45ixc.mjs +1 -0
  348. package/dist/workflow-worker-BN9XPxQO.mjs +1 -0
  349. package/package.json +20 -3
  350. package/dist/authority-state-bootstrap-C_-F_dtq.mjs +0 -1
  351. package/dist/execution-target-CsZXIvli.mjs +0 -1
  352. package/dist/extension-CjTu6mzW.mjs +0 -1
  353. package/dist/model-uE5IyUFJ.mjs +0 -1
  354. package/dist/namespace-C05pkLbN.mjs +0 -1
  355. package/dist/package-BSG1681x.d.mts +0 -427
  356. package/dist/package-DW1Upu8E.mjs +0 -7
  357. package/dist/schemas-BRxU_oqL.mjs +0 -1
  358. package/dist/schemas-C-J4W1ID.mjs +0 -1
  359. package/dist/selection-YRuVSdck.mjs +0 -1
  360. package/dist/tools-Cs2DwjCC.mjs +0 -1
  361. package/dist/visibility-Cb62p9bv.mjs +0 -1
  362. package/dist/workflow-BX-FxDb0.mjs +0 -1
  363. package/dist/workflow-worker-DR9qYOFc.mjs +0 -1
  364. /package/dist/{adapter-auth-runtime-DFBLXD5K.mjs → adapter-auth-runtime-DO-FVTXg.mjs} +0 -0
  365. /package/dist/{adapter-binding-Dfk_g-lP.d.mts → adapter-binding-DQchUtrK.d.mts} +0 -0
  366. /package/dist/{ajv-C8r45sFs.mjs → ajv-DD3SIL2i.mjs} +0 -0
  367. /package/dist/{attach-error-DCnzW-Yz.mjs → attach-error-C3tngg6J.mjs} +0 -0
  368. /package/dist/{await-trigger-UceeyCyi.mjs → await-trigger-I3lrepb8.mjs} +0 -0
  369. /package/dist/{base-orchestrator-5yH3l39s.d.mts → base-orchestrator-BilsQNW1.d.mts} +0 -0
  370. /package/dist/{capability-service-BzKBK0n2.mjs → capability-service-BqiLlRGA.mjs} +0 -0
  371. /package/dist/{client-DYEHDiJN.d.mts → client-B--e2qcU.d.mts} +0 -0
  372. /package/dist/{client-binary-version-verifier-C12PvQmz.d.mts → client-binary-version-verifier-CgjM_vGF.d.mts} +0 -0
  373. /package/dist/{client-binary-version-verifier-Dv7TGFxh.mjs → client-binary-version-verifier-taewmKTY.mjs} +0 -0
  374. /package/dist/{clients-namespace-DcFmhtLv.d.mts → clients-namespace-DfxjG2ZP.d.mts} +0 -0
  375. /package/dist/{config-namespace-DmP7NVju.d.mts → config-namespace-BCqvufbD.d.mts} +0 -0
  376. /package/dist/{create-static-mount-BLbqGmva.mjs → create-static-mount-bbQhTt6W.mjs} +0 -0
  377. /package/dist/{cross-spawn-BXxQUsPS.mjs → cross-spawn-B57KZuns.mjs} +0 -0
  378. /package/dist/{cursor-storage-DCj4uUxr.mjs → cursor-storage-DIFK_9hg.mjs} +0 -0
  379. /package/dist/{definition-BEvV7tbD.d.mts → definition-gnKgXU91.d.mts} +0 -0
  380. /package/dist/{definitions-C1pgx0Nq.mjs → definitions-xrrY0wgz.mjs} +0 -0
  381. /package/dist/{descriptor-to-package-VfB8lK5w.mjs → descriptor-to-package-DvF08krT.mjs} +0 -0
  382. /package/dist/{drizzle-oCH9H53q.mjs → drizzle-z_0SiGY8.mjs} +0 -0
  383. /package/dist/{esm-ClQELElL.mjs → esm-CltRnX8_.mjs} +0 -0
  384. /package/dist/{event-BOLVCfhH.mjs → event-CmVjR6Ib.mjs} +0 -0
  385. /package/dist/{extension-discovery-B6p3iZaV.d.mts → extension-discovery-CQRdbVQ6.d.mts} +0 -0
  386. /package/dist/{extension-namespace-vrh4ERXR.mjs → extension-namespace-Yu41YepM.mjs} +0 -0
  387. /package/dist/{facet-DqPBpqkl.mjs → facet-BCI00njh.mjs} +0 -0
  388. /package/dist/{filesystem-service-CGdboor3.d.mts → filesystem-service-CQ9yVkSz.d.mts} +0 -0
  389. /package/dist/{handler-GGOD_ofd.mjs → handler-Cbv9FqDO.mjs} +0 -0
  390. /package/dist/{hook-responses-Dg8wDvRo.d.mts → hook-responses-Dh1PWXqJ.d.mts} +0 -0
  391. /package/dist/{host-BfgdjlII.mjs → host-Caq6ZfSJ.mjs} +0 -0
  392. /package/dist/{identity-BmEHHoBw.mjs → identity-D6guMtmi.mjs} +0 -0
  393. /package/dist/{index-DEchpaya.d.mts → index-BIdsFcQs2.d.mts} +0 -0
  394. /package/dist/{index-DquI_1X5.d.mts → index-BVRQEpAg.d.mts} +0 -0
  395. /package/dist/{index-Brdc35b-.d.mts → index-BaZeoZoS.d.mts} +0 -0
  396. /package/dist/{index-BSmwpgkR.d.mts → index-ByKi34v5.d.mts} +0 -0
  397. /package/dist/{index-oYGf2zIe.d.mts → index-CGZQVTid.d.mts} +0 -0
  398. /package/dist/{index-Chy9aknK.d.mts → index-CMJZ2Z8m.d.mts} +0 -0
  399. /package/dist/{index-Bd1GC1kU2.d.mts → index-CjdRdsd0.d.mts} +0 -0
  400. /package/dist/{index-DYUxNOIX.d.mts → index-Cv-o5Krs.d.mts} +0 -0
  401. /package/dist/{index-DC0yVsYL.d.mts → index-DN4NOCqN2.d.mts} +0 -0
  402. /package/dist/{index-CcsJnJOD.d.mts → index-DR40QWlw.d.mts} +0 -0
  403. /package/dist/{index-BG9-vQHD.d.mts → index-DZunhZec.d.mts} +0 -0
  404. /package/dist/{index-BsBvs0aK.d.mts → index-DjgLchuQ.d.mts} +0 -0
  405. /package/dist/{index-pgYFJ5h6.d.mts → index-Dm1nUxCF.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-CI313bRv.d.mts → namespace-Dkod-w11.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-BSXHdCVh2.d.mts → namespace-tGRAod3o.d.mts} +0 -0
  434. /package/dist/{orchestrator-shared-BB6j8ezL.d.mts → orchestrator-shared-BHCv-l2O.d.mts} +0 -0
  435. /package/dist/{out-CFkI17mk.mjs → out-CvjtANXN.mjs} +0 -0
  436. /package/dist/{packages-DeIgn0Hn.d.mts → packages-BZ6pzFIq.d.mts} +0 -0
  437. /package/dist/{platform-CWhGFQFX.mjs → platform-Bv8llU9c.mjs} +0 -0
  438. /package/dist/{providers-CUnrif24.mjs → providers-Co5UszRH.mjs} +0 -0
  439. /package/dist/{providers-namespace-sPbGcZ6I.d.mts → providers-namespace-DjFkmvBR.d.mts} +0 -0
  440. /package/dist/{quick-lru-CTBjxfgD.mjs → quick-lru-CrOpWwrf.mjs} +0 -0
  441. /package/dist/{schema-cus0dJ81.mjs → schema-Db-y-09L.mjs} +0 -0
  442. /package/dist/{schema-introspection-BsWLmoFp.mjs → schema-introspection-DgWQCpwx.mjs} +0 -0
  443. /package/dist/{schemas-DYvvMd3c.d.mts → schemas-B1NWNASS.d.mts} +0 -0
  444. /package/dist/{schemas-CMyv7l7-.mjs → schemas-BGExwp3j.mjs} +0 -0
  445. /package/dist/{schemas-Dmij0PIc.d.mts → schemas-BO7uOum6.d.mts} +0 -0
  446. /package/dist/{schemas-BGS9RfqV.mjs → schemas-Bfxskx_2.mjs} +0 -0
  447. /package/dist/{schemas-BKKpQC4X2.d.mts → schemas-BtZqovRH.d.mts} +0 -0
  448. /package/dist/{schemas-BAvt2HDy.d.mts → schemas-CQyRBqD6.d.mts} +0 -0
  449. /package/dist/{schemas-D55eXBgl.d.mts → schemas-CR8hSqTy.d.mts} +0 -0
  450. /package/dist/{schemas-CWxf_Yut.mjs → schemas-CqRm0i9a.mjs} +0 -0
  451. /package/dist/{schemas-CiWCNQ9a2.d.mts → schemas-CwbYk_kZ.d.mts} +0 -0
  452. /package/dist/{schemas-CbMWN9-z.d.mts → schemas-DuIlOWR3.d.mts} +0 -0
  453. /package/dist/{schemas-B4FyOOJj.d.mts → schemas-miYxK_Z1.d.mts} +0 -0
  454. /package/dist/{semver-D3Y7uMEb.mjs → semver-DlM8znk4.mjs} +0 -0
  455. /package/dist/{server-lifecycle-C-3OgoKi.d.mts → server-lifecycle-Dsq56aqC.d.mts} +0 -0
  456. /package/dist/{server-lifecycle-DV6NMsgH.mjs → server-lifecycle-kmQ5PUDv.mjs} +0 -0
  457. /package/dist/{shared-schemas-BNCPgGYP.mjs → shared-schemas-DXwyMCwZ.mjs} +0 -0
  458. /package/dist/{src-ftBp6GpR.mjs → src-CCu8TwL6.mjs} +0 -0
  459. /package/dist/{storage-namespace-B1GI4elv.mjs → storage-namespace-BSrv0vXR.mjs} +0 -0
  460. /package/dist/{storage-namespace-definition-V8sc3drq.d.mts → storage-namespace-definition-BvlX0QV_.d.mts} +0 -0
  461. /package/dist/{storage-namespace-definition-4UYuij1r.mjs → storage-namespace-definition-CkMKt7-I.mjs} +0 -0
  462. /package/dist/{storage-namespace-9N9R61pI.d.mts → storage-namespace-dfywhXR3.d.mts} +0 -0
  463. /package/dist/{supports-color-DwW9N6YC.mjs → supports-color-DUugCQsK.mjs} +0 -0
  464. /package/dist/{telemetry-B42EMbZt.mjs → telemetry-Pr3oP2rk.mjs} +0 -0
  465. /package/dist/{timeout-CvONPl0l.mjs → timeout-DWDhddRJ.mjs} +0 -0
  466. /package/dist/{tray-menu-service-Dgedanv-.mjs → tray-menu-service-BBLa-Rcv.mjs} +0 -0
  467. /package/dist/{types-DkFvBdIY.d.mts → types-BrcjaNPZ.d.mts} +0 -0
  468. /package/dist/{types-DVLq657Y.d.mts → types-DHmPneIO.d.mts} +0 -0
  469. /package/dist/{types-Bju4dmAg.d.mts → types-b54n1o57.d.mts} +0 -0
  470. /package/dist/{ui-config-B2L3Xgqo.mjs → ui-config-CyCdlns_.mjs} +0 -0
  471. /package/dist/{variant-ByI-RZua.mjs → variant-krjlTdJt.mjs} +0 -0
  472. /package/dist/{window-registry-Qcnvlhp7.d.mts → window-registry-BDnZLPVx.d.mts} +0 -0
  473. /package/dist/{window-registry-DsWnCc8z.mjs → window-registry-I-imZHV_.mjs} +0 -0
@@ -0,0 +1,1056 @@
1
+ import { a as ProviderOperationClaim, i as ProcessBoundProvisionerLossProof, l as ProviderOperationOwnershipRecord, o as ProviderOperationClaimDecision, s as ProviderOperationMutationDecision } from "./provider-operation-Cxoe2SUr.mjs";
2
+ import { BoundedRecoveryEvidence, ProviderAllocationRef, WorkerNodeAllocationLifetime, WorkflowRunResult } from "@makaio/framework/contracts";
3
+
4
+ //#region subsystems/workflow-engine/src/execution-attempt-repository.d.ts
5
+ /**
6
+ * Ordered constant array of every execution attempt lifecycle status.
7
+ *
8
+ * The order is the progression an attempt follows. Declaring the vocabulary
9
+ * once lets an implementation validate a stored status against the same list
10
+ * the type is derived from.
11
+ */
12
+ declare const EXECUTION_ATTEMPT_STATUSES: readonly ["pending", "provisioning", "allocated", "settled"];
13
+ /**
14
+ * Lifecycle status of an execution attempt.
15
+ *
16
+ * - `pending`: attempt created but provider provisioning has not started.
17
+ * - `provisioning`: a provider call is in flight but no allocation is recorded.
18
+ * - `allocated`: a provider has accepted the attempt and recorded an allocation.
19
+ * - `settled`: the attempt has a committed terminal outcome (accepted or failed).
20
+ */
21
+ type ExecutionAttemptStatus = (typeof EXECUTION_ATTEMPT_STATUSES)[number];
22
+ /**
23
+ * Constant array of every way a settled attempt can have reached its terminal
24
+ * state. `null` is deliberately absent: it means "not settled at all", which
25
+ * is the absence of a settlement rather than one of its kinds.
26
+ */
27
+ declare const EXECUTION_ATTEMPT_SETTLEMENT_KINDS: readonly ["outcome", "abandoned", "infrastructure-failure"];
28
+ /**
29
+ * How a settled attempt reached its terminal state.
30
+ *
31
+ * - `outcome`: a worker submitted a workflow result that was accepted.
32
+ * - `infrastructure-failure`: the provider allocation terminated without
33
+ * an acknowledged worker outcome. The workflow run may be retried.
34
+ * - `abandoned`: dispatch ended before allocation, including a positively
35
+ * proven absence recorded through
36
+ * {@link ExecutionAttemptRepository.recordProvisioningAbsent} or a
37
+ * process-bound provisioner loss recorded through
38
+ * {@link ExecutionAttemptRepository.recordProvisionerIncarnationLost}.
39
+ *
40
+ * `null` when the attempt has not yet settled.
41
+ */
42
+ type ExecutionAttemptSettlementKind = (typeof EXECUTION_ATTEMPT_SETTLEMENT_KINDS)[number] | null;
43
+ /**
44
+ * Compare two provider allocation references as values.
45
+ *
46
+ * `providerData` is an opaque provider-owned record, so equality is over the
47
+ * canonical serialization rather than over a literal one: two references are
48
+ * the same reference when they carry the same members with the same values,
49
+ * whatever order those members happen to be in. Array order stays significant,
50
+ * because array position is part of the value.
51
+ * @param stored - Reference the attempt currently holds.
52
+ * @param candidate - Reference the caller presented.
53
+ * @returns `true` when the two denote the same allocation reference.
54
+ */
55
+ declare function sameAllocationRef(stored: ProviderAllocationRef, candidate: ProviderAllocationRef): boolean;
56
+ /**
57
+ * Compare two terminal workflow results as values.
58
+ *
59
+ * The rule {@link sameAllocationRef} states, for the same reason: a result may
60
+ * carry caller-authored data whose key order is incidental, and a replay of the
61
+ * identical result must be reported as `duplicate` by every realization.
62
+ * @param committed - Result already committed for the attempt.
63
+ * @param candidate - Result the caller presented.
64
+ * @returns `true` when the two denote the same terminal result.
65
+ */
66
+ declare function sameWorkflowResult(committed: WorkflowRunResult, candidate: WorkflowRunResult): boolean;
67
+ /**
68
+ * Rejection of an attempt identifier that already names a durable attempt.
69
+ *
70
+ * Named so that every realization reports the same failure for the same cause,
71
+ * and so a caller can tell a reused identifier apart from a storage fault
72
+ * without matching on message text. A realization that detects the collision
73
+ * through a unique-constraint violation rather than a prior read translates
74
+ * that violation into this error before it leaves
75
+ * {@link ExecutionAttemptRepository.createAttempt}.
76
+ */
77
+ declare class DuplicateExecutionAttemptError extends Error {
78
+ /** Attempt identifier that already exists. */
79
+ readonly executionAttemptId: string;
80
+ /**
81
+ * @param executionAttemptId - Attempt identifier that already exists.
82
+ * @param options - Standard error options, carrying the driver failure as `cause` where one exists.
83
+ */
84
+ constructor(executionAttemptId: string, options?: ErrorOptions);
85
+ }
86
+ /**
87
+ * Durable record for one execution attempt.
88
+ *
89
+ * Produced by the injected {@link ExecutionAttemptRepository} and consumed by
90
+ * the Authority service. All fields are JSON-safe and contain no secrets.
91
+ */
92
+ interface ExecutionAttemptRecord {
93
+ /** Authority-created attempt identifier. */
94
+ readonly executionAttemptId: string;
95
+ /** Workflow execution identifier this attempt belongs to. */
96
+ readonly executionId: string;
97
+ /** Current lifecycle status of the attempt. */
98
+ readonly status: ExecutionAttemptStatus;
99
+ /** Provider allocation reference, set after allocation recording. */
100
+ readonly allocationRef: ProviderAllocationRef | null;
101
+ /** ISO-8601 timestamp when the attempt was created. */
102
+ readonly createdAt: string;
103
+ /**
104
+ * Provider bound to this attempt, or `null` before provisioning began.
105
+ *
106
+ * Written exactly once, atomically, by the first successful
107
+ * {@link ExecutionAttemptRepository.beginProvisioning}. It never changes
108
+ * afterwards: an attempt belongs to one provider for its whole life, and a
109
+ * different provider means a different attempt.
110
+ */
111
+ readonly providerId: string | null;
112
+ /**
113
+ * Allocation lifetime declared by the bound provider, or `null` before
114
+ * provisioning began.
115
+ *
116
+ * Immutable alongside {@link providerId}. Remediation reads it to decide
117
+ * whether losing the provisioning process also loses the allocation.
118
+ */
119
+ readonly allocationLifetime: WorkerNodeAllocationLifetime | null;
120
+ /**
121
+ * Provisioner process incarnation that performed the provider call, or
122
+ * `null` before provisioning began.
123
+ *
124
+ * Immutable alongside {@link providerId}. Process-loss proof is accepted
125
+ * only when it names exactly this incarnation.
126
+ */
127
+ readonly provisionerIncarnationId: string | null;
128
+ /**
129
+ * How this attempt reached its terminal state.
130
+ *
131
+ * `null` while the attempt is `pending`, `provisioning`, or `allocated`. Set to `'outcome'`
132
+ * when a worker outcome is committed, or `'infrastructure-failure'` when
133
+ * the provider allocation terminated without an acknowledged outcome, or
134
+ * `'abandoned'` when dispatch ends before allocation or absence is proven.
135
+ */
136
+ readonly settlementKind?: ExecutionAttemptSettlementKind;
137
+ /**
138
+ * Whether this attempt is eligible for bootstrap claims.
139
+ *
140
+ * Set to `true` when the active attempt is allocated and a recovery-capable
141
+ * provider is assigned. Cleared when the attempt settles or is replaced.
142
+ * An attempt that is no longer the active attempt for its execution never
143
+ * becomes bootstrap-claimable, even when remediation records an allocation
144
+ * for it.
145
+ */
146
+ readonly claimable?: boolean;
147
+ /**
148
+ * ISO-8601 timestamp after which claim eligibility expires.
149
+ *
150
+ * `null` when claim eligibility has no expiry or the attempt is not
151
+ * claimable, which is what {@link ExecutionAttemptRepository.createAttempt}
152
+ * establishes.
153
+ *
154
+ * The host application owns claim expiry outright: no transition on this
155
+ * port ever writes this field. The host sets it through whatever path
156
+ * issues its bootstrap claims, and the port's obligations are to preserve
157
+ * it across every transition, report it on every read, and honour it in
158
+ * {@link ExecutionAttemptRecoveryOperations.getRecoverableAttempts}. An
159
+ * implementation that reset it during an unrelated transition would extend
160
+ * a claim window the host had already closed.
161
+ */
162
+ readonly claimExpiresAt?: string | null;
163
+ }
164
+ /**
165
+ * An allocated attempt that is eligible for recovery.
166
+ *
167
+ * Guarantees that `allocationRef` is non-null, status is `'allocated'`,
168
+ * the attempt has not settled, and the immutable provider binding is
169
+ * populated. Used as the return type of
170
+ * {@link ExecutionAttemptRecoveryOperations.getRecoverableAttempts} to give
171
+ * callers a narrowed type without runtime re-checks.
172
+ */
173
+ interface RecoverableAttemptRecord extends ExecutionAttemptRecord {
174
+ /** Always `'allocated'` for recoverable attempts. */
175
+ readonly status: 'allocated';
176
+ /** Always non-null for recoverable attempts. */
177
+ readonly allocationRef: ProviderAllocationRef;
178
+ /** Always `true` for recoverable attempts. */
179
+ readonly claimable: true;
180
+ /** Always `null` for recoverable attempts (not yet settled). */
181
+ readonly settlementKind: null;
182
+ /** Always bound for recoverable attempts. */
183
+ readonly providerId: string;
184
+ /** Always bound for recoverable attempts. */
185
+ readonly allocationLifetime: WorkerNodeAllocationLifetime;
186
+ /** Always bound for recoverable attempts. */
187
+ readonly provisionerIncarnationId: string;
188
+ }
189
+ /**
190
+ * Input for creating a new execution attempt.
191
+ *
192
+ * The Authority generates `executionAttemptId` before calling this method.
193
+ */
194
+ interface ExecutionAttemptCreate {
195
+ /** Authority-created attempt identifier. */
196
+ readonly executionAttemptId: string;
197
+ /** Workflow execution identifier. */
198
+ readonly executionId: string;
199
+ }
200
+ /**
201
+ * Input for claiming the provisioning phase of an attempt.
202
+ *
203
+ * Carries both the immutable provider binding written by the first successful
204
+ * begin and the host-owned initial claim context. The repository writes them
205
+ * in one transaction, so an attempt can never be bound to a provider without
206
+ * an owned operation, or vice versa.
207
+ */
208
+ interface BeginProvisioningInput {
209
+ /** Attempt whose provider call is about to begin. */
210
+ readonly executionAttemptId: string;
211
+ /** Workflow execution identifier the attempt must belong to. */
212
+ readonly executionId: string;
213
+ /** Provider to bind to the attempt, immutably. */
214
+ readonly providerId: string;
215
+ /** Allocation lifetime declared by that provider, immutably. */
216
+ readonly allocationLifetime: WorkerNodeAllocationLifetime;
217
+ /** Provisioner process incarnation performing the call, immutably. */
218
+ readonly provisionerIncarnationId: string;
219
+ /** Controller process incarnation that will hold the initial claim. */
220
+ readonly ownerId: string;
221
+ /** ISO-8601 deadline for the initial lease. */
222
+ readonly leaseExpiresAt: string;
223
+ }
224
+ /**
225
+ * Input for committing a terminal outcome to an attempt.
226
+ *
227
+ * The repository makes the durable accept/duplicate/conflict/fence decision
228
+ * and returns the canonical outcome for convergence. Outcome commitment
229
+ * carries no claim: a worker's answer never depends on who currently owns
230
+ * the attempt's provider operation.
231
+ */
232
+ interface ExecutionAttemptOutcomeCommit {
233
+ /** Authority-created attempt identifier. */
234
+ readonly executionAttemptId: string;
235
+ /** Workflow execution identifier. */
236
+ readonly executionId: string;
237
+ /** Terminal workflow result to commit. */
238
+ readonly result: WorkflowRunResult;
239
+ }
240
+ /** Input for extending the lease of a currently held provider operation. */
241
+ interface RenewProviderOperationClaimInput {
242
+ /** Claim the caller currently believes it holds. */
243
+ readonly claim: ProviderOperationClaim;
244
+ /** New ISO-8601 lease deadline. */
245
+ readonly leaseExpiresAt: string;
246
+ }
247
+ /**
248
+ * Input for taking ownership of an unowned or expired provider operation.
249
+ *
250
+ * Takeover needs no prior claim — that is the point. It succeeds only when
251
+ * the operation is unowned or its lease has expired relative to `observedAt`,
252
+ * and it always increments the generation so every claim issued before it is
253
+ * fenced immediately.
254
+ */
255
+ interface TakeOverProviderOperationInput {
256
+ /** Attempt whose provider operation is being taken over. */
257
+ readonly executionAttemptId: string;
258
+ /** Controller process incarnation requesting ownership. */
259
+ readonly ownerId: string;
260
+ /** ISO-8601 observation time used to evaluate lease expiry. */
261
+ readonly observedAt: string;
262
+ /** ISO-8601 deadline for the new lease. */
263
+ readonly leaseExpiresAt: string;
264
+ }
265
+ /**
266
+ * Input for releasing a held provider operation without resolving it.
267
+ *
268
+ * Handoff is a graceful release, not a failure: optional evidence explains
269
+ * why control was released but does not count towards the failure total.
270
+ */
271
+ interface HandoffProviderOperationInput {
272
+ /** Claim being released. */
273
+ readonly claim: ProviderOperationClaim;
274
+ /** Optional bounded evidence explaining the release. */
275
+ readonly evidence?: BoundedRecoveryEvidence;
276
+ }
277
+ /**
278
+ * Input for recording that a provider observation stayed inconclusive.
279
+ *
280
+ * Uncertainty is the only honest record for an ambiguous provider result. It
281
+ * retains the current obligation and never terminalizes the attempt.
282
+ */
283
+ interface RecordProviderOperationUncertaintyInput {
284
+ /** Claim authorizing the record. */
285
+ readonly claim: ProviderOperationClaim;
286
+ /** Bounded evidence describing what blocked a conclusion. */
287
+ readonly evidence: BoundedRecoveryEvidence;
288
+ }
289
+ /** Input for recording an allocation reference against a held operation. */
290
+ interface RecordAllocationInput {
291
+ /** Claim authorizing the record. */
292
+ readonly claim: ProviderOperationClaim;
293
+ /**
294
+ * Validated, JSON-safe provider allocation reference.
295
+ *
296
+ * Its `providerId` must equal the attempt's immutable `providerId`. An
297
+ * attempt belongs to one provider for its whole life, so a reference naming
298
+ * a different one cannot describe this attempt's infrastructure, and storing
299
+ * it would durably point remediation at a provider that never allocated
300
+ * anything for it.
301
+ */
302
+ readonly allocationRef: ProviderAllocationRef;
303
+ }
304
+ /**
305
+ * Input for recording positively proven absence of any allocation.
306
+ *
307
+ * `executionId` is an ownership consistency check — the attempt must belong
308
+ * to the named execution. It is deliberately not an active-attempt fence:
309
+ * an open operation stays remediable after its attempt is superseded.
310
+ */
311
+ interface RecordProvisioningAbsentInput {
312
+ /** Claim authorizing the record. */
313
+ readonly claim: ProviderOperationClaim;
314
+ /** Workflow execution identifier the attempt must belong to. */
315
+ readonly executionId: string;
316
+ /** Bounded evidence supporting the absence claim. */
317
+ readonly evidence: BoundedRecoveryEvidence;
318
+ }
319
+ /**
320
+ * Input for closing pre-allocation debt on proven provisioner-process loss.
321
+ *
322
+ * `executionId` is an ownership consistency check, exactly as it is for
323
+ * {@link RecordProvisioningAbsentInput}. The proof is passed whole rather than
324
+ * decomposed, so an implementation cannot accept an incarnation identifier
325
+ * without the bounded evidence that supports it.
326
+ */
327
+ interface RecordProvisionerIncarnationLostInput {
328
+ /** Claim authorizing the record. */
329
+ readonly claim: ProviderOperationClaim;
330
+ /** Workflow execution identifier the attempt must belong to. */
331
+ readonly executionId: string;
332
+ /** Proof that a specific provisioner process incarnation is gone. */
333
+ readonly proof: ProcessBoundProvisionerLossProof;
334
+ }
335
+ /** Input for recording confirmed termination of a known allocation. */
336
+ interface RecordAllocationTerminatedInput {
337
+ /** Claim authorizing the record. */
338
+ readonly claim: ProviderOperationClaim;
339
+ /** Bounded evidence supporting the termination claim. */
340
+ readonly evidence: BoundedRecoveryEvidence;
341
+ }
342
+ /**
343
+ * Input for settling an allocated attempt as an infrastructure failure.
344
+ *
345
+ * `executionId` is an ownership consistency check, not an active-attempt
346
+ * fence.
347
+ */
348
+ interface RecordInfrastructureFailureInput {
349
+ /** Claim authorizing the settlement. */
350
+ readonly claim: ProviderOperationClaim;
351
+ /** Workflow execution identifier the attempt must belong to. */
352
+ readonly executionId: string;
353
+ }
354
+ /**
355
+ * Input for a compare-and-set evolution of an allocation reference.
356
+ *
357
+ * Used when provider correlation updates the reference after initial
358
+ * allocation (for example when a hosted runner's run and job identity only
359
+ * become known after the dispatch call has already returned).
360
+ *
361
+ * The repository must verify that `currentRef` matches the stored
362
+ * allocation reference for the claimed attempt. If it does not match,
363
+ * the evolution is rejected to prevent lost updates.
364
+ */
365
+ interface AllocationRefEvolution {
366
+ /** Claim authorizing the evolution. */
367
+ readonly claim: ProviderOperationClaim;
368
+ /** Workflow execution identifier the attempt must belong to. */
369
+ readonly executionId: string;
370
+ /**
371
+ * The allocation reference the caller believes is currently stored.
372
+ *
373
+ * Compared against the stored reference by {@link sameAllocationRef}, and
374
+ * that comparison alone decides whether the evolution is permitted. A
375
+ * realization may additionally guard its write on the stored row being
376
+ * unchanged since it read — that is a concurrency guard over its own
377
+ * storage, and it answers a different question than the one the caller is
378
+ * owed a decision about.
379
+ */
380
+ readonly currentRef: ProviderAllocationRef;
381
+ /** The new allocation reference to store if the CAS check passes. */
382
+ readonly nextRef: ProviderAllocationRef;
383
+ }
384
+ /**
385
+ * Durable decision for claiming provider provisioning ownership.
386
+ *
387
+ * `started` alone authorizes a provider call, and it carries the only claim
388
+ * that can authorize the provider-side records which follow. Every other
389
+ * decision denies a new call because provisioning already began, or the
390
+ * attempt is allocated, resolved, superseded, or unknown.
391
+ *
392
+ * - `started`: this caller now owns the operation and may call the provider.
393
+ * - `already-provisioning`: a begin already succeeded for this attempt. The
394
+ * caller must converge the existing operation instead of calling again.
395
+ * - `allocated`: an allocation is already recorded for this attempt.
396
+ * - `resolved`: the attempt has settled; the operation is closed.
397
+ * - `fenced`: the attempt exists but is no longer the active attempt for its
398
+ * execution, so it may not bootstrap a new provider call.
399
+ * - `not-found`: no such attempt for the given execution.
400
+ */
401
+ type ProvisioningClaimDecision = {
402
+ readonly kind: 'started';
403
+ readonly claim: ProviderOperationClaim;
404
+ } | {
405
+ readonly kind: 'already-provisioning';
406
+ } | {
407
+ readonly kind: 'allocated';
408
+ readonly allocationRef: ProviderAllocationRef;
409
+ } | {
410
+ readonly kind: 'resolved';
411
+ readonly allocationRef: ProviderAllocationRef | null;
412
+ } | {
413
+ readonly kind: 'fenced';
414
+ } | {
415
+ readonly kind: 'not-found';
416
+ };
417
+ /**
418
+ * Durable decision for recording an allocation reference.
419
+ *
420
+ * `recorded` and `duplicate` confirm that the caller owns `allocationRef`.
421
+ * Every other decision denies ownership and carries an existing reference when
422
+ * one exists, preserving durable evidence for diagnostics and reconciliation.
423
+ *
424
+ * - `recorded`: the reference was stored and the operation now owns the
425
+ * allocation.
426
+ * - `duplicate`: a reference {@link sameAllocationRef} judges identical was
427
+ * already stored; this is a replay.
428
+ * - `conflict`: a different reference is already stored for this attempt.
429
+ * - `resolved`: the attempt has settled; the operation is closed.
430
+ * - `stale`: the claim no longer matches durable ownership.
431
+ * - `not-found`: no provider operation exists for the attempt.
432
+ */
433
+ type AllocationRecordingDecision = {
434
+ readonly kind: 'recorded';
435
+ } | {
436
+ readonly kind: 'duplicate';
437
+ readonly allocationRef: ProviderAllocationRef;
438
+ } | {
439
+ readonly kind: 'conflict';
440
+ readonly allocationRef: ProviderAllocationRef;
441
+ } | {
442
+ readonly kind: 'resolved';
443
+ readonly allocationRef: ProviderAllocationRef | null;
444
+ } | {
445
+ readonly kind: 'stale';
446
+ } | {
447
+ readonly kind: 'not-found';
448
+ };
449
+ /**
450
+ * Durable decision for recording an allocation found by provider discovery.
451
+ *
452
+ * Shares the vocabulary of {@link AllocationRecordingDecision} because the
453
+ * outcomes are the same; the two differ in effect, not in reporting. A
454
+ * discovered allocation never makes its attempt bootstrap-claimable.
455
+ */
456
+ type DiscoveredAllocationDecision = AllocationRecordingDecision;
457
+ /**
458
+ * Durable decision for recording positively proven pre-allocation absence.
459
+ *
460
+ * - `recorded`: absence evidence was stored, the attempt settled as
461
+ * `abandoned`, and the operation closed — all in one transaction.
462
+ * - `allocated`: an allocation won the race. Absence must never terminalize
463
+ * an attempt that owns live infrastructure.
464
+ * - `resolved`: the attempt has already settled; the operation is closed.
465
+ * - `stale`: the claim no longer matches durable ownership.
466
+ * - `not-found`: no provider operation exists for the attempt.
467
+ */
468
+ type ProvisioningAbsenceDecision = {
469
+ readonly kind: 'recorded';
470
+ } | {
471
+ readonly kind: 'allocated';
472
+ readonly allocationRef: ProviderAllocationRef;
473
+ } | {
474
+ readonly kind: 'resolved';
475
+ } | {
476
+ readonly kind: 'stale';
477
+ } | {
478
+ readonly kind: 'not-found';
479
+ };
480
+ /**
481
+ * Durable decision for closing pre-allocation debt on proven loss of the
482
+ * provisioner process incarnation.
483
+ *
484
+ * The counterpart of {@link ProvisioningAbsenceDecision} for the one lifetime
485
+ * where nothing needs to be observed to conclude: a
486
+ * `provisioner-process-bound` allocation cannot outlive the process that
487
+ * created it, so proof that the exact recorded incarnation is gone is proof
488
+ * that no allocation survives. Every refusal below is a statement about why the
489
+ * proof does not apply, and each is reported distinctly because they oblige the
490
+ * caller to do different things.
491
+ *
492
+ * - `recorded`: the proof was stored, the attempt settled as `abandoned`, and
493
+ * the operation closed — all in one transaction.
494
+ * - `not-process-bound`: the attempt's recorded lifetime is not
495
+ * `provisioner-process-bound`, so losing a process says nothing about its
496
+ * allocation. The reported lifetime is the stored one, `null` before
497
+ * provisioning began.
498
+ * - `incarnation-mismatch`: the proof names a different provisioner
499
+ * incarnation, or the attempt has none recorded, so the proof says nothing
500
+ * about this attempt. The reported identifier is the stored one.
501
+ * - `allocated`: an allocation is already recorded, so the attempt owes
502
+ * allocation control rather than pre-allocation closure. Terminate the known
503
+ * allocation instead of closing the attempt from a proof.
504
+ * - `resolved`: the attempt has already settled; the operation is closed.
505
+ * - `stale`: the claim no longer matches durable ownership.
506
+ * - `not-found`: no provider operation exists for the attempt, or it does not
507
+ * belong to the named execution.
508
+ */
509
+ type ProvisionerIncarnationLossDecision = {
510
+ readonly kind: 'recorded';
511
+ } | {
512
+ readonly kind: 'not-process-bound';
513
+ readonly allocationLifetime: WorkerNodeAllocationLifetime | null;
514
+ } | {
515
+ readonly kind: 'incarnation-mismatch';
516
+ readonly provisionerIncarnationId: string | null;
517
+ } | {
518
+ readonly kind: 'allocated';
519
+ readonly allocationRef: ProviderAllocationRef;
520
+ } | {
521
+ readonly kind: 'resolved';
522
+ } | {
523
+ readonly kind: 'stale';
524
+ } | {
525
+ readonly kind: 'not-found';
526
+ };
527
+ /**
528
+ * Durable decision for settling an allocated attempt as an infrastructure
529
+ * failure.
530
+ *
531
+ * This terminal CAS competes with outcome submission; the first durable
532
+ * transition wins and the loser observes `resolved`.
533
+ *
534
+ * - `recorded`: the failure was persisted, the attempt settled, and the
535
+ * operation closed.
536
+ * - `resolved`: the attempt already has a terminal settlement.
537
+ * - `not-allocated`: the attempt owns no allocation, so it cannot have
538
+ * suffered an infrastructure failure. Prove absence instead.
539
+ * - `not-terminated`: the attempt owns an allocation whose termination has not
540
+ * been confirmed, so the operation still owes `allocation-control`. Confirm
541
+ * the termination through {@link ExecutionAttemptRepository.recordAllocationTerminated}
542
+ * first. Reported distinctly from `stale` for the same reason
543
+ * {@link AllocationTerminationDecision} separates the two: the caller's
544
+ * authority is current, and what it must do next is supply the missing
545
+ * transition rather than re-read ownership.
546
+ * - `stale`: the claim no longer matches durable ownership.
547
+ * - `not-found`: no provider operation exists for the attempt.
548
+ */
549
+ type InfrastructureFailureDecision = {
550
+ readonly kind: 'recorded';
551
+ } | {
552
+ readonly kind: 'resolved';
553
+ } | {
554
+ readonly kind: 'not-allocated';
555
+ } | {
556
+ readonly kind: 'not-terminated';
557
+ } | {
558
+ readonly kind: 'stale';
559
+ } | {
560
+ readonly kind: 'not-found';
561
+ };
562
+ /**
563
+ * Durable decision for recording confirmed termination of a known allocation.
564
+ *
565
+ * It extends the shared mutation vocabulary with the one refusal that is not a
566
+ * staleness signal. `stale` says the caller's authority is gone and it must
567
+ * re-read; `not-allocated` says the caller's authority is current and the
568
+ * operation simply owns nothing to terminate. Collapsing the two would let a
569
+ * fenced controller mistake itself for a current one with no allocation, and
570
+ * choose a write path on that mistake.
571
+ *
572
+ * - `recorded`: the obligation advanced to `terminal-convergence`.
573
+ * - `not-allocated`: the claim is current, but no allocation is known for the
574
+ * attempt. Prove absence instead of claiming termination.
575
+ * - `stale`: the claim no longer matches durable ownership.
576
+ * - `resolved`: the attempt has settled, so the operation is closed.
577
+ * - `not-found`: no provider operation exists for the attempt.
578
+ */
579
+ type AllocationTerminationDecision = ProviderOperationMutationDecision | {
580
+ readonly kind: 'not-allocated';
581
+ };
582
+ /**
583
+ * Durable decision for a compare-and-set allocation reference evolution.
584
+ *
585
+ * - `evolved`: the reference was successfully updated.
586
+ * - `stale`: the caller's view is out of date — either `currentRef` does not
587
+ * match the stored reference, or the claim no longer matches durable
588
+ * ownership. `storedRef` carries the current reference when one exists.
589
+ * - `resolved`: the attempt has settled; the operation is closed.
590
+ * - `not-allocated`: the attempt has no allocation to evolve.
591
+ * - `not-found`: no provider operation exists for the attempt.
592
+ */
593
+ type AllocationRefEvolutionDecision = {
594
+ readonly kind: 'evolved';
595
+ } | {
596
+ readonly kind: 'stale';
597
+ readonly storedRef: ProviderAllocationRef | null;
598
+ } | {
599
+ readonly kind: 'resolved';
600
+ } | {
601
+ readonly kind: 'not-allocated';
602
+ } | {
603
+ readonly kind: 'not-found';
604
+ };
605
+ /** Durable decision for an attempt that failed before provider provisioning began. */
606
+ type PendingAttemptAbandonmentDecision = {
607
+ readonly kind: 'abandoned';
608
+ } | {
609
+ readonly kind: 'already-abandoned';
610
+ } | {
611
+ readonly kind: 'already-settled';
612
+ } | {
613
+ readonly kind: 'allocated';
614
+ } | {
615
+ readonly kind: 'provisioning';
616
+ } | {
617
+ readonly kind: 'fenced';
618
+ };
619
+ /**
620
+ * Durable outcome decision returned by {@link ExecutionAttemptRepository.commitOutcome}.
621
+ *
622
+ * - `accepted`: the outcome was committed as canonical for the first time.
623
+ * - `duplicate`: an outcome {@link sameWorkflowResult} judges identical to the
624
+ * committed one was submitted again; this is a replay. The committed outcome
625
+ * is reported, never the caller's copy of it.
626
+ * - `conflict`: the attempt already reached a different terminal state — either
627
+ * a different committed outcome, or a competing terminal transition that
628
+ * settled it without one.
629
+ * - `fenced`: the attempt is no longer the active attempt for this execution.
630
+ */
631
+ type ExecutionAttemptOutcomeDecision = {
632
+ readonly kind: 'accepted';
633
+ readonly outcome: WorkflowRunResult;
634
+ } | {
635
+ readonly kind: 'duplicate';
636
+ readonly outcome: WorkflowRunResult;
637
+ } | {
638
+ readonly kind: 'conflict';
639
+ } | {
640
+ readonly kind: 'fenced';
641
+ };
642
+ /**
643
+ * Passive injected port for durable execution attempt persistence.
644
+ *
645
+ * The consuming host application owns the concrete implementation and all
646
+ * durable decisions. The Authority service calls through this port but never
647
+ * owns the underlying tables or storage.
648
+ *
649
+ * The port owns two related records per attempt: canonical attempt state, and
650
+ * the fenced provider operation that tracks who may act on the attempt's
651
+ * infrastructure. Two rules follow from that split and bind every
652
+ * implementation:
653
+ *
654
+ * 1. **The state machine is repository-owned.** No mutation accepts an
655
+ * obligation, and no caller can choose one. The stored obligation moves
656
+ * only along the transitions below, never backwards:
657
+ *
658
+ * ```text
659
+ * begin => provisioning-resolution
660
+ * record allocation/discovery => allocation-control
661
+ * record confirmed absence => settled(abandoned) + operation closed
662
+ * prove provisioner loss => settled(abandoned) + operation closed
663
+ * record termination => terminal-convergence
664
+ * infrastructure failure CAS => settled(infrastructure-failure) + closed
665
+ * uncertainty => retain current obligation
666
+ * ```
667
+ *
668
+ * The two pre-allocation closers are deliberately separate. Confirmed
669
+ * absence is a provider's positive conclusion that nothing was created;
670
+ * proven provisioner loss is a host's positive conclusion that nothing
671
+ * survives. Neither is expressible as the other, and neither is implied by
672
+ * an expired lease.
673
+ *
674
+ * The table is also read downwards as a precondition: each transition is
675
+ * reachable only from the obligation the line above it establishes. One
676
+ * case is worth naming because it spans two calls rather than one.
677
+ * {@link recordInfrastructureFailure} is reachable **only** from
678
+ * `terminal-convergence`, so an allocated attempt reaches
679
+ * `settled(infrastructure-failure)` exclusively by first confirming
680
+ * termination through {@link recordAllocationTerminated}. An
681
+ * implementation that settles straight out of `allocation-control` would
682
+ * let a caller assert that infrastructure ended without ever recording the
683
+ * evidence that it did, and the settlement is irreversible.
684
+ *
685
+ * 2. **Provider-side evidence is claim-fenced; workflow outcome is not.**
686
+ * Every provider-side mutation requires the current generation and token.
687
+ * {@link commitOutcome} deliberately requires neither, so a worker can
688
+ * always deliver its canonical answer.
689
+ *
690
+ * An operation stays remediable after its attempt stops being the active
691
+ * attempt for its execution. Claim-fenced discovery, absence, cleanup, and
692
+ * terminal convergence may update such an attempt and close its operation,
693
+ * but must never change which attempt is active, reactivate it, or make it
694
+ * bootstrap-claimable.
695
+ *
696
+ * **Timestamps this port orders are instants, not strings.** Every ISO-8601
697
+ * value the port itself compares or sorts by — lease deadlines, takeover
698
+ * observation times, claim expiry, creation time — is stored canonically UTC
699
+ * with millisecond precision, exactly the form `Date.prototype.toISOString`
700
+ * produces (`YYYY-MM-DDTHH:mm:ss.sssZ`). An implementation normalizes those to
701
+ * that form before storing them, and orders them as instants. A store with
702
+ * native temporal types therefore compares the same way a lexicographic
703
+ * comparison of the canonical form does, and an offset-bearing or
704
+ * second-precision input can never silently mis-order a lease.
705
+ *
706
+ * `BoundedRecoveryEvidence.observedAt` is deliberately outside that rule. The
707
+ * port never orders by it: evidence is retained and reported, never compared.
708
+ * It is a public contract value its producer authored — commonly a provider
709
+ * describing an instant in the zone its own infrastructure reported — and
710
+ * `BoundedRecoveryEvidenceSchema` accepts a numeric offset on purpose. An
711
+ * implementation therefore stores evidence exactly as validated and reports it
712
+ * back verbatim, rewriting no field of it. Normalizing it would silently
713
+ * change a value the producer asserted, and would make two conforming
714
+ * implementations disagree on what a provider said.
715
+ *
716
+ * Durable records carry only JSON-safe, non-secret values: credential
717
+ * references and bounded recovery evidence, never plaintext credentials,
718
+ * stack traces, or raw provider responses.
719
+ *
720
+ * **Input validation precedes every durable decision.** Bounded recovery
721
+ * evidence supplied to a mutation is validated against
722
+ * `BoundedRecoveryEvidenceSchema` before ownership, execution membership, or
723
+ * attempt state is consulted. Evidence that violates the contract is a caller
724
+ * bug, not an outcome, so it is rejected rather than answered with a decision
725
+ * — including when the caller's claim is also stale. Validating after the
726
+ * guards would make the rejection depend on ownership, so the same malformed
727
+ * payload would throw against one implementation and return `stale` from
728
+ * another.
729
+ */
730
+ interface ExecutionAttemptRepository {
731
+ /**
732
+ * Persist a new execution attempt record.
733
+ *
734
+ * Called by the Authority before dispatch. The Authority owns
735
+ * `executionAttemptId` generation; the repository only persists. The new
736
+ * attempt atomically becomes the active attempt for its execution.
737
+ *
738
+ * `executionAttemptId` is unique for all time. Creating an attempt whose
739
+ * identifier already exists is a caller bug and is rejected — never
740
+ * answered with a decision and never applied. There is no correct way to
741
+ * apply it: the identifier may name an attempt that already owns provider
742
+ * infrastructure, a committed outcome, or a terminal settlement, and a
743
+ * fresh `pending` record in its place would discard all three while
744
+ * orphaning the operation beside it.
745
+ *
746
+ * The rejection is a {@link DuplicateExecutionAttemptError}, whichever way
747
+ * the realization detected the collision. Detecting it by reading first and
748
+ * detecting it from a unique-constraint violation are both conforming — the
749
+ * second is the only race-free option on a store that does not serialize
750
+ * writers — but a realization that lets the driver's own error escape would
751
+ * make the same caller bug indistinguishable from a storage fault, and
752
+ * distinguishable only by message text between one realization and another.
753
+ * @param input - Attempt identity to persist.
754
+ * @returns The created attempt record.
755
+ * @throws A {@link DuplicateExecutionAttemptError} when an attempt with the same `executionAttemptId` already exists.
756
+ */
757
+ createAttempt(input: ExecutionAttemptCreate): Promise<ExecutionAttemptRecord>;
758
+ /**
759
+ * Claim the durable provisioning phase immediately before a provider call.
760
+ *
761
+ * This is the sole authorization for invoking a provider, and it succeeds at
762
+ * most once per attempt. The same transaction binds the provider, allocation
763
+ * lifetime, and provisioner incarnation immutably, and opens the attempt's
764
+ * provider operation at generation 1 with a fresh token.
765
+ * @param input - Attempt identity, immutable provider binding, and initial claim context.
766
+ * @returns The durable provisioning ownership decision.
767
+ */
768
+ beginProvisioning(input: BeginProvisioningInput): Promise<ProvisioningClaimDecision>;
769
+ /**
770
+ * Read the current provider operation for an attempt.
771
+ * @param executionAttemptId - Attempt whose operation to read.
772
+ * @returns The ownership record, or `null` when provisioning never began.
773
+ */
774
+ getProviderOperation(executionAttemptId: string): Promise<ProviderOperationOwnershipRecord | null>;
775
+ /**
776
+ * Extend the lease of a currently held provider operation.
777
+ *
778
+ * Preserves the generation and token: renewal is not a new claim, so it
779
+ * cannot fence anyone.
780
+ * @param input - Current claim and the new lease deadline.
781
+ * @returns The durable claim decision.
782
+ */
783
+ renewProviderOperationClaim(input: RenewProviderOperationClaimInput): Promise<ProviderOperationClaimDecision>;
784
+ /**
785
+ * Take ownership of an unowned or lease-expired provider operation.
786
+ *
787
+ * Succeeds only when the operation is unowned or its lease has expired at
788
+ * `observedAt`. On success the generation increments and a fresh token is
789
+ * issued, which fences every previously issued claim immediately. The
790
+ * obligation and accumulated evidence are preserved.
791
+ * @param input - Attempt identity, requesting owner, observation time, and lease deadline.
792
+ * @returns The durable claim decision.
793
+ */
794
+ takeOverProviderOperation(input: TakeOverProviderOperationInput): Promise<ProviderOperationClaimDecision>;
795
+ /**
796
+ * Release a held provider operation without resolving it.
797
+ *
798
+ * Atomically verifies the generation and token, preserves both the
799
+ * generation and the obligation, then clears owner, token, and lease.
800
+ * Clearing the token fences the released claim immediately. Because the
801
+ * record is then unowned, takeover may claim it without waiting for the old
802
+ * lease; that claim increments the generation and receives a new token.
803
+ * @param input - Claim being released and optional bounded release evidence.
804
+ * @returns The durable mutation decision.
805
+ */
806
+ handoffProviderOperation(input: HandoffProviderOperationInput): Promise<ProviderOperationMutationDecision>;
807
+ /**
808
+ * Record that a provider observation stayed inconclusive.
809
+ *
810
+ * Retains the current obligation and increments the bounded failure total.
811
+ * Uncertainty never terminalizes an attempt: an ambiguous provider result
812
+ * is not evidence that nothing was created.
813
+ * @param input - Claim and bounded evidence describing the retained uncertainty.
814
+ * @returns The durable mutation decision.
815
+ */
816
+ recordProviderOperationUncertainty(input: RecordProviderOperationUncertaintyInput): Promise<ProviderOperationMutationDecision>;
817
+ /**
818
+ * Record the provider allocation reference for a claimed operation.
819
+ *
820
+ * Called immediately after a provider successfully provisions a resource.
821
+ * Advances the obligation to `allocation-control` and, for the active
822
+ * attempt, marks it bootstrap-claimable. Idempotent for an identical
823
+ * reference.
824
+ *
825
+ * The implementation verifies, inside the same transaction as the write and
826
+ * before any mutation, that the reference names the attempt's immutable
827
+ * `providerId`. Nothing in {@link AllocationRecordingDecision} can report a
828
+ * foreign reference, so a mismatch is a caller bug and is rejected rather
829
+ * than answered — and rejected whatever the claim's state, exactly as
830
+ * malformed evidence is.
831
+ * @param input - Claim and the validated allocation reference.
832
+ * @returns The durable allocation ownership decision.
833
+ * @throws When the reference names a provider other than the attempt's own.
834
+ */
835
+ recordAllocation(input: RecordAllocationInput): Promise<AllocationRecordingDecision>;
836
+ /**
837
+ * Record positively proven absence of any allocation for the attempt.
838
+ *
839
+ * The atomic terminal CAS for the pre-allocation case: it stores bounded
840
+ * absence evidence, settles the attempt as `abandoned`, and closes the
841
+ * operation in one transaction. It never produces `terminal-convergence` —
842
+ * that obligation is reserved for a known allocation whose termination was
843
+ * already confirmed.
844
+ * @param input - Claim, owning execution, and bounded absence evidence.
845
+ * @returns The durable absence decision.
846
+ */
847
+ recordProvisioningAbsent(input: RecordProvisioningAbsentInput): Promise<ProvisioningAbsenceDecision>;
848
+ /**
849
+ * Close pre-allocation debt on proof that a provisioner incarnation is gone.
850
+ *
851
+ * The atomic terminal CAS for an attempt whose allocation could not have
852
+ * outlived its provisioner. It exists because such an attempt has no other
853
+ * reachable terminal state: its provider need not advertise recovery, so
854
+ * there may be nothing to discover, inspect, or terminate, and
855
+ * {@link abandonPendingAttempt} refuses an attempt that already began
856
+ * provisioning.
857
+ *
858
+ * The implementation verifies, inside the same transaction as the write,
859
+ * that the attempt's stored `allocationLifetime` is
860
+ * `provisioner-process-bound` and that its immutable
861
+ * `provisionerIncarnationId` is exactly the one the proof names. Both are
862
+ * immutable facts written by {@link beginProvisioning}, so this is a
863
+ * statement about the attempt rather than about the caller's view of it. An
864
+ * expired lease can never satisfy either check.
865
+ *
866
+ * On success it stores the proof's bounded evidence, settles the attempt as
867
+ * `abandoned`, and closes the operation in one transaction. `abandoned` is
868
+ * the honest kind: no allocation was ever recorded for the attempt, so it
869
+ * cannot have suffered an infrastructure failure in the sense
870
+ * {@link recordInfrastructureFailure} defines.
871
+ * @param input - Claim, owning execution, and the provisioner loss proof.
872
+ * @returns The durable provisioner-loss decision.
873
+ */
874
+ recordProvisionerIncarnationLost(input: RecordProvisionerIncarnationLostInput): Promise<ProvisionerIncarnationLossDecision>;
875
+ /**
876
+ * Record a confirmed infrastructure failure for an allocated attempt.
877
+ *
878
+ * This terminal CAS competes with outcome submission; the first durable
879
+ * transition wins and the loser receives `resolved`. Pre-allocation
880
+ * conclusions must instead use {@link recordProvisioningAbsent}.
881
+ *
882
+ * It is reachable only from `terminal-convergence`. The implementation
883
+ * verifies the stored obligation inside the settling transaction and refuses
884
+ * an operation that still owes `allocation-control` as `not-terminated`, so
885
+ * the evidence that the allocation ended is always durable before the
886
+ * attempt is settled on the strength of it. That makes
887
+ * {@link recordAllocationTerminated} the single entry to terminal
888
+ * settlement, and it is what lets a pass interrupted between the two retry
889
+ * only the settlement.
890
+ * @param input - Claim and the owning execution.
891
+ * @returns The infrastructure failure decision.
892
+ */
893
+ recordInfrastructureFailure(input: RecordInfrastructureFailureInput): Promise<InfrastructureFailureDecision>;
894
+ /**
895
+ * Record that a known allocation was confirmed terminated.
896
+ *
897
+ * The explicit monotonic transition from `allocation-control` to
898
+ * `terminal-convergence`, and the only way an allocated attempt becomes
899
+ * eligible for {@link recordInfrastructureFailure}. It does not settle the
900
+ * attempt and does not increment the failure total: a successful termination
901
+ * is not a failure. An operation that owns no allocation cannot make this
902
+ * transition and is told so as `not-allocated`, distinctly from a fenced
903
+ * claim.
904
+ * @param input - Claim and bounded evidence supporting the termination.
905
+ * @returns The durable termination decision.
906
+ */
907
+ recordAllocationTerminated(input: RecordAllocationTerminatedInput): Promise<AllocationTerminationDecision>;
908
+ /**
909
+ * Retrieve the active attempt for a given execution.
910
+ *
911
+ * Returns `null` when the attempt does not exist or has been superseded
912
+ * (fenced) by a newer attempt for the same execution.
913
+ * @param executionId - Workflow execution identifier.
914
+ * @param executionAttemptId - Attempt identifier to look up.
915
+ * @returns The attempt record if active, or `null`.
916
+ */
917
+ getActiveAttempt(executionId: string, executionAttemptId: string): Promise<ExecutionAttemptRecord | null>;
918
+ /**
919
+ * Commit a terminal outcome for an attempt.
920
+ *
921
+ * Deliberately claim-independent: a worker's canonical answer never depends
922
+ * on who currently owns the attempt's provider operation. A successful
923
+ * commit settles the attempt and closes its operation.
924
+ *
925
+ * The repository makes the durable decision in exactly this precedence
926
+ * order. An implementation that reorders it is non-conforming, because each
927
+ * step is only reachable once every earlier one has been ruled out:
928
+ *
929
+ * 1. `fenced` — the attempt is no longer the active attempt for its
930
+ * execution. Evaluated first because `accepted` and `duplicate` oblige
931
+ * the caller to converge workflow state, and a superseded attempt must
932
+ * never drive that convergence.
933
+ * 2. `duplicate` / `conflict` — an outcome is already committed for this
934
+ * attempt: `duplicate` when {@link sameWorkflowResult} judges it
935
+ * canonically equal, including member-order-insensitive objects;
936
+ * `conflict` when it differs under that rule.
937
+ * 3. `conflict` — a competing terminal transition already settled the
938
+ * attempt without committing an outcome, that is
939
+ * {@link recordInfrastructureFailure} or
940
+ * {@link recordProvisioningAbsent} or
941
+ * {@link recordProvisionerIncarnationLost}. That transition won the
942
+ * terminal CAS, so a late outcome may neither overwrite its
943
+ * `settlementKind` nor reopen the attempt.
944
+ * 4. `accepted` — the outcome becomes canonical, the attempt settles as
945
+ * `outcome`, and its operation closes.
946
+ * @param input - Attempt identity and terminal result to commit.
947
+ * @returns The durable decision with the canonical outcome when applicable.
948
+ */
949
+ commitOutcome(input: ExecutionAttemptOutcomeCommit): Promise<ExecutionAttemptOutcomeDecision>;
950
+ /**
951
+ * Settle a pending attempt when dispatch cannot continue before provisioning.
952
+ *
953
+ * The operation is fenced and idempotent. `provisioning` and `allocated`
954
+ * mean provisioning already began, so the caller must converge the provider
955
+ * operation instead of abandoning the attempt.
956
+ * @param executionAttemptId - Pending attempt to abandon.
957
+ * @param executionId - Workflow execution identifier.
958
+ * @returns The durable abandonment decision.
959
+ */
960
+ abandonPendingAttempt(executionAttemptId: string, executionId: string): Promise<PendingAttemptAbandonmentDecision>;
961
+ /**
962
+ * Recovery operations, present only on a recovery-capable repository.
963
+ *
964
+ * Absent when the repository serves only non-recoverable providers. The
965
+ * Authority reads this one property to decide whether it may delegate, so a
966
+ * repository is either recovery-capable or it is not — there is no partially
967
+ * recoverable repository to reason about.
968
+ */
969
+ readonly recovery?: ExecutionAttemptRecoveryOperations;
970
+ }
971
+ /**
972
+ * Coherent recovery capability of the execution attempt port.
973
+ *
974
+ * Recovery is one indivisible capability: a repository implements all four
975
+ * operations or none. Partial implementation is a type error because all four
976
+ * are required members of this interface, exactly as they are on the provider
977
+ * side of the same capability.
978
+ *
979
+ * The four exist together because a recovery pass needs all of them: it reads
980
+ * a superseded attempt, records what discovery found for it, refines the
981
+ * reference as correlation narrows it, and lists what is still outstanding. A
982
+ * repository that answered three of them would strand the pass at whichever
983
+ * step it omitted, after that pass had already begun acting on infrastructure.
984
+ */
985
+ interface ExecutionAttemptRecoveryOperations {
986
+ /**
987
+ * Look up an attempt by its identifier, regardless of active status.
988
+ *
989
+ * Unlike {@link ExecutionAttemptRepository.getActiveAttempt}, this returns
990
+ * the attempt even if it has been superseded or settled. Used by recovery
991
+ * flows that need to inspect a specific attempt's allocation state.
992
+ * @param executionAttemptId - The attempt to look up.
993
+ * @returns The attempt record, or `null` if no such attempt exists.
994
+ */
995
+ getAttemptWithAllocation(executionAttemptId: string): Promise<ExecutionAttemptRecord | null>;
996
+ /**
997
+ * Record an allocation that provider discovery found for the attempt.
998
+ *
999
+ * Used when a provider call's acknowledgement was lost and an exhaustive
1000
+ * lookup later found exactly one matching allocation. It advances the
1001
+ * obligation to `allocation-control` exactly like
1002
+ * {@link ExecutionAttemptRepository.recordAllocation}, but never marks the
1003
+ * attempt bootstrap-claimable and never changes which attempt is active:
1004
+ * discovery converges an old attempt, it does not revive it.
1005
+ *
1006
+ * It enforces the same provider binding as
1007
+ * {@link ExecutionAttemptRepository.recordAllocation}, for the same reason: a
1008
+ * discovery answer that names another provider describes somebody else's
1009
+ * infrastructure.
1010
+ * @param input - Claim and the discovered allocation reference.
1011
+ * @returns The durable discovered-allocation decision.
1012
+ * @throws When the reference names a provider other than the attempt's own.
1013
+ */
1014
+ recordDiscoveredAllocation(input: RecordAllocationInput): Promise<DiscoveredAllocationDecision>;
1015
+ /**
1016
+ * Compare-and-set update of the allocation reference for a claimed attempt.
1017
+ *
1018
+ * Used when provider correlation discovers additional identity after the
1019
+ * initial allocation. The `currentRef` must match the stored reference under
1020
+ * {@link sameAllocationRef}; if it does not, the update is rejected as stale
1021
+ * to prevent lost updates from concurrent correlators.
1022
+ *
1023
+ * Both `currentRef` and `nextRef` must share the same `providerId`:
1024
+ * correlation refines one allocation's opaque `providerData`, it never
1025
+ * moves an attempt to a different provider. Nothing in
1026
+ * {@link AllocationRefEvolutionDecision} can report such a request, so a
1027
+ * mismatched pair is a caller bug and is rejected rather than answered.
1028
+ * @param input - Claim, owning execution, and current/next references.
1029
+ * @returns The evolution decision.
1030
+ * @throws When `currentRef` and `nextRef` name different providers.
1031
+ */
1032
+ evolveAllocationRef(input: AllocationRefEvolution): Promise<AllocationRefEvolutionDecision>;
1033
+ /**
1034
+ * List all recoverable (allocated, non-settled) attempts for an execution.
1035
+ *
1036
+ * Returns attempts that have a provider allocation, have not settled
1037
+ * (no committed outcome or infrastructure failure), and are still eligible
1038
+ * for recovery claims. The caller uses these to drive provider inspect and
1039
+ * attach flows.
1040
+ *
1041
+ * Expired claims (past `claimExpiresAt`) are excluded.
1042
+ *
1043
+ * **Ordering is part of the contract:** attempts are returned oldest first,
1044
+ * by `createdAt` as an instant, ties broken by ascending
1045
+ * `executionAttemptId`. Recovery reclaims infrastructure in the order it was
1046
+ * created, and the tiebreak is what keeps two attempts created within the
1047
+ * same millisecond from ordering differently on two stores. An
1048
+ * implementation that returned an arbitrary order would make a caller that
1049
+ * bounds its pass reclaim a different subset on each realization.
1050
+ * @param executionId - Workflow execution identifier.
1051
+ * @returns Allocated, non-settled attempts eligible for recovery, oldest first.
1052
+ */
1053
+ getRecoverableAttempts(executionId: string): Promise<readonly RecoverableAttemptRecord[]>;
1054
+ }
1055
+ //#endregion
1056
+ export { RecoverableAttemptRecord as A, ProvisioningClaimDecision as C, RecordProviderOperationUncertaintyInput as D, RecordInfrastructureFailureInput as E, TakeOverProviderOperationInput as M, sameAllocationRef as N, RecordProvisionerIncarnationLostInput as O, sameWorkflowResult as P, ProvisioningAbsenceDecision as S, RecordAllocationTerminatedInput as T, ExecutionAttemptStatus as _, BeginProvisioningInput as a, PendingAttemptAbandonmentDecision as b, EXECUTION_ATTEMPT_SETTLEMENT_KINDS as c, ExecutionAttemptOutcomeCommit as d, ExecutionAttemptOutcomeDecision as f, ExecutionAttemptSettlementKind as g, ExecutionAttemptRepository as h, AllocationTerminationDecision as i, RenewProviderOperationClaimInput as j, RecordProvisioningAbsentInput as k, EXECUTION_ATTEMPT_STATUSES as l, ExecutionAttemptRecoveryOperations as m, AllocationRefEvolution as n, DiscoveredAllocationDecision as o, ExecutionAttemptRecord as p, AllocationRefEvolutionDecision as r, DuplicateExecutionAttemptError as s, AllocationRecordingDecision as t, ExecutionAttemptCreate as u, HandoffProviderOperationInput as v, RecordAllocationInput as w, ProvisionerIncarnationLossDecision as x, InfrastructureFailureDecision as y };